diff --git a/go.mod b/go.mod index c6646b77..2beaaa60 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/antihax/optional v1.0.0 github.com/fatih/color v1.13.0 github.com/fatih/structs v1.1.0 + github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a github.com/google/uuid v1.3.0 github.com/hashicorp/go-retryablehttp v0.7.2 github.com/manifoldco/promptui v0.9.0 diff --git a/go.sum b/go.sum index b7d0efb6..b97bc0ab 100644 --- a/go.sum +++ b/go.sum @@ -110,6 +110,8 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= +github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a h1:RYfmiM0zluBJOiPDJseKLEN4BapJ42uSi9SZBQ2YyiA= +github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= github.com/gocql/gocql v0.0.0-20190301043612-f6df8288f9b4/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= diff --git a/vendor/github.com/gocarina/gocsv/.gitignore b/vendor/github.com/gocarina/gocsv/.gitignore new file mode 100644 index 00000000..485dee64 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/vendor/github.com/gocarina/gocsv/.travis.yml b/vendor/github.com/gocarina/gocsv/.travis.yml new file mode 100644 index 00000000..61c24c6c --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/.travis.yml @@ -0,0 +1,4 @@ +language: go +arch: + - amd64 + - ppc64le diff --git a/vendor/github.com/gocarina/gocsv/LICENSE b/vendor/github.com/gocarina/gocsv/LICENSE new file mode 100644 index 00000000..052a3711 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Picques + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/gocarina/gocsv/README.md b/vendor/github.com/gocarina/gocsv/README.md new file mode 100644 index 00000000..085f747d --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/README.md @@ -0,0 +1,173 @@ +Go CSV +===== + +The GoCSV package aims to provide easy serialization and deserialization functions to use CSV in Golang + +API and techniques inspired from https://godoc.org/gopkg.in/mgo.v2 + +[![GoDoc](https://godoc.org/github.com/gocarina/gocsv?status.png)](https://godoc.org/github.com/gocarina/gocsv) +[![Build Status](https://travis-ci.org/gocarina/gocsv.svg?branch=master)](https://travis-ci.org/gocarina/gocsv) + +Installation +===== + +```go get -u github.com/gocarina/gocsv``` + +Full example +===== + +Consider the following CSV file + +```csv + +client_id,client_name,client_age +1,Jose,42 +2,Daniel,26 +3,Vincent,32 + +``` + +Easy binding in Go! +--- + +```go + +package main + +import ( + "fmt" + "os" + + "github.com/gocarina/gocsv" +) + +type NotUsed struct { + Name string +} + +type Client struct { // Our example struct, you can use "-" to ignore a field + Id string `csv:"client_id"` + Name string `csv:"client_name"` + Age string `csv:"client_age"` + NotUsedString string `csv:"-"` + NotUsedStruct NotUsed `csv:"-"` +} + +func main() { + clientsFile, err := os.OpenFile("clients.csv", os.O_RDWR|os.O_CREATE, os.ModePerm) + if err != nil { + panic(err) + } + defer clientsFile.Close() + + clients := []*Client{} + + if err := gocsv.UnmarshalFile(clientsFile, &clients); err != nil { // Load clients from file + panic(err) + } + for _, client := range clients { + fmt.Println("Hello", client.Name) + } + + if _, err := clientsFile.Seek(0, 0); err != nil { // Go to the start of the file + panic(err) + } + + clients = append(clients, &Client{Id: "12", Name: "John", Age: "21"}) // Add clients + clients = append(clients, &Client{Id: "13", Name: "Fred"}) + clients = append(clients, &Client{Id: "14", Name: "James", Age: "32"}) + clients = append(clients, &Client{Id: "15", Name: "Danny"}) + csvContent, err := gocsv.MarshalString(&clients) // Get all clients as CSV string + //err = gocsv.MarshalFile(&clients, clientsFile) // Use this to save the CSV back to the file + if err != nil { + panic(err) + } + fmt.Println(csvContent) // Display all clients as CSV string + +} + +``` + +Customizable Converters +--- + +```go + +type DateTime struct { + time.Time +} + +// Convert the internal date as CSV string +func (date *DateTime) MarshalCSV() (string, error) { + return date.Time.Format("20060201"), nil +} + +// You could also use the standard Stringer interface +func (date *DateTime) String() (string) { + return date.String() // Redundant, just for example +} + +// Convert the CSV string as internal date +func (date *DateTime) UnmarshalCSV(csv string) (err error) { + date.Time, err = time.Parse("20060201", csv) + return err +} + +type Client struct { // Our example struct with a custom type (DateTime) + Id string `csv:"id"` + Name string `csv:"name"` + Employed DateTime `csv:"employed"` +} + +``` + +Customizable CSV Reader / Writer +--- + +```go + +func main() { + ... + + gocsv.SetCSVReader(func(in io.Reader) gocsv.CSVReader { + r := csv.NewReader(in) + r.Comma = '|' + return r // Allows use pipe as delimiter + }) + + ... + + gocsv.SetCSVReader(func(in io.Reader) gocsv.CSVReader { + r := csv.NewReader(in) + r.LazyQuotes = true + r.Comma = '.' + return r // Allows use dot as delimiter and use quotes in CSV + }) + + ... + + gocsv.SetCSVReader(func(in io.Reader) gocsv.CSVReader { + //return csv.NewReader(in) + return gocsv.LazyCSVReader(in) // Allows use of quotes in CSV + }) + + ... + + gocsv.UnmarshalFile(file, &clients) + + ... + + gocsv.SetCSVWriter(func(out io.Writer) *gocsv.SafeCSVWriter { + writer := csv.NewWriter(out) + writer.Comma = '|' + return gocsv.NewSafeCSVWriter(writer) + }) + + ... + + gocsv.MarshalFile(&clients, file) + + ... +} + +``` diff --git a/vendor/github.com/gocarina/gocsv/csv.go b/vendor/github.com/gocarina/gocsv/csv.go new file mode 100644 index 00000000..e34819ba --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/csv.go @@ -0,0 +1,554 @@ +// Copyright 2014 Jonathan Picques. All rights reserved. +// Use of this source code is governed by a MIT license +// The license can be found in the LICENSE file. + +// The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language + +package gocsv + +import ( + "bytes" + "encoding/csv" + "fmt" + "io" + "mime/multipart" + "os" + "reflect" + "strings" + "sync" +) + +// FailIfUnmatchedStructTags indicates whether it is considered an error when there is an unmatched +// struct tag. +var FailIfUnmatchedStructTags = false + +// FailIfDoubleHeaderNames indicates whether it is considered an error when a header name is repeated +// in the csv header. +var FailIfDoubleHeaderNames = false + +// ShouldAlignDuplicateHeadersWithStructFieldOrder indicates whether we should align duplicate CSV +// headers per their alignment in the struct definition. +var ShouldAlignDuplicateHeadersWithStructFieldOrder = false + +// TagName defines key in the struct field's tag to scan +var TagName = "csv" + +// TagSeparator defines seperator string for multiple csv tags in struct fields +var TagSeparator = "," + +// FieldSeperator defines how to combine parent struct with child struct +var FieldsCombiner = "." + +// Normalizer is a function that takes and returns a string. It is applied to +// struct and header field values before they are compared. It can be used to alter +// names for comparison. For instance, you could allow case insensitive matching +// or convert '-' to '_'. +type Normalizer func(string) string + +type ErrorHandler func(*csv.ParseError) bool + +// normalizeName function initially set to a nop Normalizer. +var normalizeName = DefaultNameNormalizer() + +// DefaultNameNormalizer is a nop Normalizer. +func DefaultNameNormalizer() Normalizer { return func(s string) string { return s } } + +// SetHeaderNormalizer sets the normalizer used to normalize struct and header field names. +func SetHeaderNormalizer(f Normalizer) { + normalizeName = f + // Need to clear the cache hen the header normalizer changes. + structInfoCache = sync.Map{} +} + +// -------------------------------------------------------------------------- +// CSVWriter used to format CSV + +var selfCSVWriter = DefaultCSVWriter + +// DefaultCSVWriter is the default SafeCSVWriter used to format CSV (cf. csv.NewWriter) +func DefaultCSVWriter(out io.Writer) *SafeCSVWriter { + writer := NewSafeCSVWriter(csv.NewWriter(out)) + + // As only one rune can be defined as a CSV separator, we are going to trim + // the custom tag separator and use the first rune. + if runes := []rune(strings.TrimSpace(TagSeparator)); len(runes) > 0 { + writer.Comma = runes[0] + } + + return writer +} + +// SetCSVWriter sets the SafeCSVWriter used to format CSV. +func SetCSVWriter(csvWriter func(io.Writer) *SafeCSVWriter) { + selfCSVWriter = csvWriter +} + +func getCSVWriter(out io.Writer) *SafeCSVWriter { + return selfCSVWriter(out) +} + +// -------------------------------------------------------------------------- +// CSVReader used to parse CSV + +var selfCSVReader = DefaultCSVReader + +// DefaultCSVReader is the default CSV reader used to parse CSV (cf. csv.NewReader) +func DefaultCSVReader(in io.Reader) CSVReader { + return csv.NewReader(in) +} + +// LazyCSVReader returns a lazy CSV reader, with LazyQuotes and TrimLeadingSpace. +func LazyCSVReader(in io.Reader) CSVReader { + csvReader := csv.NewReader(in) + csvReader.LazyQuotes = true + csvReader.TrimLeadingSpace = true + return csvReader +} + +// SetCSVReader sets the CSV reader used to parse CSV. +func SetCSVReader(csvReader func(io.Reader) CSVReader) { + selfCSVReader = csvReader +} + +func getCSVReader(in io.Reader) CSVReader { + return selfCSVReader(in) +} + +// -------------------------------------------------------------------------- +// Marshal functions + +// MarshalFile saves the interface as CSV in the file. +func MarshalFile(in interface{}, file *os.File) (err error) { + return Marshal(in, file) +} + +// MarshalString returns the CSV string from the interface. +func MarshalString(in interface{}) (out string, err error) { + bufferString := bytes.NewBufferString(out) + if err := Marshal(in, bufferString); err != nil { + return "", err + } + return bufferString.String(), nil +} + +// MarshalStringWithoutHeaders returns the CSV string from the interface. +func MarshalStringWithoutHeaders(in interface{}) (out string, err error) { + bufferString := bytes.NewBufferString(out) + if err := MarshalWithoutHeaders(in, bufferString); err != nil { + return "", err + } + return bufferString.String(), nil +} + +// MarshalBytes returns the CSV bytes from the interface. +func MarshalBytes(in interface{}) (out []byte, err error) { + bufferString := bytes.NewBuffer(out) + if err := Marshal(in, bufferString); err != nil { + return nil, err + } + return bufferString.Bytes(), nil +} + +// Marshal returns the CSV in writer from the interface. +func Marshal(in interface{}, out io.Writer) (err error) { + writer := getCSVWriter(out) + return writeTo(writer, in, false) +} + +// MarshalWithoutHeaders returns the CSV in writer from the interface. +func MarshalWithoutHeaders(in interface{}, out io.Writer) (err error) { + writer := getCSVWriter(out) + return writeTo(writer, in, true) +} + +// MarshalChan returns the CSV read from the channel. +func MarshalChan(c <-chan interface{}, out CSVWriter) error { + return writeFromChan(out, c, false) +} + +// MarshalChanWithoutHeaders returns the CSV read from the channel. +func MarshalChanWithoutHeaders(c <-chan interface{}, out CSVWriter) error { + return writeFromChan(out, c, true) +} + +// MarshalCSV returns the CSV in writer from the interface. +func MarshalCSV(in interface{}, out CSVWriter) (err error) { + return writeTo(out, in, false) +} + +// MarshalCSVWithoutHeaders returns the CSV in writer from the interface. +func MarshalCSVWithoutHeaders(in interface{}, out CSVWriter) (err error) { + return writeTo(out, in, true) +} + +// -------------------------------------------------------------------------- +// Unmarshal functions + +// UnmarshalFile parses the CSV from the file in the interface. +func UnmarshalFile(in *os.File, out interface{}) error { + return Unmarshal(in, out) +} + +// UnmarshalMultipartFile parses the CSV from the multipart file in the interface. +func UnmarshalMultipartFile(in *multipart.File, out interface{}) error { + return Unmarshal(convertTo(in), out) +} + +// UnmarshalFileWithErrorHandler parses the CSV from the file in the interface. +func UnmarshalFileWithErrorHandler(in *os.File, errHandler ErrorHandler, out interface{}) error { + return UnmarshalWithErrorHandler(in, errHandler, out) +} + +// UnmarshalString parses the CSV from the string in the interface. +func UnmarshalString(in string, out interface{}) error { + return Unmarshal(strings.NewReader(in), out) +} + +// UnmarshalBytes parses the CSV from the bytes in the interface. +func UnmarshalBytes(in []byte, out interface{}) error { + return Unmarshal(bytes.NewReader(in), out) +} + +// Unmarshal parses the CSV from the reader in the interface. +func Unmarshal(in io.Reader, out interface{}) error { + return readTo(newSimpleDecoderFromReader(in), out) +} + +// Unmarshal parses the CSV from the reader in the interface. +func UnmarshalWithErrorHandler(in io.Reader, errHandle ErrorHandler, out interface{}) error { + return readToWithErrorHandler(newSimpleDecoderFromReader(in), errHandle, out) +} + +// UnmarshalWithoutHeaders parses the CSV from the reader in the interface. +func UnmarshalWithoutHeaders(in io.Reader, out interface{}) error { + return readToWithoutHeaders(newSimpleDecoderFromReader(in), out) +} + +// UnmarshalCSVWithoutHeaders parses a headerless CSV with passed in CSV reader +func UnmarshalCSVWithoutHeaders(in CSVReader, out interface{}) error { + return readToWithoutHeaders(csvDecoder{in}, out) +} + +// UnmarshalDecoder parses the CSV from the decoder in the interface +func UnmarshalDecoder(in Decoder, out interface{}) error { + return readTo(in, out) +} + +// UnmarshalCSV parses the CSV from the reader in the interface. +func UnmarshalCSV(in CSVReader, out interface{}) error { + return readTo(csvDecoder{in}, out) +} + +// UnmarshalCSVToMap parses a CSV of 2 columns into a map. +func UnmarshalCSVToMap(in CSVReader, out interface{}) error { + decoder := NewSimpleDecoderFromCSVReader(in) + header, err := decoder.GetCSVRow() + if err != nil { + return err + } + if len(header) != 2 { + return fmt.Errorf("maps can only be created for csv of two columns") + } + outValue, outType := getConcreteReflectValueAndType(out) + if outType.Kind() != reflect.Map { + return fmt.Errorf("cannot use " + outType.String() + ", only map supported") + } + keyType := outType.Key() + valueType := outType.Elem() + outValue.Set(reflect.MakeMap(outType)) + for { + key := reflect.New(keyType) + value := reflect.New(valueType) + line, err := decoder.GetCSVRow() + if err == io.EOF { + break + } else if err != nil { + return err + } + if err := setField(key, line[0], false); err != nil { + return err + } + if err := setField(value, line[1], false); err != nil { + return err + } + outValue.SetMapIndex(key.Elem(), value.Elem()) + } + return nil +} + +// UnmarshalToChan parses the CSV from the reader and send each value in the chan c. +// The channel must have a concrete type. +func UnmarshalToChan(in io.Reader, c interface{}) error { + if c == nil { + return fmt.Errorf("goscv: channel is %v", c) + } + return readEach(newSimpleDecoderFromReader(in), nil, c) +} + +// UnmarshalToChanWithErrorHandler parses the CSV from the reader in the interface. +func UnmarshalToChanWithErrorHandler(in io.Reader, errorHandler ErrorHandler, c interface{}) error { + if c == nil { + return fmt.Errorf("goscv: channel is %v", c) + } + return readEach(newSimpleDecoderFromReader(in), errorHandler, c) +} + +// UnmarshalToChanWithoutHeaders parses the CSV from the reader and send each value in the chan c. +// The channel must have a concrete type. +func UnmarshalToChanWithoutHeaders(in io.Reader, c interface{}) error { + if c == nil { + return fmt.Errorf("goscv: channel is %v", c) + } + return readEachWithoutHeaders(newSimpleDecoderFromReader(in), c) +} + +// UnmarshalDecoderToChan parses the CSV from the decoder and send each value in the chan c. +// The channel must have a concrete type. +func UnmarshalDecoderToChan(in SimpleDecoder, c interface{}) error { + if c == nil { + return fmt.Errorf("goscv: channel is %v", c) + } + return readEach(in, nil, c) +} + +// UnmarshalStringToChan parses the CSV from the string and send each value in the chan c. +// The channel must have a concrete type. +func UnmarshalStringToChan(in string, c interface{}) error { + return UnmarshalToChan(strings.NewReader(in), c) +} + +// UnmarshalBytesToChan parses the CSV from the bytes and send each value in the chan c. +// The channel must have a concrete type. +func UnmarshalBytesToChan(in []byte, c interface{}) error { + return UnmarshalToChan(bytes.NewReader(in), c) +} + +// UnmarshalToCallback parses the CSV from the reader and send each value to the given func f. +// The func must look like func(Struct). +func UnmarshalToCallback(in io.Reader, f interface{}) error { + valueFunc := reflect.ValueOf(f) + t := reflect.TypeOf(f) + if t.NumIn() != 1 { + return fmt.Errorf("the given function must have exactly one parameter") + } + cerr := make(chan error) + c := reflect.MakeChan(reflect.ChanOf(reflect.BothDir, t.In(0)), 0) + go func() { + cerr <- UnmarshalToChan(in, c.Interface()) + }() + for { + select { + case err := <-cerr: + return err + default: + } + v, notClosed := c.Recv() + if !notClosed || v.Interface() == nil { + break + } + callResults := valueFunc.Call([]reflect.Value{v}) + // if last returned value from Call() is an error, return it + if len(callResults) > 0 { + if err, ok := callResults[len(callResults)-1].Interface().(error); ok { + return err + } + } + } + return <-cerr +} + +// UnmarshalDecoderToCallback parses the CSV from the decoder and send each value to the given func f. +// The func must look like func(Struct). +func UnmarshalDecoderToCallback(in SimpleDecoder, f interface{}) error { + valueFunc := reflect.ValueOf(f) + t := reflect.TypeOf(f) + if t.NumIn() != 1 { + return fmt.Errorf("the given function must have exactly one parameter") + } + cerr := make(chan error) + c := reflect.MakeChan(reflect.ChanOf(reflect.BothDir, t.In(0)), 0) + go func() { + cerr <- UnmarshalDecoderToChan(in, c.Interface()) + }() + for { + select { + case err := <-cerr: + return err + default: + } + v, notClosed := c.Recv() + if !notClosed || v.Interface() == nil { + break + } + valueFunc.Call([]reflect.Value{v}) + } + return <-cerr +} + +// UnmarshalBytesToCallback parses the CSV from the bytes and send each value to the given func f. +// The func must look like func(Struct). +func UnmarshalBytesToCallback(in []byte, f interface{}) error { + return UnmarshalToCallback(bytes.NewReader(in), f) +} + +// UnmarshalStringToCallback parses the CSV from the string and send each value to the given func f. +// The func must look like func(Struct). +func UnmarshalStringToCallback(in string, c interface{}) (err error) { + return UnmarshalToCallback(strings.NewReader(in), c) +} + +// UnmarshalToCallbackWithError parses the CSV from the reader and +// send each value to the given func f. +// +// If func returns error, it will stop processing, drain the +// parser and propagate the error to caller. +// +// The func must look like func(Struct) error. +func UnmarshalToCallbackWithError(in io.Reader, f interface{}) error { + valueFunc := reflect.ValueOf(f) + t := reflect.TypeOf(f) + if t.NumIn() != 1 { + return fmt.Errorf("the given function must have exactly one parameter") + } + if t.NumOut() != 1 { + return fmt.Errorf("the given function must have exactly one return value") + } + if !isErrorType(t.Out(0)) { + return fmt.Errorf("the given function must only return error") + } + + cerr := make(chan error) + c := reflect.MakeChan(reflect.ChanOf(reflect.BothDir, t.In(0)), 0) + go func() { + cerr <- UnmarshalToChan(in, c.Interface()) + }() + + var fErr error + for { + select { + case err := <-cerr: + if err != nil { + return err + } + return fErr + default: + } + v, notClosed := c.Recv() + if !notClosed || v.Interface() == nil { + if err := <-cerr; err != nil { + fErr = err + } + break + } + + // callback f has already returned an error, stop processing but keep draining the chan c + if fErr != nil { + continue + } + + results := valueFunc.Call([]reflect.Value{v}) + + // If the callback f returns an error, stores it and returns it in future. + errValue := results[0].Interface() + if errValue != nil { + fErr = errValue.(error) + } + } + return fErr +} + +// UnmarshalBytesToCallbackWithError parses the CSV from the bytes and +// send each value to the given func f. +// +// If func returns error, it will stop processing, drain the +// parser and propagate the error to caller. +// +// The func must look like func(Struct) error. +func UnmarshalBytesToCallbackWithError(in []byte, f interface{}) error { + return UnmarshalToCallbackWithError(bytes.NewReader(in), f) +} + +// UnmarshalStringToCallbackWithError parses the CSV from the string and +// send each value to the given func f. +// +// If func returns error, it will stop processing, drain the +// parser and propagate the error to caller. +// +// The func must look like func(Struct) error. +func UnmarshalStringToCallbackWithError(in string, c interface{}) (err error) { + return UnmarshalToCallbackWithError(strings.NewReader(in), c) +} + +// CSVToMap creates a simple map from a CSV of 2 columns. +func CSVToMap(in io.Reader) (map[string]string, error) { + decoder := newSimpleDecoderFromReader(in) + header, err := decoder.GetCSVRow() + if err != nil { + return nil, err + } + if len(header) != 2 { + return nil, fmt.Errorf("maps can only be created for csv of two columns") + } + m := make(map[string]string) + for { + line, err := decoder.GetCSVRow() + if err == io.EOF { + break + } else if err != nil { + return nil, err + } + m[line[0]] = line[1] + } + return m, nil +} + +// CSVToMaps takes a reader and returns an array of dictionaries, using the header row as the keys +func CSVToMaps(reader io.Reader) ([]map[string]string, error) { + r := getCSVReader(reader) + rows := []map[string]string{} + var header []string + for { + record, err := r.Read() + if err == io.EOF { + break + } + if err != nil { + return nil, err + } + if header == nil { + header = record + } else { + dict := map[string]string{} + for i := range header { + dict[header[i]] = record[i] + } + rows = append(rows, dict) + } + } + return rows, nil +} + +// CSVToChanMaps parses the CSV from the reader and send a dictionary in the chan c, using the header row as the keys. +func CSVToChanMaps(reader io.Reader, c chan<- map[string]string) error { + r := csv.NewReader(reader) + var header []string + for { + record, err := r.Read() + if err == io.EOF { + break + } + if err != nil { + return err + } + if header == nil { + header = record + } else { + dict := map[string]string{} + for i := range header { + dict[header[i]] = record[i] + } + c <- dict + } + } + return nil +} diff --git a/vendor/github.com/gocarina/gocsv/decode.go b/vendor/github.com/gocarina/gocsv/decode.go new file mode 100644 index 00000000..24d49d09 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/decode.go @@ -0,0 +1,505 @@ +package gocsv + +import ( + "encoding/csv" + "errors" + "fmt" + "io" + "mime/multipart" + "reflect" +) + +var ( + ErrUnmatchedStructTags = errors.New("unmatched struct tags") + ErrDoubleHeaderNames = errors.New("double header names") +) + +// Decoder . +type Decoder interface { + GetCSVRows() ([][]string, error) +} + +// SimpleDecoder . +type SimpleDecoder interface { + GetCSVRow() ([]string, error) + GetCSVRows() ([][]string, error) +} + +type CSVReader interface { + Read() ([]string, error) + ReadAll() ([][]string, error) +} + +type csvDecoder struct { + CSVReader +} + +func newSimpleDecoderFromReader(r io.Reader) SimpleDecoder { + return csvDecoder{getCSVReader(r)} +} + +var ( + ErrEmptyCSVFile = errors.New("empty csv file given") + ErrNoStructTags = errors.New("no csv struct tags found") +) + +// NewSimpleDecoderFromCSVReader creates a SimpleDecoder, which may be passed +// to the UnmarshalDecoder* family of functions, from a CSV reader. Note that +// encoding/csv.Reader implements CSVReader, so you can pass one of those +// directly here. +func NewSimpleDecoderFromCSVReader(r CSVReader) SimpleDecoder { + return csvDecoder{r} +} + +func (c csvDecoder) GetCSVRows() ([][]string, error) { + return c.ReadAll() +} + +func (c csvDecoder) GetCSVRow() ([]string, error) { + return c.Read() +} + +func mismatchStructFields(structInfo []fieldInfo, headers []string) []string { + missing := make([]string, 0) + if len(structInfo) == 0 { + return missing + } + + headerMap := make(map[string]struct{}, len(headers)) + for idx := range headers { + headerMap[headers[idx]] = struct{}{} + } + + for _, info := range structInfo { + found := false + for _, key := range info.keys { + if _, ok := headerMap[key]; ok { + found = true + break + } + } + if !found { + missing = append(missing, info.keys...) + } + } + return missing +} + +func mismatchHeaderFields(structInfo []fieldInfo, headers []string) []string { + missing := make([]string, 0) + if len(headers) == 0 { + return missing + } + + keyMap := make(map[string]struct{}) + for _, info := range structInfo { + for _, key := range info.keys { + keyMap[key] = struct{}{} + } + } + + for _, header := range headers { + if _, ok := keyMap[header]; !ok { + missing = append(missing, header) + } + } + return missing +} + +func maybeMissingStructFields(structInfo []fieldInfo, headers []string) error { + missing := mismatchStructFields(structInfo, headers) + if len(missing) != 0 { + return fmt.Errorf("found unmatched struct field with tags %v, %w", missing, ErrUnmatchedStructTags) + } + return nil +} + +// Check that no header name is repeated twice +func maybeDoubleHeaderNames(headers []string) error { + headerMap := make(map[string]bool, len(headers)) + for _, v := range headers { + if _, ok := headerMap[v]; ok { + return fmt.Errorf("repeated header name: %v, %w", v, ErrDoubleHeaderNames) + } + headerMap[v] = true + } + return nil +} + +// apply normalizer func to headers +func normalizeHeaders(headers []string) []string { + out := make([]string, len(headers)) + for i, h := range headers { + out[i] = normalizeName(h) + } + return out +} + +// convertTo converts multipart file to io.Reader +func convertTo(file *multipart.File) io.Reader { + return io.Reader(*file) +} + +func readTo(decoder Decoder, out interface{}) error { + return readToWithErrorHandler(decoder, nil, out) +} + +func readToWithErrorHandler(decoder Decoder, errHandler ErrorHandler, out interface{}) error { + outValue, outType := getConcreteReflectValueAndType(out) // Get the concrete type (not pointer) (Slice or Array) + if err := ensureOutType(outType); err != nil { + return err + } + outInnerWasPointer, outInnerType := getConcreteContainerInnerType(outType) // Get the concrete inner type (not pointer) (Container<"?">) + if err := ensureOutInnerType(outInnerType); err != nil { + return err + } + csvRows, err := decoder.GetCSVRows() // Get the CSV csvRows + if err != nil { + return err + } + if len(csvRows) == 0 { + return ErrEmptyCSVFile + } + if err := ensureOutCapacity(&outValue, len(csvRows)); err != nil { // Ensure the container is big enough to hold the CSV content + return err + } + outInnerStructInfo := getStructInfo(outInnerType) // Get the inner struct info to get CSV annotations + if len(outInnerStructInfo.Fields) == 0 { + return ErrNoStructTags + } + + headers := normalizeHeaders(csvRows[0]) + body := csvRows[1:] + + csvHeadersLabels := make(map[int]*fieldInfo, len(outInnerStructInfo.Fields)) // Used to store the correspondance header <-> position in CSV + + headerCount := map[string]int{} + for i, csvColumnHeader := range headers { + curHeaderCount := headerCount[csvColumnHeader] + if fieldInfo := getCSVFieldPosition(csvColumnHeader, outInnerStructInfo, curHeaderCount); fieldInfo != nil { + csvHeadersLabels[i] = fieldInfo + if ShouldAlignDuplicateHeadersWithStructFieldOrder { + curHeaderCount++ + headerCount[csvColumnHeader] = curHeaderCount + } + } + } + + if FailIfUnmatchedStructTags { + if err := maybeMissingStructFields(outInnerStructInfo.Fields, headers); err != nil { + return err + } + } + if FailIfDoubleHeaderNames { + if err := maybeDoubleHeaderNames(headers); err != nil { + return err + } + } + + var withFieldsOK bool + var fieldTypeUnmarshallerWithKeys TypeUnmarshalCSVWithFields + + for i, csvRow := range body { + objectIface := reflect.New(outValue.Index(i).Type()).Interface() + outInner := createNewOutInner(outInnerWasPointer, outInnerType) + for j, csvColumnContent := range csvRow { + if fieldInfo, ok := csvHeadersLabels[j]; ok { // Position found accordingly to header name + + if outInner.CanInterface() { + fieldTypeUnmarshallerWithKeys, withFieldsOK = objectIface.(TypeUnmarshalCSVWithFields) + if withFieldsOK { + if err := fieldTypeUnmarshallerWithKeys.UnmarshalCSVWithFields(fieldInfo.getFirstKey(), csvColumnContent); err != nil { + parseError := csv.ParseError{ + Line: i + 2, //add 2 to account for the header & 0-indexing of arrays + Column: j + 1, + Err: err, + } + return &parseError + } + continue + } + } + value := csvColumnContent + if value == "" { + value = fieldInfo.defaultValue + } + if err := setInnerField(&outInner, outInnerWasPointer, fieldInfo.IndexChain, value, fieldInfo.omitEmpty); err != nil { // Set field of struct + parseError := csv.ParseError{ + Line: i + 2, //add 2 to account for the header & 0-indexing of arrays + Column: j + 1, + Err: err, + } + if errHandler == nil || !errHandler(&parseError) { + return &parseError + } + } + } + } + + if withFieldsOK { + reflectedObject := reflect.ValueOf(objectIface) + outInner = reflectedObject.Elem() + } + + outValue.Index(i).Set(outInner) + } + return nil +} + +func readEach(decoder SimpleDecoder, errHandler ErrorHandler, c interface{}) error { + outValue, outType := getConcreteReflectValueAndType(c) // Get the concrete type (not pointer) + if outType.Kind() != reflect.Chan { + return fmt.Errorf("cannot use %v with type %s, only channel supported", c, outType) + } + defer outValue.Close() + + headers, err := decoder.GetCSVRow() + if err != nil { + return err + } + headers = normalizeHeaders(headers) + + outInnerWasPointer, outInnerType := getConcreteContainerInnerType(outType) // Get the concrete inner type (not pointer) (Container<"?">) + if err := ensureOutInnerType(outInnerType); err != nil { + return err + } + outInnerStructInfo := getStructInfo(outInnerType) // Get the inner struct info to get CSV annotations + if len(outInnerStructInfo.Fields) == 0 { + return ErrNoStructTags + } + csvHeadersLabels := make(map[int]*fieldInfo, len(outInnerStructInfo.Fields)) // Used to store the correspondance header <-> position in CSV + headerCount := map[string]int{} + for i, csvColumnHeader := range headers { + curHeaderCount := headerCount[csvColumnHeader] + if fieldInfo := getCSVFieldPosition(csvColumnHeader, outInnerStructInfo, curHeaderCount); fieldInfo != nil { + csvHeadersLabels[i] = fieldInfo + if ShouldAlignDuplicateHeadersWithStructFieldOrder { + curHeaderCount++ + headerCount[csvColumnHeader] = curHeaderCount + } + } + } + if err := maybeMissingStructFields(outInnerStructInfo.Fields, headers); err != nil { + if FailIfUnmatchedStructTags { + return err + } + } + if FailIfDoubleHeaderNames { + if err := maybeDoubleHeaderNames(headers); err != nil { + return err + } + } + i := 0 + for { + line, err := decoder.GetCSVRow() + if err == io.EOF { + break + } else if err != nil { + return err + } + outInner := createNewOutInner(outInnerWasPointer, outInnerType) + for j, csvColumnContent := range line { + if fieldInfo, ok := csvHeadersLabels[j]; ok { // Position found accordingly to header name + if err := setInnerField(&outInner, outInnerWasPointer, fieldInfo.IndexChain, csvColumnContent, fieldInfo.omitEmpty); err != nil { // Set field of struct + parseError := &csv.ParseError{ + Line: i + 2, //add 2 to account for the header & 0-indexing of arrays + Column: j + 1, + Err: err, + } + + if errHandler == nil || !errHandler(parseError) { + return parseError + } + } + } + } + outValue.Send(outInner) + i++ + } + return nil +} + +func readEachWithoutHeaders(decoder SimpleDecoder, c interface{}) error { + outValue, outType := getConcreteReflectValueAndType(c) // Get the concrete type (not pointer) (Slice or Array) + if err := ensureOutType(outType); err != nil { + return err + } + defer outValue.Close() + + outInnerWasPointer, outInnerType := getConcreteContainerInnerType(outType) // Get the concrete inner type (not pointer) (Container<"?">) + if err := ensureOutInnerType(outInnerType); err != nil { + return err + } + outInnerStructInfo := getStructInfo(outInnerType) // Get the inner struct info to get CSV annotations + if len(outInnerStructInfo.Fields) == 0 { + return ErrNoStructTags + } + + i := 0 + for { + line, err := decoder.GetCSVRow() + if err == io.EOF { + break + } else if err != nil { + return err + } + outInner := createNewOutInner(outInnerWasPointer, outInnerType) + for j, csvColumnContent := range line { + fieldInfo := outInnerStructInfo.Fields[j] + if err := setInnerField(&outInner, outInnerWasPointer, fieldInfo.IndexChain, csvColumnContent, fieldInfo.omitEmpty); err != nil { // Set field of struct + return &csv.ParseError{ + Line: i + 2, //add 2 to account for the header & 0-indexing of arrays + Column: j + 1, + Err: err, + } + } + } + outValue.Send(outInner) + i++ + } + return nil +} + +func readToWithoutHeaders(decoder Decoder, out interface{}) error { + outValue, outType := getConcreteReflectValueAndType(out) // Get the concrete type (not pointer) (Slice or Array) + if err := ensureOutType(outType); err != nil { + return err + } + outInnerWasPointer, outInnerType := getConcreteContainerInnerType(outType) // Get the concrete inner type (not pointer) (Container<"?">) + if err := ensureOutInnerType(outInnerType); err != nil { + return err + } + csvRows, err := decoder.GetCSVRows() // Get the CSV csvRows + if err != nil { + return err + } + if len(csvRows) == 0 { + return ErrEmptyCSVFile + } + if err := ensureOutCapacity(&outValue, len(csvRows)+1); err != nil { // Ensure the container is big enough to hold the CSV content + return err + } + outInnerStructInfo := getStructInfo(outInnerType) // Get the inner struct info to get CSV annotations + if len(outInnerStructInfo.Fields) == 0 { + return ErrNoStructTags + } + + for i, csvRow := range csvRows { + outInner := createNewOutInner(outInnerWasPointer, outInnerType) + for j, csvColumnContent := range csvRow { + fieldInfo := outInnerStructInfo.Fields[j] + if err := setInnerField(&outInner, outInnerWasPointer, fieldInfo.IndexChain, csvColumnContent, fieldInfo.omitEmpty); err != nil { // Set field of struct + return &csv.ParseError{ + Line: i + 1, + Column: j + 1, + Err: err, + } + } + } + outValue.Index(i).Set(outInner) + } + + return nil +} + +// Check if the outType is an array or a slice +func ensureOutType(outType reflect.Type) error { + switch outType.Kind() { + case reflect.Slice: + fallthrough + case reflect.Chan: + fallthrough + case reflect.Array: + return nil + } + return fmt.Errorf("cannot use " + outType.String() + ", only slice or array supported") +} + +// Check if the outInnerType is of type struct +func ensureOutInnerType(outInnerType reflect.Type) error { + switch outInnerType.Kind() { + case reflect.Struct: + return nil + } + return fmt.Errorf("cannot use " + outInnerType.String() + ", only struct supported") +} + +func ensureOutCapacity(out *reflect.Value, csvLen int) error { + switch out.Kind() { + case reflect.Array: + if out.Len() < csvLen-1 { // Array is not big enough to hold the CSV content (arrays are not addressable) + return fmt.Errorf("array capacity problem: cannot store %d %s in %s", csvLen-1, out.Type().Elem().String(), out.Type().String()) + } + case reflect.Slice: + if !out.CanAddr() && out.Len() < csvLen-1 { // Slice is not big enough tho hold the CSV content and is not addressable + return fmt.Errorf("slice capacity problem and is not addressable (did you forget &?)") + } else if out.CanAddr() && out.Len() < csvLen-1 { + out.Set(reflect.MakeSlice(out.Type(), csvLen-1, csvLen-1)) // Slice is not big enough, so grows it + } + } + return nil +} + +func getCSVFieldPosition(key string, structInfo *structInfo, curHeaderCount int) *fieldInfo { + matchedFieldCount := 0 + for _, field := range structInfo.Fields { + if field.matchesKey(key) { + if matchedFieldCount >= curHeaderCount { + return &field + } + matchedFieldCount++ + } + } + return nil +} + +func createNewOutInner(outInnerWasPointer bool, outInnerType reflect.Type) reflect.Value { + if outInnerWasPointer { + return reflect.New(outInnerType) + } + return reflect.New(outInnerType).Elem() +} + +func setInnerField(outInner *reflect.Value, outInnerWasPointer bool, index []int, value string, omitEmpty bool) error { + oi := *outInner + if outInnerWasPointer { + // initialize nil pointer + if oi.IsNil() { + if err := setField(oi, "", omitEmpty); err != nil { + return err + } + } + oi = outInner.Elem() + } + + if oi.Kind() == reflect.Slice || oi.Kind() == reflect.Array { + i := index[0] + + // grow slice when needed + if i >= oi.Cap() { + newcap := oi.Cap() + oi.Cap()/2 + if newcap < 4 { + newcap = 4 + } + newoi := reflect.MakeSlice(oi.Type(), oi.Len(), newcap) + reflect.Copy(newoi, oi) + oi.Set(newoi) + } + if i >= oi.Len() { + oi.SetLen(i + 1) + } + + item := oi.Index(i) + if len(index) > 1 { + return setInnerField(&item, false, index[1:], value, omitEmpty) + } + return setField(item, value, omitEmpty) + } + + // because pointers can be nil need to recurse one index at a time and perform nil check + if len(index) > 1 { + nextField := oi.Field(index[0]) + return setInnerField(&nextField, nextField.Kind() == reflect.Ptr, index[1:], value, omitEmpty) + } + return setField(oi.FieldByIndex(index), value, omitEmpty) +} diff --git a/vendor/github.com/gocarina/gocsv/encode.go b/vendor/github.com/gocarina/gocsv/encode.go new file mode 100644 index 00000000..a7c0e720 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/encode.go @@ -0,0 +1,169 @@ +package gocsv + +import ( + "errors" + "fmt" + "io" + "reflect" +) + +var ( + ErrChannelIsClosed = errors.New("channel is closed") +) + +type encoder struct { + out io.Writer +} + +func newEncoder(out io.Writer) *encoder { + return &encoder{out} +} + +func writeFromChan(writer CSVWriter, c <-chan interface{}, omitHeaders bool) error { + // Get the first value. It wil determine the header structure. + firstValue, ok := <-c + if !ok { + return ErrChannelIsClosed + } + inValue, inType := getConcreteReflectValueAndType(firstValue) // Get the concrete type + if err := ensureStructOrPtr(inType); err != nil { + return err + } + inInnerWasPointer := inType.Kind() == reflect.Ptr + inInnerStructInfo := getStructInfo(inType) // Get the inner struct info to get CSV annotations + csvHeadersLabels := make([]string, len(inInnerStructInfo.Fields)) + for i, fieldInfo := range inInnerStructInfo.Fields { // Used to write the header (first line) in CSV + csvHeadersLabels[i] = fieldInfo.getFirstKey() + } + if !omitHeaders { + if err := writer.Write(csvHeadersLabels); err != nil { + return err + } + } + write := func(val reflect.Value) error { + for j, fieldInfo := range inInnerStructInfo.Fields { + csvHeadersLabels[j] = "" + inInnerFieldValue, err := getInnerField(val, inInnerWasPointer, fieldInfo.IndexChain) // Get the correct field header <-> position + if err != nil { + return err + } + csvHeadersLabels[j] = inInnerFieldValue + } + if err := writer.Write(csvHeadersLabels); err != nil { + return err + } + return nil + } + if err := write(inValue); err != nil { + return err + } + for v := range c { + val, _ := getConcreteReflectValueAndType(v) // Get the concrete type (not pointer) (Slice or Array) + if err := ensureStructOrPtr(inType); err != nil { + return err + } + if err := write(val); err != nil { + return err + } + } + writer.Flush() + return writer.Error() +} + +func writeTo(writer CSVWriter, in interface{}, omitHeaders bool) error { + inValue, inType := getConcreteReflectValueAndType(in) // Get the concrete type (not pointer) (Slice or Array) + if err := ensureInType(inType); err != nil { + return err + } + inInnerWasPointer, inInnerType := getConcreteContainerInnerType(inType) // Get the concrete inner type (not pointer) (Container<"?">) + if err := ensureInInnerType(inInnerType); err != nil { + return err + } + inInnerStructInfo := getStructInfo(inInnerType) // Get the inner struct info to get CSV annotations + csvHeadersLabels := make([]string, len(inInnerStructInfo.Fields)) + for i, fieldInfo := range inInnerStructInfo.Fields { // Used to write the header (first line) in CSV + csvHeadersLabels[i] = fieldInfo.getFirstKey() + } + if !omitHeaders { + if err := writer.Write(csvHeadersLabels); err != nil { + return err + } + } + inLen := inValue.Len() + for i := 0; i < inLen; i++ { // Iterate over container rows + for j, fieldInfo := range inInnerStructInfo.Fields { + csvHeadersLabels[j] = "" + inInnerFieldValue, err := getInnerField(inValue.Index(i), inInnerWasPointer, fieldInfo.IndexChain) // Get the correct field header <-> position + if err != nil { + return err + } + csvHeadersLabels[j] = inInnerFieldValue + } + if err := writer.Write(csvHeadersLabels); err != nil { + return err + } + } + writer.Flush() + return writer.Error() +} + +func ensureStructOrPtr(t reflect.Type) error { + switch t.Kind() { + case reflect.Struct: + fallthrough + case reflect.Ptr: + return nil + } + return fmt.Errorf("cannot use " + t.String() + ", only slice or array supported") +} + +// Check if the inType is an array or a slice +func ensureInType(outType reflect.Type) error { + switch outType.Kind() { + case reflect.Slice: + fallthrough + case reflect.Array: + return nil + } + return fmt.Errorf("cannot use " + outType.String() + ", only slice or array supported") +} + +// Check if the inInnerType is of type struct +func ensureInInnerType(outInnerType reflect.Type) error { + switch outInnerType.Kind() { + case reflect.Struct: + return nil + } + return fmt.Errorf("cannot use " + outInnerType.String() + ", only struct supported") +} + +func getInnerField(outInner reflect.Value, outInnerWasPointer bool, index []int) (string, error) { + oi := outInner + if outInnerWasPointer { + if oi.IsNil() { + return "", nil + } + oi = outInner.Elem() + } + + if oi.Kind() == reflect.Slice || oi.Kind() == reflect.Array { + i := index[0] + + if i >= oi.Len() { + return "", nil + } + + item := oi.Index(i) + if len(index) > 1 { + return getInnerField(item, false, index[1:]) + } + return getFieldAsString(item) + } + + // because pointers can be nil need to recurse one index at a time and perform nil check + if len(index) > 1 { + nextField := oi.Field(index[0]) + return getInnerField(nextField, nextField.Kind() == reflect.Ptr, index[1:]) + } + return getFieldAsString(oi.FieldByIndex(index)) +} diff --git a/vendor/github.com/gocarina/gocsv/reflect.go b/vendor/github.com/gocarina/gocsv/reflect.go new file mode 100644 index 00000000..31c72f79 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/reflect.go @@ -0,0 +1,266 @@ +package gocsv + +import ( + "fmt" + "reflect" + "strconv" + "strings" + "sync" +) + +// -------------------------------------------------------------------------- +// Reflection helpers + +type structInfo struct { + Fields []fieldInfo +} + +// fieldInfo is a struct field that should be mapped to a CSV column, or vice-versa +// Each IndexChain element before the last is the index of an the embedded struct field +// that defines Key as a tag +type fieldInfo struct { + keys []string + omitEmpty bool + IndexChain []int + defaultValue string + partial bool +} + +func (f fieldInfo) getFirstKey() string { + return f.keys[0] +} + +func (f fieldInfo) matchesKey(key string) bool { + for _, k := range f.keys { + if key == k || strings.TrimSpace(key) == k || (f.partial && strings.Contains(key, k)) || removeZeroWidthChars(key) == k { + return true + } + } + return false +} + +// zwchs is Zero Width Characters map +var zwchs = map[rune]struct{}{ + '\u200B': {}, // zero width space (U+200B) + '\uFEFF': {}, // zero width no-break space (U+FEFF) + '\u200D': {}, // zero width joiner (U+200D) + '\u200C': {}, // zero width non-joiner (U+200C) +} + +func removeZeroWidthChars(s string) string { + return strings.Map(func(r rune) rune { + if _, ok := zwchs[r]; ok { + return -1 + } + return r + }, s) +} + +var structInfoCache sync.Map +var structMap = make(map[reflect.Type]*structInfo) +var structMapMutex sync.RWMutex + +func getStructInfo(rType reflect.Type) *structInfo { + stInfo, ok := structInfoCache.Load(rType) + if ok { + return stInfo.(*structInfo) + } + + fieldsList := getFieldInfos(rType, []int{}, []string{}) + stInfo = &structInfo{fieldsList} + structInfoCache.Store(rType, stInfo) + + return stInfo.(*structInfo) +} + +func getFieldInfos(rType reflect.Type, parentIndexChain []int, parentKeys []string) []fieldInfo { + fieldsCount := rType.NumField() + fieldsList := make([]fieldInfo, 0, fieldsCount) + for i := 0; i < fieldsCount; i++ { + field := rType.Field(i) + if field.PkgPath != "" { + continue + } + + var cpy = make([]int, len(parentIndexChain)) + copy(cpy, parentIndexChain) + indexChain := append(cpy, i) + + var currFieldInfo *fieldInfo + if !field.Anonymous { + filteredTags := []string{} + currFieldInfo, filteredTags = filterTags(TagName, indexChain, field) + + if len(filteredTags) == 1 && filteredTags[0] == "-" { + // ignore nested structs with - tag + continue + } else if len(filteredTags) > 0 && filteredTags[0] != "" { + currFieldInfo.keys = filteredTags + } else { + currFieldInfo.keys = []string{normalizeName(field.Name)} + } + + if len(parentKeys) > 0 && currFieldInfo != nil { + // create cartesian product of keys + // eg: parent keys x field keys + keys := make([]string, 0, len(parentKeys)*len(currFieldInfo.keys)) + for _, pkey := range parentKeys { + for _, ckey := range currFieldInfo.keys { + keys = append(keys, normalizeName(fmt.Sprintf("%s%s%s", pkey, FieldsCombiner, ckey))) + } + currFieldInfo.keys = keys + } + } + } + + // handle struct + fieldType := field.Type + // if the field is a pointer, follow the pointer + if fieldType.Kind() == reflect.Ptr { + fieldType = fieldType.Elem() + } + // if the field is a struct, create a fieldInfo for each of its fields + if fieldType.Kind() == reflect.Struct { + // Structs that implement any of the text or CSV marshaling methods + // should result in one value and not have their fields exposed + if !(canMarshal(fieldType)) { + // if the field is an embedded struct, pass along parent keys + keys := parentKeys + if currFieldInfo != nil { + keys = currFieldInfo.keys + } + fieldsList = append(fieldsList, getFieldInfos(fieldType, indexChain, keys)...) + continue + } + } + + // if the field is an embedded struct, ignore the csv tag + if currFieldInfo == nil { + continue + } + + if field.Type.Kind() == reflect.Slice || field.Type.Kind() == reflect.Array { + var arrayLength = -1 + // if the field is a slice or an array, see if it has a `csv[n]` tag + if arrayTag, ok := field.Tag.Lookup(TagName + "[]"); ok { + arrayLength, _ = strconv.Atoi(arrayTag) + } + + // slices or arrays of Struct get special handling + if field.Type.Elem().Kind() == reflect.Struct { + fieldInfos := getFieldInfos(field.Type.Elem(), []int{}, []string{}) + + // if no special csv[] tag was supplied, just include the field directly + if arrayLength == -1 { + fieldsList = append(fieldsList, *currFieldInfo) + } else { + // When the field is a slice/array of structs, create a fieldInfo for each index and each field + for idx := 0; idx < arrayLength; idx++ { + // copy index chain and append array index + var cpy2 = make([]int, len(indexChain)) + copy(cpy2, indexChain) + arrayIndexChain := append(cpy2, idx) + for _, childFieldInfo := range fieldInfos { + // copy array index chain and append array index + var cpy3 = make([]int, len(arrayIndexChain)) + copy(cpy3, arrayIndexChain) + + arrayFieldInfo := fieldInfo{ + IndexChain: append(cpy3, childFieldInfo.IndexChain...), + omitEmpty: childFieldInfo.omitEmpty, + defaultValue: childFieldInfo.defaultValue, + partial: childFieldInfo.partial, + } + + // create cartesian product of keys + // eg: array field keys x struct field keys + for _, akey := range currFieldInfo.keys { + for _, fkey := range childFieldInfo.keys { + arrayFieldInfo.keys = append(arrayFieldInfo.keys, normalizeName(fmt.Sprintf("%s[%d].%s", akey, idx, fkey))) + } + } + + fieldsList = append(fieldsList, arrayFieldInfo) + } + } + } + } else if arrayLength > 0 { + // When the field is a slice/array of primitives, create a fieldInfo for each index + for idx := 0; idx < arrayLength; idx++ { + // copy index chain and append array index + var cpy2 = make([]int, len(indexChain)) + copy(cpy2, indexChain) + + arrayFieldInfo := fieldInfo{ + IndexChain: append(cpy2, idx), + omitEmpty: currFieldInfo.omitEmpty, + defaultValue: currFieldInfo.defaultValue, + partial: currFieldInfo.partial, + } + + for _, akey := range currFieldInfo.keys { + arrayFieldInfo.keys = append(arrayFieldInfo.keys, normalizeName(fmt.Sprintf("%s[%d]", akey, idx))) + } + + fieldsList = append(fieldsList, arrayFieldInfo) + } + } else { + fieldsList = append(fieldsList, *currFieldInfo) + } + } else { + fieldsList = append(fieldsList, *currFieldInfo) + } + } + return fieldsList +} + +func filterTags(tagName string, indexChain []int, field reflect.StructField) (*fieldInfo, []string) { + currFieldInfo := fieldInfo{IndexChain: indexChain} + + fieldTag := field.Tag.Get(tagName) + fieldTags := strings.Split(fieldTag, TagSeparator) + + filteredTags := []string{} + for _, fieldTagEntry := range fieldTags { + trimmedFieldTagEntry := strings.TrimSpace(fieldTagEntry) // handles cases like `csv:"foo, omitempty, default=test"` + if trimmedFieldTagEntry == "omitempty" { + currFieldInfo.omitEmpty = true + } else if strings.HasPrefix(trimmedFieldTagEntry, "partial") { + currFieldInfo.partial = true + } else if strings.HasPrefix(trimmedFieldTagEntry, "default=") { + currFieldInfo.defaultValue = strings.TrimPrefix(trimmedFieldTagEntry, "default=") + } else { + filteredTags = append(filteredTags, normalizeName(trimmedFieldTagEntry)) + } + } + + return &currFieldInfo, filteredTags +} + +func getConcreteContainerInnerType(in reflect.Type) (inInnerWasPointer bool, inInnerType reflect.Type) { + inInnerType = in.Elem() + inInnerWasPointer = false + if inInnerType.Kind() == reflect.Ptr { + inInnerWasPointer = true + inInnerType = inInnerType.Elem() + } + return inInnerWasPointer, inInnerType +} + +func getConcreteReflectValueAndType(in interface{}) (reflect.Value, reflect.Type) { + value := reflect.ValueOf(in) + if value.Kind() == reflect.Ptr { + value = value.Elem() + } + return value, value.Type() +} + +var errorInterface = reflect.TypeOf((*error)(nil)).Elem() + +func isErrorType(outType reflect.Type) bool { + if outType.Kind() != reflect.Interface { + return false + } + + return outType.Implements(errorInterface) +} diff --git a/vendor/github.com/gocarina/gocsv/safe_csv.go b/vendor/github.com/gocarina/gocsv/safe_csv.go new file mode 100644 index 00000000..858b0781 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/safe_csv.go @@ -0,0 +1,38 @@ +package gocsv + +//Wraps around SafeCSVWriter and makes it thread safe. +import ( + "encoding/csv" + "sync" +) + +type CSVWriter interface { + Write(row []string) error + Flush() + Error() error +} + +type SafeCSVWriter struct { + *csv.Writer + m sync.Mutex +} + +func NewSafeCSVWriter(original *csv.Writer) *SafeCSVWriter { + return &SafeCSVWriter{ + Writer: original, + } +} + +//Override write +func (w *SafeCSVWriter) Write(row []string) error { + w.m.Lock() + defer w.m.Unlock() + return w.Writer.Write(row) +} + +//Override flush +func (w *SafeCSVWriter) Flush() { + w.m.Lock() + w.Writer.Flush() + w.m.Unlock() +} diff --git a/vendor/github.com/gocarina/gocsv/types.go b/vendor/github.com/gocarina/gocsv/types.go new file mode 100644 index 00000000..be853ab7 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/types.go @@ -0,0 +1,489 @@ +package gocsv + +import ( + "encoding" + "fmt" + "reflect" + "strconv" + "strings" + + "encoding/json" +) + +// -------------------------------------------------------------------------- +// Conversion interfaces + +var ( + marshalerType = reflect.TypeOf(new(TypeMarshaller)).Elem() + textMarshalerType = reflect.TypeOf(new(encoding.TextMarshaler)).Elem() + unmarshalerType = reflect.TypeOf(new(TypeUnmarshaller)).Elem() + unmarshalCSVWithFieldsType = reflect.TypeOf(new(TypeUnmarshalCSVWithFields)).Elem() +) + +// TypeMarshaller is implemented by any value that has a MarshalCSV method +// This converter is used to convert the value to it string representation +type TypeMarshaller interface { + MarshalCSV() (string, error) +} + +// TypeUnmarshaller is implemented by any value that has an UnmarshalCSV method +// This converter is used to convert a string to your value representation of that string +type TypeUnmarshaller interface { + UnmarshalCSV(string) error +} + +// TypeUnmarshalCSVWithFields can be implemented on whole structs to allow for whole structures to customized internal vs one off fields +type TypeUnmarshalCSVWithFields interface { + UnmarshalCSVWithFields(key, value string) error +} + +// NoUnmarshalFuncError is the custom error type to be raised in case there is no unmarshal function defined on type +type NoUnmarshalFuncError struct { + t reflect.Type +} + +func (e NoUnmarshalFuncError) Error() string { + return "No known conversion from string to " + e.t.Name() + ", it does not implement TypeUnmarshaller" +} + +// NoMarshalFuncError is the custom error type to be raised in case there is no marshal function defined on type +type NoMarshalFuncError struct { + ty reflect.Type +} + +func (e NoMarshalFuncError) Error() string { + return "No known conversion from " + e.ty.String() + " to string, " + e.ty.String() + " does not implement TypeMarshaller nor Stringer" +} + +// -------------------------------------------------------------------------- +// Conversion helpers + +func toString(in interface{}) (string, error) { + inValue := reflect.ValueOf(in) + + switch inValue.Kind() { + case reflect.String: + return inValue.String(), nil + case reflect.Bool: + b := inValue.Bool() + if b { + return "true", nil + } + return "false", nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return fmt.Sprintf("%v", inValue.Int()), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return fmt.Sprintf("%v", inValue.Uint()), nil + case reflect.Float32: + return strconv.FormatFloat(inValue.Float(), byte('f'), -1, 32), nil + case reflect.Float64: + return strconv.FormatFloat(inValue.Float(), byte('f'), -1, 64), nil + } + return "", fmt.Errorf("No known conversion from " + inValue.Type().String() + " to string") +} + +func toBool(in interface{}) (bool, error) { + inValue := reflect.ValueOf(in) + + switch inValue.Kind() { + case reflect.String: + s := inValue.String() + s = strings.TrimSpace(s) + if strings.EqualFold(s, "yes") { + return true, nil + } else if strings.EqualFold(s, "no") || s == "" { + return false, nil + } else { + return strconv.ParseBool(s) + } + case reflect.Bool: + return inValue.Bool(), nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + i := inValue.Int() + if i != 0 { + return true, nil + } + return false, nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + i := inValue.Uint() + if i != 0 { + return true, nil + } + return false, nil + case reflect.Float32, reflect.Float64: + f := inValue.Float() + if f != 0 { + return true, nil + } + return false, nil + } + return false, fmt.Errorf("No known conversion from " + inValue.Type().String() + " to bool") +} + +func toInt(in interface{}) (int64, error) { + inValue := reflect.ValueOf(in) + + switch inValue.Kind() { + case reflect.String: + s := strings.TrimSpace(inValue.String()) + if s == "" { + return 0, nil + } + out := strings.SplitN(s, ".", 2) + return strconv.ParseInt(out[0], 0, 64) + case reflect.Bool: + if inValue.Bool() { + return 1, nil + } + return 0, nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return inValue.Int(), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return int64(inValue.Uint()), nil + case reflect.Float32, reflect.Float64: + return int64(inValue.Float()), nil + } + return 0, fmt.Errorf("No known conversion from " + inValue.Type().String() + " to int") +} + +func toUint(in interface{}) (uint64, error) { + inValue := reflect.ValueOf(in) + + switch inValue.Kind() { + case reflect.String: + s := strings.TrimSpace(inValue.String()) + if s == "" { + return 0, nil + } + + // support the float input + if strings.Contains(s, ".") { + f, err := strconv.ParseFloat(s, 64) + if err != nil { + return 0, err + } + return uint64(f), nil + } + return strconv.ParseUint(s, 0, 64) + case reflect.Bool: + if inValue.Bool() { + return 1, nil + } + return 0, nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return uint64(inValue.Int()), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return inValue.Uint(), nil + case reflect.Float32, reflect.Float64: + return uint64(inValue.Float()), nil + } + return 0, fmt.Errorf("No known conversion from " + inValue.Type().String() + " to uint") +} + +func toFloat(in interface{}) (float64, error) { + inValue := reflect.ValueOf(in) + + switch inValue.Kind() { + case reflect.String: + s := strings.TrimSpace(inValue.String()) + if s == "" { + return 0, nil + } + s = strings.Replace(s, ",", ".", -1) + return strconv.ParseFloat(s, 64) + case reflect.Bool: + if inValue.Bool() { + return 1, nil + } + return 0, nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return float64(inValue.Int()), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return float64(inValue.Uint()), nil + case reflect.Float32, reflect.Float64: + return inValue.Float(), nil + } + return 0, fmt.Errorf("No known conversion from " + inValue.Type().String() + " to float") +} + +func setField(field reflect.Value, value string, omitEmpty bool) error { + if field.Kind() == reflect.Ptr { + if omitEmpty && value == "" { + return nil + } + if field.IsNil() { + field.Set(reflect.New(field.Type().Elem())) + } + field = field.Elem() + } + + switch field.Interface().(type) { + case string: + s, err := toString(value) + if err != nil { + return err + } + field.SetString(s) + case bool: + b, err := toBool(value) + if err != nil { + return err + } + field.SetBool(b) + case int, int8, int16, int32, int64: + i, err := toInt(value) + if err != nil { + return err + } + field.SetInt(i) + case uint, uint8, uint16, uint32, uint64: + ui, err := toUint(value) + if err != nil { + return err + } + field.SetUint(ui) + case float32, float64: + f, err := toFloat(value) + if err != nil { + return err + } + field.SetFloat(f) + default: + // Not a native type, check for unmarshal method + if err := unmarshall(field, value); err != nil { + if _, ok := err.(NoUnmarshalFuncError); !ok { + return err + } + // Could not unmarshal, check for kind, e.g. renamed type from basic type + switch field.Kind() { + case reflect.String: + s, err := toString(value) + if err != nil { + return err + } + field.SetString(s) + case reflect.Bool: + b, err := toBool(value) + if err != nil { + return err + } + field.SetBool(b) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + i, err := toInt(value) + if err != nil { + return err + } + field.SetInt(i) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + ui, err := toUint(value) + if err != nil { + return err + } + field.SetUint(ui) + case reflect.Float32, reflect.Float64: + f, err := toFloat(value) + if err != nil { + return err + } + field.SetFloat(f) + case reflect.Slice, reflect.Struct: + if value == "" { + return nil + } + + err := json.Unmarshal([]byte(value), field.Addr().Interface()) + if err != nil { + return err + } + default: + return err + } + } else { + return nil + } + } + return nil +} + +func getFieldAsString(field reflect.Value) (str string, err error) { + switch field.Kind() { + case reflect.Interface, reflect.Ptr: + if field.IsNil() { + return "", nil + } + return getFieldAsString(field.Elem()) + default: + // Check if field is go native type + switch field.Interface().(type) { + case string: + return field.String(), nil + case bool: + if field.Bool() { + return "true", nil + } else { + return "false", nil + } + case int, int8, int16, int32, int64: + return fmt.Sprintf("%v", field.Int()), nil + case uint, uint8, uint16, uint32, uint64: + return fmt.Sprintf("%v", field.Uint()), nil + case float32: + str, err = toString(float32(field.Float())) + if err != nil { + return str, err + } + case float64: + str, err = toString(field.Float()) + if err != nil { + return str, err + } + default: + // Not a native type, check for marshal method + str, err = marshall(field) + if err != nil { + if _, ok := err.(NoMarshalFuncError); !ok { + return str, err + } + // If not marshal method, is field compatible with/renamed from native type + switch field.Kind() { + case reflect.String: + return field.String(), nil + case reflect.Bool: + str, err = toString(field.Bool()) + if err != nil { + return str, err + } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + str, err = toString(field.Int()) + if err != nil { + return str, err + } + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + str, err = toString(field.Uint()) + if err != nil { + return str, err + } + case reflect.Float32: + str, err = toString(float32(field.Float())) + if err != nil { + return str, err + } + case reflect.Float64: + str, err = toString(field.Float()) + if err != nil { + return str, err + } + case reflect.Slice: + fallthrough + case reflect.Array: + b, err := json.Marshal(field.Addr().Interface()) + if err != nil { + return str, err + } + + str = string(b) + } + } else { + return str, nil + } + } + } + return str, nil +} + +// -------------------------------------------------------------------------- +// Un/serializations helpers + +func canMarshal(t reflect.Type) bool { + // Struct that implements any of the text or CSV marshaling interfaces + if t.Implements(marshalerType) || + t.Implements(textMarshalerType) || + t.Implements(unmarshalerType) || + t.Implements(unmarshalCSVWithFieldsType) { + return true + } + + // Pointer to a struct that implements any of the text or CSV marshaling interfaces + t = reflect.PtrTo(t) + if t.Implements(marshalerType) || + t.Implements(textMarshalerType) || + t.Implements(unmarshalerType) || + t.Implements(unmarshalCSVWithFieldsType) { + return true + } + return false +} + +func unmarshall(field reflect.Value, value string) error { + dupField := field + unMarshallIt := func(finalField reflect.Value) error { + if finalField.CanInterface() { + fieldIface := finalField.Interface() + + fieldTypeUnmarshaller, ok := fieldIface.(TypeUnmarshaller) + if ok { + return fieldTypeUnmarshaller.UnmarshalCSV(value) + } + + // Otherwise try to use TextUnmarshaler + fieldTextUnmarshaler, ok := fieldIface.(encoding.TextUnmarshaler) + if ok { + return fieldTextUnmarshaler.UnmarshalText([]byte(value)) + } + } + + return NoUnmarshalFuncError{field.Type()} + } + for dupField.Kind() == reflect.Interface || dupField.Kind() == reflect.Ptr { + if dupField.IsNil() { + dupField = reflect.New(field.Type().Elem()) + field.Set(dupField) + return unMarshallIt(dupField) + } + dupField = dupField.Elem() + } + if dupField.CanAddr() { + return unMarshallIt(dupField.Addr()) + } + return NoUnmarshalFuncError{field.Type()} +} + +func marshall(field reflect.Value) (value string, err error) { + dupField := field + marshallIt := func(finalField reflect.Value) (string, error) { + if finalField.CanInterface() { + fieldIface := finalField.Interface() + + // Use TypeMarshaller when possible + fieldTypeMarhaller, ok := fieldIface.(TypeMarshaller) + if ok { + return fieldTypeMarhaller.MarshalCSV() + } + + // Otherwise try to use TextMarshaller + fieldTextMarshaler, ok := fieldIface.(encoding.TextMarshaler) + if ok { + text, err := fieldTextMarshaler.MarshalText() + return string(text), err + } + + // Otherwise try to use Stringer + fieldStringer, ok := fieldIface.(fmt.Stringer) + if ok { + return fieldStringer.String(), nil + } + } + + return value, NoMarshalFuncError{field.Type()} + } + for dupField.Kind() == reflect.Interface || dupField.Kind() == reflect.Ptr { + if dupField.IsNil() { + return value, nil + } + dupField = dupField.Elem() + } + if dupField.CanAddr() { + dupField = dupField.Addr() + } + return marshallIt(dupField) +} diff --git a/vendor/github.com/gocarina/gocsv/unmarshaller.go b/vendor/github.com/gocarina/gocsv/unmarshaller.go new file mode 100644 index 00000000..50d528e3 --- /dev/null +++ b/vendor/github.com/gocarina/gocsv/unmarshaller.go @@ -0,0 +1,134 @@ +package gocsv + +import ( + "encoding/csv" + "fmt" + "reflect" +) + +// Unmarshaller is a CSV to struct unmarshaller. +type Unmarshaller struct { + reader *csv.Reader + Headers []string + fieldInfoMap []*fieldInfo + MismatchedHeaders []string + MismatchedStructFields []string + outType reflect.Type + out interface{} +} + +// NewUnmarshaller creates an unmarshaller from a csv.Reader and a struct. +func NewUnmarshaller(reader *csv.Reader, out interface{}) (*Unmarshaller, error) { + headers, err := reader.Read() + if err != nil { + return nil, err + } + headers = normalizeHeaders(headers) + + um := &Unmarshaller{reader: reader, outType: reflect.TypeOf(out)} + err = validate(um, out, headers) + if err != nil { + return nil, err + } + return um, nil +} + +// Read returns an interface{} whose runtime type is the same as the struct that +// was used to create the Unmarshaller. +func (um *Unmarshaller) Read() (interface{}, error) { + row, err := um.reader.Read() + if err != nil { + return nil, err + } + return um.unmarshalRow(row, nil) +} + +// ReadUnmatched is same as Read(), but returns a map of the columns that didn't match a field in the struct +func (um *Unmarshaller) ReadUnmatched() (interface{}, map[string]string, error) { + row, err := um.reader.Read() + if err != nil { + return nil, nil, err + } + unmatched := make(map[string]string) + value, err := um.unmarshalRow(row, unmatched) + return value, unmatched, err +} + +// validate ensures that a struct was used to create the Unmarshaller, and validates +// CSV headers against the CSV tags in the struct. +func validate(um *Unmarshaller, s interface{}, headers []string) error { + concreteType := reflect.TypeOf(s) + if concreteType.Kind() == reflect.Ptr { + concreteType = concreteType.Elem() + } + if err := ensureOutInnerType(concreteType); err != nil { + return err + } + structInfo := getStructInfo(concreteType) // Get struct info to get CSV annotations. + if len(structInfo.Fields) == 0 { + return ErrNoStructTags + } + csvHeadersLabels := make([]*fieldInfo, len(headers)) // Used to store the corresponding header <-> position in CSV + headerCount := map[string]int{} + for i, csvColumnHeader := range headers { + curHeaderCount := headerCount[csvColumnHeader] + if fieldInfo := getCSVFieldPosition(csvColumnHeader, structInfo, curHeaderCount); fieldInfo != nil { + csvHeadersLabels[i] = fieldInfo + if ShouldAlignDuplicateHeadersWithStructFieldOrder { + curHeaderCount++ + headerCount[csvColumnHeader] = curHeaderCount + } + } + } + + if FailIfDoubleHeaderNames { + if err := maybeDoubleHeaderNames(headers); err != nil { + return err + } + } + + um.Headers = headers + um.fieldInfoMap = csvHeadersLabels + um.MismatchedHeaders = mismatchHeaderFields(structInfo.Fields, headers) + um.MismatchedStructFields = mismatchStructFields(structInfo.Fields, headers) + um.out = s + return nil +} + +// unmarshalRow converts a CSV row to a struct, based on CSV struct tags. +// If unmatched is non nil, it is populated with any columns that don't map to a struct field +func (um *Unmarshaller) unmarshalRow(row []string, unmatched map[string]string) (interface{}, error) { + isPointer := false + concreteOutType := um.outType + if um.outType.Kind() == reflect.Ptr { + isPointer = true + concreteOutType = concreteOutType.Elem() + } + outValue := createNewOutInner(isPointer, concreteOutType) + for j, csvColumnContent := range row { + if j < len(um.fieldInfoMap) && um.fieldInfoMap[j] != nil { + fieldInfo := um.fieldInfoMap[j] + if err := setInnerField(&outValue, isPointer, fieldInfo.IndexChain, csvColumnContent, fieldInfo.omitEmpty); err != nil { // Set field of struct + return nil, fmt.Errorf("cannot assign field at %v to %s through index chain %v: %v", j, outValue.Type(), fieldInfo.IndexChain, err) + } + } else if unmatched != nil { + unmatched[um.Headers[j]] = csvColumnContent + } + } + return outValue.Interface(), nil +} + +// RenormalizeHeaders will remap the header names based on the headerNormalizer. +// This can be used to map a CSV to a struct where the CSV header names do not match in the file but a mapping is known +func (um *Unmarshaller) RenormalizeHeaders(headerNormalizer func([]string) []string) error { + headers := um.Headers + if headerNormalizer != nil { + headers = headerNormalizer(headers) + } + err := validate(um, um.out, headers) + if err != nil { + return err + } + + return nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/.env.example b/vendor/github.com/netbox-community/go-netbox/v3/.env.example new file mode 100644 index 00000000..eed89166 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/.env.example @@ -0,0 +1,2 @@ +# Docker +#USER_ID=1000 diff --git a/vendor/github.com/netbox-community/go-netbox/v3/.gitignore b/vendor/github.com/netbox-community/go-netbox/v3/.gitignore new file mode 100644 index 00000000..df089032 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +/.env diff --git a/vendor/github.com/netbox-community/go-netbox/v3/.openapi-generator-ignore b/vendor/github.com/netbox-community/go-netbox/v3/.openapi-generator-ignore new file mode 100644 index 00000000..6eba4737 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/.openapi-generator-ignore @@ -0,0 +1,8 @@ +# Already part of the project +/.gitignore +/api/openapi.yaml +/README.md + +# Unwanted +/.travis.yml +/git_push.sh diff --git a/vendor/github.com/netbox-community/go-netbox/v3/AUTHORS b/vendor/github.com/netbox-community/go-netbox/v3/AUTHORS new file mode 100644 index 00000000..e2b9b5ae --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/AUTHORS @@ -0,0 +1,21 @@ +Maintainers +---------- +Annika Wickert +Keiichi kobayashi +Víctor Díaz + +Original Maintainer +---------- +DigitalOcean, Inc + +Original Author +--------------- +Matt Layher + +Contributors +------------ +Allan Liu +Dave Cameron +Quan D. Hoang +David Dymko +Hirano Yuki diff --git a/vendor/github.com/netbox-community/go-netbox/v3/Dockerfile b/vendor/github.com/netbox-community/go-netbox/v3/Dockerfile new file mode 100644 index 00000000..09400915 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/Dockerfile @@ -0,0 +1,44 @@ +ARG GO_VERSION=1.21.6-bookworm +ARG GOIMPORTS_VERSION=0.16.1 +ARG DELVE_VERSION=1.22.0 + + +## Base image +FROM golang:${GO_VERSION} AS base + +WORKDIR /go/src/app + +ENV CGO_ENABLED=0 + + +## Development image +FROM base AS development + +ARG GOIMPORTS_VERSION +ARG DELVE_VERSION + +RUN apt update \ + && apt install -y \ + curl \ + git \ + jq \ + python3 \ + python3-pip \ + zsh \ + && apt clean \ + && pip install --break-system-packages \ + pyyaml \ + && go install golang.org/x/tools/cmd/goimports@v${GOIMPORTS_VERSION} \ + && go install github.com/go-delve/delve/cmd/dlv@v${DELVE_VERSION} + +ARG USER_ID=1000 +ENV USER_NAME=default + +RUN useradd --user-group --create-home --uid ${USER_ID} ${USER_NAME} \ + && chown -R ${USER_NAME}: /go + +USER ${USER_NAME} + +ENV PROMPT="%B%F{cyan}%n%f@%m:%F{yellow}%~%f %F{%(?.green.red[%?] )}>%f %b" + +RUN touch /home/${USER_NAME}/.zshrc diff --git a/vendor/github.com/netbox-community/go-netbox/v3/Makefile b/vendor/github.com/netbox-community/go-netbox/v3/Makefile new file mode 100644 index 00000000..cb3f50ea --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/Makefile @@ -0,0 +1,43 @@ +# Helpers +IS_DARWIN := $(filter Darwin,$(shell uname -s)) + +define set_env + sed $(if $(IS_DARWIN),-i "",-i) -e "s/^#*\($(1)=\).*/$(if $(2),,#)\1$(2)/" .env +endef + +EXEC := docker compose exec main + +# Environment recipes +.PHONY: default +default: init up + +.PHONY: init +init: + test -f .env || cp .env.example .env + $(call set_env,USER_ID,$(shell id -u)) + +.PHONY: up +up: + DOCKER_BUILDKIT=1 docker compose up -d --build + +.PHONY: down +down: + docker compose down + +.PHONY: shell +shell: + $(EXEC) zsh + +# Project recipes +.PHONY: build +build: + $(EXEC) ./scripts/set-versions.sh $(NETBOX_VERSION) $(NETBOX_DOCKER_VERSION) + ./scripts/fetch-spec.sh $$(cat api/netbox_version) $$(cat api/netbox_docker_version) + $(EXEC) ./scripts/fix-spec.py + ./scripts/generate-code.sh + $(EXEC) go mod tidy + $(EXEC) goimports -w . + +.PHONY: test +test: + $(EXEC) go test -v ./... diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_circuits.go b/vendor/github.com/netbox-community/go-netbox/v3/api_circuits.go new file mode 100644 index 00000000..d42af1d2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_circuits.go @@ -0,0 +1,14347 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// CircuitsAPIService CircuitsAPI service +type CircuitsAPIService service + +type ApiCircuitsCircuitTerminationsBulkDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitTerminationRequest *[]CircuitTerminationRequest +} + +func (r ApiCircuitsCircuitTerminationsBulkDestroyRequest) CircuitTerminationRequest(circuitTerminationRequest []CircuitTerminationRequest) ApiCircuitsCircuitTerminationsBulkDestroyRequest { + r.circuitTerminationRequest = &circuitTerminationRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsBulkDestroyExecute(r) +} + +/* +CircuitsCircuitTerminationsBulkDestroy Method for CircuitsCircuitTerminationsBulkDestroy + +Delete a list of circuit termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTerminationsBulkDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsBulkDestroy(ctx context.Context) ApiCircuitsCircuitTerminationsBulkDestroyRequest { + return ApiCircuitsCircuitTerminationsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsCircuitTerminationsBulkDestroyExecute(r ApiCircuitsCircuitTerminationsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTerminationRequest == nil { + return nil, reportError("circuitTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitTerminationRequest *[]CircuitTerminationRequest +} + +func (r ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest) CircuitTerminationRequest(circuitTerminationRequest []CircuitTerminationRequest) ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest { + r.circuitTerminationRequest = &circuitTerminationRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest) Execute() ([]CircuitTermination, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsBulkPartialUpdateExecute(r) +} + +/* +CircuitsCircuitTerminationsBulkPartialUpdate Method for CircuitsCircuitTerminationsBulkPartialUpdate + +Patch a list of circuit termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsBulkPartialUpdate(ctx context.Context) ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest { + return ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CircuitTermination +func (a *CircuitsAPIService) CircuitsCircuitTerminationsBulkPartialUpdateExecute(r ApiCircuitsCircuitTerminationsBulkPartialUpdateRequest) ([]CircuitTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CircuitTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTerminationRequest == nil { + return localVarReturnValue, nil, reportError("circuitTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsBulkUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitTerminationRequest *[]CircuitTerminationRequest +} + +func (r ApiCircuitsCircuitTerminationsBulkUpdateRequest) CircuitTerminationRequest(circuitTerminationRequest []CircuitTerminationRequest) ApiCircuitsCircuitTerminationsBulkUpdateRequest { + r.circuitTerminationRequest = &circuitTerminationRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsBulkUpdateRequest) Execute() ([]CircuitTermination, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsBulkUpdateExecute(r) +} + +/* +CircuitsCircuitTerminationsBulkUpdate Method for CircuitsCircuitTerminationsBulkUpdate + +Put a list of circuit termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTerminationsBulkUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsBulkUpdate(ctx context.Context) ApiCircuitsCircuitTerminationsBulkUpdateRequest { + return ApiCircuitsCircuitTerminationsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CircuitTermination +func (a *CircuitsAPIService) CircuitsCircuitTerminationsBulkUpdateExecute(r ApiCircuitsCircuitTerminationsBulkUpdateRequest) ([]CircuitTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CircuitTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTerminationRequest == nil { + return localVarReturnValue, nil, reportError("circuitTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsCreateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + writableCircuitTerminationRequest *WritableCircuitTerminationRequest +} + +func (r ApiCircuitsCircuitTerminationsCreateRequest) WritableCircuitTerminationRequest(writableCircuitTerminationRequest WritableCircuitTerminationRequest) ApiCircuitsCircuitTerminationsCreateRequest { + r.writableCircuitTerminationRequest = &writableCircuitTerminationRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsCreateRequest) Execute() (*CircuitTermination, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsCreateExecute(r) +} + +/* +CircuitsCircuitTerminationsCreate Method for CircuitsCircuitTerminationsCreate + +Post a list of circuit termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTerminationsCreateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsCreate(ctx context.Context) ApiCircuitsCircuitTerminationsCreateRequest { + return ApiCircuitsCircuitTerminationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CircuitTermination +func (a *CircuitsAPIService) CircuitsCircuitTerminationsCreateExecute(r ApiCircuitsCircuitTerminationsCreateRequest) (*CircuitTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCircuitTerminationRequest == nil { + return localVarReturnValue, nil, reportError("writableCircuitTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCircuitTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsCircuitTerminationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsDestroyExecute(r) +} + +/* +CircuitsCircuitTerminationsDestroy Method for CircuitsCircuitTerminationsDestroy + +Delete a circuit termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit termination. + @return ApiCircuitsCircuitTerminationsDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsDestroy(ctx context.Context, id int32) ApiCircuitsCircuitTerminationsDestroyRequest { + return ApiCircuitsCircuitTerminationsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsCircuitTerminationsDestroyExecute(r ApiCircuitsCircuitTerminationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsListRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + cableEnd *string + cableEndN *string + cabled *bool + circuitId *[]int32 + circuitIdN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + occupied *bool + offset *int32 + ordering *string + portSpeed *[]int32 + portSpeedEmpty *bool + portSpeedGt *[]int32 + portSpeedGte *[]int32 + portSpeedLt *[]int32 + portSpeedLte *[]int32 + portSpeedN *[]int32 + providerNetworkId *[]*int32 + providerNetworkIdN *[]*int32 + q *string + site *[]string + siteN *[]string + siteId *[]*int32 + siteIdN *[]*int32 + tag *[]string + tagN *[]string + termSide *string + termSideN *string + updatedByRequest *string + upstreamSpeed *[]int32 + upstreamSpeedEmpty *bool + upstreamSpeedGt *[]int32 + upstreamSpeedGte *[]int32 + upstreamSpeedLt *[]int32 + upstreamSpeedLte *[]int32 + upstreamSpeedN *[]int32 + xconnectId *[]string + xconnectIdEmpty *bool + xconnectIdIc *[]string + xconnectIdIe *[]string + xconnectIdIew *[]string + xconnectIdIsw *[]string + xconnectIdN *[]string + xconnectIdNic *[]string + xconnectIdNie *[]string + xconnectIdNiew *[]string + xconnectIdNisw *[]string +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CableEnd(cableEnd string) ApiCircuitsCircuitTerminationsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CableEndN(cableEndN string) ApiCircuitsCircuitTerminationsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) Cabled(cabled bool) ApiCircuitsCircuitTerminationsListRequest { + r.cabled = &cabled + return r +} + +// Circuit +func (r ApiCircuitsCircuitTerminationsListRequest) CircuitId(circuitId []int32) ApiCircuitsCircuitTerminationsListRequest { + r.circuitId = &circuitId + return r +} + +// Circuit +func (r ApiCircuitsCircuitTerminationsListRequest) CircuitIdN(circuitIdN []int32) ApiCircuitsCircuitTerminationsListRequest { + r.circuitIdN = &circuitIdN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) Created(created []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.created = &created + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CreatedGt(createdGt []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CreatedGte(createdGte []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CreatedLt(createdLt []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CreatedLte(createdLte []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CreatedN(createdN []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) CreatedByRequest(createdByRequest string) ApiCircuitsCircuitTerminationsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) Description(description []string) ApiCircuitsCircuitTerminationsListRequest { + r.description = &description + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionIc(descriptionIc []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionIe(descriptionIe []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionIew(descriptionIew []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionIsw(descriptionIsw []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionN(descriptionN []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionNic(descriptionNic []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionNie(descriptionNie []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionNiew(descriptionNiew []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) DescriptionNisw(descriptionNisw []string) ApiCircuitsCircuitTerminationsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) Id(id []int32) ApiCircuitsCircuitTerminationsListRequest { + r.id = &id + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) IdEmpty(idEmpty bool) ApiCircuitsCircuitTerminationsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) IdGt(idGt []int32) ApiCircuitsCircuitTerminationsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) IdGte(idGte []int32) ApiCircuitsCircuitTerminationsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) IdLt(idLt []int32) ApiCircuitsCircuitTerminationsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) IdLte(idLte []int32) ApiCircuitsCircuitTerminationsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) IdN(idN []int32) ApiCircuitsCircuitTerminationsListRequest { + r.idN = &idN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) LastUpdated(lastUpdated []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCircuitsCircuitTerminationsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCircuitsCircuitTerminationsListRequest) Limit(limit int32) ApiCircuitsCircuitTerminationsListRequest { + r.limit = &limit + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) ModifiedByRequest(modifiedByRequest string) ApiCircuitsCircuitTerminationsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) Occupied(occupied bool) ApiCircuitsCircuitTerminationsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiCircuitsCircuitTerminationsListRequest) Offset(offset int32) ApiCircuitsCircuitTerminationsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCircuitsCircuitTerminationsListRequest) Ordering(ordering string) ApiCircuitsCircuitTerminationsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) PortSpeed(portSpeed []int32) ApiCircuitsCircuitTerminationsListRequest { + r.portSpeed = &portSpeed + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) PortSpeedEmpty(portSpeedEmpty bool) ApiCircuitsCircuitTerminationsListRequest { + r.portSpeedEmpty = &portSpeedEmpty + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) PortSpeedGt(portSpeedGt []int32) ApiCircuitsCircuitTerminationsListRequest { + r.portSpeedGt = &portSpeedGt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) PortSpeedGte(portSpeedGte []int32) ApiCircuitsCircuitTerminationsListRequest { + r.portSpeedGte = &portSpeedGte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) PortSpeedLt(portSpeedLt []int32) ApiCircuitsCircuitTerminationsListRequest { + r.portSpeedLt = &portSpeedLt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) PortSpeedLte(portSpeedLte []int32) ApiCircuitsCircuitTerminationsListRequest { + r.portSpeedLte = &portSpeedLte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) PortSpeedN(portSpeedN []int32) ApiCircuitsCircuitTerminationsListRequest { + r.portSpeedN = &portSpeedN + return r +} + +// ProviderNetwork (ID) +func (r ApiCircuitsCircuitTerminationsListRequest) ProviderNetworkId(providerNetworkId []*int32) ApiCircuitsCircuitTerminationsListRequest { + r.providerNetworkId = &providerNetworkId + return r +} + +// ProviderNetwork (ID) +func (r ApiCircuitsCircuitTerminationsListRequest) ProviderNetworkIdN(providerNetworkIdN []*int32) ApiCircuitsCircuitTerminationsListRequest { + r.providerNetworkIdN = &providerNetworkIdN + return r +} + +// Search +func (r ApiCircuitsCircuitTerminationsListRequest) Q(q string) ApiCircuitsCircuitTerminationsListRequest { + r.q = &q + return r +} + +// Site (slug) +func (r ApiCircuitsCircuitTerminationsListRequest) Site(site []string) ApiCircuitsCircuitTerminationsListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiCircuitsCircuitTerminationsListRequest) SiteN(siteN []string) ApiCircuitsCircuitTerminationsListRequest { + r.siteN = &siteN + return r +} + +// Site (ID) +func (r ApiCircuitsCircuitTerminationsListRequest) SiteId(siteId []*int32) ApiCircuitsCircuitTerminationsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiCircuitsCircuitTerminationsListRequest) SiteIdN(siteIdN []*int32) ApiCircuitsCircuitTerminationsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) Tag(tag []string) ApiCircuitsCircuitTerminationsListRequest { + r.tag = &tag + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) TagN(tagN []string) ApiCircuitsCircuitTerminationsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) TermSide(termSide string) ApiCircuitsCircuitTerminationsListRequest { + r.termSide = &termSide + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) TermSideN(termSideN string) ApiCircuitsCircuitTerminationsListRequest { + r.termSideN = &termSideN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpdatedByRequest(updatedByRequest string) ApiCircuitsCircuitTerminationsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpstreamSpeed(upstreamSpeed []int32) ApiCircuitsCircuitTerminationsListRequest { + r.upstreamSpeed = &upstreamSpeed + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpstreamSpeedEmpty(upstreamSpeedEmpty bool) ApiCircuitsCircuitTerminationsListRequest { + r.upstreamSpeedEmpty = &upstreamSpeedEmpty + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpstreamSpeedGt(upstreamSpeedGt []int32) ApiCircuitsCircuitTerminationsListRequest { + r.upstreamSpeedGt = &upstreamSpeedGt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpstreamSpeedGte(upstreamSpeedGte []int32) ApiCircuitsCircuitTerminationsListRequest { + r.upstreamSpeedGte = &upstreamSpeedGte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpstreamSpeedLt(upstreamSpeedLt []int32) ApiCircuitsCircuitTerminationsListRequest { + r.upstreamSpeedLt = &upstreamSpeedLt + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpstreamSpeedLte(upstreamSpeedLte []int32) ApiCircuitsCircuitTerminationsListRequest { + r.upstreamSpeedLte = &upstreamSpeedLte + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) UpstreamSpeedN(upstreamSpeedN []int32) ApiCircuitsCircuitTerminationsListRequest { + r.upstreamSpeedN = &upstreamSpeedN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectId(xconnectId []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectId = &xconnectId + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdEmpty(xconnectIdEmpty bool) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdEmpty = &xconnectIdEmpty + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdIc(xconnectIdIc []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdIc = &xconnectIdIc + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdIe(xconnectIdIe []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdIe = &xconnectIdIe + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdIew(xconnectIdIew []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdIew = &xconnectIdIew + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdIsw(xconnectIdIsw []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdIsw = &xconnectIdIsw + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdN(xconnectIdN []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdN = &xconnectIdN + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdNic(xconnectIdNic []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdNic = &xconnectIdNic + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdNie(xconnectIdNie []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdNie = &xconnectIdNie + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdNiew(xconnectIdNiew []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdNiew = &xconnectIdNiew + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) XconnectIdNisw(xconnectIdNisw []string) ApiCircuitsCircuitTerminationsListRequest { + r.xconnectIdNisw = &xconnectIdNisw + return r +} + +func (r ApiCircuitsCircuitTerminationsListRequest) Execute() (*PaginatedCircuitTerminationList, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsListExecute(r) +} + +/* +CircuitsCircuitTerminationsList Method for CircuitsCircuitTerminationsList + +Get a list of circuit termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTerminationsListRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsList(ctx context.Context) ApiCircuitsCircuitTerminationsListRequest { + return ApiCircuitsCircuitTerminationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCircuitTerminationList +func (a *CircuitsAPIService) CircuitsCircuitTerminationsListExecute(r ApiCircuitsCircuitTerminationsListRequest) (*PaginatedCircuitTerminationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCircuitTerminationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.circuitId != nil { + t := *r.circuitId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "circuit_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "circuit_id", t, "multi") + } + } + if r.circuitIdN != nil { + t := *r.circuitIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "circuit_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "circuit_id__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.portSpeed != nil { + t := *r.portSpeed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed", t, "multi") + } + } + if r.portSpeedEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__empty", r.portSpeedEmpty, "") + } + if r.portSpeedGt != nil { + t := *r.portSpeedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__gt", t, "multi") + } + } + if r.portSpeedGte != nil { + t := *r.portSpeedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__gte", t, "multi") + } + } + if r.portSpeedLt != nil { + t := *r.portSpeedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__lt", t, "multi") + } + } + if r.portSpeedLte != nil { + t := *r.portSpeedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__lte", t, "multi") + } + } + if r.portSpeedN != nil { + t := *r.portSpeedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "port_speed__n", t, "multi") + } + } + if r.providerNetworkId != nil { + t := *r.providerNetworkId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id", t, "multi") + } + } + if r.providerNetworkIdN != nil { + t := *r.providerNetworkIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.termSide != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "term_side", r.termSide, "") + } + if r.termSideN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "term_side__n", r.termSideN, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.upstreamSpeed != nil { + t := *r.upstreamSpeed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed", t, "multi") + } + } + if r.upstreamSpeedEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__empty", r.upstreamSpeedEmpty, "") + } + if r.upstreamSpeedGt != nil { + t := *r.upstreamSpeedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__gt", t, "multi") + } + } + if r.upstreamSpeedGte != nil { + t := *r.upstreamSpeedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__gte", t, "multi") + } + } + if r.upstreamSpeedLt != nil { + t := *r.upstreamSpeedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__lt", t, "multi") + } + } + if r.upstreamSpeedLte != nil { + t := *r.upstreamSpeedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__lte", t, "multi") + } + } + if r.upstreamSpeedN != nil { + t := *r.upstreamSpeedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "upstream_speed__n", t, "multi") + } + } + if r.xconnectId != nil { + t := *r.xconnectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id", t, "multi") + } + } + if r.xconnectIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__empty", r.xconnectIdEmpty, "") + } + if r.xconnectIdIc != nil { + t := *r.xconnectIdIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__ic", t, "multi") + } + } + if r.xconnectIdIe != nil { + t := *r.xconnectIdIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__ie", t, "multi") + } + } + if r.xconnectIdIew != nil { + t := *r.xconnectIdIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__iew", t, "multi") + } + } + if r.xconnectIdIsw != nil { + t := *r.xconnectIdIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__isw", t, "multi") + } + } + if r.xconnectIdN != nil { + t := *r.xconnectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__n", t, "multi") + } + } + if r.xconnectIdNic != nil { + t := *r.xconnectIdNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__nic", t, "multi") + } + } + if r.xconnectIdNie != nil { + t := *r.xconnectIdNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__nie", t, "multi") + } + } + if r.xconnectIdNiew != nil { + t := *r.xconnectIdNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__niew", t, "multi") + } + } + if r.xconnectIdNisw != nil { + t := *r.xconnectIdNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "xconnect_id__nisw", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + patchedWritableCircuitTerminationRequest *PatchedWritableCircuitTerminationRequest +} + +func (r ApiCircuitsCircuitTerminationsPartialUpdateRequest) PatchedWritableCircuitTerminationRequest(patchedWritableCircuitTerminationRequest PatchedWritableCircuitTerminationRequest) ApiCircuitsCircuitTerminationsPartialUpdateRequest { + r.patchedWritableCircuitTerminationRequest = &patchedWritableCircuitTerminationRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsPartialUpdateRequest) Execute() (*CircuitTermination, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsPartialUpdateExecute(r) +} + +/* +CircuitsCircuitTerminationsPartialUpdate Method for CircuitsCircuitTerminationsPartialUpdate + +Patch a circuit termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit termination. + @return ApiCircuitsCircuitTerminationsPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsPartialUpdate(ctx context.Context, id int32) ApiCircuitsCircuitTerminationsPartialUpdateRequest { + return ApiCircuitsCircuitTerminationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CircuitTermination +func (a *CircuitsAPIService) CircuitsCircuitTerminationsPartialUpdateExecute(r ApiCircuitsCircuitTerminationsPartialUpdateRequest) (*CircuitTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableCircuitTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsPathsRetrieveRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsCircuitTerminationsPathsRetrieveRequest) Execute() (*CircuitTermination, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsPathsRetrieveExecute(r) +} + +/* +CircuitsCircuitTerminationsPathsRetrieve Method for CircuitsCircuitTerminationsPathsRetrieve + +Return all CablePaths which traverse a given pass-through port. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit termination. + @return ApiCircuitsCircuitTerminationsPathsRetrieveRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsPathsRetrieve(ctx context.Context, id int32) ApiCircuitsCircuitTerminationsPathsRetrieveRequest { + return ApiCircuitsCircuitTerminationsPathsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CircuitTermination +func (a *CircuitsAPIService) CircuitsCircuitTerminationsPathsRetrieveExecute(r ApiCircuitsCircuitTerminationsPathsRetrieveRequest) (*CircuitTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsPathsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/{id}/paths/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsRetrieveRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsCircuitTerminationsRetrieveRequest) Execute() (*CircuitTermination, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsRetrieveExecute(r) +} + +/* +CircuitsCircuitTerminationsRetrieve Method for CircuitsCircuitTerminationsRetrieve + +Get a circuit termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit termination. + @return ApiCircuitsCircuitTerminationsRetrieveRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsRetrieve(ctx context.Context, id int32) ApiCircuitsCircuitTerminationsRetrieveRequest { + return ApiCircuitsCircuitTerminationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CircuitTermination +func (a *CircuitsAPIService) CircuitsCircuitTerminationsRetrieveExecute(r ApiCircuitsCircuitTerminationsRetrieveRequest) (*CircuitTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTerminationsUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + writableCircuitTerminationRequest *WritableCircuitTerminationRequest +} + +func (r ApiCircuitsCircuitTerminationsUpdateRequest) WritableCircuitTerminationRequest(writableCircuitTerminationRequest WritableCircuitTerminationRequest) ApiCircuitsCircuitTerminationsUpdateRequest { + r.writableCircuitTerminationRequest = &writableCircuitTerminationRequest + return r +} + +func (r ApiCircuitsCircuitTerminationsUpdateRequest) Execute() (*CircuitTermination, *http.Response, error) { + return r.ApiService.CircuitsCircuitTerminationsUpdateExecute(r) +} + +/* +CircuitsCircuitTerminationsUpdate Method for CircuitsCircuitTerminationsUpdate + +Put a circuit termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit termination. + @return ApiCircuitsCircuitTerminationsUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTerminationsUpdate(ctx context.Context, id int32) ApiCircuitsCircuitTerminationsUpdateRequest { + return ApiCircuitsCircuitTerminationsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CircuitTermination +func (a *CircuitsAPIService) CircuitsCircuitTerminationsUpdateExecute(r ApiCircuitsCircuitTerminationsUpdateRequest) (*CircuitTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTerminationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCircuitTerminationRequest == nil { + return localVarReturnValue, nil, reportError("writableCircuitTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCircuitTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesBulkDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitTypeRequest *[]CircuitTypeRequest +} + +func (r ApiCircuitsCircuitTypesBulkDestroyRequest) CircuitTypeRequest(circuitTypeRequest []CircuitTypeRequest) ApiCircuitsCircuitTypesBulkDestroyRequest { + r.circuitTypeRequest = &circuitTypeRequest + return r +} + +func (r ApiCircuitsCircuitTypesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsCircuitTypesBulkDestroyExecute(r) +} + +/* +CircuitsCircuitTypesBulkDestroy Method for CircuitsCircuitTypesBulkDestroy + +Delete a list of circuit type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTypesBulkDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesBulkDestroy(ctx context.Context) ApiCircuitsCircuitTypesBulkDestroyRequest { + return ApiCircuitsCircuitTypesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsCircuitTypesBulkDestroyExecute(r ApiCircuitsCircuitTypesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTypeRequest == nil { + return nil, reportError("circuitTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitTypeRequest *[]CircuitTypeRequest +} + +func (r ApiCircuitsCircuitTypesBulkPartialUpdateRequest) CircuitTypeRequest(circuitTypeRequest []CircuitTypeRequest) ApiCircuitsCircuitTypesBulkPartialUpdateRequest { + r.circuitTypeRequest = &circuitTypeRequest + return r +} + +func (r ApiCircuitsCircuitTypesBulkPartialUpdateRequest) Execute() ([]CircuitType, *http.Response, error) { + return r.ApiService.CircuitsCircuitTypesBulkPartialUpdateExecute(r) +} + +/* +CircuitsCircuitTypesBulkPartialUpdate Method for CircuitsCircuitTypesBulkPartialUpdate + +Patch a list of circuit type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTypesBulkPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesBulkPartialUpdate(ctx context.Context) ApiCircuitsCircuitTypesBulkPartialUpdateRequest { + return ApiCircuitsCircuitTypesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CircuitType +func (a *CircuitsAPIService) CircuitsCircuitTypesBulkPartialUpdateExecute(r ApiCircuitsCircuitTypesBulkPartialUpdateRequest) ([]CircuitType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CircuitType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTypeRequest == nil { + return localVarReturnValue, nil, reportError("circuitTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesBulkUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitTypeRequest *[]CircuitTypeRequest +} + +func (r ApiCircuitsCircuitTypesBulkUpdateRequest) CircuitTypeRequest(circuitTypeRequest []CircuitTypeRequest) ApiCircuitsCircuitTypesBulkUpdateRequest { + r.circuitTypeRequest = &circuitTypeRequest + return r +} + +func (r ApiCircuitsCircuitTypesBulkUpdateRequest) Execute() ([]CircuitType, *http.Response, error) { + return r.ApiService.CircuitsCircuitTypesBulkUpdateExecute(r) +} + +/* +CircuitsCircuitTypesBulkUpdate Method for CircuitsCircuitTypesBulkUpdate + +Put a list of circuit type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTypesBulkUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesBulkUpdate(ctx context.Context) ApiCircuitsCircuitTypesBulkUpdateRequest { + return ApiCircuitsCircuitTypesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CircuitType +func (a *CircuitsAPIService) CircuitsCircuitTypesBulkUpdateExecute(r ApiCircuitsCircuitTypesBulkUpdateRequest) ([]CircuitType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CircuitType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTypeRequest == nil { + return localVarReturnValue, nil, reportError("circuitTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesCreateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitTypeRequest *CircuitTypeRequest +} + +func (r ApiCircuitsCircuitTypesCreateRequest) CircuitTypeRequest(circuitTypeRequest CircuitTypeRequest) ApiCircuitsCircuitTypesCreateRequest { + r.circuitTypeRequest = &circuitTypeRequest + return r +} + +func (r ApiCircuitsCircuitTypesCreateRequest) Execute() (*CircuitType, *http.Response, error) { + return r.ApiService.CircuitsCircuitTypesCreateExecute(r) +} + +/* +CircuitsCircuitTypesCreate Method for CircuitsCircuitTypesCreate + +Post a list of circuit type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTypesCreateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesCreate(ctx context.Context) ApiCircuitsCircuitTypesCreateRequest { + return ApiCircuitsCircuitTypesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CircuitType +func (a *CircuitsAPIService) CircuitsCircuitTypesCreateExecute(r ApiCircuitsCircuitTypesCreateRequest) (*CircuitType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTypeRequest == nil { + return localVarReturnValue, nil, reportError("circuitTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsCircuitTypesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsCircuitTypesDestroyExecute(r) +} + +/* +CircuitsCircuitTypesDestroy Method for CircuitsCircuitTypesDestroy + +Delete a circuit type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit type. + @return ApiCircuitsCircuitTypesDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesDestroy(ctx context.Context, id int32) ApiCircuitsCircuitTypesDestroyRequest { + return ApiCircuitsCircuitTypesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsCircuitTypesDestroyExecute(r ApiCircuitsCircuitTypesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesListRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiCircuitsCircuitTypesListRequest) Color(color []string) ApiCircuitsCircuitTypesListRequest { + r.color = &color + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorEmpty(colorEmpty bool) ApiCircuitsCircuitTypesListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorIc(colorIc []string) ApiCircuitsCircuitTypesListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorIe(colorIe []string) ApiCircuitsCircuitTypesListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorIew(colorIew []string) ApiCircuitsCircuitTypesListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorIsw(colorIsw []string) ApiCircuitsCircuitTypesListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorN(colorN []string) ApiCircuitsCircuitTypesListRequest { + r.colorN = &colorN + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorNic(colorNic []string) ApiCircuitsCircuitTypesListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorNie(colorNie []string) ApiCircuitsCircuitTypesListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorNiew(colorNiew []string) ApiCircuitsCircuitTypesListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ColorNisw(colorNisw []string) ApiCircuitsCircuitTypesListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) Created(created []time.Time) ApiCircuitsCircuitTypesListRequest { + r.created = &created + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCircuitsCircuitTypesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) CreatedGt(createdGt []time.Time) ApiCircuitsCircuitTypesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) CreatedGte(createdGte []time.Time) ApiCircuitsCircuitTypesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) CreatedLt(createdLt []time.Time) ApiCircuitsCircuitTypesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) CreatedLte(createdLte []time.Time) ApiCircuitsCircuitTypesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) CreatedN(createdN []time.Time) ApiCircuitsCircuitTypesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) CreatedByRequest(createdByRequest string) ApiCircuitsCircuitTypesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) Description(description []string) ApiCircuitsCircuitTypesListRequest { + r.description = &description + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiCircuitsCircuitTypesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionIc(descriptionIc []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionIe(descriptionIe []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionIew(descriptionIew []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionIsw(descriptionIsw []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionN(descriptionN []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionNic(descriptionNic []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionNie(descriptionNie []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionNiew(descriptionNiew []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) DescriptionNisw(descriptionNisw []string) ApiCircuitsCircuitTypesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) Id(id []int32) ApiCircuitsCircuitTypesListRequest { + r.id = &id + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) IdEmpty(idEmpty bool) ApiCircuitsCircuitTypesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) IdGt(idGt []int32) ApiCircuitsCircuitTypesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) IdGte(idGte []int32) ApiCircuitsCircuitTypesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) IdLt(idLt []int32) ApiCircuitsCircuitTypesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) IdLte(idLte []int32) ApiCircuitsCircuitTypesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) IdN(idN []int32) ApiCircuitsCircuitTypesListRequest { + r.idN = &idN + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) LastUpdated(lastUpdated []time.Time) ApiCircuitsCircuitTypesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCircuitsCircuitTypesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCircuitsCircuitTypesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCircuitsCircuitTypesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCircuitsCircuitTypesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCircuitsCircuitTypesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCircuitsCircuitTypesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCircuitsCircuitTypesListRequest) Limit(limit int32) ApiCircuitsCircuitTypesListRequest { + r.limit = &limit + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) ModifiedByRequest(modifiedByRequest string) ApiCircuitsCircuitTypesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) Name(name []string) ApiCircuitsCircuitTypesListRequest { + r.name = &name + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameEmpty(nameEmpty bool) ApiCircuitsCircuitTypesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameIc(nameIc []string) ApiCircuitsCircuitTypesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameIe(nameIe []string) ApiCircuitsCircuitTypesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameIew(nameIew []string) ApiCircuitsCircuitTypesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameIsw(nameIsw []string) ApiCircuitsCircuitTypesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameN(nameN []string) ApiCircuitsCircuitTypesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameNic(nameNic []string) ApiCircuitsCircuitTypesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameNie(nameNie []string) ApiCircuitsCircuitTypesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameNiew(nameNiew []string) ApiCircuitsCircuitTypesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) NameNisw(nameNisw []string) ApiCircuitsCircuitTypesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiCircuitsCircuitTypesListRequest) Offset(offset int32) ApiCircuitsCircuitTypesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCircuitsCircuitTypesListRequest) Ordering(ordering string) ApiCircuitsCircuitTypesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiCircuitsCircuitTypesListRequest) Q(q string) ApiCircuitsCircuitTypesListRequest { + r.q = &q + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) Slug(slug []string) ApiCircuitsCircuitTypesListRequest { + r.slug = &slug + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugEmpty(slugEmpty bool) ApiCircuitsCircuitTypesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugIc(slugIc []string) ApiCircuitsCircuitTypesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugIe(slugIe []string) ApiCircuitsCircuitTypesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugIew(slugIew []string) ApiCircuitsCircuitTypesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugIsw(slugIsw []string) ApiCircuitsCircuitTypesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugN(slugN []string) ApiCircuitsCircuitTypesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugNic(slugNic []string) ApiCircuitsCircuitTypesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugNie(slugNie []string) ApiCircuitsCircuitTypesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugNiew(slugNiew []string) ApiCircuitsCircuitTypesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) SlugNisw(slugNisw []string) ApiCircuitsCircuitTypesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) Tag(tag []string) ApiCircuitsCircuitTypesListRequest { + r.tag = &tag + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) TagN(tagN []string) ApiCircuitsCircuitTypesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) UpdatedByRequest(updatedByRequest string) ApiCircuitsCircuitTypesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCircuitsCircuitTypesListRequest) Execute() (*PaginatedCircuitTypeList, *http.Response, error) { + return r.ApiService.CircuitsCircuitTypesListExecute(r) +} + +/* +CircuitsCircuitTypesList Method for CircuitsCircuitTypesList + +Get a list of circuit type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitTypesListRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesList(ctx context.Context) ApiCircuitsCircuitTypesListRequest { + return ApiCircuitsCircuitTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCircuitTypeList +func (a *CircuitsAPIService) CircuitsCircuitTypesListExecute(r ApiCircuitsCircuitTypesListRequest) (*PaginatedCircuitTypeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCircuitTypeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + patchedCircuitTypeRequest *PatchedCircuitTypeRequest +} + +func (r ApiCircuitsCircuitTypesPartialUpdateRequest) PatchedCircuitTypeRequest(patchedCircuitTypeRequest PatchedCircuitTypeRequest) ApiCircuitsCircuitTypesPartialUpdateRequest { + r.patchedCircuitTypeRequest = &patchedCircuitTypeRequest + return r +} + +func (r ApiCircuitsCircuitTypesPartialUpdateRequest) Execute() (*CircuitType, *http.Response, error) { + return r.ApiService.CircuitsCircuitTypesPartialUpdateExecute(r) +} + +/* +CircuitsCircuitTypesPartialUpdate Method for CircuitsCircuitTypesPartialUpdate + +Patch a circuit type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit type. + @return ApiCircuitsCircuitTypesPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesPartialUpdate(ctx context.Context, id int32) ApiCircuitsCircuitTypesPartialUpdateRequest { + return ApiCircuitsCircuitTypesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CircuitType +func (a *CircuitsAPIService) CircuitsCircuitTypesPartialUpdateExecute(r ApiCircuitsCircuitTypesPartialUpdateRequest) (*CircuitType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedCircuitTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesRetrieveRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsCircuitTypesRetrieveRequest) Execute() (*CircuitType, *http.Response, error) { + return r.ApiService.CircuitsCircuitTypesRetrieveExecute(r) +} + +/* +CircuitsCircuitTypesRetrieve Method for CircuitsCircuitTypesRetrieve + +Get a circuit type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit type. + @return ApiCircuitsCircuitTypesRetrieveRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesRetrieve(ctx context.Context, id int32) ApiCircuitsCircuitTypesRetrieveRequest { + return ApiCircuitsCircuitTypesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CircuitType +func (a *CircuitsAPIService) CircuitsCircuitTypesRetrieveExecute(r ApiCircuitsCircuitTypesRetrieveRequest) (*CircuitType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitTypesUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + circuitTypeRequest *CircuitTypeRequest +} + +func (r ApiCircuitsCircuitTypesUpdateRequest) CircuitTypeRequest(circuitTypeRequest CircuitTypeRequest) ApiCircuitsCircuitTypesUpdateRequest { + r.circuitTypeRequest = &circuitTypeRequest + return r +} + +func (r ApiCircuitsCircuitTypesUpdateRequest) Execute() (*CircuitType, *http.Response, error) { + return r.ApiService.CircuitsCircuitTypesUpdateExecute(r) +} + +/* +CircuitsCircuitTypesUpdate Method for CircuitsCircuitTypesUpdate + +Put a circuit type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit type. + @return ApiCircuitsCircuitTypesUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitTypesUpdate(ctx context.Context, id int32) ApiCircuitsCircuitTypesUpdateRequest { + return ApiCircuitsCircuitTypesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CircuitType +func (a *CircuitsAPIService) CircuitsCircuitTypesUpdateExecute(r ApiCircuitsCircuitTypesUpdateRequest) (*CircuitType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CircuitType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitTypesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuit-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitTypeRequest == nil { + return localVarReturnValue, nil, reportError("circuitTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsBulkDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitRequest *[]CircuitRequest +} + +func (r ApiCircuitsCircuitsBulkDestroyRequest) CircuitRequest(circuitRequest []CircuitRequest) ApiCircuitsCircuitsBulkDestroyRequest { + r.circuitRequest = &circuitRequest + return r +} + +func (r ApiCircuitsCircuitsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsCircuitsBulkDestroyExecute(r) +} + +/* +CircuitsCircuitsBulkDestroy Method for CircuitsCircuitsBulkDestroy + +Delete a list of circuit objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitsBulkDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsBulkDestroy(ctx context.Context) ApiCircuitsCircuitsBulkDestroyRequest { + return ApiCircuitsCircuitsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsCircuitsBulkDestroyExecute(r ApiCircuitsCircuitsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitRequest == nil { + return nil, reportError("circuitRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitRequest *[]CircuitRequest +} + +func (r ApiCircuitsCircuitsBulkPartialUpdateRequest) CircuitRequest(circuitRequest []CircuitRequest) ApiCircuitsCircuitsBulkPartialUpdateRequest { + r.circuitRequest = &circuitRequest + return r +} + +func (r ApiCircuitsCircuitsBulkPartialUpdateRequest) Execute() ([]Circuit, *http.Response, error) { + return r.ApiService.CircuitsCircuitsBulkPartialUpdateExecute(r) +} + +/* +CircuitsCircuitsBulkPartialUpdate Method for CircuitsCircuitsBulkPartialUpdate + +Patch a list of circuit objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitsBulkPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsBulkPartialUpdate(ctx context.Context) ApiCircuitsCircuitsBulkPartialUpdateRequest { + return ApiCircuitsCircuitsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Circuit +func (a *CircuitsAPIService) CircuitsCircuitsBulkPartialUpdateExecute(r ApiCircuitsCircuitsBulkPartialUpdateRequest) ([]Circuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Circuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitRequest == nil { + return localVarReturnValue, nil, reportError("circuitRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsBulkUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + circuitRequest *[]CircuitRequest +} + +func (r ApiCircuitsCircuitsBulkUpdateRequest) CircuitRequest(circuitRequest []CircuitRequest) ApiCircuitsCircuitsBulkUpdateRequest { + r.circuitRequest = &circuitRequest + return r +} + +func (r ApiCircuitsCircuitsBulkUpdateRequest) Execute() ([]Circuit, *http.Response, error) { + return r.ApiService.CircuitsCircuitsBulkUpdateExecute(r) +} + +/* +CircuitsCircuitsBulkUpdate Method for CircuitsCircuitsBulkUpdate + +Put a list of circuit objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitsBulkUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsBulkUpdate(ctx context.Context) ApiCircuitsCircuitsBulkUpdateRequest { + return ApiCircuitsCircuitsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Circuit +func (a *CircuitsAPIService) CircuitsCircuitsBulkUpdateExecute(r ApiCircuitsCircuitsBulkUpdateRequest) ([]Circuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Circuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.circuitRequest == nil { + return localVarReturnValue, nil, reportError("circuitRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.circuitRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsCreateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + writableCircuitRequest *WritableCircuitRequest +} + +func (r ApiCircuitsCircuitsCreateRequest) WritableCircuitRequest(writableCircuitRequest WritableCircuitRequest) ApiCircuitsCircuitsCreateRequest { + r.writableCircuitRequest = &writableCircuitRequest + return r +} + +func (r ApiCircuitsCircuitsCreateRequest) Execute() (*Circuit, *http.Response, error) { + return r.ApiService.CircuitsCircuitsCreateExecute(r) +} + +/* +CircuitsCircuitsCreate Method for CircuitsCircuitsCreate + +Post a list of circuit objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitsCreateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsCreate(ctx context.Context) ApiCircuitsCircuitsCreateRequest { + return ApiCircuitsCircuitsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Circuit +func (a *CircuitsAPIService) CircuitsCircuitsCreateExecute(r ApiCircuitsCircuitsCreateRequest) (*Circuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Circuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCircuitRequest == nil { + return localVarReturnValue, nil, reportError("writableCircuitRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCircuitRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsCircuitsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsCircuitsDestroyExecute(r) +} + +/* +CircuitsCircuitsDestroy Method for CircuitsCircuitsDestroy + +Delete a circuit object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit. + @return ApiCircuitsCircuitsDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsDestroy(ctx context.Context, id int32) ApiCircuitsCircuitsDestroyRequest { + return ApiCircuitsCircuitsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsCircuitsDestroyExecute(r ApiCircuitsCircuitsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsListRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + cid *[]string + cidEmpty *bool + cidIc *[]string + cidIe *[]string + cidIew *[]string + cidIsw *[]string + cidN *[]string + cidNic *[]string + cidNie *[]string + cidNiew *[]string + cidNisw *[]string + commitRate *[]int32 + commitRateEmpty *bool + commitRateGt *[]int32 + commitRateGte *[]int32 + commitRateLt *[]int32 + commitRateLte *[]int32 + commitRateN *[]int32 + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + installDate *[]string + installDateEmpty *bool + installDateGt *[]string + installDateGte *[]string + installDateLt *[]string + installDateLte *[]string + installDateN *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + provider *[]string + providerN *[]string + providerAccountId *[]int32 + providerAccountIdN *[]int32 + providerId *[]int32 + providerIdN *[]int32 + providerNetworkId *[]int32 + providerNetworkIdN *[]int32 + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + terminationDate *[]string + terminationDateEmpty *bool + terminationDateGt *[]string + terminationDateGte *[]string + terminationDateLt *[]string + terminationDateLte *[]string + terminationDateN *[]string + type_ *[]string + typeN *[]string + typeId *[]int32 + typeIdN *[]int32 + updatedByRequest *string +} + +func (r ApiCircuitsCircuitsListRequest) Cid(cid []string) ApiCircuitsCircuitsListRequest { + r.cid = &cid + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidEmpty(cidEmpty bool) ApiCircuitsCircuitsListRequest { + r.cidEmpty = &cidEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidIc(cidIc []string) ApiCircuitsCircuitsListRequest { + r.cidIc = &cidIc + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidIe(cidIe []string) ApiCircuitsCircuitsListRequest { + r.cidIe = &cidIe + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidIew(cidIew []string) ApiCircuitsCircuitsListRequest { + r.cidIew = &cidIew + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidIsw(cidIsw []string) ApiCircuitsCircuitsListRequest { + r.cidIsw = &cidIsw + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidN(cidN []string) ApiCircuitsCircuitsListRequest { + r.cidN = &cidN + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidNic(cidNic []string) ApiCircuitsCircuitsListRequest { + r.cidNic = &cidNic + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidNie(cidNie []string) ApiCircuitsCircuitsListRequest { + r.cidNie = &cidNie + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidNiew(cidNiew []string) ApiCircuitsCircuitsListRequest { + r.cidNiew = &cidNiew + return r +} + +func (r ApiCircuitsCircuitsListRequest) CidNisw(cidNisw []string) ApiCircuitsCircuitsListRequest { + r.cidNisw = &cidNisw + return r +} + +func (r ApiCircuitsCircuitsListRequest) CommitRate(commitRate []int32) ApiCircuitsCircuitsListRequest { + r.commitRate = &commitRate + return r +} + +func (r ApiCircuitsCircuitsListRequest) CommitRateEmpty(commitRateEmpty bool) ApiCircuitsCircuitsListRequest { + r.commitRateEmpty = &commitRateEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) CommitRateGt(commitRateGt []int32) ApiCircuitsCircuitsListRequest { + r.commitRateGt = &commitRateGt + return r +} + +func (r ApiCircuitsCircuitsListRequest) CommitRateGte(commitRateGte []int32) ApiCircuitsCircuitsListRequest { + r.commitRateGte = &commitRateGte + return r +} + +func (r ApiCircuitsCircuitsListRequest) CommitRateLt(commitRateLt []int32) ApiCircuitsCircuitsListRequest { + r.commitRateLt = &commitRateLt + return r +} + +func (r ApiCircuitsCircuitsListRequest) CommitRateLte(commitRateLte []int32) ApiCircuitsCircuitsListRequest { + r.commitRateLte = &commitRateLte + return r +} + +func (r ApiCircuitsCircuitsListRequest) CommitRateN(commitRateN []int32) ApiCircuitsCircuitsListRequest { + r.commitRateN = &commitRateN + return r +} + +// Contact +func (r ApiCircuitsCircuitsListRequest) Contact(contact []int32) ApiCircuitsCircuitsListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiCircuitsCircuitsListRequest) ContactN(contactN []int32) ApiCircuitsCircuitsListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiCircuitsCircuitsListRequest) ContactGroup(contactGroup []int32) ApiCircuitsCircuitsListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiCircuitsCircuitsListRequest) ContactGroupN(contactGroupN []int32) ApiCircuitsCircuitsListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiCircuitsCircuitsListRequest) ContactRole(contactRole []int32) ApiCircuitsCircuitsListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiCircuitsCircuitsListRequest) ContactRoleN(contactRoleN []int32) ApiCircuitsCircuitsListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiCircuitsCircuitsListRequest) Created(created []time.Time) ApiCircuitsCircuitsListRequest { + r.created = &created + return r +} + +func (r ApiCircuitsCircuitsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCircuitsCircuitsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) CreatedGt(createdGt []time.Time) ApiCircuitsCircuitsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCircuitsCircuitsListRequest) CreatedGte(createdGte []time.Time) ApiCircuitsCircuitsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCircuitsCircuitsListRequest) CreatedLt(createdLt []time.Time) ApiCircuitsCircuitsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCircuitsCircuitsListRequest) CreatedLte(createdLte []time.Time) ApiCircuitsCircuitsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCircuitsCircuitsListRequest) CreatedN(createdN []time.Time) ApiCircuitsCircuitsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCircuitsCircuitsListRequest) CreatedByRequest(createdByRequest string) ApiCircuitsCircuitsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCircuitsCircuitsListRequest) Description(description []string) ApiCircuitsCircuitsListRequest { + r.description = &description + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiCircuitsCircuitsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionIc(descriptionIc []string) ApiCircuitsCircuitsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionIe(descriptionIe []string) ApiCircuitsCircuitsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionIew(descriptionIew []string) ApiCircuitsCircuitsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionIsw(descriptionIsw []string) ApiCircuitsCircuitsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionN(descriptionN []string) ApiCircuitsCircuitsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionNic(descriptionNic []string) ApiCircuitsCircuitsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionNie(descriptionNie []string) ApiCircuitsCircuitsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionNiew(descriptionNiew []string) ApiCircuitsCircuitsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiCircuitsCircuitsListRequest) DescriptionNisw(descriptionNisw []string) ApiCircuitsCircuitsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiCircuitsCircuitsListRequest) Id(id []int32) ApiCircuitsCircuitsListRequest { + r.id = &id + return r +} + +func (r ApiCircuitsCircuitsListRequest) IdEmpty(idEmpty bool) ApiCircuitsCircuitsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) IdGt(idGt []int32) ApiCircuitsCircuitsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCircuitsCircuitsListRequest) IdGte(idGte []int32) ApiCircuitsCircuitsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCircuitsCircuitsListRequest) IdLt(idLt []int32) ApiCircuitsCircuitsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCircuitsCircuitsListRequest) IdLte(idLte []int32) ApiCircuitsCircuitsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCircuitsCircuitsListRequest) IdN(idN []int32) ApiCircuitsCircuitsListRequest { + r.idN = &idN + return r +} + +func (r ApiCircuitsCircuitsListRequest) InstallDate(installDate []string) ApiCircuitsCircuitsListRequest { + r.installDate = &installDate + return r +} + +func (r ApiCircuitsCircuitsListRequest) InstallDateEmpty(installDateEmpty bool) ApiCircuitsCircuitsListRequest { + r.installDateEmpty = &installDateEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) InstallDateGt(installDateGt []string) ApiCircuitsCircuitsListRequest { + r.installDateGt = &installDateGt + return r +} + +func (r ApiCircuitsCircuitsListRequest) InstallDateGte(installDateGte []string) ApiCircuitsCircuitsListRequest { + r.installDateGte = &installDateGte + return r +} + +func (r ApiCircuitsCircuitsListRequest) InstallDateLt(installDateLt []string) ApiCircuitsCircuitsListRequest { + r.installDateLt = &installDateLt + return r +} + +func (r ApiCircuitsCircuitsListRequest) InstallDateLte(installDateLte []string) ApiCircuitsCircuitsListRequest { + r.installDateLte = &installDateLte + return r +} + +func (r ApiCircuitsCircuitsListRequest) InstallDateN(installDateN []string) ApiCircuitsCircuitsListRequest { + r.installDateN = &installDateN + return r +} + +func (r ApiCircuitsCircuitsListRequest) LastUpdated(lastUpdated []time.Time) ApiCircuitsCircuitsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCircuitsCircuitsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCircuitsCircuitsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCircuitsCircuitsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCircuitsCircuitsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCircuitsCircuitsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCircuitsCircuitsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCircuitsCircuitsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCircuitsCircuitsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCircuitsCircuitsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCircuitsCircuitsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCircuitsCircuitsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCircuitsCircuitsListRequest) Limit(limit int32) ApiCircuitsCircuitsListRequest { + r.limit = &limit + return r +} + +func (r ApiCircuitsCircuitsListRequest) ModifiedByRequest(modifiedByRequest string) ApiCircuitsCircuitsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiCircuitsCircuitsListRequest) Offset(offset int32) ApiCircuitsCircuitsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCircuitsCircuitsListRequest) Ordering(ordering string) ApiCircuitsCircuitsListRequest { + r.ordering = &ordering + return r +} + +// Provider (slug) +func (r ApiCircuitsCircuitsListRequest) Provider(provider []string) ApiCircuitsCircuitsListRequest { + r.provider = &provider + return r +} + +// Provider (slug) +func (r ApiCircuitsCircuitsListRequest) ProviderN(providerN []string) ApiCircuitsCircuitsListRequest { + r.providerN = &providerN + return r +} + +// Provider account (ID) +func (r ApiCircuitsCircuitsListRequest) ProviderAccountId(providerAccountId []int32) ApiCircuitsCircuitsListRequest { + r.providerAccountId = &providerAccountId + return r +} + +// Provider account (ID) +func (r ApiCircuitsCircuitsListRequest) ProviderAccountIdN(providerAccountIdN []int32) ApiCircuitsCircuitsListRequest { + r.providerAccountIdN = &providerAccountIdN + return r +} + +// Provider (ID) +func (r ApiCircuitsCircuitsListRequest) ProviderId(providerId []int32) ApiCircuitsCircuitsListRequest { + r.providerId = &providerId + return r +} + +// Provider (ID) +func (r ApiCircuitsCircuitsListRequest) ProviderIdN(providerIdN []int32) ApiCircuitsCircuitsListRequest { + r.providerIdN = &providerIdN + return r +} + +// Provider network (ID) +func (r ApiCircuitsCircuitsListRequest) ProviderNetworkId(providerNetworkId []int32) ApiCircuitsCircuitsListRequest { + r.providerNetworkId = &providerNetworkId + return r +} + +// Provider network (ID) +func (r ApiCircuitsCircuitsListRequest) ProviderNetworkIdN(providerNetworkIdN []int32) ApiCircuitsCircuitsListRequest { + r.providerNetworkIdN = &providerNetworkIdN + return r +} + +// Search +func (r ApiCircuitsCircuitsListRequest) Q(q string) ApiCircuitsCircuitsListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiCircuitsCircuitsListRequest) Region(region []int32) ApiCircuitsCircuitsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiCircuitsCircuitsListRequest) RegionN(regionN []int32) ApiCircuitsCircuitsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiCircuitsCircuitsListRequest) RegionId(regionId []int32) ApiCircuitsCircuitsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiCircuitsCircuitsListRequest) RegionIdN(regionIdN []int32) ApiCircuitsCircuitsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site (slug) +func (r ApiCircuitsCircuitsListRequest) Site(site []string) ApiCircuitsCircuitsListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiCircuitsCircuitsListRequest) SiteN(siteN []string) ApiCircuitsCircuitsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiCircuitsCircuitsListRequest) SiteGroup(siteGroup []int32) ApiCircuitsCircuitsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiCircuitsCircuitsListRequest) SiteGroupN(siteGroupN []int32) ApiCircuitsCircuitsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiCircuitsCircuitsListRequest) SiteGroupId(siteGroupId []int32) ApiCircuitsCircuitsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiCircuitsCircuitsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiCircuitsCircuitsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiCircuitsCircuitsListRequest) SiteId(siteId []int32) ApiCircuitsCircuitsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiCircuitsCircuitsListRequest) SiteIdN(siteIdN []int32) ApiCircuitsCircuitsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiCircuitsCircuitsListRequest) Status(status []string) ApiCircuitsCircuitsListRequest { + r.status = &status + return r +} + +func (r ApiCircuitsCircuitsListRequest) StatusN(statusN []string) ApiCircuitsCircuitsListRequest { + r.statusN = &statusN + return r +} + +func (r ApiCircuitsCircuitsListRequest) Tag(tag []string) ApiCircuitsCircuitsListRequest { + r.tag = &tag + return r +} + +func (r ApiCircuitsCircuitsListRequest) TagN(tagN []string) ApiCircuitsCircuitsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiCircuitsCircuitsListRequest) Tenant(tenant []string) ApiCircuitsCircuitsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiCircuitsCircuitsListRequest) TenantN(tenantN []string) ApiCircuitsCircuitsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiCircuitsCircuitsListRequest) TenantGroup(tenantGroup []int32) ApiCircuitsCircuitsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiCircuitsCircuitsListRequest) TenantGroupN(tenantGroupN []int32) ApiCircuitsCircuitsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiCircuitsCircuitsListRequest) TenantGroupId(tenantGroupId []int32) ApiCircuitsCircuitsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiCircuitsCircuitsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiCircuitsCircuitsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiCircuitsCircuitsListRequest) TenantId(tenantId []*int32) ApiCircuitsCircuitsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiCircuitsCircuitsListRequest) TenantIdN(tenantIdN []*int32) ApiCircuitsCircuitsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiCircuitsCircuitsListRequest) TerminationDate(terminationDate []string) ApiCircuitsCircuitsListRequest { + r.terminationDate = &terminationDate + return r +} + +func (r ApiCircuitsCircuitsListRequest) TerminationDateEmpty(terminationDateEmpty bool) ApiCircuitsCircuitsListRequest { + r.terminationDateEmpty = &terminationDateEmpty + return r +} + +func (r ApiCircuitsCircuitsListRequest) TerminationDateGt(terminationDateGt []string) ApiCircuitsCircuitsListRequest { + r.terminationDateGt = &terminationDateGt + return r +} + +func (r ApiCircuitsCircuitsListRequest) TerminationDateGte(terminationDateGte []string) ApiCircuitsCircuitsListRequest { + r.terminationDateGte = &terminationDateGte + return r +} + +func (r ApiCircuitsCircuitsListRequest) TerminationDateLt(terminationDateLt []string) ApiCircuitsCircuitsListRequest { + r.terminationDateLt = &terminationDateLt + return r +} + +func (r ApiCircuitsCircuitsListRequest) TerminationDateLte(terminationDateLte []string) ApiCircuitsCircuitsListRequest { + r.terminationDateLte = &terminationDateLte + return r +} + +func (r ApiCircuitsCircuitsListRequest) TerminationDateN(terminationDateN []string) ApiCircuitsCircuitsListRequest { + r.terminationDateN = &terminationDateN + return r +} + +// Circuit type (slug) +func (r ApiCircuitsCircuitsListRequest) Type_(type_ []string) ApiCircuitsCircuitsListRequest { + r.type_ = &type_ + return r +} + +// Circuit type (slug) +func (r ApiCircuitsCircuitsListRequest) TypeN(typeN []string) ApiCircuitsCircuitsListRequest { + r.typeN = &typeN + return r +} + +// Circuit type (ID) +func (r ApiCircuitsCircuitsListRequest) TypeId(typeId []int32) ApiCircuitsCircuitsListRequest { + r.typeId = &typeId + return r +} + +// Circuit type (ID) +func (r ApiCircuitsCircuitsListRequest) TypeIdN(typeIdN []int32) ApiCircuitsCircuitsListRequest { + r.typeIdN = &typeIdN + return r +} + +func (r ApiCircuitsCircuitsListRequest) UpdatedByRequest(updatedByRequest string) ApiCircuitsCircuitsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCircuitsCircuitsListRequest) Execute() (*PaginatedCircuitList, *http.Response, error) { + return r.ApiService.CircuitsCircuitsListExecute(r) +} + +/* +CircuitsCircuitsList Method for CircuitsCircuitsList + +Get a list of circuit objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsCircuitsListRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsList(ctx context.Context) ApiCircuitsCircuitsListRequest { + return ApiCircuitsCircuitsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCircuitList +func (a *CircuitsAPIService) CircuitsCircuitsListExecute(r ApiCircuitsCircuitsListRequest) (*PaginatedCircuitList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCircuitList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cid != nil { + t := *r.cid + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid", t, "multi") + } + } + if r.cidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__empty", r.cidEmpty, "") + } + if r.cidIc != nil { + t := *r.cidIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__ic", t, "multi") + } + } + if r.cidIe != nil { + t := *r.cidIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__ie", t, "multi") + } + } + if r.cidIew != nil { + t := *r.cidIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__iew", t, "multi") + } + } + if r.cidIsw != nil { + t := *r.cidIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__isw", t, "multi") + } + } + if r.cidN != nil { + t := *r.cidN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__n", t, "multi") + } + } + if r.cidNic != nil { + t := *r.cidNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__nic", t, "multi") + } + } + if r.cidNie != nil { + t := *r.cidNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__nie", t, "multi") + } + } + if r.cidNiew != nil { + t := *r.cidNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__niew", t, "multi") + } + } + if r.cidNisw != nil { + t := *r.cidNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cid__nisw", t, "multi") + } + } + if r.commitRate != nil { + t := *r.commitRate + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate", t, "multi") + } + } + if r.commitRateEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__empty", r.commitRateEmpty, "") + } + if r.commitRateGt != nil { + t := *r.commitRateGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__gt", t, "multi") + } + } + if r.commitRateGte != nil { + t := *r.commitRateGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__gte", t, "multi") + } + } + if r.commitRateLt != nil { + t := *r.commitRateLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__lt", t, "multi") + } + } + if r.commitRateLte != nil { + t := *r.commitRateLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__lte", t, "multi") + } + } + if r.commitRateN != nil { + t := *r.commitRateN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "commit_rate__n", t, "multi") + } + } + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.installDate != nil { + t := *r.installDate + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date", t, "multi") + } + } + if r.installDateEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__empty", r.installDateEmpty, "") + } + if r.installDateGt != nil { + t := *r.installDateGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__gt", t, "multi") + } + } + if r.installDateGte != nil { + t := *r.installDateGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__gte", t, "multi") + } + } + if r.installDateLt != nil { + t := *r.installDateLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__lt", t, "multi") + } + } + if r.installDateLte != nil { + t := *r.installDateLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__lte", t, "multi") + } + } + if r.installDateN != nil { + t := *r.installDateN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "install_date__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.provider != nil { + t := *r.provider + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", t, "multi") + } + } + if r.providerN != nil { + t := *r.providerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__n", t, "multi") + } + } + if r.providerAccountId != nil { + t := *r.providerAccountId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_account_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_account_id", t, "multi") + } + } + if r.providerAccountIdN != nil { + t := *r.providerAccountIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_account_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_account_id__n", t, "multi") + } + } + if r.providerId != nil { + t := *r.providerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id", t, "multi") + } + } + if r.providerIdN != nil { + t := *r.providerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id__n", t, "multi") + } + } + if r.providerNetworkId != nil { + t := *r.providerNetworkId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id", t, "multi") + } + } + if r.providerNetworkIdN != nil { + t := *r.providerNetworkIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_network_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.terminationDate != nil { + t := *r.terminationDate + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date", t, "multi") + } + } + if r.terminationDateEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__empty", r.terminationDateEmpty, "") + } + if r.terminationDateGt != nil { + t := *r.terminationDateGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__gt", t, "multi") + } + } + if r.terminationDateGte != nil { + t := *r.terminationDateGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__gte", t, "multi") + } + } + if r.terminationDateLt != nil { + t := *r.terminationDateLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__lt", t, "multi") + } + } + if r.terminationDateLte != nil { + t := *r.terminationDateLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__lte", t, "multi") + } + } + if r.terminationDateN != nil { + t := *r.terminationDateN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_date__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.typeId != nil { + t := *r.typeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id", t, "multi") + } + } + if r.typeIdN != nil { + t := *r.typeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + patchedWritableCircuitRequest *PatchedWritableCircuitRequest +} + +func (r ApiCircuitsCircuitsPartialUpdateRequest) PatchedWritableCircuitRequest(patchedWritableCircuitRequest PatchedWritableCircuitRequest) ApiCircuitsCircuitsPartialUpdateRequest { + r.patchedWritableCircuitRequest = &patchedWritableCircuitRequest + return r +} + +func (r ApiCircuitsCircuitsPartialUpdateRequest) Execute() (*Circuit, *http.Response, error) { + return r.ApiService.CircuitsCircuitsPartialUpdateExecute(r) +} + +/* +CircuitsCircuitsPartialUpdate Method for CircuitsCircuitsPartialUpdate + +Patch a circuit object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit. + @return ApiCircuitsCircuitsPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsPartialUpdate(ctx context.Context, id int32) ApiCircuitsCircuitsPartialUpdateRequest { + return ApiCircuitsCircuitsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Circuit +func (a *CircuitsAPIService) CircuitsCircuitsPartialUpdateExecute(r ApiCircuitsCircuitsPartialUpdateRequest) (*Circuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Circuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableCircuitRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsRetrieveRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsCircuitsRetrieveRequest) Execute() (*Circuit, *http.Response, error) { + return r.ApiService.CircuitsCircuitsRetrieveExecute(r) +} + +/* +CircuitsCircuitsRetrieve Method for CircuitsCircuitsRetrieve + +Get a circuit object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit. + @return ApiCircuitsCircuitsRetrieveRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsRetrieve(ctx context.Context, id int32) ApiCircuitsCircuitsRetrieveRequest { + return ApiCircuitsCircuitsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Circuit +func (a *CircuitsAPIService) CircuitsCircuitsRetrieveExecute(r ApiCircuitsCircuitsRetrieveRequest) (*Circuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Circuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsCircuitsUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + writableCircuitRequest *WritableCircuitRequest +} + +func (r ApiCircuitsCircuitsUpdateRequest) WritableCircuitRequest(writableCircuitRequest WritableCircuitRequest) ApiCircuitsCircuitsUpdateRequest { + r.writableCircuitRequest = &writableCircuitRequest + return r +} + +func (r ApiCircuitsCircuitsUpdateRequest) Execute() (*Circuit, *http.Response, error) { + return r.ApiService.CircuitsCircuitsUpdateExecute(r) +} + +/* +CircuitsCircuitsUpdate Method for CircuitsCircuitsUpdate + +Put a circuit object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this circuit. + @return ApiCircuitsCircuitsUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsCircuitsUpdate(ctx context.Context, id int32) ApiCircuitsCircuitsUpdateRequest { + return ApiCircuitsCircuitsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Circuit +func (a *CircuitsAPIService) CircuitsCircuitsUpdateExecute(r ApiCircuitsCircuitsUpdateRequest) (*Circuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Circuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsCircuitsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/circuits/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCircuitRequest == nil { + return localVarReturnValue, nil, reportError("writableCircuitRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCircuitRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsBulkDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerAccountRequest *[]ProviderAccountRequest +} + +func (r ApiCircuitsProviderAccountsBulkDestroyRequest) ProviderAccountRequest(providerAccountRequest []ProviderAccountRequest) ApiCircuitsProviderAccountsBulkDestroyRequest { + r.providerAccountRequest = &providerAccountRequest + return r +} + +func (r ApiCircuitsProviderAccountsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsProviderAccountsBulkDestroyExecute(r) +} + +/* +CircuitsProviderAccountsBulkDestroy Method for CircuitsProviderAccountsBulkDestroy + +Delete a list of provider account objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderAccountsBulkDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsBulkDestroy(ctx context.Context) ApiCircuitsProviderAccountsBulkDestroyRequest { + return ApiCircuitsProviderAccountsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsProviderAccountsBulkDestroyExecute(r ApiCircuitsProviderAccountsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerAccountRequest == nil { + return nil, reportError("providerAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerAccountRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerAccountRequest *[]ProviderAccountRequest +} + +func (r ApiCircuitsProviderAccountsBulkPartialUpdateRequest) ProviderAccountRequest(providerAccountRequest []ProviderAccountRequest) ApiCircuitsProviderAccountsBulkPartialUpdateRequest { + r.providerAccountRequest = &providerAccountRequest + return r +} + +func (r ApiCircuitsProviderAccountsBulkPartialUpdateRequest) Execute() ([]ProviderAccount, *http.Response, error) { + return r.ApiService.CircuitsProviderAccountsBulkPartialUpdateExecute(r) +} + +/* +CircuitsProviderAccountsBulkPartialUpdate Method for CircuitsProviderAccountsBulkPartialUpdate + +Patch a list of provider account objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderAccountsBulkPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsBulkPartialUpdate(ctx context.Context) ApiCircuitsProviderAccountsBulkPartialUpdateRequest { + return ApiCircuitsProviderAccountsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ProviderAccount +func (a *CircuitsAPIService) CircuitsProviderAccountsBulkPartialUpdateExecute(r ApiCircuitsProviderAccountsBulkPartialUpdateRequest) ([]ProviderAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ProviderAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerAccountRequest == nil { + return localVarReturnValue, nil, reportError("providerAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerAccountRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsBulkUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerAccountRequest *[]ProviderAccountRequest +} + +func (r ApiCircuitsProviderAccountsBulkUpdateRequest) ProviderAccountRequest(providerAccountRequest []ProviderAccountRequest) ApiCircuitsProviderAccountsBulkUpdateRequest { + r.providerAccountRequest = &providerAccountRequest + return r +} + +func (r ApiCircuitsProviderAccountsBulkUpdateRequest) Execute() ([]ProviderAccount, *http.Response, error) { + return r.ApiService.CircuitsProviderAccountsBulkUpdateExecute(r) +} + +/* +CircuitsProviderAccountsBulkUpdate Method for CircuitsProviderAccountsBulkUpdate + +Put a list of provider account objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderAccountsBulkUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsBulkUpdate(ctx context.Context) ApiCircuitsProviderAccountsBulkUpdateRequest { + return ApiCircuitsProviderAccountsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ProviderAccount +func (a *CircuitsAPIService) CircuitsProviderAccountsBulkUpdateExecute(r ApiCircuitsProviderAccountsBulkUpdateRequest) ([]ProviderAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ProviderAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerAccountRequest == nil { + return localVarReturnValue, nil, reportError("providerAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerAccountRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsCreateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + writableProviderAccountRequest *WritableProviderAccountRequest +} + +func (r ApiCircuitsProviderAccountsCreateRequest) WritableProviderAccountRequest(writableProviderAccountRequest WritableProviderAccountRequest) ApiCircuitsProviderAccountsCreateRequest { + r.writableProviderAccountRequest = &writableProviderAccountRequest + return r +} + +func (r ApiCircuitsProviderAccountsCreateRequest) Execute() (*ProviderAccount, *http.Response, error) { + return r.ApiService.CircuitsProviderAccountsCreateExecute(r) +} + +/* +CircuitsProviderAccountsCreate Method for CircuitsProviderAccountsCreate + +Post a list of provider account objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderAccountsCreateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsCreate(ctx context.Context) ApiCircuitsProviderAccountsCreateRequest { + return ApiCircuitsProviderAccountsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ProviderAccount +func (a *CircuitsAPIService) CircuitsProviderAccountsCreateExecute(r ApiCircuitsProviderAccountsCreateRequest) (*ProviderAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableProviderAccountRequest == nil { + return localVarReturnValue, nil, reportError("writableProviderAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableProviderAccountRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsProviderAccountsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsProviderAccountsDestroyExecute(r) +} + +/* +CircuitsProviderAccountsDestroy Method for CircuitsProviderAccountsDestroy + +Delete a provider account object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider account. + @return ApiCircuitsProviderAccountsDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsDestroy(ctx context.Context, id int32) ApiCircuitsProviderAccountsDestroyRequest { + return ApiCircuitsProviderAccountsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsProviderAccountsDestroyExecute(r ApiCircuitsProviderAccountsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsListRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + account *[]string + accountEmpty *bool + accountIc *[]string + accountIe *[]string + accountIew *[]string + accountIsw *[]string + accountN *[]string + accountNic *[]string + accountNie *[]string + accountNiew *[]string + accountNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + provider *[]string + providerN *[]string + providerId *[]int32 + providerIdN *[]int32 + q *string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiCircuitsProviderAccountsListRequest) Account(account []string) ApiCircuitsProviderAccountsListRequest { + r.account = &account + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountEmpty(accountEmpty bool) ApiCircuitsProviderAccountsListRequest { + r.accountEmpty = &accountEmpty + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountIc(accountIc []string) ApiCircuitsProviderAccountsListRequest { + r.accountIc = &accountIc + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountIe(accountIe []string) ApiCircuitsProviderAccountsListRequest { + r.accountIe = &accountIe + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountIew(accountIew []string) ApiCircuitsProviderAccountsListRequest { + r.accountIew = &accountIew + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountIsw(accountIsw []string) ApiCircuitsProviderAccountsListRequest { + r.accountIsw = &accountIsw + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountN(accountN []string) ApiCircuitsProviderAccountsListRequest { + r.accountN = &accountN + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountNic(accountNic []string) ApiCircuitsProviderAccountsListRequest { + r.accountNic = &accountNic + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountNie(accountNie []string) ApiCircuitsProviderAccountsListRequest { + r.accountNie = &accountNie + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountNiew(accountNiew []string) ApiCircuitsProviderAccountsListRequest { + r.accountNiew = &accountNiew + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) AccountNisw(accountNisw []string) ApiCircuitsProviderAccountsListRequest { + r.accountNisw = &accountNisw + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) Created(created []time.Time) ApiCircuitsProviderAccountsListRequest { + r.created = &created + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCircuitsProviderAccountsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) CreatedGt(createdGt []time.Time) ApiCircuitsProviderAccountsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) CreatedGte(createdGte []time.Time) ApiCircuitsProviderAccountsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) CreatedLt(createdLt []time.Time) ApiCircuitsProviderAccountsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) CreatedLte(createdLte []time.Time) ApiCircuitsProviderAccountsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) CreatedN(createdN []time.Time) ApiCircuitsProviderAccountsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) CreatedByRequest(createdByRequest string) ApiCircuitsProviderAccountsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) Description(description []string) ApiCircuitsProviderAccountsListRequest { + r.description = &description + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiCircuitsProviderAccountsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionIc(descriptionIc []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionIe(descriptionIe []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionIew(descriptionIew []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionIsw(descriptionIsw []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionN(descriptionN []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionNic(descriptionNic []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionNie(descriptionNie []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionNiew(descriptionNiew []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) DescriptionNisw(descriptionNisw []string) ApiCircuitsProviderAccountsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) Id(id []int32) ApiCircuitsProviderAccountsListRequest { + r.id = &id + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) IdEmpty(idEmpty bool) ApiCircuitsProviderAccountsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) IdGt(idGt []int32) ApiCircuitsProviderAccountsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) IdGte(idGte []int32) ApiCircuitsProviderAccountsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) IdLt(idLt []int32) ApiCircuitsProviderAccountsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) IdLte(idLte []int32) ApiCircuitsProviderAccountsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) IdN(idN []int32) ApiCircuitsProviderAccountsListRequest { + r.idN = &idN + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) LastUpdated(lastUpdated []time.Time) ApiCircuitsProviderAccountsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCircuitsProviderAccountsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCircuitsProviderAccountsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCircuitsProviderAccountsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCircuitsProviderAccountsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCircuitsProviderAccountsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCircuitsProviderAccountsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCircuitsProviderAccountsListRequest) Limit(limit int32) ApiCircuitsProviderAccountsListRequest { + r.limit = &limit + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) ModifiedByRequest(modifiedByRequest string) ApiCircuitsProviderAccountsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) Name(name []string) ApiCircuitsProviderAccountsListRequest { + r.name = &name + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameEmpty(nameEmpty bool) ApiCircuitsProviderAccountsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameIc(nameIc []string) ApiCircuitsProviderAccountsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameIe(nameIe []string) ApiCircuitsProviderAccountsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameIew(nameIew []string) ApiCircuitsProviderAccountsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameIsw(nameIsw []string) ApiCircuitsProviderAccountsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameN(nameN []string) ApiCircuitsProviderAccountsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameNic(nameNic []string) ApiCircuitsProviderAccountsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameNie(nameNie []string) ApiCircuitsProviderAccountsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameNiew(nameNiew []string) ApiCircuitsProviderAccountsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) NameNisw(nameNisw []string) ApiCircuitsProviderAccountsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiCircuitsProviderAccountsListRequest) Offset(offset int32) ApiCircuitsProviderAccountsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCircuitsProviderAccountsListRequest) Ordering(ordering string) ApiCircuitsProviderAccountsListRequest { + r.ordering = &ordering + return r +} + +// Provider (slug) +func (r ApiCircuitsProviderAccountsListRequest) Provider(provider []string) ApiCircuitsProviderAccountsListRequest { + r.provider = &provider + return r +} + +// Provider (slug) +func (r ApiCircuitsProviderAccountsListRequest) ProviderN(providerN []string) ApiCircuitsProviderAccountsListRequest { + r.providerN = &providerN + return r +} + +// Provider (ID) +func (r ApiCircuitsProviderAccountsListRequest) ProviderId(providerId []int32) ApiCircuitsProviderAccountsListRequest { + r.providerId = &providerId + return r +} + +// Provider (ID) +func (r ApiCircuitsProviderAccountsListRequest) ProviderIdN(providerIdN []int32) ApiCircuitsProviderAccountsListRequest { + r.providerIdN = &providerIdN + return r +} + +// Search +func (r ApiCircuitsProviderAccountsListRequest) Q(q string) ApiCircuitsProviderAccountsListRequest { + r.q = &q + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) Tag(tag []string) ApiCircuitsProviderAccountsListRequest { + r.tag = &tag + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) TagN(tagN []string) ApiCircuitsProviderAccountsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) UpdatedByRequest(updatedByRequest string) ApiCircuitsProviderAccountsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCircuitsProviderAccountsListRequest) Execute() (*PaginatedProviderAccountList, *http.Response, error) { + return r.ApiService.CircuitsProviderAccountsListExecute(r) +} + +/* +CircuitsProviderAccountsList Method for CircuitsProviderAccountsList + +Get a list of provider account objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderAccountsListRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsList(ctx context.Context) ApiCircuitsProviderAccountsListRequest { + return ApiCircuitsProviderAccountsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedProviderAccountList +func (a *CircuitsAPIService) CircuitsProviderAccountsListExecute(r ApiCircuitsProviderAccountsListRequest) (*PaginatedProviderAccountList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedProviderAccountList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.account != nil { + t := *r.account + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account", t, "multi") + } + } + if r.accountEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__empty", r.accountEmpty, "") + } + if r.accountIc != nil { + t := *r.accountIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__ic", t, "multi") + } + } + if r.accountIe != nil { + t := *r.accountIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__ie", t, "multi") + } + } + if r.accountIew != nil { + t := *r.accountIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__iew", t, "multi") + } + } + if r.accountIsw != nil { + t := *r.accountIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__isw", t, "multi") + } + } + if r.accountN != nil { + t := *r.accountN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__n", t, "multi") + } + } + if r.accountNic != nil { + t := *r.accountNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__nic", t, "multi") + } + } + if r.accountNie != nil { + t := *r.accountNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__nie", t, "multi") + } + } + if r.accountNiew != nil { + t := *r.accountNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__niew", t, "multi") + } + } + if r.accountNisw != nil { + t := *r.accountNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "account__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.provider != nil { + t := *r.provider + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", t, "multi") + } + } + if r.providerN != nil { + t := *r.providerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__n", t, "multi") + } + } + if r.providerId != nil { + t := *r.providerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id", t, "multi") + } + } + if r.providerIdN != nil { + t := *r.providerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + patchedWritableProviderAccountRequest *PatchedWritableProviderAccountRequest +} + +func (r ApiCircuitsProviderAccountsPartialUpdateRequest) PatchedWritableProviderAccountRequest(patchedWritableProviderAccountRequest PatchedWritableProviderAccountRequest) ApiCircuitsProviderAccountsPartialUpdateRequest { + r.patchedWritableProviderAccountRequest = &patchedWritableProviderAccountRequest + return r +} + +func (r ApiCircuitsProviderAccountsPartialUpdateRequest) Execute() (*ProviderAccount, *http.Response, error) { + return r.ApiService.CircuitsProviderAccountsPartialUpdateExecute(r) +} + +/* +CircuitsProviderAccountsPartialUpdate Method for CircuitsProviderAccountsPartialUpdate + +Patch a provider account object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider account. + @return ApiCircuitsProviderAccountsPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsPartialUpdate(ctx context.Context, id int32) ApiCircuitsProviderAccountsPartialUpdateRequest { + return ApiCircuitsProviderAccountsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProviderAccount +func (a *CircuitsAPIService) CircuitsProviderAccountsPartialUpdateExecute(r ApiCircuitsProviderAccountsPartialUpdateRequest) (*ProviderAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableProviderAccountRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsRetrieveRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsProviderAccountsRetrieveRequest) Execute() (*ProviderAccount, *http.Response, error) { + return r.ApiService.CircuitsProviderAccountsRetrieveExecute(r) +} + +/* +CircuitsProviderAccountsRetrieve Method for CircuitsProviderAccountsRetrieve + +Get a provider account object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider account. + @return ApiCircuitsProviderAccountsRetrieveRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsRetrieve(ctx context.Context, id int32) ApiCircuitsProviderAccountsRetrieveRequest { + return ApiCircuitsProviderAccountsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProviderAccount +func (a *CircuitsAPIService) CircuitsProviderAccountsRetrieveExecute(r ApiCircuitsProviderAccountsRetrieveRequest) (*ProviderAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderAccountsUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + writableProviderAccountRequest *WritableProviderAccountRequest +} + +func (r ApiCircuitsProviderAccountsUpdateRequest) WritableProviderAccountRequest(writableProviderAccountRequest WritableProviderAccountRequest) ApiCircuitsProviderAccountsUpdateRequest { + r.writableProviderAccountRequest = &writableProviderAccountRequest + return r +} + +func (r ApiCircuitsProviderAccountsUpdateRequest) Execute() (*ProviderAccount, *http.Response, error) { + return r.ApiService.CircuitsProviderAccountsUpdateExecute(r) +} + +/* +CircuitsProviderAccountsUpdate Method for CircuitsProviderAccountsUpdate + +Put a provider account object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider account. + @return ApiCircuitsProviderAccountsUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderAccountsUpdate(ctx context.Context, id int32) ApiCircuitsProviderAccountsUpdateRequest { + return ApiCircuitsProviderAccountsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProviderAccount +func (a *CircuitsAPIService) CircuitsProviderAccountsUpdateExecute(r ApiCircuitsProviderAccountsUpdateRequest) (*ProviderAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderAccountsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-accounts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableProviderAccountRequest == nil { + return localVarReturnValue, nil, reportError("writableProviderAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableProviderAccountRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksBulkDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerNetworkRequest *[]ProviderNetworkRequest +} + +func (r ApiCircuitsProviderNetworksBulkDestroyRequest) ProviderNetworkRequest(providerNetworkRequest []ProviderNetworkRequest) ApiCircuitsProviderNetworksBulkDestroyRequest { + r.providerNetworkRequest = &providerNetworkRequest + return r +} + +func (r ApiCircuitsProviderNetworksBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsProviderNetworksBulkDestroyExecute(r) +} + +/* +CircuitsProviderNetworksBulkDestroy Method for CircuitsProviderNetworksBulkDestroy + +Delete a list of provider network objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderNetworksBulkDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksBulkDestroy(ctx context.Context) ApiCircuitsProviderNetworksBulkDestroyRequest { + return ApiCircuitsProviderNetworksBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsProviderNetworksBulkDestroyExecute(r ApiCircuitsProviderNetworksBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerNetworkRequest == nil { + return nil, reportError("providerNetworkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerNetworkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerNetworkRequest *[]ProviderNetworkRequest +} + +func (r ApiCircuitsProviderNetworksBulkPartialUpdateRequest) ProviderNetworkRequest(providerNetworkRequest []ProviderNetworkRequest) ApiCircuitsProviderNetworksBulkPartialUpdateRequest { + r.providerNetworkRequest = &providerNetworkRequest + return r +} + +func (r ApiCircuitsProviderNetworksBulkPartialUpdateRequest) Execute() ([]ProviderNetwork, *http.Response, error) { + return r.ApiService.CircuitsProviderNetworksBulkPartialUpdateExecute(r) +} + +/* +CircuitsProviderNetworksBulkPartialUpdate Method for CircuitsProviderNetworksBulkPartialUpdate + +Patch a list of provider network objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderNetworksBulkPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksBulkPartialUpdate(ctx context.Context) ApiCircuitsProviderNetworksBulkPartialUpdateRequest { + return ApiCircuitsProviderNetworksBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ProviderNetwork +func (a *CircuitsAPIService) CircuitsProviderNetworksBulkPartialUpdateExecute(r ApiCircuitsProviderNetworksBulkPartialUpdateRequest) ([]ProviderNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ProviderNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerNetworkRequest == nil { + return localVarReturnValue, nil, reportError("providerNetworkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerNetworkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksBulkUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerNetworkRequest *[]ProviderNetworkRequest +} + +func (r ApiCircuitsProviderNetworksBulkUpdateRequest) ProviderNetworkRequest(providerNetworkRequest []ProviderNetworkRequest) ApiCircuitsProviderNetworksBulkUpdateRequest { + r.providerNetworkRequest = &providerNetworkRequest + return r +} + +func (r ApiCircuitsProviderNetworksBulkUpdateRequest) Execute() ([]ProviderNetwork, *http.Response, error) { + return r.ApiService.CircuitsProviderNetworksBulkUpdateExecute(r) +} + +/* +CircuitsProviderNetworksBulkUpdate Method for CircuitsProviderNetworksBulkUpdate + +Put a list of provider network objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderNetworksBulkUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksBulkUpdate(ctx context.Context) ApiCircuitsProviderNetworksBulkUpdateRequest { + return ApiCircuitsProviderNetworksBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ProviderNetwork +func (a *CircuitsAPIService) CircuitsProviderNetworksBulkUpdateExecute(r ApiCircuitsProviderNetworksBulkUpdateRequest) ([]ProviderNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ProviderNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerNetworkRequest == nil { + return localVarReturnValue, nil, reportError("providerNetworkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerNetworkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksCreateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + writableProviderNetworkRequest *WritableProviderNetworkRequest +} + +func (r ApiCircuitsProviderNetworksCreateRequest) WritableProviderNetworkRequest(writableProviderNetworkRequest WritableProviderNetworkRequest) ApiCircuitsProviderNetworksCreateRequest { + r.writableProviderNetworkRequest = &writableProviderNetworkRequest + return r +} + +func (r ApiCircuitsProviderNetworksCreateRequest) Execute() (*ProviderNetwork, *http.Response, error) { + return r.ApiService.CircuitsProviderNetworksCreateExecute(r) +} + +/* +CircuitsProviderNetworksCreate Method for CircuitsProviderNetworksCreate + +Post a list of provider network objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderNetworksCreateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksCreate(ctx context.Context) ApiCircuitsProviderNetworksCreateRequest { + return ApiCircuitsProviderNetworksCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ProviderNetwork +func (a *CircuitsAPIService) CircuitsProviderNetworksCreateExecute(r ApiCircuitsProviderNetworksCreateRequest) (*ProviderNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableProviderNetworkRequest == nil { + return localVarReturnValue, nil, reportError("writableProviderNetworkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableProviderNetworkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsProviderNetworksDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsProviderNetworksDestroyExecute(r) +} + +/* +CircuitsProviderNetworksDestroy Method for CircuitsProviderNetworksDestroy + +Delete a provider network object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider network. + @return ApiCircuitsProviderNetworksDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksDestroy(ctx context.Context, id int32) ApiCircuitsProviderNetworksDestroyRequest { + return ApiCircuitsProviderNetworksDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsProviderNetworksDestroyExecute(r ApiCircuitsProviderNetworksDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksListRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + provider *[]string + providerN *[]string + providerId *[]int32 + providerIdN *[]int32 + q *string + serviceId *[]string + serviceIdEmpty *bool + serviceIdIc *[]string + serviceIdIe *[]string + serviceIdIew *[]string + serviceIdIsw *[]string + serviceIdN *[]string + serviceIdNic *[]string + serviceIdNie *[]string + serviceIdNiew *[]string + serviceIdNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiCircuitsProviderNetworksListRequest) Created(created []time.Time) ApiCircuitsProviderNetworksListRequest { + r.created = &created + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCircuitsProviderNetworksListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) CreatedGt(createdGt []time.Time) ApiCircuitsProviderNetworksListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) CreatedGte(createdGte []time.Time) ApiCircuitsProviderNetworksListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) CreatedLt(createdLt []time.Time) ApiCircuitsProviderNetworksListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) CreatedLte(createdLte []time.Time) ApiCircuitsProviderNetworksListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) CreatedN(createdN []time.Time) ApiCircuitsProviderNetworksListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) CreatedByRequest(createdByRequest string) ApiCircuitsProviderNetworksListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) Description(description []string) ApiCircuitsProviderNetworksListRequest { + r.description = &description + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionEmpty(descriptionEmpty bool) ApiCircuitsProviderNetworksListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionIc(descriptionIc []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionIe(descriptionIe []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionIew(descriptionIew []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionIsw(descriptionIsw []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionN(descriptionN []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionNic(descriptionNic []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionNie(descriptionNie []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionNiew(descriptionNiew []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) DescriptionNisw(descriptionNisw []string) ApiCircuitsProviderNetworksListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) Id(id []int32) ApiCircuitsProviderNetworksListRequest { + r.id = &id + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) IdEmpty(idEmpty bool) ApiCircuitsProviderNetworksListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) IdGt(idGt []int32) ApiCircuitsProviderNetworksListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) IdGte(idGte []int32) ApiCircuitsProviderNetworksListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) IdLt(idLt []int32) ApiCircuitsProviderNetworksListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) IdLte(idLte []int32) ApiCircuitsProviderNetworksListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) IdN(idN []int32) ApiCircuitsProviderNetworksListRequest { + r.idN = &idN + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) LastUpdated(lastUpdated []time.Time) ApiCircuitsProviderNetworksListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCircuitsProviderNetworksListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCircuitsProviderNetworksListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCircuitsProviderNetworksListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCircuitsProviderNetworksListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCircuitsProviderNetworksListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCircuitsProviderNetworksListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCircuitsProviderNetworksListRequest) Limit(limit int32) ApiCircuitsProviderNetworksListRequest { + r.limit = &limit + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ModifiedByRequest(modifiedByRequest string) ApiCircuitsProviderNetworksListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) Name(name []string) ApiCircuitsProviderNetworksListRequest { + r.name = &name + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameEmpty(nameEmpty bool) ApiCircuitsProviderNetworksListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameIc(nameIc []string) ApiCircuitsProviderNetworksListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameIe(nameIe []string) ApiCircuitsProviderNetworksListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameIew(nameIew []string) ApiCircuitsProviderNetworksListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameIsw(nameIsw []string) ApiCircuitsProviderNetworksListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameN(nameN []string) ApiCircuitsProviderNetworksListRequest { + r.nameN = &nameN + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameNic(nameNic []string) ApiCircuitsProviderNetworksListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameNie(nameNie []string) ApiCircuitsProviderNetworksListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameNiew(nameNiew []string) ApiCircuitsProviderNetworksListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) NameNisw(nameNisw []string) ApiCircuitsProviderNetworksListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiCircuitsProviderNetworksListRequest) Offset(offset int32) ApiCircuitsProviderNetworksListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCircuitsProviderNetworksListRequest) Ordering(ordering string) ApiCircuitsProviderNetworksListRequest { + r.ordering = &ordering + return r +} + +// Provider (slug) +func (r ApiCircuitsProviderNetworksListRequest) Provider(provider []string) ApiCircuitsProviderNetworksListRequest { + r.provider = &provider + return r +} + +// Provider (slug) +func (r ApiCircuitsProviderNetworksListRequest) ProviderN(providerN []string) ApiCircuitsProviderNetworksListRequest { + r.providerN = &providerN + return r +} + +// Provider (ID) +func (r ApiCircuitsProviderNetworksListRequest) ProviderId(providerId []int32) ApiCircuitsProviderNetworksListRequest { + r.providerId = &providerId + return r +} + +// Provider (ID) +func (r ApiCircuitsProviderNetworksListRequest) ProviderIdN(providerIdN []int32) ApiCircuitsProviderNetworksListRequest { + r.providerIdN = &providerIdN + return r +} + +// Search +func (r ApiCircuitsProviderNetworksListRequest) Q(q string) ApiCircuitsProviderNetworksListRequest { + r.q = &q + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceId(serviceId []string) ApiCircuitsProviderNetworksListRequest { + r.serviceId = &serviceId + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdEmpty(serviceIdEmpty bool) ApiCircuitsProviderNetworksListRequest { + r.serviceIdEmpty = &serviceIdEmpty + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdIc(serviceIdIc []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdIc = &serviceIdIc + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdIe(serviceIdIe []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdIe = &serviceIdIe + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdIew(serviceIdIew []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdIew = &serviceIdIew + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdIsw(serviceIdIsw []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdIsw = &serviceIdIsw + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdN(serviceIdN []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdN = &serviceIdN + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdNic(serviceIdNic []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdNic = &serviceIdNic + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdNie(serviceIdNie []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdNie = &serviceIdNie + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdNiew(serviceIdNiew []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdNiew = &serviceIdNiew + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) ServiceIdNisw(serviceIdNisw []string) ApiCircuitsProviderNetworksListRequest { + r.serviceIdNisw = &serviceIdNisw + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) Tag(tag []string) ApiCircuitsProviderNetworksListRequest { + r.tag = &tag + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) TagN(tagN []string) ApiCircuitsProviderNetworksListRequest { + r.tagN = &tagN + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) UpdatedByRequest(updatedByRequest string) ApiCircuitsProviderNetworksListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCircuitsProviderNetworksListRequest) Execute() (*PaginatedProviderNetworkList, *http.Response, error) { + return r.ApiService.CircuitsProviderNetworksListExecute(r) +} + +/* +CircuitsProviderNetworksList Method for CircuitsProviderNetworksList + +Get a list of provider network objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProviderNetworksListRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksList(ctx context.Context) ApiCircuitsProviderNetworksListRequest { + return ApiCircuitsProviderNetworksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedProviderNetworkList +func (a *CircuitsAPIService) CircuitsProviderNetworksListExecute(r ApiCircuitsProviderNetworksListRequest) (*PaginatedProviderNetworkList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedProviderNetworkList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.provider != nil { + t := *r.provider + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", t, "multi") + } + } + if r.providerN != nil { + t := *r.providerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__n", t, "multi") + } + } + if r.providerId != nil { + t := *r.providerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id", t, "multi") + } + } + if r.providerIdN != nil { + t := *r.providerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.serviceId != nil { + t := *r.serviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id", t, "multi") + } + } + if r.serviceIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__empty", r.serviceIdEmpty, "") + } + if r.serviceIdIc != nil { + t := *r.serviceIdIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__ic", t, "multi") + } + } + if r.serviceIdIe != nil { + t := *r.serviceIdIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__ie", t, "multi") + } + } + if r.serviceIdIew != nil { + t := *r.serviceIdIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__iew", t, "multi") + } + } + if r.serviceIdIsw != nil { + t := *r.serviceIdIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__isw", t, "multi") + } + } + if r.serviceIdN != nil { + t := *r.serviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__n", t, "multi") + } + } + if r.serviceIdNic != nil { + t := *r.serviceIdNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__nic", t, "multi") + } + } + if r.serviceIdNie != nil { + t := *r.serviceIdNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__nie", t, "multi") + } + } + if r.serviceIdNiew != nil { + t := *r.serviceIdNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__niew", t, "multi") + } + } + if r.serviceIdNisw != nil { + t := *r.serviceIdNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_id__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + patchedWritableProviderNetworkRequest *PatchedWritableProviderNetworkRequest +} + +func (r ApiCircuitsProviderNetworksPartialUpdateRequest) PatchedWritableProviderNetworkRequest(patchedWritableProviderNetworkRequest PatchedWritableProviderNetworkRequest) ApiCircuitsProviderNetworksPartialUpdateRequest { + r.patchedWritableProviderNetworkRequest = &patchedWritableProviderNetworkRequest + return r +} + +func (r ApiCircuitsProviderNetworksPartialUpdateRequest) Execute() (*ProviderNetwork, *http.Response, error) { + return r.ApiService.CircuitsProviderNetworksPartialUpdateExecute(r) +} + +/* +CircuitsProviderNetworksPartialUpdate Method for CircuitsProviderNetworksPartialUpdate + +Patch a provider network object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider network. + @return ApiCircuitsProviderNetworksPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksPartialUpdate(ctx context.Context, id int32) ApiCircuitsProviderNetworksPartialUpdateRequest { + return ApiCircuitsProviderNetworksPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProviderNetwork +func (a *CircuitsAPIService) CircuitsProviderNetworksPartialUpdateExecute(r ApiCircuitsProviderNetworksPartialUpdateRequest) (*ProviderNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableProviderNetworkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksRetrieveRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsProviderNetworksRetrieveRequest) Execute() (*ProviderNetwork, *http.Response, error) { + return r.ApiService.CircuitsProviderNetworksRetrieveExecute(r) +} + +/* +CircuitsProviderNetworksRetrieve Method for CircuitsProviderNetworksRetrieve + +Get a provider network object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider network. + @return ApiCircuitsProviderNetworksRetrieveRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksRetrieve(ctx context.Context, id int32) ApiCircuitsProviderNetworksRetrieveRequest { + return ApiCircuitsProviderNetworksRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProviderNetwork +func (a *CircuitsAPIService) CircuitsProviderNetworksRetrieveExecute(r ApiCircuitsProviderNetworksRetrieveRequest) (*ProviderNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProviderNetworksUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + writableProviderNetworkRequest *WritableProviderNetworkRequest +} + +func (r ApiCircuitsProviderNetworksUpdateRequest) WritableProviderNetworkRequest(writableProviderNetworkRequest WritableProviderNetworkRequest) ApiCircuitsProviderNetworksUpdateRequest { + r.writableProviderNetworkRequest = &writableProviderNetworkRequest + return r +} + +func (r ApiCircuitsProviderNetworksUpdateRequest) Execute() (*ProviderNetwork, *http.Response, error) { + return r.ApiService.CircuitsProviderNetworksUpdateExecute(r) +} + +/* +CircuitsProviderNetworksUpdate Method for CircuitsProviderNetworksUpdate + +Put a provider network object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider network. + @return ApiCircuitsProviderNetworksUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProviderNetworksUpdate(ctx context.Context, id int32) ApiCircuitsProviderNetworksUpdateRequest { + return ApiCircuitsProviderNetworksUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProviderNetwork +func (a *CircuitsAPIService) CircuitsProviderNetworksUpdateExecute(r ApiCircuitsProviderNetworksUpdateRequest) (*ProviderNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProviderNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProviderNetworksUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/provider-networks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableProviderNetworkRequest == nil { + return localVarReturnValue, nil, reportError("writableProviderNetworkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableProviderNetworkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersBulkDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerRequest *[]ProviderRequest +} + +func (r ApiCircuitsProvidersBulkDestroyRequest) ProviderRequest(providerRequest []ProviderRequest) ApiCircuitsProvidersBulkDestroyRequest { + r.providerRequest = &providerRequest + return r +} + +func (r ApiCircuitsProvidersBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsProvidersBulkDestroyExecute(r) +} + +/* +CircuitsProvidersBulkDestroy Method for CircuitsProvidersBulkDestroy + +Delete a list of provider objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProvidersBulkDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersBulkDestroy(ctx context.Context) ApiCircuitsProvidersBulkDestroyRequest { + return ApiCircuitsProvidersBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsProvidersBulkDestroyExecute(r ApiCircuitsProvidersBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerRequest == nil { + return nil, reportError("providerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerRequest *[]ProviderRequest +} + +func (r ApiCircuitsProvidersBulkPartialUpdateRequest) ProviderRequest(providerRequest []ProviderRequest) ApiCircuitsProvidersBulkPartialUpdateRequest { + r.providerRequest = &providerRequest + return r +} + +func (r ApiCircuitsProvidersBulkPartialUpdateRequest) Execute() ([]Provider, *http.Response, error) { + return r.ApiService.CircuitsProvidersBulkPartialUpdateExecute(r) +} + +/* +CircuitsProvidersBulkPartialUpdate Method for CircuitsProvidersBulkPartialUpdate + +Patch a list of provider objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProvidersBulkPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersBulkPartialUpdate(ctx context.Context) ApiCircuitsProvidersBulkPartialUpdateRequest { + return ApiCircuitsProvidersBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Provider +func (a *CircuitsAPIService) CircuitsProvidersBulkPartialUpdateExecute(r ApiCircuitsProvidersBulkPartialUpdateRequest) ([]Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerRequest == nil { + return localVarReturnValue, nil, reportError("providerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersBulkUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + providerRequest *[]ProviderRequest +} + +func (r ApiCircuitsProvidersBulkUpdateRequest) ProviderRequest(providerRequest []ProviderRequest) ApiCircuitsProvidersBulkUpdateRequest { + r.providerRequest = &providerRequest + return r +} + +func (r ApiCircuitsProvidersBulkUpdateRequest) Execute() ([]Provider, *http.Response, error) { + return r.ApiService.CircuitsProvidersBulkUpdateExecute(r) +} + +/* +CircuitsProvidersBulkUpdate Method for CircuitsProvidersBulkUpdate + +Put a list of provider objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProvidersBulkUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersBulkUpdate(ctx context.Context) ApiCircuitsProvidersBulkUpdateRequest { + return ApiCircuitsProvidersBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Provider +func (a *CircuitsAPIService) CircuitsProvidersBulkUpdateExecute(r ApiCircuitsProvidersBulkUpdateRequest) ([]Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.providerRequest == nil { + return localVarReturnValue, nil, reportError("providerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.providerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersCreateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + writableProviderRequest *WritableProviderRequest +} + +func (r ApiCircuitsProvidersCreateRequest) WritableProviderRequest(writableProviderRequest WritableProviderRequest) ApiCircuitsProvidersCreateRequest { + r.writableProviderRequest = &writableProviderRequest + return r +} + +func (r ApiCircuitsProvidersCreateRequest) Execute() (*Provider, *http.Response, error) { + return r.ApiService.CircuitsProvidersCreateExecute(r) +} + +/* +CircuitsProvidersCreate Method for CircuitsProvidersCreate + +Post a list of provider objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProvidersCreateRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersCreate(ctx context.Context) ApiCircuitsProvidersCreateRequest { + return ApiCircuitsProvidersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Provider +func (a *CircuitsAPIService) CircuitsProvidersCreateExecute(r ApiCircuitsProvidersCreateRequest) (*Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableProviderRequest == nil { + return localVarReturnValue, nil, reportError("writableProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableProviderRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersDestroyRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsProvidersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CircuitsProvidersDestroyExecute(r) +} + +/* +CircuitsProvidersDestroy Method for CircuitsProvidersDestroy + +Delete a provider object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider. + @return ApiCircuitsProvidersDestroyRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersDestroy(ctx context.Context, id int32) ApiCircuitsProvidersDestroyRequest { + return ApiCircuitsProvidersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CircuitsAPIService) CircuitsProvidersDestroyExecute(r ApiCircuitsProvidersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersListRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + asnId *[]int32 + asnIdN *[]int32 + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// ASN (ID) +func (r ApiCircuitsProvidersListRequest) AsnId(asnId []int32) ApiCircuitsProvidersListRequest { + r.asnId = &asnId + return r +} + +// ASN (ID) +func (r ApiCircuitsProvidersListRequest) AsnIdN(asnIdN []int32) ApiCircuitsProvidersListRequest { + r.asnIdN = &asnIdN + return r +} + +// Contact +func (r ApiCircuitsProvidersListRequest) Contact(contact []int32) ApiCircuitsProvidersListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiCircuitsProvidersListRequest) ContactN(contactN []int32) ApiCircuitsProvidersListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiCircuitsProvidersListRequest) ContactGroup(contactGroup []int32) ApiCircuitsProvidersListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiCircuitsProvidersListRequest) ContactGroupN(contactGroupN []int32) ApiCircuitsProvidersListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiCircuitsProvidersListRequest) ContactRole(contactRole []int32) ApiCircuitsProvidersListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiCircuitsProvidersListRequest) ContactRoleN(contactRoleN []int32) ApiCircuitsProvidersListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiCircuitsProvidersListRequest) Created(created []time.Time) ApiCircuitsProvidersListRequest { + r.created = &created + return r +} + +func (r ApiCircuitsProvidersListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCircuitsProvidersListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCircuitsProvidersListRequest) CreatedGt(createdGt []time.Time) ApiCircuitsProvidersListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCircuitsProvidersListRequest) CreatedGte(createdGte []time.Time) ApiCircuitsProvidersListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCircuitsProvidersListRequest) CreatedLt(createdLt []time.Time) ApiCircuitsProvidersListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCircuitsProvidersListRequest) CreatedLte(createdLte []time.Time) ApiCircuitsProvidersListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCircuitsProvidersListRequest) CreatedN(createdN []time.Time) ApiCircuitsProvidersListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCircuitsProvidersListRequest) CreatedByRequest(createdByRequest string) ApiCircuitsProvidersListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCircuitsProvidersListRequest) Description(description []string) ApiCircuitsProvidersListRequest { + r.description = &description + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionEmpty(descriptionEmpty bool) ApiCircuitsProvidersListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionIc(descriptionIc []string) ApiCircuitsProvidersListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionIe(descriptionIe []string) ApiCircuitsProvidersListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionIew(descriptionIew []string) ApiCircuitsProvidersListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionIsw(descriptionIsw []string) ApiCircuitsProvidersListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionN(descriptionN []string) ApiCircuitsProvidersListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionNic(descriptionNic []string) ApiCircuitsProvidersListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionNie(descriptionNie []string) ApiCircuitsProvidersListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionNiew(descriptionNiew []string) ApiCircuitsProvidersListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiCircuitsProvidersListRequest) DescriptionNisw(descriptionNisw []string) ApiCircuitsProvidersListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiCircuitsProvidersListRequest) Id(id []int32) ApiCircuitsProvidersListRequest { + r.id = &id + return r +} + +func (r ApiCircuitsProvidersListRequest) IdEmpty(idEmpty bool) ApiCircuitsProvidersListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCircuitsProvidersListRequest) IdGt(idGt []int32) ApiCircuitsProvidersListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCircuitsProvidersListRequest) IdGte(idGte []int32) ApiCircuitsProvidersListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCircuitsProvidersListRequest) IdLt(idLt []int32) ApiCircuitsProvidersListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCircuitsProvidersListRequest) IdLte(idLte []int32) ApiCircuitsProvidersListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCircuitsProvidersListRequest) IdN(idN []int32) ApiCircuitsProvidersListRequest { + r.idN = &idN + return r +} + +func (r ApiCircuitsProvidersListRequest) LastUpdated(lastUpdated []time.Time) ApiCircuitsProvidersListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCircuitsProvidersListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCircuitsProvidersListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCircuitsProvidersListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCircuitsProvidersListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCircuitsProvidersListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCircuitsProvidersListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCircuitsProvidersListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCircuitsProvidersListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCircuitsProvidersListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCircuitsProvidersListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCircuitsProvidersListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCircuitsProvidersListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCircuitsProvidersListRequest) Limit(limit int32) ApiCircuitsProvidersListRequest { + r.limit = &limit + return r +} + +func (r ApiCircuitsProvidersListRequest) ModifiedByRequest(modifiedByRequest string) ApiCircuitsProvidersListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiCircuitsProvidersListRequest) Name(name []string) ApiCircuitsProvidersListRequest { + r.name = &name + return r +} + +func (r ApiCircuitsProvidersListRequest) NameEmpty(nameEmpty bool) ApiCircuitsProvidersListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiCircuitsProvidersListRequest) NameIc(nameIc []string) ApiCircuitsProvidersListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiCircuitsProvidersListRequest) NameIe(nameIe []string) ApiCircuitsProvidersListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiCircuitsProvidersListRequest) NameIew(nameIew []string) ApiCircuitsProvidersListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiCircuitsProvidersListRequest) NameIsw(nameIsw []string) ApiCircuitsProvidersListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiCircuitsProvidersListRequest) NameN(nameN []string) ApiCircuitsProvidersListRequest { + r.nameN = &nameN + return r +} + +func (r ApiCircuitsProvidersListRequest) NameNic(nameNic []string) ApiCircuitsProvidersListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiCircuitsProvidersListRequest) NameNie(nameNie []string) ApiCircuitsProvidersListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiCircuitsProvidersListRequest) NameNiew(nameNiew []string) ApiCircuitsProvidersListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiCircuitsProvidersListRequest) NameNisw(nameNisw []string) ApiCircuitsProvidersListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiCircuitsProvidersListRequest) Offset(offset int32) ApiCircuitsProvidersListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCircuitsProvidersListRequest) Ordering(ordering string) ApiCircuitsProvidersListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiCircuitsProvidersListRequest) Q(q string) ApiCircuitsProvidersListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiCircuitsProvidersListRequest) Region(region []int32) ApiCircuitsProvidersListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiCircuitsProvidersListRequest) RegionN(regionN []int32) ApiCircuitsProvidersListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiCircuitsProvidersListRequest) RegionId(regionId []int32) ApiCircuitsProvidersListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiCircuitsProvidersListRequest) RegionIdN(regionIdN []int32) ApiCircuitsProvidersListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site (slug) +func (r ApiCircuitsProvidersListRequest) Site(site []string) ApiCircuitsProvidersListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiCircuitsProvidersListRequest) SiteN(siteN []string) ApiCircuitsProvidersListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiCircuitsProvidersListRequest) SiteGroup(siteGroup []int32) ApiCircuitsProvidersListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiCircuitsProvidersListRequest) SiteGroupN(siteGroupN []int32) ApiCircuitsProvidersListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiCircuitsProvidersListRequest) SiteGroupId(siteGroupId []int32) ApiCircuitsProvidersListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiCircuitsProvidersListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiCircuitsProvidersListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site +func (r ApiCircuitsProvidersListRequest) SiteId(siteId []int32) ApiCircuitsProvidersListRequest { + r.siteId = &siteId + return r +} + +// Site +func (r ApiCircuitsProvidersListRequest) SiteIdN(siteIdN []int32) ApiCircuitsProvidersListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiCircuitsProvidersListRequest) Slug(slug []string) ApiCircuitsProvidersListRequest { + r.slug = &slug + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugEmpty(slugEmpty bool) ApiCircuitsProvidersListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugIc(slugIc []string) ApiCircuitsProvidersListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugIe(slugIe []string) ApiCircuitsProvidersListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugIew(slugIew []string) ApiCircuitsProvidersListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugIsw(slugIsw []string) ApiCircuitsProvidersListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugN(slugN []string) ApiCircuitsProvidersListRequest { + r.slugN = &slugN + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugNic(slugNic []string) ApiCircuitsProvidersListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugNie(slugNie []string) ApiCircuitsProvidersListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugNiew(slugNiew []string) ApiCircuitsProvidersListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiCircuitsProvidersListRequest) SlugNisw(slugNisw []string) ApiCircuitsProvidersListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiCircuitsProvidersListRequest) Tag(tag []string) ApiCircuitsProvidersListRequest { + r.tag = &tag + return r +} + +func (r ApiCircuitsProvidersListRequest) TagN(tagN []string) ApiCircuitsProvidersListRequest { + r.tagN = &tagN + return r +} + +func (r ApiCircuitsProvidersListRequest) UpdatedByRequest(updatedByRequest string) ApiCircuitsProvidersListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCircuitsProvidersListRequest) Execute() (*PaginatedProviderList, *http.Response, error) { + return r.ApiService.CircuitsProvidersListExecute(r) +} + +/* +CircuitsProvidersList Method for CircuitsProvidersList + +Get a list of provider objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCircuitsProvidersListRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersList(ctx context.Context) ApiCircuitsProvidersListRequest { + return ApiCircuitsProvidersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedProviderList +func (a *CircuitsAPIService) CircuitsProvidersListExecute(r ApiCircuitsProvidersListRequest) (*PaginatedProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.asnId != nil { + t := *r.asnId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id", t, "multi") + } + } + if r.asnIdN != nil { + t := *r.asnIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id__n", t, "multi") + } + } + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersPartialUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + patchedWritableProviderRequest *PatchedWritableProviderRequest +} + +func (r ApiCircuitsProvidersPartialUpdateRequest) PatchedWritableProviderRequest(patchedWritableProviderRequest PatchedWritableProviderRequest) ApiCircuitsProvidersPartialUpdateRequest { + r.patchedWritableProviderRequest = &patchedWritableProviderRequest + return r +} + +func (r ApiCircuitsProvidersPartialUpdateRequest) Execute() (*Provider, *http.Response, error) { + return r.ApiService.CircuitsProvidersPartialUpdateExecute(r) +} + +/* +CircuitsProvidersPartialUpdate Method for CircuitsProvidersPartialUpdate + +Patch a provider object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider. + @return ApiCircuitsProvidersPartialUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersPartialUpdate(ctx context.Context, id int32) ApiCircuitsProvidersPartialUpdateRequest { + return ApiCircuitsProvidersPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Provider +func (a *CircuitsAPIService) CircuitsProvidersPartialUpdateExecute(r ApiCircuitsProvidersPartialUpdateRequest) (*Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableProviderRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersRetrieveRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 +} + +func (r ApiCircuitsProvidersRetrieveRequest) Execute() (*Provider, *http.Response, error) { + return r.ApiService.CircuitsProvidersRetrieveExecute(r) +} + +/* +CircuitsProvidersRetrieve Method for CircuitsProvidersRetrieve + +Get a provider object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider. + @return ApiCircuitsProvidersRetrieveRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersRetrieve(ctx context.Context, id int32) ApiCircuitsProvidersRetrieveRequest { + return ApiCircuitsProvidersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Provider +func (a *CircuitsAPIService) CircuitsProvidersRetrieveExecute(r ApiCircuitsProvidersRetrieveRequest) (*Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCircuitsProvidersUpdateRequest struct { + ctx context.Context + ApiService *CircuitsAPIService + id int32 + writableProviderRequest *WritableProviderRequest +} + +func (r ApiCircuitsProvidersUpdateRequest) WritableProviderRequest(writableProviderRequest WritableProviderRequest) ApiCircuitsProvidersUpdateRequest { + r.writableProviderRequest = &writableProviderRequest + return r +} + +func (r ApiCircuitsProvidersUpdateRequest) Execute() (*Provider, *http.Response, error) { + return r.ApiService.CircuitsProvidersUpdateExecute(r) +} + +/* +CircuitsProvidersUpdate Method for CircuitsProvidersUpdate + +Put a provider object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider. + @return ApiCircuitsProvidersUpdateRequest +*/ +func (a *CircuitsAPIService) CircuitsProvidersUpdate(ctx context.Context, id int32) ApiCircuitsProvidersUpdateRequest { + return ApiCircuitsProvidersUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Provider +func (a *CircuitsAPIService) CircuitsProvidersUpdateExecute(r ApiCircuitsProvidersUpdateRequest) (*Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CircuitsAPIService.CircuitsProvidersUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/circuits/providers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableProviderRequest == nil { + return localVarReturnValue, nil, reportError("writableProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableProviderRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_core.go b/vendor/github.com/netbox-community/go-netbox/v3/api_core.go new file mode 100644 index 00000000..20aa7db8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_core.go @@ -0,0 +1,4270 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// CoreAPIService CoreAPI service +type CoreAPIService service + +type ApiCoreDataFilesListRequest struct { + ctx context.Context + ApiService *CoreAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + hash *[]string + hashEmpty *bool + hashIc *[]string + hashIe *[]string + hashIew *[]string + hashIsw *[]string + hashN *[]string + hashNic *[]string + hashNie *[]string + hashNiew *[]string + hashNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + path *[]string + pathEmpty *bool + pathIc *[]string + pathIe *[]string + pathIew *[]string + pathIsw *[]string + pathN *[]string + pathNic *[]string + pathNie *[]string + pathNiew *[]string + pathNisw *[]string + q *string + size *[]int32 + sizeEmpty *bool + sizeGt *[]int32 + sizeGte *[]int32 + sizeLt *[]int32 + sizeLte *[]int32 + sizeN *[]int32 + source *[]string + sourceN *[]string + sourceId *[]int32 + sourceIdN *[]int32 + updatedByRequest *string +} + +func (r ApiCoreDataFilesListRequest) Created(created []time.Time) ApiCoreDataFilesListRequest { + r.created = &created + return r +} + +func (r ApiCoreDataFilesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCoreDataFilesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCoreDataFilesListRequest) CreatedGt(createdGt []time.Time) ApiCoreDataFilesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCoreDataFilesListRequest) CreatedGte(createdGte []time.Time) ApiCoreDataFilesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCoreDataFilesListRequest) CreatedLt(createdLt []time.Time) ApiCoreDataFilesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCoreDataFilesListRequest) CreatedLte(createdLte []time.Time) ApiCoreDataFilesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCoreDataFilesListRequest) CreatedN(createdN []time.Time) ApiCoreDataFilesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCoreDataFilesListRequest) CreatedByRequest(createdByRequest string) ApiCoreDataFilesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCoreDataFilesListRequest) Hash(hash []string) ApiCoreDataFilesListRequest { + r.hash = &hash + return r +} + +func (r ApiCoreDataFilesListRequest) HashEmpty(hashEmpty bool) ApiCoreDataFilesListRequest { + r.hashEmpty = &hashEmpty + return r +} + +func (r ApiCoreDataFilesListRequest) HashIc(hashIc []string) ApiCoreDataFilesListRequest { + r.hashIc = &hashIc + return r +} + +func (r ApiCoreDataFilesListRequest) HashIe(hashIe []string) ApiCoreDataFilesListRequest { + r.hashIe = &hashIe + return r +} + +func (r ApiCoreDataFilesListRequest) HashIew(hashIew []string) ApiCoreDataFilesListRequest { + r.hashIew = &hashIew + return r +} + +func (r ApiCoreDataFilesListRequest) HashIsw(hashIsw []string) ApiCoreDataFilesListRequest { + r.hashIsw = &hashIsw + return r +} + +func (r ApiCoreDataFilesListRequest) HashN(hashN []string) ApiCoreDataFilesListRequest { + r.hashN = &hashN + return r +} + +func (r ApiCoreDataFilesListRequest) HashNic(hashNic []string) ApiCoreDataFilesListRequest { + r.hashNic = &hashNic + return r +} + +func (r ApiCoreDataFilesListRequest) HashNie(hashNie []string) ApiCoreDataFilesListRequest { + r.hashNie = &hashNie + return r +} + +func (r ApiCoreDataFilesListRequest) HashNiew(hashNiew []string) ApiCoreDataFilesListRequest { + r.hashNiew = &hashNiew + return r +} + +func (r ApiCoreDataFilesListRequest) HashNisw(hashNisw []string) ApiCoreDataFilesListRequest { + r.hashNisw = &hashNisw + return r +} + +func (r ApiCoreDataFilesListRequest) Id(id []int32) ApiCoreDataFilesListRequest { + r.id = &id + return r +} + +func (r ApiCoreDataFilesListRequest) IdEmpty(idEmpty bool) ApiCoreDataFilesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCoreDataFilesListRequest) IdGt(idGt []int32) ApiCoreDataFilesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCoreDataFilesListRequest) IdGte(idGte []int32) ApiCoreDataFilesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCoreDataFilesListRequest) IdLt(idLt []int32) ApiCoreDataFilesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCoreDataFilesListRequest) IdLte(idLte []int32) ApiCoreDataFilesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCoreDataFilesListRequest) IdN(idN []int32) ApiCoreDataFilesListRequest { + r.idN = &idN + return r +} + +func (r ApiCoreDataFilesListRequest) LastUpdated(lastUpdated []time.Time) ApiCoreDataFilesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCoreDataFilesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCoreDataFilesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCoreDataFilesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCoreDataFilesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCoreDataFilesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCoreDataFilesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCoreDataFilesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCoreDataFilesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCoreDataFilesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCoreDataFilesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCoreDataFilesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCoreDataFilesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCoreDataFilesListRequest) Limit(limit int32) ApiCoreDataFilesListRequest { + r.limit = &limit + return r +} + +func (r ApiCoreDataFilesListRequest) ModifiedByRequest(modifiedByRequest string) ApiCoreDataFilesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiCoreDataFilesListRequest) Offset(offset int32) ApiCoreDataFilesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreDataFilesListRequest) Ordering(ordering string) ApiCoreDataFilesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiCoreDataFilesListRequest) Path(path []string) ApiCoreDataFilesListRequest { + r.path = &path + return r +} + +func (r ApiCoreDataFilesListRequest) PathEmpty(pathEmpty bool) ApiCoreDataFilesListRequest { + r.pathEmpty = &pathEmpty + return r +} + +func (r ApiCoreDataFilesListRequest) PathIc(pathIc []string) ApiCoreDataFilesListRequest { + r.pathIc = &pathIc + return r +} + +func (r ApiCoreDataFilesListRequest) PathIe(pathIe []string) ApiCoreDataFilesListRequest { + r.pathIe = &pathIe + return r +} + +func (r ApiCoreDataFilesListRequest) PathIew(pathIew []string) ApiCoreDataFilesListRequest { + r.pathIew = &pathIew + return r +} + +func (r ApiCoreDataFilesListRequest) PathIsw(pathIsw []string) ApiCoreDataFilesListRequest { + r.pathIsw = &pathIsw + return r +} + +func (r ApiCoreDataFilesListRequest) PathN(pathN []string) ApiCoreDataFilesListRequest { + r.pathN = &pathN + return r +} + +func (r ApiCoreDataFilesListRequest) PathNic(pathNic []string) ApiCoreDataFilesListRequest { + r.pathNic = &pathNic + return r +} + +func (r ApiCoreDataFilesListRequest) PathNie(pathNie []string) ApiCoreDataFilesListRequest { + r.pathNie = &pathNie + return r +} + +func (r ApiCoreDataFilesListRequest) PathNiew(pathNiew []string) ApiCoreDataFilesListRequest { + r.pathNiew = &pathNiew + return r +} + +func (r ApiCoreDataFilesListRequest) PathNisw(pathNisw []string) ApiCoreDataFilesListRequest { + r.pathNisw = &pathNisw + return r +} + +func (r ApiCoreDataFilesListRequest) Q(q string) ApiCoreDataFilesListRequest { + r.q = &q + return r +} + +func (r ApiCoreDataFilesListRequest) Size(size []int32) ApiCoreDataFilesListRequest { + r.size = &size + return r +} + +func (r ApiCoreDataFilesListRequest) SizeEmpty(sizeEmpty bool) ApiCoreDataFilesListRequest { + r.sizeEmpty = &sizeEmpty + return r +} + +func (r ApiCoreDataFilesListRequest) SizeGt(sizeGt []int32) ApiCoreDataFilesListRequest { + r.sizeGt = &sizeGt + return r +} + +func (r ApiCoreDataFilesListRequest) SizeGte(sizeGte []int32) ApiCoreDataFilesListRequest { + r.sizeGte = &sizeGte + return r +} + +func (r ApiCoreDataFilesListRequest) SizeLt(sizeLt []int32) ApiCoreDataFilesListRequest { + r.sizeLt = &sizeLt + return r +} + +func (r ApiCoreDataFilesListRequest) SizeLte(sizeLte []int32) ApiCoreDataFilesListRequest { + r.sizeLte = &sizeLte + return r +} + +func (r ApiCoreDataFilesListRequest) SizeN(sizeN []int32) ApiCoreDataFilesListRequest { + r.sizeN = &sizeN + return r +} + +// Data source (name) +func (r ApiCoreDataFilesListRequest) Source(source []string) ApiCoreDataFilesListRequest { + r.source = &source + return r +} + +// Data source (name) +func (r ApiCoreDataFilesListRequest) SourceN(sourceN []string) ApiCoreDataFilesListRequest { + r.sourceN = &sourceN + return r +} + +// Data source (ID) +func (r ApiCoreDataFilesListRequest) SourceId(sourceId []int32) ApiCoreDataFilesListRequest { + r.sourceId = &sourceId + return r +} + +// Data source (ID) +func (r ApiCoreDataFilesListRequest) SourceIdN(sourceIdN []int32) ApiCoreDataFilesListRequest { + r.sourceIdN = &sourceIdN + return r +} + +func (r ApiCoreDataFilesListRequest) UpdatedByRequest(updatedByRequest string) ApiCoreDataFilesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCoreDataFilesListRequest) Execute() (*PaginatedDataFileList, *http.Response, error) { + return r.ApiService.CoreDataFilesListExecute(r) +} + +/* +CoreDataFilesList Method for CoreDataFilesList + +Get a list of data file objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreDataFilesListRequest +*/ +func (a *CoreAPIService) CoreDataFilesList(ctx context.Context) ApiCoreDataFilesListRequest { + return ApiCoreDataFilesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDataFileList +func (a *CoreAPIService) CoreDataFilesListExecute(r ApiCoreDataFilesListRequest) (*PaginatedDataFileList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDataFileList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataFilesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-files/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.hash != nil { + t := *r.hash + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash", t, "multi") + } + } + if r.hashEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__empty", r.hashEmpty, "") + } + if r.hashIc != nil { + t := *r.hashIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__ic", t, "multi") + } + } + if r.hashIe != nil { + t := *r.hashIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__ie", t, "multi") + } + } + if r.hashIew != nil { + t := *r.hashIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__iew", t, "multi") + } + } + if r.hashIsw != nil { + t := *r.hashIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__isw", t, "multi") + } + } + if r.hashN != nil { + t := *r.hashN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__n", t, "multi") + } + } + if r.hashNic != nil { + t := *r.hashNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__nic", t, "multi") + } + } + if r.hashNie != nil { + t := *r.hashNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__nie", t, "multi") + } + } + if r.hashNiew != nil { + t := *r.hashNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__niew", t, "multi") + } + } + if r.hashNisw != nil { + t := *r.hashNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "hash__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.path != nil { + t := *r.path + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path", t, "multi") + } + } + if r.pathEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__empty", r.pathEmpty, "") + } + if r.pathIc != nil { + t := *r.pathIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__ic", t, "multi") + } + } + if r.pathIe != nil { + t := *r.pathIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__ie", t, "multi") + } + } + if r.pathIew != nil { + t := *r.pathIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__iew", t, "multi") + } + } + if r.pathIsw != nil { + t := *r.pathIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__isw", t, "multi") + } + } + if r.pathN != nil { + t := *r.pathN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__n", t, "multi") + } + } + if r.pathNic != nil { + t := *r.pathNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__nic", t, "multi") + } + } + if r.pathNie != nil { + t := *r.pathNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__nie", t, "multi") + } + } + if r.pathNiew != nil { + t := *r.pathNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__niew", t, "multi") + } + } + if r.pathNisw != nil { + t := *r.pathNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "path__nisw", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.size != nil { + t := *r.size + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", t, "multi") + } + } + if r.sizeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__empty", r.sizeEmpty, "") + } + if r.sizeGt != nil { + t := *r.sizeGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gt", t, "multi") + } + } + if r.sizeGte != nil { + t := *r.sizeGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gte", t, "multi") + } + } + if r.sizeLt != nil { + t := *r.sizeLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lt", t, "multi") + } + } + if r.sizeLte != nil { + t := *r.sizeLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lte", t, "multi") + } + } + if r.sizeN != nil { + t := *r.sizeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__n", t, "multi") + } + } + if r.source != nil { + t := *r.source + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "source", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "source", t, "multi") + } + } + if r.sourceN != nil { + t := *r.sourceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__n", t, "multi") + } + } + if r.sourceId != nil { + t := *r.sourceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "source_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "source_id", t, "multi") + } + } + if r.sourceIdN != nil { + t := *r.sourceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "source_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "source_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataFilesRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreDataFilesRetrieveRequest) Execute() (*DataFile, *http.Response, error) { + return r.ApiService.CoreDataFilesRetrieveExecute(r) +} + +/* +CoreDataFilesRetrieve Method for CoreDataFilesRetrieve + +Get a data file object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this data file. + @return ApiCoreDataFilesRetrieveRequest +*/ +func (a *CoreAPIService) CoreDataFilesRetrieve(ctx context.Context, id int32) ApiCoreDataFilesRetrieveRequest { + return ApiCoreDataFilesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DataFile +func (a *CoreAPIService) CoreDataFilesRetrieveExecute(r ApiCoreDataFilesRetrieveRequest) (*DataFile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataFilesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-files/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesBulkDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + dataSourceRequest *[]DataSourceRequest +} + +func (r ApiCoreDataSourcesBulkDestroyRequest) DataSourceRequest(dataSourceRequest []DataSourceRequest) ApiCoreDataSourcesBulkDestroyRequest { + r.dataSourceRequest = &dataSourceRequest + return r +} + +func (r ApiCoreDataSourcesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreDataSourcesBulkDestroyExecute(r) +} + +/* +CoreDataSourcesBulkDestroy Method for CoreDataSourcesBulkDestroy + +Delete a list of data source objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreDataSourcesBulkDestroyRequest +*/ +func (a *CoreAPIService) CoreDataSourcesBulkDestroy(ctx context.Context) ApiCoreDataSourcesBulkDestroyRequest { + return ApiCoreDataSourcesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreDataSourcesBulkDestroyExecute(r ApiCoreDataSourcesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dataSourceRequest == nil { + return nil, reportError("dataSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dataSourceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + dataSourceRequest *[]DataSourceRequest +} + +func (r ApiCoreDataSourcesBulkPartialUpdateRequest) DataSourceRequest(dataSourceRequest []DataSourceRequest) ApiCoreDataSourcesBulkPartialUpdateRequest { + r.dataSourceRequest = &dataSourceRequest + return r +} + +func (r ApiCoreDataSourcesBulkPartialUpdateRequest) Execute() ([]DataSource, *http.Response, error) { + return r.ApiService.CoreDataSourcesBulkPartialUpdateExecute(r) +} + +/* +CoreDataSourcesBulkPartialUpdate Method for CoreDataSourcesBulkPartialUpdate + +Patch a list of data source objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreDataSourcesBulkPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreDataSourcesBulkPartialUpdate(ctx context.Context) ApiCoreDataSourcesBulkPartialUpdateRequest { + return ApiCoreDataSourcesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DataSource +func (a *CoreAPIService) CoreDataSourcesBulkPartialUpdateExecute(r ApiCoreDataSourcesBulkPartialUpdateRequest) ([]DataSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DataSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dataSourceRequest == nil { + return localVarReturnValue, nil, reportError("dataSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dataSourceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesBulkUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + dataSourceRequest *[]DataSourceRequest +} + +func (r ApiCoreDataSourcesBulkUpdateRequest) DataSourceRequest(dataSourceRequest []DataSourceRequest) ApiCoreDataSourcesBulkUpdateRequest { + r.dataSourceRequest = &dataSourceRequest + return r +} + +func (r ApiCoreDataSourcesBulkUpdateRequest) Execute() ([]DataSource, *http.Response, error) { + return r.ApiService.CoreDataSourcesBulkUpdateExecute(r) +} + +/* +CoreDataSourcesBulkUpdate Method for CoreDataSourcesBulkUpdate + +Put a list of data source objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreDataSourcesBulkUpdateRequest +*/ +func (a *CoreAPIService) CoreDataSourcesBulkUpdate(ctx context.Context) ApiCoreDataSourcesBulkUpdateRequest { + return ApiCoreDataSourcesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DataSource +func (a *CoreAPIService) CoreDataSourcesBulkUpdateExecute(r ApiCoreDataSourcesBulkUpdateRequest) ([]DataSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DataSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dataSourceRequest == nil { + return localVarReturnValue, nil, reportError("dataSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dataSourceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + writableDataSourceRequest *WritableDataSourceRequest +} + +func (r ApiCoreDataSourcesCreateRequest) WritableDataSourceRequest(writableDataSourceRequest WritableDataSourceRequest) ApiCoreDataSourcesCreateRequest { + r.writableDataSourceRequest = &writableDataSourceRequest + return r +} + +func (r ApiCoreDataSourcesCreateRequest) Execute() (*DataSource, *http.Response, error) { + return r.ApiService.CoreDataSourcesCreateExecute(r) +} + +/* +CoreDataSourcesCreate Method for CoreDataSourcesCreate + +Post a list of data source objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreDataSourcesCreateRequest +*/ +func (a *CoreAPIService) CoreDataSourcesCreate(ctx context.Context) ApiCoreDataSourcesCreateRequest { + return ApiCoreDataSourcesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DataSource +func (a *CoreAPIService) CoreDataSourcesCreateExecute(r ApiCoreDataSourcesCreateRequest) (*DataSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDataSourceRequest == nil { + return localVarReturnValue, nil, reportError("writableDataSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDataSourceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreDataSourcesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreDataSourcesDestroyExecute(r) +} + +/* +CoreDataSourcesDestroy Method for CoreDataSourcesDestroy + +Delete a data source object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this data source. + @return ApiCoreDataSourcesDestroyRequest +*/ +func (a *CoreAPIService) CoreDataSourcesDestroy(ctx context.Context, id int32) ApiCoreDataSourcesDestroyRequest { + return ApiCoreDataSourcesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreDataSourcesDestroyExecute(r ApiCoreDataSourcesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesListRequest struct { + ctx context.Context + ApiService *CoreAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + enabled *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string +} + +func (r ApiCoreDataSourcesListRequest) Created(created []time.Time) ApiCoreDataSourcesListRequest { + r.created = &created + return r +} + +func (r ApiCoreDataSourcesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiCoreDataSourcesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiCoreDataSourcesListRequest) CreatedGt(createdGt []time.Time) ApiCoreDataSourcesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiCoreDataSourcesListRequest) CreatedGte(createdGte []time.Time) ApiCoreDataSourcesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiCoreDataSourcesListRequest) CreatedLt(createdLt []time.Time) ApiCoreDataSourcesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiCoreDataSourcesListRequest) CreatedLte(createdLte []time.Time) ApiCoreDataSourcesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiCoreDataSourcesListRequest) CreatedN(createdN []time.Time) ApiCoreDataSourcesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiCoreDataSourcesListRequest) CreatedByRequest(createdByRequest string) ApiCoreDataSourcesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiCoreDataSourcesListRequest) Description(description []string) ApiCoreDataSourcesListRequest { + r.description = &description + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiCoreDataSourcesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionIc(descriptionIc []string) ApiCoreDataSourcesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionIe(descriptionIe []string) ApiCoreDataSourcesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionIew(descriptionIew []string) ApiCoreDataSourcesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionIsw(descriptionIsw []string) ApiCoreDataSourcesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionN(descriptionN []string) ApiCoreDataSourcesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionNic(descriptionNic []string) ApiCoreDataSourcesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionNie(descriptionNie []string) ApiCoreDataSourcesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionNiew(descriptionNiew []string) ApiCoreDataSourcesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiCoreDataSourcesListRequest) DescriptionNisw(descriptionNisw []string) ApiCoreDataSourcesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiCoreDataSourcesListRequest) Enabled(enabled bool) ApiCoreDataSourcesListRequest { + r.enabled = &enabled + return r +} + +func (r ApiCoreDataSourcesListRequest) Id(id []int32) ApiCoreDataSourcesListRequest { + r.id = &id + return r +} + +func (r ApiCoreDataSourcesListRequest) IdEmpty(idEmpty bool) ApiCoreDataSourcesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCoreDataSourcesListRequest) IdGt(idGt []int32) ApiCoreDataSourcesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCoreDataSourcesListRequest) IdGte(idGte []int32) ApiCoreDataSourcesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCoreDataSourcesListRequest) IdLt(idLt []int32) ApiCoreDataSourcesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCoreDataSourcesListRequest) IdLte(idLte []int32) ApiCoreDataSourcesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCoreDataSourcesListRequest) IdN(idN []int32) ApiCoreDataSourcesListRequest { + r.idN = &idN + return r +} + +func (r ApiCoreDataSourcesListRequest) LastUpdated(lastUpdated []time.Time) ApiCoreDataSourcesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCoreDataSourcesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiCoreDataSourcesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiCoreDataSourcesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiCoreDataSourcesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCoreDataSourcesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiCoreDataSourcesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiCoreDataSourcesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiCoreDataSourcesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCoreDataSourcesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiCoreDataSourcesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiCoreDataSourcesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiCoreDataSourcesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiCoreDataSourcesListRequest) Limit(limit int32) ApiCoreDataSourcesListRequest { + r.limit = &limit + return r +} + +func (r ApiCoreDataSourcesListRequest) ModifiedByRequest(modifiedByRequest string) ApiCoreDataSourcesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiCoreDataSourcesListRequest) Name(name []string) ApiCoreDataSourcesListRequest { + r.name = &name + return r +} + +func (r ApiCoreDataSourcesListRequest) NameEmpty(nameEmpty bool) ApiCoreDataSourcesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiCoreDataSourcesListRequest) NameIc(nameIc []string) ApiCoreDataSourcesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiCoreDataSourcesListRequest) NameIe(nameIe []string) ApiCoreDataSourcesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiCoreDataSourcesListRequest) NameIew(nameIew []string) ApiCoreDataSourcesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiCoreDataSourcesListRequest) NameIsw(nameIsw []string) ApiCoreDataSourcesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiCoreDataSourcesListRequest) NameN(nameN []string) ApiCoreDataSourcesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiCoreDataSourcesListRequest) NameNic(nameNic []string) ApiCoreDataSourcesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiCoreDataSourcesListRequest) NameNie(nameNie []string) ApiCoreDataSourcesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiCoreDataSourcesListRequest) NameNiew(nameNiew []string) ApiCoreDataSourcesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiCoreDataSourcesListRequest) NameNisw(nameNisw []string) ApiCoreDataSourcesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiCoreDataSourcesListRequest) Offset(offset int32) ApiCoreDataSourcesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreDataSourcesListRequest) Ordering(ordering string) ApiCoreDataSourcesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiCoreDataSourcesListRequest) Q(q string) ApiCoreDataSourcesListRequest { + r.q = &q + return r +} + +func (r ApiCoreDataSourcesListRequest) Status(status []string) ApiCoreDataSourcesListRequest { + r.status = &status + return r +} + +func (r ApiCoreDataSourcesListRequest) StatusN(statusN []string) ApiCoreDataSourcesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiCoreDataSourcesListRequest) Tag(tag []string) ApiCoreDataSourcesListRequest { + r.tag = &tag + return r +} + +func (r ApiCoreDataSourcesListRequest) TagN(tagN []string) ApiCoreDataSourcesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiCoreDataSourcesListRequest) Type_(type_ []string) ApiCoreDataSourcesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiCoreDataSourcesListRequest) TypeN(typeN []string) ApiCoreDataSourcesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiCoreDataSourcesListRequest) UpdatedByRequest(updatedByRequest string) ApiCoreDataSourcesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiCoreDataSourcesListRequest) Execute() (*PaginatedDataSourceList, *http.Response, error) { + return r.ApiService.CoreDataSourcesListExecute(r) +} + +/* +CoreDataSourcesList Method for CoreDataSourcesList + +Get a list of data source objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreDataSourcesListRequest +*/ +func (a *CoreAPIService) CoreDataSourcesList(ctx context.Context) ApiCoreDataSourcesListRequest { + return ApiCoreDataSourcesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDataSourceList +func (a *CoreAPIService) CoreDataSourcesListExecute(r ApiCoreDataSourcesListRequest) (*PaginatedDataSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDataSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + patchedWritableDataSourceRequest *PatchedWritableDataSourceRequest +} + +func (r ApiCoreDataSourcesPartialUpdateRequest) PatchedWritableDataSourceRequest(patchedWritableDataSourceRequest PatchedWritableDataSourceRequest) ApiCoreDataSourcesPartialUpdateRequest { + r.patchedWritableDataSourceRequest = &patchedWritableDataSourceRequest + return r +} + +func (r ApiCoreDataSourcesPartialUpdateRequest) Execute() (*DataSource, *http.Response, error) { + return r.ApiService.CoreDataSourcesPartialUpdateExecute(r) +} + +/* +CoreDataSourcesPartialUpdate Method for CoreDataSourcesPartialUpdate + +Patch a data source object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this data source. + @return ApiCoreDataSourcesPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreDataSourcesPartialUpdate(ctx context.Context, id int32) ApiCoreDataSourcesPartialUpdateRequest { + return ApiCoreDataSourcesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DataSource +func (a *CoreAPIService) CoreDataSourcesPartialUpdateExecute(r ApiCoreDataSourcesPartialUpdateRequest) (*DataSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableDataSourceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreDataSourcesRetrieveRequest) Execute() (*DataSource, *http.Response, error) { + return r.ApiService.CoreDataSourcesRetrieveExecute(r) +} + +/* +CoreDataSourcesRetrieve Method for CoreDataSourcesRetrieve + +Get a data source object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this data source. + @return ApiCoreDataSourcesRetrieveRequest +*/ +func (a *CoreAPIService) CoreDataSourcesRetrieve(ctx context.Context, id int32) ApiCoreDataSourcesRetrieveRequest { + return ApiCoreDataSourcesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DataSource +func (a *CoreAPIService) CoreDataSourcesRetrieveExecute(r ApiCoreDataSourcesRetrieveRequest) (*DataSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesSyncCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + writableDataSourceRequest *WritableDataSourceRequest +} + +func (r ApiCoreDataSourcesSyncCreateRequest) WritableDataSourceRequest(writableDataSourceRequest WritableDataSourceRequest) ApiCoreDataSourcesSyncCreateRequest { + r.writableDataSourceRequest = &writableDataSourceRequest + return r +} + +func (r ApiCoreDataSourcesSyncCreateRequest) Execute() (*DataSource, *http.Response, error) { + return r.ApiService.CoreDataSourcesSyncCreateExecute(r) +} + +/* +CoreDataSourcesSyncCreate Method for CoreDataSourcesSyncCreate + +Enqueue a job to synchronize the DataSource. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this data source. + @return ApiCoreDataSourcesSyncCreateRequest +*/ +func (a *CoreAPIService) CoreDataSourcesSyncCreate(ctx context.Context, id int32) ApiCoreDataSourcesSyncCreateRequest { + return ApiCoreDataSourcesSyncCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DataSource +func (a *CoreAPIService) CoreDataSourcesSyncCreateExecute(r ApiCoreDataSourcesSyncCreateRequest) (*DataSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesSyncCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/{id}/sync/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDataSourceRequest == nil { + return localVarReturnValue, nil, reportError("writableDataSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDataSourceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreDataSourcesUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + writableDataSourceRequest *WritableDataSourceRequest +} + +func (r ApiCoreDataSourcesUpdateRequest) WritableDataSourceRequest(writableDataSourceRequest WritableDataSourceRequest) ApiCoreDataSourcesUpdateRequest { + r.writableDataSourceRequest = &writableDataSourceRequest + return r +} + +func (r ApiCoreDataSourcesUpdateRequest) Execute() (*DataSource, *http.Response, error) { + return r.ApiService.CoreDataSourcesUpdateExecute(r) +} + +/* +CoreDataSourcesUpdate Method for CoreDataSourcesUpdate + +Put a data source object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this data source. + @return ApiCoreDataSourcesUpdateRequest +*/ +func (a *CoreAPIService) CoreDataSourcesUpdate(ctx context.Context, id int32) ApiCoreDataSourcesUpdateRequest { + return ApiCoreDataSourcesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DataSource +func (a *CoreAPIService) CoreDataSourcesUpdateExecute(r ApiCoreDataSourcesUpdateRequest) (*DataSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreDataSourcesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/data-sources/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDataSourceRequest == nil { + return localVarReturnValue, nil, reportError("writableDataSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDataSourceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreJobsListRequest struct { + ctx context.Context + ApiService *CoreAPIService + completed *time.Time + completedAfter *time.Time + completedBefore *time.Time + created *time.Time + createdAfter *time.Time + createdBefore *time.Time + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interval *[]int32 + intervalEmpty *bool + intervalGt *[]int32 + intervalGte *[]int32 + intervalLt *[]int32 + intervalLte *[]int32 + intervalN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + objectId *[]int32 + objectIdEmpty *bool + objectIdGt *[]int32 + objectIdGte *[]int32 + objectIdLt *[]int32 + objectIdLte *[]int32 + objectIdN *[]int32 + objectType *int32 + objectTypeN *int32 + offset *int32 + ordering *string + q *string + scheduled *time.Time + scheduledAfter *time.Time + scheduledBefore *time.Time + started *time.Time + startedAfter *time.Time + startedBefore *time.Time + status *[]string + statusN *[]string + user *int32 + userN *int32 +} + +func (r ApiCoreJobsListRequest) Completed(completed time.Time) ApiCoreJobsListRequest { + r.completed = &completed + return r +} + +func (r ApiCoreJobsListRequest) CompletedAfter(completedAfter time.Time) ApiCoreJobsListRequest { + r.completedAfter = &completedAfter + return r +} + +func (r ApiCoreJobsListRequest) CompletedBefore(completedBefore time.Time) ApiCoreJobsListRequest { + r.completedBefore = &completedBefore + return r +} + +func (r ApiCoreJobsListRequest) Created(created time.Time) ApiCoreJobsListRequest { + r.created = &created + return r +} + +func (r ApiCoreJobsListRequest) CreatedAfter(createdAfter time.Time) ApiCoreJobsListRequest { + r.createdAfter = &createdAfter + return r +} + +func (r ApiCoreJobsListRequest) CreatedBefore(createdBefore time.Time) ApiCoreJobsListRequest { + r.createdBefore = &createdBefore + return r +} + +func (r ApiCoreJobsListRequest) Id(id []int32) ApiCoreJobsListRequest { + r.id = &id + return r +} + +func (r ApiCoreJobsListRequest) IdEmpty(idEmpty bool) ApiCoreJobsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiCoreJobsListRequest) IdGt(idGt []int32) ApiCoreJobsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiCoreJobsListRequest) IdGte(idGte []int32) ApiCoreJobsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiCoreJobsListRequest) IdLt(idLt []int32) ApiCoreJobsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiCoreJobsListRequest) IdLte(idLte []int32) ApiCoreJobsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiCoreJobsListRequest) IdN(idN []int32) ApiCoreJobsListRequest { + r.idN = &idN + return r +} + +func (r ApiCoreJobsListRequest) Interval(interval []int32) ApiCoreJobsListRequest { + r.interval = &interval + return r +} + +func (r ApiCoreJobsListRequest) IntervalEmpty(intervalEmpty bool) ApiCoreJobsListRequest { + r.intervalEmpty = &intervalEmpty + return r +} + +func (r ApiCoreJobsListRequest) IntervalGt(intervalGt []int32) ApiCoreJobsListRequest { + r.intervalGt = &intervalGt + return r +} + +func (r ApiCoreJobsListRequest) IntervalGte(intervalGte []int32) ApiCoreJobsListRequest { + r.intervalGte = &intervalGte + return r +} + +func (r ApiCoreJobsListRequest) IntervalLt(intervalLt []int32) ApiCoreJobsListRequest { + r.intervalLt = &intervalLt + return r +} + +func (r ApiCoreJobsListRequest) IntervalLte(intervalLte []int32) ApiCoreJobsListRequest { + r.intervalLte = &intervalLte + return r +} + +func (r ApiCoreJobsListRequest) IntervalN(intervalN []int32) ApiCoreJobsListRequest { + r.intervalN = &intervalN + return r +} + +// Number of results to return per page. +func (r ApiCoreJobsListRequest) Limit(limit int32) ApiCoreJobsListRequest { + r.limit = &limit + return r +} + +func (r ApiCoreJobsListRequest) Name(name []string) ApiCoreJobsListRequest { + r.name = &name + return r +} + +func (r ApiCoreJobsListRequest) NameEmpty(nameEmpty bool) ApiCoreJobsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiCoreJobsListRequest) NameIc(nameIc []string) ApiCoreJobsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiCoreJobsListRequest) NameIe(nameIe []string) ApiCoreJobsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiCoreJobsListRequest) NameIew(nameIew []string) ApiCoreJobsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiCoreJobsListRequest) NameIsw(nameIsw []string) ApiCoreJobsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiCoreJobsListRequest) NameN(nameN []string) ApiCoreJobsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiCoreJobsListRequest) NameNic(nameNic []string) ApiCoreJobsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiCoreJobsListRequest) NameNie(nameNie []string) ApiCoreJobsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiCoreJobsListRequest) NameNiew(nameNiew []string) ApiCoreJobsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiCoreJobsListRequest) NameNisw(nameNisw []string) ApiCoreJobsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiCoreJobsListRequest) ObjectId(objectId []int32) ApiCoreJobsListRequest { + r.objectId = &objectId + return r +} + +func (r ApiCoreJobsListRequest) ObjectIdEmpty(objectIdEmpty bool) ApiCoreJobsListRequest { + r.objectIdEmpty = &objectIdEmpty + return r +} + +func (r ApiCoreJobsListRequest) ObjectIdGt(objectIdGt []int32) ApiCoreJobsListRequest { + r.objectIdGt = &objectIdGt + return r +} + +func (r ApiCoreJobsListRequest) ObjectIdGte(objectIdGte []int32) ApiCoreJobsListRequest { + r.objectIdGte = &objectIdGte + return r +} + +func (r ApiCoreJobsListRequest) ObjectIdLt(objectIdLt []int32) ApiCoreJobsListRequest { + r.objectIdLt = &objectIdLt + return r +} + +func (r ApiCoreJobsListRequest) ObjectIdLte(objectIdLte []int32) ApiCoreJobsListRequest { + r.objectIdLte = &objectIdLte + return r +} + +func (r ApiCoreJobsListRequest) ObjectIdN(objectIdN []int32) ApiCoreJobsListRequest { + r.objectIdN = &objectIdN + return r +} + +func (r ApiCoreJobsListRequest) ObjectType(objectType int32) ApiCoreJobsListRequest { + r.objectType = &objectType + return r +} + +func (r ApiCoreJobsListRequest) ObjectTypeN(objectTypeN int32) ApiCoreJobsListRequest { + r.objectTypeN = &objectTypeN + return r +} + +// The initial index from which to return the results. +func (r ApiCoreJobsListRequest) Offset(offset int32) ApiCoreJobsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreJobsListRequest) Ordering(ordering string) ApiCoreJobsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiCoreJobsListRequest) Q(q string) ApiCoreJobsListRequest { + r.q = &q + return r +} + +func (r ApiCoreJobsListRequest) Scheduled(scheduled time.Time) ApiCoreJobsListRequest { + r.scheduled = &scheduled + return r +} + +func (r ApiCoreJobsListRequest) ScheduledAfter(scheduledAfter time.Time) ApiCoreJobsListRequest { + r.scheduledAfter = &scheduledAfter + return r +} + +func (r ApiCoreJobsListRequest) ScheduledBefore(scheduledBefore time.Time) ApiCoreJobsListRequest { + r.scheduledBefore = &scheduledBefore + return r +} + +func (r ApiCoreJobsListRequest) Started(started time.Time) ApiCoreJobsListRequest { + r.started = &started + return r +} + +func (r ApiCoreJobsListRequest) StartedAfter(startedAfter time.Time) ApiCoreJobsListRequest { + r.startedAfter = &startedAfter + return r +} + +func (r ApiCoreJobsListRequest) StartedBefore(startedBefore time.Time) ApiCoreJobsListRequest { + r.startedBefore = &startedBefore + return r +} + +func (r ApiCoreJobsListRequest) Status(status []string) ApiCoreJobsListRequest { + r.status = &status + return r +} + +func (r ApiCoreJobsListRequest) StatusN(statusN []string) ApiCoreJobsListRequest { + r.statusN = &statusN + return r +} + +func (r ApiCoreJobsListRequest) User(user int32) ApiCoreJobsListRequest { + r.user = &user + return r +} + +func (r ApiCoreJobsListRequest) UserN(userN int32) ApiCoreJobsListRequest { + r.userN = &userN + return r +} + +func (r ApiCoreJobsListRequest) Execute() (*PaginatedJobList, *http.Response, error) { + return r.ApiService.CoreJobsListExecute(r) +} + +/* +CoreJobsList Method for CoreJobsList + +Retrieve a list of job results + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreJobsListRequest +*/ +func (a *CoreAPIService) CoreJobsList(ctx context.Context) ApiCoreJobsListRequest { + return ApiCoreJobsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedJobList +func (a *CoreAPIService) CoreJobsListExecute(r ApiCoreJobsListRequest) (*PaginatedJobList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedJobList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreJobsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/jobs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.completed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "completed", r.completed, "") + } + if r.completedAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "completed__after", r.completedAfter, "") + } + if r.completedBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "completed__before", r.completedBefore, "") + } + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "") + } + if r.createdAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__after", r.createdAfter, "") + } + if r.createdBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__before", r.createdBefore, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interval != nil { + t := *r.interval + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval", t, "multi") + } + } + if r.intervalEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__empty", r.intervalEmpty, "") + } + if r.intervalGt != nil { + t := *r.intervalGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__gt", t, "multi") + } + } + if r.intervalGte != nil { + t := *r.intervalGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__gte", t, "multi") + } + } + if r.intervalLt != nil { + t := *r.intervalLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__lt", t, "multi") + } + } + if r.intervalLte != nil { + t := *r.intervalLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__lte", t, "multi") + } + } + if r.intervalN != nil { + t := *r.intervalN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.objectId != nil { + t := *r.objectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", t, "multi") + } + } + if r.objectIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__empty", r.objectIdEmpty, "") + } + if r.objectIdGt != nil { + t := *r.objectIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", t, "multi") + } + } + if r.objectIdGte != nil { + t := *r.objectIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", t, "multi") + } + } + if r.objectIdLt != nil { + t := *r.objectIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", t, "multi") + } + } + if r.objectIdLte != nil { + t := *r.objectIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", t, "multi") + } + } + if r.objectIdN != nil { + t := *r.objectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", t, "multi") + } + } + if r.objectType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type", r.objectType, "") + } + if r.objectTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type__n", r.objectTypeN, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.scheduled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "scheduled", r.scheduled, "") + } + if r.scheduledAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "scheduled__after", r.scheduledAfter, "") + } + if r.scheduledBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "scheduled__before", r.scheduledBefore, "") + } + if r.started != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "started", r.started, "") + } + if r.startedAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "started__after", r.startedAfter, "") + } + if r.startedBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "started__before", r.startedBefore, "") + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "") + } + if r.userN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", r.userN, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreJobsRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreJobsRetrieveRequest) Execute() (*Job, *http.Response, error) { + return r.ApiService.CoreJobsRetrieveExecute(r) +} + +/* +CoreJobsRetrieve Method for CoreJobsRetrieve + +Retrieve a list of job results + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this job. + @return ApiCoreJobsRetrieveRequest +*/ +func (a *CoreAPIService) CoreJobsRetrieve(ctx context.Context, id int32) ApiCoreJobsRetrieveRequest { + return ApiCoreJobsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Job +func (a *CoreAPIService) CoreJobsRetrieveExecute(r ApiCoreJobsRetrieveRequest) (*Job, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Job + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreJobsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/core/jobs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_dcim.go b/vendor/github.com/netbox-community/go-netbox/v3/api_dcim.go new file mode 100644 index 00000000..34bea3bc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_dcim.go @@ -0,0 +1,106699 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// DcimAPIService DcimAPI service +type DcimAPIService service + +type ApiDcimCableTerminationsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableTerminationRequest *[]CableTerminationRequest +} + +func (r ApiDcimCableTerminationsBulkDestroyRequest) CableTerminationRequest(cableTerminationRequest []CableTerminationRequest) ApiDcimCableTerminationsBulkDestroyRequest { + r.cableTerminationRequest = &cableTerminationRequest + return r +} + +func (r ApiDcimCableTerminationsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimCableTerminationsBulkDestroyExecute(r) +} + +/* +DcimCableTerminationsBulkDestroy Method for DcimCableTerminationsBulkDestroy + +Delete a list of cable termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCableTerminationsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsBulkDestroy(ctx context.Context) ApiDcimCableTerminationsBulkDestroyRequest { + return ApiDcimCableTerminationsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimCableTerminationsBulkDestroyExecute(r ApiDcimCableTerminationsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableTerminationRequest == nil { + return nil, reportError("cableTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableTerminationRequest *[]CableTerminationRequest +} + +func (r ApiDcimCableTerminationsBulkPartialUpdateRequest) CableTerminationRequest(cableTerminationRequest []CableTerminationRequest) ApiDcimCableTerminationsBulkPartialUpdateRequest { + r.cableTerminationRequest = &cableTerminationRequest + return r +} + +func (r ApiDcimCableTerminationsBulkPartialUpdateRequest) Execute() ([]CableTermination, *http.Response, error) { + return r.ApiService.DcimCableTerminationsBulkPartialUpdateExecute(r) +} + +/* +DcimCableTerminationsBulkPartialUpdate Method for DcimCableTerminationsBulkPartialUpdate + +Patch a list of cable termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCableTerminationsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsBulkPartialUpdate(ctx context.Context) ApiDcimCableTerminationsBulkPartialUpdateRequest { + return ApiDcimCableTerminationsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CableTermination +func (a *DcimAPIService) DcimCableTerminationsBulkPartialUpdateExecute(r ApiDcimCableTerminationsBulkPartialUpdateRequest) ([]CableTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CableTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableTerminationRequest == nil { + return localVarReturnValue, nil, reportError("cableTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableTerminationRequest *[]CableTerminationRequest +} + +func (r ApiDcimCableTerminationsBulkUpdateRequest) CableTerminationRequest(cableTerminationRequest []CableTerminationRequest) ApiDcimCableTerminationsBulkUpdateRequest { + r.cableTerminationRequest = &cableTerminationRequest + return r +} + +func (r ApiDcimCableTerminationsBulkUpdateRequest) Execute() ([]CableTermination, *http.Response, error) { + return r.ApiService.DcimCableTerminationsBulkUpdateExecute(r) +} + +/* +DcimCableTerminationsBulkUpdate Method for DcimCableTerminationsBulkUpdate + +Put a list of cable termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCableTerminationsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsBulkUpdate(ctx context.Context) ApiDcimCableTerminationsBulkUpdateRequest { + return ApiDcimCableTerminationsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CableTermination +func (a *DcimAPIService) DcimCableTerminationsBulkUpdateExecute(r ApiDcimCableTerminationsBulkUpdateRequest) ([]CableTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CableTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableTerminationRequest == nil { + return localVarReturnValue, nil, reportError("cableTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableTerminationRequest *CableTerminationRequest +} + +func (r ApiDcimCableTerminationsCreateRequest) CableTerminationRequest(cableTerminationRequest CableTerminationRequest) ApiDcimCableTerminationsCreateRequest { + r.cableTerminationRequest = &cableTerminationRequest + return r +} + +func (r ApiDcimCableTerminationsCreateRequest) Execute() (*CableTermination, *http.Response, error) { + return r.ApiService.DcimCableTerminationsCreateExecute(r) +} + +/* +DcimCableTerminationsCreate Method for DcimCableTerminationsCreate + +Post a list of cable termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCableTerminationsCreateRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsCreate(ctx context.Context) ApiDcimCableTerminationsCreateRequest { + return ApiDcimCableTerminationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CableTermination +func (a *DcimAPIService) DcimCableTerminationsCreateExecute(r ApiDcimCableTerminationsCreateRequest) (*CableTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CableTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableTerminationRequest == nil { + return localVarReturnValue, nil, reportError("cableTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimCableTerminationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimCableTerminationsDestroyExecute(r) +} + +/* +DcimCableTerminationsDestroy Method for DcimCableTerminationsDestroy + +Delete a cable termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable termination. + @return ApiDcimCableTerminationsDestroyRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsDestroy(ctx context.Context, id int32) ApiDcimCableTerminationsDestroyRequest { + return ApiDcimCableTerminationsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimCableTerminationsDestroyExecute(r ApiDcimCableTerminationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + cable *int32 + cableN *int32 + cableEnd *string + cableEndN *string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + offset *int32 + ordering *string + terminationId *[]int32 + terminationIdEmpty *bool + terminationIdGt *[]int32 + terminationIdGte *[]int32 + terminationIdLt *[]int32 + terminationIdLte *[]int32 + terminationIdN *[]int32 + terminationType *string + terminationTypeN *string +} + +func (r ApiDcimCableTerminationsListRequest) Cable(cable int32) ApiDcimCableTerminationsListRequest { + r.cable = &cable + return r +} + +func (r ApiDcimCableTerminationsListRequest) CableN(cableN int32) ApiDcimCableTerminationsListRequest { + r.cableN = &cableN + return r +} + +func (r ApiDcimCableTerminationsListRequest) CableEnd(cableEnd string) ApiDcimCableTerminationsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimCableTerminationsListRequest) CableEndN(cableEndN string) ApiDcimCableTerminationsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimCableTerminationsListRequest) Id(id []int32) ApiDcimCableTerminationsListRequest { + r.id = &id + return r +} + +func (r ApiDcimCableTerminationsListRequest) IdEmpty(idEmpty bool) ApiDcimCableTerminationsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimCableTerminationsListRequest) IdGt(idGt []int32) ApiDcimCableTerminationsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimCableTerminationsListRequest) IdGte(idGte []int32) ApiDcimCableTerminationsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimCableTerminationsListRequest) IdLt(idLt []int32) ApiDcimCableTerminationsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimCableTerminationsListRequest) IdLte(idLte []int32) ApiDcimCableTerminationsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimCableTerminationsListRequest) IdN(idN []int32) ApiDcimCableTerminationsListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiDcimCableTerminationsListRequest) Limit(limit int32) ApiDcimCableTerminationsListRequest { + r.limit = &limit + return r +} + +// The initial index from which to return the results. +func (r ApiDcimCableTerminationsListRequest) Offset(offset int32) ApiDcimCableTerminationsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimCableTerminationsListRequest) Ordering(ordering string) ApiDcimCableTerminationsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationId(terminationId []int32) ApiDcimCableTerminationsListRequest { + r.terminationId = &terminationId + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationIdEmpty(terminationIdEmpty bool) ApiDcimCableTerminationsListRequest { + r.terminationIdEmpty = &terminationIdEmpty + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationIdGt(terminationIdGt []int32) ApiDcimCableTerminationsListRequest { + r.terminationIdGt = &terminationIdGt + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationIdGte(terminationIdGte []int32) ApiDcimCableTerminationsListRequest { + r.terminationIdGte = &terminationIdGte + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationIdLt(terminationIdLt []int32) ApiDcimCableTerminationsListRequest { + r.terminationIdLt = &terminationIdLt + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationIdLte(terminationIdLte []int32) ApiDcimCableTerminationsListRequest { + r.terminationIdLte = &terminationIdLte + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationIdN(terminationIdN []int32) ApiDcimCableTerminationsListRequest { + r.terminationIdN = &terminationIdN + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationType(terminationType string) ApiDcimCableTerminationsListRequest { + r.terminationType = &terminationType + return r +} + +func (r ApiDcimCableTerminationsListRequest) TerminationTypeN(terminationTypeN string) ApiDcimCableTerminationsListRequest { + r.terminationTypeN = &terminationTypeN + return r +} + +func (r ApiDcimCableTerminationsListRequest) Execute() (*PaginatedCableTerminationList, *http.Response, error) { + return r.ApiService.DcimCableTerminationsListExecute(r) +} + +/* +DcimCableTerminationsList Method for DcimCableTerminationsList + +Get a list of cable termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCableTerminationsListRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsList(ctx context.Context) ApiDcimCableTerminationsListRequest { + return ApiDcimCableTerminationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCableTerminationList +func (a *DcimAPIService) DcimCableTerminationsListExecute(r ApiDcimCableTerminationsListRequest) (*PaginatedCableTerminationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCableTerminationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable", r.cable, "") + } + if r.cableN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable__n", r.cableN, "") + } + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.terminationId != nil { + t := *r.terminationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id", t, "multi") + } + } + if r.terminationIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__empty", r.terminationIdEmpty, "") + } + if r.terminationIdGt != nil { + t := *r.terminationIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__gt", t, "multi") + } + } + if r.terminationIdGte != nil { + t := *r.terminationIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__gte", t, "multi") + } + } + if r.terminationIdLt != nil { + t := *r.terminationIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__lt", t, "multi") + } + } + if r.terminationIdLte != nil { + t := *r.terminationIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__lte", t, "multi") + } + } + if r.terminationIdN != nil { + t := *r.terminationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_id__n", t, "multi") + } + } + if r.terminationType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_type", r.terminationType, "") + } + if r.terminationTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_type__n", r.terminationTypeN, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedCableTerminationRequest *PatchedCableTerminationRequest +} + +func (r ApiDcimCableTerminationsPartialUpdateRequest) PatchedCableTerminationRequest(patchedCableTerminationRequest PatchedCableTerminationRequest) ApiDcimCableTerminationsPartialUpdateRequest { + r.patchedCableTerminationRequest = &patchedCableTerminationRequest + return r +} + +func (r ApiDcimCableTerminationsPartialUpdateRequest) Execute() (*CableTermination, *http.Response, error) { + return r.ApiService.DcimCableTerminationsPartialUpdateExecute(r) +} + +/* +DcimCableTerminationsPartialUpdate Method for DcimCableTerminationsPartialUpdate + +Patch a cable termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable termination. + @return ApiDcimCableTerminationsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsPartialUpdate(ctx context.Context, id int32) ApiDcimCableTerminationsPartialUpdateRequest { + return ApiDcimCableTerminationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CableTermination +func (a *DcimAPIService) DcimCableTerminationsPartialUpdateExecute(r ApiDcimCableTerminationsPartialUpdateRequest) (*CableTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CableTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedCableTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimCableTerminationsRetrieveRequest) Execute() (*CableTermination, *http.Response, error) { + return r.ApiService.DcimCableTerminationsRetrieveExecute(r) +} + +/* +DcimCableTerminationsRetrieve Method for DcimCableTerminationsRetrieve + +Get a cable termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable termination. + @return ApiDcimCableTerminationsRetrieveRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsRetrieve(ctx context.Context, id int32) ApiDcimCableTerminationsRetrieveRequest { + return ApiDcimCableTerminationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CableTermination +func (a *DcimAPIService) DcimCableTerminationsRetrieveExecute(r ApiDcimCableTerminationsRetrieveRequest) (*CableTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CableTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCableTerminationsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + cableTerminationRequest *CableTerminationRequest +} + +func (r ApiDcimCableTerminationsUpdateRequest) CableTerminationRequest(cableTerminationRequest CableTerminationRequest) ApiDcimCableTerminationsUpdateRequest { + r.cableTerminationRequest = &cableTerminationRequest + return r +} + +func (r ApiDcimCableTerminationsUpdateRequest) Execute() (*CableTermination, *http.Response, error) { + return r.ApiService.DcimCableTerminationsUpdateExecute(r) +} + +/* +DcimCableTerminationsUpdate Method for DcimCableTerminationsUpdate + +Put a cable termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable termination. + @return ApiDcimCableTerminationsUpdateRequest +*/ +func (a *DcimAPIService) DcimCableTerminationsUpdate(ctx context.Context, id int32) ApiDcimCableTerminationsUpdateRequest { + return ApiDcimCableTerminationsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CableTermination +func (a *DcimAPIService) DcimCableTerminationsUpdateExecute(r ApiDcimCableTerminationsUpdateRequest) (*CableTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CableTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCableTerminationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cable-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableTerminationRequest == nil { + return localVarReturnValue, nil, reportError("cableTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCablesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableRequest *[]CableRequest +} + +func (r ApiDcimCablesBulkDestroyRequest) CableRequest(cableRequest []CableRequest) ApiDcimCablesBulkDestroyRequest { + r.cableRequest = &cableRequest + return r +} + +func (r ApiDcimCablesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimCablesBulkDestroyExecute(r) +} + +/* +DcimCablesBulkDestroy Method for DcimCablesBulkDestroy + +Delete a list of cable objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCablesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimCablesBulkDestroy(ctx context.Context) ApiDcimCablesBulkDestroyRequest { + return ApiDcimCablesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimCablesBulkDestroyExecute(r ApiDcimCablesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableRequest == nil { + return nil, reportError("cableRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimCablesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableRequest *[]CableRequest +} + +func (r ApiDcimCablesBulkPartialUpdateRequest) CableRequest(cableRequest []CableRequest) ApiDcimCablesBulkPartialUpdateRequest { + r.cableRequest = &cableRequest + return r +} + +func (r ApiDcimCablesBulkPartialUpdateRequest) Execute() ([]Cable, *http.Response, error) { + return r.ApiService.DcimCablesBulkPartialUpdateExecute(r) +} + +/* +DcimCablesBulkPartialUpdate Method for DcimCablesBulkPartialUpdate + +Patch a list of cable objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCablesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimCablesBulkPartialUpdate(ctx context.Context) ApiDcimCablesBulkPartialUpdateRequest { + return ApiDcimCablesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Cable +func (a *DcimAPIService) DcimCablesBulkPartialUpdateExecute(r ApiDcimCablesBulkPartialUpdateRequest) ([]Cable, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Cable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableRequest == nil { + return localVarReturnValue, nil, reportError("cableRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCablesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableRequest *[]CableRequest +} + +func (r ApiDcimCablesBulkUpdateRequest) CableRequest(cableRequest []CableRequest) ApiDcimCablesBulkUpdateRequest { + r.cableRequest = &cableRequest + return r +} + +func (r ApiDcimCablesBulkUpdateRequest) Execute() ([]Cable, *http.Response, error) { + return r.ApiService.DcimCablesBulkUpdateExecute(r) +} + +/* +DcimCablesBulkUpdate Method for DcimCablesBulkUpdate + +Put a list of cable objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCablesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimCablesBulkUpdate(ctx context.Context) ApiDcimCablesBulkUpdateRequest { + return ApiDcimCablesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Cable +func (a *DcimAPIService) DcimCablesBulkUpdateExecute(r ApiDcimCablesBulkUpdateRequest) ([]Cable, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Cable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cableRequest == nil { + return localVarReturnValue, nil, reportError("cableRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cableRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCablesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableCableRequest *WritableCableRequest +} + +func (r ApiDcimCablesCreateRequest) WritableCableRequest(writableCableRequest WritableCableRequest) ApiDcimCablesCreateRequest { + r.writableCableRequest = &writableCableRequest + return r +} + +func (r ApiDcimCablesCreateRequest) Execute() (*Cable, *http.Response, error) { + return r.ApiService.DcimCablesCreateExecute(r) +} + +/* +DcimCablesCreate Method for DcimCablesCreate + +Post a list of cable objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCablesCreateRequest +*/ +func (a *DcimAPIService) DcimCablesCreate(ctx context.Context) ApiDcimCablesCreateRequest { + return ApiDcimCablesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Cable +func (a *DcimAPIService) DcimCablesCreateExecute(r ApiDcimCablesCreateRequest) (*Cable, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCableRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCablesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimCablesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimCablesDestroyExecute(r) +} + +/* +DcimCablesDestroy Method for DcimCablesDestroy + +Delete a cable object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable. + @return ApiDcimCablesDestroyRequest +*/ +func (a *DcimAPIService) DcimCablesDestroy(ctx context.Context, id int32) ApiDcimCablesDestroyRequest { + return ApiDcimCablesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimCablesDestroyExecute(r ApiDcimCablesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimCablesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + circuitterminationId *[]int32 + color *[]string + colorN *[]string + consoleportId *[]int32 + consoleserverportId *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]string + deviceId *[]int32 + frontportId *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interfaceId *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + length *[]float64 + lengthEmpty *bool + lengthGt *[]float64 + lengthGte *[]float64 + lengthLt *[]float64 + lengthLte *[]float64 + lengthN *[]float64 + lengthUnit *string + lengthUnitN *string + limit *int32 + location *[]string + locationId *[]int32 + modifiedByRequest *string + offset *int32 + ordering *string + powerfeedId *[]int32 + poweroutletId *[]int32 + powerportId *[]int32 + q *string + rack *[]string + rackId *[]int32 + rearportId *[]int32 + site *[]string + siteId *[]int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + terminationAId *[]int32 + terminationAType *string + terminationATypeN *string + terminationBId *[]int32 + terminationBType *string + terminationBTypeN *string + type_ *[]string + typeN *[]string + unterminated *bool + updatedByRequest *string +} + +func (r ApiDcimCablesListRequest) CircuitterminationId(circuitterminationId []int32) ApiDcimCablesListRequest { + r.circuitterminationId = &circuitterminationId + return r +} + +func (r ApiDcimCablesListRequest) Color(color []string) ApiDcimCablesListRequest { + r.color = &color + return r +} + +func (r ApiDcimCablesListRequest) ColorN(colorN []string) ApiDcimCablesListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimCablesListRequest) ConsoleportId(consoleportId []int32) ApiDcimCablesListRequest { + r.consoleportId = &consoleportId + return r +} + +func (r ApiDcimCablesListRequest) ConsoleserverportId(consoleserverportId []int32) ApiDcimCablesListRequest { + r.consoleserverportId = &consoleserverportId + return r +} + +func (r ApiDcimCablesListRequest) Created(created []time.Time) ApiDcimCablesListRequest { + r.created = &created + return r +} + +func (r ApiDcimCablesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimCablesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimCablesListRequest) CreatedGt(createdGt []time.Time) ApiDcimCablesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimCablesListRequest) CreatedGte(createdGte []time.Time) ApiDcimCablesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimCablesListRequest) CreatedLt(createdLt []time.Time) ApiDcimCablesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimCablesListRequest) CreatedLte(createdLte []time.Time) ApiDcimCablesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimCablesListRequest) CreatedN(createdN []time.Time) ApiDcimCablesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimCablesListRequest) CreatedByRequest(createdByRequest string) ApiDcimCablesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimCablesListRequest) Description(description []string) ApiDcimCablesListRequest { + r.description = &description + return r +} + +func (r ApiDcimCablesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimCablesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimCablesListRequest) DescriptionIc(descriptionIc []string) ApiDcimCablesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimCablesListRequest) DescriptionIe(descriptionIe []string) ApiDcimCablesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimCablesListRequest) DescriptionIew(descriptionIew []string) ApiDcimCablesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimCablesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimCablesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimCablesListRequest) DescriptionN(descriptionN []string) ApiDcimCablesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimCablesListRequest) DescriptionNic(descriptionNic []string) ApiDcimCablesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimCablesListRequest) DescriptionNie(descriptionNie []string) ApiDcimCablesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimCablesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimCablesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimCablesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimCablesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimCablesListRequest) Device(device []string) ApiDcimCablesListRequest { + r.device = &device + return r +} + +func (r ApiDcimCablesListRequest) DeviceId(deviceId []int32) ApiDcimCablesListRequest { + r.deviceId = &deviceId + return r +} + +func (r ApiDcimCablesListRequest) FrontportId(frontportId []int32) ApiDcimCablesListRequest { + r.frontportId = &frontportId + return r +} + +func (r ApiDcimCablesListRequest) Id(id []int32) ApiDcimCablesListRequest { + r.id = &id + return r +} + +func (r ApiDcimCablesListRequest) IdEmpty(idEmpty bool) ApiDcimCablesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimCablesListRequest) IdGt(idGt []int32) ApiDcimCablesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimCablesListRequest) IdGte(idGte []int32) ApiDcimCablesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimCablesListRequest) IdLt(idLt []int32) ApiDcimCablesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimCablesListRequest) IdLte(idLte []int32) ApiDcimCablesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimCablesListRequest) IdN(idN []int32) ApiDcimCablesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimCablesListRequest) InterfaceId(interfaceId []int32) ApiDcimCablesListRequest { + r.interfaceId = &interfaceId + return r +} + +func (r ApiDcimCablesListRequest) Label(label []string) ApiDcimCablesListRequest { + r.label = &label + return r +} + +func (r ApiDcimCablesListRequest) LabelEmpty(labelEmpty bool) ApiDcimCablesListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimCablesListRequest) LabelIc(labelIc []string) ApiDcimCablesListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimCablesListRequest) LabelIe(labelIe []string) ApiDcimCablesListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimCablesListRequest) LabelIew(labelIew []string) ApiDcimCablesListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimCablesListRequest) LabelIsw(labelIsw []string) ApiDcimCablesListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimCablesListRequest) LabelN(labelN []string) ApiDcimCablesListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimCablesListRequest) LabelNic(labelNic []string) ApiDcimCablesListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimCablesListRequest) LabelNie(labelNie []string) ApiDcimCablesListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimCablesListRequest) LabelNiew(labelNiew []string) ApiDcimCablesListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimCablesListRequest) LabelNisw(labelNisw []string) ApiDcimCablesListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimCablesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimCablesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimCablesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimCablesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimCablesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimCablesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimCablesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimCablesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimCablesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimCablesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimCablesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimCablesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimCablesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimCablesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +func (r ApiDcimCablesListRequest) Length(length []float64) ApiDcimCablesListRequest { + r.length = &length + return r +} + +func (r ApiDcimCablesListRequest) LengthEmpty(lengthEmpty bool) ApiDcimCablesListRequest { + r.lengthEmpty = &lengthEmpty + return r +} + +func (r ApiDcimCablesListRequest) LengthGt(lengthGt []float64) ApiDcimCablesListRequest { + r.lengthGt = &lengthGt + return r +} + +func (r ApiDcimCablesListRequest) LengthGte(lengthGte []float64) ApiDcimCablesListRequest { + r.lengthGte = &lengthGte + return r +} + +func (r ApiDcimCablesListRequest) LengthLt(lengthLt []float64) ApiDcimCablesListRequest { + r.lengthLt = &lengthLt + return r +} + +func (r ApiDcimCablesListRequest) LengthLte(lengthLte []float64) ApiDcimCablesListRequest { + r.lengthLte = &lengthLte + return r +} + +func (r ApiDcimCablesListRequest) LengthN(lengthN []float64) ApiDcimCablesListRequest { + r.lengthN = &lengthN + return r +} + +func (r ApiDcimCablesListRequest) LengthUnit(lengthUnit string) ApiDcimCablesListRequest { + r.lengthUnit = &lengthUnit + return r +} + +func (r ApiDcimCablesListRequest) LengthUnitN(lengthUnitN string) ApiDcimCablesListRequest { + r.lengthUnitN = &lengthUnitN + return r +} + +// Number of results to return per page. +func (r ApiDcimCablesListRequest) Limit(limit int32) ApiDcimCablesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimCablesListRequest) Location(location []string) ApiDcimCablesListRequest { + r.location = &location + return r +} + +func (r ApiDcimCablesListRequest) LocationId(locationId []int32) ApiDcimCablesListRequest { + r.locationId = &locationId + return r +} + +func (r ApiDcimCablesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimCablesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiDcimCablesListRequest) Offset(offset int32) ApiDcimCablesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimCablesListRequest) Ordering(ordering string) ApiDcimCablesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimCablesListRequest) PowerfeedId(powerfeedId []int32) ApiDcimCablesListRequest { + r.powerfeedId = &powerfeedId + return r +} + +func (r ApiDcimCablesListRequest) PoweroutletId(poweroutletId []int32) ApiDcimCablesListRequest { + r.poweroutletId = &poweroutletId + return r +} + +func (r ApiDcimCablesListRequest) PowerportId(powerportId []int32) ApiDcimCablesListRequest { + r.powerportId = &powerportId + return r +} + +// Search +func (r ApiDcimCablesListRequest) Q(q string) ApiDcimCablesListRequest { + r.q = &q + return r +} + +func (r ApiDcimCablesListRequest) Rack(rack []string) ApiDcimCablesListRequest { + r.rack = &rack + return r +} + +func (r ApiDcimCablesListRequest) RackId(rackId []int32) ApiDcimCablesListRequest { + r.rackId = &rackId + return r +} + +func (r ApiDcimCablesListRequest) RearportId(rearportId []int32) ApiDcimCablesListRequest { + r.rearportId = &rearportId + return r +} + +func (r ApiDcimCablesListRequest) Site(site []string) ApiDcimCablesListRequest { + r.site = &site + return r +} + +func (r ApiDcimCablesListRequest) SiteId(siteId []int32) ApiDcimCablesListRequest { + r.siteId = &siteId + return r +} + +func (r ApiDcimCablesListRequest) Status(status []string) ApiDcimCablesListRequest { + r.status = &status + return r +} + +func (r ApiDcimCablesListRequest) StatusN(statusN []string) ApiDcimCablesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimCablesListRequest) Tag(tag []string) ApiDcimCablesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimCablesListRequest) TagN(tagN []string) ApiDcimCablesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimCablesListRequest) Tenant(tenant []string) ApiDcimCablesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimCablesListRequest) TenantN(tenantN []string) ApiDcimCablesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimCablesListRequest) TenantGroup(tenantGroup []int32) ApiDcimCablesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimCablesListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimCablesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimCablesListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimCablesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimCablesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimCablesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimCablesListRequest) TenantId(tenantId []*int32) ApiDcimCablesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimCablesListRequest) TenantIdN(tenantIdN []*int32) ApiDcimCablesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimCablesListRequest) TerminationAId(terminationAId []int32) ApiDcimCablesListRequest { + r.terminationAId = &terminationAId + return r +} + +func (r ApiDcimCablesListRequest) TerminationAType(terminationAType string) ApiDcimCablesListRequest { + r.terminationAType = &terminationAType + return r +} + +func (r ApiDcimCablesListRequest) TerminationATypeN(terminationATypeN string) ApiDcimCablesListRequest { + r.terminationATypeN = &terminationATypeN + return r +} + +func (r ApiDcimCablesListRequest) TerminationBId(terminationBId []int32) ApiDcimCablesListRequest { + r.terminationBId = &terminationBId + return r +} + +func (r ApiDcimCablesListRequest) TerminationBType(terminationBType string) ApiDcimCablesListRequest { + r.terminationBType = &terminationBType + return r +} + +func (r ApiDcimCablesListRequest) TerminationBTypeN(terminationBTypeN string) ApiDcimCablesListRequest { + r.terminationBTypeN = &terminationBTypeN + return r +} + +func (r ApiDcimCablesListRequest) Type_(type_ []string) ApiDcimCablesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimCablesListRequest) TypeN(typeN []string) ApiDcimCablesListRequest { + r.typeN = &typeN + return r +} + +// Unterminated +func (r ApiDcimCablesListRequest) Unterminated(unterminated bool) ApiDcimCablesListRequest { + r.unterminated = &unterminated + return r +} + +func (r ApiDcimCablesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimCablesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimCablesListRequest) Execute() (*PaginatedCableList, *http.Response, error) { + return r.ApiService.DcimCablesListExecute(r) +} + +/* +DcimCablesList Method for DcimCablesList + +Get a list of cable objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimCablesListRequest +*/ +func (a *DcimAPIService) DcimCablesList(ctx context.Context) ApiDcimCablesListRequest { + return ApiDcimCablesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCableList +func (a *DcimAPIService) DcimCablesListExecute(r ApiDcimCablesListRequest) (*PaginatedCableList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCableList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.circuitterminationId != nil { + t := *r.circuitterminationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "circuittermination_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "circuittermination_id", t, "multi") + } + } + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.consoleportId != nil { + t := *r.consoleportId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "consoleport_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "consoleport_id", t, "multi") + } + } + if r.consoleserverportId != nil { + t := *r.consoleserverportId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "consoleserverport_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "consoleserverport_id", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.frontportId != nil { + t := *r.frontportId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "frontport_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "frontport_id", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interfaceId != nil { + t := *r.interfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.length != nil { + t := *r.length + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "length", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "length", t, "multi") + } + } + if r.lengthEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__empty", r.lengthEmpty, "") + } + if r.lengthGt != nil { + t := *r.lengthGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__gt", t, "multi") + } + } + if r.lengthGte != nil { + t := *r.lengthGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__gte", t, "multi") + } + } + if r.lengthLt != nil { + t := *r.lengthLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__lt", t, "multi") + } + } + if r.lengthLte != nil { + t := *r.lengthLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__lte", t, "multi") + } + } + if r.lengthN != nil { + t := *r.lengthN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "length__n", t, "multi") + } + } + if r.lengthUnit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length_unit", r.lengthUnit, "") + } + if r.lengthUnitN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length_unit__n", r.lengthUnitN, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.powerfeedId != nil { + t := *r.powerfeedId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "powerfeed_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "powerfeed_id", t, "multi") + } + } + if r.poweroutletId != nil { + t := *r.poweroutletId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poweroutlet_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poweroutlet_id", t, "multi") + } + } + if r.powerportId != nil { + t := *r.powerportId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "powerport_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "powerport_id", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rearportId != nil { + t := *r.rearportId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rearport_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rearport_id", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.terminationAId != nil { + t := *r.terminationAId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_a_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_a_id", t, "multi") + } + } + if r.terminationAType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_a_type", r.terminationAType, "") + } + if r.terminationATypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_a_type__n", r.terminationATypeN, "") + } + if r.terminationBId != nil { + t := *r.terminationBId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_b_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_b_id", t, "multi") + } + } + if r.terminationBType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_b_type", r.terminationBType, "") + } + if r.terminationBTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_b_type__n", r.terminationBTypeN, "") + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.unterminated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unterminated", r.unterminated, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCablesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableCableRequest *PatchedWritableCableRequest +} + +func (r ApiDcimCablesPartialUpdateRequest) PatchedWritableCableRequest(patchedWritableCableRequest PatchedWritableCableRequest) ApiDcimCablesPartialUpdateRequest { + r.patchedWritableCableRequest = &patchedWritableCableRequest + return r +} + +func (r ApiDcimCablesPartialUpdateRequest) Execute() (*Cable, *http.Response, error) { + return r.ApiService.DcimCablesPartialUpdateExecute(r) +} + +/* +DcimCablesPartialUpdate Method for DcimCablesPartialUpdate + +Patch a cable object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable. + @return ApiDcimCablesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimCablesPartialUpdate(ctx context.Context, id int32) ApiDcimCablesPartialUpdateRequest { + return ApiDcimCablesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Cable +func (a *DcimAPIService) DcimCablesPartialUpdateExecute(r ApiDcimCablesPartialUpdateRequest) (*Cable, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableCableRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCablesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimCablesRetrieveRequest) Execute() (*Cable, *http.Response, error) { + return r.ApiService.DcimCablesRetrieveExecute(r) +} + +/* +DcimCablesRetrieve Method for DcimCablesRetrieve + +Get a cable object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable. + @return ApiDcimCablesRetrieveRequest +*/ +func (a *DcimAPIService) DcimCablesRetrieve(ctx context.Context, id int32) ApiDcimCablesRetrieveRequest { + return ApiDcimCablesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Cable +func (a *DcimAPIService) DcimCablesRetrieveExecute(r ApiDcimCablesRetrieveRequest) (*Cable, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimCablesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableCableRequest *WritableCableRequest +} + +func (r ApiDcimCablesUpdateRequest) WritableCableRequest(writableCableRequest WritableCableRequest) ApiDcimCablesUpdateRequest { + r.writableCableRequest = &writableCableRequest + return r +} + +func (r ApiDcimCablesUpdateRequest) Execute() (*Cable, *http.Response, error) { + return r.ApiService.DcimCablesUpdateExecute(r) +} + +/* +DcimCablesUpdate Method for DcimCablesUpdate + +Put a cable object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cable. + @return ApiDcimCablesUpdateRequest +*/ +func (a *DcimAPIService) DcimCablesUpdate(ctx context.Context, id int32) ApiDcimCablesUpdateRequest { + return ApiDcimCablesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Cable +func (a *DcimAPIService) DcimCablesUpdateExecute(r ApiDcimCablesUpdateRequest) (*Cable, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimCablesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/cables/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCableRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConnectedDeviceListRequest struct { + ctx context.Context + ApiService *DcimAPIService + peerDevice *string + peerInterface *string +} + +// The name of the peer device +func (r ApiDcimConnectedDeviceListRequest) PeerDevice(peerDevice string) ApiDcimConnectedDeviceListRequest { + r.peerDevice = &peerDevice + return r +} + +// The name of the peer interface +func (r ApiDcimConnectedDeviceListRequest) PeerInterface(peerInterface string) ApiDcimConnectedDeviceListRequest { + r.peerInterface = &peerInterface + return r +} + +func (r ApiDcimConnectedDeviceListRequest) Execute() ([]Device, *http.Response, error) { + return r.ApiService.DcimConnectedDeviceListExecute(r) +} + +/* +DcimConnectedDeviceList Method for DcimConnectedDeviceList + +This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer +interface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors +via a protocol such as LLDP. Two query parameters must be included in the request: + +* `peer_device`: The name of the peer device +* `peer_interface`: The name of the peer interface + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConnectedDeviceListRequest +*/ +func (a *DcimAPIService) DcimConnectedDeviceList(ctx context.Context) ApiDcimConnectedDeviceListRequest { + return ApiDcimConnectedDeviceListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Device +func (a *DcimAPIService) DcimConnectedDeviceListExecute(r ApiDcimConnectedDeviceListRequest) ([]Device, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Device + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConnectedDeviceList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/connected-device/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.peerDevice == nil { + return localVarReturnValue, nil, reportError("peerDevice is required and must be specified") + } + if r.peerInterface == nil { + return localVarReturnValue, nil, reportError("peerInterface is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "peer_device", r.peerDevice, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "peer_interface", r.peerInterface, "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + consolePortTemplateRequest *[]ConsolePortTemplateRequest +} + +func (r ApiDcimConsolePortTemplatesBulkDestroyRequest) ConsolePortTemplateRequest(consolePortTemplateRequest []ConsolePortTemplateRequest) ApiDcimConsolePortTemplatesBulkDestroyRequest { + r.consolePortTemplateRequest = &consolePortTemplateRequest + return r +} + +func (r ApiDcimConsolePortTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesBulkDestroyExecute(r) +} + +/* +DcimConsolePortTemplatesBulkDestroy Method for DcimConsolePortTemplatesBulkDestroy + +Delete a list of console port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesBulkDestroy(ctx context.Context) ApiDcimConsolePortTemplatesBulkDestroyRequest { + return ApiDcimConsolePortTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsolePortTemplatesBulkDestroyExecute(r ApiDcimConsolePortTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consolePortTemplateRequest == nil { + return nil, reportError("consolePortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consolePortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consolePortTemplateRequest *[]ConsolePortTemplateRequest +} + +func (r ApiDcimConsolePortTemplatesBulkPartialUpdateRequest) ConsolePortTemplateRequest(consolePortTemplateRequest []ConsolePortTemplateRequest) ApiDcimConsolePortTemplatesBulkPartialUpdateRequest { + r.consolePortTemplateRequest = &consolePortTemplateRequest + return r +} + +func (r ApiDcimConsolePortTemplatesBulkPartialUpdateRequest) Execute() ([]ConsolePortTemplate, *http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimConsolePortTemplatesBulkPartialUpdate Method for DcimConsolePortTemplatesBulkPartialUpdate + +Patch a list of console port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimConsolePortTemplatesBulkPartialUpdateRequest { + return ApiDcimConsolePortTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsolePortTemplate +func (a *DcimAPIService) DcimConsolePortTemplatesBulkPartialUpdateExecute(r ApiDcimConsolePortTemplatesBulkPartialUpdateRequest) ([]ConsolePortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsolePortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consolePortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("consolePortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consolePortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consolePortTemplateRequest *[]ConsolePortTemplateRequest +} + +func (r ApiDcimConsolePortTemplatesBulkUpdateRequest) ConsolePortTemplateRequest(consolePortTemplateRequest []ConsolePortTemplateRequest) ApiDcimConsolePortTemplatesBulkUpdateRequest { + r.consolePortTemplateRequest = &consolePortTemplateRequest + return r +} + +func (r ApiDcimConsolePortTemplatesBulkUpdateRequest) Execute() ([]ConsolePortTemplate, *http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesBulkUpdateExecute(r) +} + +/* +DcimConsolePortTemplatesBulkUpdate Method for DcimConsolePortTemplatesBulkUpdate + +Put a list of console port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesBulkUpdate(ctx context.Context) ApiDcimConsolePortTemplatesBulkUpdateRequest { + return ApiDcimConsolePortTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsolePortTemplate +func (a *DcimAPIService) DcimConsolePortTemplatesBulkUpdateExecute(r ApiDcimConsolePortTemplatesBulkUpdateRequest) ([]ConsolePortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsolePortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consolePortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("consolePortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consolePortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableConsolePortTemplateRequest *WritableConsolePortTemplateRequest +} + +func (r ApiDcimConsolePortTemplatesCreateRequest) WritableConsolePortTemplateRequest(writableConsolePortTemplateRequest WritableConsolePortTemplateRequest) ApiDcimConsolePortTemplatesCreateRequest { + r.writableConsolePortTemplateRequest = &writableConsolePortTemplateRequest + return r +} + +func (r ApiDcimConsolePortTemplatesCreateRequest) Execute() (*ConsolePortTemplate, *http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesCreateExecute(r) +} + +/* +DcimConsolePortTemplatesCreate Method for DcimConsolePortTemplatesCreate + +Post a list of console port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesCreate(ctx context.Context) ApiDcimConsolePortTemplatesCreateRequest { + return ApiDcimConsolePortTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ConsolePortTemplate +func (a *DcimAPIService) DcimConsolePortTemplatesCreateExecute(r ApiDcimConsolePortTemplatesCreateRequest) (*ConsolePortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsolePortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConsolePortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsolePortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsolePortTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesDestroyExecute(r) +} + +/* +DcimConsolePortTemplatesDestroy Method for DcimConsolePortTemplatesDestroy + +Delete a console port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port template. + @return ApiDcimConsolePortTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesDestroy(ctx context.Context, id int32) ApiDcimConsolePortTemplatesDestroyRequest { + return ApiDcimConsolePortTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsolePortTemplatesDestroyExecute(r ApiDcimConsolePortTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]*int32 + devicetypeIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + moduletypeId *[]*int32 + moduletypeIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + type_ *string + typeN *string + updatedByRequest *string +} + +func (r ApiDcimConsolePortTemplatesListRequest) Created(created []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimConsolePortTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) Description(description []string) ApiDcimConsolePortTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimConsolePortTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimConsolePortTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimConsolePortTemplatesListRequest) DevicetypeId(devicetypeId []*int32) ApiDcimConsolePortTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimConsolePortTemplatesListRequest) DevicetypeIdN(devicetypeIdN []*int32) ApiDcimConsolePortTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) Id(id []int32) ApiDcimConsolePortTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimConsolePortTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) IdGt(idGt []int32) ApiDcimConsolePortTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) IdGte(idGte []int32) ApiDcimConsolePortTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) IdLt(idLt []int32) ApiDcimConsolePortTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) IdLte(idLte []int32) ApiDcimConsolePortTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) IdN(idN []int32) ApiDcimConsolePortTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimConsolePortTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimConsolePortTemplatesListRequest) Limit(limit int32) ApiDcimConsolePortTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimConsolePortTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module type (ID) +func (r ApiDcimConsolePortTemplatesListRequest) ModuletypeId(moduletypeId []*int32) ApiDcimConsolePortTemplatesListRequest { + r.moduletypeId = &moduletypeId + return r +} + +// Module type (ID) +func (r ApiDcimConsolePortTemplatesListRequest) ModuletypeIdN(moduletypeIdN []*int32) ApiDcimConsolePortTemplatesListRequest { + r.moduletypeIdN = &moduletypeIdN + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) Name(name []string) ApiDcimConsolePortTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimConsolePortTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameIc(nameIc []string) ApiDcimConsolePortTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameIe(nameIe []string) ApiDcimConsolePortTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameIew(nameIew []string) ApiDcimConsolePortTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimConsolePortTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameN(nameN []string) ApiDcimConsolePortTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameNic(nameNic []string) ApiDcimConsolePortTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameNie(nameNie []string) ApiDcimConsolePortTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimConsolePortTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimConsolePortTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimConsolePortTemplatesListRequest) Offset(offset int32) ApiDcimConsolePortTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimConsolePortTemplatesListRequest) Ordering(ordering string) ApiDcimConsolePortTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimConsolePortTemplatesListRequest) Q(q string) ApiDcimConsolePortTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) Type_(type_ string) ApiDcimConsolePortTemplatesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) TypeN(typeN string) ApiDcimConsolePortTemplatesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimConsolePortTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimConsolePortTemplatesListRequest) Execute() (*PaginatedConsolePortTemplateList, *http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesListExecute(r) +} + +/* +DcimConsolePortTemplatesList Method for DcimConsolePortTemplatesList + +Get a list of console port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortTemplatesListRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesList(ctx context.Context) ApiDcimConsolePortTemplatesListRequest { + return ApiDcimConsolePortTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConsolePortTemplateList +func (a *DcimAPIService) DcimConsolePortTemplatesListExecute(r ApiDcimConsolePortTemplatesListRequest) (*PaginatedConsolePortTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConsolePortTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduletypeId != nil { + t := *r.moduletypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", t, "multi") + } + } + if r.moduletypeIdN != nil { + t := *r.moduletypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.typeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", r.typeN, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableConsolePortTemplateRequest *PatchedWritableConsolePortTemplateRequest +} + +func (r ApiDcimConsolePortTemplatesPartialUpdateRequest) PatchedWritableConsolePortTemplateRequest(patchedWritableConsolePortTemplateRequest PatchedWritableConsolePortTemplateRequest) ApiDcimConsolePortTemplatesPartialUpdateRequest { + r.patchedWritableConsolePortTemplateRequest = &patchedWritableConsolePortTemplateRequest + return r +} + +func (r ApiDcimConsolePortTemplatesPartialUpdateRequest) Execute() (*ConsolePortTemplate, *http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesPartialUpdateExecute(r) +} + +/* +DcimConsolePortTemplatesPartialUpdate Method for DcimConsolePortTemplatesPartialUpdate + +Patch a console port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port template. + @return ApiDcimConsolePortTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimConsolePortTemplatesPartialUpdateRequest { + return ApiDcimConsolePortTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsolePortTemplate +func (a *DcimAPIService) DcimConsolePortTemplatesPartialUpdateExecute(r ApiDcimConsolePortTemplatesPartialUpdateRequest) (*ConsolePortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableConsolePortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsolePortTemplatesRetrieveRequest) Execute() (*ConsolePortTemplate, *http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesRetrieveExecute(r) +} + +/* +DcimConsolePortTemplatesRetrieve Method for DcimConsolePortTemplatesRetrieve + +Get a console port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port template. + @return ApiDcimConsolePortTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesRetrieve(ctx context.Context, id int32) ApiDcimConsolePortTemplatesRetrieveRequest { + return ApiDcimConsolePortTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsolePortTemplate +func (a *DcimAPIService) DcimConsolePortTemplatesRetrieveExecute(r ApiDcimConsolePortTemplatesRetrieveRequest) (*ConsolePortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableConsolePortTemplateRequest *WritableConsolePortTemplateRequest +} + +func (r ApiDcimConsolePortTemplatesUpdateRequest) WritableConsolePortTemplateRequest(writableConsolePortTemplateRequest WritableConsolePortTemplateRequest) ApiDcimConsolePortTemplatesUpdateRequest { + r.writableConsolePortTemplateRequest = &writableConsolePortTemplateRequest + return r +} + +func (r ApiDcimConsolePortTemplatesUpdateRequest) Execute() (*ConsolePortTemplate, *http.Response, error) { + return r.ApiService.DcimConsolePortTemplatesUpdateExecute(r) +} + +/* +DcimConsolePortTemplatesUpdate Method for DcimConsolePortTemplatesUpdate + +Put a console port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port template. + @return ApiDcimConsolePortTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortTemplatesUpdate(ctx context.Context, id int32) ApiDcimConsolePortTemplatesUpdateRequest { + return ApiDcimConsolePortTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsolePortTemplate +func (a *DcimAPIService) DcimConsolePortTemplatesUpdateExecute(r ApiDcimConsolePortTemplatesUpdateRequest) (*ConsolePortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsolePortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConsolePortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsolePortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + consolePortRequest *[]ConsolePortRequest +} + +func (r ApiDcimConsolePortsBulkDestroyRequest) ConsolePortRequest(consolePortRequest []ConsolePortRequest) ApiDcimConsolePortsBulkDestroyRequest { + r.consolePortRequest = &consolePortRequest + return r +} + +func (r ApiDcimConsolePortsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsolePortsBulkDestroyExecute(r) +} + +/* +DcimConsolePortsBulkDestroy Method for DcimConsolePortsBulkDestroy + +Delete a list of console port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimConsolePortsBulkDestroy(ctx context.Context) ApiDcimConsolePortsBulkDestroyRequest { + return ApiDcimConsolePortsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsolePortsBulkDestroyExecute(r ApiDcimConsolePortsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consolePortRequest == nil { + return nil, reportError("consolePortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consolePortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consolePortRequest *[]ConsolePortRequest +} + +func (r ApiDcimConsolePortsBulkPartialUpdateRequest) ConsolePortRequest(consolePortRequest []ConsolePortRequest) ApiDcimConsolePortsBulkPartialUpdateRequest { + r.consolePortRequest = &consolePortRequest + return r +} + +func (r ApiDcimConsolePortsBulkPartialUpdateRequest) Execute() ([]ConsolePort, *http.Response, error) { + return r.ApiService.DcimConsolePortsBulkPartialUpdateExecute(r) +} + +/* +DcimConsolePortsBulkPartialUpdate Method for DcimConsolePortsBulkPartialUpdate + +Patch a list of console port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortsBulkPartialUpdate(ctx context.Context) ApiDcimConsolePortsBulkPartialUpdateRequest { + return ApiDcimConsolePortsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsolePort +func (a *DcimAPIService) DcimConsolePortsBulkPartialUpdateExecute(r ApiDcimConsolePortsBulkPartialUpdateRequest) ([]ConsolePort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsolePort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consolePortRequest == nil { + return localVarReturnValue, nil, reportError("consolePortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consolePortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consolePortRequest *[]ConsolePortRequest +} + +func (r ApiDcimConsolePortsBulkUpdateRequest) ConsolePortRequest(consolePortRequest []ConsolePortRequest) ApiDcimConsolePortsBulkUpdateRequest { + r.consolePortRequest = &consolePortRequest + return r +} + +func (r ApiDcimConsolePortsBulkUpdateRequest) Execute() ([]ConsolePort, *http.Response, error) { + return r.ApiService.DcimConsolePortsBulkUpdateExecute(r) +} + +/* +DcimConsolePortsBulkUpdate Method for DcimConsolePortsBulkUpdate + +Put a list of console port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortsBulkUpdate(ctx context.Context) ApiDcimConsolePortsBulkUpdateRequest { + return ApiDcimConsolePortsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsolePort +func (a *DcimAPIService) DcimConsolePortsBulkUpdateExecute(r ApiDcimConsolePortsBulkUpdateRequest) ([]ConsolePort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsolePort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consolePortRequest == nil { + return localVarReturnValue, nil, reportError("consolePortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consolePortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableConsolePortRequest *WritableConsolePortRequest +} + +func (r ApiDcimConsolePortsCreateRequest) WritableConsolePortRequest(writableConsolePortRequest WritableConsolePortRequest) ApiDcimConsolePortsCreateRequest { + r.writableConsolePortRequest = &writableConsolePortRequest + return r +} + +func (r ApiDcimConsolePortsCreateRequest) Execute() (*ConsolePort, *http.Response, error) { + return r.ApiService.DcimConsolePortsCreateExecute(r) +} + +/* +DcimConsolePortsCreate Method for DcimConsolePortsCreate + +Post a list of console port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortsCreateRequest +*/ +func (a *DcimAPIService) DcimConsolePortsCreate(ctx context.Context) ApiDcimConsolePortsCreateRequest { + return ApiDcimConsolePortsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ConsolePort +func (a *DcimAPIService) DcimConsolePortsCreateExecute(r ApiDcimConsolePortsCreateRequest) (*ConsolePort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsolePortRequest == nil { + return localVarReturnValue, nil, reportError("writableConsolePortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsolePortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsolePortsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsolePortsDestroyExecute(r) +} + +/* +DcimConsolePortsDestroy Method for DcimConsolePortsDestroy + +Delete a console port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port. + @return ApiDcimConsolePortsDestroyRequest +*/ +func (a *DcimAPIService) DcimConsolePortsDestroy(ctx context.Context, id int32) ApiDcimConsolePortsDestroyRequest { + return ApiDcimConsolePortsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsolePortsDestroyExecute(r ApiDcimConsolePortsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableEnd *string + cableEndN *string + cabled *bool + connected *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + moduleId *[]*int32 + moduleIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimConsolePortsListRequest) CableEnd(cableEnd string) ApiDcimConsolePortsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimConsolePortsListRequest) CableEndN(cableEndN string) ApiDcimConsolePortsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimConsolePortsListRequest) Cabled(cabled bool) ApiDcimConsolePortsListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimConsolePortsListRequest) Connected(connected bool) ApiDcimConsolePortsListRequest { + r.connected = &connected + return r +} + +func (r ApiDcimConsolePortsListRequest) Created(created []time.Time) ApiDcimConsolePortsListRequest { + r.created = &created + return r +} + +func (r ApiDcimConsolePortsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimConsolePortsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimConsolePortsListRequest) CreatedGt(createdGt []time.Time) ApiDcimConsolePortsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimConsolePortsListRequest) CreatedGte(createdGte []time.Time) ApiDcimConsolePortsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimConsolePortsListRequest) CreatedLt(createdLt []time.Time) ApiDcimConsolePortsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimConsolePortsListRequest) CreatedLte(createdLte []time.Time) ApiDcimConsolePortsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimConsolePortsListRequest) CreatedN(createdN []time.Time) ApiDcimConsolePortsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimConsolePortsListRequest) CreatedByRequest(createdByRequest string) ApiDcimConsolePortsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimConsolePortsListRequest) Description(description []string) ApiDcimConsolePortsListRequest { + r.description = &description + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimConsolePortsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionIc(descriptionIc []string) ApiDcimConsolePortsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionIe(descriptionIe []string) ApiDcimConsolePortsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionIew(descriptionIew []string) ApiDcimConsolePortsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimConsolePortsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionN(descriptionN []string) ApiDcimConsolePortsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionNic(descriptionNic []string) ApiDcimConsolePortsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionNie(descriptionNie []string) ApiDcimConsolePortsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimConsolePortsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimConsolePortsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimConsolePortsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimConsolePortsListRequest) Device(device []*string) ApiDcimConsolePortsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimConsolePortsListRequest) DeviceN(deviceN []*string) ApiDcimConsolePortsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimConsolePortsListRequest) DeviceId(deviceId []int32) ApiDcimConsolePortsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimConsolePortsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimConsolePortsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimConsolePortsListRequest) DeviceRole(deviceRole []string) ApiDcimConsolePortsListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimConsolePortsListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimConsolePortsListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimConsolePortsListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimConsolePortsListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimConsolePortsListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimConsolePortsListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimConsolePortsListRequest) DeviceType(deviceType []string) ApiDcimConsolePortsListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimConsolePortsListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimConsolePortsListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimConsolePortsListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimConsolePortsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimConsolePortsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimConsolePortsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimConsolePortsListRequest) Id(id []int32) ApiDcimConsolePortsListRequest { + r.id = &id + return r +} + +func (r ApiDcimConsolePortsListRequest) IdEmpty(idEmpty bool) ApiDcimConsolePortsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimConsolePortsListRequest) IdGt(idGt []int32) ApiDcimConsolePortsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimConsolePortsListRequest) IdGte(idGte []int32) ApiDcimConsolePortsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimConsolePortsListRequest) IdLt(idLt []int32) ApiDcimConsolePortsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimConsolePortsListRequest) IdLte(idLte []int32) ApiDcimConsolePortsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimConsolePortsListRequest) IdN(idN []int32) ApiDcimConsolePortsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimConsolePortsListRequest) Label(label []string) ApiDcimConsolePortsListRequest { + r.label = &label + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelEmpty(labelEmpty bool) ApiDcimConsolePortsListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelIc(labelIc []string) ApiDcimConsolePortsListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelIe(labelIe []string) ApiDcimConsolePortsListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelIew(labelIew []string) ApiDcimConsolePortsListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelIsw(labelIsw []string) ApiDcimConsolePortsListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelN(labelN []string) ApiDcimConsolePortsListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelNic(labelNic []string) ApiDcimConsolePortsListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelNie(labelNie []string) ApiDcimConsolePortsListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelNiew(labelNiew []string) ApiDcimConsolePortsListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimConsolePortsListRequest) LabelNisw(labelNisw []string) ApiDcimConsolePortsListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimConsolePortsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimConsolePortsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimConsolePortsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimConsolePortsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimConsolePortsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimConsolePortsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimConsolePortsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimConsolePortsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimConsolePortsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimConsolePortsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimConsolePortsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimConsolePortsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimConsolePortsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimConsolePortsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimConsolePortsListRequest) Limit(limit int32) ApiDcimConsolePortsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimConsolePortsListRequest) Location(location []string) ApiDcimConsolePortsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimConsolePortsListRequest) LocationN(locationN []string) ApiDcimConsolePortsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimConsolePortsListRequest) LocationId(locationId []int32) ApiDcimConsolePortsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimConsolePortsListRequest) LocationIdN(locationIdN []int32) ApiDcimConsolePortsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimConsolePortsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimConsolePortsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module (ID) +func (r ApiDcimConsolePortsListRequest) ModuleId(moduleId []*int32) ApiDcimConsolePortsListRequest { + r.moduleId = &moduleId + return r +} + +// Module (ID) +func (r ApiDcimConsolePortsListRequest) ModuleIdN(moduleIdN []*int32) ApiDcimConsolePortsListRequest { + r.moduleIdN = &moduleIdN + return r +} + +func (r ApiDcimConsolePortsListRequest) Name(name []string) ApiDcimConsolePortsListRequest { + r.name = &name + return r +} + +func (r ApiDcimConsolePortsListRequest) NameEmpty(nameEmpty bool) ApiDcimConsolePortsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimConsolePortsListRequest) NameIc(nameIc []string) ApiDcimConsolePortsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimConsolePortsListRequest) NameIe(nameIe []string) ApiDcimConsolePortsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimConsolePortsListRequest) NameIew(nameIew []string) ApiDcimConsolePortsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimConsolePortsListRequest) NameIsw(nameIsw []string) ApiDcimConsolePortsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimConsolePortsListRequest) NameN(nameN []string) ApiDcimConsolePortsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimConsolePortsListRequest) NameNic(nameNic []string) ApiDcimConsolePortsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimConsolePortsListRequest) NameNie(nameNie []string) ApiDcimConsolePortsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimConsolePortsListRequest) NameNiew(nameNiew []string) ApiDcimConsolePortsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimConsolePortsListRequest) NameNisw(nameNisw []string) ApiDcimConsolePortsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimConsolePortsListRequest) Occupied(occupied bool) ApiDcimConsolePortsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimConsolePortsListRequest) Offset(offset int32) ApiDcimConsolePortsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimConsolePortsListRequest) Ordering(ordering string) ApiDcimConsolePortsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimConsolePortsListRequest) Q(q string) ApiDcimConsolePortsListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimConsolePortsListRequest) Rack(rack []string) ApiDcimConsolePortsListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimConsolePortsListRequest) RackN(rackN []string) ApiDcimConsolePortsListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimConsolePortsListRequest) RackId(rackId []int32) ApiDcimConsolePortsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimConsolePortsListRequest) RackIdN(rackIdN []int32) ApiDcimConsolePortsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimConsolePortsListRequest) Region(region []int32) ApiDcimConsolePortsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimConsolePortsListRequest) RegionN(regionN []int32) ApiDcimConsolePortsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimConsolePortsListRequest) RegionId(regionId []int32) ApiDcimConsolePortsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimConsolePortsListRequest) RegionIdN(regionIdN []int32) ApiDcimConsolePortsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimConsolePortsListRequest) Role(role []string) ApiDcimConsolePortsListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimConsolePortsListRequest) RoleN(roleN []string) ApiDcimConsolePortsListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimConsolePortsListRequest) RoleId(roleId []int32) ApiDcimConsolePortsListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimConsolePortsListRequest) RoleIdN(roleIdN []int32) ApiDcimConsolePortsListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimConsolePortsListRequest) Site(site []string) ApiDcimConsolePortsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimConsolePortsListRequest) SiteN(siteN []string) ApiDcimConsolePortsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimConsolePortsListRequest) SiteGroup(siteGroup []int32) ApiDcimConsolePortsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimConsolePortsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimConsolePortsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimConsolePortsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimConsolePortsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimConsolePortsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimConsolePortsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimConsolePortsListRequest) SiteId(siteId []int32) ApiDcimConsolePortsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimConsolePortsListRequest) SiteIdN(siteIdN []int32) ApiDcimConsolePortsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimConsolePortsListRequest) Tag(tag []string) ApiDcimConsolePortsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimConsolePortsListRequest) TagN(tagN []string) ApiDcimConsolePortsListRequest { + r.tagN = &tagN + return r +} + +// Physical port type +func (r ApiDcimConsolePortsListRequest) Type_(type_ []string) ApiDcimConsolePortsListRequest { + r.type_ = &type_ + return r +} + +// Physical port type +func (r ApiDcimConsolePortsListRequest) TypeN(typeN []string) ApiDcimConsolePortsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimConsolePortsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimConsolePortsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimConsolePortsListRequest) VirtualChassis(virtualChassis []string) ApiDcimConsolePortsListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimConsolePortsListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimConsolePortsListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimConsolePortsListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimConsolePortsListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimConsolePortsListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimConsolePortsListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimConsolePortsListRequest) Execute() (*PaginatedConsolePortList, *http.Response, error) { + return r.ApiService.DcimConsolePortsListExecute(r) +} + +/* +DcimConsolePortsList Method for DcimConsolePortsList + +Get a list of console port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsolePortsListRequest +*/ +func (a *DcimAPIService) DcimConsolePortsList(ctx context.Context) ApiDcimConsolePortsListRequest { + return ApiDcimConsolePortsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConsolePortList +func (a *DcimAPIService) DcimConsolePortsListExecute(r ApiDcimConsolePortsListRequest) (*PaginatedConsolePortList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConsolePortList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.connected != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "connected", r.connected, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleId != nil { + t := *r.moduleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", t, "multi") + } + } + if r.moduleIdN != nil { + t := *r.moduleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableConsolePortRequest *PatchedWritableConsolePortRequest +} + +func (r ApiDcimConsolePortsPartialUpdateRequest) PatchedWritableConsolePortRequest(patchedWritableConsolePortRequest PatchedWritableConsolePortRequest) ApiDcimConsolePortsPartialUpdateRequest { + r.patchedWritableConsolePortRequest = &patchedWritableConsolePortRequest + return r +} + +func (r ApiDcimConsolePortsPartialUpdateRequest) Execute() (*ConsolePort, *http.Response, error) { + return r.ApiService.DcimConsolePortsPartialUpdateExecute(r) +} + +/* +DcimConsolePortsPartialUpdate Method for DcimConsolePortsPartialUpdate + +Patch a console port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port. + @return ApiDcimConsolePortsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortsPartialUpdate(ctx context.Context, id int32) ApiDcimConsolePortsPartialUpdateRequest { + return ApiDcimConsolePortsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsolePort +func (a *DcimAPIService) DcimConsolePortsPartialUpdateExecute(r ApiDcimConsolePortsPartialUpdateRequest) (*ConsolePort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableConsolePortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsolePortsRetrieveRequest) Execute() (*ConsolePort, *http.Response, error) { + return r.ApiService.DcimConsolePortsRetrieveExecute(r) +} + +/* +DcimConsolePortsRetrieve Method for DcimConsolePortsRetrieve + +Get a console port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port. + @return ApiDcimConsolePortsRetrieveRequest +*/ +func (a *DcimAPIService) DcimConsolePortsRetrieve(ctx context.Context, id int32) ApiDcimConsolePortsRetrieveRequest { + return ApiDcimConsolePortsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsolePort +func (a *DcimAPIService) DcimConsolePortsRetrieveExecute(r ApiDcimConsolePortsRetrieveRequest) (*ConsolePort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsTraceRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsolePortsTraceRetrieveRequest) Execute() (*ConsolePort, *http.Response, error) { + return r.ApiService.DcimConsolePortsTraceRetrieveExecute(r) +} + +/* +DcimConsolePortsTraceRetrieve Method for DcimConsolePortsTraceRetrieve + +Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port. + @return ApiDcimConsolePortsTraceRetrieveRequest +*/ +func (a *DcimAPIService) DcimConsolePortsTraceRetrieve(ctx context.Context, id int32) ApiDcimConsolePortsTraceRetrieveRequest { + return ApiDcimConsolePortsTraceRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsolePort +func (a *DcimAPIService) DcimConsolePortsTraceRetrieveExecute(r ApiDcimConsolePortsTraceRetrieveRequest) (*ConsolePort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsTraceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/{id}/trace/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsolePortsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableConsolePortRequest *WritableConsolePortRequest +} + +func (r ApiDcimConsolePortsUpdateRequest) WritableConsolePortRequest(writableConsolePortRequest WritableConsolePortRequest) ApiDcimConsolePortsUpdateRequest { + r.writableConsolePortRequest = &writableConsolePortRequest + return r +} + +func (r ApiDcimConsolePortsUpdateRequest) Execute() (*ConsolePort, *http.Response, error) { + return r.ApiService.DcimConsolePortsUpdateExecute(r) +} + +/* +DcimConsolePortsUpdate Method for DcimConsolePortsUpdate + +Put a console port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console port. + @return ApiDcimConsolePortsUpdateRequest +*/ +func (a *DcimAPIService) DcimConsolePortsUpdate(ctx context.Context, id int32) ApiDcimConsolePortsUpdateRequest { + return ApiDcimConsolePortsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsolePort +func (a *DcimAPIService) DcimConsolePortsUpdateExecute(r ApiDcimConsolePortsUpdateRequest) (*ConsolePort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsolePort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsolePortsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsolePortRequest == nil { + return localVarReturnValue, nil, reportError("writableConsolePortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsolePortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + consoleServerPortTemplateRequest *[]ConsoleServerPortTemplateRequest +} + +func (r ApiDcimConsoleServerPortTemplatesBulkDestroyRequest) ConsoleServerPortTemplateRequest(consoleServerPortTemplateRequest []ConsoleServerPortTemplateRequest) ApiDcimConsoleServerPortTemplatesBulkDestroyRequest { + r.consoleServerPortTemplateRequest = &consoleServerPortTemplateRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesBulkDestroyExecute(r) +} + +/* +DcimConsoleServerPortTemplatesBulkDestroy Method for DcimConsoleServerPortTemplatesBulkDestroy + +Delete a list of console server port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesBulkDestroy(ctx context.Context) ApiDcimConsoleServerPortTemplatesBulkDestroyRequest { + return ApiDcimConsoleServerPortTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsoleServerPortTemplatesBulkDestroyExecute(r ApiDcimConsoleServerPortTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consoleServerPortTemplateRequest == nil { + return nil, reportError("consoleServerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consoleServerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consoleServerPortTemplateRequest *[]ConsoleServerPortTemplateRequest +} + +func (r ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest) ConsoleServerPortTemplateRequest(consoleServerPortTemplateRequest []ConsoleServerPortTemplateRequest) ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest { + r.consoleServerPortTemplateRequest = &consoleServerPortTemplateRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest) Execute() ([]ConsoleServerPortTemplate, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimConsoleServerPortTemplatesBulkPartialUpdate Method for DcimConsoleServerPortTemplatesBulkPartialUpdate + +Patch a list of console server port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest { + return ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsoleServerPortTemplate +func (a *DcimAPIService) DcimConsoleServerPortTemplatesBulkPartialUpdateExecute(r ApiDcimConsoleServerPortTemplatesBulkPartialUpdateRequest) ([]ConsoleServerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsoleServerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consoleServerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("consoleServerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consoleServerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consoleServerPortTemplateRequest *[]ConsoleServerPortTemplateRequest +} + +func (r ApiDcimConsoleServerPortTemplatesBulkUpdateRequest) ConsoleServerPortTemplateRequest(consoleServerPortTemplateRequest []ConsoleServerPortTemplateRequest) ApiDcimConsoleServerPortTemplatesBulkUpdateRequest { + r.consoleServerPortTemplateRequest = &consoleServerPortTemplateRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesBulkUpdateRequest) Execute() ([]ConsoleServerPortTemplate, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesBulkUpdateExecute(r) +} + +/* +DcimConsoleServerPortTemplatesBulkUpdate Method for DcimConsoleServerPortTemplatesBulkUpdate + +Put a list of console server port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesBulkUpdate(ctx context.Context) ApiDcimConsoleServerPortTemplatesBulkUpdateRequest { + return ApiDcimConsoleServerPortTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsoleServerPortTemplate +func (a *DcimAPIService) DcimConsoleServerPortTemplatesBulkUpdateExecute(r ApiDcimConsoleServerPortTemplatesBulkUpdateRequest) ([]ConsoleServerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsoleServerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consoleServerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("consoleServerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consoleServerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableConsoleServerPortTemplateRequest *WritableConsoleServerPortTemplateRequest +} + +func (r ApiDcimConsoleServerPortTemplatesCreateRequest) WritableConsoleServerPortTemplateRequest(writableConsoleServerPortTemplateRequest WritableConsoleServerPortTemplateRequest) ApiDcimConsoleServerPortTemplatesCreateRequest { + r.writableConsoleServerPortTemplateRequest = &writableConsoleServerPortTemplateRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesCreateRequest) Execute() (*ConsoleServerPortTemplate, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesCreateExecute(r) +} + +/* +DcimConsoleServerPortTemplatesCreate Method for DcimConsoleServerPortTemplatesCreate + +Post a list of console server port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesCreate(ctx context.Context) ApiDcimConsoleServerPortTemplatesCreateRequest { + return ApiDcimConsoleServerPortTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ConsoleServerPortTemplate +func (a *DcimAPIService) DcimConsoleServerPortTemplatesCreateExecute(r ApiDcimConsoleServerPortTemplatesCreateRequest) (*ConsoleServerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsoleServerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConsoleServerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsoleServerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsoleServerPortTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesDestroyExecute(r) +} + +/* +DcimConsoleServerPortTemplatesDestroy Method for DcimConsoleServerPortTemplatesDestroy + +Delete a console server port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port template. + @return ApiDcimConsoleServerPortTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesDestroy(ctx context.Context, id int32) ApiDcimConsoleServerPortTemplatesDestroyRequest { + return ApiDcimConsoleServerPortTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsoleServerPortTemplatesDestroyExecute(r ApiDcimConsoleServerPortTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]*int32 + devicetypeIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + moduletypeId *[]*int32 + moduletypeIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + type_ *string + typeN *string + updatedByRequest *string +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) Created(created []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimConsoleServerPortTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) Description(description []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimConsoleServerPortTemplatesListRequest) DevicetypeId(devicetypeId []*int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimConsoleServerPortTemplatesListRequest) DevicetypeIdN(devicetypeIdN []*int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) Id(id []int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimConsoleServerPortTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) IdGt(idGt []int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) IdGte(idGte []int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) IdLt(idLt []int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) IdLte(idLte []int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) IdN(idN []int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimConsoleServerPortTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimConsoleServerPortTemplatesListRequest) Limit(limit int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimConsoleServerPortTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module type (ID) +func (r ApiDcimConsoleServerPortTemplatesListRequest) ModuletypeId(moduletypeId []*int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.moduletypeId = &moduletypeId + return r +} + +// Module type (ID) +func (r ApiDcimConsoleServerPortTemplatesListRequest) ModuletypeIdN(moduletypeIdN []*int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.moduletypeIdN = &moduletypeIdN + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) Name(name []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameIc(nameIc []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameIe(nameIe []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameIew(nameIew []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameN(nameN []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameNic(nameNic []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameNie(nameNie []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimConsoleServerPortTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimConsoleServerPortTemplatesListRequest) Offset(offset int32) ApiDcimConsoleServerPortTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimConsoleServerPortTemplatesListRequest) Ordering(ordering string) ApiDcimConsoleServerPortTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimConsoleServerPortTemplatesListRequest) Q(q string) ApiDcimConsoleServerPortTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) Type_(type_ string) ApiDcimConsoleServerPortTemplatesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) TypeN(typeN string) ApiDcimConsoleServerPortTemplatesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimConsoleServerPortTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesListRequest) Execute() (*PaginatedConsoleServerPortTemplateList, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesListExecute(r) +} + +/* +DcimConsoleServerPortTemplatesList Method for DcimConsoleServerPortTemplatesList + +Get a list of console server port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortTemplatesListRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesList(ctx context.Context) ApiDcimConsoleServerPortTemplatesListRequest { + return ApiDcimConsoleServerPortTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConsoleServerPortTemplateList +func (a *DcimAPIService) DcimConsoleServerPortTemplatesListExecute(r ApiDcimConsoleServerPortTemplatesListRequest) (*PaginatedConsoleServerPortTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConsoleServerPortTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduletypeId != nil { + t := *r.moduletypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", t, "multi") + } + } + if r.moduletypeIdN != nil { + t := *r.moduletypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.typeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", r.typeN, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableConsoleServerPortTemplateRequest *PatchedWritableConsoleServerPortTemplateRequest +} + +func (r ApiDcimConsoleServerPortTemplatesPartialUpdateRequest) PatchedWritableConsoleServerPortTemplateRequest(patchedWritableConsoleServerPortTemplateRequest PatchedWritableConsoleServerPortTemplateRequest) ApiDcimConsoleServerPortTemplatesPartialUpdateRequest { + r.patchedWritableConsoleServerPortTemplateRequest = &patchedWritableConsoleServerPortTemplateRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesPartialUpdateRequest) Execute() (*ConsoleServerPortTemplate, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesPartialUpdateExecute(r) +} + +/* +DcimConsoleServerPortTemplatesPartialUpdate Method for DcimConsoleServerPortTemplatesPartialUpdate + +Patch a console server port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port template. + @return ApiDcimConsoleServerPortTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimConsoleServerPortTemplatesPartialUpdateRequest { + return ApiDcimConsoleServerPortTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsoleServerPortTemplate +func (a *DcimAPIService) DcimConsoleServerPortTemplatesPartialUpdateExecute(r ApiDcimConsoleServerPortTemplatesPartialUpdateRequest) (*ConsoleServerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableConsoleServerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsoleServerPortTemplatesRetrieveRequest) Execute() (*ConsoleServerPortTemplate, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesRetrieveExecute(r) +} + +/* +DcimConsoleServerPortTemplatesRetrieve Method for DcimConsoleServerPortTemplatesRetrieve + +Get a console server port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port template. + @return ApiDcimConsoleServerPortTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesRetrieve(ctx context.Context, id int32) ApiDcimConsoleServerPortTemplatesRetrieveRequest { + return ApiDcimConsoleServerPortTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsoleServerPortTemplate +func (a *DcimAPIService) DcimConsoleServerPortTemplatesRetrieveExecute(r ApiDcimConsoleServerPortTemplatesRetrieveRequest) (*ConsoleServerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableConsoleServerPortTemplateRequest *WritableConsoleServerPortTemplateRequest +} + +func (r ApiDcimConsoleServerPortTemplatesUpdateRequest) WritableConsoleServerPortTemplateRequest(writableConsoleServerPortTemplateRequest WritableConsoleServerPortTemplateRequest) ApiDcimConsoleServerPortTemplatesUpdateRequest { + r.writableConsoleServerPortTemplateRequest = &writableConsoleServerPortTemplateRequest + return r +} + +func (r ApiDcimConsoleServerPortTemplatesUpdateRequest) Execute() (*ConsoleServerPortTemplate, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortTemplatesUpdateExecute(r) +} + +/* +DcimConsoleServerPortTemplatesUpdate Method for DcimConsoleServerPortTemplatesUpdate + +Put a console server port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port template. + @return ApiDcimConsoleServerPortTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortTemplatesUpdate(ctx context.Context, id int32) ApiDcimConsoleServerPortTemplatesUpdateRequest { + return ApiDcimConsoleServerPortTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsoleServerPortTemplate +func (a *DcimAPIService) DcimConsoleServerPortTemplatesUpdateExecute(r ApiDcimConsoleServerPortTemplatesUpdateRequest) (*ConsoleServerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsoleServerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConsoleServerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsoleServerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + consoleServerPortRequest *[]ConsoleServerPortRequest +} + +func (r ApiDcimConsoleServerPortsBulkDestroyRequest) ConsoleServerPortRequest(consoleServerPortRequest []ConsoleServerPortRequest) ApiDcimConsoleServerPortsBulkDestroyRequest { + r.consoleServerPortRequest = &consoleServerPortRequest + return r +} + +func (r ApiDcimConsoleServerPortsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsoleServerPortsBulkDestroyExecute(r) +} + +/* +DcimConsoleServerPortsBulkDestroy Method for DcimConsoleServerPortsBulkDestroy + +Delete a list of console server port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsBulkDestroy(ctx context.Context) ApiDcimConsoleServerPortsBulkDestroyRequest { + return ApiDcimConsoleServerPortsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsoleServerPortsBulkDestroyExecute(r ApiDcimConsoleServerPortsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consoleServerPortRequest == nil { + return nil, reportError("consoleServerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consoleServerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consoleServerPortRequest *[]ConsoleServerPortRequest +} + +func (r ApiDcimConsoleServerPortsBulkPartialUpdateRequest) ConsoleServerPortRequest(consoleServerPortRequest []ConsoleServerPortRequest) ApiDcimConsoleServerPortsBulkPartialUpdateRequest { + r.consoleServerPortRequest = &consoleServerPortRequest + return r +} + +func (r ApiDcimConsoleServerPortsBulkPartialUpdateRequest) Execute() ([]ConsoleServerPort, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsBulkPartialUpdateExecute(r) +} + +/* +DcimConsoleServerPortsBulkPartialUpdate Method for DcimConsoleServerPortsBulkPartialUpdate + +Patch a list of console server port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsBulkPartialUpdate(ctx context.Context) ApiDcimConsoleServerPortsBulkPartialUpdateRequest { + return ApiDcimConsoleServerPortsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsoleServerPort +func (a *DcimAPIService) DcimConsoleServerPortsBulkPartialUpdateExecute(r ApiDcimConsoleServerPortsBulkPartialUpdateRequest) ([]ConsoleServerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsoleServerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consoleServerPortRequest == nil { + return localVarReturnValue, nil, reportError("consoleServerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consoleServerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + consoleServerPortRequest *[]ConsoleServerPortRequest +} + +func (r ApiDcimConsoleServerPortsBulkUpdateRequest) ConsoleServerPortRequest(consoleServerPortRequest []ConsoleServerPortRequest) ApiDcimConsoleServerPortsBulkUpdateRequest { + r.consoleServerPortRequest = &consoleServerPortRequest + return r +} + +func (r ApiDcimConsoleServerPortsBulkUpdateRequest) Execute() ([]ConsoleServerPort, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsBulkUpdateExecute(r) +} + +/* +DcimConsoleServerPortsBulkUpdate Method for DcimConsoleServerPortsBulkUpdate + +Put a list of console server port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsBulkUpdate(ctx context.Context) ApiDcimConsoleServerPortsBulkUpdateRequest { + return ApiDcimConsoleServerPortsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConsoleServerPort +func (a *DcimAPIService) DcimConsoleServerPortsBulkUpdateExecute(r ApiDcimConsoleServerPortsBulkUpdateRequest) ([]ConsoleServerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConsoleServerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consoleServerPortRequest == nil { + return localVarReturnValue, nil, reportError("consoleServerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consoleServerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableConsoleServerPortRequest *WritableConsoleServerPortRequest +} + +func (r ApiDcimConsoleServerPortsCreateRequest) WritableConsoleServerPortRequest(writableConsoleServerPortRequest WritableConsoleServerPortRequest) ApiDcimConsoleServerPortsCreateRequest { + r.writableConsoleServerPortRequest = &writableConsoleServerPortRequest + return r +} + +func (r ApiDcimConsoleServerPortsCreateRequest) Execute() (*ConsoleServerPort, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsCreateExecute(r) +} + +/* +DcimConsoleServerPortsCreate Method for DcimConsoleServerPortsCreate + +Post a list of console server port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortsCreateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsCreate(ctx context.Context) ApiDcimConsoleServerPortsCreateRequest { + return ApiDcimConsoleServerPortsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ConsoleServerPort +func (a *DcimAPIService) DcimConsoleServerPortsCreateExecute(r ApiDcimConsoleServerPortsCreateRequest) (*ConsoleServerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsoleServerPortRequest == nil { + return localVarReturnValue, nil, reportError("writableConsoleServerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsoleServerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsoleServerPortsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimConsoleServerPortsDestroyExecute(r) +} + +/* +DcimConsoleServerPortsDestroy Method for DcimConsoleServerPortsDestroy + +Delete a console server port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port. + @return ApiDcimConsoleServerPortsDestroyRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsDestroy(ctx context.Context, id int32) ApiDcimConsoleServerPortsDestroyRequest { + return ApiDcimConsoleServerPortsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimConsoleServerPortsDestroyExecute(r ApiDcimConsoleServerPortsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableEnd *string + cableEndN *string + cabled *bool + connected *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + moduleId *[]*int32 + moduleIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimConsoleServerPortsListRequest) CableEnd(cableEnd string) ApiDcimConsoleServerPortsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CableEndN(cableEndN string) ApiDcimConsoleServerPortsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Cabled(cabled bool) ApiDcimConsoleServerPortsListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Connected(connected bool) ApiDcimConsoleServerPortsListRequest { + r.connected = &connected + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Created(created []time.Time) ApiDcimConsoleServerPortsListRequest { + r.created = &created + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimConsoleServerPortsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CreatedGt(createdGt []time.Time) ApiDcimConsoleServerPortsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CreatedGte(createdGte []time.Time) ApiDcimConsoleServerPortsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CreatedLt(createdLt []time.Time) ApiDcimConsoleServerPortsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CreatedLte(createdLte []time.Time) ApiDcimConsoleServerPortsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CreatedN(createdN []time.Time) ApiDcimConsoleServerPortsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) CreatedByRequest(createdByRequest string) ApiDcimConsoleServerPortsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Description(description []string) ApiDcimConsoleServerPortsListRequest { + r.description = &description + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimConsoleServerPortsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionIc(descriptionIc []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionIe(descriptionIe []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionIew(descriptionIew []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionN(descriptionN []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionNic(descriptionNic []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionNie(descriptionNie []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimConsoleServerPortsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimConsoleServerPortsListRequest) Device(device []*string) ApiDcimConsoleServerPortsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimConsoleServerPortsListRequest) DeviceN(deviceN []*string) ApiDcimConsoleServerPortsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimConsoleServerPortsListRequest) DeviceId(deviceId []int32) ApiDcimConsoleServerPortsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimConsoleServerPortsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimConsoleServerPortsListRequest) DeviceRole(deviceRole []string) ApiDcimConsoleServerPortsListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimConsoleServerPortsListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimConsoleServerPortsListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimConsoleServerPortsListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimConsoleServerPortsListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimConsoleServerPortsListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimConsoleServerPortsListRequest) DeviceType(deviceType []string) ApiDcimConsoleServerPortsListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimConsoleServerPortsListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimConsoleServerPortsListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimConsoleServerPortsListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimConsoleServerPortsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimConsoleServerPortsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Id(id []int32) ApiDcimConsoleServerPortsListRequest { + r.id = &id + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) IdEmpty(idEmpty bool) ApiDcimConsoleServerPortsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) IdGt(idGt []int32) ApiDcimConsoleServerPortsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) IdGte(idGte []int32) ApiDcimConsoleServerPortsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) IdLt(idLt []int32) ApiDcimConsoleServerPortsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) IdLte(idLte []int32) ApiDcimConsoleServerPortsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) IdN(idN []int32) ApiDcimConsoleServerPortsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Label(label []string) ApiDcimConsoleServerPortsListRequest { + r.label = &label + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelEmpty(labelEmpty bool) ApiDcimConsoleServerPortsListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelIc(labelIc []string) ApiDcimConsoleServerPortsListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelIe(labelIe []string) ApiDcimConsoleServerPortsListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelIew(labelIew []string) ApiDcimConsoleServerPortsListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelIsw(labelIsw []string) ApiDcimConsoleServerPortsListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelN(labelN []string) ApiDcimConsoleServerPortsListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelNic(labelNic []string) ApiDcimConsoleServerPortsListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelNie(labelNie []string) ApiDcimConsoleServerPortsListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelNiew(labelNiew []string) ApiDcimConsoleServerPortsListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LabelNisw(labelNisw []string) ApiDcimConsoleServerPortsListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimConsoleServerPortsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimConsoleServerPortsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimConsoleServerPortsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimConsoleServerPortsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimConsoleServerPortsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimConsoleServerPortsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimConsoleServerPortsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimConsoleServerPortsListRequest) Limit(limit int32) ApiDcimConsoleServerPortsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimConsoleServerPortsListRequest) Location(location []string) ApiDcimConsoleServerPortsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimConsoleServerPortsListRequest) LocationN(locationN []string) ApiDcimConsoleServerPortsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimConsoleServerPortsListRequest) LocationId(locationId []int32) ApiDcimConsoleServerPortsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimConsoleServerPortsListRequest) LocationIdN(locationIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimConsoleServerPortsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module (ID) +func (r ApiDcimConsoleServerPortsListRequest) ModuleId(moduleId []*int32) ApiDcimConsoleServerPortsListRequest { + r.moduleId = &moduleId + return r +} + +// Module (ID) +func (r ApiDcimConsoleServerPortsListRequest) ModuleIdN(moduleIdN []*int32) ApiDcimConsoleServerPortsListRequest { + r.moduleIdN = &moduleIdN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Name(name []string) ApiDcimConsoleServerPortsListRequest { + r.name = &name + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameEmpty(nameEmpty bool) ApiDcimConsoleServerPortsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameIc(nameIc []string) ApiDcimConsoleServerPortsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameIe(nameIe []string) ApiDcimConsoleServerPortsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameIew(nameIew []string) ApiDcimConsoleServerPortsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameIsw(nameIsw []string) ApiDcimConsoleServerPortsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameN(nameN []string) ApiDcimConsoleServerPortsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameNic(nameNic []string) ApiDcimConsoleServerPortsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameNie(nameNie []string) ApiDcimConsoleServerPortsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameNiew(nameNiew []string) ApiDcimConsoleServerPortsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) NameNisw(nameNisw []string) ApiDcimConsoleServerPortsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Occupied(occupied bool) ApiDcimConsoleServerPortsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimConsoleServerPortsListRequest) Offset(offset int32) ApiDcimConsoleServerPortsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimConsoleServerPortsListRequest) Ordering(ordering string) ApiDcimConsoleServerPortsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimConsoleServerPortsListRequest) Q(q string) ApiDcimConsoleServerPortsListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimConsoleServerPortsListRequest) Rack(rack []string) ApiDcimConsoleServerPortsListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimConsoleServerPortsListRequest) RackN(rackN []string) ApiDcimConsoleServerPortsListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimConsoleServerPortsListRequest) RackId(rackId []int32) ApiDcimConsoleServerPortsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimConsoleServerPortsListRequest) RackIdN(rackIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimConsoleServerPortsListRequest) Region(region []int32) ApiDcimConsoleServerPortsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimConsoleServerPortsListRequest) RegionN(regionN []int32) ApiDcimConsoleServerPortsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimConsoleServerPortsListRequest) RegionId(regionId []int32) ApiDcimConsoleServerPortsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimConsoleServerPortsListRequest) RegionIdN(regionIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimConsoleServerPortsListRequest) Role(role []string) ApiDcimConsoleServerPortsListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimConsoleServerPortsListRequest) RoleN(roleN []string) ApiDcimConsoleServerPortsListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimConsoleServerPortsListRequest) RoleId(roleId []int32) ApiDcimConsoleServerPortsListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimConsoleServerPortsListRequest) RoleIdN(roleIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimConsoleServerPortsListRequest) Site(site []string) ApiDcimConsoleServerPortsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimConsoleServerPortsListRequest) SiteN(siteN []string) ApiDcimConsoleServerPortsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimConsoleServerPortsListRequest) SiteGroup(siteGroup []int32) ApiDcimConsoleServerPortsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimConsoleServerPortsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimConsoleServerPortsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimConsoleServerPortsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimConsoleServerPortsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimConsoleServerPortsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimConsoleServerPortsListRequest) SiteId(siteId []int32) ApiDcimConsoleServerPortsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimConsoleServerPortsListRequest) SiteIdN(siteIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Tag(tag []string) ApiDcimConsoleServerPortsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) TagN(tagN []string) ApiDcimConsoleServerPortsListRequest { + r.tagN = &tagN + return r +} + +// Physical port type +func (r ApiDcimConsoleServerPortsListRequest) Type_(type_ []string) ApiDcimConsoleServerPortsListRequest { + r.type_ = &type_ + return r +} + +// Physical port type +func (r ApiDcimConsoleServerPortsListRequest) TypeN(typeN []string) ApiDcimConsoleServerPortsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimConsoleServerPortsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimConsoleServerPortsListRequest) VirtualChassis(virtualChassis []string) ApiDcimConsoleServerPortsListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimConsoleServerPortsListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimConsoleServerPortsListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimConsoleServerPortsListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimConsoleServerPortsListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimConsoleServerPortsListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimConsoleServerPortsListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimConsoleServerPortsListRequest) Execute() (*PaginatedConsoleServerPortList, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsListExecute(r) +} + +/* +DcimConsoleServerPortsList Method for DcimConsoleServerPortsList + +Get a list of console server port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimConsoleServerPortsListRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsList(ctx context.Context) ApiDcimConsoleServerPortsListRequest { + return ApiDcimConsoleServerPortsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConsoleServerPortList +func (a *DcimAPIService) DcimConsoleServerPortsListExecute(r ApiDcimConsoleServerPortsListRequest) (*PaginatedConsoleServerPortList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConsoleServerPortList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.connected != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "connected", r.connected, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleId != nil { + t := *r.moduleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", t, "multi") + } + } + if r.moduleIdN != nil { + t := *r.moduleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableConsoleServerPortRequest *PatchedWritableConsoleServerPortRequest +} + +func (r ApiDcimConsoleServerPortsPartialUpdateRequest) PatchedWritableConsoleServerPortRequest(patchedWritableConsoleServerPortRequest PatchedWritableConsoleServerPortRequest) ApiDcimConsoleServerPortsPartialUpdateRequest { + r.patchedWritableConsoleServerPortRequest = &patchedWritableConsoleServerPortRequest + return r +} + +func (r ApiDcimConsoleServerPortsPartialUpdateRequest) Execute() (*ConsoleServerPort, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsPartialUpdateExecute(r) +} + +/* +DcimConsoleServerPortsPartialUpdate Method for DcimConsoleServerPortsPartialUpdate + +Patch a console server port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port. + @return ApiDcimConsoleServerPortsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsPartialUpdate(ctx context.Context, id int32) ApiDcimConsoleServerPortsPartialUpdateRequest { + return ApiDcimConsoleServerPortsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsoleServerPort +func (a *DcimAPIService) DcimConsoleServerPortsPartialUpdateExecute(r ApiDcimConsoleServerPortsPartialUpdateRequest) (*ConsoleServerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableConsoleServerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsoleServerPortsRetrieveRequest) Execute() (*ConsoleServerPort, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsRetrieveExecute(r) +} + +/* +DcimConsoleServerPortsRetrieve Method for DcimConsoleServerPortsRetrieve + +Get a console server port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port. + @return ApiDcimConsoleServerPortsRetrieveRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsRetrieve(ctx context.Context, id int32) ApiDcimConsoleServerPortsRetrieveRequest { + return ApiDcimConsoleServerPortsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsoleServerPort +func (a *DcimAPIService) DcimConsoleServerPortsRetrieveExecute(r ApiDcimConsoleServerPortsRetrieveRequest) (*ConsoleServerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsTraceRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimConsoleServerPortsTraceRetrieveRequest) Execute() (*ConsoleServerPort, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsTraceRetrieveExecute(r) +} + +/* +DcimConsoleServerPortsTraceRetrieve Method for DcimConsoleServerPortsTraceRetrieve + +Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port. + @return ApiDcimConsoleServerPortsTraceRetrieveRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsTraceRetrieve(ctx context.Context, id int32) ApiDcimConsoleServerPortsTraceRetrieveRequest { + return ApiDcimConsoleServerPortsTraceRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsoleServerPort +func (a *DcimAPIService) DcimConsoleServerPortsTraceRetrieveExecute(r ApiDcimConsoleServerPortsTraceRetrieveRequest) (*ConsoleServerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsTraceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/{id}/trace/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimConsoleServerPortsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableConsoleServerPortRequest *WritableConsoleServerPortRequest +} + +func (r ApiDcimConsoleServerPortsUpdateRequest) WritableConsoleServerPortRequest(writableConsoleServerPortRequest WritableConsoleServerPortRequest) ApiDcimConsoleServerPortsUpdateRequest { + r.writableConsoleServerPortRequest = &writableConsoleServerPortRequest + return r +} + +func (r ApiDcimConsoleServerPortsUpdateRequest) Execute() (*ConsoleServerPort, *http.Response, error) { + return r.ApiService.DcimConsoleServerPortsUpdateExecute(r) +} + +/* +DcimConsoleServerPortsUpdate Method for DcimConsoleServerPortsUpdate + +Put a console server port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this console server port. + @return ApiDcimConsoleServerPortsUpdateRequest +*/ +func (a *DcimAPIService) DcimConsoleServerPortsUpdate(ctx context.Context, id int32) ApiDcimConsoleServerPortsUpdateRequest { + return ApiDcimConsoleServerPortsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConsoleServerPort +func (a *DcimAPIService) DcimConsoleServerPortsUpdateExecute(r ApiDcimConsoleServerPortsUpdateRequest) (*ConsoleServerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsoleServerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimConsoleServerPortsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/console-server-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConsoleServerPortRequest == nil { + return localVarReturnValue, nil, reportError("writableConsoleServerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConsoleServerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceBayTemplateRequest *[]DeviceBayTemplateRequest +} + +func (r ApiDcimDeviceBayTemplatesBulkDestroyRequest) DeviceBayTemplateRequest(deviceBayTemplateRequest []DeviceBayTemplateRequest) ApiDcimDeviceBayTemplatesBulkDestroyRequest { + r.deviceBayTemplateRequest = &deviceBayTemplateRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesBulkDestroyExecute(r) +} + +/* +DcimDeviceBayTemplatesBulkDestroy Method for DcimDeviceBayTemplatesBulkDestroy + +Delete a list of device bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBayTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesBulkDestroy(ctx context.Context) ApiDcimDeviceBayTemplatesBulkDestroyRequest { + return ApiDcimDeviceBayTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceBayTemplatesBulkDestroyExecute(r ApiDcimDeviceBayTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceBayTemplateRequest == nil { + return nil, reportError("deviceBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceBayTemplateRequest *[]DeviceBayTemplateRequest +} + +func (r ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest) DeviceBayTemplateRequest(deviceBayTemplateRequest []DeviceBayTemplateRequest) ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest { + r.deviceBayTemplateRequest = &deviceBayTemplateRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest) Execute() ([]DeviceBayTemplate, *http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimDeviceBayTemplatesBulkPartialUpdate Method for DcimDeviceBayTemplatesBulkPartialUpdate + +Patch a list of device bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest { + return ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceBayTemplate +func (a *DcimAPIService) DcimDeviceBayTemplatesBulkPartialUpdateExecute(r ApiDcimDeviceBayTemplatesBulkPartialUpdateRequest) ([]DeviceBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("deviceBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceBayTemplateRequest *[]DeviceBayTemplateRequest +} + +func (r ApiDcimDeviceBayTemplatesBulkUpdateRequest) DeviceBayTemplateRequest(deviceBayTemplateRequest []DeviceBayTemplateRequest) ApiDcimDeviceBayTemplatesBulkUpdateRequest { + r.deviceBayTemplateRequest = &deviceBayTemplateRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesBulkUpdateRequest) Execute() ([]DeviceBayTemplate, *http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesBulkUpdateExecute(r) +} + +/* +DcimDeviceBayTemplatesBulkUpdate Method for DcimDeviceBayTemplatesBulkUpdate + +Put a list of device bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBayTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesBulkUpdate(ctx context.Context) ApiDcimDeviceBayTemplatesBulkUpdateRequest { + return ApiDcimDeviceBayTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceBayTemplate +func (a *DcimAPIService) DcimDeviceBayTemplatesBulkUpdateExecute(r ApiDcimDeviceBayTemplatesBulkUpdateRequest) ([]DeviceBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("deviceBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableDeviceBayTemplateRequest *WritableDeviceBayTemplateRequest +} + +func (r ApiDcimDeviceBayTemplatesCreateRequest) WritableDeviceBayTemplateRequest(writableDeviceBayTemplateRequest WritableDeviceBayTemplateRequest) ApiDcimDeviceBayTemplatesCreateRequest { + r.writableDeviceBayTemplateRequest = &writableDeviceBayTemplateRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesCreateRequest) Execute() (*DeviceBayTemplate, *http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesCreateExecute(r) +} + +/* +DcimDeviceBayTemplatesCreate Method for DcimDeviceBayTemplatesCreate + +Post a list of device bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBayTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesCreate(ctx context.Context) ApiDcimDeviceBayTemplatesCreateRequest { + return ApiDcimDeviceBayTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceBayTemplate +func (a *DcimAPIService) DcimDeviceBayTemplatesCreateExecute(r ApiDcimDeviceBayTemplatesCreateRequest) (*DeviceBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceBayTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesDestroyExecute(r) +} + +/* +DcimDeviceBayTemplatesDestroy Method for DcimDeviceBayTemplatesDestroy + +Delete a device bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay template. + @return ApiDcimDeviceBayTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesDestroy(ctx context.Context, id int32) ApiDcimDeviceBayTemplatesDestroyRequest { + return ApiDcimDeviceBayTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceBayTemplatesDestroyExecute(r ApiDcimDeviceBayTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]int32 + devicetypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + updatedByRequest *string +} + +func (r ApiDcimDeviceBayTemplatesListRequest) Created(created []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimDeviceBayTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) Description(description []string) ApiDcimDeviceBayTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimDeviceBayTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimDeviceBayTemplatesListRequest) DevicetypeId(devicetypeId []int32) ApiDcimDeviceBayTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimDeviceBayTemplatesListRequest) DevicetypeIdN(devicetypeIdN []int32) ApiDcimDeviceBayTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) Id(id []int32) ApiDcimDeviceBayTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimDeviceBayTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) IdGt(idGt []int32) ApiDcimDeviceBayTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) IdGte(idGte []int32) ApiDcimDeviceBayTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) IdLt(idLt []int32) ApiDcimDeviceBayTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) IdLte(idLte []int32) ApiDcimDeviceBayTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) IdN(idN []int32) ApiDcimDeviceBayTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimDeviceBayTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimDeviceBayTemplatesListRequest) Limit(limit int32) ApiDcimDeviceBayTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimDeviceBayTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) Name(name []string) ApiDcimDeviceBayTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimDeviceBayTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameIc(nameIc []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameIe(nameIe []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameIew(nameIew []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameN(nameN []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameNic(nameNic []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameNie(nameNie []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimDeviceBayTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimDeviceBayTemplatesListRequest) Offset(offset int32) ApiDcimDeviceBayTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimDeviceBayTemplatesListRequest) Ordering(ordering string) ApiDcimDeviceBayTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimDeviceBayTemplatesListRequest) Q(q string) ApiDcimDeviceBayTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimDeviceBayTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesListRequest) Execute() (*PaginatedDeviceBayTemplateList, *http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesListExecute(r) +} + +/* +DcimDeviceBayTemplatesList Method for DcimDeviceBayTemplatesList + +Get a list of device bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBayTemplatesListRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesList(ctx context.Context) ApiDcimDeviceBayTemplatesListRequest { + return ApiDcimDeviceBayTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDeviceBayTemplateList +func (a *DcimAPIService) DcimDeviceBayTemplatesListExecute(r ApiDcimDeviceBayTemplatesListRequest) (*PaginatedDeviceBayTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDeviceBayTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableDeviceBayTemplateRequest *PatchedWritableDeviceBayTemplateRequest +} + +func (r ApiDcimDeviceBayTemplatesPartialUpdateRequest) PatchedWritableDeviceBayTemplateRequest(patchedWritableDeviceBayTemplateRequest PatchedWritableDeviceBayTemplateRequest) ApiDcimDeviceBayTemplatesPartialUpdateRequest { + r.patchedWritableDeviceBayTemplateRequest = &patchedWritableDeviceBayTemplateRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesPartialUpdateRequest) Execute() (*DeviceBayTemplate, *http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesPartialUpdateExecute(r) +} + +/* +DcimDeviceBayTemplatesPartialUpdate Method for DcimDeviceBayTemplatesPartialUpdate + +Patch a device bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay template. + @return ApiDcimDeviceBayTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimDeviceBayTemplatesPartialUpdateRequest { + return ApiDcimDeviceBayTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceBayTemplate +func (a *DcimAPIService) DcimDeviceBayTemplatesPartialUpdateExecute(r ApiDcimDeviceBayTemplatesPartialUpdateRequest) (*DeviceBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableDeviceBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceBayTemplatesRetrieveRequest) Execute() (*DeviceBayTemplate, *http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesRetrieveExecute(r) +} + +/* +DcimDeviceBayTemplatesRetrieve Method for DcimDeviceBayTemplatesRetrieve + +Get a device bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay template. + @return ApiDcimDeviceBayTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesRetrieve(ctx context.Context, id int32) ApiDcimDeviceBayTemplatesRetrieveRequest { + return ApiDcimDeviceBayTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceBayTemplate +func (a *DcimAPIService) DcimDeviceBayTemplatesRetrieveExecute(r ApiDcimDeviceBayTemplatesRetrieveRequest) (*DeviceBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBayTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableDeviceBayTemplateRequest *WritableDeviceBayTemplateRequest +} + +func (r ApiDcimDeviceBayTemplatesUpdateRequest) WritableDeviceBayTemplateRequest(writableDeviceBayTemplateRequest WritableDeviceBayTemplateRequest) ApiDcimDeviceBayTemplatesUpdateRequest { + r.writableDeviceBayTemplateRequest = &writableDeviceBayTemplateRequest + return r +} + +func (r ApiDcimDeviceBayTemplatesUpdateRequest) Execute() (*DeviceBayTemplate, *http.Response, error) { + return r.ApiService.DcimDeviceBayTemplatesUpdateExecute(r) +} + +/* +DcimDeviceBayTemplatesUpdate Method for DcimDeviceBayTemplatesUpdate + +Put a device bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay template. + @return ApiDcimDeviceBayTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBayTemplatesUpdate(ctx context.Context, id int32) ApiDcimDeviceBayTemplatesUpdateRequest { + return ApiDcimDeviceBayTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceBayTemplate +func (a *DcimAPIService) DcimDeviceBayTemplatesUpdateExecute(r ApiDcimDeviceBayTemplatesUpdateRequest) (*DeviceBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBayTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceBayRequest *[]DeviceBayRequest +} + +func (r ApiDcimDeviceBaysBulkDestroyRequest) DeviceBayRequest(deviceBayRequest []DeviceBayRequest) ApiDcimDeviceBaysBulkDestroyRequest { + r.deviceBayRequest = &deviceBayRequest + return r +} + +func (r ApiDcimDeviceBaysBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceBaysBulkDestroyExecute(r) +} + +/* +DcimDeviceBaysBulkDestroy Method for DcimDeviceBaysBulkDestroy + +Delete a list of device bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBaysBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysBulkDestroy(ctx context.Context) ApiDcimDeviceBaysBulkDestroyRequest { + return ApiDcimDeviceBaysBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceBaysBulkDestroyExecute(r ApiDcimDeviceBaysBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceBayRequest == nil { + return nil, reportError("deviceBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceBayRequest *[]DeviceBayRequest +} + +func (r ApiDcimDeviceBaysBulkPartialUpdateRequest) DeviceBayRequest(deviceBayRequest []DeviceBayRequest) ApiDcimDeviceBaysBulkPartialUpdateRequest { + r.deviceBayRequest = &deviceBayRequest + return r +} + +func (r ApiDcimDeviceBaysBulkPartialUpdateRequest) Execute() ([]DeviceBay, *http.Response, error) { + return r.ApiService.DcimDeviceBaysBulkPartialUpdateExecute(r) +} + +/* +DcimDeviceBaysBulkPartialUpdate Method for DcimDeviceBaysBulkPartialUpdate + +Patch a list of device bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBaysBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysBulkPartialUpdate(ctx context.Context) ApiDcimDeviceBaysBulkPartialUpdateRequest { + return ApiDcimDeviceBaysBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceBay +func (a *DcimAPIService) DcimDeviceBaysBulkPartialUpdateExecute(r ApiDcimDeviceBaysBulkPartialUpdateRequest) ([]DeviceBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceBayRequest == nil { + return localVarReturnValue, nil, reportError("deviceBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceBayRequest *[]DeviceBayRequest +} + +func (r ApiDcimDeviceBaysBulkUpdateRequest) DeviceBayRequest(deviceBayRequest []DeviceBayRequest) ApiDcimDeviceBaysBulkUpdateRequest { + r.deviceBayRequest = &deviceBayRequest + return r +} + +func (r ApiDcimDeviceBaysBulkUpdateRequest) Execute() ([]DeviceBay, *http.Response, error) { + return r.ApiService.DcimDeviceBaysBulkUpdateExecute(r) +} + +/* +DcimDeviceBaysBulkUpdate Method for DcimDeviceBaysBulkUpdate + +Put a list of device bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBaysBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysBulkUpdate(ctx context.Context) ApiDcimDeviceBaysBulkUpdateRequest { + return ApiDcimDeviceBaysBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceBay +func (a *DcimAPIService) DcimDeviceBaysBulkUpdateExecute(r ApiDcimDeviceBaysBulkUpdateRequest) ([]DeviceBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceBayRequest == nil { + return localVarReturnValue, nil, reportError("deviceBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableDeviceBayRequest *WritableDeviceBayRequest +} + +func (r ApiDcimDeviceBaysCreateRequest) WritableDeviceBayRequest(writableDeviceBayRequest WritableDeviceBayRequest) ApiDcimDeviceBaysCreateRequest { + r.writableDeviceBayRequest = &writableDeviceBayRequest + return r +} + +func (r ApiDcimDeviceBaysCreateRequest) Execute() (*DeviceBay, *http.Response, error) { + return r.ApiService.DcimDeviceBaysCreateExecute(r) +} + +/* +DcimDeviceBaysCreate Method for DcimDeviceBaysCreate + +Post a list of device bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBaysCreateRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysCreate(ctx context.Context) ApiDcimDeviceBaysCreateRequest { + return ApiDcimDeviceBaysCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceBay +func (a *DcimAPIService) DcimDeviceBaysCreateExecute(r ApiDcimDeviceBaysCreateRequest) (*DeviceBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceBayRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceBaysDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceBaysDestroyExecute(r) +} + +/* +DcimDeviceBaysDestroy Method for DcimDeviceBaysDestroy + +Delete a device bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay. + @return ApiDcimDeviceBaysDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysDestroy(ctx context.Context, id int32) ApiDcimDeviceBaysDestroyRequest { + return ApiDcimDeviceBaysDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceBaysDestroyExecute(r ApiDcimDeviceBaysDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimDeviceBaysListRequest) Created(created []time.Time) ApiDcimDeviceBaysListRequest { + r.created = &created + return r +} + +func (r ApiDcimDeviceBaysListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimDeviceBaysListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimDeviceBaysListRequest) CreatedGt(createdGt []time.Time) ApiDcimDeviceBaysListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimDeviceBaysListRequest) CreatedGte(createdGte []time.Time) ApiDcimDeviceBaysListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimDeviceBaysListRequest) CreatedLt(createdLt []time.Time) ApiDcimDeviceBaysListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimDeviceBaysListRequest) CreatedLte(createdLte []time.Time) ApiDcimDeviceBaysListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimDeviceBaysListRequest) CreatedN(createdN []time.Time) ApiDcimDeviceBaysListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimDeviceBaysListRequest) CreatedByRequest(createdByRequest string) ApiDcimDeviceBaysListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimDeviceBaysListRequest) Description(description []string) ApiDcimDeviceBaysListRequest { + r.description = &description + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimDeviceBaysListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionIc(descriptionIc []string) ApiDcimDeviceBaysListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionIe(descriptionIe []string) ApiDcimDeviceBaysListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionIew(descriptionIew []string) ApiDcimDeviceBaysListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimDeviceBaysListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionN(descriptionN []string) ApiDcimDeviceBaysListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionNic(descriptionNic []string) ApiDcimDeviceBaysListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionNie(descriptionNie []string) ApiDcimDeviceBaysListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimDeviceBaysListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimDeviceBaysListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimDeviceBaysListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimDeviceBaysListRequest) Device(device []*string) ApiDcimDeviceBaysListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimDeviceBaysListRequest) DeviceN(deviceN []*string) ApiDcimDeviceBaysListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimDeviceBaysListRequest) DeviceId(deviceId []int32) ApiDcimDeviceBaysListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimDeviceBaysListRequest) DeviceIdN(deviceIdN []int32) ApiDcimDeviceBaysListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimDeviceBaysListRequest) DeviceRole(deviceRole []string) ApiDcimDeviceBaysListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimDeviceBaysListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimDeviceBaysListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimDeviceBaysListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimDeviceBaysListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimDeviceBaysListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimDeviceBaysListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimDeviceBaysListRequest) DeviceType(deviceType []string) ApiDcimDeviceBaysListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimDeviceBaysListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimDeviceBaysListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimDeviceBaysListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimDeviceBaysListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimDeviceBaysListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimDeviceBaysListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimDeviceBaysListRequest) Id(id []int32) ApiDcimDeviceBaysListRequest { + r.id = &id + return r +} + +func (r ApiDcimDeviceBaysListRequest) IdEmpty(idEmpty bool) ApiDcimDeviceBaysListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimDeviceBaysListRequest) IdGt(idGt []int32) ApiDcimDeviceBaysListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimDeviceBaysListRequest) IdGte(idGte []int32) ApiDcimDeviceBaysListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimDeviceBaysListRequest) IdLt(idLt []int32) ApiDcimDeviceBaysListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimDeviceBaysListRequest) IdLte(idLte []int32) ApiDcimDeviceBaysListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimDeviceBaysListRequest) IdN(idN []int32) ApiDcimDeviceBaysListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimDeviceBaysListRequest) Label(label []string) ApiDcimDeviceBaysListRequest { + r.label = &label + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelEmpty(labelEmpty bool) ApiDcimDeviceBaysListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelIc(labelIc []string) ApiDcimDeviceBaysListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelIe(labelIe []string) ApiDcimDeviceBaysListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelIew(labelIew []string) ApiDcimDeviceBaysListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelIsw(labelIsw []string) ApiDcimDeviceBaysListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelN(labelN []string) ApiDcimDeviceBaysListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelNic(labelNic []string) ApiDcimDeviceBaysListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelNie(labelNie []string) ApiDcimDeviceBaysListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelNiew(labelNiew []string) ApiDcimDeviceBaysListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimDeviceBaysListRequest) LabelNisw(labelNisw []string) ApiDcimDeviceBaysListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimDeviceBaysListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimDeviceBaysListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimDeviceBaysListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimDeviceBaysListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimDeviceBaysListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimDeviceBaysListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimDeviceBaysListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimDeviceBaysListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimDeviceBaysListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimDeviceBaysListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimDeviceBaysListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimDeviceBaysListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimDeviceBaysListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimDeviceBaysListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimDeviceBaysListRequest) Limit(limit int32) ApiDcimDeviceBaysListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimDeviceBaysListRequest) Location(location []string) ApiDcimDeviceBaysListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimDeviceBaysListRequest) LocationN(locationN []string) ApiDcimDeviceBaysListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimDeviceBaysListRequest) LocationId(locationId []int32) ApiDcimDeviceBaysListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimDeviceBaysListRequest) LocationIdN(locationIdN []int32) ApiDcimDeviceBaysListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimDeviceBaysListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimDeviceBaysListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimDeviceBaysListRequest) Name(name []string) ApiDcimDeviceBaysListRequest { + r.name = &name + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameEmpty(nameEmpty bool) ApiDcimDeviceBaysListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameIc(nameIc []string) ApiDcimDeviceBaysListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameIe(nameIe []string) ApiDcimDeviceBaysListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameIew(nameIew []string) ApiDcimDeviceBaysListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameIsw(nameIsw []string) ApiDcimDeviceBaysListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameN(nameN []string) ApiDcimDeviceBaysListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameNic(nameNic []string) ApiDcimDeviceBaysListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameNie(nameNie []string) ApiDcimDeviceBaysListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameNiew(nameNiew []string) ApiDcimDeviceBaysListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimDeviceBaysListRequest) NameNisw(nameNisw []string) ApiDcimDeviceBaysListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimDeviceBaysListRequest) Offset(offset int32) ApiDcimDeviceBaysListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimDeviceBaysListRequest) Ordering(ordering string) ApiDcimDeviceBaysListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimDeviceBaysListRequest) Q(q string) ApiDcimDeviceBaysListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimDeviceBaysListRequest) Rack(rack []string) ApiDcimDeviceBaysListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimDeviceBaysListRequest) RackN(rackN []string) ApiDcimDeviceBaysListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimDeviceBaysListRequest) RackId(rackId []int32) ApiDcimDeviceBaysListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimDeviceBaysListRequest) RackIdN(rackIdN []int32) ApiDcimDeviceBaysListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimDeviceBaysListRequest) Region(region []int32) ApiDcimDeviceBaysListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimDeviceBaysListRequest) RegionN(regionN []int32) ApiDcimDeviceBaysListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimDeviceBaysListRequest) RegionId(regionId []int32) ApiDcimDeviceBaysListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimDeviceBaysListRequest) RegionIdN(regionIdN []int32) ApiDcimDeviceBaysListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimDeviceBaysListRequest) Role(role []string) ApiDcimDeviceBaysListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimDeviceBaysListRequest) RoleN(roleN []string) ApiDcimDeviceBaysListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimDeviceBaysListRequest) RoleId(roleId []int32) ApiDcimDeviceBaysListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimDeviceBaysListRequest) RoleIdN(roleIdN []int32) ApiDcimDeviceBaysListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimDeviceBaysListRequest) Site(site []string) ApiDcimDeviceBaysListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimDeviceBaysListRequest) SiteN(siteN []string) ApiDcimDeviceBaysListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimDeviceBaysListRequest) SiteGroup(siteGroup []int32) ApiDcimDeviceBaysListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimDeviceBaysListRequest) SiteGroupN(siteGroupN []int32) ApiDcimDeviceBaysListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimDeviceBaysListRequest) SiteGroupId(siteGroupId []int32) ApiDcimDeviceBaysListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimDeviceBaysListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimDeviceBaysListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimDeviceBaysListRequest) SiteId(siteId []int32) ApiDcimDeviceBaysListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimDeviceBaysListRequest) SiteIdN(siteIdN []int32) ApiDcimDeviceBaysListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimDeviceBaysListRequest) Tag(tag []string) ApiDcimDeviceBaysListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimDeviceBaysListRequest) TagN(tagN []string) ApiDcimDeviceBaysListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimDeviceBaysListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimDeviceBaysListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimDeviceBaysListRequest) VirtualChassis(virtualChassis []string) ApiDcimDeviceBaysListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimDeviceBaysListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimDeviceBaysListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimDeviceBaysListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimDeviceBaysListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimDeviceBaysListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimDeviceBaysListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimDeviceBaysListRequest) Execute() (*PaginatedDeviceBayList, *http.Response, error) { + return r.ApiService.DcimDeviceBaysListExecute(r) +} + +/* +DcimDeviceBaysList Method for DcimDeviceBaysList + +Get a list of device bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceBaysListRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysList(ctx context.Context) ApiDcimDeviceBaysListRequest { + return ApiDcimDeviceBaysListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDeviceBayList +func (a *DcimAPIService) DcimDeviceBaysListExecute(r ApiDcimDeviceBaysListRequest) (*PaginatedDeviceBayList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDeviceBayList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableDeviceBayRequest *PatchedWritableDeviceBayRequest +} + +func (r ApiDcimDeviceBaysPartialUpdateRequest) PatchedWritableDeviceBayRequest(patchedWritableDeviceBayRequest PatchedWritableDeviceBayRequest) ApiDcimDeviceBaysPartialUpdateRequest { + r.patchedWritableDeviceBayRequest = &patchedWritableDeviceBayRequest + return r +} + +func (r ApiDcimDeviceBaysPartialUpdateRequest) Execute() (*DeviceBay, *http.Response, error) { + return r.ApiService.DcimDeviceBaysPartialUpdateExecute(r) +} + +/* +DcimDeviceBaysPartialUpdate Method for DcimDeviceBaysPartialUpdate + +Patch a device bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay. + @return ApiDcimDeviceBaysPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysPartialUpdate(ctx context.Context, id int32) ApiDcimDeviceBaysPartialUpdateRequest { + return ApiDcimDeviceBaysPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceBay +func (a *DcimAPIService) DcimDeviceBaysPartialUpdateExecute(r ApiDcimDeviceBaysPartialUpdateRequest) (*DeviceBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableDeviceBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceBaysRetrieveRequest) Execute() (*DeviceBay, *http.Response, error) { + return r.ApiService.DcimDeviceBaysRetrieveExecute(r) +} + +/* +DcimDeviceBaysRetrieve Method for DcimDeviceBaysRetrieve + +Get a device bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay. + @return ApiDcimDeviceBaysRetrieveRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysRetrieve(ctx context.Context, id int32) ApiDcimDeviceBaysRetrieveRequest { + return ApiDcimDeviceBaysRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceBay +func (a *DcimAPIService) DcimDeviceBaysRetrieveExecute(r ApiDcimDeviceBaysRetrieveRequest) (*DeviceBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceBaysUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableDeviceBayRequest *WritableDeviceBayRequest +} + +func (r ApiDcimDeviceBaysUpdateRequest) WritableDeviceBayRequest(writableDeviceBayRequest WritableDeviceBayRequest) ApiDcimDeviceBaysUpdateRequest { + r.writableDeviceBayRequest = &writableDeviceBayRequest + return r +} + +func (r ApiDcimDeviceBaysUpdateRequest) Execute() (*DeviceBay, *http.Response, error) { + return r.ApiService.DcimDeviceBaysUpdateExecute(r) +} + +/* +DcimDeviceBaysUpdate Method for DcimDeviceBaysUpdate + +Put a device bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device bay. + @return ApiDcimDeviceBaysUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceBaysUpdate(ctx context.Context, id int32) ApiDcimDeviceBaysUpdateRequest { + return ApiDcimDeviceBaysUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceBay +func (a *DcimAPIService) DcimDeviceBaysUpdateExecute(r ApiDcimDeviceBaysUpdateRequest) (*DeviceBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceBaysUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceBayRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceRoleRequest *[]DeviceRoleRequest +} + +func (r ApiDcimDeviceRolesBulkDestroyRequest) DeviceRoleRequest(deviceRoleRequest []DeviceRoleRequest) ApiDcimDeviceRolesBulkDestroyRequest { + r.deviceRoleRequest = &deviceRoleRequest + return r +} + +func (r ApiDcimDeviceRolesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceRolesBulkDestroyExecute(r) +} + +/* +DcimDeviceRolesBulkDestroy Method for DcimDeviceRolesBulkDestroy + +Delete a list of device role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceRolesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesBulkDestroy(ctx context.Context) ApiDcimDeviceRolesBulkDestroyRequest { + return ApiDcimDeviceRolesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceRolesBulkDestroyExecute(r ApiDcimDeviceRolesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceRoleRequest == nil { + return nil, reportError("deviceRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceRoleRequest *[]DeviceRoleRequest +} + +func (r ApiDcimDeviceRolesBulkPartialUpdateRequest) DeviceRoleRequest(deviceRoleRequest []DeviceRoleRequest) ApiDcimDeviceRolesBulkPartialUpdateRequest { + r.deviceRoleRequest = &deviceRoleRequest + return r +} + +func (r ApiDcimDeviceRolesBulkPartialUpdateRequest) Execute() ([]DeviceRole, *http.Response, error) { + return r.ApiService.DcimDeviceRolesBulkPartialUpdateExecute(r) +} + +/* +DcimDeviceRolesBulkPartialUpdate Method for DcimDeviceRolesBulkPartialUpdate + +Patch a list of device role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceRolesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesBulkPartialUpdate(ctx context.Context) ApiDcimDeviceRolesBulkPartialUpdateRequest { + return ApiDcimDeviceRolesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceRole +func (a *DcimAPIService) DcimDeviceRolesBulkPartialUpdateExecute(r ApiDcimDeviceRolesBulkPartialUpdateRequest) ([]DeviceRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceRoleRequest == nil { + return localVarReturnValue, nil, reportError("deviceRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceRoleRequest *[]DeviceRoleRequest +} + +func (r ApiDcimDeviceRolesBulkUpdateRequest) DeviceRoleRequest(deviceRoleRequest []DeviceRoleRequest) ApiDcimDeviceRolesBulkUpdateRequest { + r.deviceRoleRequest = &deviceRoleRequest + return r +} + +func (r ApiDcimDeviceRolesBulkUpdateRequest) Execute() ([]DeviceRole, *http.Response, error) { + return r.ApiService.DcimDeviceRolesBulkUpdateExecute(r) +} + +/* +DcimDeviceRolesBulkUpdate Method for DcimDeviceRolesBulkUpdate + +Put a list of device role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceRolesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesBulkUpdate(ctx context.Context) ApiDcimDeviceRolesBulkUpdateRequest { + return ApiDcimDeviceRolesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceRole +func (a *DcimAPIService) DcimDeviceRolesBulkUpdateExecute(r ApiDcimDeviceRolesBulkUpdateRequest) ([]DeviceRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceRoleRequest == nil { + return localVarReturnValue, nil, reportError("deviceRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableDeviceRoleRequest *WritableDeviceRoleRequest +} + +func (r ApiDcimDeviceRolesCreateRequest) WritableDeviceRoleRequest(writableDeviceRoleRequest WritableDeviceRoleRequest) ApiDcimDeviceRolesCreateRequest { + r.writableDeviceRoleRequest = &writableDeviceRoleRequest + return r +} + +func (r ApiDcimDeviceRolesCreateRequest) Execute() (*DeviceRole, *http.Response, error) { + return r.ApiService.DcimDeviceRolesCreateExecute(r) +} + +/* +DcimDeviceRolesCreate Method for DcimDeviceRolesCreate + +Post a list of device role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceRolesCreateRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesCreate(ctx context.Context) ApiDcimDeviceRolesCreateRequest { + return ApiDcimDeviceRolesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceRole +func (a *DcimAPIService) DcimDeviceRolesCreateExecute(r ApiDcimDeviceRolesCreateRequest) (*DeviceRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceRoleRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceRolesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceRolesDestroyExecute(r) +} + +/* +DcimDeviceRolesDestroy Method for DcimDeviceRolesDestroy + +Delete a device role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device role. + @return ApiDcimDeviceRolesDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesDestroy(ctx context.Context, id int32) ApiDcimDeviceRolesDestroyRequest { + return ApiDcimDeviceRolesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceRolesDestroyExecute(r ApiDcimDeviceRolesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + configTemplateId *[]*int32 + configTemplateIdN *[]*int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string + vmRole *bool +} + +func (r ApiDcimDeviceRolesListRequest) Color(color []string) ApiDcimDeviceRolesListRequest { + r.color = &color + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorEmpty(colorEmpty bool) ApiDcimDeviceRolesListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorIc(colorIc []string) ApiDcimDeviceRolesListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorIe(colorIe []string) ApiDcimDeviceRolesListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorIew(colorIew []string) ApiDcimDeviceRolesListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorIsw(colorIsw []string) ApiDcimDeviceRolesListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorN(colorN []string) ApiDcimDeviceRolesListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorNic(colorNic []string) ApiDcimDeviceRolesListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorNie(colorNie []string) ApiDcimDeviceRolesListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorNiew(colorNiew []string) ApiDcimDeviceRolesListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiDcimDeviceRolesListRequest) ColorNisw(colorNisw []string) ApiDcimDeviceRolesListRequest { + r.colorNisw = &colorNisw + return r +} + +// Config template (ID) +func (r ApiDcimDeviceRolesListRequest) ConfigTemplateId(configTemplateId []*int32) ApiDcimDeviceRolesListRequest { + r.configTemplateId = &configTemplateId + return r +} + +// Config template (ID) +func (r ApiDcimDeviceRolesListRequest) ConfigTemplateIdN(configTemplateIdN []*int32) ApiDcimDeviceRolesListRequest { + r.configTemplateIdN = &configTemplateIdN + return r +} + +func (r ApiDcimDeviceRolesListRequest) Created(created []time.Time) ApiDcimDeviceRolesListRequest { + r.created = &created + return r +} + +func (r ApiDcimDeviceRolesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimDeviceRolesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimDeviceRolesListRequest) CreatedGt(createdGt []time.Time) ApiDcimDeviceRolesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimDeviceRolesListRequest) CreatedGte(createdGte []time.Time) ApiDcimDeviceRolesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimDeviceRolesListRequest) CreatedLt(createdLt []time.Time) ApiDcimDeviceRolesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimDeviceRolesListRequest) CreatedLte(createdLte []time.Time) ApiDcimDeviceRolesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimDeviceRolesListRequest) CreatedN(createdN []time.Time) ApiDcimDeviceRolesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimDeviceRolesListRequest) CreatedByRequest(createdByRequest string) ApiDcimDeviceRolesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimDeviceRolesListRequest) Description(description []string) ApiDcimDeviceRolesListRequest { + r.description = &description + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimDeviceRolesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionIc(descriptionIc []string) ApiDcimDeviceRolesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionIe(descriptionIe []string) ApiDcimDeviceRolesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionIew(descriptionIew []string) ApiDcimDeviceRolesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimDeviceRolesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionN(descriptionN []string) ApiDcimDeviceRolesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionNic(descriptionNic []string) ApiDcimDeviceRolesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionNie(descriptionNie []string) ApiDcimDeviceRolesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimDeviceRolesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimDeviceRolesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimDeviceRolesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimDeviceRolesListRequest) Id(id []int32) ApiDcimDeviceRolesListRequest { + r.id = &id + return r +} + +func (r ApiDcimDeviceRolesListRequest) IdEmpty(idEmpty bool) ApiDcimDeviceRolesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimDeviceRolesListRequest) IdGt(idGt []int32) ApiDcimDeviceRolesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimDeviceRolesListRequest) IdGte(idGte []int32) ApiDcimDeviceRolesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimDeviceRolesListRequest) IdLt(idLt []int32) ApiDcimDeviceRolesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimDeviceRolesListRequest) IdLte(idLte []int32) ApiDcimDeviceRolesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimDeviceRolesListRequest) IdN(idN []int32) ApiDcimDeviceRolesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimDeviceRolesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimDeviceRolesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimDeviceRolesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimDeviceRolesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimDeviceRolesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimDeviceRolesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimDeviceRolesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimDeviceRolesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimDeviceRolesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimDeviceRolesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimDeviceRolesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimDeviceRolesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimDeviceRolesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimDeviceRolesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimDeviceRolesListRequest) Limit(limit int32) ApiDcimDeviceRolesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimDeviceRolesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimDeviceRolesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimDeviceRolesListRequest) Name(name []string) ApiDcimDeviceRolesListRequest { + r.name = &name + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameEmpty(nameEmpty bool) ApiDcimDeviceRolesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameIc(nameIc []string) ApiDcimDeviceRolesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameIe(nameIe []string) ApiDcimDeviceRolesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameIew(nameIew []string) ApiDcimDeviceRolesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameIsw(nameIsw []string) ApiDcimDeviceRolesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameN(nameN []string) ApiDcimDeviceRolesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameNic(nameNic []string) ApiDcimDeviceRolesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameNie(nameNie []string) ApiDcimDeviceRolesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameNiew(nameNiew []string) ApiDcimDeviceRolesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimDeviceRolesListRequest) NameNisw(nameNisw []string) ApiDcimDeviceRolesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimDeviceRolesListRequest) Offset(offset int32) ApiDcimDeviceRolesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimDeviceRolesListRequest) Ordering(ordering string) ApiDcimDeviceRolesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimDeviceRolesListRequest) Q(q string) ApiDcimDeviceRolesListRequest { + r.q = &q + return r +} + +func (r ApiDcimDeviceRolesListRequest) Slug(slug []string) ApiDcimDeviceRolesListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugEmpty(slugEmpty bool) ApiDcimDeviceRolesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugIc(slugIc []string) ApiDcimDeviceRolesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugIe(slugIe []string) ApiDcimDeviceRolesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugIew(slugIew []string) ApiDcimDeviceRolesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugIsw(slugIsw []string) ApiDcimDeviceRolesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugN(slugN []string) ApiDcimDeviceRolesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugNic(slugNic []string) ApiDcimDeviceRolesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugNie(slugNie []string) ApiDcimDeviceRolesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugNiew(slugNiew []string) ApiDcimDeviceRolesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimDeviceRolesListRequest) SlugNisw(slugNisw []string) ApiDcimDeviceRolesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimDeviceRolesListRequest) Tag(tag []string) ApiDcimDeviceRolesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimDeviceRolesListRequest) TagN(tagN []string) ApiDcimDeviceRolesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimDeviceRolesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimDeviceRolesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimDeviceRolesListRequest) VmRole(vmRole bool) ApiDcimDeviceRolesListRequest { + r.vmRole = &vmRole + return r +} + +func (r ApiDcimDeviceRolesListRequest) Execute() (*PaginatedDeviceRoleList, *http.Response, error) { + return r.ApiService.DcimDeviceRolesListExecute(r) +} + +/* +DcimDeviceRolesList Method for DcimDeviceRolesList + +Get a list of device role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceRolesListRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesList(ctx context.Context) ApiDcimDeviceRolesListRequest { + return ApiDcimDeviceRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDeviceRoleList +func (a *DcimAPIService) DcimDeviceRolesListExecute(r ApiDcimDeviceRolesListRequest) (*PaginatedDeviceRoleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDeviceRoleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.configTemplateId != nil { + t := *r.configTemplateId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", t, "multi") + } + } + if r.configTemplateIdN != nil { + t := *r.configTemplateIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vmRole != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vm_role", r.vmRole, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableDeviceRoleRequest *PatchedWritableDeviceRoleRequest +} + +func (r ApiDcimDeviceRolesPartialUpdateRequest) PatchedWritableDeviceRoleRequest(patchedWritableDeviceRoleRequest PatchedWritableDeviceRoleRequest) ApiDcimDeviceRolesPartialUpdateRequest { + r.patchedWritableDeviceRoleRequest = &patchedWritableDeviceRoleRequest + return r +} + +func (r ApiDcimDeviceRolesPartialUpdateRequest) Execute() (*DeviceRole, *http.Response, error) { + return r.ApiService.DcimDeviceRolesPartialUpdateExecute(r) +} + +/* +DcimDeviceRolesPartialUpdate Method for DcimDeviceRolesPartialUpdate + +Patch a device role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device role. + @return ApiDcimDeviceRolesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesPartialUpdate(ctx context.Context, id int32) ApiDcimDeviceRolesPartialUpdateRequest { + return ApiDcimDeviceRolesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceRole +func (a *DcimAPIService) DcimDeviceRolesPartialUpdateExecute(r ApiDcimDeviceRolesPartialUpdateRequest) (*DeviceRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableDeviceRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceRolesRetrieveRequest) Execute() (*DeviceRole, *http.Response, error) { + return r.ApiService.DcimDeviceRolesRetrieveExecute(r) +} + +/* +DcimDeviceRolesRetrieve Method for DcimDeviceRolesRetrieve + +Get a device role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device role. + @return ApiDcimDeviceRolesRetrieveRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesRetrieve(ctx context.Context, id int32) ApiDcimDeviceRolesRetrieveRequest { + return ApiDcimDeviceRolesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceRole +func (a *DcimAPIService) DcimDeviceRolesRetrieveExecute(r ApiDcimDeviceRolesRetrieveRequest) (*DeviceRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceRolesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableDeviceRoleRequest *WritableDeviceRoleRequest +} + +func (r ApiDcimDeviceRolesUpdateRequest) WritableDeviceRoleRequest(writableDeviceRoleRequest WritableDeviceRoleRequest) ApiDcimDeviceRolesUpdateRequest { + r.writableDeviceRoleRequest = &writableDeviceRoleRequest + return r +} + +func (r ApiDcimDeviceRolesUpdateRequest) Execute() (*DeviceRole, *http.Response, error) { + return r.ApiService.DcimDeviceRolesUpdateExecute(r) +} + +/* +DcimDeviceRolesUpdate Method for DcimDeviceRolesUpdate + +Put a device role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device role. + @return ApiDcimDeviceRolesUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceRolesUpdate(ctx context.Context, id int32) ApiDcimDeviceRolesUpdateRequest { + return ApiDcimDeviceRolesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceRole +func (a *DcimAPIService) DcimDeviceRolesUpdateExecute(r ApiDcimDeviceRolesUpdateRequest) (*DeviceRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceRolesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceRoleRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceTypeRequest *[]DeviceTypeRequest +} + +func (r ApiDcimDeviceTypesBulkDestroyRequest) DeviceTypeRequest(deviceTypeRequest []DeviceTypeRequest) ApiDcimDeviceTypesBulkDestroyRequest { + r.deviceTypeRequest = &deviceTypeRequest + return r +} + +func (r ApiDcimDeviceTypesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceTypesBulkDestroyExecute(r) +} + +/* +DcimDeviceTypesBulkDestroy Method for DcimDeviceTypesBulkDestroy + +Delete a list of device type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceTypesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesBulkDestroy(ctx context.Context) ApiDcimDeviceTypesBulkDestroyRequest { + return ApiDcimDeviceTypesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceTypesBulkDestroyExecute(r ApiDcimDeviceTypesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceTypeRequest == nil { + return nil, reportError("deviceTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceTypeRequest *[]DeviceTypeRequest +} + +func (r ApiDcimDeviceTypesBulkPartialUpdateRequest) DeviceTypeRequest(deviceTypeRequest []DeviceTypeRequest) ApiDcimDeviceTypesBulkPartialUpdateRequest { + r.deviceTypeRequest = &deviceTypeRequest + return r +} + +func (r ApiDcimDeviceTypesBulkPartialUpdateRequest) Execute() ([]DeviceType, *http.Response, error) { + return r.ApiService.DcimDeviceTypesBulkPartialUpdateExecute(r) +} + +/* +DcimDeviceTypesBulkPartialUpdate Method for DcimDeviceTypesBulkPartialUpdate + +Patch a list of device type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceTypesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesBulkPartialUpdate(ctx context.Context) ApiDcimDeviceTypesBulkPartialUpdateRequest { + return ApiDcimDeviceTypesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceType +func (a *DcimAPIService) DcimDeviceTypesBulkPartialUpdateExecute(r ApiDcimDeviceTypesBulkPartialUpdateRequest) ([]DeviceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceTypeRequest == nil { + return localVarReturnValue, nil, reportError("deviceTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceTypeRequest *[]DeviceTypeRequest +} + +func (r ApiDcimDeviceTypesBulkUpdateRequest) DeviceTypeRequest(deviceTypeRequest []DeviceTypeRequest) ApiDcimDeviceTypesBulkUpdateRequest { + r.deviceTypeRequest = &deviceTypeRequest + return r +} + +func (r ApiDcimDeviceTypesBulkUpdateRequest) Execute() ([]DeviceType, *http.Response, error) { + return r.ApiService.DcimDeviceTypesBulkUpdateExecute(r) +} + +/* +DcimDeviceTypesBulkUpdate Method for DcimDeviceTypesBulkUpdate + +Put a list of device type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceTypesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesBulkUpdate(ctx context.Context) ApiDcimDeviceTypesBulkUpdateRequest { + return ApiDcimDeviceTypesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceType +func (a *DcimAPIService) DcimDeviceTypesBulkUpdateExecute(r ApiDcimDeviceTypesBulkUpdateRequest) ([]DeviceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceTypeRequest == nil { + return localVarReturnValue, nil, reportError("deviceTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableDeviceTypeRequest *WritableDeviceTypeRequest +} + +func (r ApiDcimDeviceTypesCreateRequest) WritableDeviceTypeRequest(writableDeviceTypeRequest WritableDeviceTypeRequest) ApiDcimDeviceTypesCreateRequest { + r.writableDeviceTypeRequest = &writableDeviceTypeRequest + return r +} + +func (r ApiDcimDeviceTypesCreateRequest) Execute() (*DeviceType, *http.Response, error) { + return r.ApiService.DcimDeviceTypesCreateExecute(r) +} + +/* +DcimDeviceTypesCreate Method for DcimDeviceTypesCreate + +Post a list of device type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceTypesCreateRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesCreate(ctx context.Context) ApiDcimDeviceTypesCreateRequest { + return ApiDcimDeviceTypesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceType +func (a *DcimAPIService) DcimDeviceTypesCreateExecute(r ApiDcimDeviceTypesCreateRequest) (*DeviceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceTypeRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceTypesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDeviceTypesDestroyExecute(r) +} + +/* +DcimDeviceTypesDestroy Method for DcimDeviceTypesDestroy + +Delete a device type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device type. + @return ApiDcimDeviceTypesDestroyRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesDestroy(ctx context.Context, id int32) ApiDcimDeviceTypesDestroyRequest { + return ApiDcimDeviceTypesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDeviceTypesDestroyExecute(r ApiDcimDeviceTypesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + airflow *string + airflowN *string + consolePorts *bool + consoleServerPorts *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + defaultPlatform *[]string + defaultPlatformN *[]string + defaultPlatformId *[]*int32 + defaultPlatformIdN *[]*int32 + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + deviceBays *bool + excludeFromUtilization *bool + hasFrontImage *bool + hasRearImage *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interfaces *bool + inventoryItems *bool + isFullDepth *bool + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + manufacturer *[]string + manufacturerN *[]string + manufacturerId *[]int32 + manufacturerIdN *[]int32 + model *[]string + modelEmpty *bool + modelIc *[]string + modelIe *[]string + modelIew *[]string + modelIsw *[]string + modelN *[]string + modelNic *[]string + modelNie *[]string + modelNiew *[]string + modelNisw *[]string + modifiedByRequest *string + moduleBays *bool + offset *int32 + ordering *string + partNumber *[]string + partNumberEmpty *bool + partNumberIc *[]string + partNumberIe *[]string + partNumberIew *[]string + partNumberIsw *[]string + partNumberN *[]string + partNumberNic *[]string + partNumberNie *[]string + partNumberNiew *[]string + partNumberNisw *[]string + passThroughPorts *bool + powerOutlets *bool + powerPorts *bool + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + subdeviceRole *string + subdeviceRoleN *string + tag *[]string + tagN *[]string + uHeight *[]float64 + uHeightEmpty *bool + uHeightGt *[]float64 + uHeightGte *[]float64 + uHeightLt *[]float64 + uHeightLte *[]float64 + uHeightN *[]float64 + updatedByRequest *string + weight *[]float64 + weightEmpty *bool + weightGt *[]float64 + weightGte *[]float64 + weightLt *[]float64 + weightLte *[]float64 + weightN *[]float64 + weightUnit *string + weightUnitN *string +} + +func (r ApiDcimDeviceTypesListRequest) Airflow(airflow string) ApiDcimDeviceTypesListRequest { + r.airflow = &airflow + return r +} + +func (r ApiDcimDeviceTypesListRequest) AirflowN(airflowN string) ApiDcimDeviceTypesListRequest { + r.airflowN = &airflowN + return r +} + +// Has console ports +func (r ApiDcimDeviceTypesListRequest) ConsolePorts(consolePorts bool) ApiDcimDeviceTypesListRequest { + r.consolePorts = &consolePorts + return r +} + +// Has console server ports +func (r ApiDcimDeviceTypesListRequest) ConsoleServerPorts(consoleServerPorts bool) ApiDcimDeviceTypesListRequest { + r.consoleServerPorts = &consoleServerPorts + return r +} + +func (r ApiDcimDeviceTypesListRequest) Created(created []time.Time) ApiDcimDeviceTypesListRequest { + r.created = &created + return r +} + +func (r ApiDcimDeviceTypesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimDeviceTypesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) CreatedGt(createdGt []time.Time) ApiDcimDeviceTypesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimDeviceTypesListRequest) CreatedGte(createdGte []time.Time) ApiDcimDeviceTypesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimDeviceTypesListRequest) CreatedLt(createdLt []time.Time) ApiDcimDeviceTypesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimDeviceTypesListRequest) CreatedLte(createdLte []time.Time) ApiDcimDeviceTypesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimDeviceTypesListRequest) CreatedN(createdN []time.Time) ApiDcimDeviceTypesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimDeviceTypesListRequest) CreatedByRequest(createdByRequest string) ApiDcimDeviceTypesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +// Default platform (slug) +func (r ApiDcimDeviceTypesListRequest) DefaultPlatform(defaultPlatform []string) ApiDcimDeviceTypesListRequest { + r.defaultPlatform = &defaultPlatform + return r +} + +// Default platform (slug) +func (r ApiDcimDeviceTypesListRequest) DefaultPlatformN(defaultPlatformN []string) ApiDcimDeviceTypesListRequest { + r.defaultPlatformN = &defaultPlatformN + return r +} + +// Default platform (ID) +func (r ApiDcimDeviceTypesListRequest) DefaultPlatformId(defaultPlatformId []*int32) ApiDcimDeviceTypesListRequest { + r.defaultPlatformId = &defaultPlatformId + return r +} + +// Default platform (ID) +func (r ApiDcimDeviceTypesListRequest) DefaultPlatformIdN(defaultPlatformIdN []*int32) ApiDcimDeviceTypesListRequest { + r.defaultPlatformIdN = &defaultPlatformIdN + return r +} + +func (r ApiDcimDeviceTypesListRequest) Description(description []string) ApiDcimDeviceTypesListRequest { + r.description = &description + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimDeviceTypesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionIc(descriptionIc []string) ApiDcimDeviceTypesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionIe(descriptionIe []string) ApiDcimDeviceTypesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionIew(descriptionIew []string) ApiDcimDeviceTypesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimDeviceTypesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionN(descriptionN []string) ApiDcimDeviceTypesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionNic(descriptionNic []string) ApiDcimDeviceTypesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionNie(descriptionNie []string) ApiDcimDeviceTypesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimDeviceTypesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimDeviceTypesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimDeviceTypesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Has device bays +func (r ApiDcimDeviceTypesListRequest) DeviceBays(deviceBays bool) ApiDcimDeviceTypesListRequest { + r.deviceBays = &deviceBays + return r +} + +func (r ApiDcimDeviceTypesListRequest) ExcludeFromUtilization(excludeFromUtilization bool) ApiDcimDeviceTypesListRequest { + r.excludeFromUtilization = &excludeFromUtilization + return r +} + +// Has a front image +func (r ApiDcimDeviceTypesListRequest) HasFrontImage(hasFrontImage bool) ApiDcimDeviceTypesListRequest { + r.hasFrontImage = &hasFrontImage + return r +} + +// Has a rear image +func (r ApiDcimDeviceTypesListRequest) HasRearImage(hasRearImage bool) ApiDcimDeviceTypesListRequest { + r.hasRearImage = &hasRearImage + return r +} + +func (r ApiDcimDeviceTypesListRequest) Id(id []int32) ApiDcimDeviceTypesListRequest { + r.id = &id + return r +} + +func (r ApiDcimDeviceTypesListRequest) IdEmpty(idEmpty bool) ApiDcimDeviceTypesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) IdGt(idGt []int32) ApiDcimDeviceTypesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimDeviceTypesListRequest) IdGte(idGte []int32) ApiDcimDeviceTypesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimDeviceTypesListRequest) IdLt(idLt []int32) ApiDcimDeviceTypesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimDeviceTypesListRequest) IdLte(idLte []int32) ApiDcimDeviceTypesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimDeviceTypesListRequest) IdN(idN []int32) ApiDcimDeviceTypesListRequest { + r.idN = &idN + return r +} + +// Has interfaces +func (r ApiDcimDeviceTypesListRequest) Interfaces(interfaces bool) ApiDcimDeviceTypesListRequest { + r.interfaces = &interfaces + return r +} + +// Has inventory items +func (r ApiDcimDeviceTypesListRequest) InventoryItems(inventoryItems bool) ApiDcimDeviceTypesListRequest { + r.inventoryItems = &inventoryItems + return r +} + +func (r ApiDcimDeviceTypesListRequest) IsFullDepth(isFullDepth bool) ApiDcimDeviceTypesListRequest { + r.isFullDepth = &isFullDepth + return r +} + +func (r ApiDcimDeviceTypesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimDeviceTypesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimDeviceTypesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimDeviceTypesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimDeviceTypesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimDeviceTypesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimDeviceTypesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimDeviceTypesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimDeviceTypesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimDeviceTypesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimDeviceTypesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimDeviceTypesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimDeviceTypesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimDeviceTypesListRequest) Limit(limit int32) ApiDcimDeviceTypesListRequest { + r.limit = &limit + return r +} + +// Manufacturer (slug) +func (r ApiDcimDeviceTypesListRequest) Manufacturer(manufacturer []string) ApiDcimDeviceTypesListRequest { + r.manufacturer = &manufacturer + return r +} + +// Manufacturer (slug) +func (r ApiDcimDeviceTypesListRequest) ManufacturerN(manufacturerN []string) ApiDcimDeviceTypesListRequest { + r.manufacturerN = &manufacturerN + return r +} + +// Manufacturer (ID) +func (r ApiDcimDeviceTypesListRequest) ManufacturerId(manufacturerId []int32) ApiDcimDeviceTypesListRequest { + r.manufacturerId = &manufacturerId + return r +} + +// Manufacturer (ID) +func (r ApiDcimDeviceTypesListRequest) ManufacturerIdN(manufacturerIdN []int32) ApiDcimDeviceTypesListRequest { + r.manufacturerIdN = &manufacturerIdN + return r +} + +func (r ApiDcimDeviceTypesListRequest) Model(model []string) ApiDcimDeviceTypesListRequest { + r.model = &model + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelEmpty(modelEmpty bool) ApiDcimDeviceTypesListRequest { + r.modelEmpty = &modelEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelIc(modelIc []string) ApiDcimDeviceTypesListRequest { + r.modelIc = &modelIc + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelIe(modelIe []string) ApiDcimDeviceTypesListRequest { + r.modelIe = &modelIe + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelIew(modelIew []string) ApiDcimDeviceTypesListRequest { + r.modelIew = &modelIew + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelIsw(modelIsw []string) ApiDcimDeviceTypesListRequest { + r.modelIsw = &modelIsw + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelN(modelN []string) ApiDcimDeviceTypesListRequest { + r.modelN = &modelN + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelNic(modelNic []string) ApiDcimDeviceTypesListRequest { + r.modelNic = &modelNic + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelNie(modelNie []string) ApiDcimDeviceTypesListRequest { + r.modelNie = &modelNie + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelNiew(modelNiew []string) ApiDcimDeviceTypesListRequest { + r.modelNiew = &modelNiew + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModelNisw(modelNisw []string) ApiDcimDeviceTypesListRequest { + r.modelNisw = &modelNisw + return r +} + +func (r ApiDcimDeviceTypesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimDeviceTypesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Has module bays +func (r ApiDcimDeviceTypesListRequest) ModuleBays(moduleBays bool) ApiDcimDeviceTypesListRequest { + r.moduleBays = &moduleBays + return r +} + +// The initial index from which to return the results. +func (r ApiDcimDeviceTypesListRequest) Offset(offset int32) ApiDcimDeviceTypesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimDeviceTypesListRequest) Ordering(ordering string) ApiDcimDeviceTypesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumber(partNumber []string) ApiDcimDeviceTypesListRequest { + r.partNumber = &partNumber + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberEmpty(partNumberEmpty bool) ApiDcimDeviceTypesListRequest { + r.partNumberEmpty = &partNumberEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberIc(partNumberIc []string) ApiDcimDeviceTypesListRequest { + r.partNumberIc = &partNumberIc + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberIe(partNumberIe []string) ApiDcimDeviceTypesListRequest { + r.partNumberIe = &partNumberIe + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberIew(partNumberIew []string) ApiDcimDeviceTypesListRequest { + r.partNumberIew = &partNumberIew + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberIsw(partNumberIsw []string) ApiDcimDeviceTypesListRequest { + r.partNumberIsw = &partNumberIsw + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberN(partNumberN []string) ApiDcimDeviceTypesListRequest { + r.partNumberN = &partNumberN + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberNic(partNumberNic []string) ApiDcimDeviceTypesListRequest { + r.partNumberNic = &partNumberNic + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberNie(partNumberNie []string) ApiDcimDeviceTypesListRequest { + r.partNumberNie = &partNumberNie + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberNiew(partNumberNiew []string) ApiDcimDeviceTypesListRequest { + r.partNumberNiew = &partNumberNiew + return r +} + +func (r ApiDcimDeviceTypesListRequest) PartNumberNisw(partNumberNisw []string) ApiDcimDeviceTypesListRequest { + r.partNumberNisw = &partNumberNisw + return r +} + +// Has pass-through ports +func (r ApiDcimDeviceTypesListRequest) PassThroughPorts(passThroughPorts bool) ApiDcimDeviceTypesListRequest { + r.passThroughPorts = &passThroughPorts + return r +} + +// Has power outlets +func (r ApiDcimDeviceTypesListRequest) PowerOutlets(powerOutlets bool) ApiDcimDeviceTypesListRequest { + r.powerOutlets = &powerOutlets + return r +} + +// Has power ports +func (r ApiDcimDeviceTypesListRequest) PowerPorts(powerPorts bool) ApiDcimDeviceTypesListRequest { + r.powerPorts = &powerPorts + return r +} + +// Search +func (r ApiDcimDeviceTypesListRequest) Q(q string) ApiDcimDeviceTypesListRequest { + r.q = &q + return r +} + +func (r ApiDcimDeviceTypesListRequest) Slug(slug []string) ApiDcimDeviceTypesListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugEmpty(slugEmpty bool) ApiDcimDeviceTypesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugIc(slugIc []string) ApiDcimDeviceTypesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugIe(slugIe []string) ApiDcimDeviceTypesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugIew(slugIew []string) ApiDcimDeviceTypesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugIsw(slugIsw []string) ApiDcimDeviceTypesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugN(slugN []string) ApiDcimDeviceTypesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugNic(slugNic []string) ApiDcimDeviceTypesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugNie(slugNie []string) ApiDcimDeviceTypesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugNiew(slugNiew []string) ApiDcimDeviceTypesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimDeviceTypesListRequest) SlugNisw(slugNisw []string) ApiDcimDeviceTypesListRequest { + r.slugNisw = &slugNisw + return r +} + +// Parent devices house child devices in device bays. Leave blank if this device type is neither a parent nor a child. +func (r ApiDcimDeviceTypesListRequest) SubdeviceRole(subdeviceRole string) ApiDcimDeviceTypesListRequest { + r.subdeviceRole = &subdeviceRole + return r +} + +// Parent devices house child devices in device bays. Leave blank if this device type is neither a parent nor a child. +func (r ApiDcimDeviceTypesListRequest) SubdeviceRoleN(subdeviceRoleN string) ApiDcimDeviceTypesListRequest { + r.subdeviceRoleN = &subdeviceRoleN + return r +} + +func (r ApiDcimDeviceTypesListRequest) Tag(tag []string) ApiDcimDeviceTypesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimDeviceTypesListRequest) TagN(tagN []string) ApiDcimDeviceTypesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimDeviceTypesListRequest) UHeight(uHeight []float64) ApiDcimDeviceTypesListRequest { + r.uHeight = &uHeight + return r +} + +func (r ApiDcimDeviceTypesListRequest) UHeightEmpty(uHeightEmpty bool) ApiDcimDeviceTypesListRequest { + r.uHeightEmpty = &uHeightEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) UHeightGt(uHeightGt []float64) ApiDcimDeviceTypesListRequest { + r.uHeightGt = &uHeightGt + return r +} + +func (r ApiDcimDeviceTypesListRequest) UHeightGte(uHeightGte []float64) ApiDcimDeviceTypesListRequest { + r.uHeightGte = &uHeightGte + return r +} + +func (r ApiDcimDeviceTypesListRequest) UHeightLt(uHeightLt []float64) ApiDcimDeviceTypesListRequest { + r.uHeightLt = &uHeightLt + return r +} + +func (r ApiDcimDeviceTypesListRequest) UHeightLte(uHeightLte []float64) ApiDcimDeviceTypesListRequest { + r.uHeightLte = &uHeightLte + return r +} + +func (r ApiDcimDeviceTypesListRequest) UHeightN(uHeightN []float64) ApiDcimDeviceTypesListRequest { + r.uHeightN = &uHeightN + return r +} + +func (r ApiDcimDeviceTypesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimDeviceTypesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimDeviceTypesListRequest) Weight(weight []float64) ApiDcimDeviceTypesListRequest { + r.weight = &weight + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightEmpty(weightEmpty bool) ApiDcimDeviceTypesListRequest { + r.weightEmpty = &weightEmpty + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightGt(weightGt []float64) ApiDcimDeviceTypesListRequest { + r.weightGt = &weightGt + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightGte(weightGte []float64) ApiDcimDeviceTypesListRequest { + r.weightGte = &weightGte + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightLt(weightLt []float64) ApiDcimDeviceTypesListRequest { + r.weightLt = &weightLt + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightLte(weightLte []float64) ApiDcimDeviceTypesListRequest { + r.weightLte = &weightLte + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightN(weightN []float64) ApiDcimDeviceTypesListRequest { + r.weightN = &weightN + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightUnit(weightUnit string) ApiDcimDeviceTypesListRequest { + r.weightUnit = &weightUnit + return r +} + +func (r ApiDcimDeviceTypesListRequest) WeightUnitN(weightUnitN string) ApiDcimDeviceTypesListRequest { + r.weightUnitN = &weightUnitN + return r +} + +func (r ApiDcimDeviceTypesListRequest) Execute() (*PaginatedDeviceTypeList, *http.Response, error) { + return r.ApiService.DcimDeviceTypesListExecute(r) +} + +/* +DcimDeviceTypesList Method for DcimDeviceTypesList + +Get a list of device type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDeviceTypesListRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesList(ctx context.Context) ApiDcimDeviceTypesListRequest { + return ApiDcimDeviceTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDeviceTypeList +func (a *DcimAPIService) DcimDeviceTypesListExecute(r ApiDcimDeviceTypesListRequest) (*PaginatedDeviceTypeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDeviceTypeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.airflow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "airflow", r.airflow, "") + } + if r.airflowN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "airflow__n", r.airflowN, "") + } + if r.consolePorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "console_ports", r.consolePorts, "") + } + if r.consoleServerPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "console_server_ports", r.consoleServerPorts, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.defaultPlatform != nil { + t := *r.defaultPlatform + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform", t, "multi") + } + } + if r.defaultPlatformN != nil { + t := *r.defaultPlatformN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform__n", t, "multi") + } + } + if r.defaultPlatformId != nil { + t := *r.defaultPlatformId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform_id", t, "multi") + } + } + if r.defaultPlatformIdN != nil { + t := *r.defaultPlatformIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_platform_id__n", t, "multi") + } + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.deviceBays != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_bays", r.deviceBays, "") + } + if r.excludeFromUtilization != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude_from_utilization", r.excludeFromUtilization, "") + } + if r.hasFrontImage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_front_image", r.hasFrontImage, "") + } + if r.hasRearImage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_rear_image", r.hasRearImage, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interfaces != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interfaces", r.interfaces, "") + } + if r.inventoryItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "inventory_items", r.inventoryItems, "") + } + if r.isFullDepth != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_full_depth", r.isFullDepth, "") + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.manufacturer != nil { + t := *r.manufacturer + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", t, "multi") + } + } + if r.manufacturerN != nil { + t := *r.manufacturerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", t, "multi") + } + } + if r.manufacturerId != nil { + t := *r.manufacturerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", t, "multi") + } + } + if r.manufacturerIdN != nil { + t := *r.manufacturerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", t, "multi") + } + } + if r.model != nil { + t := *r.model + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", t, "multi") + } + } + if r.modelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__empty", r.modelEmpty, "") + } + if r.modelIc != nil { + t := *r.modelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ic", t, "multi") + } + } + if r.modelIe != nil { + t := *r.modelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ie", t, "multi") + } + } + if r.modelIew != nil { + t := *r.modelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__iew", t, "multi") + } + } + if r.modelIsw != nil { + t := *r.modelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__isw", t, "multi") + } + } + if r.modelN != nil { + t := *r.modelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__n", t, "multi") + } + } + if r.modelNic != nil { + t := *r.modelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nic", t, "multi") + } + } + if r.modelNie != nil { + t := *r.modelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nie", t, "multi") + } + } + if r.modelNiew != nil { + t := *r.modelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__niew", t, "multi") + } + } + if r.modelNisw != nil { + t := *r.modelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nisw", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleBays != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_bays", r.moduleBays, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.partNumber != nil { + t := *r.partNumber + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number", t, "multi") + } + } + if r.partNumberEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__empty", r.partNumberEmpty, "") + } + if r.partNumberIc != nil { + t := *r.partNumberIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ic", t, "multi") + } + } + if r.partNumberIe != nil { + t := *r.partNumberIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ie", t, "multi") + } + } + if r.partNumberIew != nil { + t := *r.partNumberIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__iew", t, "multi") + } + } + if r.partNumberIsw != nil { + t := *r.partNumberIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__isw", t, "multi") + } + } + if r.partNumberN != nil { + t := *r.partNumberN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__n", t, "multi") + } + } + if r.partNumberNic != nil { + t := *r.partNumberNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nic", t, "multi") + } + } + if r.partNumberNie != nil { + t := *r.partNumberNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nie", t, "multi") + } + } + if r.partNumberNiew != nil { + t := *r.partNumberNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__niew", t, "multi") + } + } + if r.partNumberNisw != nil { + t := *r.partNumberNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nisw", t, "multi") + } + } + if r.passThroughPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pass_through_ports", r.passThroughPorts, "") + } + if r.powerOutlets != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_outlets", r.powerOutlets, "") + } + if r.powerPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_ports", r.powerPorts, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.subdeviceRole != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "subdevice_role", r.subdeviceRole, "") + } + if r.subdeviceRoleN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "subdevice_role__n", r.subdeviceRoleN, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.uHeight != nil { + t := *r.uHeight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height", t, "multi") + } + } + if r.uHeightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__empty", r.uHeightEmpty, "") + } + if r.uHeightGt != nil { + t := *r.uHeightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gt", t, "multi") + } + } + if r.uHeightGte != nil { + t := *r.uHeightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gte", t, "multi") + } + } + if r.uHeightLt != nil { + t := *r.uHeightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lt", t, "multi") + } + } + if r.uHeightLte != nil { + t := *r.uHeightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lte", t, "multi") + } + } + if r.uHeightN != nil { + t := *r.uHeightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.weight != nil { + t := *r.weight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", t, "multi") + } + } + if r.weightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__empty", r.weightEmpty, "") + } + if r.weightGt != nil { + t := *r.weightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", t, "multi") + } + } + if r.weightGte != nil { + t := *r.weightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", t, "multi") + } + } + if r.weightLt != nil { + t := *r.weightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", t, "multi") + } + } + if r.weightLte != nil { + t := *r.weightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", t, "multi") + } + } + if r.weightN != nil { + t := *r.weightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", t, "multi") + } + } + if r.weightUnit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight_unit", r.weightUnit, "") + } + if r.weightUnitN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight_unit__n", r.weightUnitN, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableDeviceTypeRequest *PatchedWritableDeviceTypeRequest +} + +func (r ApiDcimDeviceTypesPartialUpdateRequest) PatchedWritableDeviceTypeRequest(patchedWritableDeviceTypeRequest PatchedWritableDeviceTypeRequest) ApiDcimDeviceTypesPartialUpdateRequest { + r.patchedWritableDeviceTypeRequest = &patchedWritableDeviceTypeRequest + return r +} + +func (r ApiDcimDeviceTypesPartialUpdateRequest) Execute() (*DeviceType, *http.Response, error) { + return r.ApiService.DcimDeviceTypesPartialUpdateExecute(r) +} + +/* +DcimDeviceTypesPartialUpdate Method for DcimDeviceTypesPartialUpdate + +Patch a device type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device type. + @return ApiDcimDeviceTypesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesPartialUpdate(ctx context.Context, id int32) ApiDcimDeviceTypesPartialUpdateRequest { + return ApiDcimDeviceTypesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceType +func (a *DcimAPIService) DcimDeviceTypesPartialUpdateExecute(r ApiDcimDeviceTypesPartialUpdateRequest) (*DeviceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableDeviceTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDeviceTypesRetrieveRequest) Execute() (*DeviceType, *http.Response, error) { + return r.ApiService.DcimDeviceTypesRetrieveExecute(r) +} + +/* +DcimDeviceTypesRetrieve Method for DcimDeviceTypesRetrieve + +Get a device type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device type. + @return ApiDcimDeviceTypesRetrieveRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesRetrieve(ctx context.Context, id int32) ApiDcimDeviceTypesRetrieveRequest { + return ApiDcimDeviceTypesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceType +func (a *DcimAPIService) DcimDeviceTypesRetrieveExecute(r ApiDcimDeviceTypesRetrieveRequest) (*DeviceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDeviceTypesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableDeviceTypeRequest *WritableDeviceTypeRequest +} + +func (r ApiDcimDeviceTypesUpdateRequest) WritableDeviceTypeRequest(writableDeviceTypeRequest WritableDeviceTypeRequest) ApiDcimDeviceTypesUpdateRequest { + r.writableDeviceTypeRequest = &writableDeviceTypeRequest + return r +} + +func (r ApiDcimDeviceTypesUpdateRequest) Execute() (*DeviceType, *http.Response, error) { + return r.ApiService.DcimDeviceTypesUpdateExecute(r) +} + +/* +DcimDeviceTypesUpdate Method for DcimDeviceTypesUpdate + +Put a device type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device type. + @return ApiDcimDeviceTypesUpdateRequest +*/ +func (a *DcimAPIService) DcimDeviceTypesUpdate(ctx context.Context, id int32) ApiDcimDeviceTypesUpdateRequest { + return ApiDcimDeviceTypesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceType +func (a *DcimAPIService) DcimDeviceTypesUpdateExecute(r ApiDcimDeviceTypesUpdateRequest) (*DeviceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDeviceTypesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/device-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceTypeRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceWithConfigContextRequest *[]DeviceWithConfigContextRequest +} + +func (r ApiDcimDevicesBulkDestroyRequest) DeviceWithConfigContextRequest(deviceWithConfigContextRequest []DeviceWithConfigContextRequest) ApiDcimDevicesBulkDestroyRequest { + r.deviceWithConfigContextRequest = &deviceWithConfigContextRequest + return r +} + +func (r ApiDcimDevicesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDevicesBulkDestroyExecute(r) +} + +/* +DcimDevicesBulkDestroy Method for DcimDevicesBulkDestroy + +Delete a list of device objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDevicesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimDevicesBulkDestroy(ctx context.Context) ApiDcimDevicesBulkDestroyRequest { + return ApiDcimDevicesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDevicesBulkDestroyExecute(r ApiDcimDevicesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceWithConfigContextRequest == nil { + return nil, reportError("deviceWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDevicesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceWithConfigContextRequest *[]DeviceWithConfigContextRequest +} + +func (r ApiDcimDevicesBulkPartialUpdateRequest) DeviceWithConfigContextRequest(deviceWithConfigContextRequest []DeviceWithConfigContextRequest) ApiDcimDevicesBulkPartialUpdateRequest { + r.deviceWithConfigContextRequest = &deviceWithConfigContextRequest + return r +} + +func (r ApiDcimDevicesBulkPartialUpdateRequest) Execute() ([]DeviceWithConfigContext, *http.Response, error) { + return r.ApiService.DcimDevicesBulkPartialUpdateExecute(r) +} + +/* +DcimDevicesBulkPartialUpdate Method for DcimDevicesBulkPartialUpdate + +Patch a list of device objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDevicesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDevicesBulkPartialUpdate(ctx context.Context) ApiDcimDevicesBulkPartialUpdateRequest { + return ApiDcimDevicesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceWithConfigContext +func (a *DcimAPIService) DcimDevicesBulkPartialUpdateExecute(r ApiDcimDevicesBulkPartialUpdateRequest) ([]DeviceWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("deviceWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + deviceWithConfigContextRequest *[]DeviceWithConfigContextRequest +} + +func (r ApiDcimDevicesBulkUpdateRequest) DeviceWithConfigContextRequest(deviceWithConfigContextRequest []DeviceWithConfigContextRequest) ApiDcimDevicesBulkUpdateRequest { + r.deviceWithConfigContextRequest = &deviceWithConfigContextRequest + return r +} + +func (r ApiDcimDevicesBulkUpdateRequest) Execute() ([]DeviceWithConfigContext, *http.Response, error) { + return r.ApiService.DcimDevicesBulkUpdateExecute(r) +} + +/* +DcimDevicesBulkUpdate Method for DcimDevicesBulkUpdate + +Put a list of device objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDevicesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimDevicesBulkUpdate(ctx context.Context) ApiDcimDevicesBulkUpdateRequest { + return ApiDcimDevicesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DeviceWithConfigContext +func (a *DcimAPIService) DcimDevicesBulkUpdateExecute(r ApiDcimDevicesBulkUpdateRequest) ([]DeviceWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DeviceWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("deviceWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableDeviceWithConfigContextRequest *WritableDeviceWithConfigContextRequest +} + +func (r ApiDcimDevicesCreateRequest) WritableDeviceWithConfigContextRequest(writableDeviceWithConfigContextRequest WritableDeviceWithConfigContextRequest) ApiDcimDevicesCreateRequest { + r.writableDeviceWithConfigContextRequest = &writableDeviceWithConfigContextRequest + return r +} + +func (r ApiDcimDevicesCreateRequest) Execute() (*DeviceWithConfigContext, *http.Response, error) { + return r.ApiService.DcimDevicesCreateExecute(r) +} + +/* +DcimDevicesCreate Method for DcimDevicesCreate + +Post a list of device objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDevicesCreateRequest +*/ +func (a *DcimAPIService) DcimDevicesCreate(ctx context.Context) ApiDcimDevicesCreateRequest { + return ApiDcimDevicesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceWithConfigContext +func (a *DcimAPIService) DcimDevicesCreateExecute(r ApiDcimDevicesCreateRequest) (*DeviceWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDevicesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimDevicesDestroyExecute(r) +} + +/* +DcimDevicesDestroy Method for DcimDevicesDestroy + +Delete a device object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device. + @return ApiDcimDevicesDestroyRequest +*/ +func (a *DcimAPIService) DcimDevicesDestroy(ctx context.Context, id int32) ApiDcimDevicesDestroyRequest { + return ApiDcimDevicesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimDevicesDestroyExecute(r ApiDcimDevicesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimDevicesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + airflow *string + airflowN *string + assetTag *[]string + assetTagEmpty *bool + assetTagIc *[]string + assetTagIe *[]string + assetTagIew *[]string + assetTagIsw *[]string + assetTagN *[]string + assetTagNic *[]string + assetTagNie *[]string + assetTagNiew *[]string + assetTagNisw *[]string + clusterId *[]*int32 + clusterIdN *[]*int32 + configTemplateId *[]*int32 + configTemplateIdN *[]*int32 + consolePorts *bool + consoleServerPorts *bool + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + deviceBays *bool + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + face *string + faceN *string + hasOobIp *bool + hasPrimaryIp *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interfaces *bool + isFullDepth *bool + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + latitude *[]float64 + latitudeEmpty *bool + latitudeGt *[]float64 + latitudeGte *[]float64 + latitudeLt *[]float64 + latitudeLte *[]float64 + latitudeN *[]float64 + limit *int32 + localContextData *bool + locationId *[]int32 + locationIdN *[]int32 + longitude *[]float64 + longitudeEmpty *bool + longitudeGt *[]float64 + longitudeGte *[]float64 + longitudeLt *[]float64 + longitudeLte *[]float64 + longitudeN *[]float64 + macAddress *[]string + macAddressIc *[]string + macAddressIe *[]string + macAddressIew *[]string + macAddressIsw *[]string + macAddressN *[]string + macAddressNic *[]string + macAddressNie *[]string + macAddressNiew *[]string + macAddressNisw *[]string + manufacturer *[]string + manufacturerN *[]string + manufacturerId *[]int32 + manufacturerIdN *[]int32 + model *[]string + modelN *[]string + modifiedByRequest *string + moduleBays *bool + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + oobIpId *[]int32 + oobIpIdN *[]int32 + ordering *string + parentDeviceId *[]int32 + parentDeviceIdN *[]int32 + passThroughPorts *bool + platform *[]string + platformN *[]string + platformId *[]*int32 + platformIdN *[]*int32 + position *[]float64 + positionEmpty *bool + positionGt *[]float64 + positionGte *[]float64 + positionLt *[]float64 + positionLte *[]float64 + positionN *[]float64 + powerOutlets *bool + powerPorts *bool + primaryIp4Id *[]int32 + primaryIp4IdN *[]int32 + primaryIp6Id *[]int32 + primaryIp6IdN *[]int32 + q *string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + serial *[]string + serialEmpty *bool + serialIc *[]string + serialIe *[]string + serialIew *[]string + serialIsw *[]string + serialN *[]string + serialNic *[]string + serialNie *[]string + serialNiew *[]string + serialNisw *[]string + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + vcPosition *[]int32 + vcPositionEmpty *bool + vcPositionGt *[]int32 + vcPositionGte *[]int32 + vcPositionLt *[]int32 + vcPositionLte *[]int32 + vcPositionN *[]int32 + vcPriority *[]int32 + vcPriorityEmpty *bool + vcPriorityGt *[]int32 + vcPriorityGte *[]int32 + vcPriorityLt *[]int32 + vcPriorityLte *[]int32 + vcPriorityN *[]int32 + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 + virtualChassisMember *bool +} + +func (r ApiDcimDevicesListRequest) Airflow(airflow string) ApiDcimDevicesListRequest { + r.airflow = &airflow + return r +} + +func (r ApiDcimDevicesListRequest) AirflowN(airflowN string) ApiDcimDevicesListRequest { + r.airflowN = &airflowN + return r +} + +func (r ApiDcimDevicesListRequest) AssetTag(assetTag []string) ApiDcimDevicesListRequest { + r.assetTag = &assetTag + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagEmpty(assetTagEmpty bool) ApiDcimDevicesListRequest { + r.assetTagEmpty = &assetTagEmpty + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagIc(assetTagIc []string) ApiDcimDevicesListRequest { + r.assetTagIc = &assetTagIc + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagIe(assetTagIe []string) ApiDcimDevicesListRequest { + r.assetTagIe = &assetTagIe + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagIew(assetTagIew []string) ApiDcimDevicesListRequest { + r.assetTagIew = &assetTagIew + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagIsw(assetTagIsw []string) ApiDcimDevicesListRequest { + r.assetTagIsw = &assetTagIsw + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagN(assetTagN []string) ApiDcimDevicesListRequest { + r.assetTagN = &assetTagN + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagNic(assetTagNic []string) ApiDcimDevicesListRequest { + r.assetTagNic = &assetTagNic + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagNie(assetTagNie []string) ApiDcimDevicesListRequest { + r.assetTagNie = &assetTagNie + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagNiew(assetTagNiew []string) ApiDcimDevicesListRequest { + r.assetTagNiew = &assetTagNiew + return r +} + +func (r ApiDcimDevicesListRequest) AssetTagNisw(assetTagNisw []string) ApiDcimDevicesListRequest { + r.assetTagNisw = &assetTagNisw + return r +} + +// VM cluster (ID) +func (r ApiDcimDevicesListRequest) ClusterId(clusterId []*int32) ApiDcimDevicesListRequest { + r.clusterId = &clusterId + return r +} + +// VM cluster (ID) +func (r ApiDcimDevicesListRequest) ClusterIdN(clusterIdN []*int32) ApiDcimDevicesListRequest { + r.clusterIdN = &clusterIdN + return r +} + +// Config template (ID) +func (r ApiDcimDevicesListRequest) ConfigTemplateId(configTemplateId []*int32) ApiDcimDevicesListRequest { + r.configTemplateId = &configTemplateId + return r +} + +// Config template (ID) +func (r ApiDcimDevicesListRequest) ConfigTemplateIdN(configTemplateIdN []*int32) ApiDcimDevicesListRequest { + r.configTemplateIdN = &configTemplateIdN + return r +} + +// Has console ports +func (r ApiDcimDevicesListRequest) ConsolePorts(consolePorts bool) ApiDcimDevicesListRequest { + r.consolePorts = &consolePorts + return r +} + +// Has console server ports +func (r ApiDcimDevicesListRequest) ConsoleServerPorts(consoleServerPorts bool) ApiDcimDevicesListRequest { + r.consoleServerPorts = &consoleServerPorts + return r +} + +// Contact +func (r ApiDcimDevicesListRequest) Contact(contact []int32) ApiDcimDevicesListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimDevicesListRequest) ContactN(contactN []int32) ApiDcimDevicesListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimDevicesListRequest) ContactGroup(contactGroup []int32) ApiDcimDevicesListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimDevicesListRequest) ContactGroupN(contactGroupN []int32) ApiDcimDevicesListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimDevicesListRequest) ContactRole(contactRole []int32) ApiDcimDevicesListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimDevicesListRequest) ContactRoleN(contactRoleN []int32) ApiDcimDevicesListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimDevicesListRequest) Created(created []time.Time) ApiDcimDevicesListRequest { + r.created = &created + return r +} + +func (r ApiDcimDevicesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimDevicesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimDevicesListRequest) CreatedGt(createdGt []time.Time) ApiDcimDevicesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimDevicesListRequest) CreatedGte(createdGte []time.Time) ApiDcimDevicesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimDevicesListRequest) CreatedLt(createdLt []time.Time) ApiDcimDevicesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimDevicesListRequest) CreatedLte(createdLte []time.Time) ApiDcimDevicesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimDevicesListRequest) CreatedN(createdN []time.Time) ApiDcimDevicesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimDevicesListRequest) CreatedByRequest(createdByRequest string) ApiDcimDevicesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimDevicesListRequest) Description(description []string) ApiDcimDevicesListRequest { + r.description = &description + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimDevicesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionIc(descriptionIc []string) ApiDcimDevicesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionIe(descriptionIe []string) ApiDcimDevicesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionIew(descriptionIew []string) ApiDcimDevicesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimDevicesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionN(descriptionN []string) ApiDcimDevicesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionNic(descriptionNic []string) ApiDcimDevicesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionNie(descriptionNie []string) ApiDcimDevicesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimDevicesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimDevicesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimDevicesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Has device bays +func (r ApiDcimDevicesListRequest) DeviceBays(deviceBays bool) ApiDcimDevicesListRequest { + r.deviceBays = &deviceBays + return r +} + +// Device type (slug) +func (r ApiDcimDevicesListRequest) DeviceType(deviceType []string) ApiDcimDevicesListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (slug) +func (r ApiDcimDevicesListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimDevicesListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimDevicesListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimDevicesListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimDevicesListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimDevicesListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimDevicesListRequest) Face(face string) ApiDcimDevicesListRequest { + r.face = &face + return r +} + +func (r ApiDcimDevicesListRequest) FaceN(faceN string) ApiDcimDevicesListRequest { + r.faceN = &faceN + return r +} + +// Has an out-of-band IP +func (r ApiDcimDevicesListRequest) HasOobIp(hasOobIp bool) ApiDcimDevicesListRequest { + r.hasOobIp = &hasOobIp + return r +} + +// Has a primary IP +func (r ApiDcimDevicesListRequest) HasPrimaryIp(hasPrimaryIp bool) ApiDcimDevicesListRequest { + r.hasPrimaryIp = &hasPrimaryIp + return r +} + +func (r ApiDcimDevicesListRequest) Id(id []int32) ApiDcimDevicesListRequest { + r.id = &id + return r +} + +func (r ApiDcimDevicesListRequest) IdEmpty(idEmpty bool) ApiDcimDevicesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimDevicesListRequest) IdGt(idGt []int32) ApiDcimDevicesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimDevicesListRequest) IdGte(idGte []int32) ApiDcimDevicesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimDevicesListRequest) IdLt(idLt []int32) ApiDcimDevicesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimDevicesListRequest) IdLte(idLte []int32) ApiDcimDevicesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimDevicesListRequest) IdN(idN []int32) ApiDcimDevicesListRequest { + r.idN = &idN + return r +} + +// Has interfaces +func (r ApiDcimDevicesListRequest) Interfaces(interfaces bool) ApiDcimDevicesListRequest { + r.interfaces = &interfaces + return r +} + +// Is full depth +func (r ApiDcimDevicesListRequest) IsFullDepth(isFullDepth bool) ApiDcimDevicesListRequest { + r.isFullDepth = &isFullDepth + return r +} + +func (r ApiDcimDevicesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimDevicesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimDevicesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimDevicesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimDevicesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimDevicesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimDevicesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimDevicesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimDevicesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimDevicesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimDevicesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimDevicesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimDevicesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimDevicesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +func (r ApiDcimDevicesListRequest) Latitude(latitude []float64) ApiDcimDevicesListRequest { + r.latitude = &latitude + return r +} + +func (r ApiDcimDevicesListRequest) LatitudeEmpty(latitudeEmpty bool) ApiDcimDevicesListRequest { + r.latitudeEmpty = &latitudeEmpty + return r +} + +func (r ApiDcimDevicesListRequest) LatitudeGt(latitudeGt []float64) ApiDcimDevicesListRequest { + r.latitudeGt = &latitudeGt + return r +} + +func (r ApiDcimDevicesListRequest) LatitudeGte(latitudeGte []float64) ApiDcimDevicesListRequest { + r.latitudeGte = &latitudeGte + return r +} + +func (r ApiDcimDevicesListRequest) LatitudeLt(latitudeLt []float64) ApiDcimDevicesListRequest { + r.latitudeLt = &latitudeLt + return r +} + +func (r ApiDcimDevicesListRequest) LatitudeLte(latitudeLte []float64) ApiDcimDevicesListRequest { + r.latitudeLte = &latitudeLte + return r +} + +func (r ApiDcimDevicesListRequest) LatitudeN(latitudeN []float64) ApiDcimDevicesListRequest { + r.latitudeN = &latitudeN + return r +} + +// Number of results to return per page. +func (r ApiDcimDevicesListRequest) Limit(limit int32) ApiDcimDevicesListRequest { + r.limit = &limit + return r +} + +// Has local config context data +func (r ApiDcimDevicesListRequest) LocalContextData(localContextData bool) ApiDcimDevicesListRequest { + r.localContextData = &localContextData + return r +} + +// Location (ID) +func (r ApiDcimDevicesListRequest) LocationId(locationId []int32) ApiDcimDevicesListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimDevicesListRequest) LocationIdN(locationIdN []int32) ApiDcimDevicesListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimDevicesListRequest) Longitude(longitude []float64) ApiDcimDevicesListRequest { + r.longitude = &longitude + return r +} + +func (r ApiDcimDevicesListRequest) LongitudeEmpty(longitudeEmpty bool) ApiDcimDevicesListRequest { + r.longitudeEmpty = &longitudeEmpty + return r +} + +func (r ApiDcimDevicesListRequest) LongitudeGt(longitudeGt []float64) ApiDcimDevicesListRequest { + r.longitudeGt = &longitudeGt + return r +} + +func (r ApiDcimDevicesListRequest) LongitudeGte(longitudeGte []float64) ApiDcimDevicesListRequest { + r.longitudeGte = &longitudeGte + return r +} + +func (r ApiDcimDevicesListRequest) LongitudeLt(longitudeLt []float64) ApiDcimDevicesListRequest { + r.longitudeLt = &longitudeLt + return r +} + +func (r ApiDcimDevicesListRequest) LongitudeLte(longitudeLte []float64) ApiDcimDevicesListRequest { + r.longitudeLte = &longitudeLte + return r +} + +func (r ApiDcimDevicesListRequest) LongitudeN(longitudeN []float64) ApiDcimDevicesListRequest { + r.longitudeN = &longitudeN + return r +} + +func (r ApiDcimDevicesListRequest) MacAddress(macAddress []string) ApiDcimDevicesListRequest { + r.macAddress = &macAddress + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressIc(macAddressIc []string) ApiDcimDevicesListRequest { + r.macAddressIc = &macAddressIc + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressIe(macAddressIe []string) ApiDcimDevicesListRequest { + r.macAddressIe = &macAddressIe + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressIew(macAddressIew []string) ApiDcimDevicesListRequest { + r.macAddressIew = &macAddressIew + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressIsw(macAddressIsw []string) ApiDcimDevicesListRequest { + r.macAddressIsw = &macAddressIsw + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressN(macAddressN []string) ApiDcimDevicesListRequest { + r.macAddressN = &macAddressN + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressNic(macAddressNic []string) ApiDcimDevicesListRequest { + r.macAddressNic = &macAddressNic + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressNie(macAddressNie []string) ApiDcimDevicesListRequest { + r.macAddressNie = &macAddressNie + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressNiew(macAddressNiew []string) ApiDcimDevicesListRequest { + r.macAddressNiew = &macAddressNiew + return r +} + +func (r ApiDcimDevicesListRequest) MacAddressNisw(macAddressNisw []string) ApiDcimDevicesListRequest { + r.macAddressNisw = &macAddressNisw + return r +} + +// Manufacturer (slug) +func (r ApiDcimDevicesListRequest) Manufacturer(manufacturer []string) ApiDcimDevicesListRequest { + r.manufacturer = &manufacturer + return r +} + +// Manufacturer (slug) +func (r ApiDcimDevicesListRequest) ManufacturerN(manufacturerN []string) ApiDcimDevicesListRequest { + r.manufacturerN = &manufacturerN + return r +} + +// Manufacturer (ID) +func (r ApiDcimDevicesListRequest) ManufacturerId(manufacturerId []int32) ApiDcimDevicesListRequest { + r.manufacturerId = &manufacturerId + return r +} + +// Manufacturer (ID) +func (r ApiDcimDevicesListRequest) ManufacturerIdN(manufacturerIdN []int32) ApiDcimDevicesListRequest { + r.manufacturerIdN = &manufacturerIdN + return r +} + +// Device model (slug) +func (r ApiDcimDevicesListRequest) Model(model []string) ApiDcimDevicesListRequest { + r.model = &model + return r +} + +// Device model (slug) +func (r ApiDcimDevicesListRequest) ModelN(modelN []string) ApiDcimDevicesListRequest { + r.modelN = &modelN + return r +} + +func (r ApiDcimDevicesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimDevicesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Has module bays +func (r ApiDcimDevicesListRequest) ModuleBays(moduleBays bool) ApiDcimDevicesListRequest { + r.moduleBays = &moduleBays + return r +} + +func (r ApiDcimDevicesListRequest) Name(name []string) ApiDcimDevicesListRequest { + r.name = &name + return r +} + +func (r ApiDcimDevicesListRequest) NameEmpty(nameEmpty bool) ApiDcimDevicesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimDevicesListRequest) NameIc(nameIc []string) ApiDcimDevicesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimDevicesListRequest) NameIe(nameIe []string) ApiDcimDevicesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimDevicesListRequest) NameIew(nameIew []string) ApiDcimDevicesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimDevicesListRequest) NameIsw(nameIsw []string) ApiDcimDevicesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimDevicesListRequest) NameN(nameN []string) ApiDcimDevicesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimDevicesListRequest) NameNic(nameNic []string) ApiDcimDevicesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimDevicesListRequest) NameNie(nameNie []string) ApiDcimDevicesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimDevicesListRequest) NameNiew(nameNiew []string) ApiDcimDevicesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimDevicesListRequest) NameNisw(nameNisw []string) ApiDcimDevicesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimDevicesListRequest) Offset(offset int32) ApiDcimDevicesListRequest { + r.offset = &offset + return r +} + +// OOB IP (ID) +func (r ApiDcimDevicesListRequest) OobIpId(oobIpId []int32) ApiDcimDevicesListRequest { + r.oobIpId = &oobIpId + return r +} + +// OOB IP (ID) +func (r ApiDcimDevicesListRequest) OobIpIdN(oobIpIdN []int32) ApiDcimDevicesListRequest { + r.oobIpIdN = &oobIpIdN + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimDevicesListRequest) Ordering(ordering string) ApiDcimDevicesListRequest { + r.ordering = &ordering + return r +} + +// Parent Device (ID) +func (r ApiDcimDevicesListRequest) ParentDeviceId(parentDeviceId []int32) ApiDcimDevicesListRequest { + r.parentDeviceId = &parentDeviceId + return r +} + +// Parent Device (ID) +func (r ApiDcimDevicesListRequest) ParentDeviceIdN(parentDeviceIdN []int32) ApiDcimDevicesListRequest { + r.parentDeviceIdN = &parentDeviceIdN + return r +} + +// Has pass-through ports +func (r ApiDcimDevicesListRequest) PassThroughPorts(passThroughPorts bool) ApiDcimDevicesListRequest { + r.passThroughPorts = &passThroughPorts + return r +} + +// Platform (slug) +func (r ApiDcimDevicesListRequest) Platform(platform []string) ApiDcimDevicesListRequest { + r.platform = &platform + return r +} + +// Platform (slug) +func (r ApiDcimDevicesListRequest) PlatformN(platformN []string) ApiDcimDevicesListRequest { + r.platformN = &platformN + return r +} + +// Platform (ID) +func (r ApiDcimDevicesListRequest) PlatformId(platformId []*int32) ApiDcimDevicesListRequest { + r.platformId = &platformId + return r +} + +// Platform (ID) +func (r ApiDcimDevicesListRequest) PlatformIdN(platformIdN []*int32) ApiDcimDevicesListRequest { + r.platformIdN = &platformIdN + return r +} + +func (r ApiDcimDevicesListRequest) Position(position []float64) ApiDcimDevicesListRequest { + r.position = &position + return r +} + +func (r ApiDcimDevicesListRequest) PositionEmpty(positionEmpty bool) ApiDcimDevicesListRequest { + r.positionEmpty = &positionEmpty + return r +} + +func (r ApiDcimDevicesListRequest) PositionGt(positionGt []float64) ApiDcimDevicesListRequest { + r.positionGt = &positionGt + return r +} + +func (r ApiDcimDevicesListRequest) PositionGte(positionGte []float64) ApiDcimDevicesListRequest { + r.positionGte = &positionGte + return r +} + +func (r ApiDcimDevicesListRequest) PositionLt(positionLt []float64) ApiDcimDevicesListRequest { + r.positionLt = &positionLt + return r +} + +func (r ApiDcimDevicesListRequest) PositionLte(positionLte []float64) ApiDcimDevicesListRequest { + r.positionLte = &positionLte + return r +} + +func (r ApiDcimDevicesListRequest) PositionN(positionN []float64) ApiDcimDevicesListRequest { + r.positionN = &positionN + return r +} + +// Has power outlets +func (r ApiDcimDevicesListRequest) PowerOutlets(powerOutlets bool) ApiDcimDevicesListRequest { + r.powerOutlets = &powerOutlets + return r +} + +// Has power ports +func (r ApiDcimDevicesListRequest) PowerPorts(powerPorts bool) ApiDcimDevicesListRequest { + r.powerPorts = &powerPorts + return r +} + +// Primary IPv4 (ID) +func (r ApiDcimDevicesListRequest) PrimaryIp4Id(primaryIp4Id []int32) ApiDcimDevicesListRequest { + r.primaryIp4Id = &primaryIp4Id + return r +} + +// Primary IPv4 (ID) +func (r ApiDcimDevicesListRequest) PrimaryIp4IdN(primaryIp4IdN []int32) ApiDcimDevicesListRequest { + r.primaryIp4IdN = &primaryIp4IdN + return r +} + +// Primary IPv6 (ID) +func (r ApiDcimDevicesListRequest) PrimaryIp6Id(primaryIp6Id []int32) ApiDcimDevicesListRequest { + r.primaryIp6Id = &primaryIp6Id + return r +} + +// Primary IPv6 (ID) +func (r ApiDcimDevicesListRequest) PrimaryIp6IdN(primaryIp6IdN []int32) ApiDcimDevicesListRequest { + r.primaryIp6IdN = &primaryIp6IdN + return r +} + +// Search +func (r ApiDcimDevicesListRequest) Q(q string) ApiDcimDevicesListRequest { + r.q = &q + return r +} + +// Rack (ID) +func (r ApiDcimDevicesListRequest) RackId(rackId []int32) ApiDcimDevicesListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimDevicesListRequest) RackIdN(rackIdN []int32) ApiDcimDevicesListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimDevicesListRequest) Region(region []int32) ApiDcimDevicesListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimDevicesListRequest) RegionN(regionN []int32) ApiDcimDevicesListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimDevicesListRequest) RegionId(regionId []int32) ApiDcimDevicesListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimDevicesListRequest) RegionIdN(regionIdN []int32) ApiDcimDevicesListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Role (slug) +func (r ApiDcimDevicesListRequest) Role(role []string) ApiDcimDevicesListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiDcimDevicesListRequest) RoleN(roleN []string) ApiDcimDevicesListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiDcimDevicesListRequest) RoleId(roleId []int32) ApiDcimDevicesListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiDcimDevicesListRequest) RoleIdN(roleIdN []int32) ApiDcimDevicesListRequest { + r.roleIdN = &roleIdN + return r +} + +func (r ApiDcimDevicesListRequest) Serial(serial []string) ApiDcimDevicesListRequest { + r.serial = &serial + return r +} + +func (r ApiDcimDevicesListRequest) SerialEmpty(serialEmpty bool) ApiDcimDevicesListRequest { + r.serialEmpty = &serialEmpty + return r +} + +func (r ApiDcimDevicesListRequest) SerialIc(serialIc []string) ApiDcimDevicesListRequest { + r.serialIc = &serialIc + return r +} + +func (r ApiDcimDevicesListRequest) SerialIe(serialIe []string) ApiDcimDevicesListRequest { + r.serialIe = &serialIe + return r +} + +func (r ApiDcimDevicesListRequest) SerialIew(serialIew []string) ApiDcimDevicesListRequest { + r.serialIew = &serialIew + return r +} + +func (r ApiDcimDevicesListRequest) SerialIsw(serialIsw []string) ApiDcimDevicesListRequest { + r.serialIsw = &serialIsw + return r +} + +func (r ApiDcimDevicesListRequest) SerialN(serialN []string) ApiDcimDevicesListRequest { + r.serialN = &serialN + return r +} + +func (r ApiDcimDevicesListRequest) SerialNic(serialNic []string) ApiDcimDevicesListRequest { + r.serialNic = &serialNic + return r +} + +func (r ApiDcimDevicesListRequest) SerialNie(serialNie []string) ApiDcimDevicesListRequest { + r.serialNie = &serialNie + return r +} + +func (r ApiDcimDevicesListRequest) SerialNiew(serialNiew []string) ApiDcimDevicesListRequest { + r.serialNiew = &serialNiew + return r +} + +func (r ApiDcimDevicesListRequest) SerialNisw(serialNisw []string) ApiDcimDevicesListRequest { + r.serialNisw = &serialNisw + return r +} + +// Site name (slug) +func (r ApiDcimDevicesListRequest) Site(site []string) ApiDcimDevicesListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimDevicesListRequest) SiteN(siteN []string) ApiDcimDevicesListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimDevicesListRequest) SiteGroup(siteGroup []int32) ApiDcimDevicesListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimDevicesListRequest) SiteGroupN(siteGroupN []int32) ApiDcimDevicesListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimDevicesListRequest) SiteGroupId(siteGroupId []int32) ApiDcimDevicesListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimDevicesListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimDevicesListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimDevicesListRequest) SiteId(siteId []int32) ApiDcimDevicesListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimDevicesListRequest) SiteIdN(siteIdN []int32) ApiDcimDevicesListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimDevicesListRequest) Status(status []string) ApiDcimDevicesListRequest { + r.status = &status + return r +} + +func (r ApiDcimDevicesListRequest) StatusN(statusN []string) ApiDcimDevicesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimDevicesListRequest) Tag(tag []string) ApiDcimDevicesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimDevicesListRequest) TagN(tagN []string) ApiDcimDevicesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimDevicesListRequest) Tenant(tenant []string) ApiDcimDevicesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimDevicesListRequest) TenantN(tenantN []string) ApiDcimDevicesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimDevicesListRequest) TenantGroup(tenantGroup []int32) ApiDcimDevicesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimDevicesListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimDevicesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimDevicesListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimDevicesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimDevicesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimDevicesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimDevicesListRequest) TenantId(tenantId []*int32) ApiDcimDevicesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimDevicesListRequest) TenantIdN(tenantIdN []*int32) ApiDcimDevicesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimDevicesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimDevicesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimDevicesListRequest) VcPosition(vcPosition []int32) ApiDcimDevicesListRequest { + r.vcPosition = &vcPosition + return r +} + +func (r ApiDcimDevicesListRequest) VcPositionEmpty(vcPositionEmpty bool) ApiDcimDevicesListRequest { + r.vcPositionEmpty = &vcPositionEmpty + return r +} + +func (r ApiDcimDevicesListRequest) VcPositionGt(vcPositionGt []int32) ApiDcimDevicesListRequest { + r.vcPositionGt = &vcPositionGt + return r +} + +func (r ApiDcimDevicesListRequest) VcPositionGte(vcPositionGte []int32) ApiDcimDevicesListRequest { + r.vcPositionGte = &vcPositionGte + return r +} + +func (r ApiDcimDevicesListRequest) VcPositionLt(vcPositionLt []int32) ApiDcimDevicesListRequest { + r.vcPositionLt = &vcPositionLt + return r +} + +func (r ApiDcimDevicesListRequest) VcPositionLte(vcPositionLte []int32) ApiDcimDevicesListRequest { + r.vcPositionLte = &vcPositionLte + return r +} + +func (r ApiDcimDevicesListRequest) VcPositionN(vcPositionN []int32) ApiDcimDevicesListRequest { + r.vcPositionN = &vcPositionN + return r +} + +func (r ApiDcimDevicesListRequest) VcPriority(vcPriority []int32) ApiDcimDevicesListRequest { + r.vcPriority = &vcPriority + return r +} + +func (r ApiDcimDevicesListRequest) VcPriorityEmpty(vcPriorityEmpty bool) ApiDcimDevicesListRequest { + r.vcPriorityEmpty = &vcPriorityEmpty + return r +} + +func (r ApiDcimDevicesListRequest) VcPriorityGt(vcPriorityGt []int32) ApiDcimDevicesListRequest { + r.vcPriorityGt = &vcPriorityGt + return r +} + +func (r ApiDcimDevicesListRequest) VcPriorityGte(vcPriorityGte []int32) ApiDcimDevicesListRequest { + r.vcPriorityGte = &vcPriorityGte + return r +} + +func (r ApiDcimDevicesListRequest) VcPriorityLt(vcPriorityLt []int32) ApiDcimDevicesListRequest { + r.vcPriorityLt = &vcPriorityLt + return r +} + +func (r ApiDcimDevicesListRequest) VcPriorityLte(vcPriorityLte []int32) ApiDcimDevicesListRequest { + r.vcPriorityLte = &vcPriorityLte + return r +} + +func (r ApiDcimDevicesListRequest) VcPriorityN(vcPriorityN []int32) ApiDcimDevicesListRequest { + r.vcPriorityN = &vcPriorityN + return r +} + +// Virtual chassis (ID) +func (r ApiDcimDevicesListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimDevicesListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual chassis (ID) +func (r ApiDcimDevicesListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimDevicesListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +// Is a virtual chassis member +func (r ApiDcimDevicesListRequest) VirtualChassisMember(virtualChassisMember bool) ApiDcimDevicesListRequest { + r.virtualChassisMember = &virtualChassisMember + return r +} + +func (r ApiDcimDevicesListRequest) Execute() (*PaginatedDeviceWithConfigContextList, *http.Response, error) { + return r.ApiService.DcimDevicesListExecute(r) +} + +/* +DcimDevicesList Method for DcimDevicesList + +Get a list of device objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimDevicesListRequest +*/ +func (a *DcimAPIService) DcimDevicesList(ctx context.Context) ApiDcimDevicesListRequest { + return ApiDcimDevicesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDeviceWithConfigContextList +func (a *DcimAPIService) DcimDevicesListExecute(r ApiDcimDevicesListRequest) (*PaginatedDeviceWithConfigContextList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDeviceWithConfigContextList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.airflow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "airflow", r.airflow, "") + } + if r.airflowN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "airflow__n", r.airflowN, "") + } + if r.assetTag != nil { + t := *r.assetTag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", t, "multi") + } + } + if r.assetTagEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__empty", r.assetTagEmpty, "") + } + if r.assetTagIc != nil { + t := *r.assetTagIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", t, "multi") + } + } + if r.assetTagIe != nil { + t := *r.assetTagIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", t, "multi") + } + } + if r.assetTagIew != nil { + t := *r.assetTagIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", t, "multi") + } + } + if r.assetTagIsw != nil { + t := *r.assetTagIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", t, "multi") + } + } + if r.assetTagN != nil { + t := *r.assetTagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", t, "multi") + } + } + if r.assetTagNic != nil { + t := *r.assetTagNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", t, "multi") + } + } + if r.assetTagNie != nil { + t := *r.assetTagNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", t, "multi") + } + } + if r.assetTagNiew != nil { + t := *r.assetTagNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", t, "multi") + } + } + if r.assetTagNisw != nil { + t := *r.assetTagNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", t, "multi") + } + } + if r.clusterId != nil { + t := *r.clusterId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", t, "multi") + } + } + if r.clusterIdN != nil { + t := *r.clusterIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", t, "multi") + } + } + if r.configTemplateId != nil { + t := *r.configTemplateId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", t, "multi") + } + } + if r.configTemplateIdN != nil { + t := *r.configTemplateIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", t, "multi") + } + } + if r.consolePorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "console_ports", r.consolePorts, "") + } + if r.consoleServerPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "console_server_ports", r.consoleServerPorts, "") + } + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.deviceBays != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_bays", r.deviceBays, "") + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.face != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "face", r.face, "") + } + if r.faceN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "face__n", r.faceN, "") + } + if r.hasOobIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_oob_ip", r.hasOobIp, "") + } + if r.hasPrimaryIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_primary_ip", r.hasPrimaryIp, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interfaces != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interfaces", r.interfaces, "") + } + if r.isFullDepth != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_full_depth", r.isFullDepth, "") + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.latitude != nil { + t := *r.latitude + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude", t, "multi") + } + } + if r.latitudeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__empty", r.latitudeEmpty, "") + } + if r.latitudeGt != nil { + t := *r.latitudeGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gt", t, "multi") + } + } + if r.latitudeGte != nil { + t := *r.latitudeGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gte", t, "multi") + } + } + if r.latitudeLt != nil { + t := *r.latitudeLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lt", t, "multi") + } + } + if r.latitudeLte != nil { + t := *r.latitudeLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lte", t, "multi") + } + } + if r.latitudeN != nil { + t := *r.latitudeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.localContextData != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "local_context_data", r.localContextData, "") + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.longitude != nil { + t := *r.longitude + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude", t, "multi") + } + } + if r.longitudeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__empty", r.longitudeEmpty, "") + } + if r.longitudeGt != nil { + t := *r.longitudeGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gt", t, "multi") + } + } + if r.longitudeGte != nil { + t := *r.longitudeGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gte", t, "multi") + } + } + if r.longitudeLt != nil { + t := *r.longitudeLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lt", t, "multi") + } + } + if r.longitudeLte != nil { + t := *r.longitudeLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lte", t, "multi") + } + } + if r.longitudeN != nil { + t := *r.longitudeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__n", t, "multi") + } + } + if r.macAddress != nil { + t := *r.macAddress + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", t, "multi") + } + } + if r.macAddressIc != nil { + t := *r.macAddressIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", t, "multi") + } + } + if r.macAddressIe != nil { + t := *r.macAddressIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", t, "multi") + } + } + if r.macAddressIew != nil { + t := *r.macAddressIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", t, "multi") + } + } + if r.macAddressIsw != nil { + t := *r.macAddressIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", t, "multi") + } + } + if r.macAddressN != nil { + t := *r.macAddressN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", t, "multi") + } + } + if r.macAddressNic != nil { + t := *r.macAddressNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", t, "multi") + } + } + if r.macAddressNie != nil { + t := *r.macAddressNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", t, "multi") + } + } + if r.macAddressNiew != nil { + t := *r.macAddressNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", t, "multi") + } + } + if r.macAddressNisw != nil { + t := *r.macAddressNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", t, "multi") + } + } + if r.manufacturer != nil { + t := *r.manufacturer + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", t, "multi") + } + } + if r.manufacturerN != nil { + t := *r.manufacturerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", t, "multi") + } + } + if r.manufacturerId != nil { + t := *r.manufacturerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", t, "multi") + } + } + if r.manufacturerIdN != nil { + t := *r.manufacturerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", t, "multi") + } + } + if r.model != nil { + t := *r.model + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", t, "multi") + } + } + if r.modelN != nil { + t := *r.modelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleBays != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_bays", r.moduleBays, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.oobIpId != nil { + t := *r.oobIpId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "oob_ip_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "oob_ip_id", t, "multi") + } + } + if r.oobIpIdN != nil { + t := *r.oobIpIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "oob_ip_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "oob_ip_id__n", t, "multi") + } + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parentDeviceId != nil { + t := *r.parentDeviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_device_id", t, "multi") + } + } + if r.parentDeviceIdN != nil { + t := *r.parentDeviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_device_id__n", t, "multi") + } + } + if r.passThroughPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pass_through_ports", r.passThroughPorts, "") + } + if r.platform != nil { + t := *r.platform + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform", t, "multi") + } + } + if r.platformN != nil { + t := *r.platformN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform__n", t, "multi") + } + } + if r.platformId != nil { + t := *r.platformId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id", t, "multi") + } + } + if r.platformIdN != nil { + t := *r.platformIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id__n", t, "multi") + } + } + if r.position != nil { + t := *r.position + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "position", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "position", t, "multi") + } + } + if r.positionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__empty", r.positionEmpty, "") + } + if r.positionGt != nil { + t := *r.positionGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__gt", t, "multi") + } + } + if r.positionGte != nil { + t := *r.positionGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__gte", t, "multi") + } + } + if r.positionLt != nil { + t := *r.positionLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__lt", t, "multi") + } + } + if r.positionLte != nil { + t := *r.positionLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__lte", t, "multi") + } + } + if r.positionN != nil { + t := *r.positionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "position__n", t, "multi") + } + } + if r.powerOutlets != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_outlets", r.powerOutlets, "") + } + if r.powerPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_ports", r.powerPorts, "") + } + if r.primaryIp4Id != nil { + t := *r.primaryIp4Id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id", t, "multi") + } + } + if r.primaryIp4IdN != nil { + t := *r.primaryIp4IdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id__n", t, "multi") + } + } + if r.primaryIp6Id != nil { + t := *r.primaryIp6Id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id", t, "multi") + } + } + if r.primaryIp6IdN != nil { + t := *r.primaryIp6IdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.serial != nil { + t := *r.serial + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", t, "multi") + } + } + if r.serialEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__empty", r.serialEmpty, "") + } + if r.serialIc != nil { + t := *r.serialIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", t, "multi") + } + } + if r.serialIe != nil { + t := *r.serialIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", t, "multi") + } + } + if r.serialIew != nil { + t := *r.serialIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", t, "multi") + } + } + if r.serialIsw != nil { + t := *r.serialIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", t, "multi") + } + } + if r.serialN != nil { + t := *r.serialN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", t, "multi") + } + } + if r.serialNic != nil { + t := *r.serialNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", t, "multi") + } + } + if r.serialNie != nil { + t := *r.serialNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", t, "multi") + } + } + if r.serialNiew != nil { + t := *r.serialNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", t, "multi") + } + } + if r.serialNisw != nil { + t := *r.serialNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vcPosition != nil { + t := *r.vcPosition + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position", t, "multi") + } + } + if r.vcPositionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__empty", r.vcPositionEmpty, "") + } + if r.vcPositionGt != nil { + t := *r.vcPositionGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__gt", t, "multi") + } + } + if r.vcPositionGte != nil { + t := *r.vcPositionGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__gte", t, "multi") + } + } + if r.vcPositionLt != nil { + t := *r.vcPositionLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__lt", t, "multi") + } + } + if r.vcPositionLte != nil { + t := *r.vcPositionLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__lte", t, "multi") + } + } + if r.vcPositionN != nil { + t := *r.vcPositionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_position__n", t, "multi") + } + } + if r.vcPriority != nil { + t := *r.vcPriority + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority", t, "multi") + } + } + if r.vcPriorityEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__empty", r.vcPriorityEmpty, "") + } + if r.vcPriorityGt != nil { + t := *r.vcPriorityGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__gt", t, "multi") + } + } + if r.vcPriorityGte != nil { + t := *r.vcPriorityGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__gte", t, "multi") + } + } + if r.vcPriorityLt != nil { + t := *r.vcPriorityLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__lt", t, "multi") + } + } + if r.vcPriorityLte != nil { + t := *r.vcPriorityLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__lte", t, "multi") + } + } + if r.vcPriorityN != nil { + t := *r.vcPriorityN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vc_priority__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + if r.virtualChassisMember != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_member", r.virtualChassisMember, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableDeviceWithConfigContextRequest *PatchedWritableDeviceWithConfigContextRequest +} + +func (r ApiDcimDevicesPartialUpdateRequest) PatchedWritableDeviceWithConfigContextRequest(patchedWritableDeviceWithConfigContextRequest PatchedWritableDeviceWithConfigContextRequest) ApiDcimDevicesPartialUpdateRequest { + r.patchedWritableDeviceWithConfigContextRequest = &patchedWritableDeviceWithConfigContextRequest + return r +} + +func (r ApiDcimDevicesPartialUpdateRequest) Execute() (*DeviceWithConfigContext, *http.Response, error) { + return r.ApiService.DcimDevicesPartialUpdateExecute(r) +} + +/* +DcimDevicesPartialUpdate Method for DcimDevicesPartialUpdate + +Patch a device object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device. + @return ApiDcimDevicesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimDevicesPartialUpdate(ctx context.Context, id int32) ApiDcimDevicesPartialUpdateRequest { + return ApiDcimDevicesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceWithConfigContext +func (a *DcimAPIService) DcimDevicesPartialUpdateExecute(r ApiDcimDevicesPartialUpdateRequest) (*DeviceWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableDeviceWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesRenderConfigCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableDeviceWithConfigContextRequest *WritableDeviceWithConfigContextRequest + format *DcimDevicesRenderConfigCreateFormatParameter +} + +func (r ApiDcimDevicesRenderConfigCreateRequest) WritableDeviceWithConfigContextRequest(writableDeviceWithConfigContextRequest WritableDeviceWithConfigContextRequest) ApiDcimDevicesRenderConfigCreateRequest { + r.writableDeviceWithConfigContextRequest = &writableDeviceWithConfigContextRequest + return r +} + +func (r ApiDcimDevicesRenderConfigCreateRequest) Format(format DcimDevicesRenderConfigCreateFormatParameter) ApiDcimDevicesRenderConfigCreateRequest { + r.format = &format + return r +} + +func (r ApiDcimDevicesRenderConfigCreateRequest) Execute() (*DeviceWithConfigContext, *http.Response, error) { + return r.ApiService.DcimDevicesRenderConfigCreateExecute(r) +} + +/* +DcimDevicesRenderConfigCreate Method for DcimDevicesRenderConfigCreate + +Resolve and render the preferred ConfigTemplate for this Device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device. + @return ApiDcimDevicesRenderConfigCreateRequest +*/ +func (a *DcimAPIService) DcimDevicesRenderConfigCreate(ctx context.Context, id int32) ApiDcimDevicesRenderConfigCreateRequest { + return ApiDcimDevicesRenderConfigCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceWithConfigContext +func (a *DcimAPIService) DcimDevicesRenderConfigCreateExecute(r ApiDcimDevicesRenderConfigCreateRequest) (*DeviceWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesRenderConfigCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/{id}/render-config/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceWithConfigContextRequest is required and must be specified") + } + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimDevicesRetrieveRequest) Execute() (*DeviceWithConfigContext, *http.Response, error) { + return r.ApiService.DcimDevicesRetrieveExecute(r) +} + +/* +DcimDevicesRetrieve Method for DcimDevicesRetrieve + +Get a device object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device. + @return ApiDcimDevicesRetrieveRequest +*/ +func (a *DcimAPIService) DcimDevicesRetrieve(ctx context.Context, id int32) ApiDcimDevicesRetrieveRequest { + return ApiDcimDevicesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceWithConfigContext +func (a *DcimAPIService) DcimDevicesRetrieveExecute(r ApiDcimDevicesRetrieveRequest) (*DeviceWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimDevicesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableDeviceWithConfigContextRequest *WritableDeviceWithConfigContextRequest +} + +func (r ApiDcimDevicesUpdateRequest) WritableDeviceWithConfigContextRequest(writableDeviceWithConfigContextRequest WritableDeviceWithConfigContextRequest) ApiDcimDevicesUpdateRequest { + r.writableDeviceWithConfigContextRequest = &writableDeviceWithConfigContextRequest + return r +} + +func (r ApiDcimDevicesUpdateRequest) Execute() (*DeviceWithConfigContext, *http.Response, error) { + return r.ApiService.DcimDevicesUpdateExecute(r) +} + +/* +DcimDevicesUpdate Method for DcimDevicesUpdate + +Put a device object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this device. + @return ApiDcimDevicesUpdateRequest +*/ +func (a *DcimAPIService) DcimDevicesUpdate(ctx context.Context, id int32) ApiDcimDevicesUpdateRequest { + return ApiDcimDevicesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceWithConfigContext +func (a *DcimAPIService) DcimDevicesUpdateExecute(r ApiDcimDevicesUpdateRequest) (*DeviceWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimDevicesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/devices/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableDeviceWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableDeviceWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableDeviceWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + frontPortTemplateRequest *[]FrontPortTemplateRequest +} + +func (r ApiDcimFrontPortTemplatesBulkDestroyRequest) FrontPortTemplateRequest(frontPortTemplateRequest []FrontPortTemplateRequest) ApiDcimFrontPortTemplatesBulkDestroyRequest { + r.frontPortTemplateRequest = &frontPortTemplateRequest + return r +} + +func (r ApiDcimFrontPortTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesBulkDestroyExecute(r) +} + +/* +DcimFrontPortTemplatesBulkDestroy Method for DcimFrontPortTemplatesBulkDestroy + +Delete a list of front port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesBulkDestroy(ctx context.Context) ApiDcimFrontPortTemplatesBulkDestroyRequest { + return ApiDcimFrontPortTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimFrontPortTemplatesBulkDestroyExecute(r ApiDcimFrontPortTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.frontPortTemplateRequest == nil { + return nil, reportError("frontPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.frontPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + frontPortTemplateRequest *[]FrontPortTemplateRequest +} + +func (r ApiDcimFrontPortTemplatesBulkPartialUpdateRequest) FrontPortTemplateRequest(frontPortTemplateRequest []FrontPortTemplateRequest) ApiDcimFrontPortTemplatesBulkPartialUpdateRequest { + r.frontPortTemplateRequest = &frontPortTemplateRequest + return r +} + +func (r ApiDcimFrontPortTemplatesBulkPartialUpdateRequest) Execute() ([]FrontPortTemplate, *http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimFrontPortTemplatesBulkPartialUpdate Method for DcimFrontPortTemplatesBulkPartialUpdate + +Patch a list of front port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimFrontPortTemplatesBulkPartialUpdateRequest { + return ApiDcimFrontPortTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FrontPortTemplate +func (a *DcimAPIService) DcimFrontPortTemplatesBulkPartialUpdateExecute(r ApiDcimFrontPortTemplatesBulkPartialUpdateRequest) ([]FrontPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FrontPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.frontPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("frontPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.frontPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + frontPortTemplateRequest *[]FrontPortTemplateRequest +} + +func (r ApiDcimFrontPortTemplatesBulkUpdateRequest) FrontPortTemplateRequest(frontPortTemplateRequest []FrontPortTemplateRequest) ApiDcimFrontPortTemplatesBulkUpdateRequest { + r.frontPortTemplateRequest = &frontPortTemplateRequest + return r +} + +func (r ApiDcimFrontPortTemplatesBulkUpdateRequest) Execute() ([]FrontPortTemplate, *http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesBulkUpdateExecute(r) +} + +/* +DcimFrontPortTemplatesBulkUpdate Method for DcimFrontPortTemplatesBulkUpdate + +Put a list of front port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesBulkUpdate(ctx context.Context) ApiDcimFrontPortTemplatesBulkUpdateRequest { + return ApiDcimFrontPortTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FrontPortTemplate +func (a *DcimAPIService) DcimFrontPortTemplatesBulkUpdateExecute(r ApiDcimFrontPortTemplatesBulkUpdateRequest) ([]FrontPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FrontPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.frontPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("frontPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.frontPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableFrontPortTemplateRequest *WritableFrontPortTemplateRequest +} + +func (r ApiDcimFrontPortTemplatesCreateRequest) WritableFrontPortTemplateRequest(writableFrontPortTemplateRequest WritableFrontPortTemplateRequest) ApiDcimFrontPortTemplatesCreateRequest { + r.writableFrontPortTemplateRequest = &writableFrontPortTemplateRequest + return r +} + +func (r ApiDcimFrontPortTemplatesCreateRequest) Execute() (*FrontPortTemplate, *http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesCreateExecute(r) +} + +/* +DcimFrontPortTemplatesCreate Method for DcimFrontPortTemplatesCreate + +Post a list of front port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesCreate(ctx context.Context) ApiDcimFrontPortTemplatesCreateRequest { + return ApiDcimFrontPortTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FrontPortTemplate +func (a *DcimAPIService) DcimFrontPortTemplatesCreateExecute(r ApiDcimFrontPortTemplatesCreateRequest) (*FrontPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableFrontPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableFrontPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableFrontPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimFrontPortTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesDestroyExecute(r) +} + +/* +DcimFrontPortTemplatesDestroy Method for DcimFrontPortTemplatesDestroy + +Delete a front port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port template. + @return ApiDcimFrontPortTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesDestroy(ctx context.Context, id int32) ApiDcimFrontPortTemplatesDestroyRequest { + return ApiDcimFrontPortTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimFrontPortTemplatesDestroyExecute(r ApiDcimFrontPortTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]*int32 + devicetypeIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + moduletypeId *[]*int32 + moduletypeIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + type_ *[]string + typeN *[]string + updatedByRequest *string +} + +func (r ApiDcimFrontPortTemplatesListRequest) Color(color []string) ApiDcimFrontPortTemplatesListRequest { + r.color = &color + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorEmpty(colorEmpty bool) ApiDcimFrontPortTemplatesListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorIc(colorIc []string) ApiDcimFrontPortTemplatesListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorIe(colorIe []string) ApiDcimFrontPortTemplatesListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorIew(colorIew []string) ApiDcimFrontPortTemplatesListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorIsw(colorIsw []string) ApiDcimFrontPortTemplatesListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorN(colorN []string) ApiDcimFrontPortTemplatesListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorNic(colorNic []string) ApiDcimFrontPortTemplatesListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorNie(colorNie []string) ApiDcimFrontPortTemplatesListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorNiew(colorNiew []string) ApiDcimFrontPortTemplatesListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ColorNisw(colorNisw []string) ApiDcimFrontPortTemplatesListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) Created(created []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimFrontPortTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) Description(description []string) ApiDcimFrontPortTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimFrontPortTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimFrontPortTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimFrontPortTemplatesListRequest) DevicetypeId(devicetypeId []*int32) ApiDcimFrontPortTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimFrontPortTemplatesListRequest) DevicetypeIdN(devicetypeIdN []*int32) ApiDcimFrontPortTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) Id(id []int32) ApiDcimFrontPortTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimFrontPortTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) IdGt(idGt []int32) ApiDcimFrontPortTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) IdGte(idGte []int32) ApiDcimFrontPortTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) IdLt(idLt []int32) ApiDcimFrontPortTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) IdLte(idLte []int32) ApiDcimFrontPortTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) IdN(idN []int32) ApiDcimFrontPortTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimFrontPortTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimFrontPortTemplatesListRequest) Limit(limit int32) ApiDcimFrontPortTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimFrontPortTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module type (ID) +func (r ApiDcimFrontPortTemplatesListRequest) ModuletypeId(moduletypeId []*int32) ApiDcimFrontPortTemplatesListRequest { + r.moduletypeId = &moduletypeId + return r +} + +// Module type (ID) +func (r ApiDcimFrontPortTemplatesListRequest) ModuletypeIdN(moduletypeIdN []*int32) ApiDcimFrontPortTemplatesListRequest { + r.moduletypeIdN = &moduletypeIdN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) Name(name []string) ApiDcimFrontPortTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimFrontPortTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameIc(nameIc []string) ApiDcimFrontPortTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameIe(nameIe []string) ApiDcimFrontPortTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameIew(nameIew []string) ApiDcimFrontPortTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimFrontPortTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameN(nameN []string) ApiDcimFrontPortTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameNic(nameNic []string) ApiDcimFrontPortTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameNie(nameNie []string) ApiDcimFrontPortTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimFrontPortTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimFrontPortTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimFrontPortTemplatesListRequest) Offset(offset int32) ApiDcimFrontPortTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimFrontPortTemplatesListRequest) Ordering(ordering string) ApiDcimFrontPortTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimFrontPortTemplatesListRequest) Q(q string) ApiDcimFrontPortTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) Type_(type_ []string) ApiDcimFrontPortTemplatesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) TypeN(typeN []string) ApiDcimFrontPortTemplatesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimFrontPortTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimFrontPortTemplatesListRequest) Execute() (*PaginatedFrontPortTemplateList, *http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesListExecute(r) +} + +/* +DcimFrontPortTemplatesList Method for DcimFrontPortTemplatesList + +Get a list of front port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortTemplatesListRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesList(ctx context.Context) ApiDcimFrontPortTemplatesListRequest { + return ApiDcimFrontPortTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedFrontPortTemplateList +func (a *DcimAPIService) DcimFrontPortTemplatesListExecute(r ApiDcimFrontPortTemplatesListRequest) (*PaginatedFrontPortTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedFrontPortTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduletypeId != nil { + t := *r.moduletypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", t, "multi") + } + } + if r.moduletypeIdN != nil { + t := *r.moduletypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableFrontPortTemplateRequest *PatchedWritableFrontPortTemplateRequest +} + +func (r ApiDcimFrontPortTemplatesPartialUpdateRequest) PatchedWritableFrontPortTemplateRequest(patchedWritableFrontPortTemplateRequest PatchedWritableFrontPortTemplateRequest) ApiDcimFrontPortTemplatesPartialUpdateRequest { + r.patchedWritableFrontPortTemplateRequest = &patchedWritableFrontPortTemplateRequest + return r +} + +func (r ApiDcimFrontPortTemplatesPartialUpdateRequest) Execute() (*FrontPortTemplate, *http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesPartialUpdateExecute(r) +} + +/* +DcimFrontPortTemplatesPartialUpdate Method for DcimFrontPortTemplatesPartialUpdate + +Patch a front port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port template. + @return ApiDcimFrontPortTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimFrontPortTemplatesPartialUpdateRequest { + return ApiDcimFrontPortTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FrontPortTemplate +func (a *DcimAPIService) DcimFrontPortTemplatesPartialUpdateExecute(r ApiDcimFrontPortTemplatesPartialUpdateRequest) (*FrontPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableFrontPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimFrontPortTemplatesRetrieveRequest) Execute() (*FrontPortTemplate, *http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesRetrieveExecute(r) +} + +/* +DcimFrontPortTemplatesRetrieve Method for DcimFrontPortTemplatesRetrieve + +Get a front port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port template. + @return ApiDcimFrontPortTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesRetrieve(ctx context.Context, id int32) ApiDcimFrontPortTemplatesRetrieveRequest { + return ApiDcimFrontPortTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FrontPortTemplate +func (a *DcimAPIService) DcimFrontPortTemplatesRetrieveExecute(r ApiDcimFrontPortTemplatesRetrieveRequest) (*FrontPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableFrontPortTemplateRequest *WritableFrontPortTemplateRequest +} + +func (r ApiDcimFrontPortTemplatesUpdateRequest) WritableFrontPortTemplateRequest(writableFrontPortTemplateRequest WritableFrontPortTemplateRequest) ApiDcimFrontPortTemplatesUpdateRequest { + r.writableFrontPortTemplateRequest = &writableFrontPortTemplateRequest + return r +} + +func (r ApiDcimFrontPortTemplatesUpdateRequest) Execute() (*FrontPortTemplate, *http.Response, error) { + return r.ApiService.DcimFrontPortTemplatesUpdateExecute(r) +} + +/* +DcimFrontPortTemplatesUpdate Method for DcimFrontPortTemplatesUpdate + +Put a front port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port template. + @return ApiDcimFrontPortTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortTemplatesUpdate(ctx context.Context, id int32) ApiDcimFrontPortTemplatesUpdateRequest { + return ApiDcimFrontPortTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FrontPortTemplate +func (a *DcimAPIService) DcimFrontPortTemplatesUpdateExecute(r ApiDcimFrontPortTemplatesUpdateRequest) (*FrontPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableFrontPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableFrontPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableFrontPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + frontPortRequest *[]FrontPortRequest +} + +func (r ApiDcimFrontPortsBulkDestroyRequest) FrontPortRequest(frontPortRequest []FrontPortRequest) ApiDcimFrontPortsBulkDestroyRequest { + r.frontPortRequest = &frontPortRequest + return r +} + +func (r ApiDcimFrontPortsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimFrontPortsBulkDestroyExecute(r) +} + +/* +DcimFrontPortsBulkDestroy Method for DcimFrontPortsBulkDestroy + +Delete a list of front port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimFrontPortsBulkDestroy(ctx context.Context) ApiDcimFrontPortsBulkDestroyRequest { + return ApiDcimFrontPortsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimFrontPortsBulkDestroyExecute(r ApiDcimFrontPortsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.frontPortRequest == nil { + return nil, reportError("frontPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.frontPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + frontPortRequest *[]FrontPortRequest +} + +func (r ApiDcimFrontPortsBulkPartialUpdateRequest) FrontPortRequest(frontPortRequest []FrontPortRequest) ApiDcimFrontPortsBulkPartialUpdateRequest { + r.frontPortRequest = &frontPortRequest + return r +} + +func (r ApiDcimFrontPortsBulkPartialUpdateRequest) Execute() ([]FrontPort, *http.Response, error) { + return r.ApiService.DcimFrontPortsBulkPartialUpdateExecute(r) +} + +/* +DcimFrontPortsBulkPartialUpdate Method for DcimFrontPortsBulkPartialUpdate + +Patch a list of front port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortsBulkPartialUpdate(ctx context.Context) ApiDcimFrontPortsBulkPartialUpdateRequest { + return ApiDcimFrontPortsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FrontPort +func (a *DcimAPIService) DcimFrontPortsBulkPartialUpdateExecute(r ApiDcimFrontPortsBulkPartialUpdateRequest) ([]FrontPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FrontPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.frontPortRequest == nil { + return localVarReturnValue, nil, reportError("frontPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.frontPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + frontPortRequest *[]FrontPortRequest +} + +func (r ApiDcimFrontPortsBulkUpdateRequest) FrontPortRequest(frontPortRequest []FrontPortRequest) ApiDcimFrontPortsBulkUpdateRequest { + r.frontPortRequest = &frontPortRequest + return r +} + +func (r ApiDcimFrontPortsBulkUpdateRequest) Execute() ([]FrontPort, *http.Response, error) { + return r.ApiService.DcimFrontPortsBulkUpdateExecute(r) +} + +/* +DcimFrontPortsBulkUpdate Method for DcimFrontPortsBulkUpdate + +Put a list of front port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortsBulkUpdate(ctx context.Context) ApiDcimFrontPortsBulkUpdateRequest { + return ApiDcimFrontPortsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FrontPort +func (a *DcimAPIService) DcimFrontPortsBulkUpdateExecute(r ApiDcimFrontPortsBulkUpdateRequest) ([]FrontPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FrontPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.frontPortRequest == nil { + return localVarReturnValue, nil, reportError("frontPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.frontPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableFrontPortRequest *WritableFrontPortRequest +} + +func (r ApiDcimFrontPortsCreateRequest) WritableFrontPortRequest(writableFrontPortRequest WritableFrontPortRequest) ApiDcimFrontPortsCreateRequest { + r.writableFrontPortRequest = &writableFrontPortRequest + return r +} + +func (r ApiDcimFrontPortsCreateRequest) Execute() (*FrontPort, *http.Response, error) { + return r.ApiService.DcimFrontPortsCreateExecute(r) +} + +/* +DcimFrontPortsCreate Method for DcimFrontPortsCreate + +Post a list of front port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortsCreateRequest +*/ +func (a *DcimAPIService) DcimFrontPortsCreate(ctx context.Context) ApiDcimFrontPortsCreateRequest { + return ApiDcimFrontPortsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FrontPort +func (a *DcimAPIService) DcimFrontPortsCreateExecute(r ApiDcimFrontPortsCreateRequest) (*FrontPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableFrontPortRequest == nil { + return localVarReturnValue, nil, reportError("writableFrontPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableFrontPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimFrontPortsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimFrontPortsDestroyExecute(r) +} + +/* +DcimFrontPortsDestroy Method for DcimFrontPortsDestroy + +Delete a front port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port. + @return ApiDcimFrontPortsDestroyRequest +*/ +func (a *DcimAPIService) DcimFrontPortsDestroy(ctx context.Context, id int32) ApiDcimFrontPortsDestroyRequest { + return ApiDcimFrontPortsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimFrontPortsDestroyExecute(r ApiDcimFrontPortsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableEnd *string + cableEndN *string + cabled *bool + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + moduleId *[]*int32 + moduleIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimFrontPortsListRequest) CableEnd(cableEnd string) ApiDcimFrontPortsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimFrontPortsListRequest) CableEndN(cableEndN string) ApiDcimFrontPortsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimFrontPortsListRequest) Cabled(cabled bool) ApiDcimFrontPortsListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimFrontPortsListRequest) Color(color []string) ApiDcimFrontPortsListRequest { + r.color = &color + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorEmpty(colorEmpty bool) ApiDcimFrontPortsListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorIc(colorIc []string) ApiDcimFrontPortsListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorIe(colorIe []string) ApiDcimFrontPortsListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorIew(colorIew []string) ApiDcimFrontPortsListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorIsw(colorIsw []string) ApiDcimFrontPortsListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorN(colorN []string) ApiDcimFrontPortsListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorNic(colorNic []string) ApiDcimFrontPortsListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorNie(colorNie []string) ApiDcimFrontPortsListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorNiew(colorNiew []string) ApiDcimFrontPortsListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiDcimFrontPortsListRequest) ColorNisw(colorNisw []string) ApiDcimFrontPortsListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiDcimFrontPortsListRequest) Created(created []time.Time) ApiDcimFrontPortsListRequest { + r.created = &created + return r +} + +func (r ApiDcimFrontPortsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimFrontPortsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimFrontPortsListRequest) CreatedGt(createdGt []time.Time) ApiDcimFrontPortsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimFrontPortsListRequest) CreatedGte(createdGte []time.Time) ApiDcimFrontPortsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimFrontPortsListRequest) CreatedLt(createdLt []time.Time) ApiDcimFrontPortsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimFrontPortsListRequest) CreatedLte(createdLte []time.Time) ApiDcimFrontPortsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimFrontPortsListRequest) CreatedN(createdN []time.Time) ApiDcimFrontPortsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimFrontPortsListRequest) CreatedByRequest(createdByRequest string) ApiDcimFrontPortsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimFrontPortsListRequest) Description(description []string) ApiDcimFrontPortsListRequest { + r.description = &description + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimFrontPortsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionIc(descriptionIc []string) ApiDcimFrontPortsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionIe(descriptionIe []string) ApiDcimFrontPortsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionIew(descriptionIew []string) ApiDcimFrontPortsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimFrontPortsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionN(descriptionN []string) ApiDcimFrontPortsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionNic(descriptionNic []string) ApiDcimFrontPortsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionNie(descriptionNie []string) ApiDcimFrontPortsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimFrontPortsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimFrontPortsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimFrontPortsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimFrontPortsListRequest) Device(device []*string) ApiDcimFrontPortsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimFrontPortsListRequest) DeviceN(deviceN []*string) ApiDcimFrontPortsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimFrontPortsListRequest) DeviceId(deviceId []int32) ApiDcimFrontPortsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimFrontPortsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimFrontPortsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimFrontPortsListRequest) DeviceRole(deviceRole []string) ApiDcimFrontPortsListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimFrontPortsListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimFrontPortsListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimFrontPortsListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimFrontPortsListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimFrontPortsListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimFrontPortsListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimFrontPortsListRequest) DeviceType(deviceType []string) ApiDcimFrontPortsListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimFrontPortsListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimFrontPortsListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimFrontPortsListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimFrontPortsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimFrontPortsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimFrontPortsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimFrontPortsListRequest) Id(id []int32) ApiDcimFrontPortsListRequest { + r.id = &id + return r +} + +func (r ApiDcimFrontPortsListRequest) IdEmpty(idEmpty bool) ApiDcimFrontPortsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimFrontPortsListRequest) IdGt(idGt []int32) ApiDcimFrontPortsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimFrontPortsListRequest) IdGte(idGte []int32) ApiDcimFrontPortsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimFrontPortsListRequest) IdLt(idLt []int32) ApiDcimFrontPortsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimFrontPortsListRequest) IdLte(idLte []int32) ApiDcimFrontPortsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimFrontPortsListRequest) IdN(idN []int32) ApiDcimFrontPortsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimFrontPortsListRequest) Label(label []string) ApiDcimFrontPortsListRequest { + r.label = &label + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelEmpty(labelEmpty bool) ApiDcimFrontPortsListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelIc(labelIc []string) ApiDcimFrontPortsListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelIe(labelIe []string) ApiDcimFrontPortsListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelIew(labelIew []string) ApiDcimFrontPortsListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelIsw(labelIsw []string) ApiDcimFrontPortsListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelN(labelN []string) ApiDcimFrontPortsListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelNic(labelNic []string) ApiDcimFrontPortsListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelNie(labelNie []string) ApiDcimFrontPortsListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelNiew(labelNiew []string) ApiDcimFrontPortsListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimFrontPortsListRequest) LabelNisw(labelNisw []string) ApiDcimFrontPortsListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimFrontPortsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimFrontPortsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimFrontPortsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimFrontPortsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimFrontPortsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimFrontPortsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimFrontPortsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimFrontPortsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimFrontPortsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimFrontPortsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimFrontPortsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimFrontPortsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimFrontPortsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimFrontPortsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimFrontPortsListRequest) Limit(limit int32) ApiDcimFrontPortsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimFrontPortsListRequest) Location(location []string) ApiDcimFrontPortsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimFrontPortsListRequest) LocationN(locationN []string) ApiDcimFrontPortsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimFrontPortsListRequest) LocationId(locationId []int32) ApiDcimFrontPortsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimFrontPortsListRequest) LocationIdN(locationIdN []int32) ApiDcimFrontPortsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimFrontPortsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimFrontPortsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module (ID) +func (r ApiDcimFrontPortsListRequest) ModuleId(moduleId []*int32) ApiDcimFrontPortsListRequest { + r.moduleId = &moduleId + return r +} + +// Module (ID) +func (r ApiDcimFrontPortsListRequest) ModuleIdN(moduleIdN []*int32) ApiDcimFrontPortsListRequest { + r.moduleIdN = &moduleIdN + return r +} + +func (r ApiDcimFrontPortsListRequest) Name(name []string) ApiDcimFrontPortsListRequest { + r.name = &name + return r +} + +func (r ApiDcimFrontPortsListRequest) NameEmpty(nameEmpty bool) ApiDcimFrontPortsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimFrontPortsListRequest) NameIc(nameIc []string) ApiDcimFrontPortsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimFrontPortsListRequest) NameIe(nameIe []string) ApiDcimFrontPortsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimFrontPortsListRequest) NameIew(nameIew []string) ApiDcimFrontPortsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimFrontPortsListRequest) NameIsw(nameIsw []string) ApiDcimFrontPortsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimFrontPortsListRequest) NameN(nameN []string) ApiDcimFrontPortsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimFrontPortsListRequest) NameNic(nameNic []string) ApiDcimFrontPortsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimFrontPortsListRequest) NameNie(nameNie []string) ApiDcimFrontPortsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimFrontPortsListRequest) NameNiew(nameNiew []string) ApiDcimFrontPortsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimFrontPortsListRequest) NameNisw(nameNisw []string) ApiDcimFrontPortsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimFrontPortsListRequest) Occupied(occupied bool) ApiDcimFrontPortsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimFrontPortsListRequest) Offset(offset int32) ApiDcimFrontPortsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimFrontPortsListRequest) Ordering(ordering string) ApiDcimFrontPortsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimFrontPortsListRequest) Q(q string) ApiDcimFrontPortsListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimFrontPortsListRequest) Rack(rack []string) ApiDcimFrontPortsListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimFrontPortsListRequest) RackN(rackN []string) ApiDcimFrontPortsListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimFrontPortsListRequest) RackId(rackId []int32) ApiDcimFrontPortsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimFrontPortsListRequest) RackIdN(rackIdN []int32) ApiDcimFrontPortsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimFrontPortsListRequest) Region(region []int32) ApiDcimFrontPortsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimFrontPortsListRequest) RegionN(regionN []int32) ApiDcimFrontPortsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimFrontPortsListRequest) RegionId(regionId []int32) ApiDcimFrontPortsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimFrontPortsListRequest) RegionIdN(regionIdN []int32) ApiDcimFrontPortsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimFrontPortsListRequest) Role(role []string) ApiDcimFrontPortsListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimFrontPortsListRequest) RoleN(roleN []string) ApiDcimFrontPortsListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimFrontPortsListRequest) RoleId(roleId []int32) ApiDcimFrontPortsListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimFrontPortsListRequest) RoleIdN(roleIdN []int32) ApiDcimFrontPortsListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimFrontPortsListRequest) Site(site []string) ApiDcimFrontPortsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimFrontPortsListRequest) SiteN(siteN []string) ApiDcimFrontPortsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimFrontPortsListRequest) SiteGroup(siteGroup []int32) ApiDcimFrontPortsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimFrontPortsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimFrontPortsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimFrontPortsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimFrontPortsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimFrontPortsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimFrontPortsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimFrontPortsListRequest) SiteId(siteId []int32) ApiDcimFrontPortsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimFrontPortsListRequest) SiteIdN(siteIdN []int32) ApiDcimFrontPortsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimFrontPortsListRequest) Tag(tag []string) ApiDcimFrontPortsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimFrontPortsListRequest) TagN(tagN []string) ApiDcimFrontPortsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimFrontPortsListRequest) Type_(type_ []string) ApiDcimFrontPortsListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimFrontPortsListRequest) TypeN(typeN []string) ApiDcimFrontPortsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimFrontPortsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimFrontPortsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimFrontPortsListRequest) VirtualChassis(virtualChassis []string) ApiDcimFrontPortsListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimFrontPortsListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimFrontPortsListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimFrontPortsListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimFrontPortsListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimFrontPortsListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimFrontPortsListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimFrontPortsListRequest) Execute() (*PaginatedFrontPortList, *http.Response, error) { + return r.ApiService.DcimFrontPortsListExecute(r) +} + +/* +DcimFrontPortsList Method for DcimFrontPortsList + +Get a list of front port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimFrontPortsListRequest +*/ +func (a *DcimAPIService) DcimFrontPortsList(ctx context.Context) ApiDcimFrontPortsListRequest { + return ApiDcimFrontPortsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedFrontPortList +func (a *DcimAPIService) DcimFrontPortsListExecute(r ApiDcimFrontPortsListRequest) (*PaginatedFrontPortList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedFrontPortList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleId != nil { + t := *r.moduleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", t, "multi") + } + } + if r.moduleIdN != nil { + t := *r.moduleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableFrontPortRequest *PatchedWritableFrontPortRequest +} + +func (r ApiDcimFrontPortsPartialUpdateRequest) PatchedWritableFrontPortRequest(patchedWritableFrontPortRequest PatchedWritableFrontPortRequest) ApiDcimFrontPortsPartialUpdateRequest { + r.patchedWritableFrontPortRequest = &patchedWritableFrontPortRequest + return r +} + +func (r ApiDcimFrontPortsPartialUpdateRequest) Execute() (*FrontPort, *http.Response, error) { + return r.ApiService.DcimFrontPortsPartialUpdateExecute(r) +} + +/* +DcimFrontPortsPartialUpdate Method for DcimFrontPortsPartialUpdate + +Patch a front port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port. + @return ApiDcimFrontPortsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortsPartialUpdate(ctx context.Context, id int32) ApiDcimFrontPortsPartialUpdateRequest { + return ApiDcimFrontPortsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FrontPort +func (a *DcimAPIService) DcimFrontPortsPartialUpdateExecute(r ApiDcimFrontPortsPartialUpdateRequest) (*FrontPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableFrontPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsPathsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimFrontPortsPathsRetrieveRequest) Execute() (*FrontPort, *http.Response, error) { + return r.ApiService.DcimFrontPortsPathsRetrieveExecute(r) +} + +/* +DcimFrontPortsPathsRetrieve Method for DcimFrontPortsPathsRetrieve + +Return all CablePaths which traverse a given pass-through port. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port. + @return ApiDcimFrontPortsPathsRetrieveRequest +*/ +func (a *DcimAPIService) DcimFrontPortsPathsRetrieve(ctx context.Context, id int32) ApiDcimFrontPortsPathsRetrieveRequest { + return ApiDcimFrontPortsPathsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FrontPort +func (a *DcimAPIService) DcimFrontPortsPathsRetrieveExecute(r ApiDcimFrontPortsPathsRetrieveRequest) (*FrontPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsPathsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/{id}/paths/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimFrontPortsRetrieveRequest) Execute() (*FrontPort, *http.Response, error) { + return r.ApiService.DcimFrontPortsRetrieveExecute(r) +} + +/* +DcimFrontPortsRetrieve Method for DcimFrontPortsRetrieve + +Get a front port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port. + @return ApiDcimFrontPortsRetrieveRequest +*/ +func (a *DcimAPIService) DcimFrontPortsRetrieve(ctx context.Context, id int32) ApiDcimFrontPortsRetrieveRequest { + return ApiDcimFrontPortsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FrontPort +func (a *DcimAPIService) DcimFrontPortsRetrieveExecute(r ApiDcimFrontPortsRetrieveRequest) (*FrontPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimFrontPortsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableFrontPortRequest *WritableFrontPortRequest +} + +func (r ApiDcimFrontPortsUpdateRequest) WritableFrontPortRequest(writableFrontPortRequest WritableFrontPortRequest) ApiDcimFrontPortsUpdateRequest { + r.writableFrontPortRequest = &writableFrontPortRequest + return r +} + +func (r ApiDcimFrontPortsUpdateRequest) Execute() (*FrontPort, *http.Response, error) { + return r.ApiService.DcimFrontPortsUpdateExecute(r) +} + +/* +DcimFrontPortsUpdate Method for DcimFrontPortsUpdate + +Put a front port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this front port. + @return ApiDcimFrontPortsUpdateRequest +*/ +func (a *DcimAPIService) DcimFrontPortsUpdate(ctx context.Context, id int32) ApiDcimFrontPortsUpdateRequest { + return ApiDcimFrontPortsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FrontPort +func (a *DcimAPIService) DcimFrontPortsUpdateExecute(r ApiDcimFrontPortsUpdateRequest) (*FrontPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FrontPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimFrontPortsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/front-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableFrontPortRequest == nil { + return localVarReturnValue, nil, reportError("writableFrontPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableFrontPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + interfaceTemplateRequest *[]InterfaceTemplateRequest +} + +func (r ApiDcimInterfaceTemplatesBulkDestroyRequest) InterfaceTemplateRequest(interfaceTemplateRequest []InterfaceTemplateRequest) ApiDcimInterfaceTemplatesBulkDestroyRequest { + r.interfaceTemplateRequest = &interfaceTemplateRequest + return r +} + +func (r ApiDcimInterfaceTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesBulkDestroyExecute(r) +} + +/* +DcimInterfaceTemplatesBulkDestroy Method for DcimInterfaceTemplatesBulkDestroy + +Delete a list of interface template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfaceTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesBulkDestroy(ctx context.Context) ApiDcimInterfaceTemplatesBulkDestroyRequest { + return ApiDcimInterfaceTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInterfaceTemplatesBulkDestroyExecute(r ApiDcimInterfaceTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.interfaceTemplateRequest == nil { + return nil, reportError("interfaceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.interfaceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + interfaceTemplateRequest *[]InterfaceTemplateRequest +} + +func (r ApiDcimInterfaceTemplatesBulkPartialUpdateRequest) InterfaceTemplateRequest(interfaceTemplateRequest []InterfaceTemplateRequest) ApiDcimInterfaceTemplatesBulkPartialUpdateRequest { + r.interfaceTemplateRequest = &interfaceTemplateRequest + return r +} + +func (r ApiDcimInterfaceTemplatesBulkPartialUpdateRequest) Execute() ([]InterfaceTemplate, *http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimInterfaceTemplatesBulkPartialUpdate Method for DcimInterfaceTemplatesBulkPartialUpdate + +Patch a list of interface template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfaceTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimInterfaceTemplatesBulkPartialUpdateRequest { + return ApiDcimInterfaceTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InterfaceTemplate +func (a *DcimAPIService) DcimInterfaceTemplatesBulkPartialUpdateExecute(r ApiDcimInterfaceTemplatesBulkPartialUpdateRequest) ([]InterfaceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InterfaceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.interfaceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("interfaceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.interfaceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + interfaceTemplateRequest *[]InterfaceTemplateRequest +} + +func (r ApiDcimInterfaceTemplatesBulkUpdateRequest) InterfaceTemplateRequest(interfaceTemplateRequest []InterfaceTemplateRequest) ApiDcimInterfaceTemplatesBulkUpdateRequest { + r.interfaceTemplateRequest = &interfaceTemplateRequest + return r +} + +func (r ApiDcimInterfaceTemplatesBulkUpdateRequest) Execute() ([]InterfaceTemplate, *http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesBulkUpdateExecute(r) +} + +/* +DcimInterfaceTemplatesBulkUpdate Method for DcimInterfaceTemplatesBulkUpdate + +Put a list of interface template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfaceTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesBulkUpdate(ctx context.Context) ApiDcimInterfaceTemplatesBulkUpdateRequest { + return ApiDcimInterfaceTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InterfaceTemplate +func (a *DcimAPIService) DcimInterfaceTemplatesBulkUpdateExecute(r ApiDcimInterfaceTemplatesBulkUpdateRequest) ([]InterfaceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InterfaceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.interfaceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("interfaceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.interfaceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableInterfaceTemplateRequest *WritableInterfaceTemplateRequest +} + +func (r ApiDcimInterfaceTemplatesCreateRequest) WritableInterfaceTemplateRequest(writableInterfaceTemplateRequest WritableInterfaceTemplateRequest) ApiDcimInterfaceTemplatesCreateRequest { + r.writableInterfaceTemplateRequest = &writableInterfaceTemplateRequest + return r +} + +func (r ApiDcimInterfaceTemplatesCreateRequest) Execute() (*InterfaceTemplate, *http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesCreateExecute(r) +} + +/* +DcimInterfaceTemplatesCreate Method for DcimInterfaceTemplatesCreate + +Post a list of interface template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfaceTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesCreate(ctx context.Context) ApiDcimInterfaceTemplatesCreateRequest { + return ApiDcimInterfaceTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InterfaceTemplate +func (a *DcimAPIService) DcimInterfaceTemplatesCreateExecute(r ApiDcimInterfaceTemplatesCreateRequest) (*InterfaceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterfaceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInterfaceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableInterfaceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInterfaceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInterfaceTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesDestroyExecute(r) +} + +/* +DcimInterfaceTemplatesDestroy Method for DcimInterfaceTemplatesDestroy + +Delete a interface template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface template. + @return ApiDcimInterfaceTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesDestroy(ctx context.Context, id int32) ApiDcimInterfaceTemplatesDestroyRequest { + return ApiDcimInterfaceTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInterfaceTemplatesDestroyExecute(r ApiDcimInterfaceTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + bridgeId *[]int32 + bridgeIdN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]*int32 + devicetypeIdN *[]*int32 + enabled *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + mgmtOnly *bool + modifiedByRequest *string + moduletypeId *[]*int32 + moduletypeIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + poeMode *[]string + poeModeN *[]string + poeType *[]string + poeTypeN *[]string + q *string + rfRole *[]string + rfRoleN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string +} + +func (r ApiDcimInterfaceTemplatesListRequest) BridgeId(bridgeId []int32) ApiDcimInterfaceTemplatesListRequest { + r.bridgeId = &bridgeId + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) BridgeIdN(bridgeIdN []int32) ApiDcimInterfaceTemplatesListRequest { + r.bridgeIdN = &bridgeIdN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) Created(created []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimInterfaceTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) Description(description []string) ApiDcimInterfaceTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimInterfaceTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimInterfaceTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimInterfaceTemplatesListRequest) DevicetypeId(devicetypeId []*int32) ApiDcimInterfaceTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimInterfaceTemplatesListRequest) DevicetypeIdN(devicetypeIdN []*int32) ApiDcimInterfaceTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) Enabled(enabled bool) ApiDcimInterfaceTemplatesListRequest { + r.enabled = &enabled + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) Id(id []int32) ApiDcimInterfaceTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimInterfaceTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) IdGt(idGt []int32) ApiDcimInterfaceTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) IdGte(idGte []int32) ApiDcimInterfaceTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) IdLt(idLt []int32) ApiDcimInterfaceTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) IdLte(idLte []int32) ApiDcimInterfaceTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) IdN(idN []int32) ApiDcimInterfaceTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimInterfaceTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimInterfaceTemplatesListRequest) Limit(limit int32) ApiDcimInterfaceTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) MgmtOnly(mgmtOnly bool) ApiDcimInterfaceTemplatesListRequest { + r.mgmtOnly = &mgmtOnly + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimInterfaceTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module type (ID) +func (r ApiDcimInterfaceTemplatesListRequest) ModuletypeId(moduletypeId []*int32) ApiDcimInterfaceTemplatesListRequest { + r.moduletypeId = &moduletypeId + return r +} + +// Module type (ID) +func (r ApiDcimInterfaceTemplatesListRequest) ModuletypeIdN(moduletypeIdN []*int32) ApiDcimInterfaceTemplatesListRequest { + r.moduletypeIdN = &moduletypeIdN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) Name(name []string) ApiDcimInterfaceTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimInterfaceTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameIc(nameIc []string) ApiDcimInterfaceTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameIe(nameIe []string) ApiDcimInterfaceTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameIew(nameIew []string) ApiDcimInterfaceTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimInterfaceTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameN(nameN []string) ApiDcimInterfaceTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameNic(nameNic []string) ApiDcimInterfaceTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameNie(nameNie []string) ApiDcimInterfaceTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimInterfaceTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimInterfaceTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimInterfaceTemplatesListRequest) Offset(offset int32) ApiDcimInterfaceTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimInterfaceTemplatesListRequest) Ordering(ordering string) ApiDcimInterfaceTemplatesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) PoeMode(poeMode []string) ApiDcimInterfaceTemplatesListRequest { + r.poeMode = &poeMode + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) PoeModeN(poeModeN []string) ApiDcimInterfaceTemplatesListRequest { + r.poeModeN = &poeModeN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) PoeType(poeType []string) ApiDcimInterfaceTemplatesListRequest { + r.poeType = &poeType + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) PoeTypeN(poeTypeN []string) ApiDcimInterfaceTemplatesListRequest { + r.poeTypeN = &poeTypeN + return r +} + +// Search +func (r ApiDcimInterfaceTemplatesListRequest) Q(q string) ApiDcimInterfaceTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) RfRole(rfRole []string) ApiDcimInterfaceTemplatesListRequest { + r.rfRole = &rfRole + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) RfRoleN(rfRoleN []string) ApiDcimInterfaceTemplatesListRequest { + r.rfRoleN = &rfRoleN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) Type_(type_ []string) ApiDcimInterfaceTemplatesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) TypeN(typeN []string) ApiDcimInterfaceTemplatesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimInterfaceTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimInterfaceTemplatesListRequest) Execute() (*PaginatedInterfaceTemplateList, *http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesListExecute(r) +} + +/* +DcimInterfaceTemplatesList Method for DcimInterfaceTemplatesList + +Get a list of interface template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfaceTemplatesListRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesList(ctx context.Context) ApiDcimInterfaceTemplatesListRequest { + return ApiDcimInterfaceTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInterfaceTemplateList +func (a *DcimAPIService) DcimInterfaceTemplatesListExecute(r ApiDcimInterfaceTemplatesListRequest) (*PaginatedInterfaceTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInterfaceTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.bridgeId != nil { + t := *r.bridgeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id", t, "multi") + } + } + if r.bridgeIdN != nil { + t := *r.bridgeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.mgmtOnly != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mgmt_only", r.mgmtOnly, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduletypeId != nil { + t := *r.moduletypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", t, "multi") + } + } + if r.moduletypeIdN != nil { + t := *r.moduletypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.poeMode != nil { + t := *r.poeMode + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode", t, "multi") + } + } + if r.poeModeN != nil { + t := *r.poeModeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode__n", t, "multi") + } + } + if r.poeType != nil { + t := *r.poeType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type", t, "multi") + } + } + if r.poeTypeN != nil { + t := *r.poeTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rfRole != nil { + t := *r.rfRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role", t, "multi") + } + } + if r.rfRoleN != nil { + t := *r.rfRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableInterfaceTemplateRequest *PatchedWritableInterfaceTemplateRequest +} + +func (r ApiDcimInterfaceTemplatesPartialUpdateRequest) PatchedWritableInterfaceTemplateRequest(patchedWritableInterfaceTemplateRequest PatchedWritableInterfaceTemplateRequest) ApiDcimInterfaceTemplatesPartialUpdateRequest { + r.patchedWritableInterfaceTemplateRequest = &patchedWritableInterfaceTemplateRequest + return r +} + +func (r ApiDcimInterfaceTemplatesPartialUpdateRequest) Execute() (*InterfaceTemplate, *http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesPartialUpdateExecute(r) +} + +/* +DcimInterfaceTemplatesPartialUpdate Method for DcimInterfaceTemplatesPartialUpdate + +Patch a interface template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface template. + @return ApiDcimInterfaceTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimInterfaceTemplatesPartialUpdateRequest { + return ApiDcimInterfaceTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InterfaceTemplate +func (a *DcimAPIService) DcimInterfaceTemplatesPartialUpdateExecute(r ApiDcimInterfaceTemplatesPartialUpdateRequest) (*InterfaceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterfaceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableInterfaceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInterfaceTemplatesRetrieveRequest) Execute() (*InterfaceTemplate, *http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesRetrieveExecute(r) +} + +/* +DcimInterfaceTemplatesRetrieve Method for DcimInterfaceTemplatesRetrieve + +Get a interface template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface template. + @return ApiDcimInterfaceTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesRetrieve(ctx context.Context, id int32) ApiDcimInterfaceTemplatesRetrieveRequest { + return ApiDcimInterfaceTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InterfaceTemplate +func (a *DcimAPIService) DcimInterfaceTemplatesRetrieveExecute(r ApiDcimInterfaceTemplatesRetrieveRequest) (*InterfaceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterfaceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfaceTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableInterfaceTemplateRequest *WritableInterfaceTemplateRequest +} + +func (r ApiDcimInterfaceTemplatesUpdateRequest) WritableInterfaceTemplateRequest(writableInterfaceTemplateRequest WritableInterfaceTemplateRequest) ApiDcimInterfaceTemplatesUpdateRequest { + r.writableInterfaceTemplateRequest = &writableInterfaceTemplateRequest + return r +} + +func (r ApiDcimInterfaceTemplatesUpdateRequest) Execute() (*InterfaceTemplate, *http.Response, error) { + return r.ApiService.DcimInterfaceTemplatesUpdateExecute(r) +} + +/* +DcimInterfaceTemplatesUpdate Method for DcimInterfaceTemplatesUpdate + +Put a interface template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface template. + @return ApiDcimInterfaceTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfaceTemplatesUpdate(ctx context.Context, id int32) ApiDcimInterfaceTemplatesUpdateRequest { + return ApiDcimInterfaceTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InterfaceTemplate +func (a *DcimAPIService) DcimInterfaceTemplatesUpdateExecute(r ApiDcimInterfaceTemplatesUpdateRequest) (*InterfaceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterfaceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfaceTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interface-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInterfaceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableInterfaceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInterfaceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + interfaceRequest *[]InterfaceRequest +} + +func (r ApiDcimInterfacesBulkDestroyRequest) InterfaceRequest(interfaceRequest []InterfaceRequest) ApiDcimInterfacesBulkDestroyRequest { + r.interfaceRequest = &interfaceRequest + return r +} + +func (r ApiDcimInterfacesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInterfacesBulkDestroyExecute(r) +} + +/* +DcimInterfacesBulkDestroy Method for DcimInterfacesBulkDestroy + +Delete a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfacesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimInterfacesBulkDestroy(ctx context.Context) ApiDcimInterfacesBulkDestroyRequest { + return ApiDcimInterfacesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInterfacesBulkDestroyExecute(r ApiDcimInterfacesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.interfaceRequest == nil { + return nil, reportError("interfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.interfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInterfacesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + interfaceRequest *[]InterfaceRequest +} + +func (r ApiDcimInterfacesBulkPartialUpdateRequest) InterfaceRequest(interfaceRequest []InterfaceRequest) ApiDcimInterfacesBulkPartialUpdateRequest { + r.interfaceRequest = &interfaceRequest + return r +} + +func (r ApiDcimInterfacesBulkPartialUpdateRequest) Execute() ([]Interface, *http.Response, error) { + return r.ApiService.DcimInterfacesBulkPartialUpdateExecute(r) +} + +/* +DcimInterfacesBulkPartialUpdate Method for DcimInterfacesBulkPartialUpdate + +Patch a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfacesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfacesBulkPartialUpdate(ctx context.Context) ApiDcimInterfacesBulkPartialUpdateRequest { + return ApiDcimInterfacesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Interface +func (a *DcimAPIService) DcimInterfacesBulkPartialUpdateExecute(r ApiDcimInterfacesBulkPartialUpdateRequest) ([]Interface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Interface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.interfaceRequest == nil { + return localVarReturnValue, nil, reportError("interfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.interfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + interfaceRequest *[]InterfaceRequest +} + +func (r ApiDcimInterfacesBulkUpdateRequest) InterfaceRequest(interfaceRequest []InterfaceRequest) ApiDcimInterfacesBulkUpdateRequest { + r.interfaceRequest = &interfaceRequest + return r +} + +func (r ApiDcimInterfacesBulkUpdateRequest) Execute() ([]Interface, *http.Response, error) { + return r.ApiService.DcimInterfacesBulkUpdateExecute(r) +} + +/* +DcimInterfacesBulkUpdate Method for DcimInterfacesBulkUpdate + +Put a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfacesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfacesBulkUpdate(ctx context.Context) ApiDcimInterfacesBulkUpdateRequest { + return ApiDcimInterfacesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Interface +func (a *DcimAPIService) DcimInterfacesBulkUpdateExecute(r ApiDcimInterfacesBulkUpdateRequest) ([]Interface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Interface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.interfaceRequest == nil { + return localVarReturnValue, nil, reportError("interfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.interfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableInterfaceRequest *WritableInterfaceRequest +} + +func (r ApiDcimInterfacesCreateRequest) WritableInterfaceRequest(writableInterfaceRequest WritableInterfaceRequest) ApiDcimInterfacesCreateRequest { + r.writableInterfaceRequest = &writableInterfaceRequest + return r +} + +func (r ApiDcimInterfacesCreateRequest) Execute() (*Interface, *http.Response, error) { + return r.ApiService.DcimInterfacesCreateExecute(r) +} + +/* +DcimInterfacesCreate Method for DcimInterfacesCreate + +Post a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfacesCreateRequest +*/ +func (a *DcimAPIService) DcimInterfacesCreate(ctx context.Context) ApiDcimInterfacesCreateRequest { + return ApiDcimInterfacesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Interface +func (a *DcimAPIService) DcimInterfacesCreateExecute(r ApiDcimInterfacesCreateRequest) (*Interface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInterfaceRequest == nil { + return localVarReturnValue, nil, reportError("writableInterfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInterfacesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInterfacesDestroyExecute(r) +} + +/* +DcimInterfacesDestroy Method for DcimInterfacesDestroy + +Delete a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiDcimInterfacesDestroyRequest +*/ +func (a *DcimAPIService) DcimInterfacesDestroy(ctx context.Context, id int32) ApiDcimInterfacesDestroyRequest { + return ApiDcimInterfacesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInterfacesDestroyExecute(r ApiDcimInterfacesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInterfacesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + bridgeId *[]int32 + bridgeIdN *[]int32 + cableEnd *string + cableEndN *string + cabled *bool + connected *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + duplex *[]*string + duplexN *[]*string + enabled *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + kind *string + l2vpn *[]*int64 + l2vpnN *[]*int64 + l2vpnId *[]int32 + l2vpnIdN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lagId *[]int32 + lagIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + macAddress *[]string + macAddressIc *[]string + macAddressIe *[]string + macAddressIew *[]string + macAddressIsw *[]string + macAddressN *[]string + macAddressNic *[]string + macAddressNie *[]string + macAddressNiew *[]string + macAddressNisw *[]string + mgmtOnly *bool + mode *string + modeN *string + modifiedByRequest *string + moduleId *[]*int32 + moduleIdN *[]*int32 + mtu *[]int32 + mtuEmpty *bool + mtuGt *[]int32 + mtuGte *[]int32 + mtuLt *[]int32 + mtuLte *[]int32 + mtuN *[]int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + parentId *[]int32 + parentIdN *[]int32 + poeMode *[]string + poeModeN *[]string + poeType *[]string + poeTypeN *[]string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + rfChannel *[]string + rfChannelN *[]string + rfChannelFrequency *[]float64 + rfChannelFrequencyEmpty *bool + rfChannelFrequencyGt *[]float64 + rfChannelFrequencyGte *[]float64 + rfChannelFrequencyLt *[]float64 + rfChannelFrequencyLte *[]float64 + rfChannelFrequencyN *[]float64 + rfChannelWidth *[]float64 + rfChannelWidthEmpty *bool + rfChannelWidthGt *[]float64 + rfChannelWidthGte *[]float64 + rfChannelWidthLt *[]float64 + rfChannelWidthLte *[]float64 + rfChannelWidthN *[]float64 + rfRole *[]string + rfRoleN *[]string + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + speed *[]int32 + speedEmpty *[]int32 + speedGt *[]int32 + speedGte *[]int32 + speedLt *[]int32 + speedLte *[]int32 + speedN *[]int32 + tag *[]string + tagN *[]string + txPower *[]int32 + txPowerEmpty *bool + txPowerGt *[]int32 + txPowerGte *[]int32 + txPowerLt *[]int32 + txPowerLte *[]int32 + txPowerN *[]int32 + type_ *[]string + typeN *[]string + updatedByRequest *string + vdc *[]string + vdcN *[]string + vdcId *[]int32 + vdcIdN *[]int32 + vdcIdentifier *[]*int32 + vdcIdentifierN *[]*int32 + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 + virtualChassisMember *[]string + virtualChassisMemberId *[]int32 + vlan *string + vlanId *string + vrf *[]*string + vrfN *[]*string + vrfId *[]int32 + vrfIdN *[]int32 + wwn *[]string + wwnIc *[]string + wwnIe *[]string + wwnIew *[]string + wwnIsw *[]string + wwnN *[]string + wwnNic *[]string + wwnNie *[]string + wwnNiew *[]string + wwnNisw *[]string +} + +// Bridged interface (ID) +func (r ApiDcimInterfacesListRequest) BridgeId(bridgeId []int32) ApiDcimInterfacesListRequest { + r.bridgeId = &bridgeId + return r +} + +// Bridged interface (ID) +func (r ApiDcimInterfacesListRequest) BridgeIdN(bridgeIdN []int32) ApiDcimInterfacesListRequest { + r.bridgeIdN = &bridgeIdN + return r +} + +func (r ApiDcimInterfacesListRequest) CableEnd(cableEnd string) ApiDcimInterfacesListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimInterfacesListRequest) CableEndN(cableEndN string) ApiDcimInterfacesListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimInterfacesListRequest) Cabled(cabled bool) ApiDcimInterfacesListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimInterfacesListRequest) Connected(connected bool) ApiDcimInterfacesListRequest { + r.connected = &connected + return r +} + +func (r ApiDcimInterfacesListRequest) Created(created []time.Time) ApiDcimInterfacesListRequest { + r.created = &created + return r +} + +func (r ApiDcimInterfacesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimInterfacesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) CreatedGt(createdGt []time.Time) ApiDcimInterfacesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimInterfacesListRequest) CreatedGte(createdGte []time.Time) ApiDcimInterfacesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimInterfacesListRequest) CreatedLt(createdLt []time.Time) ApiDcimInterfacesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimInterfacesListRequest) CreatedLte(createdLte []time.Time) ApiDcimInterfacesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimInterfacesListRequest) CreatedN(createdN []time.Time) ApiDcimInterfacesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimInterfacesListRequest) CreatedByRequest(createdByRequest string) ApiDcimInterfacesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimInterfacesListRequest) Description(description []string) ApiDcimInterfacesListRequest { + r.description = &description + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimInterfacesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionIc(descriptionIc []string) ApiDcimInterfacesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionIe(descriptionIe []string) ApiDcimInterfacesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionIew(descriptionIew []string) ApiDcimInterfacesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimInterfacesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionN(descriptionN []string) ApiDcimInterfacesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionNic(descriptionNic []string) ApiDcimInterfacesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionNie(descriptionNie []string) ApiDcimInterfacesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimInterfacesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimInterfacesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimInterfacesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimInterfacesListRequest) Device(device []*string) ApiDcimInterfacesListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimInterfacesListRequest) DeviceN(deviceN []*string) ApiDcimInterfacesListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimInterfacesListRequest) DeviceId(deviceId []int32) ApiDcimInterfacesListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimInterfacesListRequest) DeviceIdN(deviceIdN []int32) ApiDcimInterfacesListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimInterfacesListRequest) DeviceRole(deviceRole []string) ApiDcimInterfacesListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimInterfacesListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimInterfacesListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimInterfacesListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimInterfacesListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimInterfacesListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimInterfacesListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimInterfacesListRequest) DeviceType(deviceType []string) ApiDcimInterfacesListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimInterfacesListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimInterfacesListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimInterfacesListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimInterfacesListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimInterfacesListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimInterfacesListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimInterfacesListRequest) Duplex(duplex []*string) ApiDcimInterfacesListRequest { + r.duplex = &duplex + return r +} + +func (r ApiDcimInterfacesListRequest) DuplexN(duplexN []*string) ApiDcimInterfacesListRequest { + r.duplexN = &duplexN + return r +} + +func (r ApiDcimInterfacesListRequest) Enabled(enabled bool) ApiDcimInterfacesListRequest { + r.enabled = &enabled + return r +} + +func (r ApiDcimInterfacesListRequest) Id(id []int32) ApiDcimInterfacesListRequest { + r.id = &id + return r +} + +func (r ApiDcimInterfacesListRequest) IdEmpty(idEmpty bool) ApiDcimInterfacesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) IdGt(idGt []int32) ApiDcimInterfacesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimInterfacesListRequest) IdGte(idGte []int32) ApiDcimInterfacesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimInterfacesListRequest) IdLt(idLt []int32) ApiDcimInterfacesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimInterfacesListRequest) IdLte(idLte []int32) ApiDcimInterfacesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimInterfacesListRequest) IdN(idN []int32) ApiDcimInterfacesListRequest { + r.idN = &idN + return r +} + +// Kind of interface +func (r ApiDcimInterfacesListRequest) Kind(kind string) ApiDcimInterfacesListRequest { + r.kind = &kind + return r +} + +// L2VPN +func (r ApiDcimInterfacesListRequest) L2vpn(l2vpn []*int64) ApiDcimInterfacesListRequest { + r.l2vpn = &l2vpn + return r +} + +// L2VPN +func (r ApiDcimInterfacesListRequest) L2vpnN(l2vpnN []*int64) ApiDcimInterfacesListRequest { + r.l2vpnN = &l2vpnN + return r +} + +// L2VPN (ID) +func (r ApiDcimInterfacesListRequest) L2vpnId(l2vpnId []int32) ApiDcimInterfacesListRequest { + r.l2vpnId = &l2vpnId + return r +} + +// L2VPN (ID) +func (r ApiDcimInterfacesListRequest) L2vpnIdN(l2vpnIdN []int32) ApiDcimInterfacesListRequest { + r.l2vpnIdN = &l2vpnIdN + return r +} + +func (r ApiDcimInterfacesListRequest) Label(label []string) ApiDcimInterfacesListRequest { + r.label = &label + return r +} + +func (r ApiDcimInterfacesListRequest) LabelEmpty(labelEmpty bool) ApiDcimInterfacesListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) LabelIc(labelIc []string) ApiDcimInterfacesListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimInterfacesListRequest) LabelIe(labelIe []string) ApiDcimInterfacesListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimInterfacesListRequest) LabelIew(labelIew []string) ApiDcimInterfacesListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimInterfacesListRequest) LabelIsw(labelIsw []string) ApiDcimInterfacesListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimInterfacesListRequest) LabelN(labelN []string) ApiDcimInterfacesListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimInterfacesListRequest) LabelNic(labelNic []string) ApiDcimInterfacesListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimInterfacesListRequest) LabelNie(labelNie []string) ApiDcimInterfacesListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimInterfacesListRequest) LabelNiew(labelNiew []string) ApiDcimInterfacesListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimInterfacesListRequest) LabelNisw(labelNisw []string) ApiDcimInterfacesListRequest { + r.labelNisw = &labelNisw + return r +} + +// LAG interface (ID) +func (r ApiDcimInterfacesListRequest) LagId(lagId []int32) ApiDcimInterfacesListRequest { + r.lagId = &lagId + return r +} + +// LAG interface (ID) +func (r ApiDcimInterfacesListRequest) LagIdN(lagIdN []int32) ApiDcimInterfacesListRequest { + r.lagIdN = &lagIdN + return r +} + +func (r ApiDcimInterfacesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimInterfacesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimInterfacesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimInterfacesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimInterfacesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimInterfacesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimInterfacesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimInterfacesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimInterfacesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimInterfacesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimInterfacesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimInterfacesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimInterfacesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimInterfacesListRequest) Limit(limit int32) ApiDcimInterfacesListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimInterfacesListRequest) Location(location []string) ApiDcimInterfacesListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimInterfacesListRequest) LocationN(locationN []string) ApiDcimInterfacesListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimInterfacesListRequest) LocationId(locationId []int32) ApiDcimInterfacesListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimInterfacesListRequest) LocationIdN(locationIdN []int32) ApiDcimInterfacesListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddress(macAddress []string) ApiDcimInterfacesListRequest { + r.macAddress = &macAddress + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressIc(macAddressIc []string) ApiDcimInterfacesListRequest { + r.macAddressIc = &macAddressIc + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressIe(macAddressIe []string) ApiDcimInterfacesListRequest { + r.macAddressIe = &macAddressIe + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressIew(macAddressIew []string) ApiDcimInterfacesListRequest { + r.macAddressIew = &macAddressIew + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressIsw(macAddressIsw []string) ApiDcimInterfacesListRequest { + r.macAddressIsw = &macAddressIsw + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressN(macAddressN []string) ApiDcimInterfacesListRequest { + r.macAddressN = &macAddressN + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressNic(macAddressNic []string) ApiDcimInterfacesListRequest { + r.macAddressNic = &macAddressNic + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressNie(macAddressNie []string) ApiDcimInterfacesListRequest { + r.macAddressNie = &macAddressNie + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressNiew(macAddressNiew []string) ApiDcimInterfacesListRequest { + r.macAddressNiew = &macAddressNiew + return r +} + +func (r ApiDcimInterfacesListRequest) MacAddressNisw(macAddressNisw []string) ApiDcimInterfacesListRequest { + r.macAddressNisw = &macAddressNisw + return r +} + +func (r ApiDcimInterfacesListRequest) MgmtOnly(mgmtOnly bool) ApiDcimInterfacesListRequest { + r.mgmtOnly = &mgmtOnly + return r +} + +// IEEE 802.1Q tagging strategy +func (r ApiDcimInterfacesListRequest) Mode(mode string) ApiDcimInterfacesListRequest { + r.mode = &mode + return r +} + +// IEEE 802.1Q tagging strategy +func (r ApiDcimInterfacesListRequest) ModeN(modeN string) ApiDcimInterfacesListRequest { + r.modeN = &modeN + return r +} + +func (r ApiDcimInterfacesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimInterfacesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module (ID) +func (r ApiDcimInterfacesListRequest) ModuleId(moduleId []*int32) ApiDcimInterfacesListRequest { + r.moduleId = &moduleId + return r +} + +// Module (ID) +func (r ApiDcimInterfacesListRequest) ModuleIdN(moduleIdN []*int32) ApiDcimInterfacesListRequest { + r.moduleIdN = &moduleIdN + return r +} + +func (r ApiDcimInterfacesListRequest) Mtu(mtu []int32) ApiDcimInterfacesListRequest { + r.mtu = &mtu + return r +} + +func (r ApiDcimInterfacesListRequest) MtuEmpty(mtuEmpty bool) ApiDcimInterfacesListRequest { + r.mtuEmpty = &mtuEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) MtuGt(mtuGt []int32) ApiDcimInterfacesListRequest { + r.mtuGt = &mtuGt + return r +} + +func (r ApiDcimInterfacesListRequest) MtuGte(mtuGte []int32) ApiDcimInterfacesListRequest { + r.mtuGte = &mtuGte + return r +} + +func (r ApiDcimInterfacesListRequest) MtuLt(mtuLt []int32) ApiDcimInterfacesListRequest { + r.mtuLt = &mtuLt + return r +} + +func (r ApiDcimInterfacesListRequest) MtuLte(mtuLte []int32) ApiDcimInterfacesListRequest { + r.mtuLte = &mtuLte + return r +} + +func (r ApiDcimInterfacesListRequest) MtuN(mtuN []int32) ApiDcimInterfacesListRequest { + r.mtuN = &mtuN + return r +} + +func (r ApiDcimInterfacesListRequest) Name(name []string) ApiDcimInterfacesListRequest { + r.name = &name + return r +} + +func (r ApiDcimInterfacesListRequest) NameEmpty(nameEmpty bool) ApiDcimInterfacesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) NameIc(nameIc []string) ApiDcimInterfacesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimInterfacesListRequest) NameIe(nameIe []string) ApiDcimInterfacesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimInterfacesListRequest) NameIew(nameIew []string) ApiDcimInterfacesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimInterfacesListRequest) NameIsw(nameIsw []string) ApiDcimInterfacesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimInterfacesListRequest) NameN(nameN []string) ApiDcimInterfacesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimInterfacesListRequest) NameNic(nameNic []string) ApiDcimInterfacesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimInterfacesListRequest) NameNie(nameNie []string) ApiDcimInterfacesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimInterfacesListRequest) NameNiew(nameNiew []string) ApiDcimInterfacesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimInterfacesListRequest) NameNisw(nameNisw []string) ApiDcimInterfacesListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimInterfacesListRequest) Occupied(occupied bool) ApiDcimInterfacesListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimInterfacesListRequest) Offset(offset int32) ApiDcimInterfacesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimInterfacesListRequest) Ordering(ordering string) ApiDcimInterfacesListRequest { + r.ordering = &ordering + return r +} + +// Parent interface (ID) +func (r ApiDcimInterfacesListRequest) ParentId(parentId []int32) ApiDcimInterfacesListRequest { + r.parentId = &parentId + return r +} + +// Parent interface (ID) +func (r ApiDcimInterfacesListRequest) ParentIdN(parentIdN []int32) ApiDcimInterfacesListRequest { + r.parentIdN = &parentIdN + return r +} + +func (r ApiDcimInterfacesListRequest) PoeMode(poeMode []string) ApiDcimInterfacesListRequest { + r.poeMode = &poeMode + return r +} + +func (r ApiDcimInterfacesListRequest) PoeModeN(poeModeN []string) ApiDcimInterfacesListRequest { + r.poeModeN = &poeModeN + return r +} + +func (r ApiDcimInterfacesListRequest) PoeType(poeType []string) ApiDcimInterfacesListRequest { + r.poeType = &poeType + return r +} + +func (r ApiDcimInterfacesListRequest) PoeTypeN(poeTypeN []string) ApiDcimInterfacesListRequest { + r.poeTypeN = &poeTypeN + return r +} + +// Search +func (r ApiDcimInterfacesListRequest) Q(q string) ApiDcimInterfacesListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimInterfacesListRequest) Rack(rack []string) ApiDcimInterfacesListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimInterfacesListRequest) RackN(rackN []string) ApiDcimInterfacesListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimInterfacesListRequest) RackId(rackId []int32) ApiDcimInterfacesListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimInterfacesListRequest) RackIdN(rackIdN []int32) ApiDcimInterfacesListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimInterfacesListRequest) Region(region []int32) ApiDcimInterfacesListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimInterfacesListRequest) RegionN(regionN []int32) ApiDcimInterfacesListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimInterfacesListRequest) RegionId(regionId []int32) ApiDcimInterfacesListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimInterfacesListRequest) RegionIdN(regionIdN []int32) ApiDcimInterfacesListRequest { + r.regionIdN = ®ionIdN + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannel(rfChannel []string) ApiDcimInterfacesListRequest { + r.rfChannel = &rfChannel + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelN(rfChannelN []string) ApiDcimInterfacesListRequest { + r.rfChannelN = &rfChannelN + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelFrequency(rfChannelFrequency []float64) ApiDcimInterfacesListRequest { + r.rfChannelFrequency = &rfChannelFrequency + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelFrequencyEmpty(rfChannelFrequencyEmpty bool) ApiDcimInterfacesListRequest { + r.rfChannelFrequencyEmpty = &rfChannelFrequencyEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelFrequencyGt(rfChannelFrequencyGt []float64) ApiDcimInterfacesListRequest { + r.rfChannelFrequencyGt = &rfChannelFrequencyGt + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelFrequencyGte(rfChannelFrequencyGte []float64) ApiDcimInterfacesListRequest { + r.rfChannelFrequencyGte = &rfChannelFrequencyGte + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelFrequencyLt(rfChannelFrequencyLt []float64) ApiDcimInterfacesListRequest { + r.rfChannelFrequencyLt = &rfChannelFrequencyLt + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelFrequencyLte(rfChannelFrequencyLte []float64) ApiDcimInterfacesListRequest { + r.rfChannelFrequencyLte = &rfChannelFrequencyLte + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelFrequencyN(rfChannelFrequencyN []float64) ApiDcimInterfacesListRequest { + r.rfChannelFrequencyN = &rfChannelFrequencyN + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelWidth(rfChannelWidth []float64) ApiDcimInterfacesListRequest { + r.rfChannelWidth = &rfChannelWidth + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelWidthEmpty(rfChannelWidthEmpty bool) ApiDcimInterfacesListRequest { + r.rfChannelWidthEmpty = &rfChannelWidthEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelWidthGt(rfChannelWidthGt []float64) ApiDcimInterfacesListRequest { + r.rfChannelWidthGt = &rfChannelWidthGt + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelWidthGte(rfChannelWidthGte []float64) ApiDcimInterfacesListRequest { + r.rfChannelWidthGte = &rfChannelWidthGte + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelWidthLt(rfChannelWidthLt []float64) ApiDcimInterfacesListRequest { + r.rfChannelWidthLt = &rfChannelWidthLt + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelWidthLte(rfChannelWidthLte []float64) ApiDcimInterfacesListRequest { + r.rfChannelWidthLte = &rfChannelWidthLte + return r +} + +func (r ApiDcimInterfacesListRequest) RfChannelWidthN(rfChannelWidthN []float64) ApiDcimInterfacesListRequest { + r.rfChannelWidthN = &rfChannelWidthN + return r +} + +func (r ApiDcimInterfacesListRequest) RfRole(rfRole []string) ApiDcimInterfacesListRequest { + r.rfRole = &rfRole + return r +} + +func (r ApiDcimInterfacesListRequest) RfRoleN(rfRoleN []string) ApiDcimInterfacesListRequest { + r.rfRoleN = &rfRoleN + return r +} + +// Device role (slug) +func (r ApiDcimInterfacesListRequest) Role(role []string) ApiDcimInterfacesListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimInterfacesListRequest) RoleN(roleN []string) ApiDcimInterfacesListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimInterfacesListRequest) RoleId(roleId []int32) ApiDcimInterfacesListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimInterfacesListRequest) RoleIdN(roleIdN []int32) ApiDcimInterfacesListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimInterfacesListRequest) Site(site []string) ApiDcimInterfacesListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimInterfacesListRequest) SiteN(siteN []string) ApiDcimInterfacesListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimInterfacesListRequest) SiteGroup(siteGroup []int32) ApiDcimInterfacesListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimInterfacesListRequest) SiteGroupN(siteGroupN []int32) ApiDcimInterfacesListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimInterfacesListRequest) SiteGroupId(siteGroupId []int32) ApiDcimInterfacesListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimInterfacesListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimInterfacesListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimInterfacesListRequest) SiteId(siteId []int32) ApiDcimInterfacesListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimInterfacesListRequest) SiteIdN(siteIdN []int32) ApiDcimInterfacesListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimInterfacesListRequest) Speed(speed []int32) ApiDcimInterfacesListRequest { + r.speed = &speed + return r +} + +func (r ApiDcimInterfacesListRequest) SpeedEmpty(speedEmpty []int32) ApiDcimInterfacesListRequest { + r.speedEmpty = &speedEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) SpeedGt(speedGt []int32) ApiDcimInterfacesListRequest { + r.speedGt = &speedGt + return r +} + +func (r ApiDcimInterfacesListRequest) SpeedGte(speedGte []int32) ApiDcimInterfacesListRequest { + r.speedGte = &speedGte + return r +} + +func (r ApiDcimInterfacesListRequest) SpeedLt(speedLt []int32) ApiDcimInterfacesListRequest { + r.speedLt = &speedLt + return r +} + +func (r ApiDcimInterfacesListRequest) SpeedLte(speedLte []int32) ApiDcimInterfacesListRequest { + r.speedLte = &speedLte + return r +} + +func (r ApiDcimInterfacesListRequest) SpeedN(speedN []int32) ApiDcimInterfacesListRequest { + r.speedN = &speedN + return r +} + +func (r ApiDcimInterfacesListRequest) Tag(tag []string) ApiDcimInterfacesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimInterfacesListRequest) TagN(tagN []string) ApiDcimInterfacesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimInterfacesListRequest) TxPower(txPower []int32) ApiDcimInterfacesListRequest { + r.txPower = &txPower + return r +} + +func (r ApiDcimInterfacesListRequest) TxPowerEmpty(txPowerEmpty bool) ApiDcimInterfacesListRequest { + r.txPowerEmpty = &txPowerEmpty + return r +} + +func (r ApiDcimInterfacesListRequest) TxPowerGt(txPowerGt []int32) ApiDcimInterfacesListRequest { + r.txPowerGt = &txPowerGt + return r +} + +func (r ApiDcimInterfacesListRequest) TxPowerGte(txPowerGte []int32) ApiDcimInterfacesListRequest { + r.txPowerGte = &txPowerGte + return r +} + +func (r ApiDcimInterfacesListRequest) TxPowerLt(txPowerLt []int32) ApiDcimInterfacesListRequest { + r.txPowerLt = &txPowerLt + return r +} + +func (r ApiDcimInterfacesListRequest) TxPowerLte(txPowerLte []int32) ApiDcimInterfacesListRequest { + r.txPowerLte = &txPowerLte + return r +} + +func (r ApiDcimInterfacesListRequest) TxPowerN(txPowerN []int32) ApiDcimInterfacesListRequest { + r.txPowerN = &txPowerN + return r +} + +func (r ApiDcimInterfacesListRequest) Type_(type_ []string) ApiDcimInterfacesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimInterfacesListRequest) TypeN(typeN []string) ApiDcimInterfacesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimInterfacesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimInterfacesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Device Context +func (r ApiDcimInterfacesListRequest) Vdc(vdc []string) ApiDcimInterfacesListRequest { + r.vdc = &vdc + return r +} + +// Virtual Device Context +func (r ApiDcimInterfacesListRequest) VdcN(vdcN []string) ApiDcimInterfacesListRequest { + r.vdcN = &vdcN + return r +} + +// Virtual Device Context +func (r ApiDcimInterfacesListRequest) VdcId(vdcId []int32) ApiDcimInterfacesListRequest { + r.vdcId = &vdcId + return r +} + +// Virtual Device Context +func (r ApiDcimInterfacesListRequest) VdcIdN(vdcIdN []int32) ApiDcimInterfacesListRequest { + r.vdcIdN = &vdcIdN + return r +} + +// Virtual Device Context (Identifier) +func (r ApiDcimInterfacesListRequest) VdcIdentifier(vdcIdentifier []*int32) ApiDcimInterfacesListRequest { + r.vdcIdentifier = &vdcIdentifier + return r +} + +// Virtual Device Context (Identifier) +func (r ApiDcimInterfacesListRequest) VdcIdentifierN(vdcIdentifierN []*int32) ApiDcimInterfacesListRequest { + r.vdcIdentifierN = &vdcIdentifierN + return r +} + +// Virtual Chassis +func (r ApiDcimInterfacesListRequest) VirtualChassis(virtualChassis []string) ApiDcimInterfacesListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimInterfacesListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimInterfacesListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimInterfacesListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimInterfacesListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimInterfacesListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimInterfacesListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimInterfacesListRequest) VirtualChassisMember(virtualChassisMember []string) ApiDcimInterfacesListRequest { + r.virtualChassisMember = &virtualChassisMember + return r +} + +func (r ApiDcimInterfacesListRequest) VirtualChassisMemberId(virtualChassisMemberId []int32) ApiDcimInterfacesListRequest { + r.virtualChassisMemberId = &virtualChassisMemberId + return r +} + +// Assigned VID +func (r ApiDcimInterfacesListRequest) Vlan(vlan string) ApiDcimInterfacesListRequest { + r.vlan = &vlan + return r +} + +// Assigned VLAN +func (r ApiDcimInterfacesListRequest) VlanId(vlanId string) ApiDcimInterfacesListRequest { + r.vlanId = &vlanId + return r +} + +// VRF (RD) +func (r ApiDcimInterfacesListRequest) Vrf(vrf []*string) ApiDcimInterfacesListRequest { + r.vrf = &vrf + return r +} + +// VRF (RD) +func (r ApiDcimInterfacesListRequest) VrfN(vrfN []*string) ApiDcimInterfacesListRequest { + r.vrfN = &vrfN + return r +} + +// VRF +func (r ApiDcimInterfacesListRequest) VrfId(vrfId []int32) ApiDcimInterfacesListRequest { + r.vrfId = &vrfId + return r +} + +// VRF +func (r ApiDcimInterfacesListRequest) VrfIdN(vrfIdN []int32) ApiDcimInterfacesListRequest { + r.vrfIdN = &vrfIdN + return r +} + +func (r ApiDcimInterfacesListRequest) Wwn(wwn []string) ApiDcimInterfacesListRequest { + r.wwn = &wwn + return r +} + +func (r ApiDcimInterfacesListRequest) WwnIc(wwnIc []string) ApiDcimInterfacesListRequest { + r.wwnIc = &wwnIc + return r +} + +func (r ApiDcimInterfacesListRequest) WwnIe(wwnIe []string) ApiDcimInterfacesListRequest { + r.wwnIe = &wwnIe + return r +} + +func (r ApiDcimInterfacesListRequest) WwnIew(wwnIew []string) ApiDcimInterfacesListRequest { + r.wwnIew = &wwnIew + return r +} + +func (r ApiDcimInterfacesListRequest) WwnIsw(wwnIsw []string) ApiDcimInterfacesListRequest { + r.wwnIsw = &wwnIsw + return r +} + +func (r ApiDcimInterfacesListRequest) WwnN(wwnN []string) ApiDcimInterfacesListRequest { + r.wwnN = &wwnN + return r +} + +func (r ApiDcimInterfacesListRequest) WwnNic(wwnNic []string) ApiDcimInterfacesListRequest { + r.wwnNic = &wwnNic + return r +} + +func (r ApiDcimInterfacesListRequest) WwnNie(wwnNie []string) ApiDcimInterfacesListRequest { + r.wwnNie = &wwnNie + return r +} + +func (r ApiDcimInterfacesListRequest) WwnNiew(wwnNiew []string) ApiDcimInterfacesListRequest { + r.wwnNiew = &wwnNiew + return r +} + +func (r ApiDcimInterfacesListRequest) WwnNisw(wwnNisw []string) ApiDcimInterfacesListRequest { + r.wwnNisw = &wwnNisw + return r +} + +func (r ApiDcimInterfacesListRequest) Execute() (*PaginatedInterfaceList, *http.Response, error) { + return r.ApiService.DcimInterfacesListExecute(r) +} + +/* +DcimInterfacesList Method for DcimInterfacesList + +Get a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInterfacesListRequest +*/ +func (a *DcimAPIService) DcimInterfacesList(ctx context.Context) ApiDcimInterfacesListRequest { + return ApiDcimInterfacesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInterfaceList +func (a *DcimAPIService) DcimInterfacesListExecute(r ApiDcimInterfacesListRequest) (*PaginatedInterfaceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInterfaceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.bridgeId != nil { + t := *r.bridgeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id", t, "multi") + } + } + if r.bridgeIdN != nil { + t := *r.bridgeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id__n", t, "multi") + } + } + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.connected != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "connected", r.connected, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.duplex != nil { + t := *r.duplex + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "duplex", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "duplex", t, "multi") + } + } + if r.duplexN != nil { + t := *r.duplexN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "duplex__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "duplex__n", t, "multi") + } + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.kind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "kind", r.kind, "") + } + if r.l2vpn != nil { + t := *r.l2vpn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", t, "multi") + } + } + if r.l2vpnN != nil { + t := *r.l2vpnN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", t, "multi") + } + } + if r.l2vpnId != nil { + t := *r.l2vpnId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", t, "multi") + } + } + if r.l2vpnIdN != nil { + t := *r.l2vpnIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lagId != nil { + t := *r.lagId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "lag_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "lag_id", t, "multi") + } + } + if r.lagIdN != nil { + t := *r.lagIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "lag_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "lag_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.macAddress != nil { + t := *r.macAddress + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", t, "multi") + } + } + if r.macAddressIc != nil { + t := *r.macAddressIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", t, "multi") + } + } + if r.macAddressIe != nil { + t := *r.macAddressIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", t, "multi") + } + } + if r.macAddressIew != nil { + t := *r.macAddressIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", t, "multi") + } + } + if r.macAddressIsw != nil { + t := *r.macAddressIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", t, "multi") + } + } + if r.macAddressN != nil { + t := *r.macAddressN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", t, "multi") + } + } + if r.macAddressNic != nil { + t := *r.macAddressNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", t, "multi") + } + } + if r.macAddressNie != nil { + t := *r.macAddressNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", t, "multi") + } + } + if r.macAddressNiew != nil { + t := *r.macAddressNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", t, "multi") + } + } + if r.macAddressNisw != nil { + t := *r.macAddressNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", t, "multi") + } + } + if r.mgmtOnly != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mgmt_only", r.mgmtOnly, "") + } + if r.mode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", r.mode, "") + } + if r.modeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode__n", r.modeN, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleId != nil { + t := *r.moduleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", t, "multi") + } + } + if r.moduleIdN != nil { + t := *r.moduleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", t, "multi") + } + } + if r.mtu != nil { + t := *r.mtu + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu", t, "multi") + } + } + if r.mtuEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__empty", r.mtuEmpty, "") + } + if r.mtuGt != nil { + t := *r.mtuGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gt", t, "multi") + } + } + if r.mtuGte != nil { + t := *r.mtuGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gte", t, "multi") + } + } + if r.mtuLt != nil { + t := *r.mtuLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lt", t, "multi") + } + } + if r.mtuLte != nil { + t := *r.mtuLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lte", t, "multi") + } + } + if r.mtuN != nil { + t := *r.mtuN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.poeMode != nil { + t := *r.poeMode + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode", t, "multi") + } + } + if r.poeModeN != nil { + t := *r.poeModeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_mode__n", t, "multi") + } + } + if r.poeType != nil { + t := *r.poeType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type", t, "multi") + } + } + if r.poeTypeN != nil { + t := *r.poeTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "poe_type__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.rfChannel != nil { + t := *r.rfChannel + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel", t, "multi") + } + } + if r.rfChannelN != nil { + t := *r.rfChannelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel__n", t, "multi") + } + } + if r.rfChannelFrequency != nil { + t := *r.rfChannelFrequency + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency", t, "multi") + } + } + if r.rfChannelFrequencyEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__empty", r.rfChannelFrequencyEmpty, "") + } + if r.rfChannelFrequencyGt != nil { + t := *r.rfChannelFrequencyGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__gt", t, "multi") + } + } + if r.rfChannelFrequencyGte != nil { + t := *r.rfChannelFrequencyGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__gte", t, "multi") + } + } + if r.rfChannelFrequencyLt != nil { + t := *r.rfChannelFrequencyLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__lt", t, "multi") + } + } + if r.rfChannelFrequencyLte != nil { + t := *r.rfChannelFrequencyLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__lte", t, "multi") + } + } + if r.rfChannelFrequencyN != nil { + t := *r.rfChannelFrequencyN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_frequency__n", t, "multi") + } + } + if r.rfChannelWidth != nil { + t := *r.rfChannelWidth + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width", t, "multi") + } + } + if r.rfChannelWidthEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__empty", r.rfChannelWidthEmpty, "") + } + if r.rfChannelWidthGt != nil { + t := *r.rfChannelWidthGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__gt", t, "multi") + } + } + if r.rfChannelWidthGte != nil { + t := *r.rfChannelWidthGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__gte", t, "multi") + } + } + if r.rfChannelWidthLt != nil { + t := *r.rfChannelWidthLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__lt", t, "multi") + } + } + if r.rfChannelWidthLte != nil { + t := *r.rfChannelWidthLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__lte", t, "multi") + } + } + if r.rfChannelWidthN != nil { + t := *r.rfChannelWidthN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_channel_width__n", t, "multi") + } + } + if r.rfRole != nil { + t := *r.rfRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role", t, "multi") + } + } + if r.rfRoleN != nil { + t := *r.rfRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rf_role__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.speed != nil { + t := *r.speed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed", t, "multi") + } + } + if r.speedEmpty != nil { + t := *r.speedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__empty", t, "multi") + } + } + if r.speedGt != nil { + t := *r.speedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__gt", t, "multi") + } + } + if r.speedGte != nil { + t := *r.speedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__gte", t, "multi") + } + } + if r.speedLt != nil { + t := *r.speedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__lt", t, "multi") + } + } + if r.speedLte != nil { + t := *r.speedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__lte", t, "multi") + } + } + if r.speedN != nil { + t := *r.speedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "speed__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.txPower != nil { + t := *r.txPower + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power", t, "multi") + } + } + if r.txPowerEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__empty", r.txPowerEmpty, "") + } + if r.txPowerGt != nil { + t := *r.txPowerGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__gt", t, "multi") + } + } + if r.txPowerGte != nil { + t := *r.txPowerGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__gte", t, "multi") + } + } + if r.txPowerLt != nil { + t := *r.txPowerLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__lt", t, "multi") + } + } + if r.txPowerLte != nil { + t := *r.txPowerLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__lte", t, "multi") + } + } + if r.txPowerN != nil { + t := *r.txPowerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tx_power__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vdc != nil { + t := *r.vdc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc", t, "multi") + } + } + if r.vdcN != nil { + t := *r.vdcN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc__n", t, "multi") + } + } + if r.vdcId != nil { + t := *r.vdcId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_id", t, "multi") + } + } + if r.vdcIdN != nil { + t := *r.vdcIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_id__n", t, "multi") + } + } + if r.vdcIdentifier != nil { + t := *r.vdcIdentifier + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_identifier", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_identifier", t, "multi") + } + } + if r.vdcIdentifierN != nil { + t := *r.vdcIdentifierN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_identifier__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vdc_identifier__n", t, "multi") + } + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + if r.virtualChassisMember != nil { + t := *r.virtualChassisMember + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_member", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_member", t, "multi") + } + } + if r.virtualChassisMemberId != nil { + t := *r.virtualChassisMemberId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_member_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_member_id", t, "multi") + } + } + if r.vlan != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan", r.vlan, "") + } + if r.vlanId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", r.vlanId, "") + } + if r.vrf != nil { + t := *r.vrf + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", t, "multi") + } + } + if r.vrfN != nil { + t := *r.vrfN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", t, "multi") + } + } + if r.vrfId != nil { + t := *r.vrfId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", t, "multi") + } + } + if r.vrfIdN != nil { + t := *r.vrfIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", t, "multi") + } + } + if r.wwn != nil { + t := *r.wwn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn", t, "multi") + } + } + if r.wwnIc != nil { + t := *r.wwnIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__ic", t, "multi") + } + } + if r.wwnIe != nil { + t := *r.wwnIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__ie", t, "multi") + } + } + if r.wwnIew != nil { + t := *r.wwnIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__iew", t, "multi") + } + } + if r.wwnIsw != nil { + t := *r.wwnIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__isw", t, "multi") + } + } + if r.wwnN != nil { + t := *r.wwnN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__n", t, "multi") + } + } + if r.wwnNic != nil { + t := *r.wwnNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__nic", t, "multi") + } + } + if r.wwnNie != nil { + t := *r.wwnNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__nie", t, "multi") + } + } + if r.wwnNiew != nil { + t := *r.wwnNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__niew", t, "multi") + } + } + if r.wwnNisw != nil { + t := *r.wwnNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "wwn__nisw", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableInterfaceRequest *PatchedWritableInterfaceRequest +} + +func (r ApiDcimInterfacesPartialUpdateRequest) PatchedWritableInterfaceRequest(patchedWritableInterfaceRequest PatchedWritableInterfaceRequest) ApiDcimInterfacesPartialUpdateRequest { + r.patchedWritableInterfaceRequest = &patchedWritableInterfaceRequest + return r +} + +func (r ApiDcimInterfacesPartialUpdateRequest) Execute() (*Interface, *http.Response, error) { + return r.ApiService.DcimInterfacesPartialUpdateExecute(r) +} + +/* +DcimInterfacesPartialUpdate Method for DcimInterfacesPartialUpdate + +Patch a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiDcimInterfacesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfacesPartialUpdate(ctx context.Context, id int32) ApiDcimInterfacesPartialUpdateRequest { + return ApiDcimInterfacesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Interface +func (a *DcimAPIService) DcimInterfacesPartialUpdateExecute(r ApiDcimInterfacesPartialUpdateRequest) (*Interface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInterfacesRetrieveRequest) Execute() (*Interface, *http.Response, error) { + return r.ApiService.DcimInterfacesRetrieveExecute(r) +} + +/* +DcimInterfacesRetrieve Method for DcimInterfacesRetrieve + +Get a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiDcimInterfacesRetrieveRequest +*/ +func (a *DcimAPIService) DcimInterfacesRetrieve(ctx context.Context, id int32) ApiDcimInterfacesRetrieveRequest { + return ApiDcimInterfacesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Interface +func (a *DcimAPIService) DcimInterfacesRetrieveExecute(r ApiDcimInterfacesRetrieveRequest) (*Interface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesTraceRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInterfacesTraceRetrieveRequest) Execute() (*Interface, *http.Response, error) { + return r.ApiService.DcimInterfacesTraceRetrieveExecute(r) +} + +/* +DcimInterfacesTraceRetrieve Method for DcimInterfacesTraceRetrieve + +Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiDcimInterfacesTraceRetrieveRequest +*/ +func (a *DcimAPIService) DcimInterfacesTraceRetrieve(ctx context.Context, id int32) ApiDcimInterfacesTraceRetrieveRequest { + return ApiDcimInterfacesTraceRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Interface +func (a *DcimAPIService) DcimInterfacesTraceRetrieveExecute(r ApiDcimInterfacesTraceRetrieveRequest) (*Interface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesTraceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/{id}/trace/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInterfacesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableInterfaceRequest *WritableInterfaceRequest +} + +func (r ApiDcimInterfacesUpdateRequest) WritableInterfaceRequest(writableInterfaceRequest WritableInterfaceRequest) ApiDcimInterfacesUpdateRequest { + r.writableInterfaceRequest = &writableInterfaceRequest + return r +} + +func (r ApiDcimInterfacesUpdateRequest) Execute() (*Interface, *http.Response, error) { + return r.ApiService.DcimInterfacesUpdateExecute(r) +} + +/* +DcimInterfacesUpdate Method for DcimInterfacesUpdate + +Put a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiDcimInterfacesUpdateRequest +*/ +func (a *DcimAPIService) DcimInterfacesUpdate(ctx context.Context, id int32) ApiDcimInterfacesUpdateRequest { + return ApiDcimInterfacesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Interface +func (a *DcimAPIService) DcimInterfacesUpdateExecute(r ApiDcimInterfacesUpdateRequest) (*Interface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInterfacesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInterfaceRequest == nil { + return localVarReturnValue, nil, reportError("writableInterfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemRoleRequest *[]InventoryItemRoleRequest +} + +func (r ApiDcimInventoryItemRolesBulkDestroyRequest) InventoryItemRoleRequest(inventoryItemRoleRequest []InventoryItemRoleRequest) ApiDcimInventoryItemRolesBulkDestroyRequest { + r.inventoryItemRoleRequest = &inventoryItemRoleRequest + return r +} + +func (r ApiDcimInventoryItemRolesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInventoryItemRolesBulkDestroyExecute(r) +} + +/* +DcimInventoryItemRolesBulkDestroy Method for DcimInventoryItemRolesBulkDestroy + +Delete a list of inventory item role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemRolesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesBulkDestroy(ctx context.Context) ApiDcimInventoryItemRolesBulkDestroyRequest { + return ApiDcimInventoryItemRolesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInventoryItemRolesBulkDestroyExecute(r ApiDcimInventoryItemRolesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRoleRequest == nil { + return nil, reportError("inventoryItemRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemRoleRequest *[]InventoryItemRoleRequest +} + +func (r ApiDcimInventoryItemRolesBulkPartialUpdateRequest) InventoryItemRoleRequest(inventoryItemRoleRequest []InventoryItemRoleRequest) ApiDcimInventoryItemRolesBulkPartialUpdateRequest { + r.inventoryItemRoleRequest = &inventoryItemRoleRequest + return r +} + +func (r ApiDcimInventoryItemRolesBulkPartialUpdateRequest) Execute() ([]InventoryItemRole, *http.Response, error) { + return r.ApiService.DcimInventoryItemRolesBulkPartialUpdateExecute(r) +} + +/* +DcimInventoryItemRolesBulkPartialUpdate Method for DcimInventoryItemRolesBulkPartialUpdate + +Patch a list of inventory item role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemRolesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesBulkPartialUpdate(ctx context.Context) ApiDcimInventoryItemRolesBulkPartialUpdateRequest { + return ApiDcimInventoryItemRolesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InventoryItemRole +func (a *DcimAPIService) DcimInventoryItemRolesBulkPartialUpdateExecute(r ApiDcimInventoryItemRolesBulkPartialUpdateRequest) ([]InventoryItemRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InventoryItemRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRoleRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemRoleRequest *[]InventoryItemRoleRequest +} + +func (r ApiDcimInventoryItemRolesBulkUpdateRequest) InventoryItemRoleRequest(inventoryItemRoleRequest []InventoryItemRoleRequest) ApiDcimInventoryItemRolesBulkUpdateRequest { + r.inventoryItemRoleRequest = &inventoryItemRoleRequest + return r +} + +func (r ApiDcimInventoryItemRolesBulkUpdateRequest) Execute() ([]InventoryItemRole, *http.Response, error) { + return r.ApiService.DcimInventoryItemRolesBulkUpdateExecute(r) +} + +/* +DcimInventoryItemRolesBulkUpdate Method for DcimInventoryItemRolesBulkUpdate + +Put a list of inventory item role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemRolesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesBulkUpdate(ctx context.Context) ApiDcimInventoryItemRolesBulkUpdateRequest { + return ApiDcimInventoryItemRolesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InventoryItemRole +func (a *DcimAPIService) DcimInventoryItemRolesBulkUpdateExecute(r ApiDcimInventoryItemRolesBulkUpdateRequest) ([]InventoryItemRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InventoryItemRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRoleRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemRoleRequest *InventoryItemRoleRequest +} + +func (r ApiDcimInventoryItemRolesCreateRequest) InventoryItemRoleRequest(inventoryItemRoleRequest InventoryItemRoleRequest) ApiDcimInventoryItemRolesCreateRequest { + r.inventoryItemRoleRequest = &inventoryItemRoleRequest + return r +} + +func (r ApiDcimInventoryItemRolesCreateRequest) Execute() (*InventoryItemRole, *http.Response, error) { + return r.ApiService.DcimInventoryItemRolesCreateExecute(r) +} + +/* +DcimInventoryItemRolesCreate Method for DcimInventoryItemRolesCreate + +Post a list of inventory item role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemRolesCreateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesCreate(ctx context.Context) ApiDcimInventoryItemRolesCreateRequest { + return ApiDcimInventoryItemRolesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InventoryItemRole +func (a *DcimAPIService) DcimInventoryItemRolesCreateExecute(r ApiDcimInventoryItemRolesCreateRequest) (*InventoryItemRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRoleRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInventoryItemRolesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInventoryItemRolesDestroyExecute(r) +} + +/* +DcimInventoryItemRolesDestroy Method for DcimInventoryItemRolesDestroy + +Delete a inventory item role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item role. + @return ApiDcimInventoryItemRolesDestroyRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesDestroy(ctx context.Context, id int32) ApiDcimInventoryItemRolesDestroyRequest { + return ApiDcimInventoryItemRolesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInventoryItemRolesDestroyExecute(r ApiDcimInventoryItemRolesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiDcimInventoryItemRolesListRequest) Color(color []string) ApiDcimInventoryItemRolesListRequest { + r.color = &color + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorEmpty(colorEmpty bool) ApiDcimInventoryItemRolesListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorIc(colorIc []string) ApiDcimInventoryItemRolesListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorIe(colorIe []string) ApiDcimInventoryItemRolesListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorIew(colorIew []string) ApiDcimInventoryItemRolesListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorIsw(colorIsw []string) ApiDcimInventoryItemRolesListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorN(colorN []string) ApiDcimInventoryItemRolesListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorNic(colorNic []string) ApiDcimInventoryItemRolesListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorNie(colorNie []string) ApiDcimInventoryItemRolesListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorNiew(colorNiew []string) ApiDcimInventoryItemRolesListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ColorNisw(colorNisw []string) ApiDcimInventoryItemRolesListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) Created(created []time.Time) ApiDcimInventoryItemRolesListRequest { + r.created = &created + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimInventoryItemRolesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) CreatedGt(createdGt []time.Time) ApiDcimInventoryItemRolesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) CreatedGte(createdGte []time.Time) ApiDcimInventoryItemRolesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) CreatedLt(createdLt []time.Time) ApiDcimInventoryItemRolesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) CreatedLte(createdLte []time.Time) ApiDcimInventoryItemRolesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) CreatedN(createdN []time.Time) ApiDcimInventoryItemRolesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) CreatedByRequest(createdByRequest string) ApiDcimInventoryItemRolesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) Description(description []string) ApiDcimInventoryItemRolesListRequest { + r.description = &description + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimInventoryItemRolesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionIc(descriptionIc []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionIe(descriptionIe []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionIew(descriptionIew []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionN(descriptionN []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionNic(descriptionNic []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionNie(descriptionNie []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimInventoryItemRolesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) Id(id []int32) ApiDcimInventoryItemRolesListRequest { + r.id = &id + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) IdEmpty(idEmpty bool) ApiDcimInventoryItemRolesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) IdGt(idGt []int32) ApiDcimInventoryItemRolesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) IdGte(idGte []int32) ApiDcimInventoryItemRolesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) IdLt(idLt []int32) ApiDcimInventoryItemRolesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) IdLte(idLte []int32) ApiDcimInventoryItemRolesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) IdN(idN []int32) ApiDcimInventoryItemRolesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimInventoryItemRolesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimInventoryItemRolesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimInventoryItemRolesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimInventoryItemRolesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimInventoryItemRolesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimInventoryItemRolesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimInventoryItemRolesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimInventoryItemRolesListRequest) Limit(limit int32) ApiDcimInventoryItemRolesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimInventoryItemRolesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) Name(name []string) ApiDcimInventoryItemRolesListRequest { + r.name = &name + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameEmpty(nameEmpty bool) ApiDcimInventoryItemRolesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameIc(nameIc []string) ApiDcimInventoryItemRolesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameIe(nameIe []string) ApiDcimInventoryItemRolesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameIew(nameIew []string) ApiDcimInventoryItemRolesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameIsw(nameIsw []string) ApiDcimInventoryItemRolesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameN(nameN []string) ApiDcimInventoryItemRolesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameNic(nameNic []string) ApiDcimInventoryItemRolesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameNie(nameNie []string) ApiDcimInventoryItemRolesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameNiew(nameNiew []string) ApiDcimInventoryItemRolesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) NameNisw(nameNisw []string) ApiDcimInventoryItemRolesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimInventoryItemRolesListRequest) Offset(offset int32) ApiDcimInventoryItemRolesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimInventoryItemRolesListRequest) Ordering(ordering string) ApiDcimInventoryItemRolesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimInventoryItemRolesListRequest) Q(q string) ApiDcimInventoryItemRolesListRequest { + r.q = &q + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) Slug(slug []string) ApiDcimInventoryItemRolesListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugEmpty(slugEmpty bool) ApiDcimInventoryItemRolesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugIc(slugIc []string) ApiDcimInventoryItemRolesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugIe(slugIe []string) ApiDcimInventoryItemRolesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugIew(slugIew []string) ApiDcimInventoryItemRolesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugIsw(slugIsw []string) ApiDcimInventoryItemRolesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugN(slugN []string) ApiDcimInventoryItemRolesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugNic(slugNic []string) ApiDcimInventoryItemRolesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugNie(slugNie []string) ApiDcimInventoryItemRolesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugNiew(slugNiew []string) ApiDcimInventoryItemRolesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) SlugNisw(slugNisw []string) ApiDcimInventoryItemRolesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) Tag(tag []string) ApiDcimInventoryItemRolesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) TagN(tagN []string) ApiDcimInventoryItemRolesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimInventoryItemRolesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimInventoryItemRolesListRequest) Execute() (*PaginatedInventoryItemRoleList, *http.Response, error) { + return r.ApiService.DcimInventoryItemRolesListExecute(r) +} + +/* +DcimInventoryItemRolesList Method for DcimInventoryItemRolesList + +Get a list of inventory item role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemRolesListRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesList(ctx context.Context) ApiDcimInventoryItemRolesListRequest { + return ApiDcimInventoryItemRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInventoryItemRoleList +func (a *DcimAPIService) DcimInventoryItemRolesListExecute(r ApiDcimInventoryItemRolesListRequest) (*PaginatedInventoryItemRoleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInventoryItemRoleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedInventoryItemRoleRequest *PatchedInventoryItemRoleRequest +} + +func (r ApiDcimInventoryItemRolesPartialUpdateRequest) PatchedInventoryItemRoleRequest(patchedInventoryItemRoleRequest PatchedInventoryItemRoleRequest) ApiDcimInventoryItemRolesPartialUpdateRequest { + r.patchedInventoryItemRoleRequest = &patchedInventoryItemRoleRequest + return r +} + +func (r ApiDcimInventoryItemRolesPartialUpdateRequest) Execute() (*InventoryItemRole, *http.Response, error) { + return r.ApiService.DcimInventoryItemRolesPartialUpdateExecute(r) +} + +/* +DcimInventoryItemRolesPartialUpdate Method for DcimInventoryItemRolesPartialUpdate + +Patch a inventory item role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item role. + @return ApiDcimInventoryItemRolesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesPartialUpdate(ctx context.Context, id int32) ApiDcimInventoryItemRolesPartialUpdateRequest { + return ApiDcimInventoryItemRolesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItemRole +func (a *DcimAPIService) DcimInventoryItemRolesPartialUpdateExecute(r ApiDcimInventoryItemRolesPartialUpdateRequest) (*InventoryItemRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedInventoryItemRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInventoryItemRolesRetrieveRequest) Execute() (*InventoryItemRole, *http.Response, error) { + return r.ApiService.DcimInventoryItemRolesRetrieveExecute(r) +} + +/* +DcimInventoryItemRolesRetrieve Method for DcimInventoryItemRolesRetrieve + +Get a inventory item role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item role. + @return ApiDcimInventoryItemRolesRetrieveRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesRetrieve(ctx context.Context, id int32) ApiDcimInventoryItemRolesRetrieveRequest { + return ApiDcimInventoryItemRolesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItemRole +func (a *DcimAPIService) DcimInventoryItemRolesRetrieveExecute(r ApiDcimInventoryItemRolesRetrieveRequest) (*InventoryItemRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemRolesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + inventoryItemRoleRequest *InventoryItemRoleRequest +} + +func (r ApiDcimInventoryItemRolesUpdateRequest) InventoryItemRoleRequest(inventoryItemRoleRequest InventoryItemRoleRequest) ApiDcimInventoryItemRolesUpdateRequest { + r.inventoryItemRoleRequest = &inventoryItemRoleRequest + return r +} + +func (r ApiDcimInventoryItemRolesUpdateRequest) Execute() (*InventoryItemRole, *http.Response, error) { + return r.ApiService.DcimInventoryItemRolesUpdateExecute(r) +} + +/* +DcimInventoryItemRolesUpdate Method for DcimInventoryItemRolesUpdate + +Put a inventory item role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item role. + @return ApiDcimInventoryItemRolesUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemRolesUpdate(ctx context.Context, id int32) ApiDcimInventoryItemRolesUpdateRequest { + return ApiDcimInventoryItemRolesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItemRole +func (a *DcimAPIService) DcimInventoryItemRolesUpdateExecute(r ApiDcimInventoryItemRolesUpdateRequest) (*InventoryItemRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemRolesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRoleRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemTemplateRequest *[]InventoryItemTemplateRequest +} + +func (r ApiDcimInventoryItemTemplatesBulkDestroyRequest) InventoryItemTemplateRequest(inventoryItemTemplateRequest []InventoryItemTemplateRequest) ApiDcimInventoryItemTemplatesBulkDestroyRequest { + r.inventoryItemTemplateRequest = &inventoryItemTemplateRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesBulkDestroyExecute(r) +} + +/* +DcimInventoryItemTemplatesBulkDestroy Method for DcimInventoryItemTemplatesBulkDestroy + +Delete a list of inventory item template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesBulkDestroy(ctx context.Context) ApiDcimInventoryItemTemplatesBulkDestroyRequest { + return ApiDcimInventoryItemTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInventoryItemTemplatesBulkDestroyExecute(r ApiDcimInventoryItemTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemTemplateRequest == nil { + return nil, reportError("inventoryItemTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemTemplateRequest *[]InventoryItemTemplateRequest +} + +func (r ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest) InventoryItemTemplateRequest(inventoryItemTemplateRequest []InventoryItemTemplateRequest) ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest { + r.inventoryItemTemplateRequest = &inventoryItemTemplateRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest) Execute() ([]InventoryItemTemplate, *http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimInventoryItemTemplatesBulkPartialUpdate Method for DcimInventoryItemTemplatesBulkPartialUpdate + +Patch a list of inventory item template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest { + return ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InventoryItemTemplate +func (a *DcimAPIService) DcimInventoryItemTemplatesBulkPartialUpdateExecute(r ApiDcimInventoryItemTemplatesBulkPartialUpdateRequest) ([]InventoryItemTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InventoryItemTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemTemplateRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemTemplateRequest *[]InventoryItemTemplateRequest +} + +func (r ApiDcimInventoryItemTemplatesBulkUpdateRequest) InventoryItemTemplateRequest(inventoryItemTemplateRequest []InventoryItemTemplateRequest) ApiDcimInventoryItemTemplatesBulkUpdateRequest { + r.inventoryItemTemplateRequest = &inventoryItemTemplateRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesBulkUpdateRequest) Execute() ([]InventoryItemTemplate, *http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesBulkUpdateExecute(r) +} + +/* +DcimInventoryItemTemplatesBulkUpdate Method for DcimInventoryItemTemplatesBulkUpdate + +Put a list of inventory item template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesBulkUpdate(ctx context.Context) ApiDcimInventoryItemTemplatesBulkUpdateRequest { + return ApiDcimInventoryItemTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InventoryItemTemplate +func (a *DcimAPIService) DcimInventoryItemTemplatesBulkUpdateExecute(r ApiDcimInventoryItemTemplatesBulkUpdateRequest) ([]InventoryItemTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InventoryItemTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemTemplateRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableInventoryItemTemplateRequest *WritableInventoryItemTemplateRequest +} + +func (r ApiDcimInventoryItemTemplatesCreateRequest) WritableInventoryItemTemplateRequest(writableInventoryItemTemplateRequest WritableInventoryItemTemplateRequest) ApiDcimInventoryItemTemplatesCreateRequest { + r.writableInventoryItemTemplateRequest = &writableInventoryItemTemplateRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesCreateRequest) Execute() (*InventoryItemTemplate, *http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesCreateExecute(r) +} + +/* +DcimInventoryItemTemplatesCreate Method for DcimInventoryItemTemplatesCreate + +Post a list of inventory item template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesCreate(ctx context.Context) ApiDcimInventoryItemTemplatesCreateRequest { + return ApiDcimInventoryItemTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InventoryItemTemplate +func (a *DcimAPIService) DcimInventoryItemTemplatesCreateExecute(r ApiDcimInventoryItemTemplatesCreateRequest) (*InventoryItemTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInventoryItemTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableInventoryItemTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInventoryItemTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInventoryItemTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesDestroyExecute(r) +} + +/* +DcimInventoryItemTemplatesDestroy Method for DcimInventoryItemTemplatesDestroy + +Delete a inventory item template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item template. + @return ApiDcimInventoryItemTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesDestroy(ctx context.Context, id int32) ApiDcimInventoryItemTemplatesDestroyRequest { + return ApiDcimInventoryItemTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInventoryItemTemplatesDestroyExecute(r ApiDcimInventoryItemTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + componentId *[]int32 + componentIdEmpty *[]int32 + componentIdGt *[]int32 + componentIdGte *[]int32 + componentIdLt *[]int32 + componentIdLte *[]int32 + componentIdN *[]int32 + componentType *string + componentTypeN *string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]int32 + devicetypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + manufacturer *[]string + manufacturerN *[]string + manufacturerId *[]*int32 + manufacturerIdN *[]*int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parentId *[]*int32 + parentIdN *[]*int32 + partId *[]string + partIdEmpty *bool + partIdIc *[]string + partIdIe *[]string + partIdIew *[]string + partIdIsw *[]string + partIdN *[]string + partIdNic *[]string + partIdNie *[]string + partIdNiew *[]string + partIdNisw *[]string + q *string + role *[]string + roleN *[]string + roleId *[]*int32 + roleIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentId(componentId []int32) ApiDcimInventoryItemTemplatesListRequest { + r.componentId = &componentId + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentIdEmpty(componentIdEmpty []int32) ApiDcimInventoryItemTemplatesListRequest { + r.componentIdEmpty = &componentIdEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentIdGt(componentIdGt []int32) ApiDcimInventoryItemTemplatesListRequest { + r.componentIdGt = &componentIdGt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentIdGte(componentIdGte []int32) ApiDcimInventoryItemTemplatesListRequest { + r.componentIdGte = &componentIdGte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentIdLt(componentIdLt []int32) ApiDcimInventoryItemTemplatesListRequest { + r.componentIdLt = &componentIdLt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentIdLte(componentIdLte []int32) ApiDcimInventoryItemTemplatesListRequest { + r.componentIdLte = &componentIdLte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentIdN(componentIdN []int32) ApiDcimInventoryItemTemplatesListRequest { + r.componentIdN = &componentIdN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentType(componentType string) ApiDcimInventoryItemTemplatesListRequest { + r.componentType = &componentType + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ComponentTypeN(componentTypeN string) ApiDcimInventoryItemTemplatesListRequest { + r.componentTypeN = &componentTypeN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) Created(created []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimInventoryItemTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) Description(description []string) ApiDcimInventoryItemTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimInventoryItemTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) DevicetypeId(devicetypeId []int32) ApiDcimInventoryItemTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) DevicetypeIdN(devicetypeIdN []int32) ApiDcimInventoryItemTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) Id(id []int32) ApiDcimInventoryItemTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimInventoryItemTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) IdGt(idGt []int32) ApiDcimInventoryItemTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) IdGte(idGte []int32) ApiDcimInventoryItemTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) IdLt(idLt []int32) ApiDcimInventoryItemTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) IdLte(idLte []int32) ApiDcimInventoryItemTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) IdN(idN []int32) ApiDcimInventoryItemTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) Label(label []string) ApiDcimInventoryItemTemplatesListRequest { + r.label = &label + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelEmpty(labelEmpty bool) ApiDcimInventoryItemTemplatesListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelIc(labelIc []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelIe(labelIe []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelIew(labelIew []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelIsw(labelIsw []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelN(labelN []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelNic(labelNic []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelNie(labelNie []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelNiew(labelNiew []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LabelNisw(labelNisw []string) ApiDcimInventoryItemTemplatesListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimInventoryItemTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimInventoryItemTemplatesListRequest) Limit(limit int32) ApiDcimInventoryItemTemplatesListRequest { + r.limit = &limit + return r +} + +// Manufacturer (slug) +func (r ApiDcimInventoryItemTemplatesListRequest) Manufacturer(manufacturer []string) ApiDcimInventoryItemTemplatesListRequest { + r.manufacturer = &manufacturer + return r +} + +// Manufacturer (slug) +func (r ApiDcimInventoryItemTemplatesListRequest) ManufacturerN(manufacturerN []string) ApiDcimInventoryItemTemplatesListRequest { + r.manufacturerN = &manufacturerN + return r +} + +// Manufacturer (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) ManufacturerId(manufacturerId []*int32) ApiDcimInventoryItemTemplatesListRequest { + r.manufacturerId = &manufacturerId + return r +} + +// Manufacturer (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) ManufacturerIdN(manufacturerIdN []*int32) ApiDcimInventoryItemTemplatesListRequest { + r.manufacturerIdN = &manufacturerIdN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimInventoryItemTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) Name(name []string) ApiDcimInventoryItemTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimInventoryItemTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameIc(nameIc []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameIe(nameIe []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameIew(nameIew []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameN(nameN []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameNic(nameNic []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameNie(nameNie []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimInventoryItemTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimInventoryItemTemplatesListRequest) Offset(offset int32) ApiDcimInventoryItemTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimInventoryItemTemplatesListRequest) Ordering(ordering string) ApiDcimInventoryItemTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Parent inventory item (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) ParentId(parentId []*int32) ApiDcimInventoryItemTemplatesListRequest { + r.parentId = &parentId + return r +} + +// Parent inventory item (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) ParentIdN(parentIdN []*int32) ApiDcimInventoryItemTemplatesListRequest { + r.parentIdN = &parentIdN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartId(partId []string) ApiDcimInventoryItemTemplatesListRequest { + r.partId = &partId + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdEmpty(partIdEmpty bool) ApiDcimInventoryItemTemplatesListRequest { + r.partIdEmpty = &partIdEmpty + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdIc(partIdIc []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdIc = &partIdIc + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdIe(partIdIe []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdIe = &partIdIe + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdIew(partIdIew []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdIew = &partIdIew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdIsw(partIdIsw []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdIsw = &partIdIsw + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdN(partIdN []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdN = &partIdN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdNic(partIdNic []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdNic = &partIdNic + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdNie(partIdNie []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdNie = &partIdNie + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdNiew(partIdNiew []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdNiew = &partIdNiew + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) PartIdNisw(partIdNisw []string) ApiDcimInventoryItemTemplatesListRequest { + r.partIdNisw = &partIdNisw + return r +} + +// Search +func (r ApiDcimInventoryItemTemplatesListRequest) Q(q string) ApiDcimInventoryItemTemplatesListRequest { + r.q = &q + return r +} + +// Role (slug) +func (r ApiDcimInventoryItemTemplatesListRequest) Role(role []string) ApiDcimInventoryItemTemplatesListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiDcimInventoryItemTemplatesListRequest) RoleN(roleN []string) ApiDcimInventoryItemTemplatesListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) RoleId(roleId []*int32) ApiDcimInventoryItemTemplatesListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiDcimInventoryItemTemplatesListRequest) RoleIdN(roleIdN []*int32) ApiDcimInventoryItemTemplatesListRequest { + r.roleIdN = &roleIdN + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimInventoryItemTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesListRequest) Execute() (*PaginatedInventoryItemTemplateList, *http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesListExecute(r) +} + +/* +DcimInventoryItemTemplatesList Method for DcimInventoryItemTemplatesList + +Get a list of inventory item template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemTemplatesListRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesList(ctx context.Context) ApiDcimInventoryItemTemplatesListRequest { + return ApiDcimInventoryItemTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInventoryItemTemplateList +func (a *DcimAPIService) DcimInventoryItemTemplatesListExecute(r ApiDcimInventoryItemTemplatesListRequest) (*PaginatedInventoryItemTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInventoryItemTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.componentId != nil { + t := *r.componentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id", t, "multi") + } + } + if r.componentIdEmpty != nil { + t := *r.componentIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__empty", t, "multi") + } + } + if r.componentIdGt != nil { + t := *r.componentIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gt", t, "multi") + } + } + if r.componentIdGte != nil { + t := *r.componentIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gte", t, "multi") + } + } + if r.componentIdLt != nil { + t := *r.componentIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lt", t, "multi") + } + } + if r.componentIdLte != nil { + t := *r.componentIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lte", t, "multi") + } + } + if r.componentIdN != nil { + t := *r.componentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__n", t, "multi") + } + } + if r.componentType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_type", r.componentType, "") + } + if r.componentTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_type__n", r.componentTypeN, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.manufacturer != nil { + t := *r.manufacturer + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", t, "multi") + } + } + if r.manufacturerN != nil { + t := *r.manufacturerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", t, "multi") + } + } + if r.manufacturerId != nil { + t := *r.manufacturerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", t, "multi") + } + } + if r.manufacturerIdN != nil { + t := *r.manufacturerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.partId != nil { + t := *r.partId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id", t, "multi") + } + } + if r.partIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__empty", r.partIdEmpty, "") + } + if r.partIdIc != nil { + t := *r.partIdIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ic", t, "multi") + } + } + if r.partIdIe != nil { + t := *r.partIdIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ie", t, "multi") + } + } + if r.partIdIew != nil { + t := *r.partIdIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__iew", t, "multi") + } + } + if r.partIdIsw != nil { + t := *r.partIdIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__isw", t, "multi") + } + } + if r.partIdN != nil { + t := *r.partIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__n", t, "multi") + } + } + if r.partIdNic != nil { + t := *r.partIdNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nic", t, "multi") + } + } + if r.partIdNie != nil { + t := *r.partIdNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nie", t, "multi") + } + } + if r.partIdNiew != nil { + t := *r.partIdNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__niew", t, "multi") + } + } + if r.partIdNisw != nil { + t := *r.partIdNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nisw", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableInventoryItemTemplateRequest *PatchedWritableInventoryItemTemplateRequest +} + +func (r ApiDcimInventoryItemTemplatesPartialUpdateRequest) PatchedWritableInventoryItemTemplateRequest(patchedWritableInventoryItemTemplateRequest PatchedWritableInventoryItemTemplateRequest) ApiDcimInventoryItemTemplatesPartialUpdateRequest { + r.patchedWritableInventoryItemTemplateRequest = &patchedWritableInventoryItemTemplateRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesPartialUpdateRequest) Execute() (*InventoryItemTemplate, *http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesPartialUpdateExecute(r) +} + +/* +DcimInventoryItemTemplatesPartialUpdate Method for DcimInventoryItemTemplatesPartialUpdate + +Patch a inventory item template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item template. + @return ApiDcimInventoryItemTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimInventoryItemTemplatesPartialUpdateRequest { + return ApiDcimInventoryItemTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItemTemplate +func (a *DcimAPIService) DcimInventoryItemTemplatesPartialUpdateExecute(r ApiDcimInventoryItemTemplatesPartialUpdateRequest) (*InventoryItemTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableInventoryItemTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInventoryItemTemplatesRetrieveRequest) Execute() (*InventoryItemTemplate, *http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesRetrieveExecute(r) +} + +/* +DcimInventoryItemTemplatesRetrieve Method for DcimInventoryItemTemplatesRetrieve + +Get a inventory item template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item template. + @return ApiDcimInventoryItemTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesRetrieve(ctx context.Context, id int32) ApiDcimInventoryItemTemplatesRetrieveRequest { + return ApiDcimInventoryItemTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItemTemplate +func (a *DcimAPIService) DcimInventoryItemTemplatesRetrieveExecute(r ApiDcimInventoryItemTemplatesRetrieveRequest) (*InventoryItemTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableInventoryItemTemplateRequest *WritableInventoryItemTemplateRequest +} + +func (r ApiDcimInventoryItemTemplatesUpdateRequest) WritableInventoryItemTemplateRequest(writableInventoryItemTemplateRequest WritableInventoryItemTemplateRequest) ApiDcimInventoryItemTemplatesUpdateRequest { + r.writableInventoryItemTemplateRequest = &writableInventoryItemTemplateRequest + return r +} + +func (r ApiDcimInventoryItemTemplatesUpdateRequest) Execute() (*InventoryItemTemplate, *http.Response, error) { + return r.ApiService.DcimInventoryItemTemplatesUpdateExecute(r) +} + +/* +DcimInventoryItemTemplatesUpdate Method for DcimInventoryItemTemplatesUpdate + +Put a inventory item template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item template. + @return ApiDcimInventoryItemTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemTemplatesUpdate(ctx context.Context, id int32) ApiDcimInventoryItemTemplatesUpdateRequest { + return ApiDcimInventoryItemTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItemTemplate +func (a *DcimAPIService) DcimInventoryItemTemplatesUpdateExecute(r ApiDcimInventoryItemTemplatesUpdateRequest) (*InventoryItemTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItemTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-item-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInventoryItemTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableInventoryItemTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInventoryItemTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemRequest *[]InventoryItemRequest +} + +func (r ApiDcimInventoryItemsBulkDestroyRequest) InventoryItemRequest(inventoryItemRequest []InventoryItemRequest) ApiDcimInventoryItemsBulkDestroyRequest { + r.inventoryItemRequest = &inventoryItemRequest + return r +} + +func (r ApiDcimInventoryItemsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInventoryItemsBulkDestroyExecute(r) +} + +/* +DcimInventoryItemsBulkDestroy Method for DcimInventoryItemsBulkDestroy + +Delete a list of inventory item objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsBulkDestroy(ctx context.Context) ApiDcimInventoryItemsBulkDestroyRequest { + return ApiDcimInventoryItemsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInventoryItemsBulkDestroyExecute(r ApiDcimInventoryItemsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRequest == nil { + return nil, reportError("inventoryItemRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemRequest *[]InventoryItemRequest +} + +func (r ApiDcimInventoryItemsBulkPartialUpdateRequest) InventoryItemRequest(inventoryItemRequest []InventoryItemRequest) ApiDcimInventoryItemsBulkPartialUpdateRequest { + r.inventoryItemRequest = &inventoryItemRequest + return r +} + +func (r ApiDcimInventoryItemsBulkPartialUpdateRequest) Execute() ([]InventoryItem, *http.Response, error) { + return r.ApiService.DcimInventoryItemsBulkPartialUpdateExecute(r) +} + +/* +DcimInventoryItemsBulkPartialUpdate Method for DcimInventoryItemsBulkPartialUpdate + +Patch a list of inventory item objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsBulkPartialUpdate(ctx context.Context) ApiDcimInventoryItemsBulkPartialUpdateRequest { + return ApiDcimInventoryItemsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InventoryItem +func (a *DcimAPIService) DcimInventoryItemsBulkPartialUpdateExecute(r ApiDcimInventoryItemsBulkPartialUpdateRequest) ([]InventoryItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InventoryItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + inventoryItemRequest *[]InventoryItemRequest +} + +func (r ApiDcimInventoryItemsBulkUpdateRequest) InventoryItemRequest(inventoryItemRequest []InventoryItemRequest) ApiDcimInventoryItemsBulkUpdateRequest { + r.inventoryItemRequest = &inventoryItemRequest + return r +} + +func (r ApiDcimInventoryItemsBulkUpdateRequest) Execute() ([]InventoryItem, *http.Response, error) { + return r.ApiService.DcimInventoryItemsBulkUpdateExecute(r) +} + +/* +DcimInventoryItemsBulkUpdate Method for DcimInventoryItemsBulkUpdate + +Put a list of inventory item objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsBulkUpdate(ctx context.Context) ApiDcimInventoryItemsBulkUpdateRequest { + return ApiDcimInventoryItemsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []InventoryItem +func (a *DcimAPIService) DcimInventoryItemsBulkUpdateExecute(r ApiDcimInventoryItemsBulkUpdateRequest) ([]InventoryItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []InventoryItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inventoryItemRequest == nil { + return localVarReturnValue, nil, reportError("inventoryItemRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inventoryItemRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableInventoryItemRequest *WritableInventoryItemRequest +} + +func (r ApiDcimInventoryItemsCreateRequest) WritableInventoryItemRequest(writableInventoryItemRequest WritableInventoryItemRequest) ApiDcimInventoryItemsCreateRequest { + r.writableInventoryItemRequest = &writableInventoryItemRequest + return r +} + +func (r ApiDcimInventoryItemsCreateRequest) Execute() (*InventoryItem, *http.Response, error) { + return r.ApiService.DcimInventoryItemsCreateExecute(r) +} + +/* +DcimInventoryItemsCreate Method for DcimInventoryItemsCreate + +Post a list of inventory item objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemsCreateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsCreate(ctx context.Context) ApiDcimInventoryItemsCreateRequest { + return ApiDcimInventoryItemsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InventoryItem +func (a *DcimAPIService) DcimInventoryItemsCreateExecute(r ApiDcimInventoryItemsCreateRequest) (*InventoryItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInventoryItemRequest == nil { + return localVarReturnValue, nil, reportError("writableInventoryItemRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInventoryItemRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInventoryItemsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimInventoryItemsDestroyExecute(r) +} + +/* +DcimInventoryItemsDestroy Method for DcimInventoryItemsDestroy + +Delete a inventory item object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item. + @return ApiDcimInventoryItemsDestroyRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsDestroy(ctx context.Context, id int32) ApiDcimInventoryItemsDestroyRequest { + return ApiDcimInventoryItemsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimInventoryItemsDestroyExecute(r ApiDcimInventoryItemsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + assetTag *[]string + assetTagEmpty *bool + assetTagIc *[]string + assetTagIe *[]string + assetTagIew *[]string + assetTagIsw *[]string + assetTagN *[]string + assetTagNic *[]string + assetTagNie *[]string + assetTagNiew *[]string + assetTagNisw *[]string + componentId *[]int32 + componentIdEmpty *[]int32 + componentIdGt *[]int32 + componentIdGte *[]int32 + componentIdLt *[]int32 + componentIdLte *[]int32 + componentIdN *[]int32 + componentType *string + componentTypeN *string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + discovered *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + manufacturer *[]string + manufacturerN *[]string + manufacturerId *[]*int32 + manufacturerIdN *[]*int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parentId *[]*int32 + parentIdN *[]*int32 + partId *[]string + partIdEmpty *bool + partIdIc *[]string + partIdIe *[]string + partIdIew *[]string + partIdIsw *[]string + partIdN *[]string + partIdNic *[]string + partIdNie *[]string + partIdNiew *[]string + partIdNisw *[]string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]*int32 + roleIdN *[]*int32 + serial *[]string + serialEmpty *bool + serialIc *[]string + serialIe *[]string + serialIew *[]string + serialIsw *[]string + serialN *[]string + serialNic *[]string + serialNie *[]string + serialNiew *[]string + serialNisw *[]string + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimInventoryItemsListRequest) AssetTag(assetTag []string) ApiDcimInventoryItemsListRequest { + r.assetTag = &assetTag + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagEmpty(assetTagEmpty bool) ApiDcimInventoryItemsListRequest { + r.assetTagEmpty = &assetTagEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagIc(assetTagIc []string) ApiDcimInventoryItemsListRequest { + r.assetTagIc = &assetTagIc + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagIe(assetTagIe []string) ApiDcimInventoryItemsListRequest { + r.assetTagIe = &assetTagIe + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagIew(assetTagIew []string) ApiDcimInventoryItemsListRequest { + r.assetTagIew = &assetTagIew + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagIsw(assetTagIsw []string) ApiDcimInventoryItemsListRequest { + r.assetTagIsw = &assetTagIsw + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagN(assetTagN []string) ApiDcimInventoryItemsListRequest { + r.assetTagN = &assetTagN + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagNic(assetTagNic []string) ApiDcimInventoryItemsListRequest { + r.assetTagNic = &assetTagNic + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagNie(assetTagNie []string) ApiDcimInventoryItemsListRequest { + r.assetTagNie = &assetTagNie + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagNiew(assetTagNiew []string) ApiDcimInventoryItemsListRequest { + r.assetTagNiew = &assetTagNiew + return r +} + +func (r ApiDcimInventoryItemsListRequest) AssetTagNisw(assetTagNisw []string) ApiDcimInventoryItemsListRequest { + r.assetTagNisw = &assetTagNisw + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentId(componentId []int32) ApiDcimInventoryItemsListRequest { + r.componentId = &componentId + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentIdEmpty(componentIdEmpty []int32) ApiDcimInventoryItemsListRequest { + r.componentIdEmpty = &componentIdEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentIdGt(componentIdGt []int32) ApiDcimInventoryItemsListRequest { + r.componentIdGt = &componentIdGt + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentIdGte(componentIdGte []int32) ApiDcimInventoryItemsListRequest { + r.componentIdGte = &componentIdGte + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentIdLt(componentIdLt []int32) ApiDcimInventoryItemsListRequest { + r.componentIdLt = &componentIdLt + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentIdLte(componentIdLte []int32) ApiDcimInventoryItemsListRequest { + r.componentIdLte = &componentIdLte + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentIdN(componentIdN []int32) ApiDcimInventoryItemsListRequest { + r.componentIdN = &componentIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentType(componentType string) ApiDcimInventoryItemsListRequest { + r.componentType = &componentType + return r +} + +func (r ApiDcimInventoryItemsListRequest) ComponentTypeN(componentTypeN string) ApiDcimInventoryItemsListRequest { + r.componentTypeN = &componentTypeN + return r +} + +func (r ApiDcimInventoryItemsListRequest) Created(created []time.Time) ApiDcimInventoryItemsListRequest { + r.created = &created + return r +} + +func (r ApiDcimInventoryItemsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimInventoryItemsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) CreatedGt(createdGt []time.Time) ApiDcimInventoryItemsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimInventoryItemsListRequest) CreatedGte(createdGte []time.Time) ApiDcimInventoryItemsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimInventoryItemsListRequest) CreatedLt(createdLt []time.Time) ApiDcimInventoryItemsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimInventoryItemsListRequest) CreatedLte(createdLte []time.Time) ApiDcimInventoryItemsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimInventoryItemsListRequest) CreatedN(createdN []time.Time) ApiDcimInventoryItemsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) CreatedByRequest(createdByRequest string) ApiDcimInventoryItemsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +// Device (name) +func (r ApiDcimInventoryItemsListRequest) Device(device []*string) ApiDcimInventoryItemsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimInventoryItemsListRequest) DeviceN(deviceN []*string) ApiDcimInventoryItemsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimInventoryItemsListRequest) DeviceId(deviceId []int32) ApiDcimInventoryItemsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimInventoryItemsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimInventoryItemsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimInventoryItemsListRequest) DeviceRole(deviceRole []string) ApiDcimInventoryItemsListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimInventoryItemsListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimInventoryItemsListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimInventoryItemsListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimInventoryItemsListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimInventoryItemsListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimInventoryItemsListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimInventoryItemsListRequest) DeviceType(deviceType []string) ApiDcimInventoryItemsListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimInventoryItemsListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimInventoryItemsListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimInventoryItemsListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimInventoryItemsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimInventoryItemsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimInventoryItemsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) Discovered(discovered bool) ApiDcimInventoryItemsListRequest { + r.discovered = &discovered + return r +} + +func (r ApiDcimInventoryItemsListRequest) Id(id []int32) ApiDcimInventoryItemsListRequest { + r.id = &id + return r +} + +func (r ApiDcimInventoryItemsListRequest) IdEmpty(idEmpty bool) ApiDcimInventoryItemsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) IdGt(idGt []int32) ApiDcimInventoryItemsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimInventoryItemsListRequest) IdGte(idGte []int32) ApiDcimInventoryItemsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimInventoryItemsListRequest) IdLt(idLt []int32) ApiDcimInventoryItemsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimInventoryItemsListRequest) IdLte(idLte []int32) ApiDcimInventoryItemsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimInventoryItemsListRequest) IdN(idN []int32) ApiDcimInventoryItemsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimInventoryItemsListRequest) Label(label []string) ApiDcimInventoryItemsListRequest { + r.label = &label + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelEmpty(labelEmpty bool) ApiDcimInventoryItemsListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelIc(labelIc []string) ApiDcimInventoryItemsListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelIe(labelIe []string) ApiDcimInventoryItemsListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelIew(labelIew []string) ApiDcimInventoryItemsListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelIsw(labelIsw []string) ApiDcimInventoryItemsListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelN(labelN []string) ApiDcimInventoryItemsListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelNic(labelNic []string) ApiDcimInventoryItemsListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelNie(labelNie []string) ApiDcimInventoryItemsListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelNiew(labelNiew []string) ApiDcimInventoryItemsListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimInventoryItemsListRequest) LabelNisw(labelNisw []string) ApiDcimInventoryItemsListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimInventoryItemsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimInventoryItemsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimInventoryItemsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimInventoryItemsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimInventoryItemsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimInventoryItemsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimInventoryItemsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimInventoryItemsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimInventoryItemsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimInventoryItemsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimInventoryItemsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimInventoryItemsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimInventoryItemsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimInventoryItemsListRequest) Limit(limit int32) ApiDcimInventoryItemsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimInventoryItemsListRequest) Location(location []string) ApiDcimInventoryItemsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimInventoryItemsListRequest) LocationN(locationN []string) ApiDcimInventoryItemsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimInventoryItemsListRequest) LocationId(locationId []int32) ApiDcimInventoryItemsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimInventoryItemsListRequest) LocationIdN(locationIdN []int32) ApiDcimInventoryItemsListRequest { + r.locationIdN = &locationIdN + return r +} + +// Manufacturer (slug) +func (r ApiDcimInventoryItemsListRequest) Manufacturer(manufacturer []string) ApiDcimInventoryItemsListRequest { + r.manufacturer = &manufacturer + return r +} + +// Manufacturer (slug) +func (r ApiDcimInventoryItemsListRequest) ManufacturerN(manufacturerN []string) ApiDcimInventoryItemsListRequest { + r.manufacturerN = &manufacturerN + return r +} + +// Manufacturer (ID) +func (r ApiDcimInventoryItemsListRequest) ManufacturerId(manufacturerId []*int32) ApiDcimInventoryItemsListRequest { + r.manufacturerId = &manufacturerId + return r +} + +// Manufacturer (ID) +func (r ApiDcimInventoryItemsListRequest) ManufacturerIdN(manufacturerIdN []*int32) ApiDcimInventoryItemsListRequest { + r.manufacturerIdN = &manufacturerIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimInventoryItemsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimInventoryItemsListRequest) Name(name []string) ApiDcimInventoryItemsListRequest { + r.name = &name + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameEmpty(nameEmpty bool) ApiDcimInventoryItemsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameIc(nameIc []string) ApiDcimInventoryItemsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameIe(nameIe []string) ApiDcimInventoryItemsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameIew(nameIew []string) ApiDcimInventoryItemsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameIsw(nameIsw []string) ApiDcimInventoryItemsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameN(nameN []string) ApiDcimInventoryItemsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameNic(nameNic []string) ApiDcimInventoryItemsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameNie(nameNie []string) ApiDcimInventoryItemsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameNiew(nameNiew []string) ApiDcimInventoryItemsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimInventoryItemsListRequest) NameNisw(nameNisw []string) ApiDcimInventoryItemsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimInventoryItemsListRequest) Offset(offset int32) ApiDcimInventoryItemsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimInventoryItemsListRequest) Ordering(ordering string) ApiDcimInventoryItemsListRequest { + r.ordering = &ordering + return r +} + +// Parent inventory item (ID) +func (r ApiDcimInventoryItemsListRequest) ParentId(parentId []*int32) ApiDcimInventoryItemsListRequest { + r.parentId = &parentId + return r +} + +// Parent inventory item (ID) +func (r ApiDcimInventoryItemsListRequest) ParentIdN(parentIdN []*int32) ApiDcimInventoryItemsListRequest { + r.parentIdN = &parentIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartId(partId []string) ApiDcimInventoryItemsListRequest { + r.partId = &partId + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdEmpty(partIdEmpty bool) ApiDcimInventoryItemsListRequest { + r.partIdEmpty = &partIdEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdIc(partIdIc []string) ApiDcimInventoryItemsListRequest { + r.partIdIc = &partIdIc + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdIe(partIdIe []string) ApiDcimInventoryItemsListRequest { + r.partIdIe = &partIdIe + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdIew(partIdIew []string) ApiDcimInventoryItemsListRequest { + r.partIdIew = &partIdIew + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdIsw(partIdIsw []string) ApiDcimInventoryItemsListRequest { + r.partIdIsw = &partIdIsw + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdN(partIdN []string) ApiDcimInventoryItemsListRequest { + r.partIdN = &partIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdNic(partIdNic []string) ApiDcimInventoryItemsListRequest { + r.partIdNic = &partIdNic + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdNie(partIdNie []string) ApiDcimInventoryItemsListRequest { + r.partIdNie = &partIdNie + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdNiew(partIdNiew []string) ApiDcimInventoryItemsListRequest { + r.partIdNiew = &partIdNiew + return r +} + +func (r ApiDcimInventoryItemsListRequest) PartIdNisw(partIdNisw []string) ApiDcimInventoryItemsListRequest { + r.partIdNisw = &partIdNisw + return r +} + +// Search +func (r ApiDcimInventoryItemsListRequest) Q(q string) ApiDcimInventoryItemsListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimInventoryItemsListRequest) Rack(rack []string) ApiDcimInventoryItemsListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimInventoryItemsListRequest) RackN(rackN []string) ApiDcimInventoryItemsListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimInventoryItemsListRequest) RackId(rackId []int32) ApiDcimInventoryItemsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimInventoryItemsListRequest) RackIdN(rackIdN []int32) ApiDcimInventoryItemsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimInventoryItemsListRequest) Region(region []int32) ApiDcimInventoryItemsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimInventoryItemsListRequest) RegionN(regionN []int32) ApiDcimInventoryItemsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimInventoryItemsListRequest) RegionId(regionId []int32) ApiDcimInventoryItemsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimInventoryItemsListRequest) RegionIdN(regionIdN []int32) ApiDcimInventoryItemsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Role (slug) +func (r ApiDcimInventoryItemsListRequest) Role(role []string) ApiDcimInventoryItemsListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiDcimInventoryItemsListRequest) RoleN(roleN []string) ApiDcimInventoryItemsListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiDcimInventoryItemsListRequest) RoleId(roleId []*int32) ApiDcimInventoryItemsListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiDcimInventoryItemsListRequest) RoleIdN(roleIdN []*int32) ApiDcimInventoryItemsListRequest { + r.roleIdN = &roleIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) Serial(serial []string) ApiDcimInventoryItemsListRequest { + r.serial = &serial + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialEmpty(serialEmpty bool) ApiDcimInventoryItemsListRequest { + r.serialEmpty = &serialEmpty + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialIc(serialIc []string) ApiDcimInventoryItemsListRequest { + r.serialIc = &serialIc + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialIe(serialIe []string) ApiDcimInventoryItemsListRequest { + r.serialIe = &serialIe + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialIew(serialIew []string) ApiDcimInventoryItemsListRequest { + r.serialIew = &serialIew + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialIsw(serialIsw []string) ApiDcimInventoryItemsListRequest { + r.serialIsw = &serialIsw + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialN(serialN []string) ApiDcimInventoryItemsListRequest { + r.serialN = &serialN + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialNic(serialNic []string) ApiDcimInventoryItemsListRequest { + r.serialNic = &serialNic + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialNie(serialNie []string) ApiDcimInventoryItemsListRequest { + r.serialNie = &serialNie + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialNiew(serialNiew []string) ApiDcimInventoryItemsListRequest { + r.serialNiew = &serialNiew + return r +} + +func (r ApiDcimInventoryItemsListRequest) SerialNisw(serialNisw []string) ApiDcimInventoryItemsListRequest { + r.serialNisw = &serialNisw + return r +} + +// Site name (slug) +func (r ApiDcimInventoryItemsListRequest) Site(site []string) ApiDcimInventoryItemsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimInventoryItemsListRequest) SiteN(siteN []string) ApiDcimInventoryItemsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimInventoryItemsListRequest) SiteGroup(siteGroup []int32) ApiDcimInventoryItemsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimInventoryItemsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimInventoryItemsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimInventoryItemsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimInventoryItemsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimInventoryItemsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimInventoryItemsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimInventoryItemsListRequest) SiteId(siteId []int32) ApiDcimInventoryItemsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimInventoryItemsListRequest) SiteIdN(siteIdN []int32) ApiDcimInventoryItemsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) Tag(tag []string) ApiDcimInventoryItemsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimInventoryItemsListRequest) TagN(tagN []string) ApiDcimInventoryItemsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimInventoryItemsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimInventoryItemsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimInventoryItemsListRequest) VirtualChassis(virtualChassis []string) ApiDcimInventoryItemsListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimInventoryItemsListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimInventoryItemsListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimInventoryItemsListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimInventoryItemsListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimInventoryItemsListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimInventoryItemsListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimInventoryItemsListRequest) Execute() (*PaginatedInventoryItemList, *http.Response, error) { + return r.ApiService.DcimInventoryItemsListExecute(r) +} + +/* +DcimInventoryItemsList Method for DcimInventoryItemsList + +Get a list of inventory item objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimInventoryItemsListRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsList(ctx context.Context) ApiDcimInventoryItemsListRequest { + return ApiDcimInventoryItemsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInventoryItemList +func (a *DcimAPIService) DcimInventoryItemsListExecute(r ApiDcimInventoryItemsListRequest) (*PaginatedInventoryItemList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInventoryItemList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.assetTag != nil { + t := *r.assetTag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", t, "multi") + } + } + if r.assetTagEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__empty", r.assetTagEmpty, "") + } + if r.assetTagIc != nil { + t := *r.assetTagIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", t, "multi") + } + } + if r.assetTagIe != nil { + t := *r.assetTagIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", t, "multi") + } + } + if r.assetTagIew != nil { + t := *r.assetTagIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", t, "multi") + } + } + if r.assetTagIsw != nil { + t := *r.assetTagIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", t, "multi") + } + } + if r.assetTagN != nil { + t := *r.assetTagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", t, "multi") + } + } + if r.assetTagNic != nil { + t := *r.assetTagNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", t, "multi") + } + } + if r.assetTagNie != nil { + t := *r.assetTagNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", t, "multi") + } + } + if r.assetTagNiew != nil { + t := *r.assetTagNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", t, "multi") + } + } + if r.assetTagNisw != nil { + t := *r.assetTagNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", t, "multi") + } + } + if r.componentId != nil { + t := *r.componentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id", t, "multi") + } + } + if r.componentIdEmpty != nil { + t := *r.componentIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__empty", t, "multi") + } + } + if r.componentIdGt != nil { + t := *r.componentIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gt", t, "multi") + } + } + if r.componentIdGte != nil { + t := *r.componentIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__gte", t, "multi") + } + } + if r.componentIdLt != nil { + t := *r.componentIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lt", t, "multi") + } + } + if r.componentIdLte != nil { + t := *r.componentIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__lte", t, "multi") + } + } + if r.componentIdN != nil { + t := *r.componentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_id__n", t, "multi") + } + } + if r.componentType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_type", r.componentType, "") + } + if r.componentTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "component_type__n", r.componentTypeN, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.discovered != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "discovered", r.discovered, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.manufacturer != nil { + t := *r.manufacturer + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", t, "multi") + } + } + if r.manufacturerN != nil { + t := *r.manufacturerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", t, "multi") + } + } + if r.manufacturerId != nil { + t := *r.manufacturerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", t, "multi") + } + } + if r.manufacturerIdN != nil { + t := *r.manufacturerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.partId != nil { + t := *r.partId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id", t, "multi") + } + } + if r.partIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__empty", r.partIdEmpty, "") + } + if r.partIdIc != nil { + t := *r.partIdIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ic", t, "multi") + } + } + if r.partIdIe != nil { + t := *r.partIdIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__ie", t, "multi") + } + } + if r.partIdIew != nil { + t := *r.partIdIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__iew", t, "multi") + } + } + if r.partIdIsw != nil { + t := *r.partIdIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__isw", t, "multi") + } + } + if r.partIdN != nil { + t := *r.partIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__n", t, "multi") + } + } + if r.partIdNic != nil { + t := *r.partIdNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nic", t, "multi") + } + } + if r.partIdNie != nil { + t := *r.partIdNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nie", t, "multi") + } + } + if r.partIdNiew != nil { + t := *r.partIdNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__niew", t, "multi") + } + } + if r.partIdNisw != nil { + t := *r.partIdNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_id__nisw", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.serial != nil { + t := *r.serial + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", t, "multi") + } + } + if r.serialEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__empty", r.serialEmpty, "") + } + if r.serialIc != nil { + t := *r.serialIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", t, "multi") + } + } + if r.serialIe != nil { + t := *r.serialIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", t, "multi") + } + } + if r.serialIew != nil { + t := *r.serialIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", t, "multi") + } + } + if r.serialIsw != nil { + t := *r.serialIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", t, "multi") + } + } + if r.serialN != nil { + t := *r.serialN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", t, "multi") + } + } + if r.serialNic != nil { + t := *r.serialNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", t, "multi") + } + } + if r.serialNie != nil { + t := *r.serialNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", t, "multi") + } + } + if r.serialNiew != nil { + t := *r.serialNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", t, "multi") + } + } + if r.serialNisw != nil { + t := *r.serialNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableInventoryItemRequest *PatchedWritableInventoryItemRequest +} + +func (r ApiDcimInventoryItemsPartialUpdateRequest) PatchedWritableInventoryItemRequest(patchedWritableInventoryItemRequest PatchedWritableInventoryItemRequest) ApiDcimInventoryItemsPartialUpdateRequest { + r.patchedWritableInventoryItemRequest = &patchedWritableInventoryItemRequest + return r +} + +func (r ApiDcimInventoryItemsPartialUpdateRequest) Execute() (*InventoryItem, *http.Response, error) { + return r.ApiService.DcimInventoryItemsPartialUpdateExecute(r) +} + +/* +DcimInventoryItemsPartialUpdate Method for DcimInventoryItemsPartialUpdate + +Patch a inventory item object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item. + @return ApiDcimInventoryItemsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsPartialUpdate(ctx context.Context, id int32) ApiDcimInventoryItemsPartialUpdateRequest { + return ApiDcimInventoryItemsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItem +func (a *DcimAPIService) DcimInventoryItemsPartialUpdateExecute(r ApiDcimInventoryItemsPartialUpdateRequest) (*InventoryItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableInventoryItemRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimInventoryItemsRetrieveRequest) Execute() (*InventoryItem, *http.Response, error) { + return r.ApiService.DcimInventoryItemsRetrieveExecute(r) +} + +/* +DcimInventoryItemsRetrieve Method for DcimInventoryItemsRetrieve + +Get a inventory item object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item. + @return ApiDcimInventoryItemsRetrieveRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsRetrieve(ctx context.Context, id int32) ApiDcimInventoryItemsRetrieveRequest { + return ApiDcimInventoryItemsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItem +func (a *DcimAPIService) DcimInventoryItemsRetrieveExecute(r ApiDcimInventoryItemsRetrieveRequest) (*InventoryItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimInventoryItemsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableInventoryItemRequest *WritableInventoryItemRequest +} + +func (r ApiDcimInventoryItemsUpdateRequest) WritableInventoryItemRequest(writableInventoryItemRequest WritableInventoryItemRequest) ApiDcimInventoryItemsUpdateRequest { + r.writableInventoryItemRequest = &writableInventoryItemRequest + return r +} + +func (r ApiDcimInventoryItemsUpdateRequest) Execute() (*InventoryItem, *http.Response, error) { + return r.ApiService.DcimInventoryItemsUpdateExecute(r) +} + +/* +DcimInventoryItemsUpdate Method for DcimInventoryItemsUpdate + +Put a inventory item object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this inventory item. + @return ApiDcimInventoryItemsUpdateRequest +*/ +func (a *DcimAPIService) DcimInventoryItemsUpdate(ctx context.Context, id int32) ApiDcimInventoryItemsUpdateRequest { + return ApiDcimInventoryItemsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InventoryItem +func (a *DcimAPIService) DcimInventoryItemsUpdateExecute(r ApiDcimInventoryItemsUpdateRequest) (*InventoryItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InventoryItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimInventoryItemsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/inventory-items/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableInventoryItemRequest == nil { + return localVarReturnValue, nil, reportError("writableInventoryItemRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableInventoryItemRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimLocationsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + locationRequest *[]LocationRequest +} + +func (r ApiDcimLocationsBulkDestroyRequest) LocationRequest(locationRequest []LocationRequest) ApiDcimLocationsBulkDestroyRequest { + r.locationRequest = &locationRequest + return r +} + +func (r ApiDcimLocationsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimLocationsBulkDestroyExecute(r) +} + +/* +DcimLocationsBulkDestroy Method for DcimLocationsBulkDestroy + +Delete a list of location objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimLocationsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimLocationsBulkDestroy(ctx context.Context) ApiDcimLocationsBulkDestroyRequest { + return ApiDcimLocationsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimLocationsBulkDestroyExecute(r ApiDcimLocationsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.locationRequest == nil { + return nil, reportError("locationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.locationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimLocationsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + locationRequest *[]LocationRequest +} + +func (r ApiDcimLocationsBulkPartialUpdateRequest) LocationRequest(locationRequest []LocationRequest) ApiDcimLocationsBulkPartialUpdateRequest { + r.locationRequest = &locationRequest + return r +} + +func (r ApiDcimLocationsBulkPartialUpdateRequest) Execute() ([]Location, *http.Response, error) { + return r.ApiService.DcimLocationsBulkPartialUpdateExecute(r) +} + +/* +DcimLocationsBulkPartialUpdate Method for DcimLocationsBulkPartialUpdate + +Patch a list of location objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimLocationsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimLocationsBulkPartialUpdate(ctx context.Context) ApiDcimLocationsBulkPartialUpdateRequest { + return ApiDcimLocationsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Location +func (a *DcimAPIService) DcimLocationsBulkPartialUpdateExecute(r ApiDcimLocationsBulkPartialUpdateRequest) ([]Location, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Location + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.locationRequest == nil { + return localVarReturnValue, nil, reportError("locationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.locationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimLocationsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + locationRequest *[]LocationRequest +} + +func (r ApiDcimLocationsBulkUpdateRequest) LocationRequest(locationRequest []LocationRequest) ApiDcimLocationsBulkUpdateRequest { + r.locationRequest = &locationRequest + return r +} + +func (r ApiDcimLocationsBulkUpdateRequest) Execute() ([]Location, *http.Response, error) { + return r.ApiService.DcimLocationsBulkUpdateExecute(r) +} + +/* +DcimLocationsBulkUpdate Method for DcimLocationsBulkUpdate + +Put a list of location objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimLocationsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimLocationsBulkUpdate(ctx context.Context) ApiDcimLocationsBulkUpdateRequest { + return ApiDcimLocationsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Location +func (a *DcimAPIService) DcimLocationsBulkUpdateExecute(r ApiDcimLocationsBulkUpdateRequest) ([]Location, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Location + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.locationRequest == nil { + return localVarReturnValue, nil, reportError("locationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.locationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimLocationsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableLocationRequest *WritableLocationRequest +} + +func (r ApiDcimLocationsCreateRequest) WritableLocationRequest(writableLocationRequest WritableLocationRequest) ApiDcimLocationsCreateRequest { + r.writableLocationRequest = &writableLocationRequest + return r +} + +func (r ApiDcimLocationsCreateRequest) Execute() (*Location, *http.Response, error) { + return r.ApiService.DcimLocationsCreateExecute(r) +} + +/* +DcimLocationsCreate Method for DcimLocationsCreate + +Post a list of location objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimLocationsCreateRequest +*/ +func (a *DcimAPIService) DcimLocationsCreate(ctx context.Context) ApiDcimLocationsCreateRequest { + return ApiDcimLocationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Location +func (a *DcimAPIService) DcimLocationsCreateExecute(r ApiDcimLocationsCreateRequest) (*Location, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Location + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableLocationRequest == nil { + return localVarReturnValue, nil, reportError("writableLocationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableLocationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimLocationsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimLocationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimLocationsDestroyExecute(r) +} + +/* +DcimLocationsDestroy Method for DcimLocationsDestroy + +Delete a location object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this location. + @return ApiDcimLocationsDestroyRequest +*/ +func (a *DcimAPIService) DcimLocationsDestroy(ctx context.Context, id int32) ApiDcimLocationsDestroyRequest { + return ApiDcimLocationsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimLocationsDestroyExecute(r ApiDcimLocationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimLocationsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parent *[]int32 + parentN *[]int32 + parentId *[]int32 + parentIdN *[]int32 + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +// Contact +func (r ApiDcimLocationsListRequest) Contact(contact []int32) ApiDcimLocationsListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimLocationsListRequest) ContactN(contactN []int32) ApiDcimLocationsListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimLocationsListRequest) ContactGroup(contactGroup []int32) ApiDcimLocationsListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimLocationsListRequest) ContactGroupN(contactGroupN []int32) ApiDcimLocationsListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimLocationsListRequest) ContactRole(contactRole []int32) ApiDcimLocationsListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimLocationsListRequest) ContactRoleN(contactRoleN []int32) ApiDcimLocationsListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimLocationsListRequest) Created(created []time.Time) ApiDcimLocationsListRequest { + r.created = &created + return r +} + +func (r ApiDcimLocationsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimLocationsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimLocationsListRequest) CreatedGt(createdGt []time.Time) ApiDcimLocationsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimLocationsListRequest) CreatedGte(createdGte []time.Time) ApiDcimLocationsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimLocationsListRequest) CreatedLt(createdLt []time.Time) ApiDcimLocationsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimLocationsListRequest) CreatedLte(createdLte []time.Time) ApiDcimLocationsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimLocationsListRequest) CreatedN(createdN []time.Time) ApiDcimLocationsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimLocationsListRequest) CreatedByRequest(createdByRequest string) ApiDcimLocationsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimLocationsListRequest) Description(description []string) ApiDcimLocationsListRequest { + r.description = &description + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimLocationsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionIc(descriptionIc []string) ApiDcimLocationsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionIe(descriptionIe []string) ApiDcimLocationsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionIew(descriptionIew []string) ApiDcimLocationsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimLocationsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionN(descriptionN []string) ApiDcimLocationsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionNic(descriptionNic []string) ApiDcimLocationsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionNie(descriptionNie []string) ApiDcimLocationsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimLocationsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimLocationsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimLocationsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimLocationsListRequest) Id(id []int32) ApiDcimLocationsListRequest { + r.id = &id + return r +} + +func (r ApiDcimLocationsListRequest) IdEmpty(idEmpty bool) ApiDcimLocationsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimLocationsListRequest) IdGt(idGt []int32) ApiDcimLocationsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimLocationsListRequest) IdGte(idGte []int32) ApiDcimLocationsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimLocationsListRequest) IdLt(idLt []int32) ApiDcimLocationsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimLocationsListRequest) IdLte(idLte []int32) ApiDcimLocationsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimLocationsListRequest) IdN(idN []int32) ApiDcimLocationsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimLocationsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimLocationsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimLocationsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimLocationsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimLocationsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimLocationsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimLocationsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimLocationsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimLocationsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimLocationsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimLocationsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimLocationsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimLocationsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimLocationsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimLocationsListRequest) Limit(limit int32) ApiDcimLocationsListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimLocationsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimLocationsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimLocationsListRequest) Name(name []string) ApiDcimLocationsListRequest { + r.name = &name + return r +} + +func (r ApiDcimLocationsListRequest) NameEmpty(nameEmpty bool) ApiDcimLocationsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimLocationsListRequest) NameIc(nameIc []string) ApiDcimLocationsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimLocationsListRequest) NameIe(nameIe []string) ApiDcimLocationsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimLocationsListRequest) NameIew(nameIew []string) ApiDcimLocationsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimLocationsListRequest) NameIsw(nameIsw []string) ApiDcimLocationsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimLocationsListRequest) NameN(nameN []string) ApiDcimLocationsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimLocationsListRequest) NameNic(nameNic []string) ApiDcimLocationsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimLocationsListRequest) NameNie(nameNie []string) ApiDcimLocationsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimLocationsListRequest) NameNiew(nameNiew []string) ApiDcimLocationsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimLocationsListRequest) NameNisw(nameNisw []string) ApiDcimLocationsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimLocationsListRequest) Offset(offset int32) ApiDcimLocationsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimLocationsListRequest) Ordering(ordering string) ApiDcimLocationsListRequest { + r.ordering = &ordering + return r +} + +// Location (slug) +func (r ApiDcimLocationsListRequest) Parent(parent []int32) ApiDcimLocationsListRequest { + r.parent = &parent + return r +} + +// Location (slug) +func (r ApiDcimLocationsListRequest) ParentN(parentN []int32) ApiDcimLocationsListRequest { + r.parentN = &parentN + return r +} + +// Location (ID) +func (r ApiDcimLocationsListRequest) ParentId(parentId []int32) ApiDcimLocationsListRequest { + r.parentId = &parentId + return r +} + +// Location (ID) +func (r ApiDcimLocationsListRequest) ParentIdN(parentIdN []int32) ApiDcimLocationsListRequest { + r.parentIdN = &parentIdN + return r +} + +// Search +func (r ApiDcimLocationsListRequest) Q(q string) ApiDcimLocationsListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiDcimLocationsListRequest) Region(region []int32) ApiDcimLocationsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimLocationsListRequest) RegionN(regionN []int32) ApiDcimLocationsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimLocationsListRequest) RegionId(regionId []int32) ApiDcimLocationsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimLocationsListRequest) RegionIdN(regionIdN []int32) ApiDcimLocationsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site (slug) +func (r ApiDcimLocationsListRequest) Site(site []string) ApiDcimLocationsListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiDcimLocationsListRequest) SiteN(siteN []string) ApiDcimLocationsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimLocationsListRequest) SiteGroup(siteGroup []int32) ApiDcimLocationsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimLocationsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimLocationsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimLocationsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimLocationsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimLocationsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimLocationsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimLocationsListRequest) SiteId(siteId []int32) ApiDcimLocationsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimLocationsListRequest) SiteIdN(siteIdN []int32) ApiDcimLocationsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimLocationsListRequest) Slug(slug []string) ApiDcimLocationsListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimLocationsListRequest) SlugEmpty(slugEmpty bool) ApiDcimLocationsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimLocationsListRequest) SlugIc(slugIc []string) ApiDcimLocationsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimLocationsListRequest) SlugIe(slugIe []string) ApiDcimLocationsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimLocationsListRequest) SlugIew(slugIew []string) ApiDcimLocationsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimLocationsListRequest) SlugIsw(slugIsw []string) ApiDcimLocationsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimLocationsListRequest) SlugN(slugN []string) ApiDcimLocationsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimLocationsListRequest) SlugNic(slugNic []string) ApiDcimLocationsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimLocationsListRequest) SlugNie(slugNie []string) ApiDcimLocationsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimLocationsListRequest) SlugNiew(slugNiew []string) ApiDcimLocationsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimLocationsListRequest) SlugNisw(slugNisw []string) ApiDcimLocationsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimLocationsListRequest) Status(status []string) ApiDcimLocationsListRequest { + r.status = &status + return r +} + +func (r ApiDcimLocationsListRequest) StatusN(statusN []string) ApiDcimLocationsListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimLocationsListRequest) Tag(tag []string) ApiDcimLocationsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimLocationsListRequest) TagN(tagN []string) ApiDcimLocationsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimLocationsListRequest) Tenant(tenant []string) ApiDcimLocationsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimLocationsListRequest) TenantN(tenantN []string) ApiDcimLocationsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimLocationsListRequest) TenantGroup(tenantGroup []int32) ApiDcimLocationsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimLocationsListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimLocationsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimLocationsListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimLocationsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimLocationsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimLocationsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimLocationsListRequest) TenantId(tenantId []*int32) ApiDcimLocationsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimLocationsListRequest) TenantIdN(tenantIdN []*int32) ApiDcimLocationsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimLocationsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimLocationsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimLocationsListRequest) Execute() (*PaginatedLocationList, *http.Response, error) { + return r.ApiService.DcimLocationsListExecute(r) +} + +/* +DcimLocationsList Method for DcimLocationsList + +Get a list of location objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimLocationsListRequest +*/ +func (a *DcimAPIService) DcimLocationsList(ctx context.Context) ApiDcimLocationsListRequest { + return ApiDcimLocationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLocationList +func (a *DcimAPIService) DcimLocationsListExecute(r ApiDcimLocationsListRequest) (*PaginatedLocationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLocationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.parentN != nil { + t := *r.parentN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", t, "multi") + } + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimLocationsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableLocationRequest *PatchedWritableLocationRequest +} + +func (r ApiDcimLocationsPartialUpdateRequest) PatchedWritableLocationRequest(patchedWritableLocationRequest PatchedWritableLocationRequest) ApiDcimLocationsPartialUpdateRequest { + r.patchedWritableLocationRequest = &patchedWritableLocationRequest + return r +} + +func (r ApiDcimLocationsPartialUpdateRequest) Execute() (*Location, *http.Response, error) { + return r.ApiService.DcimLocationsPartialUpdateExecute(r) +} + +/* +DcimLocationsPartialUpdate Method for DcimLocationsPartialUpdate + +Patch a location object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this location. + @return ApiDcimLocationsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimLocationsPartialUpdate(ctx context.Context, id int32) ApiDcimLocationsPartialUpdateRequest { + return ApiDcimLocationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Location +func (a *DcimAPIService) DcimLocationsPartialUpdateExecute(r ApiDcimLocationsPartialUpdateRequest) (*Location, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Location + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableLocationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimLocationsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimLocationsRetrieveRequest) Execute() (*Location, *http.Response, error) { + return r.ApiService.DcimLocationsRetrieveExecute(r) +} + +/* +DcimLocationsRetrieve Method for DcimLocationsRetrieve + +Get a location object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this location. + @return ApiDcimLocationsRetrieveRequest +*/ +func (a *DcimAPIService) DcimLocationsRetrieve(ctx context.Context, id int32) ApiDcimLocationsRetrieveRequest { + return ApiDcimLocationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Location +func (a *DcimAPIService) DcimLocationsRetrieveExecute(r ApiDcimLocationsRetrieveRequest) (*Location, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Location + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimLocationsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableLocationRequest *WritableLocationRequest +} + +func (r ApiDcimLocationsUpdateRequest) WritableLocationRequest(writableLocationRequest WritableLocationRequest) ApiDcimLocationsUpdateRequest { + r.writableLocationRequest = &writableLocationRequest + return r +} + +func (r ApiDcimLocationsUpdateRequest) Execute() (*Location, *http.Response, error) { + return r.ApiService.DcimLocationsUpdateExecute(r) +} + +/* +DcimLocationsUpdate Method for DcimLocationsUpdate + +Put a location object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this location. + @return ApiDcimLocationsUpdateRequest +*/ +func (a *DcimAPIService) DcimLocationsUpdate(ctx context.Context, id int32) ApiDcimLocationsUpdateRequest { + return ApiDcimLocationsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Location +func (a *DcimAPIService) DcimLocationsUpdateExecute(r ApiDcimLocationsUpdateRequest) (*Location, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Location + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimLocationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/locations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableLocationRequest == nil { + return localVarReturnValue, nil, reportError("writableLocationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableLocationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimManufacturersBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + manufacturerRequest *[]ManufacturerRequest +} + +func (r ApiDcimManufacturersBulkDestroyRequest) ManufacturerRequest(manufacturerRequest []ManufacturerRequest) ApiDcimManufacturersBulkDestroyRequest { + r.manufacturerRequest = &manufacturerRequest + return r +} + +func (r ApiDcimManufacturersBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimManufacturersBulkDestroyExecute(r) +} + +/* +DcimManufacturersBulkDestroy Method for DcimManufacturersBulkDestroy + +Delete a list of manufacturer objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimManufacturersBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimManufacturersBulkDestroy(ctx context.Context) ApiDcimManufacturersBulkDestroyRequest { + return ApiDcimManufacturersBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimManufacturersBulkDestroyExecute(r ApiDcimManufacturersBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.manufacturerRequest == nil { + return nil, reportError("manufacturerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.manufacturerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimManufacturersBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + manufacturerRequest *[]ManufacturerRequest +} + +func (r ApiDcimManufacturersBulkPartialUpdateRequest) ManufacturerRequest(manufacturerRequest []ManufacturerRequest) ApiDcimManufacturersBulkPartialUpdateRequest { + r.manufacturerRequest = &manufacturerRequest + return r +} + +func (r ApiDcimManufacturersBulkPartialUpdateRequest) Execute() ([]Manufacturer, *http.Response, error) { + return r.ApiService.DcimManufacturersBulkPartialUpdateExecute(r) +} + +/* +DcimManufacturersBulkPartialUpdate Method for DcimManufacturersBulkPartialUpdate + +Patch a list of manufacturer objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimManufacturersBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimManufacturersBulkPartialUpdate(ctx context.Context) ApiDcimManufacturersBulkPartialUpdateRequest { + return ApiDcimManufacturersBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Manufacturer +func (a *DcimAPIService) DcimManufacturersBulkPartialUpdateExecute(r ApiDcimManufacturersBulkPartialUpdateRequest) ([]Manufacturer, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Manufacturer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.manufacturerRequest == nil { + return localVarReturnValue, nil, reportError("manufacturerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.manufacturerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimManufacturersBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + manufacturerRequest *[]ManufacturerRequest +} + +func (r ApiDcimManufacturersBulkUpdateRequest) ManufacturerRequest(manufacturerRequest []ManufacturerRequest) ApiDcimManufacturersBulkUpdateRequest { + r.manufacturerRequest = &manufacturerRequest + return r +} + +func (r ApiDcimManufacturersBulkUpdateRequest) Execute() ([]Manufacturer, *http.Response, error) { + return r.ApiService.DcimManufacturersBulkUpdateExecute(r) +} + +/* +DcimManufacturersBulkUpdate Method for DcimManufacturersBulkUpdate + +Put a list of manufacturer objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimManufacturersBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimManufacturersBulkUpdate(ctx context.Context) ApiDcimManufacturersBulkUpdateRequest { + return ApiDcimManufacturersBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Manufacturer +func (a *DcimAPIService) DcimManufacturersBulkUpdateExecute(r ApiDcimManufacturersBulkUpdateRequest) ([]Manufacturer, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Manufacturer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.manufacturerRequest == nil { + return localVarReturnValue, nil, reportError("manufacturerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.manufacturerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimManufacturersCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + manufacturerRequest *ManufacturerRequest +} + +func (r ApiDcimManufacturersCreateRequest) ManufacturerRequest(manufacturerRequest ManufacturerRequest) ApiDcimManufacturersCreateRequest { + r.manufacturerRequest = &manufacturerRequest + return r +} + +func (r ApiDcimManufacturersCreateRequest) Execute() (*Manufacturer, *http.Response, error) { + return r.ApiService.DcimManufacturersCreateExecute(r) +} + +/* +DcimManufacturersCreate Method for DcimManufacturersCreate + +Post a list of manufacturer objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimManufacturersCreateRequest +*/ +func (a *DcimAPIService) DcimManufacturersCreate(ctx context.Context) ApiDcimManufacturersCreateRequest { + return ApiDcimManufacturersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Manufacturer +func (a *DcimAPIService) DcimManufacturersCreateExecute(r ApiDcimManufacturersCreateRequest) (*Manufacturer, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Manufacturer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.manufacturerRequest == nil { + return localVarReturnValue, nil, reportError("manufacturerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.manufacturerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimManufacturersDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimManufacturersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimManufacturersDestroyExecute(r) +} + +/* +DcimManufacturersDestroy Method for DcimManufacturersDestroy + +Delete a manufacturer object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this manufacturer. + @return ApiDcimManufacturersDestroyRequest +*/ +func (a *DcimAPIService) DcimManufacturersDestroy(ctx context.Context, id int32) ApiDcimManufacturersDestroyRequest { + return ApiDcimManufacturersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimManufacturersDestroyExecute(r ApiDcimManufacturersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimManufacturersListRequest struct { + ctx context.Context + ApiService *DcimAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Contact +func (r ApiDcimManufacturersListRequest) Contact(contact []int32) ApiDcimManufacturersListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimManufacturersListRequest) ContactN(contactN []int32) ApiDcimManufacturersListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimManufacturersListRequest) ContactGroup(contactGroup []int32) ApiDcimManufacturersListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimManufacturersListRequest) ContactGroupN(contactGroupN []int32) ApiDcimManufacturersListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimManufacturersListRequest) ContactRole(contactRole []int32) ApiDcimManufacturersListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimManufacturersListRequest) ContactRoleN(contactRoleN []int32) ApiDcimManufacturersListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimManufacturersListRequest) Created(created []time.Time) ApiDcimManufacturersListRequest { + r.created = &created + return r +} + +func (r ApiDcimManufacturersListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimManufacturersListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimManufacturersListRequest) CreatedGt(createdGt []time.Time) ApiDcimManufacturersListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimManufacturersListRequest) CreatedGte(createdGte []time.Time) ApiDcimManufacturersListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimManufacturersListRequest) CreatedLt(createdLt []time.Time) ApiDcimManufacturersListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimManufacturersListRequest) CreatedLte(createdLte []time.Time) ApiDcimManufacturersListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimManufacturersListRequest) CreatedN(createdN []time.Time) ApiDcimManufacturersListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimManufacturersListRequest) CreatedByRequest(createdByRequest string) ApiDcimManufacturersListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimManufacturersListRequest) Description(description []string) ApiDcimManufacturersListRequest { + r.description = &description + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimManufacturersListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionIc(descriptionIc []string) ApiDcimManufacturersListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionIe(descriptionIe []string) ApiDcimManufacturersListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionIew(descriptionIew []string) ApiDcimManufacturersListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimManufacturersListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionN(descriptionN []string) ApiDcimManufacturersListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionNic(descriptionNic []string) ApiDcimManufacturersListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionNie(descriptionNie []string) ApiDcimManufacturersListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimManufacturersListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimManufacturersListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimManufacturersListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimManufacturersListRequest) Id(id []int32) ApiDcimManufacturersListRequest { + r.id = &id + return r +} + +func (r ApiDcimManufacturersListRequest) IdEmpty(idEmpty bool) ApiDcimManufacturersListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimManufacturersListRequest) IdGt(idGt []int32) ApiDcimManufacturersListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimManufacturersListRequest) IdGte(idGte []int32) ApiDcimManufacturersListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimManufacturersListRequest) IdLt(idLt []int32) ApiDcimManufacturersListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimManufacturersListRequest) IdLte(idLte []int32) ApiDcimManufacturersListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimManufacturersListRequest) IdN(idN []int32) ApiDcimManufacturersListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimManufacturersListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimManufacturersListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimManufacturersListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimManufacturersListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimManufacturersListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimManufacturersListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimManufacturersListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimManufacturersListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimManufacturersListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimManufacturersListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimManufacturersListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimManufacturersListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimManufacturersListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimManufacturersListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimManufacturersListRequest) Limit(limit int32) ApiDcimManufacturersListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimManufacturersListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimManufacturersListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimManufacturersListRequest) Name(name []string) ApiDcimManufacturersListRequest { + r.name = &name + return r +} + +func (r ApiDcimManufacturersListRequest) NameEmpty(nameEmpty bool) ApiDcimManufacturersListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimManufacturersListRequest) NameIc(nameIc []string) ApiDcimManufacturersListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimManufacturersListRequest) NameIe(nameIe []string) ApiDcimManufacturersListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimManufacturersListRequest) NameIew(nameIew []string) ApiDcimManufacturersListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimManufacturersListRequest) NameIsw(nameIsw []string) ApiDcimManufacturersListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimManufacturersListRequest) NameN(nameN []string) ApiDcimManufacturersListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimManufacturersListRequest) NameNic(nameNic []string) ApiDcimManufacturersListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimManufacturersListRequest) NameNie(nameNie []string) ApiDcimManufacturersListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimManufacturersListRequest) NameNiew(nameNiew []string) ApiDcimManufacturersListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimManufacturersListRequest) NameNisw(nameNisw []string) ApiDcimManufacturersListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimManufacturersListRequest) Offset(offset int32) ApiDcimManufacturersListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimManufacturersListRequest) Ordering(ordering string) ApiDcimManufacturersListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimManufacturersListRequest) Q(q string) ApiDcimManufacturersListRequest { + r.q = &q + return r +} + +func (r ApiDcimManufacturersListRequest) Slug(slug []string) ApiDcimManufacturersListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimManufacturersListRequest) SlugEmpty(slugEmpty bool) ApiDcimManufacturersListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimManufacturersListRequest) SlugIc(slugIc []string) ApiDcimManufacturersListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimManufacturersListRequest) SlugIe(slugIe []string) ApiDcimManufacturersListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimManufacturersListRequest) SlugIew(slugIew []string) ApiDcimManufacturersListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimManufacturersListRequest) SlugIsw(slugIsw []string) ApiDcimManufacturersListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimManufacturersListRequest) SlugN(slugN []string) ApiDcimManufacturersListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimManufacturersListRequest) SlugNic(slugNic []string) ApiDcimManufacturersListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimManufacturersListRequest) SlugNie(slugNie []string) ApiDcimManufacturersListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimManufacturersListRequest) SlugNiew(slugNiew []string) ApiDcimManufacturersListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimManufacturersListRequest) SlugNisw(slugNisw []string) ApiDcimManufacturersListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimManufacturersListRequest) Tag(tag []string) ApiDcimManufacturersListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimManufacturersListRequest) TagN(tagN []string) ApiDcimManufacturersListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimManufacturersListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimManufacturersListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimManufacturersListRequest) Execute() (*PaginatedManufacturerList, *http.Response, error) { + return r.ApiService.DcimManufacturersListExecute(r) +} + +/* +DcimManufacturersList Method for DcimManufacturersList + +Get a list of manufacturer objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimManufacturersListRequest +*/ +func (a *DcimAPIService) DcimManufacturersList(ctx context.Context) ApiDcimManufacturersListRequest { + return ApiDcimManufacturersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedManufacturerList +func (a *DcimAPIService) DcimManufacturersListExecute(r ApiDcimManufacturersListRequest) (*PaginatedManufacturerList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedManufacturerList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimManufacturersPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedManufacturerRequest *PatchedManufacturerRequest +} + +func (r ApiDcimManufacturersPartialUpdateRequest) PatchedManufacturerRequest(patchedManufacturerRequest PatchedManufacturerRequest) ApiDcimManufacturersPartialUpdateRequest { + r.patchedManufacturerRequest = &patchedManufacturerRequest + return r +} + +func (r ApiDcimManufacturersPartialUpdateRequest) Execute() (*Manufacturer, *http.Response, error) { + return r.ApiService.DcimManufacturersPartialUpdateExecute(r) +} + +/* +DcimManufacturersPartialUpdate Method for DcimManufacturersPartialUpdate + +Patch a manufacturer object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this manufacturer. + @return ApiDcimManufacturersPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimManufacturersPartialUpdate(ctx context.Context, id int32) ApiDcimManufacturersPartialUpdateRequest { + return ApiDcimManufacturersPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Manufacturer +func (a *DcimAPIService) DcimManufacturersPartialUpdateExecute(r ApiDcimManufacturersPartialUpdateRequest) (*Manufacturer, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Manufacturer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedManufacturerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimManufacturersRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimManufacturersRetrieveRequest) Execute() (*Manufacturer, *http.Response, error) { + return r.ApiService.DcimManufacturersRetrieveExecute(r) +} + +/* +DcimManufacturersRetrieve Method for DcimManufacturersRetrieve + +Get a manufacturer object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this manufacturer. + @return ApiDcimManufacturersRetrieveRequest +*/ +func (a *DcimAPIService) DcimManufacturersRetrieve(ctx context.Context, id int32) ApiDcimManufacturersRetrieveRequest { + return ApiDcimManufacturersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Manufacturer +func (a *DcimAPIService) DcimManufacturersRetrieveExecute(r ApiDcimManufacturersRetrieveRequest) (*Manufacturer, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Manufacturer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimManufacturersUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + manufacturerRequest *ManufacturerRequest +} + +func (r ApiDcimManufacturersUpdateRequest) ManufacturerRequest(manufacturerRequest ManufacturerRequest) ApiDcimManufacturersUpdateRequest { + r.manufacturerRequest = &manufacturerRequest + return r +} + +func (r ApiDcimManufacturersUpdateRequest) Execute() (*Manufacturer, *http.Response, error) { + return r.ApiService.DcimManufacturersUpdateExecute(r) +} + +/* +DcimManufacturersUpdate Method for DcimManufacturersUpdate + +Put a manufacturer object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this manufacturer. + @return ApiDcimManufacturersUpdateRequest +*/ +func (a *DcimAPIService) DcimManufacturersUpdate(ctx context.Context, id int32) ApiDcimManufacturersUpdateRequest { + return ApiDcimManufacturersUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Manufacturer +func (a *DcimAPIService) DcimManufacturersUpdateExecute(r ApiDcimManufacturersUpdateRequest) (*Manufacturer, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Manufacturer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimManufacturersUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/manufacturers/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.manufacturerRequest == nil { + return localVarReturnValue, nil, reportError("manufacturerRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.manufacturerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleBayTemplateRequest *[]ModuleBayTemplateRequest +} + +func (r ApiDcimModuleBayTemplatesBulkDestroyRequest) ModuleBayTemplateRequest(moduleBayTemplateRequest []ModuleBayTemplateRequest) ApiDcimModuleBayTemplatesBulkDestroyRequest { + r.moduleBayTemplateRequest = &moduleBayTemplateRequest + return r +} + +func (r ApiDcimModuleBayTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesBulkDestroyExecute(r) +} + +/* +DcimModuleBayTemplatesBulkDestroy Method for DcimModuleBayTemplatesBulkDestroy + +Delete a list of module bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBayTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesBulkDestroy(ctx context.Context) ApiDcimModuleBayTemplatesBulkDestroyRequest { + return ApiDcimModuleBayTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModuleBayTemplatesBulkDestroyExecute(r ApiDcimModuleBayTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleBayTemplateRequest == nil { + return nil, reportError("moduleBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleBayTemplateRequest *[]ModuleBayTemplateRequest +} + +func (r ApiDcimModuleBayTemplatesBulkPartialUpdateRequest) ModuleBayTemplateRequest(moduleBayTemplateRequest []ModuleBayTemplateRequest) ApiDcimModuleBayTemplatesBulkPartialUpdateRequest { + r.moduleBayTemplateRequest = &moduleBayTemplateRequest + return r +} + +func (r ApiDcimModuleBayTemplatesBulkPartialUpdateRequest) Execute() ([]ModuleBayTemplate, *http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimModuleBayTemplatesBulkPartialUpdate Method for DcimModuleBayTemplatesBulkPartialUpdate + +Patch a list of module bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBayTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimModuleBayTemplatesBulkPartialUpdateRequest { + return ApiDcimModuleBayTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ModuleBayTemplate +func (a *DcimAPIService) DcimModuleBayTemplatesBulkPartialUpdateExecute(r ApiDcimModuleBayTemplatesBulkPartialUpdateRequest) ([]ModuleBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ModuleBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("moduleBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleBayTemplateRequest *[]ModuleBayTemplateRequest +} + +func (r ApiDcimModuleBayTemplatesBulkUpdateRequest) ModuleBayTemplateRequest(moduleBayTemplateRequest []ModuleBayTemplateRequest) ApiDcimModuleBayTemplatesBulkUpdateRequest { + r.moduleBayTemplateRequest = &moduleBayTemplateRequest + return r +} + +func (r ApiDcimModuleBayTemplatesBulkUpdateRequest) Execute() ([]ModuleBayTemplate, *http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesBulkUpdateExecute(r) +} + +/* +DcimModuleBayTemplatesBulkUpdate Method for DcimModuleBayTemplatesBulkUpdate + +Put a list of module bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBayTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesBulkUpdate(ctx context.Context) ApiDcimModuleBayTemplatesBulkUpdateRequest { + return ApiDcimModuleBayTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ModuleBayTemplate +func (a *DcimAPIService) DcimModuleBayTemplatesBulkUpdateExecute(r ApiDcimModuleBayTemplatesBulkUpdateRequest) ([]ModuleBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ModuleBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("moduleBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableModuleBayTemplateRequest *WritableModuleBayTemplateRequest +} + +func (r ApiDcimModuleBayTemplatesCreateRequest) WritableModuleBayTemplateRequest(writableModuleBayTemplateRequest WritableModuleBayTemplateRequest) ApiDcimModuleBayTemplatesCreateRequest { + r.writableModuleBayTemplateRequest = &writableModuleBayTemplateRequest + return r +} + +func (r ApiDcimModuleBayTemplatesCreateRequest) Execute() (*ModuleBayTemplate, *http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesCreateExecute(r) +} + +/* +DcimModuleBayTemplatesCreate Method for DcimModuleBayTemplatesCreate + +Post a list of module bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBayTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesCreate(ctx context.Context) ApiDcimModuleBayTemplatesCreateRequest { + return ApiDcimModuleBayTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ModuleBayTemplate +func (a *DcimAPIService) DcimModuleBayTemplatesCreateExecute(r ApiDcimModuleBayTemplatesCreateRequest) (*ModuleBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModuleBayTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesDestroyExecute(r) +} + +/* +DcimModuleBayTemplatesDestroy Method for DcimModuleBayTemplatesDestroy + +Delete a module bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay template. + @return ApiDcimModuleBayTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesDestroy(ctx context.Context, id int32) ApiDcimModuleBayTemplatesDestroyRequest { + return ApiDcimModuleBayTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModuleBayTemplatesDestroyExecute(r ApiDcimModuleBayTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]int32 + devicetypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + updatedByRequest *string +} + +func (r ApiDcimModuleBayTemplatesListRequest) Created(created []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimModuleBayTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) Description(description []string) ApiDcimModuleBayTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimModuleBayTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimModuleBayTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimModuleBayTemplatesListRequest) DevicetypeId(devicetypeId []int32) ApiDcimModuleBayTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimModuleBayTemplatesListRequest) DevicetypeIdN(devicetypeIdN []int32) ApiDcimModuleBayTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) Id(id []int32) ApiDcimModuleBayTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimModuleBayTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) IdGt(idGt []int32) ApiDcimModuleBayTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) IdGte(idGte []int32) ApiDcimModuleBayTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) IdLt(idLt []int32) ApiDcimModuleBayTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) IdLte(idLte []int32) ApiDcimModuleBayTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) IdN(idN []int32) ApiDcimModuleBayTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimModuleBayTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimModuleBayTemplatesListRequest) Limit(limit int32) ApiDcimModuleBayTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimModuleBayTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) Name(name []string) ApiDcimModuleBayTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimModuleBayTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameIc(nameIc []string) ApiDcimModuleBayTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameIe(nameIe []string) ApiDcimModuleBayTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameIew(nameIew []string) ApiDcimModuleBayTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimModuleBayTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameN(nameN []string) ApiDcimModuleBayTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameNic(nameNic []string) ApiDcimModuleBayTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameNie(nameNie []string) ApiDcimModuleBayTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimModuleBayTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimModuleBayTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimModuleBayTemplatesListRequest) Offset(offset int32) ApiDcimModuleBayTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimModuleBayTemplatesListRequest) Ordering(ordering string) ApiDcimModuleBayTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimModuleBayTemplatesListRequest) Q(q string) ApiDcimModuleBayTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimModuleBayTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimModuleBayTemplatesListRequest) Execute() (*PaginatedModuleBayTemplateList, *http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesListExecute(r) +} + +/* +DcimModuleBayTemplatesList Method for DcimModuleBayTemplatesList + +Get a list of module bay template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBayTemplatesListRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesList(ctx context.Context) ApiDcimModuleBayTemplatesListRequest { + return ApiDcimModuleBayTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedModuleBayTemplateList +func (a *DcimAPIService) DcimModuleBayTemplatesListExecute(r ApiDcimModuleBayTemplatesListRequest) (*PaginatedModuleBayTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedModuleBayTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableModuleBayTemplateRequest *PatchedWritableModuleBayTemplateRequest +} + +func (r ApiDcimModuleBayTemplatesPartialUpdateRequest) PatchedWritableModuleBayTemplateRequest(patchedWritableModuleBayTemplateRequest PatchedWritableModuleBayTemplateRequest) ApiDcimModuleBayTemplatesPartialUpdateRequest { + r.patchedWritableModuleBayTemplateRequest = &patchedWritableModuleBayTemplateRequest + return r +} + +func (r ApiDcimModuleBayTemplatesPartialUpdateRequest) Execute() (*ModuleBayTemplate, *http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesPartialUpdateExecute(r) +} + +/* +DcimModuleBayTemplatesPartialUpdate Method for DcimModuleBayTemplatesPartialUpdate + +Patch a module bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay template. + @return ApiDcimModuleBayTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimModuleBayTemplatesPartialUpdateRequest { + return ApiDcimModuleBayTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleBayTemplate +func (a *DcimAPIService) DcimModuleBayTemplatesPartialUpdateExecute(r ApiDcimModuleBayTemplatesPartialUpdateRequest) (*ModuleBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableModuleBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModuleBayTemplatesRetrieveRequest) Execute() (*ModuleBayTemplate, *http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesRetrieveExecute(r) +} + +/* +DcimModuleBayTemplatesRetrieve Method for DcimModuleBayTemplatesRetrieve + +Get a module bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay template. + @return ApiDcimModuleBayTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesRetrieve(ctx context.Context, id int32) ApiDcimModuleBayTemplatesRetrieveRequest { + return ApiDcimModuleBayTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleBayTemplate +func (a *DcimAPIService) DcimModuleBayTemplatesRetrieveExecute(r ApiDcimModuleBayTemplatesRetrieveRequest) (*ModuleBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBayTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableModuleBayTemplateRequest *WritableModuleBayTemplateRequest +} + +func (r ApiDcimModuleBayTemplatesUpdateRequest) WritableModuleBayTemplateRequest(writableModuleBayTemplateRequest WritableModuleBayTemplateRequest) ApiDcimModuleBayTemplatesUpdateRequest { + r.writableModuleBayTemplateRequest = &writableModuleBayTemplateRequest + return r +} + +func (r ApiDcimModuleBayTemplatesUpdateRequest) Execute() (*ModuleBayTemplate, *http.Response, error) { + return r.ApiService.DcimModuleBayTemplatesUpdateExecute(r) +} + +/* +DcimModuleBayTemplatesUpdate Method for DcimModuleBayTemplatesUpdate + +Put a module bay template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay template. + @return ApiDcimModuleBayTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBayTemplatesUpdate(ctx context.Context, id int32) ApiDcimModuleBayTemplatesUpdateRequest { + return ApiDcimModuleBayTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleBayTemplate +func (a *DcimAPIService) DcimModuleBayTemplatesUpdateExecute(r ApiDcimModuleBayTemplatesUpdateRequest) (*ModuleBayTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBayTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBayTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bay-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleBayTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleBayTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleBayTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleBayRequest *[]ModuleBayRequest +} + +func (r ApiDcimModuleBaysBulkDestroyRequest) ModuleBayRequest(moduleBayRequest []ModuleBayRequest) ApiDcimModuleBaysBulkDestroyRequest { + r.moduleBayRequest = &moduleBayRequest + return r +} + +func (r ApiDcimModuleBaysBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModuleBaysBulkDestroyExecute(r) +} + +/* +DcimModuleBaysBulkDestroy Method for DcimModuleBaysBulkDestroy + +Delete a list of module bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBaysBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimModuleBaysBulkDestroy(ctx context.Context) ApiDcimModuleBaysBulkDestroyRequest { + return ApiDcimModuleBaysBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModuleBaysBulkDestroyExecute(r ApiDcimModuleBaysBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleBayRequest == nil { + return nil, reportError("moduleBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleBayRequest *[]ModuleBayRequest +} + +func (r ApiDcimModuleBaysBulkPartialUpdateRequest) ModuleBayRequest(moduleBayRequest []ModuleBayRequest) ApiDcimModuleBaysBulkPartialUpdateRequest { + r.moduleBayRequest = &moduleBayRequest + return r +} + +func (r ApiDcimModuleBaysBulkPartialUpdateRequest) Execute() ([]ModuleBay, *http.Response, error) { + return r.ApiService.DcimModuleBaysBulkPartialUpdateExecute(r) +} + +/* +DcimModuleBaysBulkPartialUpdate Method for DcimModuleBaysBulkPartialUpdate + +Patch a list of module bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBaysBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBaysBulkPartialUpdate(ctx context.Context) ApiDcimModuleBaysBulkPartialUpdateRequest { + return ApiDcimModuleBaysBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ModuleBay +func (a *DcimAPIService) DcimModuleBaysBulkPartialUpdateExecute(r ApiDcimModuleBaysBulkPartialUpdateRequest) ([]ModuleBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ModuleBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleBayRequest == nil { + return localVarReturnValue, nil, reportError("moduleBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleBayRequest *[]ModuleBayRequest +} + +func (r ApiDcimModuleBaysBulkUpdateRequest) ModuleBayRequest(moduleBayRequest []ModuleBayRequest) ApiDcimModuleBaysBulkUpdateRequest { + r.moduleBayRequest = &moduleBayRequest + return r +} + +func (r ApiDcimModuleBaysBulkUpdateRequest) Execute() ([]ModuleBay, *http.Response, error) { + return r.ApiService.DcimModuleBaysBulkUpdateExecute(r) +} + +/* +DcimModuleBaysBulkUpdate Method for DcimModuleBaysBulkUpdate + +Put a list of module bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBaysBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBaysBulkUpdate(ctx context.Context) ApiDcimModuleBaysBulkUpdateRequest { + return ApiDcimModuleBaysBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ModuleBay +func (a *DcimAPIService) DcimModuleBaysBulkUpdateExecute(r ApiDcimModuleBaysBulkUpdateRequest) ([]ModuleBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ModuleBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleBayRequest == nil { + return localVarReturnValue, nil, reportError("moduleBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableModuleBayRequest *WritableModuleBayRequest +} + +func (r ApiDcimModuleBaysCreateRequest) WritableModuleBayRequest(writableModuleBayRequest WritableModuleBayRequest) ApiDcimModuleBaysCreateRequest { + r.writableModuleBayRequest = &writableModuleBayRequest + return r +} + +func (r ApiDcimModuleBaysCreateRequest) Execute() (*ModuleBay, *http.Response, error) { + return r.ApiService.DcimModuleBaysCreateExecute(r) +} + +/* +DcimModuleBaysCreate Method for DcimModuleBaysCreate + +Post a list of module bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBaysCreateRequest +*/ +func (a *DcimAPIService) DcimModuleBaysCreate(ctx context.Context) ApiDcimModuleBaysCreateRequest { + return ApiDcimModuleBaysCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ModuleBay +func (a *DcimAPIService) DcimModuleBaysCreateExecute(r ApiDcimModuleBaysCreateRequest) (*ModuleBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleBayRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModuleBaysDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModuleBaysDestroyExecute(r) +} + +/* +DcimModuleBaysDestroy Method for DcimModuleBaysDestroy + +Delete a module bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay. + @return ApiDcimModuleBaysDestroyRequest +*/ +func (a *DcimAPIService) DcimModuleBaysDestroy(ctx context.Context, id int32) ApiDcimModuleBaysDestroyRequest { + return ApiDcimModuleBaysDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModuleBaysDestroyExecute(r ApiDcimModuleBaysDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimModuleBaysListRequest) Created(created []time.Time) ApiDcimModuleBaysListRequest { + r.created = &created + return r +} + +func (r ApiDcimModuleBaysListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimModuleBaysListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimModuleBaysListRequest) CreatedGt(createdGt []time.Time) ApiDcimModuleBaysListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimModuleBaysListRequest) CreatedGte(createdGte []time.Time) ApiDcimModuleBaysListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimModuleBaysListRequest) CreatedLt(createdLt []time.Time) ApiDcimModuleBaysListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimModuleBaysListRequest) CreatedLte(createdLte []time.Time) ApiDcimModuleBaysListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimModuleBaysListRequest) CreatedN(createdN []time.Time) ApiDcimModuleBaysListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimModuleBaysListRequest) CreatedByRequest(createdByRequest string) ApiDcimModuleBaysListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimModuleBaysListRequest) Description(description []string) ApiDcimModuleBaysListRequest { + r.description = &description + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimModuleBaysListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionIc(descriptionIc []string) ApiDcimModuleBaysListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionIe(descriptionIe []string) ApiDcimModuleBaysListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionIew(descriptionIew []string) ApiDcimModuleBaysListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimModuleBaysListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionN(descriptionN []string) ApiDcimModuleBaysListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionNic(descriptionNic []string) ApiDcimModuleBaysListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionNie(descriptionNie []string) ApiDcimModuleBaysListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimModuleBaysListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimModuleBaysListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimModuleBaysListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimModuleBaysListRequest) Device(device []*string) ApiDcimModuleBaysListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimModuleBaysListRequest) DeviceN(deviceN []*string) ApiDcimModuleBaysListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimModuleBaysListRequest) DeviceId(deviceId []int32) ApiDcimModuleBaysListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimModuleBaysListRequest) DeviceIdN(deviceIdN []int32) ApiDcimModuleBaysListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimModuleBaysListRequest) DeviceRole(deviceRole []string) ApiDcimModuleBaysListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimModuleBaysListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimModuleBaysListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimModuleBaysListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimModuleBaysListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimModuleBaysListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimModuleBaysListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimModuleBaysListRequest) DeviceType(deviceType []string) ApiDcimModuleBaysListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimModuleBaysListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimModuleBaysListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimModuleBaysListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimModuleBaysListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimModuleBaysListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimModuleBaysListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimModuleBaysListRequest) Id(id []int32) ApiDcimModuleBaysListRequest { + r.id = &id + return r +} + +func (r ApiDcimModuleBaysListRequest) IdEmpty(idEmpty bool) ApiDcimModuleBaysListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimModuleBaysListRequest) IdGt(idGt []int32) ApiDcimModuleBaysListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimModuleBaysListRequest) IdGte(idGte []int32) ApiDcimModuleBaysListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimModuleBaysListRequest) IdLt(idLt []int32) ApiDcimModuleBaysListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimModuleBaysListRequest) IdLte(idLte []int32) ApiDcimModuleBaysListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimModuleBaysListRequest) IdN(idN []int32) ApiDcimModuleBaysListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimModuleBaysListRequest) Label(label []string) ApiDcimModuleBaysListRequest { + r.label = &label + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelEmpty(labelEmpty bool) ApiDcimModuleBaysListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelIc(labelIc []string) ApiDcimModuleBaysListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelIe(labelIe []string) ApiDcimModuleBaysListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelIew(labelIew []string) ApiDcimModuleBaysListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelIsw(labelIsw []string) ApiDcimModuleBaysListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelN(labelN []string) ApiDcimModuleBaysListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelNic(labelNic []string) ApiDcimModuleBaysListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelNie(labelNie []string) ApiDcimModuleBaysListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelNiew(labelNiew []string) ApiDcimModuleBaysListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimModuleBaysListRequest) LabelNisw(labelNisw []string) ApiDcimModuleBaysListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimModuleBaysListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimModuleBaysListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimModuleBaysListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimModuleBaysListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimModuleBaysListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimModuleBaysListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimModuleBaysListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimModuleBaysListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimModuleBaysListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimModuleBaysListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimModuleBaysListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimModuleBaysListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimModuleBaysListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimModuleBaysListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimModuleBaysListRequest) Limit(limit int32) ApiDcimModuleBaysListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimModuleBaysListRequest) Location(location []string) ApiDcimModuleBaysListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimModuleBaysListRequest) LocationN(locationN []string) ApiDcimModuleBaysListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimModuleBaysListRequest) LocationId(locationId []int32) ApiDcimModuleBaysListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimModuleBaysListRequest) LocationIdN(locationIdN []int32) ApiDcimModuleBaysListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimModuleBaysListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimModuleBaysListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimModuleBaysListRequest) Name(name []string) ApiDcimModuleBaysListRequest { + r.name = &name + return r +} + +func (r ApiDcimModuleBaysListRequest) NameEmpty(nameEmpty bool) ApiDcimModuleBaysListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimModuleBaysListRequest) NameIc(nameIc []string) ApiDcimModuleBaysListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimModuleBaysListRequest) NameIe(nameIe []string) ApiDcimModuleBaysListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimModuleBaysListRequest) NameIew(nameIew []string) ApiDcimModuleBaysListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimModuleBaysListRequest) NameIsw(nameIsw []string) ApiDcimModuleBaysListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimModuleBaysListRequest) NameN(nameN []string) ApiDcimModuleBaysListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimModuleBaysListRequest) NameNic(nameNic []string) ApiDcimModuleBaysListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimModuleBaysListRequest) NameNie(nameNie []string) ApiDcimModuleBaysListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimModuleBaysListRequest) NameNiew(nameNiew []string) ApiDcimModuleBaysListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimModuleBaysListRequest) NameNisw(nameNisw []string) ApiDcimModuleBaysListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimModuleBaysListRequest) Offset(offset int32) ApiDcimModuleBaysListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimModuleBaysListRequest) Ordering(ordering string) ApiDcimModuleBaysListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimModuleBaysListRequest) Q(q string) ApiDcimModuleBaysListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimModuleBaysListRequest) Rack(rack []string) ApiDcimModuleBaysListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimModuleBaysListRequest) RackN(rackN []string) ApiDcimModuleBaysListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimModuleBaysListRequest) RackId(rackId []int32) ApiDcimModuleBaysListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimModuleBaysListRequest) RackIdN(rackIdN []int32) ApiDcimModuleBaysListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimModuleBaysListRequest) Region(region []int32) ApiDcimModuleBaysListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimModuleBaysListRequest) RegionN(regionN []int32) ApiDcimModuleBaysListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimModuleBaysListRequest) RegionId(regionId []int32) ApiDcimModuleBaysListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimModuleBaysListRequest) RegionIdN(regionIdN []int32) ApiDcimModuleBaysListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimModuleBaysListRequest) Role(role []string) ApiDcimModuleBaysListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimModuleBaysListRequest) RoleN(roleN []string) ApiDcimModuleBaysListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimModuleBaysListRequest) RoleId(roleId []int32) ApiDcimModuleBaysListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimModuleBaysListRequest) RoleIdN(roleIdN []int32) ApiDcimModuleBaysListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimModuleBaysListRequest) Site(site []string) ApiDcimModuleBaysListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimModuleBaysListRequest) SiteN(siteN []string) ApiDcimModuleBaysListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimModuleBaysListRequest) SiteGroup(siteGroup []int32) ApiDcimModuleBaysListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimModuleBaysListRequest) SiteGroupN(siteGroupN []int32) ApiDcimModuleBaysListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimModuleBaysListRequest) SiteGroupId(siteGroupId []int32) ApiDcimModuleBaysListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimModuleBaysListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimModuleBaysListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimModuleBaysListRequest) SiteId(siteId []int32) ApiDcimModuleBaysListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimModuleBaysListRequest) SiteIdN(siteIdN []int32) ApiDcimModuleBaysListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimModuleBaysListRequest) Tag(tag []string) ApiDcimModuleBaysListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimModuleBaysListRequest) TagN(tagN []string) ApiDcimModuleBaysListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimModuleBaysListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimModuleBaysListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimModuleBaysListRequest) VirtualChassis(virtualChassis []string) ApiDcimModuleBaysListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimModuleBaysListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimModuleBaysListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimModuleBaysListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimModuleBaysListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimModuleBaysListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimModuleBaysListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimModuleBaysListRequest) Execute() (*PaginatedModuleBayList, *http.Response, error) { + return r.ApiService.DcimModuleBaysListExecute(r) +} + +/* +DcimModuleBaysList Method for DcimModuleBaysList + +Get a list of module bay objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleBaysListRequest +*/ +func (a *DcimAPIService) DcimModuleBaysList(ctx context.Context) ApiDcimModuleBaysListRequest { + return ApiDcimModuleBaysListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedModuleBayList +func (a *DcimAPIService) DcimModuleBaysListExecute(r ApiDcimModuleBaysListRequest) (*PaginatedModuleBayList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedModuleBayList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableModuleBayRequest *PatchedWritableModuleBayRequest +} + +func (r ApiDcimModuleBaysPartialUpdateRequest) PatchedWritableModuleBayRequest(patchedWritableModuleBayRequest PatchedWritableModuleBayRequest) ApiDcimModuleBaysPartialUpdateRequest { + r.patchedWritableModuleBayRequest = &patchedWritableModuleBayRequest + return r +} + +func (r ApiDcimModuleBaysPartialUpdateRequest) Execute() (*ModuleBay, *http.Response, error) { + return r.ApiService.DcimModuleBaysPartialUpdateExecute(r) +} + +/* +DcimModuleBaysPartialUpdate Method for DcimModuleBaysPartialUpdate + +Patch a module bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay. + @return ApiDcimModuleBaysPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBaysPartialUpdate(ctx context.Context, id int32) ApiDcimModuleBaysPartialUpdateRequest { + return ApiDcimModuleBaysPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleBay +func (a *DcimAPIService) DcimModuleBaysPartialUpdateExecute(r ApiDcimModuleBaysPartialUpdateRequest) (*ModuleBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableModuleBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModuleBaysRetrieveRequest) Execute() (*ModuleBay, *http.Response, error) { + return r.ApiService.DcimModuleBaysRetrieveExecute(r) +} + +/* +DcimModuleBaysRetrieve Method for DcimModuleBaysRetrieve + +Get a module bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay. + @return ApiDcimModuleBaysRetrieveRequest +*/ +func (a *DcimAPIService) DcimModuleBaysRetrieve(ctx context.Context, id int32) ApiDcimModuleBaysRetrieveRequest { + return ApiDcimModuleBaysRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleBay +func (a *DcimAPIService) DcimModuleBaysRetrieveExecute(r ApiDcimModuleBaysRetrieveRequest) (*ModuleBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleBaysUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableModuleBayRequest *WritableModuleBayRequest +} + +func (r ApiDcimModuleBaysUpdateRequest) WritableModuleBayRequest(writableModuleBayRequest WritableModuleBayRequest) ApiDcimModuleBaysUpdateRequest { + r.writableModuleBayRequest = &writableModuleBayRequest + return r +} + +func (r ApiDcimModuleBaysUpdateRequest) Execute() (*ModuleBay, *http.Response, error) { + return r.ApiService.DcimModuleBaysUpdateExecute(r) +} + +/* +DcimModuleBaysUpdate Method for DcimModuleBaysUpdate + +Put a module bay object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module bay. + @return ApiDcimModuleBaysUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleBaysUpdate(ctx context.Context, id int32) ApiDcimModuleBaysUpdateRequest { + return ApiDcimModuleBaysUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleBay +func (a *DcimAPIService) DcimModuleBaysUpdateExecute(r ApiDcimModuleBaysUpdateRequest) (*ModuleBay, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleBay + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleBaysUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-bays/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleBayRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleBayRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleBayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleTypeRequest *[]ModuleTypeRequest +} + +func (r ApiDcimModuleTypesBulkDestroyRequest) ModuleTypeRequest(moduleTypeRequest []ModuleTypeRequest) ApiDcimModuleTypesBulkDestroyRequest { + r.moduleTypeRequest = &moduleTypeRequest + return r +} + +func (r ApiDcimModuleTypesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModuleTypesBulkDestroyExecute(r) +} + +/* +DcimModuleTypesBulkDestroy Method for DcimModuleTypesBulkDestroy + +Delete a list of module type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleTypesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimModuleTypesBulkDestroy(ctx context.Context) ApiDcimModuleTypesBulkDestroyRequest { + return ApiDcimModuleTypesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModuleTypesBulkDestroyExecute(r ApiDcimModuleTypesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleTypeRequest == nil { + return nil, reportError("moduleTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleTypeRequest *[]ModuleTypeRequest +} + +func (r ApiDcimModuleTypesBulkPartialUpdateRequest) ModuleTypeRequest(moduleTypeRequest []ModuleTypeRequest) ApiDcimModuleTypesBulkPartialUpdateRequest { + r.moduleTypeRequest = &moduleTypeRequest + return r +} + +func (r ApiDcimModuleTypesBulkPartialUpdateRequest) Execute() ([]ModuleType, *http.Response, error) { + return r.ApiService.DcimModuleTypesBulkPartialUpdateExecute(r) +} + +/* +DcimModuleTypesBulkPartialUpdate Method for DcimModuleTypesBulkPartialUpdate + +Patch a list of module type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleTypesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleTypesBulkPartialUpdate(ctx context.Context) ApiDcimModuleTypesBulkPartialUpdateRequest { + return ApiDcimModuleTypesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ModuleType +func (a *DcimAPIService) DcimModuleTypesBulkPartialUpdateExecute(r ApiDcimModuleTypesBulkPartialUpdateRequest) ([]ModuleType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ModuleType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleTypeRequest == nil { + return localVarReturnValue, nil, reportError("moduleTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleTypeRequest *[]ModuleTypeRequest +} + +func (r ApiDcimModuleTypesBulkUpdateRequest) ModuleTypeRequest(moduleTypeRequest []ModuleTypeRequest) ApiDcimModuleTypesBulkUpdateRequest { + r.moduleTypeRequest = &moduleTypeRequest + return r +} + +func (r ApiDcimModuleTypesBulkUpdateRequest) Execute() ([]ModuleType, *http.Response, error) { + return r.ApiService.DcimModuleTypesBulkUpdateExecute(r) +} + +/* +DcimModuleTypesBulkUpdate Method for DcimModuleTypesBulkUpdate + +Put a list of module type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleTypesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleTypesBulkUpdate(ctx context.Context) ApiDcimModuleTypesBulkUpdateRequest { + return ApiDcimModuleTypesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ModuleType +func (a *DcimAPIService) DcimModuleTypesBulkUpdateExecute(r ApiDcimModuleTypesBulkUpdateRequest) ([]ModuleType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ModuleType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleTypeRequest == nil { + return localVarReturnValue, nil, reportError("moduleTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableModuleTypeRequest *WritableModuleTypeRequest +} + +func (r ApiDcimModuleTypesCreateRequest) WritableModuleTypeRequest(writableModuleTypeRequest WritableModuleTypeRequest) ApiDcimModuleTypesCreateRequest { + r.writableModuleTypeRequest = &writableModuleTypeRequest + return r +} + +func (r ApiDcimModuleTypesCreateRequest) Execute() (*ModuleType, *http.Response, error) { + return r.ApiService.DcimModuleTypesCreateExecute(r) +} + +/* +DcimModuleTypesCreate Method for DcimModuleTypesCreate + +Post a list of module type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleTypesCreateRequest +*/ +func (a *DcimAPIService) DcimModuleTypesCreate(ctx context.Context) ApiDcimModuleTypesCreateRequest { + return ApiDcimModuleTypesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ModuleType +func (a *DcimAPIService) DcimModuleTypesCreateExecute(r ApiDcimModuleTypesCreateRequest) (*ModuleType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleTypeRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModuleTypesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModuleTypesDestroyExecute(r) +} + +/* +DcimModuleTypesDestroy Method for DcimModuleTypesDestroy + +Delete a module type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module type. + @return ApiDcimModuleTypesDestroyRequest +*/ +func (a *DcimAPIService) DcimModuleTypesDestroy(ctx context.Context, id int32) ApiDcimModuleTypesDestroyRequest { + return ApiDcimModuleTypesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModuleTypesDestroyExecute(r ApiDcimModuleTypesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + consolePorts *bool + consoleServerPorts *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interfaces *bool + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + manufacturer *[]string + manufacturerN *[]string + manufacturerId *[]int32 + manufacturerIdN *[]int32 + model *[]string + modelEmpty *bool + modelIc *[]string + modelIe *[]string + modelIew *[]string + modelIsw *[]string + modelN *[]string + modelNic *[]string + modelNie *[]string + modelNiew *[]string + modelNisw *[]string + modifiedByRequest *string + offset *int32 + ordering *string + partNumber *[]string + partNumberEmpty *bool + partNumberIc *[]string + partNumberIe *[]string + partNumberIew *[]string + partNumberIsw *[]string + partNumberN *[]string + partNumberNic *[]string + partNumberNie *[]string + partNumberNiew *[]string + partNumberNisw *[]string + passThroughPorts *bool + powerOutlets *bool + powerPorts *bool + q *string + tag *[]string + tagN *[]string + updatedByRequest *string + weight *[]float64 + weightEmpty *bool + weightGt *[]float64 + weightGte *[]float64 + weightLt *[]float64 + weightLte *[]float64 + weightN *[]float64 + weightUnit *string + weightUnitN *string +} + +// Has console ports +func (r ApiDcimModuleTypesListRequest) ConsolePorts(consolePorts bool) ApiDcimModuleTypesListRequest { + r.consolePorts = &consolePorts + return r +} + +// Has console server ports +func (r ApiDcimModuleTypesListRequest) ConsoleServerPorts(consoleServerPorts bool) ApiDcimModuleTypesListRequest { + r.consoleServerPorts = &consoleServerPorts + return r +} + +func (r ApiDcimModuleTypesListRequest) Created(created []time.Time) ApiDcimModuleTypesListRequest { + r.created = &created + return r +} + +func (r ApiDcimModuleTypesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimModuleTypesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimModuleTypesListRequest) CreatedGt(createdGt []time.Time) ApiDcimModuleTypesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimModuleTypesListRequest) CreatedGte(createdGte []time.Time) ApiDcimModuleTypesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimModuleTypesListRequest) CreatedLt(createdLt []time.Time) ApiDcimModuleTypesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimModuleTypesListRequest) CreatedLte(createdLte []time.Time) ApiDcimModuleTypesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimModuleTypesListRequest) CreatedN(createdN []time.Time) ApiDcimModuleTypesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimModuleTypesListRequest) CreatedByRequest(createdByRequest string) ApiDcimModuleTypesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimModuleTypesListRequest) Description(description []string) ApiDcimModuleTypesListRequest { + r.description = &description + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimModuleTypesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionIc(descriptionIc []string) ApiDcimModuleTypesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionIe(descriptionIe []string) ApiDcimModuleTypesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionIew(descriptionIew []string) ApiDcimModuleTypesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimModuleTypesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionN(descriptionN []string) ApiDcimModuleTypesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionNic(descriptionNic []string) ApiDcimModuleTypesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionNie(descriptionNie []string) ApiDcimModuleTypesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimModuleTypesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimModuleTypesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimModuleTypesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimModuleTypesListRequest) Id(id []int32) ApiDcimModuleTypesListRequest { + r.id = &id + return r +} + +func (r ApiDcimModuleTypesListRequest) IdEmpty(idEmpty bool) ApiDcimModuleTypesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimModuleTypesListRequest) IdGt(idGt []int32) ApiDcimModuleTypesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimModuleTypesListRequest) IdGte(idGte []int32) ApiDcimModuleTypesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimModuleTypesListRequest) IdLt(idLt []int32) ApiDcimModuleTypesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimModuleTypesListRequest) IdLte(idLte []int32) ApiDcimModuleTypesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimModuleTypesListRequest) IdN(idN []int32) ApiDcimModuleTypesListRequest { + r.idN = &idN + return r +} + +// Has interfaces +func (r ApiDcimModuleTypesListRequest) Interfaces(interfaces bool) ApiDcimModuleTypesListRequest { + r.interfaces = &interfaces + return r +} + +func (r ApiDcimModuleTypesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimModuleTypesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimModuleTypesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimModuleTypesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimModuleTypesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimModuleTypesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimModuleTypesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimModuleTypesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimModuleTypesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimModuleTypesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimModuleTypesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimModuleTypesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimModuleTypesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimModuleTypesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimModuleTypesListRequest) Limit(limit int32) ApiDcimModuleTypesListRequest { + r.limit = &limit + return r +} + +// Manufacturer (slug) +func (r ApiDcimModuleTypesListRequest) Manufacturer(manufacturer []string) ApiDcimModuleTypesListRequest { + r.manufacturer = &manufacturer + return r +} + +// Manufacturer (slug) +func (r ApiDcimModuleTypesListRequest) ManufacturerN(manufacturerN []string) ApiDcimModuleTypesListRequest { + r.manufacturerN = &manufacturerN + return r +} + +// Manufacturer (ID) +func (r ApiDcimModuleTypesListRequest) ManufacturerId(manufacturerId []int32) ApiDcimModuleTypesListRequest { + r.manufacturerId = &manufacturerId + return r +} + +// Manufacturer (ID) +func (r ApiDcimModuleTypesListRequest) ManufacturerIdN(manufacturerIdN []int32) ApiDcimModuleTypesListRequest { + r.manufacturerIdN = &manufacturerIdN + return r +} + +func (r ApiDcimModuleTypesListRequest) Model(model []string) ApiDcimModuleTypesListRequest { + r.model = &model + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelEmpty(modelEmpty bool) ApiDcimModuleTypesListRequest { + r.modelEmpty = &modelEmpty + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelIc(modelIc []string) ApiDcimModuleTypesListRequest { + r.modelIc = &modelIc + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelIe(modelIe []string) ApiDcimModuleTypesListRequest { + r.modelIe = &modelIe + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelIew(modelIew []string) ApiDcimModuleTypesListRequest { + r.modelIew = &modelIew + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelIsw(modelIsw []string) ApiDcimModuleTypesListRequest { + r.modelIsw = &modelIsw + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelN(modelN []string) ApiDcimModuleTypesListRequest { + r.modelN = &modelN + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelNic(modelNic []string) ApiDcimModuleTypesListRequest { + r.modelNic = &modelNic + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelNie(modelNie []string) ApiDcimModuleTypesListRequest { + r.modelNie = &modelNie + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelNiew(modelNiew []string) ApiDcimModuleTypesListRequest { + r.modelNiew = &modelNiew + return r +} + +func (r ApiDcimModuleTypesListRequest) ModelNisw(modelNisw []string) ApiDcimModuleTypesListRequest { + r.modelNisw = &modelNisw + return r +} + +func (r ApiDcimModuleTypesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimModuleTypesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiDcimModuleTypesListRequest) Offset(offset int32) ApiDcimModuleTypesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimModuleTypesListRequest) Ordering(ordering string) ApiDcimModuleTypesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumber(partNumber []string) ApiDcimModuleTypesListRequest { + r.partNumber = &partNumber + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberEmpty(partNumberEmpty bool) ApiDcimModuleTypesListRequest { + r.partNumberEmpty = &partNumberEmpty + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberIc(partNumberIc []string) ApiDcimModuleTypesListRequest { + r.partNumberIc = &partNumberIc + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberIe(partNumberIe []string) ApiDcimModuleTypesListRequest { + r.partNumberIe = &partNumberIe + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberIew(partNumberIew []string) ApiDcimModuleTypesListRequest { + r.partNumberIew = &partNumberIew + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberIsw(partNumberIsw []string) ApiDcimModuleTypesListRequest { + r.partNumberIsw = &partNumberIsw + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberN(partNumberN []string) ApiDcimModuleTypesListRequest { + r.partNumberN = &partNumberN + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberNic(partNumberNic []string) ApiDcimModuleTypesListRequest { + r.partNumberNic = &partNumberNic + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberNie(partNumberNie []string) ApiDcimModuleTypesListRequest { + r.partNumberNie = &partNumberNie + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberNiew(partNumberNiew []string) ApiDcimModuleTypesListRequest { + r.partNumberNiew = &partNumberNiew + return r +} + +func (r ApiDcimModuleTypesListRequest) PartNumberNisw(partNumberNisw []string) ApiDcimModuleTypesListRequest { + r.partNumberNisw = &partNumberNisw + return r +} + +// Has pass-through ports +func (r ApiDcimModuleTypesListRequest) PassThroughPorts(passThroughPorts bool) ApiDcimModuleTypesListRequest { + r.passThroughPorts = &passThroughPorts + return r +} + +// Has power outlets +func (r ApiDcimModuleTypesListRequest) PowerOutlets(powerOutlets bool) ApiDcimModuleTypesListRequest { + r.powerOutlets = &powerOutlets + return r +} + +// Has power ports +func (r ApiDcimModuleTypesListRequest) PowerPorts(powerPorts bool) ApiDcimModuleTypesListRequest { + r.powerPorts = &powerPorts + return r +} + +// Search +func (r ApiDcimModuleTypesListRequest) Q(q string) ApiDcimModuleTypesListRequest { + r.q = &q + return r +} + +func (r ApiDcimModuleTypesListRequest) Tag(tag []string) ApiDcimModuleTypesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimModuleTypesListRequest) TagN(tagN []string) ApiDcimModuleTypesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimModuleTypesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimModuleTypesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimModuleTypesListRequest) Weight(weight []float64) ApiDcimModuleTypesListRequest { + r.weight = &weight + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightEmpty(weightEmpty bool) ApiDcimModuleTypesListRequest { + r.weightEmpty = &weightEmpty + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightGt(weightGt []float64) ApiDcimModuleTypesListRequest { + r.weightGt = &weightGt + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightGte(weightGte []float64) ApiDcimModuleTypesListRequest { + r.weightGte = &weightGte + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightLt(weightLt []float64) ApiDcimModuleTypesListRequest { + r.weightLt = &weightLt + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightLte(weightLte []float64) ApiDcimModuleTypesListRequest { + r.weightLte = &weightLte + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightN(weightN []float64) ApiDcimModuleTypesListRequest { + r.weightN = &weightN + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightUnit(weightUnit string) ApiDcimModuleTypesListRequest { + r.weightUnit = &weightUnit + return r +} + +func (r ApiDcimModuleTypesListRequest) WeightUnitN(weightUnitN string) ApiDcimModuleTypesListRequest { + r.weightUnitN = &weightUnitN + return r +} + +func (r ApiDcimModuleTypesListRequest) Execute() (*PaginatedModuleTypeList, *http.Response, error) { + return r.ApiService.DcimModuleTypesListExecute(r) +} + +/* +DcimModuleTypesList Method for DcimModuleTypesList + +Get a list of module type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModuleTypesListRequest +*/ +func (a *DcimAPIService) DcimModuleTypesList(ctx context.Context) ApiDcimModuleTypesListRequest { + return ApiDcimModuleTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedModuleTypeList +func (a *DcimAPIService) DcimModuleTypesListExecute(r ApiDcimModuleTypesListRequest) (*PaginatedModuleTypeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedModuleTypeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.consolePorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "console_ports", r.consolePorts, "") + } + if r.consoleServerPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "console_server_ports", r.consoleServerPorts, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interfaces != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interfaces", r.interfaces, "") + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.manufacturer != nil { + t := *r.manufacturer + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", t, "multi") + } + } + if r.manufacturerN != nil { + t := *r.manufacturerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", t, "multi") + } + } + if r.manufacturerId != nil { + t := *r.manufacturerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", t, "multi") + } + } + if r.manufacturerIdN != nil { + t := *r.manufacturerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", t, "multi") + } + } + if r.model != nil { + t := *r.model + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", t, "multi") + } + } + if r.modelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__empty", r.modelEmpty, "") + } + if r.modelIc != nil { + t := *r.modelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ic", t, "multi") + } + } + if r.modelIe != nil { + t := *r.modelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__ie", t, "multi") + } + } + if r.modelIew != nil { + t := *r.modelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__iew", t, "multi") + } + } + if r.modelIsw != nil { + t := *r.modelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__isw", t, "multi") + } + } + if r.modelN != nil { + t := *r.modelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__n", t, "multi") + } + } + if r.modelNic != nil { + t := *r.modelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nic", t, "multi") + } + } + if r.modelNie != nil { + t := *r.modelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nie", t, "multi") + } + } + if r.modelNiew != nil { + t := *r.modelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__niew", t, "multi") + } + } + if r.modelNisw != nil { + t := *r.modelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "model__nisw", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.partNumber != nil { + t := *r.partNumber + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number", t, "multi") + } + } + if r.partNumberEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__empty", r.partNumberEmpty, "") + } + if r.partNumberIc != nil { + t := *r.partNumberIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ic", t, "multi") + } + } + if r.partNumberIe != nil { + t := *r.partNumberIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__ie", t, "multi") + } + } + if r.partNumberIew != nil { + t := *r.partNumberIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__iew", t, "multi") + } + } + if r.partNumberIsw != nil { + t := *r.partNumberIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__isw", t, "multi") + } + } + if r.partNumberN != nil { + t := *r.partNumberN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__n", t, "multi") + } + } + if r.partNumberNic != nil { + t := *r.partNumberNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nic", t, "multi") + } + } + if r.partNumberNie != nil { + t := *r.partNumberNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nie", t, "multi") + } + } + if r.partNumberNiew != nil { + t := *r.partNumberNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__niew", t, "multi") + } + } + if r.partNumberNisw != nil { + t := *r.partNumberNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "part_number__nisw", t, "multi") + } + } + if r.passThroughPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pass_through_ports", r.passThroughPorts, "") + } + if r.powerOutlets != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_outlets", r.powerOutlets, "") + } + if r.powerPorts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_ports", r.powerPorts, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.weight != nil { + t := *r.weight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", t, "multi") + } + } + if r.weightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__empty", r.weightEmpty, "") + } + if r.weightGt != nil { + t := *r.weightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", t, "multi") + } + } + if r.weightGte != nil { + t := *r.weightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", t, "multi") + } + } + if r.weightLt != nil { + t := *r.weightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", t, "multi") + } + } + if r.weightLte != nil { + t := *r.weightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", t, "multi") + } + } + if r.weightN != nil { + t := *r.weightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", t, "multi") + } + } + if r.weightUnit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight_unit", r.weightUnit, "") + } + if r.weightUnitN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight_unit__n", r.weightUnitN, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableModuleTypeRequest *PatchedWritableModuleTypeRequest +} + +func (r ApiDcimModuleTypesPartialUpdateRequest) PatchedWritableModuleTypeRequest(patchedWritableModuleTypeRequest PatchedWritableModuleTypeRequest) ApiDcimModuleTypesPartialUpdateRequest { + r.patchedWritableModuleTypeRequest = &patchedWritableModuleTypeRequest + return r +} + +func (r ApiDcimModuleTypesPartialUpdateRequest) Execute() (*ModuleType, *http.Response, error) { + return r.ApiService.DcimModuleTypesPartialUpdateExecute(r) +} + +/* +DcimModuleTypesPartialUpdate Method for DcimModuleTypesPartialUpdate + +Patch a module type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module type. + @return ApiDcimModuleTypesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleTypesPartialUpdate(ctx context.Context, id int32) ApiDcimModuleTypesPartialUpdateRequest { + return ApiDcimModuleTypesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleType +func (a *DcimAPIService) DcimModuleTypesPartialUpdateExecute(r ApiDcimModuleTypesPartialUpdateRequest) (*ModuleType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableModuleTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModuleTypesRetrieveRequest) Execute() (*ModuleType, *http.Response, error) { + return r.ApiService.DcimModuleTypesRetrieveExecute(r) +} + +/* +DcimModuleTypesRetrieve Method for DcimModuleTypesRetrieve + +Get a module type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module type. + @return ApiDcimModuleTypesRetrieveRequest +*/ +func (a *DcimAPIService) DcimModuleTypesRetrieve(ctx context.Context, id int32) ApiDcimModuleTypesRetrieveRequest { + return ApiDcimModuleTypesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleType +func (a *DcimAPIService) DcimModuleTypesRetrieveExecute(r ApiDcimModuleTypesRetrieveRequest) (*ModuleType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModuleTypesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableModuleTypeRequest *WritableModuleTypeRequest +} + +func (r ApiDcimModuleTypesUpdateRequest) WritableModuleTypeRequest(writableModuleTypeRequest WritableModuleTypeRequest) ApiDcimModuleTypesUpdateRequest { + r.writableModuleTypeRequest = &writableModuleTypeRequest + return r +} + +func (r ApiDcimModuleTypesUpdateRequest) Execute() (*ModuleType, *http.Response, error) { + return r.ApiService.DcimModuleTypesUpdateExecute(r) +} + +/* +DcimModuleTypesUpdate Method for DcimModuleTypesUpdate + +Put a module type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module type. + @return ApiDcimModuleTypesUpdateRequest +*/ +func (a *DcimAPIService) DcimModuleTypesUpdate(ctx context.Context, id int32) ApiDcimModuleTypesUpdateRequest { + return ApiDcimModuleTypesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ModuleType +func (a *DcimAPIService) DcimModuleTypesUpdateExecute(r ApiDcimModuleTypesUpdateRequest) (*ModuleType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ModuleType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModuleTypesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/module-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleTypeRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModulesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleRequest *[]ModuleRequest +} + +func (r ApiDcimModulesBulkDestroyRequest) ModuleRequest(moduleRequest []ModuleRequest) ApiDcimModulesBulkDestroyRequest { + r.moduleRequest = &moduleRequest + return r +} + +func (r ApiDcimModulesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModulesBulkDestroyExecute(r) +} + +/* +DcimModulesBulkDestroy Method for DcimModulesBulkDestroy + +Delete a list of module objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModulesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimModulesBulkDestroy(ctx context.Context) ApiDcimModulesBulkDestroyRequest { + return ApiDcimModulesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModulesBulkDestroyExecute(r ApiDcimModulesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleRequest == nil { + return nil, reportError("moduleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModulesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleRequest *[]ModuleRequest +} + +func (r ApiDcimModulesBulkPartialUpdateRequest) ModuleRequest(moduleRequest []ModuleRequest) ApiDcimModulesBulkPartialUpdateRequest { + r.moduleRequest = &moduleRequest + return r +} + +func (r ApiDcimModulesBulkPartialUpdateRequest) Execute() ([]Module, *http.Response, error) { + return r.ApiService.DcimModulesBulkPartialUpdateExecute(r) +} + +/* +DcimModulesBulkPartialUpdate Method for DcimModulesBulkPartialUpdate + +Patch a list of module objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModulesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModulesBulkPartialUpdate(ctx context.Context) ApiDcimModulesBulkPartialUpdateRequest { + return ApiDcimModulesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Module +func (a *DcimAPIService) DcimModulesBulkPartialUpdateExecute(r ApiDcimModulesBulkPartialUpdateRequest) ([]Module, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Module + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleRequest == nil { + return localVarReturnValue, nil, reportError("moduleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModulesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + moduleRequest *[]ModuleRequest +} + +func (r ApiDcimModulesBulkUpdateRequest) ModuleRequest(moduleRequest []ModuleRequest) ApiDcimModulesBulkUpdateRequest { + r.moduleRequest = &moduleRequest + return r +} + +func (r ApiDcimModulesBulkUpdateRequest) Execute() ([]Module, *http.Response, error) { + return r.ApiService.DcimModulesBulkUpdateExecute(r) +} + +/* +DcimModulesBulkUpdate Method for DcimModulesBulkUpdate + +Put a list of module objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModulesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimModulesBulkUpdate(ctx context.Context) ApiDcimModulesBulkUpdateRequest { + return ApiDcimModulesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Module +func (a *DcimAPIService) DcimModulesBulkUpdateExecute(r ApiDcimModulesBulkUpdateRequest) ([]Module, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Module + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moduleRequest == nil { + return localVarReturnValue, nil, reportError("moduleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moduleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModulesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableModuleRequest *WritableModuleRequest +} + +func (r ApiDcimModulesCreateRequest) WritableModuleRequest(writableModuleRequest WritableModuleRequest) ApiDcimModulesCreateRequest { + r.writableModuleRequest = &writableModuleRequest + return r +} + +func (r ApiDcimModulesCreateRequest) Execute() (*Module, *http.Response, error) { + return r.ApiService.DcimModulesCreateExecute(r) +} + +/* +DcimModulesCreate Method for DcimModulesCreate + +Post a list of module objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModulesCreateRequest +*/ +func (a *DcimAPIService) DcimModulesCreate(ctx context.Context) ApiDcimModulesCreateRequest { + return ApiDcimModulesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Module +func (a *DcimAPIService) DcimModulesCreateExecute(r ApiDcimModulesCreateRequest) (*Module, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Module + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModulesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModulesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimModulesDestroyExecute(r) +} + +/* +DcimModulesDestroy Method for DcimModulesDestroy + +Delete a module object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module. + @return ApiDcimModulesDestroyRequest +*/ +func (a *DcimAPIService) DcimModulesDestroy(ctx context.Context, id int32) ApiDcimModulesDestroyRequest { + return ApiDcimModulesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimModulesDestroyExecute(r ApiDcimModulesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimModulesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + assetTag *[]string + assetTagEmpty *bool + assetTagIc *[]string + assetTagIe *[]string + assetTagIew *[]string + assetTagIsw *[]string + assetTagN *[]string + assetTagNic *[]string + assetTagNie *[]string + assetTagNiew *[]string + assetTagNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + deviceId *[]int32 + deviceIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + manufacturer *[]string + manufacturerN *[]string + manufacturerId *[]int32 + manufacturerIdN *[]int32 + modifiedByRequest *string + moduleBayId *[]int32 + moduleBayIdN *[]int32 + moduleType *[]string + moduleTypeN *[]string + moduleTypeId *[]int32 + moduleTypeIdN *[]int32 + offset *int32 + ordering *string + q *string + serial *[]string + serialEmpty *bool + serialIc *[]string + serialIe *[]string + serialIew *[]string + serialIsw *[]string + serialN *[]string + serialNic *[]string + serialNie *[]string + serialNiew *[]string + serialNisw *[]string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiDcimModulesListRequest) AssetTag(assetTag []string) ApiDcimModulesListRequest { + r.assetTag = &assetTag + return r +} + +func (r ApiDcimModulesListRequest) AssetTagEmpty(assetTagEmpty bool) ApiDcimModulesListRequest { + r.assetTagEmpty = &assetTagEmpty + return r +} + +func (r ApiDcimModulesListRequest) AssetTagIc(assetTagIc []string) ApiDcimModulesListRequest { + r.assetTagIc = &assetTagIc + return r +} + +func (r ApiDcimModulesListRequest) AssetTagIe(assetTagIe []string) ApiDcimModulesListRequest { + r.assetTagIe = &assetTagIe + return r +} + +func (r ApiDcimModulesListRequest) AssetTagIew(assetTagIew []string) ApiDcimModulesListRequest { + r.assetTagIew = &assetTagIew + return r +} + +func (r ApiDcimModulesListRequest) AssetTagIsw(assetTagIsw []string) ApiDcimModulesListRequest { + r.assetTagIsw = &assetTagIsw + return r +} + +func (r ApiDcimModulesListRequest) AssetTagN(assetTagN []string) ApiDcimModulesListRequest { + r.assetTagN = &assetTagN + return r +} + +func (r ApiDcimModulesListRequest) AssetTagNic(assetTagNic []string) ApiDcimModulesListRequest { + r.assetTagNic = &assetTagNic + return r +} + +func (r ApiDcimModulesListRequest) AssetTagNie(assetTagNie []string) ApiDcimModulesListRequest { + r.assetTagNie = &assetTagNie + return r +} + +func (r ApiDcimModulesListRequest) AssetTagNiew(assetTagNiew []string) ApiDcimModulesListRequest { + r.assetTagNiew = &assetTagNiew + return r +} + +func (r ApiDcimModulesListRequest) AssetTagNisw(assetTagNisw []string) ApiDcimModulesListRequest { + r.assetTagNisw = &assetTagNisw + return r +} + +func (r ApiDcimModulesListRequest) Created(created []time.Time) ApiDcimModulesListRequest { + r.created = &created + return r +} + +func (r ApiDcimModulesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimModulesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimModulesListRequest) CreatedGt(createdGt []time.Time) ApiDcimModulesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimModulesListRequest) CreatedGte(createdGte []time.Time) ApiDcimModulesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimModulesListRequest) CreatedLt(createdLt []time.Time) ApiDcimModulesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimModulesListRequest) CreatedLte(createdLte []time.Time) ApiDcimModulesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimModulesListRequest) CreatedN(createdN []time.Time) ApiDcimModulesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimModulesListRequest) CreatedByRequest(createdByRequest string) ApiDcimModulesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimModulesListRequest) Description(description []string) ApiDcimModulesListRequest { + r.description = &description + return r +} + +func (r ApiDcimModulesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimModulesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimModulesListRequest) DescriptionIc(descriptionIc []string) ApiDcimModulesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimModulesListRequest) DescriptionIe(descriptionIe []string) ApiDcimModulesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimModulesListRequest) DescriptionIew(descriptionIew []string) ApiDcimModulesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimModulesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimModulesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimModulesListRequest) DescriptionN(descriptionN []string) ApiDcimModulesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimModulesListRequest) DescriptionNic(descriptionNic []string) ApiDcimModulesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimModulesListRequest) DescriptionNie(descriptionNie []string) ApiDcimModulesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimModulesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimModulesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimModulesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimModulesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (ID) +func (r ApiDcimModulesListRequest) DeviceId(deviceId []int32) ApiDcimModulesListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimModulesListRequest) DeviceIdN(deviceIdN []int32) ApiDcimModulesListRequest { + r.deviceIdN = &deviceIdN + return r +} + +func (r ApiDcimModulesListRequest) Id(id []int32) ApiDcimModulesListRequest { + r.id = &id + return r +} + +func (r ApiDcimModulesListRequest) IdEmpty(idEmpty bool) ApiDcimModulesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimModulesListRequest) IdGt(idGt []int32) ApiDcimModulesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimModulesListRequest) IdGte(idGte []int32) ApiDcimModulesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimModulesListRequest) IdLt(idLt []int32) ApiDcimModulesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimModulesListRequest) IdLte(idLte []int32) ApiDcimModulesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimModulesListRequest) IdN(idN []int32) ApiDcimModulesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimModulesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimModulesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimModulesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimModulesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimModulesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimModulesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimModulesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimModulesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimModulesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimModulesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimModulesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimModulesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimModulesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimModulesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimModulesListRequest) Limit(limit int32) ApiDcimModulesListRequest { + r.limit = &limit + return r +} + +// Manufacturer (slug) +func (r ApiDcimModulesListRequest) Manufacturer(manufacturer []string) ApiDcimModulesListRequest { + r.manufacturer = &manufacturer + return r +} + +// Manufacturer (slug) +func (r ApiDcimModulesListRequest) ManufacturerN(manufacturerN []string) ApiDcimModulesListRequest { + r.manufacturerN = &manufacturerN + return r +} + +// Manufacturer (ID) +func (r ApiDcimModulesListRequest) ManufacturerId(manufacturerId []int32) ApiDcimModulesListRequest { + r.manufacturerId = &manufacturerId + return r +} + +// Manufacturer (ID) +func (r ApiDcimModulesListRequest) ManufacturerIdN(manufacturerIdN []int32) ApiDcimModulesListRequest { + r.manufacturerIdN = &manufacturerIdN + return r +} + +func (r ApiDcimModulesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimModulesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module Bay (ID) +func (r ApiDcimModulesListRequest) ModuleBayId(moduleBayId []int32) ApiDcimModulesListRequest { + r.moduleBayId = &moduleBayId + return r +} + +// Module Bay (ID) +func (r ApiDcimModulesListRequest) ModuleBayIdN(moduleBayIdN []int32) ApiDcimModulesListRequest { + r.moduleBayIdN = &moduleBayIdN + return r +} + +// Module type (model) +func (r ApiDcimModulesListRequest) ModuleType(moduleType []string) ApiDcimModulesListRequest { + r.moduleType = &moduleType + return r +} + +// Module type (model) +func (r ApiDcimModulesListRequest) ModuleTypeN(moduleTypeN []string) ApiDcimModulesListRequest { + r.moduleTypeN = &moduleTypeN + return r +} + +// Module type (ID) +func (r ApiDcimModulesListRequest) ModuleTypeId(moduleTypeId []int32) ApiDcimModulesListRequest { + r.moduleTypeId = &moduleTypeId + return r +} + +// Module type (ID) +func (r ApiDcimModulesListRequest) ModuleTypeIdN(moduleTypeIdN []int32) ApiDcimModulesListRequest { + r.moduleTypeIdN = &moduleTypeIdN + return r +} + +// The initial index from which to return the results. +func (r ApiDcimModulesListRequest) Offset(offset int32) ApiDcimModulesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimModulesListRequest) Ordering(ordering string) ApiDcimModulesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimModulesListRequest) Q(q string) ApiDcimModulesListRequest { + r.q = &q + return r +} + +func (r ApiDcimModulesListRequest) Serial(serial []string) ApiDcimModulesListRequest { + r.serial = &serial + return r +} + +func (r ApiDcimModulesListRequest) SerialEmpty(serialEmpty bool) ApiDcimModulesListRequest { + r.serialEmpty = &serialEmpty + return r +} + +func (r ApiDcimModulesListRequest) SerialIc(serialIc []string) ApiDcimModulesListRequest { + r.serialIc = &serialIc + return r +} + +func (r ApiDcimModulesListRequest) SerialIe(serialIe []string) ApiDcimModulesListRequest { + r.serialIe = &serialIe + return r +} + +func (r ApiDcimModulesListRequest) SerialIew(serialIew []string) ApiDcimModulesListRequest { + r.serialIew = &serialIew + return r +} + +func (r ApiDcimModulesListRequest) SerialIsw(serialIsw []string) ApiDcimModulesListRequest { + r.serialIsw = &serialIsw + return r +} + +func (r ApiDcimModulesListRequest) SerialN(serialN []string) ApiDcimModulesListRequest { + r.serialN = &serialN + return r +} + +func (r ApiDcimModulesListRequest) SerialNic(serialNic []string) ApiDcimModulesListRequest { + r.serialNic = &serialNic + return r +} + +func (r ApiDcimModulesListRequest) SerialNie(serialNie []string) ApiDcimModulesListRequest { + r.serialNie = &serialNie + return r +} + +func (r ApiDcimModulesListRequest) SerialNiew(serialNiew []string) ApiDcimModulesListRequest { + r.serialNiew = &serialNiew + return r +} + +func (r ApiDcimModulesListRequest) SerialNisw(serialNisw []string) ApiDcimModulesListRequest { + r.serialNisw = &serialNisw + return r +} + +func (r ApiDcimModulesListRequest) Status(status []string) ApiDcimModulesListRequest { + r.status = &status + return r +} + +func (r ApiDcimModulesListRequest) StatusN(statusN []string) ApiDcimModulesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimModulesListRequest) Tag(tag []string) ApiDcimModulesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimModulesListRequest) TagN(tagN []string) ApiDcimModulesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimModulesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimModulesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimModulesListRequest) Execute() (*PaginatedModuleList, *http.Response, error) { + return r.ApiService.DcimModulesListExecute(r) +} + +/* +DcimModulesList Method for DcimModulesList + +Get a list of module objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimModulesListRequest +*/ +func (a *DcimAPIService) DcimModulesList(ctx context.Context) ApiDcimModulesListRequest { + return ApiDcimModulesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedModuleList +func (a *DcimAPIService) DcimModulesListExecute(r ApiDcimModulesListRequest) (*PaginatedModuleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedModuleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.assetTag != nil { + t := *r.assetTag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", t, "multi") + } + } + if r.assetTagEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__empty", r.assetTagEmpty, "") + } + if r.assetTagIc != nil { + t := *r.assetTagIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", t, "multi") + } + } + if r.assetTagIe != nil { + t := *r.assetTagIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", t, "multi") + } + } + if r.assetTagIew != nil { + t := *r.assetTagIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", t, "multi") + } + } + if r.assetTagIsw != nil { + t := *r.assetTagIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", t, "multi") + } + } + if r.assetTagN != nil { + t := *r.assetTagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", t, "multi") + } + } + if r.assetTagNic != nil { + t := *r.assetTagNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", t, "multi") + } + } + if r.assetTagNie != nil { + t := *r.assetTagNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", t, "multi") + } + } + if r.assetTagNiew != nil { + t := *r.assetTagNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", t, "multi") + } + } + if r.assetTagNisw != nil { + t := *r.assetTagNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.manufacturer != nil { + t := *r.manufacturer + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", t, "multi") + } + } + if r.manufacturerN != nil { + t := *r.manufacturerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", t, "multi") + } + } + if r.manufacturerId != nil { + t := *r.manufacturerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", t, "multi") + } + } + if r.manufacturerIdN != nil { + t := *r.manufacturerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleBayId != nil { + t := *r.moduleBayId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_bay_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_bay_id", t, "multi") + } + } + if r.moduleBayIdN != nil { + t := *r.moduleBayIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_bay_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_bay_id__n", t, "multi") + } + } + if r.moduleType != nil { + t := *r.moduleType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type", t, "multi") + } + } + if r.moduleTypeN != nil { + t := *r.moduleTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type__n", t, "multi") + } + } + if r.moduleTypeId != nil { + t := *r.moduleTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type_id", t, "multi") + } + } + if r.moduleTypeIdN != nil { + t := *r.moduleTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_type_id__n", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.serial != nil { + t := *r.serial + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", t, "multi") + } + } + if r.serialEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__empty", r.serialEmpty, "") + } + if r.serialIc != nil { + t := *r.serialIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", t, "multi") + } + } + if r.serialIe != nil { + t := *r.serialIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", t, "multi") + } + } + if r.serialIew != nil { + t := *r.serialIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", t, "multi") + } + } + if r.serialIsw != nil { + t := *r.serialIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", t, "multi") + } + } + if r.serialN != nil { + t := *r.serialN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", t, "multi") + } + } + if r.serialNic != nil { + t := *r.serialNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", t, "multi") + } + } + if r.serialNie != nil { + t := *r.serialNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", t, "multi") + } + } + if r.serialNiew != nil { + t := *r.serialNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", t, "multi") + } + } + if r.serialNisw != nil { + t := *r.serialNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModulesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableModuleRequest *PatchedWritableModuleRequest +} + +func (r ApiDcimModulesPartialUpdateRequest) PatchedWritableModuleRequest(patchedWritableModuleRequest PatchedWritableModuleRequest) ApiDcimModulesPartialUpdateRequest { + r.patchedWritableModuleRequest = &patchedWritableModuleRequest + return r +} + +func (r ApiDcimModulesPartialUpdateRequest) Execute() (*Module, *http.Response, error) { + return r.ApiService.DcimModulesPartialUpdateExecute(r) +} + +/* +DcimModulesPartialUpdate Method for DcimModulesPartialUpdate + +Patch a module object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module. + @return ApiDcimModulesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimModulesPartialUpdate(ctx context.Context, id int32) ApiDcimModulesPartialUpdateRequest { + return ApiDcimModulesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Module +func (a *DcimAPIService) DcimModulesPartialUpdateExecute(r ApiDcimModulesPartialUpdateRequest) (*Module, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Module + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableModuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModulesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimModulesRetrieveRequest) Execute() (*Module, *http.Response, error) { + return r.ApiService.DcimModulesRetrieveExecute(r) +} + +/* +DcimModulesRetrieve Method for DcimModulesRetrieve + +Get a module object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module. + @return ApiDcimModulesRetrieveRequest +*/ +func (a *DcimAPIService) DcimModulesRetrieve(ctx context.Context, id int32) ApiDcimModulesRetrieveRequest { + return ApiDcimModulesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Module +func (a *DcimAPIService) DcimModulesRetrieveExecute(r ApiDcimModulesRetrieveRequest) (*Module, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Module + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimModulesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableModuleRequest *WritableModuleRequest +} + +func (r ApiDcimModulesUpdateRequest) WritableModuleRequest(writableModuleRequest WritableModuleRequest) ApiDcimModulesUpdateRequest { + r.writableModuleRequest = &writableModuleRequest + return r +} + +func (r ApiDcimModulesUpdateRequest) Execute() (*Module, *http.Response, error) { + return r.ApiService.DcimModulesUpdateExecute(r) +} + +/* +DcimModulesUpdate Method for DcimModulesUpdate + +Put a module object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this module. + @return ApiDcimModulesUpdateRequest +*/ +func (a *DcimAPIService) DcimModulesUpdate(ctx context.Context, id int32) ApiDcimModulesUpdateRequest { + return ApiDcimModulesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Module +func (a *DcimAPIService) DcimModulesUpdateExecute(r ApiDcimModulesUpdateRequest) (*Module, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Module + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimModulesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/modules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableModuleRequest == nil { + return localVarReturnValue, nil, reportError("writableModuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableModuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPlatformsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + platformRequest *[]PlatformRequest +} + +func (r ApiDcimPlatformsBulkDestroyRequest) PlatformRequest(platformRequest []PlatformRequest) ApiDcimPlatformsBulkDestroyRequest { + r.platformRequest = &platformRequest + return r +} + +func (r ApiDcimPlatformsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPlatformsBulkDestroyExecute(r) +} + +/* +DcimPlatformsBulkDestroy Method for DcimPlatformsBulkDestroy + +Delete a list of platform objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPlatformsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimPlatformsBulkDestroy(ctx context.Context) ApiDcimPlatformsBulkDestroyRequest { + return ApiDcimPlatformsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPlatformsBulkDestroyExecute(r ApiDcimPlatformsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.platformRequest == nil { + return nil, reportError("platformRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.platformRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPlatformsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + platformRequest *[]PlatformRequest +} + +func (r ApiDcimPlatformsBulkPartialUpdateRequest) PlatformRequest(platformRequest []PlatformRequest) ApiDcimPlatformsBulkPartialUpdateRequest { + r.platformRequest = &platformRequest + return r +} + +func (r ApiDcimPlatformsBulkPartialUpdateRequest) Execute() ([]Platform, *http.Response, error) { + return r.ApiService.DcimPlatformsBulkPartialUpdateExecute(r) +} + +/* +DcimPlatformsBulkPartialUpdate Method for DcimPlatformsBulkPartialUpdate + +Patch a list of platform objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPlatformsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPlatformsBulkPartialUpdate(ctx context.Context) ApiDcimPlatformsBulkPartialUpdateRequest { + return ApiDcimPlatformsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Platform +func (a *DcimAPIService) DcimPlatformsBulkPartialUpdateExecute(r ApiDcimPlatformsBulkPartialUpdateRequest) ([]Platform, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Platform + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.platformRequest == nil { + return localVarReturnValue, nil, reportError("platformRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.platformRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPlatformsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + platformRequest *[]PlatformRequest +} + +func (r ApiDcimPlatformsBulkUpdateRequest) PlatformRequest(platformRequest []PlatformRequest) ApiDcimPlatformsBulkUpdateRequest { + r.platformRequest = &platformRequest + return r +} + +func (r ApiDcimPlatformsBulkUpdateRequest) Execute() ([]Platform, *http.Response, error) { + return r.ApiService.DcimPlatformsBulkUpdateExecute(r) +} + +/* +DcimPlatformsBulkUpdate Method for DcimPlatformsBulkUpdate + +Put a list of platform objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPlatformsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimPlatformsBulkUpdate(ctx context.Context) ApiDcimPlatformsBulkUpdateRequest { + return ApiDcimPlatformsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Platform +func (a *DcimAPIService) DcimPlatformsBulkUpdateExecute(r ApiDcimPlatformsBulkUpdateRequest) ([]Platform, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Platform + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.platformRequest == nil { + return localVarReturnValue, nil, reportError("platformRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.platformRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPlatformsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writablePlatformRequest *WritablePlatformRequest +} + +func (r ApiDcimPlatformsCreateRequest) WritablePlatformRequest(writablePlatformRequest WritablePlatformRequest) ApiDcimPlatformsCreateRequest { + r.writablePlatformRequest = &writablePlatformRequest + return r +} + +func (r ApiDcimPlatformsCreateRequest) Execute() (*Platform, *http.Response, error) { + return r.ApiService.DcimPlatformsCreateExecute(r) +} + +/* +DcimPlatformsCreate Method for DcimPlatformsCreate + +Post a list of platform objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPlatformsCreateRequest +*/ +func (a *DcimAPIService) DcimPlatformsCreate(ctx context.Context) ApiDcimPlatformsCreateRequest { + return ApiDcimPlatformsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Platform +func (a *DcimAPIService) DcimPlatformsCreateExecute(r ApiDcimPlatformsCreateRequest) (*Platform, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Platform + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePlatformRequest == nil { + return localVarReturnValue, nil, reportError("writablePlatformRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePlatformRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPlatformsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPlatformsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPlatformsDestroyExecute(r) +} + +/* +DcimPlatformsDestroy Method for DcimPlatformsDestroy + +Delete a platform object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this platform. + @return ApiDcimPlatformsDestroyRequest +*/ +func (a *DcimAPIService) DcimPlatformsDestroy(ctx context.Context, id int32) ApiDcimPlatformsDestroyRequest { + return ApiDcimPlatformsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPlatformsDestroyExecute(r ApiDcimPlatformsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPlatformsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + configTemplateId *[]*int32 + configTemplateIdN *[]*int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + manufacturer *[]string + manufacturerN *[]string + manufacturerId *[]int32 + manufacturerIdN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Config template (ID) +func (r ApiDcimPlatformsListRequest) ConfigTemplateId(configTemplateId []*int32) ApiDcimPlatformsListRequest { + r.configTemplateId = &configTemplateId + return r +} + +// Config template (ID) +func (r ApiDcimPlatformsListRequest) ConfigTemplateIdN(configTemplateIdN []*int32) ApiDcimPlatformsListRequest { + r.configTemplateIdN = &configTemplateIdN + return r +} + +func (r ApiDcimPlatformsListRequest) Created(created []time.Time) ApiDcimPlatformsListRequest { + r.created = &created + return r +} + +func (r ApiDcimPlatformsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimPlatformsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimPlatformsListRequest) CreatedGt(createdGt []time.Time) ApiDcimPlatformsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimPlatformsListRequest) CreatedGte(createdGte []time.Time) ApiDcimPlatformsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimPlatformsListRequest) CreatedLt(createdLt []time.Time) ApiDcimPlatformsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimPlatformsListRequest) CreatedLte(createdLte []time.Time) ApiDcimPlatformsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimPlatformsListRequest) CreatedN(createdN []time.Time) ApiDcimPlatformsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimPlatformsListRequest) CreatedByRequest(createdByRequest string) ApiDcimPlatformsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimPlatformsListRequest) Description(description []string) ApiDcimPlatformsListRequest { + r.description = &description + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimPlatformsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionIc(descriptionIc []string) ApiDcimPlatformsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionIe(descriptionIe []string) ApiDcimPlatformsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionIew(descriptionIew []string) ApiDcimPlatformsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimPlatformsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionN(descriptionN []string) ApiDcimPlatformsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionNic(descriptionNic []string) ApiDcimPlatformsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionNie(descriptionNie []string) ApiDcimPlatformsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimPlatformsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimPlatformsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimPlatformsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimPlatformsListRequest) Id(id []int32) ApiDcimPlatformsListRequest { + r.id = &id + return r +} + +func (r ApiDcimPlatformsListRequest) IdEmpty(idEmpty bool) ApiDcimPlatformsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimPlatformsListRequest) IdGt(idGt []int32) ApiDcimPlatformsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimPlatformsListRequest) IdGte(idGte []int32) ApiDcimPlatformsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimPlatformsListRequest) IdLt(idLt []int32) ApiDcimPlatformsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimPlatformsListRequest) IdLte(idLte []int32) ApiDcimPlatformsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimPlatformsListRequest) IdN(idN []int32) ApiDcimPlatformsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimPlatformsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimPlatformsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimPlatformsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimPlatformsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimPlatformsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimPlatformsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimPlatformsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimPlatformsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimPlatformsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimPlatformsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimPlatformsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimPlatformsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimPlatformsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimPlatformsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimPlatformsListRequest) Limit(limit int32) ApiDcimPlatformsListRequest { + r.limit = &limit + return r +} + +// Manufacturer (slug) +func (r ApiDcimPlatformsListRequest) Manufacturer(manufacturer []string) ApiDcimPlatformsListRequest { + r.manufacturer = &manufacturer + return r +} + +// Manufacturer (slug) +func (r ApiDcimPlatformsListRequest) ManufacturerN(manufacturerN []string) ApiDcimPlatformsListRequest { + r.manufacturerN = &manufacturerN + return r +} + +// Manufacturer (ID) +func (r ApiDcimPlatformsListRequest) ManufacturerId(manufacturerId []int32) ApiDcimPlatformsListRequest { + r.manufacturerId = &manufacturerId + return r +} + +// Manufacturer (ID) +func (r ApiDcimPlatformsListRequest) ManufacturerIdN(manufacturerIdN []int32) ApiDcimPlatformsListRequest { + r.manufacturerIdN = &manufacturerIdN + return r +} + +func (r ApiDcimPlatformsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimPlatformsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimPlatformsListRequest) Name(name []string) ApiDcimPlatformsListRequest { + r.name = &name + return r +} + +func (r ApiDcimPlatformsListRequest) NameEmpty(nameEmpty bool) ApiDcimPlatformsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimPlatformsListRequest) NameIc(nameIc []string) ApiDcimPlatformsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimPlatformsListRequest) NameIe(nameIe []string) ApiDcimPlatformsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimPlatformsListRequest) NameIew(nameIew []string) ApiDcimPlatformsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimPlatformsListRequest) NameIsw(nameIsw []string) ApiDcimPlatformsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimPlatformsListRequest) NameN(nameN []string) ApiDcimPlatformsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimPlatformsListRequest) NameNic(nameNic []string) ApiDcimPlatformsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimPlatformsListRequest) NameNie(nameNie []string) ApiDcimPlatformsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimPlatformsListRequest) NameNiew(nameNiew []string) ApiDcimPlatformsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimPlatformsListRequest) NameNisw(nameNisw []string) ApiDcimPlatformsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimPlatformsListRequest) Offset(offset int32) ApiDcimPlatformsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimPlatformsListRequest) Ordering(ordering string) ApiDcimPlatformsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimPlatformsListRequest) Q(q string) ApiDcimPlatformsListRequest { + r.q = &q + return r +} + +func (r ApiDcimPlatformsListRequest) Slug(slug []string) ApiDcimPlatformsListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimPlatformsListRequest) SlugEmpty(slugEmpty bool) ApiDcimPlatformsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimPlatformsListRequest) SlugIc(slugIc []string) ApiDcimPlatformsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimPlatformsListRequest) SlugIe(slugIe []string) ApiDcimPlatformsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimPlatformsListRequest) SlugIew(slugIew []string) ApiDcimPlatformsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimPlatformsListRequest) SlugIsw(slugIsw []string) ApiDcimPlatformsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimPlatformsListRequest) SlugN(slugN []string) ApiDcimPlatformsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimPlatformsListRequest) SlugNic(slugNic []string) ApiDcimPlatformsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimPlatformsListRequest) SlugNie(slugNie []string) ApiDcimPlatformsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimPlatformsListRequest) SlugNiew(slugNiew []string) ApiDcimPlatformsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimPlatformsListRequest) SlugNisw(slugNisw []string) ApiDcimPlatformsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimPlatformsListRequest) Tag(tag []string) ApiDcimPlatformsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimPlatformsListRequest) TagN(tagN []string) ApiDcimPlatformsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimPlatformsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimPlatformsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimPlatformsListRequest) Execute() (*PaginatedPlatformList, *http.Response, error) { + return r.ApiService.DcimPlatformsListExecute(r) +} + +/* +DcimPlatformsList Method for DcimPlatformsList + +Get a list of platform objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPlatformsListRequest +*/ +func (a *DcimAPIService) DcimPlatformsList(ctx context.Context) ApiDcimPlatformsListRequest { + return ApiDcimPlatformsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPlatformList +func (a *DcimAPIService) DcimPlatformsListExecute(r ApiDcimPlatformsListRequest) (*PaginatedPlatformList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPlatformList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.configTemplateId != nil { + t := *r.configTemplateId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", t, "multi") + } + } + if r.configTemplateIdN != nil { + t := *r.configTemplateIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.manufacturer != nil { + t := *r.manufacturer + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer", t, "multi") + } + } + if r.manufacturerN != nil { + t := *r.manufacturerN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer__n", t, "multi") + } + } + if r.manufacturerId != nil { + t := *r.manufacturerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id", t, "multi") + } + } + if r.manufacturerIdN != nil { + t := *r.manufacturerIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "manufacturer_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPlatformsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritablePlatformRequest *PatchedWritablePlatformRequest +} + +func (r ApiDcimPlatformsPartialUpdateRequest) PatchedWritablePlatformRequest(patchedWritablePlatformRequest PatchedWritablePlatformRequest) ApiDcimPlatformsPartialUpdateRequest { + r.patchedWritablePlatformRequest = &patchedWritablePlatformRequest + return r +} + +func (r ApiDcimPlatformsPartialUpdateRequest) Execute() (*Platform, *http.Response, error) { + return r.ApiService.DcimPlatformsPartialUpdateExecute(r) +} + +/* +DcimPlatformsPartialUpdate Method for DcimPlatformsPartialUpdate + +Patch a platform object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this platform. + @return ApiDcimPlatformsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPlatformsPartialUpdate(ctx context.Context, id int32) ApiDcimPlatformsPartialUpdateRequest { + return ApiDcimPlatformsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Platform +func (a *DcimAPIService) DcimPlatformsPartialUpdateExecute(r ApiDcimPlatformsPartialUpdateRequest) (*Platform, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Platform + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePlatformRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPlatformsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPlatformsRetrieveRequest) Execute() (*Platform, *http.Response, error) { + return r.ApiService.DcimPlatformsRetrieveExecute(r) +} + +/* +DcimPlatformsRetrieve Method for DcimPlatformsRetrieve + +Get a platform object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this platform. + @return ApiDcimPlatformsRetrieveRequest +*/ +func (a *DcimAPIService) DcimPlatformsRetrieve(ctx context.Context, id int32) ApiDcimPlatformsRetrieveRequest { + return ApiDcimPlatformsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Platform +func (a *DcimAPIService) DcimPlatformsRetrieveExecute(r ApiDcimPlatformsRetrieveRequest) (*Platform, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Platform + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPlatformsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writablePlatformRequest *WritablePlatformRequest +} + +func (r ApiDcimPlatformsUpdateRequest) WritablePlatformRequest(writablePlatformRequest WritablePlatformRequest) ApiDcimPlatformsUpdateRequest { + r.writablePlatformRequest = &writablePlatformRequest + return r +} + +func (r ApiDcimPlatformsUpdateRequest) Execute() (*Platform, *http.Response, error) { + return r.ApiService.DcimPlatformsUpdateExecute(r) +} + +/* +DcimPlatformsUpdate Method for DcimPlatformsUpdate + +Put a platform object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this platform. + @return ApiDcimPlatformsUpdateRequest +*/ +func (a *DcimAPIService) DcimPlatformsUpdate(ctx context.Context, id int32) ApiDcimPlatformsUpdateRequest { + return ApiDcimPlatformsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Platform +func (a *DcimAPIService) DcimPlatformsUpdateExecute(r ApiDcimPlatformsUpdateRequest) (*Platform, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Platform + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPlatformsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/platforms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePlatformRequest == nil { + return localVarReturnValue, nil, reportError("writablePlatformRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePlatformRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerFeedRequest *[]PowerFeedRequest +} + +func (r ApiDcimPowerFeedsBulkDestroyRequest) PowerFeedRequest(powerFeedRequest []PowerFeedRequest) ApiDcimPowerFeedsBulkDestroyRequest { + r.powerFeedRequest = &powerFeedRequest + return r +} + +func (r ApiDcimPowerFeedsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerFeedsBulkDestroyExecute(r) +} + +/* +DcimPowerFeedsBulkDestroy Method for DcimPowerFeedsBulkDestroy + +Delete a list of power feed objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerFeedsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsBulkDestroy(ctx context.Context) ApiDcimPowerFeedsBulkDestroyRequest { + return ApiDcimPowerFeedsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerFeedsBulkDestroyExecute(r ApiDcimPowerFeedsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerFeedRequest == nil { + return nil, reportError("powerFeedRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerFeedRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerFeedRequest *[]PowerFeedRequest +} + +func (r ApiDcimPowerFeedsBulkPartialUpdateRequest) PowerFeedRequest(powerFeedRequest []PowerFeedRequest) ApiDcimPowerFeedsBulkPartialUpdateRequest { + r.powerFeedRequest = &powerFeedRequest + return r +} + +func (r ApiDcimPowerFeedsBulkPartialUpdateRequest) Execute() ([]PowerFeed, *http.Response, error) { + return r.ApiService.DcimPowerFeedsBulkPartialUpdateExecute(r) +} + +/* +DcimPowerFeedsBulkPartialUpdate Method for DcimPowerFeedsBulkPartialUpdate + +Patch a list of power feed objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerFeedsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsBulkPartialUpdate(ctx context.Context) ApiDcimPowerFeedsBulkPartialUpdateRequest { + return ApiDcimPowerFeedsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerFeed +func (a *DcimAPIService) DcimPowerFeedsBulkPartialUpdateExecute(r ApiDcimPowerFeedsBulkPartialUpdateRequest) ([]PowerFeed, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerFeed + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerFeedRequest == nil { + return localVarReturnValue, nil, reportError("powerFeedRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerFeedRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerFeedRequest *[]PowerFeedRequest +} + +func (r ApiDcimPowerFeedsBulkUpdateRequest) PowerFeedRequest(powerFeedRequest []PowerFeedRequest) ApiDcimPowerFeedsBulkUpdateRequest { + r.powerFeedRequest = &powerFeedRequest + return r +} + +func (r ApiDcimPowerFeedsBulkUpdateRequest) Execute() ([]PowerFeed, *http.Response, error) { + return r.ApiService.DcimPowerFeedsBulkUpdateExecute(r) +} + +/* +DcimPowerFeedsBulkUpdate Method for DcimPowerFeedsBulkUpdate + +Put a list of power feed objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerFeedsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsBulkUpdate(ctx context.Context) ApiDcimPowerFeedsBulkUpdateRequest { + return ApiDcimPowerFeedsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerFeed +func (a *DcimAPIService) DcimPowerFeedsBulkUpdateExecute(r ApiDcimPowerFeedsBulkUpdateRequest) ([]PowerFeed, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerFeed + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerFeedRequest == nil { + return localVarReturnValue, nil, reportError("powerFeedRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerFeedRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writablePowerFeedRequest *WritablePowerFeedRequest +} + +func (r ApiDcimPowerFeedsCreateRequest) WritablePowerFeedRequest(writablePowerFeedRequest WritablePowerFeedRequest) ApiDcimPowerFeedsCreateRequest { + r.writablePowerFeedRequest = &writablePowerFeedRequest + return r +} + +func (r ApiDcimPowerFeedsCreateRequest) Execute() (*PowerFeed, *http.Response, error) { + return r.ApiService.DcimPowerFeedsCreateExecute(r) +} + +/* +DcimPowerFeedsCreate Method for DcimPowerFeedsCreate + +Post a list of power feed objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerFeedsCreateRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsCreate(ctx context.Context) ApiDcimPowerFeedsCreateRequest { + return ApiDcimPowerFeedsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PowerFeed +func (a *DcimAPIService) DcimPowerFeedsCreateExecute(r ApiDcimPowerFeedsCreateRequest) (*PowerFeed, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerFeed + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerFeedRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerFeedRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerFeedRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerFeedsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerFeedsDestroyExecute(r) +} + +/* +DcimPowerFeedsDestroy Method for DcimPowerFeedsDestroy + +Delete a power feed object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power feed. + @return ApiDcimPowerFeedsDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsDestroy(ctx context.Context, id int32) ApiDcimPowerFeedsDestroyRequest { + return ApiDcimPowerFeedsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerFeedsDestroyExecute(r ApiDcimPowerFeedsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + amperage *[]int32 + amperageEmpty *bool + amperageGt *[]int32 + amperageGte *[]int32 + amperageLt *[]int32 + amperageLte *[]int32 + amperageN *[]int32 + cableEnd *string + cableEndN *string + cabled *bool + connected *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + maxUtilization *[]int32 + maxUtilizationEmpty *bool + maxUtilizationGt *[]int32 + maxUtilizationGte *[]int32 + maxUtilizationLt *[]int32 + maxUtilizationLte *[]int32 + maxUtilizationN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + phase *string + phaseN *string + powerPanelId *[]int32 + powerPanelIdN *[]int32 + q *string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + status *[]string + statusN *[]string + supply *string + supplyN *string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + type_ *string + typeN *string + updatedByRequest *string + voltage *[]int32 + voltageEmpty *bool + voltageGt *[]int32 + voltageGte *[]int32 + voltageLt *[]int32 + voltageLte *[]int32 + voltageN *[]int32 +} + +func (r ApiDcimPowerFeedsListRequest) Amperage(amperage []int32) ApiDcimPowerFeedsListRequest { + r.amperage = &erage + return r +} + +func (r ApiDcimPowerFeedsListRequest) AmperageEmpty(amperageEmpty bool) ApiDcimPowerFeedsListRequest { + r.amperageEmpty = &erageEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) AmperageGt(amperageGt []int32) ApiDcimPowerFeedsListRequest { + r.amperageGt = &erageGt + return r +} + +func (r ApiDcimPowerFeedsListRequest) AmperageGte(amperageGte []int32) ApiDcimPowerFeedsListRequest { + r.amperageGte = &erageGte + return r +} + +func (r ApiDcimPowerFeedsListRequest) AmperageLt(amperageLt []int32) ApiDcimPowerFeedsListRequest { + r.amperageLt = &erageLt + return r +} + +func (r ApiDcimPowerFeedsListRequest) AmperageLte(amperageLte []int32) ApiDcimPowerFeedsListRequest { + r.amperageLte = &erageLte + return r +} + +func (r ApiDcimPowerFeedsListRequest) AmperageN(amperageN []int32) ApiDcimPowerFeedsListRequest { + r.amperageN = &erageN + return r +} + +func (r ApiDcimPowerFeedsListRequest) CableEnd(cableEnd string) ApiDcimPowerFeedsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimPowerFeedsListRequest) CableEndN(cableEndN string) ApiDcimPowerFeedsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimPowerFeedsListRequest) Cabled(cabled bool) ApiDcimPowerFeedsListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimPowerFeedsListRequest) Connected(connected bool) ApiDcimPowerFeedsListRequest { + r.connected = &connected + return r +} + +func (r ApiDcimPowerFeedsListRequest) Created(created []time.Time) ApiDcimPowerFeedsListRequest { + r.created = &created + return r +} + +func (r ApiDcimPowerFeedsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimPowerFeedsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) CreatedGt(createdGt []time.Time) ApiDcimPowerFeedsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimPowerFeedsListRequest) CreatedGte(createdGte []time.Time) ApiDcimPowerFeedsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimPowerFeedsListRequest) CreatedLt(createdLt []time.Time) ApiDcimPowerFeedsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimPowerFeedsListRequest) CreatedLte(createdLte []time.Time) ApiDcimPowerFeedsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimPowerFeedsListRequest) CreatedN(createdN []time.Time) ApiDcimPowerFeedsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimPowerFeedsListRequest) CreatedByRequest(createdByRequest string) ApiDcimPowerFeedsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimPowerFeedsListRequest) Description(description []string) ApiDcimPowerFeedsListRequest { + r.description = &description + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimPowerFeedsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionIc(descriptionIc []string) ApiDcimPowerFeedsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionIe(descriptionIe []string) ApiDcimPowerFeedsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionIew(descriptionIew []string) ApiDcimPowerFeedsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimPowerFeedsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionN(descriptionN []string) ApiDcimPowerFeedsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionNic(descriptionNic []string) ApiDcimPowerFeedsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionNie(descriptionNie []string) ApiDcimPowerFeedsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimPowerFeedsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimPowerFeedsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimPowerFeedsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimPowerFeedsListRequest) Id(id []int32) ApiDcimPowerFeedsListRequest { + r.id = &id + return r +} + +func (r ApiDcimPowerFeedsListRequest) IdEmpty(idEmpty bool) ApiDcimPowerFeedsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) IdGt(idGt []int32) ApiDcimPowerFeedsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimPowerFeedsListRequest) IdGte(idGte []int32) ApiDcimPowerFeedsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimPowerFeedsListRequest) IdLt(idLt []int32) ApiDcimPowerFeedsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimPowerFeedsListRequest) IdLte(idLte []int32) ApiDcimPowerFeedsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimPowerFeedsListRequest) IdN(idN []int32) ApiDcimPowerFeedsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimPowerFeedsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimPowerFeedsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimPowerFeedsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimPowerFeedsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimPowerFeedsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimPowerFeedsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimPowerFeedsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimPowerFeedsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimPowerFeedsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimPowerFeedsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimPowerFeedsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimPowerFeedsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimPowerFeedsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimPowerFeedsListRequest) Limit(limit int32) ApiDcimPowerFeedsListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimPowerFeedsListRequest) MaxUtilization(maxUtilization []int32) ApiDcimPowerFeedsListRequest { + r.maxUtilization = &maxUtilization + return r +} + +func (r ApiDcimPowerFeedsListRequest) MaxUtilizationEmpty(maxUtilizationEmpty bool) ApiDcimPowerFeedsListRequest { + r.maxUtilizationEmpty = &maxUtilizationEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) MaxUtilizationGt(maxUtilizationGt []int32) ApiDcimPowerFeedsListRequest { + r.maxUtilizationGt = &maxUtilizationGt + return r +} + +func (r ApiDcimPowerFeedsListRequest) MaxUtilizationGte(maxUtilizationGte []int32) ApiDcimPowerFeedsListRequest { + r.maxUtilizationGte = &maxUtilizationGte + return r +} + +func (r ApiDcimPowerFeedsListRequest) MaxUtilizationLt(maxUtilizationLt []int32) ApiDcimPowerFeedsListRequest { + r.maxUtilizationLt = &maxUtilizationLt + return r +} + +func (r ApiDcimPowerFeedsListRequest) MaxUtilizationLte(maxUtilizationLte []int32) ApiDcimPowerFeedsListRequest { + r.maxUtilizationLte = &maxUtilizationLte + return r +} + +func (r ApiDcimPowerFeedsListRequest) MaxUtilizationN(maxUtilizationN []int32) ApiDcimPowerFeedsListRequest { + r.maxUtilizationN = &maxUtilizationN + return r +} + +func (r ApiDcimPowerFeedsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimPowerFeedsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimPowerFeedsListRequest) Name(name []string) ApiDcimPowerFeedsListRequest { + r.name = &name + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameEmpty(nameEmpty bool) ApiDcimPowerFeedsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameIc(nameIc []string) ApiDcimPowerFeedsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameIe(nameIe []string) ApiDcimPowerFeedsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameIew(nameIew []string) ApiDcimPowerFeedsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameIsw(nameIsw []string) ApiDcimPowerFeedsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameN(nameN []string) ApiDcimPowerFeedsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameNic(nameNic []string) ApiDcimPowerFeedsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameNie(nameNie []string) ApiDcimPowerFeedsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameNiew(nameNiew []string) ApiDcimPowerFeedsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimPowerFeedsListRequest) NameNisw(nameNisw []string) ApiDcimPowerFeedsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimPowerFeedsListRequest) Occupied(occupied bool) ApiDcimPowerFeedsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimPowerFeedsListRequest) Offset(offset int32) ApiDcimPowerFeedsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimPowerFeedsListRequest) Ordering(ordering string) ApiDcimPowerFeedsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimPowerFeedsListRequest) Phase(phase string) ApiDcimPowerFeedsListRequest { + r.phase = &phase + return r +} + +func (r ApiDcimPowerFeedsListRequest) PhaseN(phaseN string) ApiDcimPowerFeedsListRequest { + r.phaseN = &phaseN + return r +} + +// Power panel (ID) +func (r ApiDcimPowerFeedsListRequest) PowerPanelId(powerPanelId []int32) ApiDcimPowerFeedsListRequest { + r.powerPanelId = &powerPanelId + return r +} + +// Power panel (ID) +func (r ApiDcimPowerFeedsListRequest) PowerPanelIdN(powerPanelIdN []int32) ApiDcimPowerFeedsListRequest { + r.powerPanelIdN = &powerPanelIdN + return r +} + +// Search +func (r ApiDcimPowerFeedsListRequest) Q(q string) ApiDcimPowerFeedsListRequest { + r.q = &q + return r +} + +// Rack (ID) +func (r ApiDcimPowerFeedsListRequest) RackId(rackId []int32) ApiDcimPowerFeedsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimPowerFeedsListRequest) RackIdN(rackIdN []int32) ApiDcimPowerFeedsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimPowerFeedsListRequest) Region(region []int32) ApiDcimPowerFeedsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimPowerFeedsListRequest) RegionN(regionN []int32) ApiDcimPowerFeedsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimPowerFeedsListRequest) RegionId(regionId []int32) ApiDcimPowerFeedsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimPowerFeedsListRequest) RegionIdN(regionIdN []int32) ApiDcimPowerFeedsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site name (slug) +func (r ApiDcimPowerFeedsListRequest) Site(site []string) ApiDcimPowerFeedsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimPowerFeedsListRequest) SiteN(siteN []string) ApiDcimPowerFeedsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimPowerFeedsListRequest) SiteGroup(siteGroup []int32) ApiDcimPowerFeedsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimPowerFeedsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimPowerFeedsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimPowerFeedsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimPowerFeedsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimPowerFeedsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimPowerFeedsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimPowerFeedsListRequest) SiteId(siteId []int32) ApiDcimPowerFeedsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimPowerFeedsListRequest) SiteIdN(siteIdN []int32) ApiDcimPowerFeedsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimPowerFeedsListRequest) Status(status []string) ApiDcimPowerFeedsListRequest { + r.status = &status + return r +} + +func (r ApiDcimPowerFeedsListRequest) StatusN(statusN []string) ApiDcimPowerFeedsListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimPowerFeedsListRequest) Supply(supply string) ApiDcimPowerFeedsListRequest { + r.supply = &supply + return r +} + +func (r ApiDcimPowerFeedsListRequest) SupplyN(supplyN string) ApiDcimPowerFeedsListRequest { + r.supplyN = &supplyN + return r +} + +func (r ApiDcimPowerFeedsListRequest) Tag(tag []string) ApiDcimPowerFeedsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimPowerFeedsListRequest) TagN(tagN []string) ApiDcimPowerFeedsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimPowerFeedsListRequest) Tenant(tenant []string) ApiDcimPowerFeedsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimPowerFeedsListRequest) TenantN(tenantN []string) ApiDcimPowerFeedsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimPowerFeedsListRequest) TenantGroup(tenantGroup []int32) ApiDcimPowerFeedsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimPowerFeedsListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimPowerFeedsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimPowerFeedsListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimPowerFeedsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimPowerFeedsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimPowerFeedsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimPowerFeedsListRequest) TenantId(tenantId []*int32) ApiDcimPowerFeedsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimPowerFeedsListRequest) TenantIdN(tenantIdN []*int32) ApiDcimPowerFeedsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimPowerFeedsListRequest) Type_(type_ string) ApiDcimPowerFeedsListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimPowerFeedsListRequest) TypeN(typeN string) ApiDcimPowerFeedsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimPowerFeedsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimPowerFeedsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimPowerFeedsListRequest) Voltage(voltage []int32) ApiDcimPowerFeedsListRequest { + r.voltage = &voltage + return r +} + +func (r ApiDcimPowerFeedsListRequest) VoltageEmpty(voltageEmpty bool) ApiDcimPowerFeedsListRequest { + r.voltageEmpty = &voltageEmpty + return r +} + +func (r ApiDcimPowerFeedsListRequest) VoltageGt(voltageGt []int32) ApiDcimPowerFeedsListRequest { + r.voltageGt = &voltageGt + return r +} + +func (r ApiDcimPowerFeedsListRequest) VoltageGte(voltageGte []int32) ApiDcimPowerFeedsListRequest { + r.voltageGte = &voltageGte + return r +} + +func (r ApiDcimPowerFeedsListRequest) VoltageLt(voltageLt []int32) ApiDcimPowerFeedsListRequest { + r.voltageLt = &voltageLt + return r +} + +func (r ApiDcimPowerFeedsListRequest) VoltageLte(voltageLte []int32) ApiDcimPowerFeedsListRequest { + r.voltageLte = &voltageLte + return r +} + +func (r ApiDcimPowerFeedsListRequest) VoltageN(voltageN []int32) ApiDcimPowerFeedsListRequest { + r.voltageN = &voltageN + return r +} + +func (r ApiDcimPowerFeedsListRequest) Execute() (*PaginatedPowerFeedList, *http.Response, error) { + return r.ApiService.DcimPowerFeedsListExecute(r) +} + +/* +DcimPowerFeedsList Method for DcimPowerFeedsList + +Get a list of power feed objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerFeedsListRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsList(ctx context.Context) ApiDcimPowerFeedsListRequest { + return ApiDcimPowerFeedsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPowerFeedList +func (a *DcimAPIService) DcimPowerFeedsListExecute(r ApiDcimPowerFeedsListRequest) (*PaginatedPowerFeedList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPowerFeedList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.amperage != nil { + t := *r.amperage + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage", t, "multi") + } + } + if r.amperageEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__empty", r.amperageEmpty, "") + } + if r.amperageGt != nil { + t := *r.amperageGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__gt", t, "multi") + } + } + if r.amperageGte != nil { + t := *r.amperageGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__gte", t, "multi") + } + } + if r.amperageLt != nil { + t := *r.amperageLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__lt", t, "multi") + } + } + if r.amperageLte != nil { + t := *r.amperageLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__lte", t, "multi") + } + } + if r.amperageN != nil { + t := *r.amperageN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "amperage__n", t, "multi") + } + } + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.connected != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "connected", r.connected, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.maxUtilization != nil { + t := *r.maxUtilization + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization", t, "multi") + } + } + if r.maxUtilizationEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__empty", r.maxUtilizationEmpty, "") + } + if r.maxUtilizationGt != nil { + t := *r.maxUtilizationGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__gt", t, "multi") + } + } + if r.maxUtilizationGte != nil { + t := *r.maxUtilizationGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__gte", t, "multi") + } + } + if r.maxUtilizationLt != nil { + t := *r.maxUtilizationLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__lt", t, "multi") + } + } + if r.maxUtilizationLte != nil { + t := *r.maxUtilizationLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__lte", t, "multi") + } + } + if r.maxUtilizationN != nil { + t := *r.maxUtilizationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_utilization__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.phase != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "phase", r.phase, "") + } + if r.phaseN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "phase__n", r.phaseN, "") + } + if r.powerPanelId != nil { + t := *r.powerPanelId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_panel_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_panel_id", t, "multi") + } + } + if r.powerPanelIdN != nil { + t := *r.powerPanelIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_panel_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "power_panel_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.supply != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "supply", r.supply, "") + } + if r.supplyN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "supply__n", r.supplyN, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.typeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", r.typeN, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.voltage != nil { + t := *r.voltage + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage", t, "multi") + } + } + if r.voltageEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__empty", r.voltageEmpty, "") + } + if r.voltageGt != nil { + t := *r.voltageGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__gt", t, "multi") + } + } + if r.voltageGte != nil { + t := *r.voltageGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__gte", t, "multi") + } + } + if r.voltageLt != nil { + t := *r.voltageLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__lt", t, "multi") + } + } + if r.voltageLte != nil { + t := *r.voltageLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__lte", t, "multi") + } + } + if r.voltageN != nil { + t := *r.voltageN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "voltage__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritablePowerFeedRequest *PatchedWritablePowerFeedRequest +} + +func (r ApiDcimPowerFeedsPartialUpdateRequest) PatchedWritablePowerFeedRequest(patchedWritablePowerFeedRequest PatchedWritablePowerFeedRequest) ApiDcimPowerFeedsPartialUpdateRequest { + r.patchedWritablePowerFeedRequest = &patchedWritablePowerFeedRequest + return r +} + +func (r ApiDcimPowerFeedsPartialUpdateRequest) Execute() (*PowerFeed, *http.Response, error) { + return r.ApiService.DcimPowerFeedsPartialUpdateExecute(r) +} + +/* +DcimPowerFeedsPartialUpdate Method for DcimPowerFeedsPartialUpdate + +Patch a power feed object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power feed. + @return ApiDcimPowerFeedsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsPartialUpdate(ctx context.Context, id int32) ApiDcimPowerFeedsPartialUpdateRequest { + return ApiDcimPowerFeedsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerFeed +func (a *DcimAPIService) DcimPowerFeedsPartialUpdateExecute(r ApiDcimPowerFeedsPartialUpdateRequest) (*PowerFeed, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerFeed + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePowerFeedRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerFeedsRetrieveRequest) Execute() (*PowerFeed, *http.Response, error) { + return r.ApiService.DcimPowerFeedsRetrieveExecute(r) +} + +/* +DcimPowerFeedsRetrieve Method for DcimPowerFeedsRetrieve + +Get a power feed object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power feed. + @return ApiDcimPowerFeedsRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsRetrieve(ctx context.Context, id int32) ApiDcimPowerFeedsRetrieveRequest { + return ApiDcimPowerFeedsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerFeed +func (a *DcimAPIService) DcimPowerFeedsRetrieveExecute(r ApiDcimPowerFeedsRetrieveRequest) (*PowerFeed, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerFeed + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsTraceRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerFeedsTraceRetrieveRequest) Execute() (*PowerFeed, *http.Response, error) { + return r.ApiService.DcimPowerFeedsTraceRetrieveExecute(r) +} + +/* +DcimPowerFeedsTraceRetrieve Method for DcimPowerFeedsTraceRetrieve + +Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power feed. + @return ApiDcimPowerFeedsTraceRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsTraceRetrieve(ctx context.Context, id int32) ApiDcimPowerFeedsTraceRetrieveRequest { + return ApiDcimPowerFeedsTraceRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerFeed +func (a *DcimAPIService) DcimPowerFeedsTraceRetrieveExecute(r ApiDcimPowerFeedsTraceRetrieveRequest) (*PowerFeed, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerFeed + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsTraceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/{id}/trace/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerFeedsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writablePowerFeedRequest *WritablePowerFeedRequest +} + +func (r ApiDcimPowerFeedsUpdateRequest) WritablePowerFeedRequest(writablePowerFeedRequest WritablePowerFeedRequest) ApiDcimPowerFeedsUpdateRequest { + r.writablePowerFeedRequest = &writablePowerFeedRequest + return r +} + +func (r ApiDcimPowerFeedsUpdateRequest) Execute() (*PowerFeed, *http.Response, error) { + return r.ApiService.DcimPowerFeedsUpdateExecute(r) +} + +/* +DcimPowerFeedsUpdate Method for DcimPowerFeedsUpdate + +Put a power feed object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power feed. + @return ApiDcimPowerFeedsUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerFeedsUpdate(ctx context.Context, id int32) ApiDcimPowerFeedsUpdateRequest { + return ApiDcimPowerFeedsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerFeed +func (a *DcimAPIService) DcimPowerFeedsUpdateExecute(r ApiDcimPowerFeedsUpdateRequest) (*PowerFeed, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerFeed + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerFeedsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-feeds/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerFeedRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerFeedRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerFeedRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerOutletTemplateRequest *[]PowerOutletTemplateRequest +} + +func (r ApiDcimPowerOutletTemplatesBulkDestroyRequest) PowerOutletTemplateRequest(powerOutletTemplateRequest []PowerOutletTemplateRequest) ApiDcimPowerOutletTemplatesBulkDestroyRequest { + r.powerOutletTemplateRequest = &powerOutletTemplateRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesBulkDestroyExecute(r) +} + +/* +DcimPowerOutletTemplatesBulkDestroy Method for DcimPowerOutletTemplatesBulkDestroy + +Delete a list of power outlet template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesBulkDestroy(ctx context.Context) ApiDcimPowerOutletTemplatesBulkDestroyRequest { + return ApiDcimPowerOutletTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerOutletTemplatesBulkDestroyExecute(r ApiDcimPowerOutletTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerOutletTemplateRequest == nil { + return nil, reportError("powerOutletTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerOutletTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerOutletTemplateRequest *[]PowerOutletTemplateRequest +} + +func (r ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest) PowerOutletTemplateRequest(powerOutletTemplateRequest []PowerOutletTemplateRequest) ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest { + r.powerOutletTemplateRequest = &powerOutletTemplateRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest) Execute() ([]PowerOutletTemplate, *http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimPowerOutletTemplatesBulkPartialUpdate Method for DcimPowerOutletTemplatesBulkPartialUpdate + +Patch a list of power outlet template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest { + return ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerOutletTemplate +func (a *DcimAPIService) DcimPowerOutletTemplatesBulkPartialUpdateExecute(r ApiDcimPowerOutletTemplatesBulkPartialUpdateRequest) ([]PowerOutletTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerOutletTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerOutletTemplateRequest == nil { + return localVarReturnValue, nil, reportError("powerOutletTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerOutletTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerOutletTemplateRequest *[]PowerOutletTemplateRequest +} + +func (r ApiDcimPowerOutletTemplatesBulkUpdateRequest) PowerOutletTemplateRequest(powerOutletTemplateRequest []PowerOutletTemplateRequest) ApiDcimPowerOutletTemplatesBulkUpdateRequest { + r.powerOutletTemplateRequest = &powerOutletTemplateRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesBulkUpdateRequest) Execute() ([]PowerOutletTemplate, *http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesBulkUpdateExecute(r) +} + +/* +DcimPowerOutletTemplatesBulkUpdate Method for DcimPowerOutletTemplatesBulkUpdate + +Put a list of power outlet template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesBulkUpdate(ctx context.Context) ApiDcimPowerOutletTemplatesBulkUpdateRequest { + return ApiDcimPowerOutletTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerOutletTemplate +func (a *DcimAPIService) DcimPowerOutletTemplatesBulkUpdateExecute(r ApiDcimPowerOutletTemplatesBulkUpdateRequest) ([]PowerOutletTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerOutletTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerOutletTemplateRequest == nil { + return localVarReturnValue, nil, reportError("powerOutletTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerOutletTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writablePowerOutletTemplateRequest *WritablePowerOutletTemplateRequest +} + +func (r ApiDcimPowerOutletTemplatesCreateRequest) WritablePowerOutletTemplateRequest(writablePowerOutletTemplateRequest WritablePowerOutletTemplateRequest) ApiDcimPowerOutletTemplatesCreateRequest { + r.writablePowerOutletTemplateRequest = &writablePowerOutletTemplateRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesCreateRequest) Execute() (*PowerOutletTemplate, *http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesCreateExecute(r) +} + +/* +DcimPowerOutletTemplatesCreate Method for DcimPowerOutletTemplatesCreate + +Post a list of power outlet template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesCreate(ctx context.Context) ApiDcimPowerOutletTemplatesCreateRequest { + return ApiDcimPowerOutletTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PowerOutletTemplate +func (a *DcimAPIService) DcimPowerOutletTemplatesCreateExecute(r ApiDcimPowerOutletTemplatesCreateRequest) (*PowerOutletTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutletTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerOutletTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerOutletTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerOutletTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerOutletTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesDestroyExecute(r) +} + +/* +DcimPowerOutletTemplatesDestroy Method for DcimPowerOutletTemplatesDestroy + +Delete a power outlet template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet template. + @return ApiDcimPowerOutletTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesDestroy(ctx context.Context, id int32) ApiDcimPowerOutletTemplatesDestroyRequest { + return ApiDcimPowerOutletTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerOutletTemplatesDestroyExecute(r ApiDcimPowerOutletTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]*int32 + devicetypeIdN *[]*int32 + feedLeg *[]string + feedLegN *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + moduletypeId *[]*int32 + moduletypeIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + type_ *string + typeN *string + updatedByRequest *string +} + +func (r ApiDcimPowerOutletTemplatesListRequest) Created(created []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimPowerOutletTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) Description(description []string) ApiDcimPowerOutletTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimPowerOutletTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimPowerOutletTemplatesListRequest) DevicetypeId(devicetypeId []*int32) ApiDcimPowerOutletTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimPowerOutletTemplatesListRequest) DevicetypeIdN(devicetypeIdN []*int32) ApiDcimPowerOutletTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +// Phase (for three-phase feeds) +func (r ApiDcimPowerOutletTemplatesListRequest) FeedLeg(feedLeg []string) ApiDcimPowerOutletTemplatesListRequest { + r.feedLeg = &feedLeg + return r +} + +// Phase (for three-phase feeds) +func (r ApiDcimPowerOutletTemplatesListRequest) FeedLegN(feedLegN []string) ApiDcimPowerOutletTemplatesListRequest { + r.feedLegN = &feedLegN + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) Id(id []int32) ApiDcimPowerOutletTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimPowerOutletTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) IdGt(idGt []int32) ApiDcimPowerOutletTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) IdGte(idGte []int32) ApiDcimPowerOutletTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) IdLt(idLt []int32) ApiDcimPowerOutletTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) IdLte(idLte []int32) ApiDcimPowerOutletTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) IdN(idN []int32) ApiDcimPowerOutletTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimPowerOutletTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimPowerOutletTemplatesListRequest) Limit(limit int32) ApiDcimPowerOutletTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimPowerOutletTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module type (ID) +func (r ApiDcimPowerOutletTemplatesListRequest) ModuletypeId(moduletypeId []*int32) ApiDcimPowerOutletTemplatesListRequest { + r.moduletypeId = &moduletypeId + return r +} + +// Module type (ID) +func (r ApiDcimPowerOutletTemplatesListRequest) ModuletypeIdN(moduletypeIdN []*int32) ApiDcimPowerOutletTemplatesListRequest { + r.moduletypeIdN = &moduletypeIdN + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) Name(name []string) ApiDcimPowerOutletTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimPowerOutletTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameIc(nameIc []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameIe(nameIe []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameIew(nameIew []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameN(nameN []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameNic(nameNic []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameNie(nameNie []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimPowerOutletTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimPowerOutletTemplatesListRequest) Offset(offset int32) ApiDcimPowerOutletTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimPowerOutletTemplatesListRequest) Ordering(ordering string) ApiDcimPowerOutletTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimPowerOutletTemplatesListRequest) Q(q string) ApiDcimPowerOutletTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) Type_(type_ string) ApiDcimPowerOutletTemplatesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) TypeN(typeN string) ApiDcimPowerOutletTemplatesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimPowerOutletTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesListRequest) Execute() (*PaginatedPowerOutletTemplateList, *http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesListExecute(r) +} + +/* +DcimPowerOutletTemplatesList Method for DcimPowerOutletTemplatesList + +Get a list of power outlet template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletTemplatesListRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesList(ctx context.Context) ApiDcimPowerOutletTemplatesListRequest { + return ApiDcimPowerOutletTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPowerOutletTemplateList +func (a *DcimAPIService) DcimPowerOutletTemplatesListExecute(r ApiDcimPowerOutletTemplatesListRequest) (*PaginatedPowerOutletTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPowerOutletTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.feedLeg != nil { + t := *r.feedLeg + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg", t, "multi") + } + } + if r.feedLegN != nil { + t := *r.feedLegN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduletypeId != nil { + t := *r.moduletypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", t, "multi") + } + } + if r.moduletypeIdN != nil { + t := *r.moduletypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.typeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", r.typeN, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritablePowerOutletTemplateRequest *PatchedWritablePowerOutletTemplateRequest +} + +func (r ApiDcimPowerOutletTemplatesPartialUpdateRequest) PatchedWritablePowerOutletTemplateRequest(patchedWritablePowerOutletTemplateRequest PatchedWritablePowerOutletTemplateRequest) ApiDcimPowerOutletTemplatesPartialUpdateRequest { + r.patchedWritablePowerOutletTemplateRequest = &patchedWritablePowerOutletTemplateRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesPartialUpdateRequest) Execute() (*PowerOutletTemplate, *http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesPartialUpdateExecute(r) +} + +/* +DcimPowerOutletTemplatesPartialUpdate Method for DcimPowerOutletTemplatesPartialUpdate + +Patch a power outlet template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet template. + @return ApiDcimPowerOutletTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimPowerOutletTemplatesPartialUpdateRequest { + return ApiDcimPowerOutletTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerOutletTemplate +func (a *DcimAPIService) DcimPowerOutletTemplatesPartialUpdateExecute(r ApiDcimPowerOutletTemplatesPartialUpdateRequest) (*PowerOutletTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutletTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePowerOutletTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerOutletTemplatesRetrieveRequest) Execute() (*PowerOutletTemplate, *http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesRetrieveExecute(r) +} + +/* +DcimPowerOutletTemplatesRetrieve Method for DcimPowerOutletTemplatesRetrieve + +Get a power outlet template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet template. + @return ApiDcimPowerOutletTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesRetrieve(ctx context.Context, id int32) ApiDcimPowerOutletTemplatesRetrieveRequest { + return ApiDcimPowerOutletTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerOutletTemplate +func (a *DcimAPIService) DcimPowerOutletTemplatesRetrieveExecute(r ApiDcimPowerOutletTemplatesRetrieveRequest) (*PowerOutletTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutletTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writablePowerOutletTemplateRequest *WritablePowerOutletTemplateRequest +} + +func (r ApiDcimPowerOutletTemplatesUpdateRequest) WritablePowerOutletTemplateRequest(writablePowerOutletTemplateRequest WritablePowerOutletTemplateRequest) ApiDcimPowerOutletTemplatesUpdateRequest { + r.writablePowerOutletTemplateRequest = &writablePowerOutletTemplateRequest + return r +} + +func (r ApiDcimPowerOutletTemplatesUpdateRequest) Execute() (*PowerOutletTemplate, *http.Response, error) { + return r.ApiService.DcimPowerOutletTemplatesUpdateExecute(r) +} + +/* +DcimPowerOutletTemplatesUpdate Method for DcimPowerOutletTemplatesUpdate + +Put a power outlet template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet template. + @return ApiDcimPowerOutletTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletTemplatesUpdate(ctx context.Context, id int32) ApiDcimPowerOutletTemplatesUpdateRequest { + return ApiDcimPowerOutletTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerOutletTemplate +func (a *DcimAPIService) DcimPowerOutletTemplatesUpdateExecute(r ApiDcimPowerOutletTemplatesUpdateRequest) (*PowerOutletTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutletTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlet-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerOutletTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerOutletTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerOutletTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerOutletRequest *[]PowerOutletRequest +} + +func (r ApiDcimPowerOutletsBulkDestroyRequest) PowerOutletRequest(powerOutletRequest []PowerOutletRequest) ApiDcimPowerOutletsBulkDestroyRequest { + r.powerOutletRequest = &powerOutletRequest + return r +} + +func (r ApiDcimPowerOutletsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerOutletsBulkDestroyExecute(r) +} + +/* +DcimPowerOutletsBulkDestroy Method for DcimPowerOutletsBulkDestroy + +Delete a list of power outlet objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsBulkDestroy(ctx context.Context) ApiDcimPowerOutletsBulkDestroyRequest { + return ApiDcimPowerOutletsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerOutletsBulkDestroyExecute(r ApiDcimPowerOutletsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerOutletRequest == nil { + return nil, reportError("powerOutletRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerOutletRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerOutletRequest *[]PowerOutletRequest +} + +func (r ApiDcimPowerOutletsBulkPartialUpdateRequest) PowerOutletRequest(powerOutletRequest []PowerOutletRequest) ApiDcimPowerOutletsBulkPartialUpdateRequest { + r.powerOutletRequest = &powerOutletRequest + return r +} + +func (r ApiDcimPowerOutletsBulkPartialUpdateRequest) Execute() ([]PowerOutlet, *http.Response, error) { + return r.ApiService.DcimPowerOutletsBulkPartialUpdateExecute(r) +} + +/* +DcimPowerOutletsBulkPartialUpdate Method for DcimPowerOutletsBulkPartialUpdate + +Patch a list of power outlet objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsBulkPartialUpdate(ctx context.Context) ApiDcimPowerOutletsBulkPartialUpdateRequest { + return ApiDcimPowerOutletsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerOutlet +func (a *DcimAPIService) DcimPowerOutletsBulkPartialUpdateExecute(r ApiDcimPowerOutletsBulkPartialUpdateRequest) ([]PowerOutlet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerOutlet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerOutletRequest == nil { + return localVarReturnValue, nil, reportError("powerOutletRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerOutletRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerOutletRequest *[]PowerOutletRequest +} + +func (r ApiDcimPowerOutletsBulkUpdateRequest) PowerOutletRequest(powerOutletRequest []PowerOutletRequest) ApiDcimPowerOutletsBulkUpdateRequest { + r.powerOutletRequest = &powerOutletRequest + return r +} + +func (r ApiDcimPowerOutletsBulkUpdateRequest) Execute() ([]PowerOutlet, *http.Response, error) { + return r.ApiService.DcimPowerOutletsBulkUpdateExecute(r) +} + +/* +DcimPowerOutletsBulkUpdate Method for DcimPowerOutletsBulkUpdate + +Put a list of power outlet objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsBulkUpdate(ctx context.Context) ApiDcimPowerOutletsBulkUpdateRequest { + return ApiDcimPowerOutletsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerOutlet +func (a *DcimAPIService) DcimPowerOutletsBulkUpdateExecute(r ApiDcimPowerOutletsBulkUpdateRequest) ([]PowerOutlet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerOutlet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerOutletRequest == nil { + return localVarReturnValue, nil, reportError("powerOutletRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerOutletRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writablePowerOutletRequest *WritablePowerOutletRequest +} + +func (r ApiDcimPowerOutletsCreateRequest) WritablePowerOutletRequest(writablePowerOutletRequest WritablePowerOutletRequest) ApiDcimPowerOutletsCreateRequest { + r.writablePowerOutletRequest = &writablePowerOutletRequest + return r +} + +func (r ApiDcimPowerOutletsCreateRequest) Execute() (*PowerOutlet, *http.Response, error) { + return r.ApiService.DcimPowerOutletsCreateExecute(r) +} + +/* +DcimPowerOutletsCreate Method for DcimPowerOutletsCreate + +Post a list of power outlet objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletsCreateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsCreate(ctx context.Context) ApiDcimPowerOutletsCreateRequest { + return ApiDcimPowerOutletsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PowerOutlet +func (a *DcimAPIService) DcimPowerOutletsCreateExecute(r ApiDcimPowerOutletsCreateRequest) (*PowerOutlet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutlet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerOutletRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerOutletRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerOutletRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerOutletsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerOutletsDestroyExecute(r) +} + +/* +DcimPowerOutletsDestroy Method for DcimPowerOutletsDestroy + +Delete a power outlet object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet. + @return ApiDcimPowerOutletsDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsDestroy(ctx context.Context, id int32) ApiDcimPowerOutletsDestroyRequest { + return ApiDcimPowerOutletsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerOutletsDestroyExecute(r ApiDcimPowerOutletsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableEnd *string + cableEndN *string + cabled *bool + connected *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + feedLeg *[]string + feedLegN *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + moduleId *[]*int32 + moduleIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimPowerOutletsListRequest) CableEnd(cableEnd string) ApiDcimPowerOutletsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimPowerOutletsListRequest) CableEndN(cableEndN string) ApiDcimPowerOutletsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimPowerOutletsListRequest) Cabled(cabled bool) ApiDcimPowerOutletsListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimPowerOutletsListRequest) Connected(connected bool) ApiDcimPowerOutletsListRequest { + r.connected = &connected + return r +} + +func (r ApiDcimPowerOutletsListRequest) Created(created []time.Time) ApiDcimPowerOutletsListRequest { + r.created = &created + return r +} + +func (r ApiDcimPowerOutletsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimPowerOutletsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimPowerOutletsListRequest) CreatedGt(createdGt []time.Time) ApiDcimPowerOutletsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimPowerOutletsListRequest) CreatedGte(createdGte []time.Time) ApiDcimPowerOutletsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimPowerOutletsListRequest) CreatedLt(createdLt []time.Time) ApiDcimPowerOutletsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimPowerOutletsListRequest) CreatedLte(createdLte []time.Time) ApiDcimPowerOutletsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimPowerOutletsListRequest) CreatedN(createdN []time.Time) ApiDcimPowerOutletsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimPowerOutletsListRequest) CreatedByRequest(createdByRequest string) ApiDcimPowerOutletsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimPowerOutletsListRequest) Description(description []string) ApiDcimPowerOutletsListRequest { + r.description = &description + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimPowerOutletsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionIc(descriptionIc []string) ApiDcimPowerOutletsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionIe(descriptionIe []string) ApiDcimPowerOutletsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionIew(descriptionIew []string) ApiDcimPowerOutletsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimPowerOutletsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionN(descriptionN []string) ApiDcimPowerOutletsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionNic(descriptionNic []string) ApiDcimPowerOutletsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionNie(descriptionNie []string) ApiDcimPowerOutletsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimPowerOutletsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimPowerOutletsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimPowerOutletsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimPowerOutletsListRequest) Device(device []*string) ApiDcimPowerOutletsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimPowerOutletsListRequest) DeviceN(deviceN []*string) ApiDcimPowerOutletsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimPowerOutletsListRequest) DeviceId(deviceId []int32) ApiDcimPowerOutletsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimPowerOutletsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimPowerOutletsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimPowerOutletsListRequest) DeviceRole(deviceRole []string) ApiDcimPowerOutletsListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimPowerOutletsListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimPowerOutletsListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimPowerOutletsListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimPowerOutletsListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimPowerOutletsListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimPowerOutletsListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimPowerOutletsListRequest) DeviceType(deviceType []string) ApiDcimPowerOutletsListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimPowerOutletsListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimPowerOutletsListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimPowerOutletsListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimPowerOutletsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimPowerOutletsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimPowerOutletsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +// Phase (for three-phase feeds) +func (r ApiDcimPowerOutletsListRequest) FeedLeg(feedLeg []string) ApiDcimPowerOutletsListRequest { + r.feedLeg = &feedLeg + return r +} + +// Phase (for three-phase feeds) +func (r ApiDcimPowerOutletsListRequest) FeedLegN(feedLegN []string) ApiDcimPowerOutletsListRequest { + r.feedLegN = &feedLegN + return r +} + +func (r ApiDcimPowerOutletsListRequest) Id(id []int32) ApiDcimPowerOutletsListRequest { + r.id = &id + return r +} + +func (r ApiDcimPowerOutletsListRequest) IdEmpty(idEmpty bool) ApiDcimPowerOutletsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimPowerOutletsListRequest) IdGt(idGt []int32) ApiDcimPowerOutletsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimPowerOutletsListRequest) IdGte(idGte []int32) ApiDcimPowerOutletsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimPowerOutletsListRequest) IdLt(idLt []int32) ApiDcimPowerOutletsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimPowerOutletsListRequest) IdLte(idLte []int32) ApiDcimPowerOutletsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimPowerOutletsListRequest) IdN(idN []int32) ApiDcimPowerOutletsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimPowerOutletsListRequest) Label(label []string) ApiDcimPowerOutletsListRequest { + r.label = &label + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelEmpty(labelEmpty bool) ApiDcimPowerOutletsListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelIc(labelIc []string) ApiDcimPowerOutletsListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelIe(labelIe []string) ApiDcimPowerOutletsListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelIew(labelIew []string) ApiDcimPowerOutletsListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelIsw(labelIsw []string) ApiDcimPowerOutletsListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelN(labelN []string) ApiDcimPowerOutletsListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelNic(labelNic []string) ApiDcimPowerOutletsListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelNie(labelNie []string) ApiDcimPowerOutletsListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelNiew(labelNiew []string) ApiDcimPowerOutletsListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimPowerOutletsListRequest) LabelNisw(labelNisw []string) ApiDcimPowerOutletsListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimPowerOutletsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimPowerOutletsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimPowerOutletsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimPowerOutletsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimPowerOutletsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimPowerOutletsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimPowerOutletsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimPowerOutletsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimPowerOutletsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimPowerOutletsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimPowerOutletsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimPowerOutletsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimPowerOutletsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimPowerOutletsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimPowerOutletsListRequest) Limit(limit int32) ApiDcimPowerOutletsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimPowerOutletsListRequest) Location(location []string) ApiDcimPowerOutletsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimPowerOutletsListRequest) LocationN(locationN []string) ApiDcimPowerOutletsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimPowerOutletsListRequest) LocationId(locationId []int32) ApiDcimPowerOutletsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimPowerOutletsListRequest) LocationIdN(locationIdN []int32) ApiDcimPowerOutletsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimPowerOutletsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimPowerOutletsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module (ID) +func (r ApiDcimPowerOutletsListRequest) ModuleId(moduleId []*int32) ApiDcimPowerOutletsListRequest { + r.moduleId = &moduleId + return r +} + +// Module (ID) +func (r ApiDcimPowerOutletsListRequest) ModuleIdN(moduleIdN []*int32) ApiDcimPowerOutletsListRequest { + r.moduleIdN = &moduleIdN + return r +} + +func (r ApiDcimPowerOutletsListRequest) Name(name []string) ApiDcimPowerOutletsListRequest { + r.name = &name + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameEmpty(nameEmpty bool) ApiDcimPowerOutletsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameIc(nameIc []string) ApiDcimPowerOutletsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameIe(nameIe []string) ApiDcimPowerOutletsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameIew(nameIew []string) ApiDcimPowerOutletsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameIsw(nameIsw []string) ApiDcimPowerOutletsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameN(nameN []string) ApiDcimPowerOutletsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameNic(nameNic []string) ApiDcimPowerOutletsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameNie(nameNie []string) ApiDcimPowerOutletsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameNiew(nameNiew []string) ApiDcimPowerOutletsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimPowerOutletsListRequest) NameNisw(nameNisw []string) ApiDcimPowerOutletsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimPowerOutletsListRequest) Occupied(occupied bool) ApiDcimPowerOutletsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimPowerOutletsListRequest) Offset(offset int32) ApiDcimPowerOutletsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimPowerOutletsListRequest) Ordering(ordering string) ApiDcimPowerOutletsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimPowerOutletsListRequest) Q(q string) ApiDcimPowerOutletsListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimPowerOutletsListRequest) Rack(rack []string) ApiDcimPowerOutletsListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimPowerOutletsListRequest) RackN(rackN []string) ApiDcimPowerOutletsListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimPowerOutletsListRequest) RackId(rackId []int32) ApiDcimPowerOutletsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimPowerOutletsListRequest) RackIdN(rackIdN []int32) ApiDcimPowerOutletsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimPowerOutletsListRequest) Region(region []int32) ApiDcimPowerOutletsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimPowerOutletsListRequest) RegionN(regionN []int32) ApiDcimPowerOutletsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimPowerOutletsListRequest) RegionId(regionId []int32) ApiDcimPowerOutletsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimPowerOutletsListRequest) RegionIdN(regionIdN []int32) ApiDcimPowerOutletsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimPowerOutletsListRequest) Role(role []string) ApiDcimPowerOutletsListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimPowerOutletsListRequest) RoleN(roleN []string) ApiDcimPowerOutletsListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimPowerOutletsListRequest) RoleId(roleId []int32) ApiDcimPowerOutletsListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimPowerOutletsListRequest) RoleIdN(roleIdN []int32) ApiDcimPowerOutletsListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimPowerOutletsListRequest) Site(site []string) ApiDcimPowerOutletsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimPowerOutletsListRequest) SiteN(siteN []string) ApiDcimPowerOutletsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimPowerOutletsListRequest) SiteGroup(siteGroup []int32) ApiDcimPowerOutletsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimPowerOutletsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimPowerOutletsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimPowerOutletsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimPowerOutletsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimPowerOutletsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimPowerOutletsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimPowerOutletsListRequest) SiteId(siteId []int32) ApiDcimPowerOutletsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimPowerOutletsListRequest) SiteIdN(siteIdN []int32) ApiDcimPowerOutletsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimPowerOutletsListRequest) Tag(tag []string) ApiDcimPowerOutletsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimPowerOutletsListRequest) TagN(tagN []string) ApiDcimPowerOutletsListRequest { + r.tagN = &tagN + return r +} + +// Physical port type +func (r ApiDcimPowerOutletsListRequest) Type_(type_ []string) ApiDcimPowerOutletsListRequest { + r.type_ = &type_ + return r +} + +// Physical port type +func (r ApiDcimPowerOutletsListRequest) TypeN(typeN []string) ApiDcimPowerOutletsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimPowerOutletsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimPowerOutletsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimPowerOutletsListRequest) VirtualChassis(virtualChassis []string) ApiDcimPowerOutletsListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimPowerOutletsListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimPowerOutletsListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimPowerOutletsListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimPowerOutletsListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimPowerOutletsListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimPowerOutletsListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimPowerOutletsListRequest) Execute() (*PaginatedPowerOutletList, *http.Response, error) { + return r.ApiService.DcimPowerOutletsListExecute(r) +} + +/* +DcimPowerOutletsList Method for DcimPowerOutletsList + +Get a list of power outlet objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerOutletsListRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsList(ctx context.Context) ApiDcimPowerOutletsListRequest { + return ApiDcimPowerOutletsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPowerOutletList +func (a *DcimAPIService) DcimPowerOutletsListExecute(r ApiDcimPowerOutletsListRequest) (*PaginatedPowerOutletList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPowerOutletList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.connected != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "connected", r.connected, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.feedLeg != nil { + t := *r.feedLeg + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg", t, "multi") + } + } + if r.feedLegN != nil { + t := *r.feedLegN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "feed_leg__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleId != nil { + t := *r.moduleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", t, "multi") + } + } + if r.moduleIdN != nil { + t := *r.moduleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritablePowerOutletRequest *PatchedWritablePowerOutletRequest +} + +func (r ApiDcimPowerOutletsPartialUpdateRequest) PatchedWritablePowerOutletRequest(patchedWritablePowerOutletRequest PatchedWritablePowerOutletRequest) ApiDcimPowerOutletsPartialUpdateRequest { + r.patchedWritablePowerOutletRequest = &patchedWritablePowerOutletRequest + return r +} + +func (r ApiDcimPowerOutletsPartialUpdateRequest) Execute() (*PowerOutlet, *http.Response, error) { + return r.ApiService.DcimPowerOutletsPartialUpdateExecute(r) +} + +/* +DcimPowerOutletsPartialUpdate Method for DcimPowerOutletsPartialUpdate + +Patch a power outlet object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet. + @return ApiDcimPowerOutletsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsPartialUpdate(ctx context.Context, id int32) ApiDcimPowerOutletsPartialUpdateRequest { + return ApiDcimPowerOutletsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerOutlet +func (a *DcimAPIService) DcimPowerOutletsPartialUpdateExecute(r ApiDcimPowerOutletsPartialUpdateRequest) (*PowerOutlet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutlet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePowerOutletRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerOutletsRetrieveRequest) Execute() (*PowerOutlet, *http.Response, error) { + return r.ApiService.DcimPowerOutletsRetrieveExecute(r) +} + +/* +DcimPowerOutletsRetrieve Method for DcimPowerOutletsRetrieve + +Get a power outlet object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet. + @return ApiDcimPowerOutletsRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsRetrieve(ctx context.Context, id int32) ApiDcimPowerOutletsRetrieveRequest { + return ApiDcimPowerOutletsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerOutlet +func (a *DcimAPIService) DcimPowerOutletsRetrieveExecute(r ApiDcimPowerOutletsRetrieveRequest) (*PowerOutlet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutlet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsTraceRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerOutletsTraceRetrieveRequest) Execute() (*PowerOutlet, *http.Response, error) { + return r.ApiService.DcimPowerOutletsTraceRetrieveExecute(r) +} + +/* +DcimPowerOutletsTraceRetrieve Method for DcimPowerOutletsTraceRetrieve + +Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet. + @return ApiDcimPowerOutletsTraceRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsTraceRetrieve(ctx context.Context, id int32) ApiDcimPowerOutletsTraceRetrieveRequest { + return ApiDcimPowerOutletsTraceRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerOutlet +func (a *DcimAPIService) DcimPowerOutletsTraceRetrieveExecute(r ApiDcimPowerOutletsTraceRetrieveRequest) (*PowerOutlet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutlet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsTraceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/{id}/trace/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerOutletsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writablePowerOutletRequest *WritablePowerOutletRequest +} + +func (r ApiDcimPowerOutletsUpdateRequest) WritablePowerOutletRequest(writablePowerOutletRequest WritablePowerOutletRequest) ApiDcimPowerOutletsUpdateRequest { + r.writablePowerOutletRequest = &writablePowerOutletRequest + return r +} + +func (r ApiDcimPowerOutletsUpdateRequest) Execute() (*PowerOutlet, *http.Response, error) { + return r.ApiService.DcimPowerOutletsUpdateExecute(r) +} + +/* +DcimPowerOutletsUpdate Method for DcimPowerOutletsUpdate + +Put a power outlet object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power outlet. + @return ApiDcimPowerOutletsUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerOutletsUpdate(ctx context.Context, id int32) ApiDcimPowerOutletsUpdateRequest { + return ApiDcimPowerOutletsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerOutlet +func (a *DcimAPIService) DcimPowerOutletsUpdateExecute(r ApiDcimPowerOutletsUpdateRequest) (*PowerOutlet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerOutlet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerOutletsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-outlets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerOutletRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerOutletRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerOutletRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPanelRequest *[]PowerPanelRequest +} + +func (r ApiDcimPowerPanelsBulkDestroyRequest) PowerPanelRequest(powerPanelRequest []PowerPanelRequest) ApiDcimPowerPanelsBulkDestroyRequest { + r.powerPanelRequest = &powerPanelRequest + return r +} + +func (r ApiDcimPowerPanelsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerPanelsBulkDestroyExecute(r) +} + +/* +DcimPowerPanelsBulkDestroy Method for DcimPowerPanelsBulkDestroy + +Delete a list of power panel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPanelsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsBulkDestroy(ctx context.Context) ApiDcimPowerPanelsBulkDestroyRequest { + return ApiDcimPowerPanelsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerPanelsBulkDestroyExecute(r ApiDcimPowerPanelsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPanelRequest == nil { + return nil, reportError("powerPanelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPanelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPanelRequest *[]PowerPanelRequest +} + +func (r ApiDcimPowerPanelsBulkPartialUpdateRequest) PowerPanelRequest(powerPanelRequest []PowerPanelRequest) ApiDcimPowerPanelsBulkPartialUpdateRequest { + r.powerPanelRequest = &powerPanelRequest + return r +} + +func (r ApiDcimPowerPanelsBulkPartialUpdateRequest) Execute() ([]PowerPanel, *http.Response, error) { + return r.ApiService.DcimPowerPanelsBulkPartialUpdateExecute(r) +} + +/* +DcimPowerPanelsBulkPartialUpdate Method for DcimPowerPanelsBulkPartialUpdate + +Patch a list of power panel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPanelsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsBulkPartialUpdate(ctx context.Context) ApiDcimPowerPanelsBulkPartialUpdateRequest { + return ApiDcimPowerPanelsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerPanel +func (a *DcimAPIService) DcimPowerPanelsBulkPartialUpdateExecute(r ApiDcimPowerPanelsBulkPartialUpdateRequest) ([]PowerPanel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerPanel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPanelRequest == nil { + return localVarReturnValue, nil, reportError("powerPanelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPanelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPanelRequest *[]PowerPanelRequest +} + +func (r ApiDcimPowerPanelsBulkUpdateRequest) PowerPanelRequest(powerPanelRequest []PowerPanelRequest) ApiDcimPowerPanelsBulkUpdateRequest { + r.powerPanelRequest = &powerPanelRequest + return r +} + +func (r ApiDcimPowerPanelsBulkUpdateRequest) Execute() ([]PowerPanel, *http.Response, error) { + return r.ApiService.DcimPowerPanelsBulkUpdateExecute(r) +} + +/* +DcimPowerPanelsBulkUpdate Method for DcimPowerPanelsBulkUpdate + +Put a list of power panel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPanelsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsBulkUpdate(ctx context.Context) ApiDcimPowerPanelsBulkUpdateRequest { + return ApiDcimPowerPanelsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerPanel +func (a *DcimAPIService) DcimPowerPanelsBulkUpdateExecute(r ApiDcimPowerPanelsBulkUpdateRequest) ([]PowerPanel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerPanel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPanelRequest == nil { + return localVarReturnValue, nil, reportError("powerPanelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPanelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writablePowerPanelRequest *WritablePowerPanelRequest +} + +func (r ApiDcimPowerPanelsCreateRequest) WritablePowerPanelRequest(writablePowerPanelRequest WritablePowerPanelRequest) ApiDcimPowerPanelsCreateRequest { + r.writablePowerPanelRequest = &writablePowerPanelRequest + return r +} + +func (r ApiDcimPowerPanelsCreateRequest) Execute() (*PowerPanel, *http.Response, error) { + return r.ApiService.DcimPowerPanelsCreateExecute(r) +} + +/* +DcimPowerPanelsCreate Method for DcimPowerPanelsCreate + +Post a list of power panel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPanelsCreateRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsCreate(ctx context.Context) ApiDcimPowerPanelsCreateRequest { + return ApiDcimPowerPanelsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PowerPanel +func (a *DcimAPIService) DcimPowerPanelsCreateExecute(r ApiDcimPowerPanelsCreateRequest) (*PowerPanel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPanel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerPanelRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerPanelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerPanelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerPanelsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerPanelsDestroyExecute(r) +} + +/* +DcimPowerPanelsDestroy Method for DcimPowerPanelsDestroy + +Delete a power panel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power panel. + @return ApiDcimPowerPanelsDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsDestroy(ctx context.Context, id int32) ApiDcimPowerPanelsDestroyRequest { + return ApiDcimPowerPanelsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerPanelsDestroyExecute(r ApiDcimPowerPanelsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Contact +func (r ApiDcimPowerPanelsListRequest) Contact(contact []int32) ApiDcimPowerPanelsListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimPowerPanelsListRequest) ContactN(contactN []int32) ApiDcimPowerPanelsListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimPowerPanelsListRequest) ContactGroup(contactGroup []int32) ApiDcimPowerPanelsListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimPowerPanelsListRequest) ContactGroupN(contactGroupN []int32) ApiDcimPowerPanelsListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimPowerPanelsListRequest) ContactRole(contactRole []int32) ApiDcimPowerPanelsListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimPowerPanelsListRequest) ContactRoleN(contactRoleN []int32) ApiDcimPowerPanelsListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimPowerPanelsListRequest) Created(created []time.Time) ApiDcimPowerPanelsListRequest { + r.created = &created + return r +} + +func (r ApiDcimPowerPanelsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimPowerPanelsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimPowerPanelsListRequest) CreatedGt(createdGt []time.Time) ApiDcimPowerPanelsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimPowerPanelsListRequest) CreatedGte(createdGte []time.Time) ApiDcimPowerPanelsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimPowerPanelsListRequest) CreatedLt(createdLt []time.Time) ApiDcimPowerPanelsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimPowerPanelsListRequest) CreatedLte(createdLte []time.Time) ApiDcimPowerPanelsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimPowerPanelsListRequest) CreatedN(createdN []time.Time) ApiDcimPowerPanelsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimPowerPanelsListRequest) CreatedByRequest(createdByRequest string) ApiDcimPowerPanelsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimPowerPanelsListRequest) Description(description []string) ApiDcimPowerPanelsListRequest { + r.description = &description + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimPowerPanelsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionIc(descriptionIc []string) ApiDcimPowerPanelsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionIe(descriptionIe []string) ApiDcimPowerPanelsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionIew(descriptionIew []string) ApiDcimPowerPanelsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimPowerPanelsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionN(descriptionN []string) ApiDcimPowerPanelsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionNic(descriptionNic []string) ApiDcimPowerPanelsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionNie(descriptionNie []string) ApiDcimPowerPanelsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimPowerPanelsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimPowerPanelsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimPowerPanelsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimPowerPanelsListRequest) Id(id []int32) ApiDcimPowerPanelsListRequest { + r.id = &id + return r +} + +func (r ApiDcimPowerPanelsListRequest) IdEmpty(idEmpty bool) ApiDcimPowerPanelsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimPowerPanelsListRequest) IdGt(idGt []int32) ApiDcimPowerPanelsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimPowerPanelsListRequest) IdGte(idGte []int32) ApiDcimPowerPanelsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimPowerPanelsListRequest) IdLt(idLt []int32) ApiDcimPowerPanelsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimPowerPanelsListRequest) IdLte(idLte []int32) ApiDcimPowerPanelsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimPowerPanelsListRequest) IdN(idN []int32) ApiDcimPowerPanelsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimPowerPanelsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimPowerPanelsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimPowerPanelsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimPowerPanelsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimPowerPanelsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimPowerPanelsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimPowerPanelsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimPowerPanelsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimPowerPanelsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimPowerPanelsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimPowerPanelsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimPowerPanelsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimPowerPanelsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimPowerPanelsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimPowerPanelsListRequest) Limit(limit int32) ApiDcimPowerPanelsListRequest { + r.limit = &limit + return r +} + +// Location (ID) +func (r ApiDcimPowerPanelsListRequest) LocationId(locationId []int32) ApiDcimPowerPanelsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimPowerPanelsListRequest) LocationIdN(locationIdN []int32) ApiDcimPowerPanelsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimPowerPanelsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimPowerPanelsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimPowerPanelsListRequest) Name(name []string) ApiDcimPowerPanelsListRequest { + r.name = &name + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameEmpty(nameEmpty bool) ApiDcimPowerPanelsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameIc(nameIc []string) ApiDcimPowerPanelsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameIe(nameIe []string) ApiDcimPowerPanelsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameIew(nameIew []string) ApiDcimPowerPanelsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameIsw(nameIsw []string) ApiDcimPowerPanelsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameN(nameN []string) ApiDcimPowerPanelsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameNic(nameNic []string) ApiDcimPowerPanelsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameNie(nameNie []string) ApiDcimPowerPanelsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameNiew(nameNiew []string) ApiDcimPowerPanelsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimPowerPanelsListRequest) NameNisw(nameNisw []string) ApiDcimPowerPanelsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimPowerPanelsListRequest) Offset(offset int32) ApiDcimPowerPanelsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimPowerPanelsListRequest) Ordering(ordering string) ApiDcimPowerPanelsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimPowerPanelsListRequest) Q(q string) ApiDcimPowerPanelsListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiDcimPowerPanelsListRequest) Region(region []int32) ApiDcimPowerPanelsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimPowerPanelsListRequest) RegionN(regionN []int32) ApiDcimPowerPanelsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimPowerPanelsListRequest) RegionId(regionId []int32) ApiDcimPowerPanelsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimPowerPanelsListRequest) RegionIdN(regionIdN []int32) ApiDcimPowerPanelsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site name (slug) +func (r ApiDcimPowerPanelsListRequest) Site(site []string) ApiDcimPowerPanelsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimPowerPanelsListRequest) SiteN(siteN []string) ApiDcimPowerPanelsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimPowerPanelsListRequest) SiteGroup(siteGroup []int32) ApiDcimPowerPanelsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimPowerPanelsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimPowerPanelsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimPowerPanelsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimPowerPanelsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimPowerPanelsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimPowerPanelsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimPowerPanelsListRequest) SiteId(siteId []int32) ApiDcimPowerPanelsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimPowerPanelsListRequest) SiteIdN(siteIdN []int32) ApiDcimPowerPanelsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimPowerPanelsListRequest) Tag(tag []string) ApiDcimPowerPanelsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimPowerPanelsListRequest) TagN(tagN []string) ApiDcimPowerPanelsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimPowerPanelsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimPowerPanelsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimPowerPanelsListRequest) Execute() (*PaginatedPowerPanelList, *http.Response, error) { + return r.ApiService.DcimPowerPanelsListExecute(r) +} + +/* +DcimPowerPanelsList Method for DcimPowerPanelsList + +Get a list of power panel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPanelsListRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsList(ctx context.Context) ApiDcimPowerPanelsListRequest { + return ApiDcimPowerPanelsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPowerPanelList +func (a *DcimAPIService) DcimPowerPanelsListExecute(r ApiDcimPowerPanelsListRequest) (*PaginatedPowerPanelList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPowerPanelList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritablePowerPanelRequest *PatchedWritablePowerPanelRequest +} + +func (r ApiDcimPowerPanelsPartialUpdateRequest) PatchedWritablePowerPanelRequest(patchedWritablePowerPanelRequest PatchedWritablePowerPanelRequest) ApiDcimPowerPanelsPartialUpdateRequest { + r.patchedWritablePowerPanelRequest = &patchedWritablePowerPanelRequest + return r +} + +func (r ApiDcimPowerPanelsPartialUpdateRequest) Execute() (*PowerPanel, *http.Response, error) { + return r.ApiService.DcimPowerPanelsPartialUpdateExecute(r) +} + +/* +DcimPowerPanelsPartialUpdate Method for DcimPowerPanelsPartialUpdate + +Patch a power panel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power panel. + @return ApiDcimPowerPanelsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsPartialUpdate(ctx context.Context, id int32) ApiDcimPowerPanelsPartialUpdateRequest { + return ApiDcimPowerPanelsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPanel +func (a *DcimAPIService) DcimPowerPanelsPartialUpdateExecute(r ApiDcimPowerPanelsPartialUpdateRequest) (*PowerPanel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPanel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePowerPanelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerPanelsRetrieveRequest) Execute() (*PowerPanel, *http.Response, error) { + return r.ApiService.DcimPowerPanelsRetrieveExecute(r) +} + +/* +DcimPowerPanelsRetrieve Method for DcimPowerPanelsRetrieve + +Get a power panel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power panel. + @return ApiDcimPowerPanelsRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsRetrieve(ctx context.Context, id int32) ApiDcimPowerPanelsRetrieveRequest { + return ApiDcimPowerPanelsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPanel +func (a *DcimAPIService) DcimPowerPanelsRetrieveExecute(r ApiDcimPowerPanelsRetrieveRequest) (*PowerPanel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPanel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPanelsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writablePowerPanelRequest *WritablePowerPanelRequest +} + +func (r ApiDcimPowerPanelsUpdateRequest) WritablePowerPanelRequest(writablePowerPanelRequest WritablePowerPanelRequest) ApiDcimPowerPanelsUpdateRequest { + r.writablePowerPanelRequest = &writablePowerPanelRequest + return r +} + +func (r ApiDcimPowerPanelsUpdateRequest) Execute() (*PowerPanel, *http.Response, error) { + return r.ApiService.DcimPowerPanelsUpdateExecute(r) +} + +/* +DcimPowerPanelsUpdate Method for DcimPowerPanelsUpdate + +Put a power panel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power panel. + @return ApiDcimPowerPanelsUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPanelsUpdate(ctx context.Context, id int32) ApiDcimPowerPanelsUpdateRequest { + return ApiDcimPowerPanelsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPanel +func (a *DcimAPIService) DcimPowerPanelsUpdateExecute(r ApiDcimPowerPanelsUpdateRequest) (*PowerPanel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPanel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPanelsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-panels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerPanelRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerPanelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerPanelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPortTemplateRequest *[]PowerPortTemplateRequest +} + +func (r ApiDcimPowerPortTemplatesBulkDestroyRequest) PowerPortTemplateRequest(powerPortTemplateRequest []PowerPortTemplateRequest) ApiDcimPowerPortTemplatesBulkDestroyRequest { + r.powerPortTemplateRequest = &powerPortTemplateRequest + return r +} + +func (r ApiDcimPowerPortTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesBulkDestroyExecute(r) +} + +/* +DcimPowerPortTemplatesBulkDestroy Method for DcimPowerPortTemplatesBulkDestroy + +Delete a list of power port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesBulkDestroy(ctx context.Context) ApiDcimPowerPortTemplatesBulkDestroyRequest { + return ApiDcimPowerPortTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerPortTemplatesBulkDestroyExecute(r ApiDcimPowerPortTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPortTemplateRequest == nil { + return nil, reportError("powerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPortTemplateRequest *[]PowerPortTemplateRequest +} + +func (r ApiDcimPowerPortTemplatesBulkPartialUpdateRequest) PowerPortTemplateRequest(powerPortTemplateRequest []PowerPortTemplateRequest) ApiDcimPowerPortTemplatesBulkPartialUpdateRequest { + r.powerPortTemplateRequest = &powerPortTemplateRequest + return r +} + +func (r ApiDcimPowerPortTemplatesBulkPartialUpdateRequest) Execute() ([]PowerPortTemplate, *http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimPowerPortTemplatesBulkPartialUpdate Method for DcimPowerPortTemplatesBulkPartialUpdate + +Patch a list of power port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimPowerPortTemplatesBulkPartialUpdateRequest { + return ApiDcimPowerPortTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerPortTemplate +func (a *DcimAPIService) DcimPowerPortTemplatesBulkPartialUpdateExecute(r ApiDcimPowerPortTemplatesBulkPartialUpdateRequest) ([]PowerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("powerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPortTemplateRequest *[]PowerPortTemplateRequest +} + +func (r ApiDcimPowerPortTemplatesBulkUpdateRequest) PowerPortTemplateRequest(powerPortTemplateRequest []PowerPortTemplateRequest) ApiDcimPowerPortTemplatesBulkUpdateRequest { + r.powerPortTemplateRequest = &powerPortTemplateRequest + return r +} + +func (r ApiDcimPowerPortTemplatesBulkUpdateRequest) Execute() ([]PowerPortTemplate, *http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesBulkUpdateExecute(r) +} + +/* +DcimPowerPortTemplatesBulkUpdate Method for DcimPowerPortTemplatesBulkUpdate + +Put a list of power port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesBulkUpdate(ctx context.Context) ApiDcimPowerPortTemplatesBulkUpdateRequest { + return ApiDcimPowerPortTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerPortTemplate +func (a *DcimAPIService) DcimPowerPortTemplatesBulkUpdateExecute(r ApiDcimPowerPortTemplatesBulkUpdateRequest) ([]PowerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("powerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writablePowerPortTemplateRequest *WritablePowerPortTemplateRequest +} + +func (r ApiDcimPowerPortTemplatesCreateRequest) WritablePowerPortTemplateRequest(writablePowerPortTemplateRequest WritablePowerPortTemplateRequest) ApiDcimPowerPortTemplatesCreateRequest { + r.writablePowerPortTemplateRequest = &writablePowerPortTemplateRequest + return r +} + +func (r ApiDcimPowerPortTemplatesCreateRequest) Execute() (*PowerPortTemplate, *http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesCreateExecute(r) +} + +/* +DcimPowerPortTemplatesCreate Method for DcimPowerPortTemplatesCreate + +Post a list of power port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesCreate(ctx context.Context) ApiDcimPowerPortTemplatesCreateRequest { + return ApiDcimPowerPortTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PowerPortTemplate +func (a *DcimAPIService) DcimPowerPortTemplatesCreateExecute(r ApiDcimPowerPortTemplatesCreateRequest) (*PowerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerPortTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesDestroyExecute(r) +} + +/* +DcimPowerPortTemplatesDestroy Method for DcimPowerPortTemplatesDestroy + +Delete a power port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port template. + @return ApiDcimPowerPortTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesDestroy(ctx context.Context, id int32) ApiDcimPowerPortTemplatesDestroyRequest { + return ApiDcimPowerPortTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerPortTemplatesDestroyExecute(r ApiDcimPowerPortTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + allocatedDraw *[]int32 + allocatedDrawEmpty *bool + allocatedDrawGt *[]int32 + allocatedDrawGte *[]int32 + allocatedDrawLt *[]int32 + allocatedDrawLte *[]int32 + allocatedDrawN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]*int32 + devicetypeIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + maximumDraw *[]int32 + maximumDrawEmpty *bool + maximumDrawGt *[]int32 + maximumDrawGte *[]int32 + maximumDrawLt *[]int32 + maximumDrawLte *[]int32 + maximumDrawN *[]int32 + modifiedByRequest *string + moduletypeId *[]*int32 + moduletypeIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + type_ *string + typeN *string + updatedByRequest *string +} + +func (r ApiDcimPowerPortTemplatesListRequest) AllocatedDraw(allocatedDraw []int32) ApiDcimPowerPortTemplatesListRequest { + r.allocatedDraw = &allocatedDraw + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) AllocatedDrawEmpty(allocatedDrawEmpty bool) ApiDcimPowerPortTemplatesListRequest { + r.allocatedDrawEmpty = &allocatedDrawEmpty + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) AllocatedDrawGt(allocatedDrawGt []int32) ApiDcimPowerPortTemplatesListRequest { + r.allocatedDrawGt = &allocatedDrawGt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) AllocatedDrawGte(allocatedDrawGte []int32) ApiDcimPowerPortTemplatesListRequest { + r.allocatedDrawGte = &allocatedDrawGte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) AllocatedDrawLt(allocatedDrawLt []int32) ApiDcimPowerPortTemplatesListRequest { + r.allocatedDrawLt = &allocatedDrawLt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) AllocatedDrawLte(allocatedDrawLte []int32) ApiDcimPowerPortTemplatesListRequest { + r.allocatedDrawLte = &allocatedDrawLte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) AllocatedDrawN(allocatedDrawN []int32) ApiDcimPowerPortTemplatesListRequest { + r.allocatedDrawN = &allocatedDrawN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) Created(created []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimPowerPortTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) Description(description []string) ApiDcimPowerPortTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimPowerPortTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimPowerPortTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimPowerPortTemplatesListRequest) DevicetypeId(devicetypeId []*int32) ApiDcimPowerPortTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimPowerPortTemplatesListRequest) DevicetypeIdN(devicetypeIdN []*int32) ApiDcimPowerPortTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) Id(id []int32) ApiDcimPowerPortTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimPowerPortTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) IdGt(idGt []int32) ApiDcimPowerPortTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) IdGte(idGte []int32) ApiDcimPowerPortTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) IdLt(idLt []int32) ApiDcimPowerPortTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) IdLte(idLte []int32) ApiDcimPowerPortTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) IdN(idN []int32) ApiDcimPowerPortTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimPowerPortTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimPowerPortTemplatesListRequest) Limit(limit int32) ApiDcimPowerPortTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) MaximumDraw(maximumDraw []int32) ApiDcimPowerPortTemplatesListRequest { + r.maximumDraw = &maximumDraw + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) MaximumDrawEmpty(maximumDrawEmpty bool) ApiDcimPowerPortTemplatesListRequest { + r.maximumDrawEmpty = &maximumDrawEmpty + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) MaximumDrawGt(maximumDrawGt []int32) ApiDcimPowerPortTemplatesListRequest { + r.maximumDrawGt = &maximumDrawGt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) MaximumDrawGte(maximumDrawGte []int32) ApiDcimPowerPortTemplatesListRequest { + r.maximumDrawGte = &maximumDrawGte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) MaximumDrawLt(maximumDrawLt []int32) ApiDcimPowerPortTemplatesListRequest { + r.maximumDrawLt = &maximumDrawLt + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) MaximumDrawLte(maximumDrawLte []int32) ApiDcimPowerPortTemplatesListRequest { + r.maximumDrawLte = &maximumDrawLte + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) MaximumDrawN(maximumDrawN []int32) ApiDcimPowerPortTemplatesListRequest { + r.maximumDrawN = &maximumDrawN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimPowerPortTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module type (ID) +func (r ApiDcimPowerPortTemplatesListRequest) ModuletypeId(moduletypeId []*int32) ApiDcimPowerPortTemplatesListRequest { + r.moduletypeId = &moduletypeId + return r +} + +// Module type (ID) +func (r ApiDcimPowerPortTemplatesListRequest) ModuletypeIdN(moduletypeIdN []*int32) ApiDcimPowerPortTemplatesListRequest { + r.moduletypeIdN = &moduletypeIdN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) Name(name []string) ApiDcimPowerPortTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimPowerPortTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameIc(nameIc []string) ApiDcimPowerPortTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameIe(nameIe []string) ApiDcimPowerPortTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameIew(nameIew []string) ApiDcimPowerPortTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimPowerPortTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameN(nameN []string) ApiDcimPowerPortTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameNic(nameNic []string) ApiDcimPowerPortTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameNie(nameNie []string) ApiDcimPowerPortTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimPowerPortTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimPowerPortTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimPowerPortTemplatesListRequest) Offset(offset int32) ApiDcimPowerPortTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimPowerPortTemplatesListRequest) Ordering(ordering string) ApiDcimPowerPortTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimPowerPortTemplatesListRequest) Q(q string) ApiDcimPowerPortTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) Type_(type_ string) ApiDcimPowerPortTemplatesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) TypeN(typeN string) ApiDcimPowerPortTemplatesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimPowerPortTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimPowerPortTemplatesListRequest) Execute() (*PaginatedPowerPortTemplateList, *http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesListExecute(r) +} + +/* +DcimPowerPortTemplatesList Method for DcimPowerPortTemplatesList + +Get a list of power port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortTemplatesListRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesList(ctx context.Context) ApiDcimPowerPortTemplatesListRequest { + return ApiDcimPowerPortTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPowerPortTemplateList +func (a *DcimAPIService) DcimPowerPortTemplatesListExecute(r ApiDcimPowerPortTemplatesListRequest) (*PaginatedPowerPortTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPowerPortTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.allocatedDraw != nil { + t := *r.allocatedDraw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw", t, "multi") + } + } + if r.allocatedDrawEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__empty", r.allocatedDrawEmpty, "") + } + if r.allocatedDrawGt != nil { + t := *r.allocatedDrawGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gt", t, "multi") + } + } + if r.allocatedDrawGte != nil { + t := *r.allocatedDrawGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gte", t, "multi") + } + } + if r.allocatedDrawLt != nil { + t := *r.allocatedDrawLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lt", t, "multi") + } + } + if r.allocatedDrawLte != nil { + t := *r.allocatedDrawLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lte", t, "multi") + } + } + if r.allocatedDrawN != nil { + t := *r.allocatedDrawN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.maximumDraw != nil { + t := *r.maximumDraw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw", t, "multi") + } + } + if r.maximumDrawEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__empty", r.maximumDrawEmpty, "") + } + if r.maximumDrawGt != nil { + t := *r.maximumDrawGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gt", t, "multi") + } + } + if r.maximumDrawGte != nil { + t := *r.maximumDrawGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gte", t, "multi") + } + } + if r.maximumDrawLt != nil { + t := *r.maximumDrawLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lt", t, "multi") + } + } + if r.maximumDrawLte != nil { + t := *r.maximumDrawLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lte", t, "multi") + } + } + if r.maximumDrawN != nil { + t := *r.maximumDrawN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduletypeId != nil { + t := *r.moduletypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", t, "multi") + } + } + if r.moduletypeIdN != nil { + t := *r.moduletypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.typeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", r.typeN, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritablePowerPortTemplateRequest *PatchedWritablePowerPortTemplateRequest +} + +func (r ApiDcimPowerPortTemplatesPartialUpdateRequest) PatchedWritablePowerPortTemplateRequest(patchedWritablePowerPortTemplateRequest PatchedWritablePowerPortTemplateRequest) ApiDcimPowerPortTemplatesPartialUpdateRequest { + r.patchedWritablePowerPortTemplateRequest = &patchedWritablePowerPortTemplateRequest + return r +} + +func (r ApiDcimPowerPortTemplatesPartialUpdateRequest) Execute() (*PowerPortTemplate, *http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesPartialUpdateExecute(r) +} + +/* +DcimPowerPortTemplatesPartialUpdate Method for DcimPowerPortTemplatesPartialUpdate + +Patch a power port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port template. + @return ApiDcimPowerPortTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimPowerPortTemplatesPartialUpdateRequest { + return ApiDcimPowerPortTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPortTemplate +func (a *DcimAPIService) DcimPowerPortTemplatesPartialUpdateExecute(r ApiDcimPowerPortTemplatesPartialUpdateRequest) (*PowerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePowerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerPortTemplatesRetrieveRequest) Execute() (*PowerPortTemplate, *http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesRetrieveExecute(r) +} + +/* +DcimPowerPortTemplatesRetrieve Method for DcimPowerPortTemplatesRetrieve + +Get a power port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port template. + @return ApiDcimPowerPortTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesRetrieve(ctx context.Context, id int32) ApiDcimPowerPortTemplatesRetrieveRequest { + return ApiDcimPowerPortTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPortTemplate +func (a *DcimAPIService) DcimPowerPortTemplatesRetrieveExecute(r ApiDcimPowerPortTemplatesRetrieveRequest) (*PowerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writablePowerPortTemplateRequest *WritablePowerPortTemplateRequest +} + +func (r ApiDcimPowerPortTemplatesUpdateRequest) WritablePowerPortTemplateRequest(writablePowerPortTemplateRequest WritablePowerPortTemplateRequest) ApiDcimPowerPortTemplatesUpdateRequest { + r.writablePowerPortTemplateRequest = &writablePowerPortTemplateRequest + return r +} + +func (r ApiDcimPowerPortTemplatesUpdateRequest) Execute() (*PowerPortTemplate, *http.Response, error) { + return r.ApiService.DcimPowerPortTemplatesUpdateExecute(r) +} + +/* +DcimPowerPortTemplatesUpdate Method for DcimPowerPortTemplatesUpdate + +Put a power port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port template. + @return ApiDcimPowerPortTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortTemplatesUpdate(ctx context.Context, id int32) ApiDcimPowerPortTemplatesUpdateRequest { + return ApiDcimPowerPortTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPortTemplate +func (a *DcimAPIService) DcimPowerPortTemplatesUpdateExecute(r ApiDcimPowerPortTemplatesUpdateRequest) (*PowerPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPortRequest *[]PowerPortRequest +} + +func (r ApiDcimPowerPortsBulkDestroyRequest) PowerPortRequest(powerPortRequest []PowerPortRequest) ApiDcimPowerPortsBulkDestroyRequest { + r.powerPortRequest = &powerPortRequest + return r +} + +func (r ApiDcimPowerPortsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerPortsBulkDestroyExecute(r) +} + +/* +DcimPowerPortsBulkDestroy Method for DcimPowerPortsBulkDestroy + +Delete a list of power port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerPortsBulkDestroy(ctx context.Context) ApiDcimPowerPortsBulkDestroyRequest { + return ApiDcimPowerPortsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerPortsBulkDestroyExecute(r ApiDcimPowerPortsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPortRequest == nil { + return nil, reportError("powerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPortRequest *[]PowerPortRequest +} + +func (r ApiDcimPowerPortsBulkPartialUpdateRequest) PowerPortRequest(powerPortRequest []PowerPortRequest) ApiDcimPowerPortsBulkPartialUpdateRequest { + r.powerPortRequest = &powerPortRequest + return r +} + +func (r ApiDcimPowerPortsBulkPartialUpdateRequest) Execute() ([]PowerPort, *http.Response, error) { + return r.ApiService.DcimPowerPortsBulkPartialUpdateExecute(r) +} + +/* +DcimPowerPortsBulkPartialUpdate Method for DcimPowerPortsBulkPartialUpdate + +Patch a list of power port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortsBulkPartialUpdate(ctx context.Context) ApiDcimPowerPortsBulkPartialUpdateRequest { + return ApiDcimPowerPortsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerPort +func (a *DcimAPIService) DcimPowerPortsBulkPartialUpdateExecute(r ApiDcimPowerPortsBulkPartialUpdateRequest) ([]PowerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPortRequest == nil { + return localVarReturnValue, nil, reportError("powerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + powerPortRequest *[]PowerPortRequest +} + +func (r ApiDcimPowerPortsBulkUpdateRequest) PowerPortRequest(powerPortRequest []PowerPortRequest) ApiDcimPowerPortsBulkUpdateRequest { + r.powerPortRequest = &powerPortRequest + return r +} + +func (r ApiDcimPowerPortsBulkUpdateRequest) Execute() ([]PowerPort, *http.Response, error) { + return r.ApiService.DcimPowerPortsBulkUpdateExecute(r) +} + +/* +DcimPowerPortsBulkUpdate Method for DcimPowerPortsBulkUpdate + +Put a list of power port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortsBulkUpdate(ctx context.Context) ApiDcimPowerPortsBulkUpdateRequest { + return ApiDcimPowerPortsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []PowerPort +func (a *DcimAPIService) DcimPowerPortsBulkUpdateExecute(r ApiDcimPowerPortsBulkUpdateRequest) ([]PowerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PowerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.powerPortRequest == nil { + return localVarReturnValue, nil, reportError("powerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.powerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writablePowerPortRequest *WritablePowerPortRequest +} + +func (r ApiDcimPowerPortsCreateRequest) WritablePowerPortRequest(writablePowerPortRequest WritablePowerPortRequest) ApiDcimPowerPortsCreateRequest { + r.writablePowerPortRequest = &writablePowerPortRequest + return r +} + +func (r ApiDcimPowerPortsCreateRequest) Execute() (*PowerPort, *http.Response, error) { + return r.ApiService.DcimPowerPortsCreateExecute(r) +} + +/* +DcimPowerPortsCreate Method for DcimPowerPortsCreate + +Post a list of power port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortsCreateRequest +*/ +func (a *DcimAPIService) DcimPowerPortsCreate(ctx context.Context) ApiDcimPowerPortsCreateRequest { + return ApiDcimPowerPortsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PowerPort +func (a *DcimAPIService) DcimPowerPortsCreateExecute(r ApiDcimPowerPortsCreateRequest) (*PowerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerPortRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerPortsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimPowerPortsDestroyExecute(r) +} + +/* +DcimPowerPortsDestroy Method for DcimPowerPortsDestroy + +Delete a power port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port. + @return ApiDcimPowerPortsDestroyRequest +*/ +func (a *DcimAPIService) DcimPowerPortsDestroy(ctx context.Context, id int32) ApiDcimPowerPortsDestroyRequest { + return ApiDcimPowerPortsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimPowerPortsDestroyExecute(r ApiDcimPowerPortsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + allocatedDraw *[]int32 + allocatedDrawEmpty *bool + allocatedDrawGt *[]int32 + allocatedDrawGte *[]int32 + allocatedDrawLt *[]int32 + allocatedDrawLte *[]int32 + allocatedDrawN *[]int32 + cableEnd *string + cableEndN *string + cabled *bool + connected *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + maximumDraw *[]int32 + maximumDrawEmpty *bool + maximumDrawGt *[]int32 + maximumDrawGte *[]int32 + maximumDrawLt *[]int32 + maximumDrawLte *[]int32 + maximumDrawN *[]int32 + modifiedByRequest *string + moduleId *[]*int32 + moduleIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimPowerPortsListRequest) AllocatedDraw(allocatedDraw []int32) ApiDcimPowerPortsListRequest { + r.allocatedDraw = &allocatedDraw + return r +} + +func (r ApiDcimPowerPortsListRequest) AllocatedDrawEmpty(allocatedDrawEmpty bool) ApiDcimPowerPortsListRequest { + r.allocatedDrawEmpty = &allocatedDrawEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) AllocatedDrawGt(allocatedDrawGt []int32) ApiDcimPowerPortsListRequest { + r.allocatedDrawGt = &allocatedDrawGt + return r +} + +func (r ApiDcimPowerPortsListRequest) AllocatedDrawGte(allocatedDrawGte []int32) ApiDcimPowerPortsListRequest { + r.allocatedDrawGte = &allocatedDrawGte + return r +} + +func (r ApiDcimPowerPortsListRequest) AllocatedDrawLt(allocatedDrawLt []int32) ApiDcimPowerPortsListRequest { + r.allocatedDrawLt = &allocatedDrawLt + return r +} + +func (r ApiDcimPowerPortsListRequest) AllocatedDrawLte(allocatedDrawLte []int32) ApiDcimPowerPortsListRequest { + r.allocatedDrawLte = &allocatedDrawLte + return r +} + +func (r ApiDcimPowerPortsListRequest) AllocatedDrawN(allocatedDrawN []int32) ApiDcimPowerPortsListRequest { + r.allocatedDrawN = &allocatedDrawN + return r +} + +func (r ApiDcimPowerPortsListRequest) CableEnd(cableEnd string) ApiDcimPowerPortsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimPowerPortsListRequest) CableEndN(cableEndN string) ApiDcimPowerPortsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimPowerPortsListRequest) Cabled(cabled bool) ApiDcimPowerPortsListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimPowerPortsListRequest) Connected(connected bool) ApiDcimPowerPortsListRequest { + r.connected = &connected + return r +} + +func (r ApiDcimPowerPortsListRequest) Created(created []time.Time) ApiDcimPowerPortsListRequest { + r.created = &created + return r +} + +func (r ApiDcimPowerPortsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimPowerPortsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) CreatedGt(createdGt []time.Time) ApiDcimPowerPortsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimPowerPortsListRequest) CreatedGte(createdGte []time.Time) ApiDcimPowerPortsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimPowerPortsListRequest) CreatedLt(createdLt []time.Time) ApiDcimPowerPortsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimPowerPortsListRequest) CreatedLte(createdLte []time.Time) ApiDcimPowerPortsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimPowerPortsListRequest) CreatedN(createdN []time.Time) ApiDcimPowerPortsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimPowerPortsListRequest) CreatedByRequest(createdByRequest string) ApiDcimPowerPortsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimPowerPortsListRequest) Description(description []string) ApiDcimPowerPortsListRequest { + r.description = &description + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimPowerPortsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionIc(descriptionIc []string) ApiDcimPowerPortsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionIe(descriptionIe []string) ApiDcimPowerPortsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionIew(descriptionIew []string) ApiDcimPowerPortsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimPowerPortsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionN(descriptionN []string) ApiDcimPowerPortsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionNic(descriptionNic []string) ApiDcimPowerPortsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionNie(descriptionNie []string) ApiDcimPowerPortsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimPowerPortsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimPowerPortsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimPowerPortsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimPowerPortsListRequest) Device(device []*string) ApiDcimPowerPortsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimPowerPortsListRequest) DeviceN(deviceN []*string) ApiDcimPowerPortsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimPowerPortsListRequest) DeviceId(deviceId []int32) ApiDcimPowerPortsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimPowerPortsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimPowerPortsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimPowerPortsListRequest) DeviceRole(deviceRole []string) ApiDcimPowerPortsListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimPowerPortsListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimPowerPortsListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimPowerPortsListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimPowerPortsListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimPowerPortsListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimPowerPortsListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimPowerPortsListRequest) DeviceType(deviceType []string) ApiDcimPowerPortsListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimPowerPortsListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimPowerPortsListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimPowerPortsListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimPowerPortsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimPowerPortsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimPowerPortsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimPowerPortsListRequest) Id(id []int32) ApiDcimPowerPortsListRequest { + r.id = &id + return r +} + +func (r ApiDcimPowerPortsListRequest) IdEmpty(idEmpty bool) ApiDcimPowerPortsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) IdGt(idGt []int32) ApiDcimPowerPortsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimPowerPortsListRequest) IdGte(idGte []int32) ApiDcimPowerPortsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimPowerPortsListRequest) IdLt(idLt []int32) ApiDcimPowerPortsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimPowerPortsListRequest) IdLte(idLte []int32) ApiDcimPowerPortsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimPowerPortsListRequest) IdN(idN []int32) ApiDcimPowerPortsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimPowerPortsListRequest) Label(label []string) ApiDcimPowerPortsListRequest { + r.label = &label + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelEmpty(labelEmpty bool) ApiDcimPowerPortsListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelIc(labelIc []string) ApiDcimPowerPortsListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelIe(labelIe []string) ApiDcimPowerPortsListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelIew(labelIew []string) ApiDcimPowerPortsListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelIsw(labelIsw []string) ApiDcimPowerPortsListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelN(labelN []string) ApiDcimPowerPortsListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelNic(labelNic []string) ApiDcimPowerPortsListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelNie(labelNie []string) ApiDcimPowerPortsListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelNiew(labelNiew []string) ApiDcimPowerPortsListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimPowerPortsListRequest) LabelNisw(labelNisw []string) ApiDcimPowerPortsListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimPowerPortsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimPowerPortsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimPowerPortsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimPowerPortsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimPowerPortsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimPowerPortsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimPowerPortsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimPowerPortsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimPowerPortsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimPowerPortsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimPowerPortsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimPowerPortsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimPowerPortsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimPowerPortsListRequest) Limit(limit int32) ApiDcimPowerPortsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimPowerPortsListRequest) Location(location []string) ApiDcimPowerPortsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimPowerPortsListRequest) LocationN(locationN []string) ApiDcimPowerPortsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimPowerPortsListRequest) LocationId(locationId []int32) ApiDcimPowerPortsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimPowerPortsListRequest) LocationIdN(locationIdN []int32) ApiDcimPowerPortsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimPowerPortsListRequest) MaximumDraw(maximumDraw []int32) ApiDcimPowerPortsListRequest { + r.maximumDraw = &maximumDraw + return r +} + +func (r ApiDcimPowerPortsListRequest) MaximumDrawEmpty(maximumDrawEmpty bool) ApiDcimPowerPortsListRequest { + r.maximumDrawEmpty = &maximumDrawEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) MaximumDrawGt(maximumDrawGt []int32) ApiDcimPowerPortsListRequest { + r.maximumDrawGt = &maximumDrawGt + return r +} + +func (r ApiDcimPowerPortsListRequest) MaximumDrawGte(maximumDrawGte []int32) ApiDcimPowerPortsListRequest { + r.maximumDrawGte = &maximumDrawGte + return r +} + +func (r ApiDcimPowerPortsListRequest) MaximumDrawLt(maximumDrawLt []int32) ApiDcimPowerPortsListRequest { + r.maximumDrawLt = &maximumDrawLt + return r +} + +func (r ApiDcimPowerPortsListRequest) MaximumDrawLte(maximumDrawLte []int32) ApiDcimPowerPortsListRequest { + r.maximumDrawLte = &maximumDrawLte + return r +} + +func (r ApiDcimPowerPortsListRequest) MaximumDrawN(maximumDrawN []int32) ApiDcimPowerPortsListRequest { + r.maximumDrawN = &maximumDrawN + return r +} + +func (r ApiDcimPowerPortsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimPowerPortsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module (ID) +func (r ApiDcimPowerPortsListRequest) ModuleId(moduleId []*int32) ApiDcimPowerPortsListRequest { + r.moduleId = &moduleId + return r +} + +// Module (ID) +func (r ApiDcimPowerPortsListRequest) ModuleIdN(moduleIdN []*int32) ApiDcimPowerPortsListRequest { + r.moduleIdN = &moduleIdN + return r +} + +func (r ApiDcimPowerPortsListRequest) Name(name []string) ApiDcimPowerPortsListRequest { + r.name = &name + return r +} + +func (r ApiDcimPowerPortsListRequest) NameEmpty(nameEmpty bool) ApiDcimPowerPortsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimPowerPortsListRequest) NameIc(nameIc []string) ApiDcimPowerPortsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimPowerPortsListRequest) NameIe(nameIe []string) ApiDcimPowerPortsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimPowerPortsListRequest) NameIew(nameIew []string) ApiDcimPowerPortsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimPowerPortsListRequest) NameIsw(nameIsw []string) ApiDcimPowerPortsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimPowerPortsListRequest) NameN(nameN []string) ApiDcimPowerPortsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimPowerPortsListRequest) NameNic(nameNic []string) ApiDcimPowerPortsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimPowerPortsListRequest) NameNie(nameNie []string) ApiDcimPowerPortsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimPowerPortsListRequest) NameNiew(nameNiew []string) ApiDcimPowerPortsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimPowerPortsListRequest) NameNisw(nameNisw []string) ApiDcimPowerPortsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimPowerPortsListRequest) Occupied(occupied bool) ApiDcimPowerPortsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimPowerPortsListRequest) Offset(offset int32) ApiDcimPowerPortsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimPowerPortsListRequest) Ordering(ordering string) ApiDcimPowerPortsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimPowerPortsListRequest) Q(q string) ApiDcimPowerPortsListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimPowerPortsListRequest) Rack(rack []string) ApiDcimPowerPortsListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimPowerPortsListRequest) RackN(rackN []string) ApiDcimPowerPortsListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimPowerPortsListRequest) RackId(rackId []int32) ApiDcimPowerPortsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimPowerPortsListRequest) RackIdN(rackIdN []int32) ApiDcimPowerPortsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimPowerPortsListRequest) Region(region []int32) ApiDcimPowerPortsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimPowerPortsListRequest) RegionN(regionN []int32) ApiDcimPowerPortsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimPowerPortsListRequest) RegionId(regionId []int32) ApiDcimPowerPortsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimPowerPortsListRequest) RegionIdN(regionIdN []int32) ApiDcimPowerPortsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimPowerPortsListRequest) Role(role []string) ApiDcimPowerPortsListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimPowerPortsListRequest) RoleN(roleN []string) ApiDcimPowerPortsListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimPowerPortsListRequest) RoleId(roleId []int32) ApiDcimPowerPortsListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimPowerPortsListRequest) RoleIdN(roleIdN []int32) ApiDcimPowerPortsListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimPowerPortsListRequest) Site(site []string) ApiDcimPowerPortsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimPowerPortsListRequest) SiteN(siteN []string) ApiDcimPowerPortsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimPowerPortsListRequest) SiteGroup(siteGroup []int32) ApiDcimPowerPortsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimPowerPortsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimPowerPortsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimPowerPortsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimPowerPortsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimPowerPortsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimPowerPortsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimPowerPortsListRequest) SiteId(siteId []int32) ApiDcimPowerPortsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimPowerPortsListRequest) SiteIdN(siteIdN []int32) ApiDcimPowerPortsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimPowerPortsListRequest) Tag(tag []string) ApiDcimPowerPortsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimPowerPortsListRequest) TagN(tagN []string) ApiDcimPowerPortsListRequest { + r.tagN = &tagN + return r +} + +// Physical port type +func (r ApiDcimPowerPortsListRequest) Type_(type_ []string) ApiDcimPowerPortsListRequest { + r.type_ = &type_ + return r +} + +// Physical port type +func (r ApiDcimPowerPortsListRequest) TypeN(typeN []string) ApiDcimPowerPortsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimPowerPortsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimPowerPortsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimPowerPortsListRequest) VirtualChassis(virtualChassis []string) ApiDcimPowerPortsListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimPowerPortsListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimPowerPortsListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimPowerPortsListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimPowerPortsListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimPowerPortsListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimPowerPortsListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimPowerPortsListRequest) Execute() (*PaginatedPowerPortList, *http.Response, error) { + return r.ApiService.DcimPowerPortsListExecute(r) +} + +/* +DcimPowerPortsList Method for DcimPowerPortsList + +Get a list of power port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimPowerPortsListRequest +*/ +func (a *DcimAPIService) DcimPowerPortsList(ctx context.Context) ApiDcimPowerPortsListRequest { + return ApiDcimPowerPortsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPowerPortList +func (a *DcimAPIService) DcimPowerPortsListExecute(r ApiDcimPowerPortsListRequest) (*PaginatedPowerPortList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPowerPortList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.allocatedDraw != nil { + t := *r.allocatedDraw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw", t, "multi") + } + } + if r.allocatedDrawEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__empty", r.allocatedDrawEmpty, "") + } + if r.allocatedDrawGt != nil { + t := *r.allocatedDrawGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gt", t, "multi") + } + } + if r.allocatedDrawGte != nil { + t := *r.allocatedDrawGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__gte", t, "multi") + } + } + if r.allocatedDrawLt != nil { + t := *r.allocatedDrawLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lt", t, "multi") + } + } + if r.allocatedDrawLte != nil { + t := *r.allocatedDrawLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__lte", t, "multi") + } + } + if r.allocatedDrawN != nil { + t := *r.allocatedDrawN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "allocated_draw__n", t, "multi") + } + } + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.connected != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "connected", r.connected, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.maximumDraw != nil { + t := *r.maximumDraw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw", t, "multi") + } + } + if r.maximumDrawEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__empty", r.maximumDrawEmpty, "") + } + if r.maximumDrawGt != nil { + t := *r.maximumDrawGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gt", t, "multi") + } + } + if r.maximumDrawGte != nil { + t := *r.maximumDrawGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__gte", t, "multi") + } + } + if r.maximumDrawLt != nil { + t := *r.maximumDrawLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lt", t, "multi") + } + } + if r.maximumDrawLte != nil { + t := *r.maximumDrawLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__lte", t, "multi") + } + } + if r.maximumDrawN != nil { + t := *r.maximumDrawN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "maximum_draw__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleId != nil { + t := *r.moduleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", t, "multi") + } + } + if r.moduleIdN != nil { + t := *r.moduleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritablePowerPortRequest *PatchedWritablePowerPortRequest +} + +func (r ApiDcimPowerPortsPartialUpdateRequest) PatchedWritablePowerPortRequest(patchedWritablePowerPortRequest PatchedWritablePowerPortRequest) ApiDcimPowerPortsPartialUpdateRequest { + r.patchedWritablePowerPortRequest = &patchedWritablePowerPortRequest + return r +} + +func (r ApiDcimPowerPortsPartialUpdateRequest) Execute() (*PowerPort, *http.Response, error) { + return r.ApiService.DcimPowerPortsPartialUpdateExecute(r) +} + +/* +DcimPowerPortsPartialUpdate Method for DcimPowerPortsPartialUpdate + +Patch a power port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port. + @return ApiDcimPowerPortsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortsPartialUpdate(ctx context.Context, id int32) ApiDcimPowerPortsPartialUpdateRequest { + return ApiDcimPowerPortsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPort +func (a *DcimAPIService) DcimPowerPortsPartialUpdateExecute(r ApiDcimPowerPortsPartialUpdateRequest) (*PowerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePowerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerPortsRetrieveRequest) Execute() (*PowerPort, *http.Response, error) { + return r.ApiService.DcimPowerPortsRetrieveExecute(r) +} + +/* +DcimPowerPortsRetrieve Method for DcimPowerPortsRetrieve + +Get a power port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port. + @return ApiDcimPowerPortsRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerPortsRetrieve(ctx context.Context, id int32) ApiDcimPowerPortsRetrieveRequest { + return ApiDcimPowerPortsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPort +func (a *DcimAPIService) DcimPowerPortsRetrieveExecute(r ApiDcimPowerPortsRetrieveRequest) (*PowerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsTraceRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimPowerPortsTraceRetrieveRequest) Execute() (*PowerPort, *http.Response, error) { + return r.ApiService.DcimPowerPortsTraceRetrieveExecute(r) +} + +/* +DcimPowerPortsTraceRetrieve Method for DcimPowerPortsTraceRetrieve + +Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port. + @return ApiDcimPowerPortsTraceRetrieveRequest +*/ +func (a *DcimAPIService) DcimPowerPortsTraceRetrieve(ctx context.Context, id int32) ApiDcimPowerPortsTraceRetrieveRequest { + return ApiDcimPowerPortsTraceRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPort +func (a *DcimAPIService) DcimPowerPortsTraceRetrieveExecute(r ApiDcimPowerPortsTraceRetrieveRequest) (*PowerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsTraceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/{id}/trace/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimPowerPortsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writablePowerPortRequest *WritablePowerPortRequest +} + +func (r ApiDcimPowerPortsUpdateRequest) WritablePowerPortRequest(writablePowerPortRequest WritablePowerPortRequest) ApiDcimPowerPortsUpdateRequest { + r.writablePowerPortRequest = &writablePowerPortRequest + return r +} + +func (r ApiDcimPowerPortsUpdateRequest) Execute() (*PowerPort, *http.Response, error) { + return r.ApiService.DcimPowerPortsUpdateExecute(r) +} + +/* +DcimPowerPortsUpdate Method for DcimPowerPortsUpdate + +Put a power port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this power port. + @return ApiDcimPowerPortsUpdateRequest +*/ +func (a *DcimAPIService) DcimPowerPortsUpdate(ctx context.Context, id int32) ApiDcimPowerPortsUpdateRequest { + return ApiDcimPowerPortsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PowerPort +func (a *DcimAPIService) DcimPowerPortsUpdateExecute(r ApiDcimPowerPortsUpdateRequest) (*PowerPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PowerPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimPowerPortsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/power-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePowerPortRequest == nil { + return localVarReturnValue, nil, reportError("writablePowerPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePowerPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackReservationRequest *[]RackReservationRequest +} + +func (r ApiDcimRackReservationsBulkDestroyRequest) RackReservationRequest(rackReservationRequest []RackReservationRequest) ApiDcimRackReservationsBulkDestroyRequest { + r.rackReservationRequest = &rackReservationRequest + return r +} + +func (r ApiDcimRackReservationsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRackReservationsBulkDestroyExecute(r) +} + +/* +DcimRackReservationsBulkDestroy Method for DcimRackReservationsBulkDestroy + +Delete a list of rack reservation objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackReservationsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimRackReservationsBulkDestroy(ctx context.Context) ApiDcimRackReservationsBulkDestroyRequest { + return ApiDcimRackReservationsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRackReservationsBulkDestroyExecute(r ApiDcimRackReservationsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackReservationRequest == nil { + return nil, reportError("rackReservationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackReservationRequest *[]RackReservationRequest +} + +func (r ApiDcimRackReservationsBulkPartialUpdateRequest) RackReservationRequest(rackReservationRequest []RackReservationRequest) ApiDcimRackReservationsBulkPartialUpdateRequest { + r.rackReservationRequest = &rackReservationRequest + return r +} + +func (r ApiDcimRackReservationsBulkPartialUpdateRequest) Execute() ([]RackReservation, *http.Response, error) { + return r.ApiService.DcimRackReservationsBulkPartialUpdateExecute(r) +} + +/* +DcimRackReservationsBulkPartialUpdate Method for DcimRackReservationsBulkPartialUpdate + +Patch a list of rack reservation objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackReservationsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRackReservationsBulkPartialUpdate(ctx context.Context) ApiDcimRackReservationsBulkPartialUpdateRequest { + return ApiDcimRackReservationsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RackReservation +func (a *DcimAPIService) DcimRackReservationsBulkPartialUpdateExecute(r ApiDcimRackReservationsBulkPartialUpdateRequest) ([]RackReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RackReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackReservationRequest == nil { + return localVarReturnValue, nil, reportError("rackReservationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackReservationRequest *[]RackReservationRequest +} + +func (r ApiDcimRackReservationsBulkUpdateRequest) RackReservationRequest(rackReservationRequest []RackReservationRequest) ApiDcimRackReservationsBulkUpdateRequest { + r.rackReservationRequest = &rackReservationRequest + return r +} + +func (r ApiDcimRackReservationsBulkUpdateRequest) Execute() ([]RackReservation, *http.Response, error) { + return r.ApiService.DcimRackReservationsBulkUpdateExecute(r) +} + +/* +DcimRackReservationsBulkUpdate Method for DcimRackReservationsBulkUpdate + +Put a list of rack reservation objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackReservationsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimRackReservationsBulkUpdate(ctx context.Context) ApiDcimRackReservationsBulkUpdateRequest { + return ApiDcimRackReservationsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RackReservation +func (a *DcimAPIService) DcimRackReservationsBulkUpdateExecute(r ApiDcimRackReservationsBulkUpdateRequest) ([]RackReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RackReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackReservationRequest == nil { + return localVarReturnValue, nil, reportError("rackReservationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableRackReservationRequest *WritableRackReservationRequest +} + +func (r ApiDcimRackReservationsCreateRequest) WritableRackReservationRequest(writableRackReservationRequest WritableRackReservationRequest) ApiDcimRackReservationsCreateRequest { + r.writableRackReservationRequest = &writableRackReservationRequest + return r +} + +func (r ApiDcimRackReservationsCreateRequest) Execute() (*RackReservation, *http.Response, error) { + return r.ApiService.DcimRackReservationsCreateExecute(r) +} + +/* +DcimRackReservationsCreate Method for DcimRackReservationsCreate + +Post a list of rack reservation objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackReservationsCreateRequest +*/ +func (a *DcimAPIService) DcimRackReservationsCreate(ctx context.Context) ApiDcimRackReservationsCreateRequest { + return ApiDcimRackReservationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RackReservation +func (a *DcimAPIService) DcimRackReservationsCreateExecute(r ApiDcimRackReservationsCreateRequest) (*RackReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRackReservationRequest == nil { + return localVarReturnValue, nil, reportError("writableRackReservationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRackReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRackReservationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRackReservationsDestroyExecute(r) +} + +/* +DcimRackReservationsDestroy Method for DcimRackReservationsDestroy + +Delete a rack reservation object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack reservation. + @return ApiDcimRackReservationsDestroyRequest +*/ +func (a *DcimAPIService) DcimRackReservationsDestroy(ctx context.Context, id int32) ApiDcimRackReservationsDestroyRequest { + return ApiDcimRackReservationsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRackReservationsDestroyExecute(r ApiDcimRackReservationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]int32 + locationN *[]int32 + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + offset *int32 + ordering *string + q *string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + user *[]string + userN *[]string + userId *[]int32 + userIdN *[]int32 +} + +func (r ApiDcimRackReservationsListRequest) Created(created []time.Time) ApiDcimRackReservationsListRequest { + r.created = &created + return r +} + +func (r ApiDcimRackReservationsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimRackReservationsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimRackReservationsListRequest) CreatedGt(createdGt []time.Time) ApiDcimRackReservationsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimRackReservationsListRequest) CreatedGte(createdGte []time.Time) ApiDcimRackReservationsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimRackReservationsListRequest) CreatedLt(createdLt []time.Time) ApiDcimRackReservationsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimRackReservationsListRequest) CreatedLte(createdLte []time.Time) ApiDcimRackReservationsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimRackReservationsListRequest) CreatedN(createdN []time.Time) ApiDcimRackReservationsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimRackReservationsListRequest) CreatedByRequest(createdByRequest string) ApiDcimRackReservationsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimRackReservationsListRequest) Description(description []string) ApiDcimRackReservationsListRequest { + r.description = &description + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimRackReservationsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionIc(descriptionIc []string) ApiDcimRackReservationsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionIe(descriptionIe []string) ApiDcimRackReservationsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionIew(descriptionIew []string) ApiDcimRackReservationsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimRackReservationsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionN(descriptionN []string) ApiDcimRackReservationsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionNic(descriptionNic []string) ApiDcimRackReservationsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionNie(descriptionNie []string) ApiDcimRackReservationsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimRackReservationsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimRackReservationsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimRackReservationsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimRackReservationsListRequest) Id(id []int32) ApiDcimRackReservationsListRequest { + r.id = &id + return r +} + +func (r ApiDcimRackReservationsListRequest) IdEmpty(idEmpty bool) ApiDcimRackReservationsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimRackReservationsListRequest) IdGt(idGt []int32) ApiDcimRackReservationsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimRackReservationsListRequest) IdGte(idGte []int32) ApiDcimRackReservationsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimRackReservationsListRequest) IdLt(idLt []int32) ApiDcimRackReservationsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimRackReservationsListRequest) IdLte(idLte []int32) ApiDcimRackReservationsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimRackReservationsListRequest) IdN(idN []int32) ApiDcimRackReservationsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimRackReservationsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimRackReservationsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimRackReservationsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimRackReservationsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimRackReservationsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimRackReservationsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimRackReservationsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimRackReservationsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimRackReservationsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimRackReservationsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimRackReservationsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimRackReservationsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimRackReservationsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimRackReservationsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimRackReservationsListRequest) Limit(limit int32) ApiDcimRackReservationsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimRackReservationsListRequest) Location(location []int32) ApiDcimRackReservationsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimRackReservationsListRequest) LocationN(locationN []int32) ApiDcimRackReservationsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimRackReservationsListRequest) LocationId(locationId []int32) ApiDcimRackReservationsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimRackReservationsListRequest) LocationIdN(locationIdN []int32) ApiDcimRackReservationsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimRackReservationsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimRackReservationsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiDcimRackReservationsListRequest) Offset(offset int32) ApiDcimRackReservationsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimRackReservationsListRequest) Ordering(ordering string) ApiDcimRackReservationsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimRackReservationsListRequest) Q(q string) ApiDcimRackReservationsListRequest { + r.q = &q + return r +} + +// Rack (ID) +func (r ApiDcimRackReservationsListRequest) RackId(rackId []int32) ApiDcimRackReservationsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimRackReservationsListRequest) RackIdN(rackIdN []int32) ApiDcimRackReservationsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimRackReservationsListRequest) Region(region []int32) ApiDcimRackReservationsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimRackReservationsListRequest) RegionN(regionN []int32) ApiDcimRackReservationsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimRackReservationsListRequest) RegionId(regionId []int32) ApiDcimRackReservationsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimRackReservationsListRequest) RegionIdN(regionIdN []int32) ApiDcimRackReservationsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site (slug) +func (r ApiDcimRackReservationsListRequest) Site(site []string) ApiDcimRackReservationsListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiDcimRackReservationsListRequest) SiteN(siteN []string) ApiDcimRackReservationsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimRackReservationsListRequest) SiteGroup(siteGroup []int32) ApiDcimRackReservationsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimRackReservationsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimRackReservationsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimRackReservationsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimRackReservationsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimRackReservationsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimRackReservationsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimRackReservationsListRequest) SiteId(siteId []int32) ApiDcimRackReservationsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimRackReservationsListRequest) SiteIdN(siteIdN []int32) ApiDcimRackReservationsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimRackReservationsListRequest) Tag(tag []string) ApiDcimRackReservationsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimRackReservationsListRequest) TagN(tagN []string) ApiDcimRackReservationsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimRackReservationsListRequest) Tenant(tenant []string) ApiDcimRackReservationsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimRackReservationsListRequest) TenantN(tenantN []string) ApiDcimRackReservationsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimRackReservationsListRequest) TenantGroup(tenantGroup []int32) ApiDcimRackReservationsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimRackReservationsListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimRackReservationsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimRackReservationsListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimRackReservationsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimRackReservationsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimRackReservationsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimRackReservationsListRequest) TenantId(tenantId []*int32) ApiDcimRackReservationsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimRackReservationsListRequest) TenantIdN(tenantIdN []*int32) ApiDcimRackReservationsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimRackReservationsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimRackReservationsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// User (name) +func (r ApiDcimRackReservationsListRequest) User(user []string) ApiDcimRackReservationsListRequest { + r.user = &user + return r +} + +// User (name) +func (r ApiDcimRackReservationsListRequest) UserN(userN []string) ApiDcimRackReservationsListRequest { + r.userN = &userN + return r +} + +// User (ID) +func (r ApiDcimRackReservationsListRequest) UserId(userId []int32) ApiDcimRackReservationsListRequest { + r.userId = &userId + return r +} + +// User (ID) +func (r ApiDcimRackReservationsListRequest) UserIdN(userIdN []int32) ApiDcimRackReservationsListRequest { + r.userIdN = &userIdN + return r +} + +func (r ApiDcimRackReservationsListRequest) Execute() (*PaginatedRackReservationList, *http.Response, error) { + return r.ApiService.DcimRackReservationsListExecute(r) +} + +/* +DcimRackReservationsList Method for DcimRackReservationsList + +Get a list of rack reservation objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackReservationsListRequest +*/ +func (a *DcimAPIService) DcimRackReservationsList(ctx context.Context) ApiDcimRackReservationsListRequest { + return ApiDcimRackReservationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRackReservationList +func (a *DcimAPIService) DcimRackReservationsListExecute(r ApiDcimRackReservationsListRequest) (*PaginatedRackReservationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRackReservationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.user != nil { + t := *r.user + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", t, "multi") + } + } + if r.userN != nil { + t := *r.userN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", t, "multi") + } + } + if r.userId != nil { + t := *r.userId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", t, "multi") + } + } + if r.userIdN != nil { + t := *r.userIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableRackReservationRequest *PatchedWritableRackReservationRequest +} + +func (r ApiDcimRackReservationsPartialUpdateRequest) PatchedWritableRackReservationRequest(patchedWritableRackReservationRequest PatchedWritableRackReservationRequest) ApiDcimRackReservationsPartialUpdateRequest { + r.patchedWritableRackReservationRequest = &patchedWritableRackReservationRequest + return r +} + +func (r ApiDcimRackReservationsPartialUpdateRequest) Execute() (*RackReservation, *http.Response, error) { + return r.ApiService.DcimRackReservationsPartialUpdateExecute(r) +} + +/* +DcimRackReservationsPartialUpdate Method for DcimRackReservationsPartialUpdate + +Patch a rack reservation object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack reservation. + @return ApiDcimRackReservationsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRackReservationsPartialUpdate(ctx context.Context, id int32) ApiDcimRackReservationsPartialUpdateRequest { + return ApiDcimRackReservationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RackReservation +func (a *DcimAPIService) DcimRackReservationsPartialUpdateExecute(r ApiDcimRackReservationsPartialUpdateRequest) (*RackReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableRackReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRackReservationsRetrieveRequest) Execute() (*RackReservation, *http.Response, error) { + return r.ApiService.DcimRackReservationsRetrieveExecute(r) +} + +/* +DcimRackReservationsRetrieve Method for DcimRackReservationsRetrieve + +Get a rack reservation object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack reservation. + @return ApiDcimRackReservationsRetrieveRequest +*/ +func (a *DcimAPIService) DcimRackReservationsRetrieve(ctx context.Context, id int32) ApiDcimRackReservationsRetrieveRequest { + return ApiDcimRackReservationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RackReservation +func (a *DcimAPIService) DcimRackReservationsRetrieveExecute(r ApiDcimRackReservationsRetrieveRequest) (*RackReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackReservationsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableRackReservationRequest *WritableRackReservationRequest +} + +func (r ApiDcimRackReservationsUpdateRequest) WritableRackReservationRequest(writableRackReservationRequest WritableRackReservationRequest) ApiDcimRackReservationsUpdateRequest { + r.writableRackReservationRequest = &writableRackReservationRequest + return r +} + +func (r ApiDcimRackReservationsUpdateRequest) Execute() (*RackReservation, *http.Response, error) { + return r.ApiService.DcimRackReservationsUpdateExecute(r) +} + +/* +DcimRackReservationsUpdate Method for DcimRackReservationsUpdate + +Put a rack reservation object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack reservation. + @return ApiDcimRackReservationsUpdateRequest +*/ +func (a *DcimAPIService) DcimRackReservationsUpdate(ctx context.Context, id int32) ApiDcimRackReservationsUpdateRequest { + return ApiDcimRackReservationsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RackReservation +func (a *DcimAPIService) DcimRackReservationsUpdateExecute(r ApiDcimRackReservationsUpdateRequest) (*RackReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackReservationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-reservations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRackReservationRequest == nil { + return localVarReturnValue, nil, reportError("writableRackReservationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRackReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackRolesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackRoleRequest *[]RackRoleRequest +} + +func (r ApiDcimRackRolesBulkDestroyRequest) RackRoleRequest(rackRoleRequest []RackRoleRequest) ApiDcimRackRolesBulkDestroyRequest { + r.rackRoleRequest = &rackRoleRequest + return r +} + +func (r ApiDcimRackRolesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRackRolesBulkDestroyExecute(r) +} + +/* +DcimRackRolesBulkDestroy Method for DcimRackRolesBulkDestroy + +Delete a list of rack role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackRolesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimRackRolesBulkDestroy(ctx context.Context) ApiDcimRackRolesBulkDestroyRequest { + return ApiDcimRackRolesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRackRolesBulkDestroyExecute(r ApiDcimRackRolesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRoleRequest == nil { + return nil, reportError("rackRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRackRolesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackRoleRequest *[]RackRoleRequest +} + +func (r ApiDcimRackRolesBulkPartialUpdateRequest) RackRoleRequest(rackRoleRequest []RackRoleRequest) ApiDcimRackRolesBulkPartialUpdateRequest { + r.rackRoleRequest = &rackRoleRequest + return r +} + +func (r ApiDcimRackRolesBulkPartialUpdateRequest) Execute() ([]RackRole, *http.Response, error) { + return r.ApiService.DcimRackRolesBulkPartialUpdateExecute(r) +} + +/* +DcimRackRolesBulkPartialUpdate Method for DcimRackRolesBulkPartialUpdate + +Patch a list of rack role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackRolesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRackRolesBulkPartialUpdate(ctx context.Context) ApiDcimRackRolesBulkPartialUpdateRequest { + return ApiDcimRackRolesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RackRole +func (a *DcimAPIService) DcimRackRolesBulkPartialUpdateExecute(r ApiDcimRackRolesBulkPartialUpdateRequest) ([]RackRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RackRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRoleRequest == nil { + return localVarReturnValue, nil, reportError("rackRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackRolesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackRoleRequest *[]RackRoleRequest +} + +func (r ApiDcimRackRolesBulkUpdateRequest) RackRoleRequest(rackRoleRequest []RackRoleRequest) ApiDcimRackRolesBulkUpdateRequest { + r.rackRoleRequest = &rackRoleRequest + return r +} + +func (r ApiDcimRackRolesBulkUpdateRequest) Execute() ([]RackRole, *http.Response, error) { + return r.ApiService.DcimRackRolesBulkUpdateExecute(r) +} + +/* +DcimRackRolesBulkUpdate Method for DcimRackRolesBulkUpdate + +Put a list of rack role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackRolesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimRackRolesBulkUpdate(ctx context.Context) ApiDcimRackRolesBulkUpdateRequest { + return ApiDcimRackRolesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RackRole +func (a *DcimAPIService) DcimRackRolesBulkUpdateExecute(r ApiDcimRackRolesBulkUpdateRequest) ([]RackRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RackRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRoleRequest == nil { + return localVarReturnValue, nil, reportError("rackRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackRolesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackRoleRequest *RackRoleRequest +} + +func (r ApiDcimRackRolesCreateRequest) RackRoleRequest(rackRoleRequest RackRoleRequest) ApiDcimRackRolesCreateRequest { + r.rackRoleRequest = &rackRoleRequest + return r +} + +func (r ApiDcimRackRolesCreateRequest) Execute() (*RackRole, *http.Response, error) { + return r.ApiService.DcimRackRolesCreateExecute(r) +} + +/* +DcimRackRolesCreate Method for DcimRackRolesCreate + +Post a list of rack role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackRolesCreateRequest +*/ +func (a *DcimAPIService) DcimRackRolesCreate(ctx context.Context) ApiDcimRackRolesCreateRequest { + return ApiDcimRackRolesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RackRole +func (a *DcimAPIService) DcimRackRolesCreateExecute(r ApiDcimRackRolesCreateRequest) (*RackRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRoleRequest == nil { + return localVarReturnValue, nil, reportError("rackRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackRolesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRackRolesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRackRolesDestroyExecute(r) +} + +/* +DcimRackRolesDestroy Method for DcimRackRolesDestroy + +Delete a rack role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack role. + @return ApiDcimRackRolesDestroyRequest +*/ +func (a *DcimAPIService) DcimRackRolesDestroy(ctx context.Context, id int32) ApiDcimRackRolesDestroyRequest { + return ApiDcimRackRolesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRackRolesDestroyExecute(r ApiDcimRackRolesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRackRolesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiDcimRackRolesListRequest) Color(color []string) ApiDcimRackRolesListRequest { + r.color = &color + return r +} + +func (r ApiDcimRackRolesListRequest) ColorEmpty(colorEmpty bool) ApiDcimRackRolesListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiDcimRackRolesListRequest) ColorIc(colorIc []string) ApiDcimRackRolesListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiDcimRackRolesListRequest) ColorIe(colorIe []string) ApiDcimRackRolesListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiDcimRackRolesListRequest) ColorIew(colorIew []string) ApiDcimRackRolesListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiDcimRackRolesListRequest) ColorIsw(colorIsw []string) ApiDcimRackRolesListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiDcimRackRolesListRequest) ColorN(colorN []string) ApiDcimRackRolesListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimRackRolesListRequest) ColorNic(colorNic []string) ApiDcimRackRolesListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiDcimRackRolesListRequest) ColorNie(colorNie []string) ApiDcimRackRolesListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiDcimRackRolesListRequest) ColorNiew(colorNiew []string) ApiDcimRackRolesListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiDcimRackRolesListRequest) ColorNisw(colorNisw []string) ApiDcimRackRolesListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiDcimRackRolesListRequest) Created(created []time.Time) ApiDcimRackRolesListRequest { + r.created = &created + return r +} + +func (r ApiDcimRackRolesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimRackRolesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimRackRolesListRequest) CreatedGt(createdGt []time.Time) ApiDcimRackRolesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimRackRolesListRequest) CreatedGte(createdGte []time.Time) ApiDcimRackRolesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimRackRolesListRequest) CreatedLt(createdLt []time.Time) ApiDcimRackRolesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimRackRolesListRequest) CreatedLte(createdLte []time.Time) ApiDcimRackRolesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimRackRolesListRequest) CreatedN(createdN []time.Time) ApiDcimRackRolesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimRackRolesListRequest) CreatedByRequest(createdByRequest string) ApiDcimRackRolesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimRackRolesListRequest) Description(description []string) ApiDcimRackRolesListRequest { + r.description = &description + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimRackRolesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionIc(descriptionIc []string) ApiDcimRackRolesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionIe(descriptionIe []string) ApiDcimRackRolesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionIew(descriptionIew []string) ApiDcimRackRolesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimRackRolesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionN(descriptionN []string) ApiDcimRackRolesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionNic(descriptionNic []string) ApiDcimRackRolesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionNie(descriptionNie []string) ApiDcimRackRolesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimRackRolesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimRackRolesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimRackRolesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimRackRolesListRequest) Id(id []int32) ApiDcimRackRolesListRequest { + r.id = &id + return r +} + +func (r ApiDcimRackRolesListRequest) IdEmpty(idEmpty bool) ApiDcimRackRolesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimRackRolesListRequest) IdGt(idGt []int32) ApiDcimRackRolesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimRackRolesListRequest) IdGte(idGte []int32) ApiDcimRackRolesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimRackRolesListRequest) IdLt(idLt []int32) ApiDcimRackRolesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimRackRolesListRequest) IdLte(idLte []int32) ApiDcimRackRolesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimRackRolesListRequest) IdN(idN []int32) ApiDcimRackRolesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimRackRolesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimRackRolesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimRackRolesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimRackRolesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimRackRolesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimRackRolesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimRackRolesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimRackRolesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimRackRolesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimRackRolesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimRackRolesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimRackRolesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimRackRolesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimRackRolesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimRackRolesListRequest) Limit(limit int32) ApiDcimRackRolesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimRackRolesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimRackRolesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimRackRolesListRequest) Name(name []string) ApiDcimRackRolesListRequest { + r.name = &name + return r +} + +func (r ApiDcimRackRolesListRequest) NameEmpty(nameEmpty bool) ApiDcimRackRolesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimRackRolesListRequest) NameIc(nameIc []string) ApiDcimRackRolesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimRackRolesListRequest) NameIe(nameIe []string) ApiDcimRackRolesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimRackRolesListRequest) NameIew(nameIew []string) ApiDcimRackRolesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimRackRolesListRequest) NameIsw(nameIsw []string) ApiDcimRackRolesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimRackRolesListRequest) NameN(nameN []string) ApiDcimRackRolesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimRackRolesListRequest) NameNic(nameNic []string) ApiDcimRackRolesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimRackRolesListRequest) NameNie(nameNie []string) ApiDcimRackRolesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimRackRolesListRequest) NameNiew(nameNiew []string) ApiDcimRackRolesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimRackRolesListRequest) NameNisw(nameNisw []string) ApiDcimRackRolesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimRackRolesListRequest) Offset(offset int32) ApiDcimRackRolesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimRackRolesListRequest) Ordering(ordering string) ApiDcimRackRolesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimRackRolesListRequest) Q(q string) ApiDcimRackRolesListRequest { + r.q = &q + return r +} + +func (r ApiDcimRackRolesListRequest) Slug(slug []string) ApiDcimRackRolesListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimRackRolesListRequest) SlugEmpty(slugEmpty bool) ApiDcimRackRolesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimRackRolesListRequest) SlugIc(slugIc []string) ApiDcimRackRolesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimRackRolesListRequest) SlugIe(slugIe []string) ApiDcimRackRolesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimRackRolesListRequest) SlugIew(slugIew []string) ApiDcimRackRolesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimRackRolesListRequest) SlugIsw(slugIsw []string) ApiDcimRackRolesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimRackRolesListRequest) SlugN(slugN []string) ApiDcimRackRolesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimRackRolesListRequest) SlugNic(slugNic []string) ApiDcimRackRolesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimRackRolesListRequest) SlugNie(slugNie []string) ApiDcimRackRolesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimRackRolesListRequest) SlugNiew(slugNiew []string) ApiDcimRackRolesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimRackRolesListRequest) SlugNisw(slugNisw []string) ApiDcimRackRolesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimRackRolesListRequest) Tag(tag []string) ApiDcimRackRolesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimRackRolesListRequest) TagN(tagN []string) ApiDcimRackRolesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimRackRolesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimRackRolesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimRackRolesListRequest) Execute() (*PaginatedRackRoleList, *http.Response, error) { + return r.ApiService.DcimRackRolesListExecute(r) +} + +/* +DcimRackRolesList Method for DcimRackRolesList + +Get a list of rack role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRackRolesListRequest +*/ +func (a *DcimAPIService) DcimRackRolesList(ctx context.Context) ApiDcimRackRolesListRequest { + return ApiDcimRackRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRackRoleList +func (a *DcimAPIService) DcimRackRolesListExecute(r ApiDcimRackRolesListRequest) (*PaginatedRackRoleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRackRoleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackRolesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedRackRoleRequest *PatchedRackRoleRequest +} + +func (r ApiDcimRackRolesPartialUpdateRequest) PatchedRackRoleRequest(patchedRackRoleRequest PatchedRackRoleRequest) ApiDcimRackRolesPartialUpdateRequest { + r.patchedRackRoleRequest = &patchedRackRoleRequest + return r +} + +func (r ApiDcimRackRolesPartialUpdateRequest) Execute() (*RackRole, *http.Response, error) { + return r.ApiService.DcimRackRolesPartialUpdateExecute(r) +} + +/* +DcimRackRolesPartialUpdate Method for DcimRackRolesPartialUpdate + +Patch a rack role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack role. + @return ApiDcimRackRolesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRackRolesPartialUpdate(ctx context.Context, id int32) ApiDcimRackRolesPartialUpdateRequest { + return ApiDcimRackRolesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RackRole +func (a *DcimAPIService) DcimRackRolesPartialUpdateExecute(r ApiDcimRackRolesPartialUpdateRequest) (*RackRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRackRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackRolesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRackRolesRetrieveRequest) Execute() (*RackRole, *http.Response, error) { + return r.ApiService.DcimRackRolesRetrieveExecute(r) +} + +/* +DcimRackRolesRetrieve Method for DcimRackRolesRetrieve + +Get a rack role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack role. + @return ApiDcimRackRolesRetrieveRequest +*/ +func (a *DcimAPIService) DcimRackRolesRetrieve(ctx context.Context, id int32) ApiDcimRackRolesRetrieveRequest { + return ApiDcimRackRolesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RackRole +func (a *DcimAPIService) DcimRackRolesRetrieveExecute(r ApiDcimRackRolesRetrieveRequest) (*RackRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRackRolesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + rackRoleRequest *RackRoleRequest +} + +func (r ApiDcimRackRolesUpdateRequest) RackRoleRequest(rackRoleRequest RackRoleRequest) ApiDcimRackRolesUpdateRequest { + r.rackRoleRequest = &rackRoleRequest + return r +} + +func (r ApiDcimRackRolesUpdateRequest) Execute() (*RackRole, *http.Response, error) { + return r.ApiService.DcimRackRolesUpdateExecute(r) +} + +/* +DcimRackRolesUpdate Method for DcimRackRolesUpdate + +Put a rack role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack role. + @return ApiDcimRackRolesUpdateRequest +*/ +func (a *DcimAPIService) DcimRackRolesUpdate(ctx context.Context, id int32) ApiDcimRackRolesUpdateRequest { + return ApiDcimRackRolesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RackRole +func (a *DcimAPIService) DcimRackRolesUpdateExecute(r ApiDcimRackRolesUpdateRequest) (*RackRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RackRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRackRolesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rack-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRoleRequest == nil { + return localVarReturnValue, nil, reportError("rackRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackRequest *[]RackRequest +} + +func (r ApiDcimRacksBulkDestroyRequest) RackRequest(rackRequest []RackRequest) ApiDcimRacksBulkDestroyRequest { + r.rackRequest = &rackRequest + return r +} + +func (r ApiDcimRacksBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRacksBulkDestroyExecute(r) +} + +/* +DcimRacksBulkDestroy Method for DcimRacksBulkDestroy + +Delete a list of rack objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRacksBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimRacksBulkDestroy(ctx context.Context) ApiDcimRacksBulkDestroyRequest { + return ApiDcimRacksBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRacksBulkDestroyExecute(r ApiDcimRacksBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRequest == nil { + return nil, reportError("rackRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRacksBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackRequest *[]RackRequest +} + +func (r ApiDcimRacksBulkPartialUpdateRequest) RackRequest(rackRequest []RackRequest) ApiDcimRacksBulkPartialUpdateRequest { + r.rackRequest = &rackRequest + return r +} + +func (r ApiDcimRacksBulkPartialUpdateRequest) Execute() ([]Rack, *http.Response, error) { + return r.ApiService.DcimRacksBulkPartialUpdateExecute(r) +} + +/* +DcimRacksBulkPartialUpdate Method for DcimRacksBulkPartialUpdate + +Patch a list of rack objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRacksBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRacksBulkPartialUpdate(ctx context.Context) ApiDcimRacksBulkPartialUpdateRequest { + return ApiDcimRacksBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Rack +func (a *DcimAPIService) DcimRacksBulkPartialUpdateExecute(r ApiDcimRacksBulkPartialUpdateRequest) ([]Rack, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Rack + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRequest == nil { + return localVarReturnValue, nil, reportError("rackRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rackRequest *[]RackRequest +} + +func (r ApiDcimRacksBulkUpdateRequest) RackRequest(rackRequest []RackRequest) ApiDcimRacksBulkUpdateRequest { + r.rackRequest = &rackRequest + return r +} + +func (r ApiDcimRacksBulkUpdateRequest) Execute() ([]Rack, *http.Response, error) { + return r.ApiService.DcimRacksBulkUpdateExecute(r) +} + +/* +DcimRacksBulkUpdate Method for DcimRacksBulkUpdate + +Put a list of rack objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRacksBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimRacksBulkUpdate(ctx context.Context) ApiDcimRacksBulkUpdateRequest { + return ApiDcimRacksBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Rack +func (a *DcimAPIService) DcimRacksBulkUpdateExecute(r ApiDcimRacksBulkUpdateRequest) ([]Rack, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Rack + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rackRequest == nil { + return localVarReturnValue, nil, reportError("rackRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rackRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableRackRequest *WritableRackRequest +} + +func (r ApiDcimRacksCreateRequest) WritableRackRequest(writableRackRequest WritableRackRequest) ApiDcimRacksCreateRequest { + r.writableRackRequest = &writableRackRequest + return r +} + +func (r ApiDcimRacksCreateRequest) Execute() (*Rack, *http.Response, error) { + return r.ApiService.DcimRacksCreateExecute(r) +} + +/* +DcimRacksCreate Method for DcimRacksCreate + +Post a list of rack objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRacksCreateRequest +*/ +func (a *DcimAPIService) DcimRacksCreate(ctx context.Context) ApiDcimRacksCreateRequest { + return ApiDcimRacksCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Rack +func (a *DcimAPIService) DcimRacksCreateExecute(r ApiDcimRacksCreateRequest) (*Rack, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Rack + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRackRequest == nil { + return localVarReturnValue, nil, reportError("writableRackRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRackRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRacksDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRacksDestroyExecute(r) +} + +/* +DcimRacksDestroy Method for DcimRacksDestroy + +Delete a rack object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack. + @return ApiDcimRacksDestroyRequest +*/ +func (a *DcimAPIService) DcimRacksDestroy(ctx context.Context, id int32) ApiDcimRacksDestroyRequest { + return ApiDcimRacksDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRacksDestroyExecute(r ApiDcimRacksDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRacksElevationRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRacksElevationRetrieveRequest) Execute() (*Rack, *http.Response, error) { + return r.ApiService.DcimRacksElevationRetrieveExecute(r) +} + +/* +DcimRacksElevationRetrieve Method for DcimRacksElevationRetrieve + +Rack elevation representing the list of rack units. Also supports rendering the elevation as an SVG. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack. + @return ApiDcimRacksElevationRetrieveRequest +*/ +func (a *DcimAPIService) DcimRacksElevationRetrieve(ctx context.Context, id int32) ApiDcimRacksElevationRetrieveRequest { + return ApiDcimRacksElevationRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Rack +func (a *DcimAPIService) DcimRacksElevationRetrieveExecute(r ApiDcimRacksElevationRetrieveRequest) (*Rack, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Rack + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksElevationRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/{id}/elevation/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksListRequest struct { + ctx context.Context + ApiService *DcimAPIService + assetTag *[]string + assetTagEmpty *bool + assetTagIc *[]string + assetTagIe *[]string + assetTagIew *[]string + assetTagIsw *[]string + assetTagN *[]string + assetTagNic *[]string + assetTagNie *[]string + assetTagNiew *[]string + assetTagNisw *[]string + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + descUnits *bool + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + facilityId *[]string + facilityIdEmpty *bool + facilityIdIc *[]string + facilityIdIe *[]string + facilityIdIew *[]string + facilityIdIsw *[]string + facilityIdN *[]string + facilityIdNic *[]string + facilityIdNie *[]string + facilityIdNiew *[]string + facilityIdNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]int32 + locationN *[]int32 + locationId *[]int32 + locationIdN *[]int32 + maxWeight *[]int32 + maxWeightEmpty *bool + maxWeightGt *[]int32 + maxWeightGte *[]int32 + maxWeightLt *[]int32 + maxWeightLte *[]int32 + maxWeightN *[]int32 + modifiedByRequest *string + mountingDepth *[]int32 + mountingDepthEmpty *bool + mountingDepthGt *[]int32 + mountingDepthGte *[]int32 + mountingDepthLt *[]int32 + mountingDepthLte *[]int32 + mountingDepthN *[]int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + outerDepth *[]int32 + outerDepthEmpty *bool + outerDepthGt *[]int32 + outerDepthGte *[]int32 + outerDepthLt *[]int32 + outerDepthLte *[]int32 + outerDepthN *[]int32 + outerUnit *string + outerUnitN *string + outerWidth *[]int32 + outerWidthEmpty *bool + outerWidthGt *[]int32 + outerWidthGte *[]int32 + outerWidthLt *[]int32 + outerWidthLte *[]int32 + outerWidthN *[]int32 + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]*int32 + roleIdN *[]*int32 + serial *[]string + serialEmpty *bool + serialIc *[]string + serialIe *[]string + serialIew *[]string + serialIsw *[]string + serialN *[]string + serialNic *[]string + serialNie *[]string + serialNiew *[]string + serialNisw *[]string + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + startingUnit *[]int32 + startingUnitEmpty *bool + startingUnitGt *[]int32 + startingUnitGte *[]int32 + startingUnitLt *[]int32 + startingUnitLte *[]int32 + startingUnitN *[]int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + type_ *[]string + typeN *[]string + uHeight *[]int32 + uHeightEmpty *bool + uHeightGt *[]int32 + uHeightGte *[]int32 + uHeightLt *[]int32 + uHeightLte *[]int32 + uHeightN *[]int32 + updatedByRequest *string + weight *[]float64 + weightEmpty *bool + weightGt *[]float64 + weightGte *[]float64 + weightLt *[]float64 + weightLte *[]float64 + weightN *[]float64 + weightUnit *string + weightUnitN *string + width *[]int32 + widthN *[]int32 +} + +func (r ApiDcimRacksListRequest) AssetTag(assetTag []string) ApiDcimRacksListRequest { + r.assetTag = &assetTag + return r +} + +func (r ApiDcimRacksListRequest) AssetTagEmpty(assetTagEmpty bool) ApiDcimRacksListRequest { + r.assetTagEmpty = &assetTagEmpty + return r +} + +func (r ApiDcimRacksListRequest) AssetTagIc(assetTagIc []string) ApiDcimRacksListRequest { + r.assetTagIc = &assetTagIc + return r +} + +func (r ApiDcimRacksListRequest) AssetTagIe(assetTagIe []string) ApiDcimRacksListRequest { + r.assetTagIe = &assetTagIe + return r +} + +func (r ApiDcimRacksListRequest) AssetTagIew(assetTagIew []string) ApiDcimRacksListRequest { + r.assetTagIew = &assetTagIew + return r +} + +func (r ApiDcimRacksListRequest) AssetTagIsw(assetTagIsw []string) ApiDcimRacksListRequest { + r.assetTagIsw = &assetTagIsw + return r +} + +func (r ApiDcimRacksListRequest) AssetTagN(assetTagN []string) ApiDcimRacksListRequest { + r.assetTagN = &assetTagN + return r +} + +func (r ApiDcimRacksListRequest) AssetTagNic(assetTagNic []string) ApiDcimRacksListRequest { + r.assetTagNic = &assetTagNic + return r +} + +func (r ApiDcimRacksListRequest) AssetTagNie(assetTagNie []string) ApiDcimRacksListRequest { + r.assetTagNie = &assetTagNie + return r +} + +func (r ApiDcimRacksListRequest) AssetTagNiew(assetTagNiew []string) ApiDcimRacksListRequest { + r.assetTagNiew = &assetTagNiew + return r +} + +func (r ApiDcimRacksListRequest) AssetTagNisw(assetTagNisw []string) ApiDcimRacksListRequest { + r.assetTagNisw = &assetTagNisw + return r +} + +// Contact +func (r ApiDcimRacksListRequest) Contact(contact []int32) ApiDcimRacksListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimRacksListRequest) ContactN(contactN []int32) ApiDcimRacksListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimRacksListRequest) ContactGroup(contactGroup []int32) ApiDcimRacksListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimRacksListRequest) ContactGroupN(contactGroupN []int32) ApiDcimRacksListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimRacksListRequest) ContactRole(contactRole []int32) ApiDcimRacksListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimRacksListRequest) ContactRoleN(contactRoleN []int32) ApiDcimRacksListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimRacksListRequest) Created(created []time.Time) ApiDcimRacksListRequest { + r.created = &created + return r +} + +func (r ApiDcimRacksListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimRacksListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimRacksListRequest) CreatedGt(createdGt []time.Time) ApiDcimRacksListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimRacksListRequest) CreatedGte(createdGte []time.Time) ApiDcimRacksListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimRacksListRequest) CreatedLt(createdLt []time.Time) ApiDcimRacksListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimRacksListRequest) CreatedLte(createdLte []time.Time) ApiDcimRacksListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimRacksListRequest) CreatedN(createdN []time.Time) ApiDcimRacksListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimRacksListRequest) CreatedByRequest(createdByRequest string) ApiDcimRacksListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimRacksListRequest) DescUnits(descUnits bool) ApiDcimRacksListRequest { + r.descUnits = &descUnits + return r +} + +func (r ApiDcimRacksListRequest) Description(description []string) ApiDcimRacksListRequest { + r.description = &description + return r +} + +func (r ApiDcimRacksListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimRacksListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimRacksListRequest) DescriptionIc(descriptionIc []string) ApiDcimRacksListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimRacksListRequest) DescriptionIe(descriptionIe []string) ApiDcimRacksListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimRacksListRequest) DescriptionIew(descriptionIew []string) ApiDcimRacksListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimRacksListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimRacksListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimRacksListRequest) DescriptionN(descriptionN []string) ApiDcimRacksListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimRacksListRequest) DescriptionNic(descriptionNic []string) ApiDcimRacksListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimRacksListRequest) DescriptionNie(descriptionNie []string) ApiDcimRacksListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimRacksListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimRacksListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimRacksListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimRacksListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimRacksListRequest) FacilityId(facilityId []string) ApiDcimRacksListRequest { + r.facilityId = &facilityId + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdEmpty(facilityIdEmpty bool) ApiDcimRacksListRequest { + r.facilityIdEmpty = &facilityIdEmpty + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdIc(facilityIdIc []string) ApiDcimRacksListRequest { + r.facilityIdIc = &facilityIdIc + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdIe(facilityIdIe []string) ApiDcimRacksListRequest { + r.facilityIdIe = &facilityIdIe + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdIew(facilityIdIew []string) ApiDcimRacksListRequest { + r.facilityIdIew = &facilityIdIew + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdIsw(facilityIdIsw []string) ApiDcimRacksListRequest { + r.facilityIdIsw = &facilityIdIsw + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdN(facilityIdN []string) ApiDcimRacksListRequest { + r.facilityIdN = &facilityIdN + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdNic(facilityIdNic []string) ApiDcimRacksListRequest { + r.facilityIdNic = &facilityIdNic + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdNie(facilityIdNie []string) ApiDcimRacksListRequest { + r.facilityIdNie = &facilityIdNie + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdNiew(facilityIdNiew []string) ApiDcimRacksListRequest { + r.facilityIdNiew = &facilityIdNiew + return r +} + +func (r ApiDcimRacksListRequest) FacilityIdNisw(facilityIdNisw []string) ApiDcimRacksListRequest { + r.facilityIdNisw = &facilityIdNisw + return r +} + +func (r ApiDcimRacksListRequest) Id(id []int32) ApiDcimRacksListRequest { + r.id = &id + return r +} + +func (r ApiDcimRacksListRequest) IdEmpty(idEmpty bool) ApiDcimRacksListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimRacksListRequest) IdGt(idGt []int32) ApiDcimRacksListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimRacksListRequest) IdGte(idGte []int32) ApiDcimRacksListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimRacksListRequest) IdLt(idLt []int32) ApiDcimRacksListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimRacksListRequest) IdLte(idLte []int32) ApiDcimRacksListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimRacksListRequest) IdN(idN []int32) ApiDcimRacksListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimRacksListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimRacksListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimRacksListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimRacksListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimRacksListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimRacksListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimRacksListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimRacksListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimRacksListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimRacksListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimRacksListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimRacksListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimRacksListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimRacksListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimRacksListRequest) Limit(limit int32) ApiDcimRacksListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimRacksListRequest) Location(location []int32) ApiDcimRacksListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimRacksListRequest) LocationN(locationN []int32) ApiDcimRacksListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimRacksListRequest) LocationId(locationId []int32) ApiDcimRacksListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimRacksListRequest) LocationIdN(locationIdN []int32) ApiDcimRacksListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimRacksListRequest) MaxWeight(maxWeight []int32) ApiDcimRacksListRequest { + r.maxWeight = &maxWeight + return r +} + +func (r ApiDcimRacksListRequest) MaxWeightEmpty(maxWeightEmpty bool) ApiDcimRacksListRequest { + r.maxWeightEmpty = &maxWeightEmpty + return r +} + +func (r ApiDcimRacksListRequest) MaxWeightGt(maxWeightGt []int32) ApiDcimRacksListRequest { + r.maxWeightGt = &maxWeightGt + return r +} + +func (r ApiDcimRacksListRequest) MaxWeightGte(maxWeightGte []int32) ApiDcimRacksListRequest { + r.maxWeightGte = &maxWeightGte + return r +} + +func (r ApiDcimRacksListRequest) MaxWeightLt(maxWeightLt []int32) ApiDcimRacksListRequest { + r.maxWeightLt = &maxWeightLt + return r +} + +func (r ApiDcimRacksListRequest) MaxWeightLte(maxWeightLte []int32) ApiDcimRacksListRequest { + r.maxWeightLte = &maxWeightLte + return r +} + +func (r ApiDcimRacksListRequest) MaxWeightN(maxWeightN []int32) ApiDcimRacksListRequest { + r.maxWeightN = &maxWeightN + return r +} + +func (r ApiDcimRacksListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimRacksListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimRacksListRequest) MountingDepth(mountingDepth []int32) ApiDcimRacksListRequest { + r.mountingDepth = &mountingDepth + return r +} + +func (r ApiDcimRacksListRequest) MountingDepthEmpty(mountingDepthEmpty bool) ApiDcimRacksListRequest { + r.mountingDepthEmpty = &mountingDepthEmpty + return r +} + +func (r ApiDcimRacksListRequest) MountingDepthGt(mountingDepthGt []int32) ApiDcimRacksListRequest { + r.mountingDepthGt = &mountingDepthGt + return r +} + +func (r ApiDcimRacksListRequest) MountingDepthGte(mountingDepthGte []int32) ApiDcimRacksListRequest { + r.mountingDepthGte = &mountingDepthGte + return r +} + +func (r ApiDcimRacksListRequest) MountingDepthLt(mountingDepthLt []int32) ApiDcimRacksListRequest { + r.mountingDepthLt = &mountingDepthLt + return r +} + +func (r ApiDcimRacksListRequest) MountingDepthLte(mountingDepthLte []int32) ApiDcimRacksListRequest { + r.mountingDepthLte = &mountingDepthLte + return r +} + +func (r ApiDcimRacksListRequest) MountingDepthN(mountingDepthN []int32) ApiDcimRacksListRequest { + r.mountingDepthN = &mountingDepthN + return r +} + +func (r ApiDcimRacksListRequest) Name(name []string) ApiDcimRacksListRequest { + r.name = &name + return r +} + +func (r ApiDcimRacksListRequest) NameEmpty(nameEmpty bool) ApiDcimRacksListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimRacksListRequest) NameIc(nameIc []string) ApiDcimRacksListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimRacksListRequest) NameIe(nameIe []string) ApiDcimRacksListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimRacksListRequest) NameIew(nameIew []string) ApiDcimRacksListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimRacksListRequest) NameIsw(nameIsw []string) ApiDcimRacksListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimRacksListRequest) NameN(nameN []string) ApiDcimRacksListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimRacksListRequest) NameNic(nameNic []string) ApiDcimRacksListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimRacksListRequest) NameNie(nameNie []string) ApiDcimRacksListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimRacksListRequest) NameNiew(nameNiew []string) ApiDcimRacksListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimRacksListRequest) NameNisw(nameNisw []string) ApiDcimRacksListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimRacksListRequest) Offset(offset int32) ApiDcimRacksListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimRacksListRequest) Ordering(ordering string) ApiDcimRacksListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimRacksListRequest) OuterDepth(outerDepth []int32) ApiDcimRacksListRequest { + r.outerDepth = &outerDepth + return r +} + +func (r ApiDcimRacksListRequest) OuterDepthEmpty(outerDepthEmpty bool) ApiDcimRacksListRequest { + r.outerDepthEmpty = &outerDepthEmpty + return r +} + +func (r ApiDcimRacksListRequest) OuterDepthGt(outerDepthGt []int32) ApiDcimRacksListRequest { + r.outerDepthGt = &outerDepthGt + return r +} + +func (r ApiDcimRacksListRequest) OuterDepthGte(outerDepthGte []int32) ApiDcimRacksListRequest { + r.outerDepthGte = &outerDepthGte + return r +} + +func (r ApiDcimRacksListRequest) OuterDepthLt(outerDepthLt []int32) ApiDcimRacksListRequest { + r.outerDepthLt = &outerDepthLt + return r +} + +func (r ApiDcimRacksListRequest) OuterDepthLte(outerDepthLte []int32) ApiDcimRacksListRequest { + r.outerDepthLte = &outerDepthLte + return r +} + +func (r ApiDcimRacksListRequest) OuterDepthN(outerDepthN []int32) ApiDcimRacksListRequest { + r.outerDepthN = &outerDepthN + return r +} + +func (r ApiDcimRacksListRequest) OuterUnit(outerUnit string) ApiDcimRacksListRequest { + r.outerUnit = &outerUnit + return r +} + +func (r ApiDcimRacksListRequest) OuterUnitN(outerUnitN string) ApiDcimRacksListRequest { + r.outerUnitN = &outerUnitN + return r +} + +func (r ApiDcimRacksListRequest) OuterWidth(outerWidth []int32) ApiDcimRacksListRequest { + r.outerWidth = &outerWidth + return r +} + +func (r ApiDcimRacksListRequest) OuterWidthEmpty(outerWidthEmpty bool) ApiDcimRacksListRequest { + r.outerWidthEmpty = &outerWidthEmpty + return r +} + +func (r ApiDcimRacksListRequest) OuterWidthGt(outerWidthGt []int32) ApiDcimRacksListRequest { + r.outerWidthGt = &outerWidthGt + return r +} + +func (r ApiDcimRacksListRequest) OuterWidthGte(outerWidthGte []int32) ApiDcimRacksListRequest { + r.outerWidthGte = &outerWidthGte + return r +} + +func (r ApiDcimRacksListRequest) OuterWidthLt(outerWidthLt []int32) ApiDcimRacksListRequest { + r.outerWidthLt = &outerWidthLt + return r +} + +func (r ApiDcimRacksListRequest) OuterWidthLte(outerWidthLte []int32) ApiDcimRacksListRequest { + r.outerWidthLte = &outerWidthLte + return r +} + +func (r ApiDcimRacksListRequest) OuterWidthN(outerWidthN []int32) ApiDcimRacksListRequest { + r.outerWidthN = &outerWidthN + return r +} + +// Search +func (r ApiDcimRacksListRequest) Q(q string) ApiDcimRacksListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiDcimRacksListRequest) Region(region []int32) ApiDcimRacksListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimRacksListRequest) RegionN(regionN []int32) ApiDcimRacksListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimRacksListRequest) RegionId(regionId []int32) ApiDcimRacksListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimRacksListRequest) RegionIdN(regionIdN []int32) ApiDcimRacksListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Role (slug) +func (r ApiDcimRacksListRequest) Role(role []string) ApiDcimRacksListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiDcimRacksListRequest) RoleN(roleN []string) ApiDcimRacksListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiDcimRacksListRequest) RoleId(roleId []*int32) ApiDcimRacksListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiDcimRacksListRequest) RoleIdN(roleIdN []*int32) ApiDcimRacksListRequest { + r.roleIdN = &roleIdN + return r +} + +func (r ApiDcimRacksListRequest) Serial(serial []string) ApiDcimRacksListRequest { + r.serial = &serial + return r +} + +func (r ApiDcimRacksListRequest) SerialEmpty(serialEmpty bool) ApiDcimRacksListRequest { + r.serialEmpty = &serialEmpty + return r +} + +func (r ApiDcimRacksListRequest) SerialIc(serialIc []string) ApiDcimRacksListRequest { + r.serialIc = &serialIc + return r +} + +func (r ApiDcimRacksListRequest) SerialIe(serialIe []string) ApiDcimRacksListRequest { + r.serialIe = &serialIe + return r +} + +func (r ApiDcimRacksListRequest) SerialIew(serialIew []string) ApiDcimRacksListRequest { + r.serialIew = &serialIew + return r +} + +func (r ApiDcimRacksListRequest) SerialIsw(serialIsw []string) ApiDcimRacksListRequest { + r.serialIsw = &serialIsw + return r +} + +func (r ApiDcimRacksListRequest) SerialN(serialN []string) ApiDcimRacksListRequest { + r.serialN = &serialN + return r +} + +func (r ApiDcimRacksListRequest) SerialNic(serialNic []string) ApiDcimRacksListRequest { + r.serialNic = &serialNic + return r +} + +func (r ApiDcimRacksListRequest) SerialNie(serialNie []string) ApiDcimRacksListRequest { + r.serialNie = &serialNie + return r +} + +func (r ApiDcimRacksListRequest) SerialNiew(serialNiew []string) ApiDcimRacksListRequest { + r.serialNiew = &serialNiew + return r +} + +func (r ApiDcimRacksListRequest) SerialNisw(serialNisw []string) ApiDcimRacksListRequest { + r.serialNisw = &serialNisw + return r +} + +// Site (slug) +func (r ApiDcimRacksListRequest) Site(site []string) ApiDcimRacksListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiDcimRacksListRequest) SiteN(siteN []string) ApiDcimRacksListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimRacksListRequest) SiteGroup(siteGroup []int32) ApiDcimRacksListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimRacksListRequest) SiteGroupN(siteGroupN []int32) ApiDcimRacksListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimRacksListRequest) SiteGroupId(siteGroupId []int32) ApiDcimRacksListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimRacksListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimRacksListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimRacksListRequest) SiteId(siteId []int32) ApiDcimRacksListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimRacksListRequest) SiteIdN(siteIdN []int32) ApiDcimRacksListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimRacksListRequest) StartingUnit(startingUnit []int32) ApiDcimRacksListRequest { + r.startingUnit = &startingUnit + return r +} + +func (r ApiDcimRacksListRequest) StartingUnitEmpty(startingUnitEmpty bool) ApiDcimRacksListRequest { + r.startingUnitEmpty = &startingUnitEmpty + return r +} + +func (r ApiDcimRacksListRequest) StartingUnitGt(startingUnitGt []int32) ApiDcimRacksListRequest { + r.startingUnitGt = &startingUnitGt + return r +} + +func (r ApiDcimRacksListRequest) StartingUnitGte(startingUnitGte []int32) ApiDcimRacksListRequest { + r.startingUnitGte = &startingUnitGte + return r +} + +func (r ApiDcimRacksListRequest) StartingUnitLt(startingUnitLt []int32) ApiDcimRacksListRequest { + r.startingUnitLt = &startingUnitLt + return r +} + +func (r ApiDcimRacksListRequest) StartingUnitLte(startingUnitLte []int32) ApiDcimRacksListRequest { + r.startingUnitLte = &startingUnitLte + return r +} + +func (r ApiDcimRacksListRequest) StartingUnitN(startingUnitN []int32) ApiDcimRacksListRequest { + r.startingUnitN = &startingUnitN + return r +} + +func (r ApiDcimRacksListRequest) Status(status []string) ApiDcimRacksListRequest { + r.status = &status + return r +} + +func (r ApiDcimRacksListRequest) StatusN(statusN []string) ApiDcimRacksListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimRacksListRequest) Tag(tag []string) ApiDcimRacksListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimRacksListRequest) TagN(tagN []string) ApiDcimRacksListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimRacksListRequest) Tenant(tenant []string) ApiDcimRacksListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimRacksListRequest) TenantN(tenantN []string) ApiDcimRacksListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimRacksListRequest) TenantGroup(tenantGroup []int32) ApiDcimRacksListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimRacksListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimRacksListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimRacksListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimRacksListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimRacksListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimRacksListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimRacksListRequest) TenantId(tenantId []*int32) ApiDcimRacksListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimRacksListRequest) TenantIdN(tenantIdN []*int32) ApiDcimRacksListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimRacksListRequest) Type_(type_ []string) ApiDcimRacksListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimRacksListRequest) TypeN(typeN []string) ApiDcimRacksListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimRacksListRequest) UHeight(uHeight []int32) ApiDcimRacksListRequest { + r.uHeight = &uHeight + return r +} + +func (r ApiDcimRacksListRequest) UHeightEmpty(uHeightEmpty bool) ApiDcimRacksListRequest { + r.uHeightEmpty = &uHeightEmpty + return r +} + +func (r ApiDcimRacksListRequest) UHeightGt(uHeightGt []int32) ApiDcimRacksListRequest { + r.uHeightGt = &uHeightGt + return r +} + +func (r ApiDcimRacksListRequest) UHeightGte(uHeightGte []int32) ApiDcimRacksListRequest { + r.uHeightGte = &uHeightGte + return r +} + +func (r ApiDcimRacksListRequest) UHeightLt(uHeightLt []int32) ApiDcimRacksListRequest { + r.uHeightLt = &uHeightLt + return r +} + +func (r ApiDcimRacksListRequest) UHeightLte(uHeightLte []int32) ApiDcimRacksListRequest { + r.uHeightLte = &uHeightLte + return r +} + +func (r ApiDcimRacksListRequest) UHeightN(uHeightN []int32) ApiDcimRacksListRequest { + r.uHeightN = &uHeightN + return r +} + +func (r ApiDcimRacksListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimRacksListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimRacksListRequest) Weight(weight []float64) ApiDcimRacksListRequest { + r.weight = &weight + return r +} + +func (r ApiDcimRacksListRequest) WeightEmpty(weightEmpty bool) ApiDcimRacksListRequest { + r.weightEmpty = &weightEmpty + return r +} + +func (r ApiDcimRacksListRequest) WeightGt(weightGt []float64) ApiDcimRacksListRequest { + r.weightGt = &weightGt + return r +} + +func (r ApiDcimRacksListRequest) WeightGte(weightGte []float64) ApiDcimRacksListRequest { + r.weightGte = &weightGte + return r +} + +func (r ApiDcimRacksListRequest) WeightLt(weightLt []float64) ApiDcimRacksListRequest { + r.weightLt = &weightLt + return r +} + +func (r ApiDcimRacksListRequest) WeightLte(weightLte []float64) ApiDcimRacksListRequest { + r.weightLte = &weightLte + return r +} + +func (r ApiDcimRacksListRequest) WeightN(weightN []float64) ApiDcimRacksListRequest { + r.weightN = &weightN + return r +} + +func (r ApiDcimRacksListRequest) WeightUnit(weightUnit string) ApiDcimRacksListRequest { + r.weightUnit = &weightUnit + return r +} + +func (r ApiDcimRacksListRequest) WeightUnitN(weightUnitN string) ApiDcimRacksListRequest { + r.weightUnitN = &weightUnitN + return r +} + +// Rail-to-rail width +func (r ApiDcimRacksListRequest) Width(width []int32) ApiDcimRacksListRequest { + r.width = &width + return r +} + +// Rail-to-rail width +func (r ApiDcimRacksListRequest) WidthN(widthN []int32) ApiDcimRacksListRequest { + r.widthN = &widthN + return r +} + +func (r ApiDcimRacksListRequest) Execute() (*PaginatedRackList, *http.Response, error) { + return r.ApiService.DcimRacksListExecute(r) +} + +/* +DcimRacksList Method for DcimRacksList + +Get a list of rack objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRacksListRequest +*/ +func (a *DcimAPIService) DcimRacksList(ctx context.Context) ApiDcimRacksListRequest { + return ApiDcimRacksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRackList +func (a *DcimAPIService) DcimRacksListExecute(r ApiDcimRacksListRequest) (*PaginatedRackList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRackList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.assetTag != nil { + t := *r.assetTag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag", t, "multi") + } + } + if r.assetTagEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__empty", r.assetTagEmpty, "") + } + if r.assetTagIc != nil { + t := *r.assetTagIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ic", t, "multi") + } + } + if r.assetTagIe != nil { + t := *r.assetTagIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__ie", t, "multi") + } + } + if r.assetTagIew != nil { + t := *r.assetTagIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__iew", t, "multi") + } + } + if r.assetTagIsw != nil { + t := *r.assetTagIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__isw", t, "multi") + } + } + if r.assetTagN != nil { + t := *r.assetTagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__n", t, "multi") + } + } + if r.assetTagNic != nil { + t := *r.assetTagNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nic", t, "multi") + } + } + if r.assetTagNie != nil { + t := *r.assetTagNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nie", t, "multi") + } + } + if r.assetTagNiew != nil { + t := *r.assetTagNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__niew", t, "multi") + } + } + if r.assetTagNisw != nil { + t := *r.assetTagNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asset_tag__nisw", t, "multi") + } + } + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.descUnits != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc_units", r.descUnits, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.facilityId != nil { + t := *r.facilityId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id", t, "multi") + } + } + if r.facilityIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__empty", r.facilityIdEmpty, "") + } + if r.facilityIdIc != nil { + t := *r.facilityIdIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__ic", t, "multi") + } + } + if r.facilityIdIe != nil { + t := *r.facilityIdIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__ie", t, "multi") + } + } + if r.facilityIdIew != nil { + t := *r.facilityIdIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__iew", t, "multi") + } + } + if r.facilityIdIsw != nil { + t := *r.facilityIdIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__isw", t, "multi") + } + } + if r.facilityIdN != nil { + t := *r.facilityIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__n", t, "multi") + } + } + if r.facilityIdNic != nil { + t := *r.facilityIdNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__nic", t, "multi") + } + } + if r.facilityIdNie != nil { + t := *r.facilityIdNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__nie", t, "multi") + } + } + if r.facilityIdNiew != nil { + t := *r.facilityIdNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__niew", t, "multi") + } + } + if r.facilityIdNisw != nil { + t := *r.facilityIdNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility_id__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.maxWeight != nil { + t := *r.maxWeight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight", t, "multi") + } + } + if r.maxWeightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__empty", r.maxWeightEmpty, "") + } + if r.maxWeightGt != nil { + t := *r.maxWeightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__gt", t, "multi") + } + } + if r.maxWeightGte != nil { + t := *r.maxWeightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__gte", t, "multi") + } + } + if r.maxWeightLt != nil { + t := *r.maxWeightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__lt", t, "multi") + } + } + if r.maxWeightLte != nil { + t := *r.maxWeightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__lte", t, "multi") + } + } + if r.maxWeightN != nil { + t := *r.maxWeightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_weight__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.mountingDepth != nil { + t := *r.mountingDepth + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth", t, "multi") + } + } + if r.mountingDepthEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__empty", r.mountingDepthEmpty, "") + } + if r.mountingDepthGt != nil { + t := *r.mountingDepthGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__gt", t, "multi") + } + } + if r.mountingDepthGte != nil { + t := *r.mountingDepthGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__gte", t, "multi") + } + } + if r.mountingDepthLt != nil { + t := *r.mountingDepthLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__lt", t, "multi") + } + } + if r.mountingDepthLte != nil { + t := *r.mountingDepthLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__lte", t, "multi") + } + } + if r.mountingDepthN != nil { + t := *r.mountingDepthN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mounting_depth__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.outerDepth != nil { + t := *r.outerDepth + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth", t, "multi") + } + } + if r.outerDepthEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__empty", r.outerDepthEmpty, "") + } + if r.outerDepthGt != nil { + t := *r.outerDepthGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__gt", t, "multi") + } + } + if r.outerDepthGte != nil { + t := *r.outerDepthGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__gte", t, "multi") + } + } + if r.outerDepthLt != nil { + t := *r.outerDepthLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__lt", t, "multi") + } + } + if r.outerDepthLte != nil { + t := *r.outerDepthLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__lte", t, "multi") + } + } + if r.outerDepthN != nil { + t := *r.outerDepthN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_depth__n", t, "multi") + } + } + if r.outerUnit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_unit", r.outerUnit, "") + } + if r.outerUnitN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_unit__n", r.outerUnitN, "") + } + if r.outerWidth != nil { + t := *r.outerWidth + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width", t, "multi") + } + } + if r.outerWidthEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__empty", r.outerWidthEmpty, "") + } + if r.outerWidthGt != nil { + t := *r.outerWidthGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__gt", t, "multi") + } + } + if r.outerWidthGte != nil { + t := *r.outerWidthGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__gte", t, "multi") + } + } + if r.outerWidthLt != nil { + t := *r.outerWidthLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__lt", t, "multi") + } + } + if r.outerWidthLte != nil { + t := *r.outerWidthLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__lte", t, "multi") + } + } + if r.outerWidthN != nil { + t := *r.outerWidthN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outer_width__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.serial != nil { + t := *r.serial + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial", t, "multi") + } + } + if r.serialEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__empty", r.serialEmpty, "") + } + if r.serialIc != nil { + t := *r.serialIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ic", t, "multi") + } + } + if r.serialIe != nil { + t := *r.serialIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__ie", t, "multi") + } + } + if r.serialIew != nil { + t := *r.serialIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__iew", t, "multi") + } + } + if r.serialIsw != nil { + t := *r.serialIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__isw", t, "multi") + } + } + if r.serialN != nil { + t := *r.serialN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__n", t, "multi") + } + } + if r.serialNic != nil { + t := *r.serialNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nic", t, "multi") + } + } + if r.serialNie != nil { + t := *r.serialNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nie", t, "multi") + } + } + if r.serialNiew != nil { + t := *r.serialNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__niew", t, "multi") + } + } + if r.serialNisw != nil { + t := *r.serialNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "serial__nisw", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.startingUnit != nil { + t := *r.startingUnit + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit", t, "multi") + } + } + if r.startingUnitEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__empty", r.startingUnitEmpty, "") + } + if r.startingUnitGt != nil { + t := *r.startingUnitGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__gt", t, "multi") + } + } + if r.startingUnitGte != nil { + t := *r.startingUnitGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__gte", t, "multi") + } + } + if r.startingUnitLt != nil { + t := *r.startingUnitLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__lt", t, "multi") + } + } + if r.startingUnitLte != nil { + t := *r.startingUnitLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__lte", t, "multi") + } + } + if r.startingUnitN != nil { + t := *r.startingUnitN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "starting_unit__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.uHeight != nil { + t := *r.uHeight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height", t, "multi") + } + } + if r.uHeightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__empty", r.uHeightEmpty, "") + } + if r.uHeightGt != nil { + t := *r.uHeightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gt", t, "multi") + } + } + if r.uHeightGte != nil { + t := *r.uHeightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__gte", t, "multi") + } + } + if r.uHeightLt != nil { + t := *r.uHeightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lt", t, "multi") + } + } + if r.uHeightLte != nil { + t := *r.uHeightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__lte", t, "multi") + } + } + if r.uHeightN != nil { + t := *r.uHeightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "u_height__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.weight != nil { + t := *r.weight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", t, "multi") + } + } + if r.weightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__empty", r.weightEmpty, "") + } + if r.weightGt != nil { + t := *r.weightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", t, "multi") + } + } + if r.weightGte != nil { + t := *r.weightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", t, "multi") + } + } + if r.weightLt != nil { + t := *r.weightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", t, "multi") + } + } + if r.weightLte != nil { + t := *r.weightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", t, "multi") + } + } + if r.weightN != nil { + t := *r.weightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", t, "multi") + } + } + if r.weightUnit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight_unit", r.weightUnit, "") + } + if r.weightUnitN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight_unit__n", r.weightUnitN, "") + } + if r.width != nil { + t := *r.width + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "width", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "width", t, "multi") + } + } + if r.widthN != nil { + t := *r.widthN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "width__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "width__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableRackRequest *PatchedWritableRackRequest +} + +func (r ApiDcimRacksPartialUpdateRequest) PatchedWritableRackRequest(patchedWritableRackRequest PatchedWritableRackRequest) ApiDcimRacksPartialUpdateRequest { + r.patchedWritableRackRequest = &patchedWritableRackRequest + return r +} + +func (r ApiDcimRacksPartialUpdateRequest) Execute() (*Rack, *http.Response, error) { + return r.ApiService.DcimRacksPartialUpdateExecute(r) +} + +/* +DcimRacksPartialUpdate Method for DcimRacksPartialUpdate + +Patch a rack object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack. + @return ApiDcimRacksPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRacksPartialUpdate(ctx context.Context, id int32) ApiDcimRacksPartialUpdateRequest { + return ApiDcimRacksPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Rack +func (a *DcimAPIService) DcimRacksPartialUpdateExecute(r ApiDcimRacksPartialUpdateRequest) (*Rack, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Rack + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableRackRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRacksRetrieveRequest) Execute() (*Rack, *http.Response, error) { + return r.ApiService.DcimRacksRetrieveExecute(r) +} + +/* +DcimRacksRetrieve Method for DcimRacksRetrieve + +Get a rack object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack. + @return ApiDcimRacksRetrieveRequest +*/ +func (a *DcimAPIService) DcimRacksRetrieve(ctx context.Context, id int32) ApiDcimRacksRetrieveRequest { + return ApiDcimRacksRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Rack +func (a *DcimAPIService) DcimRacksRetrieveExecute(r ApiDcimRacksRetrieveRequest) (*Rack, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Rack + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRacksUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableRackRequest *WritableRackRequest +} + +func (r ApiDcimRacksUpdateRequest) WritableRackRequest(writableRackRequest WritableRackRequest) ApiDcimRacksUpdateRequest { + r.writableRackRequest = &writableRackRequest + return r +} + +func (r ApiDcimRacksUpdateRequest) Execute() (*Rack, *http.Response, error) { + return r.ApiService.DcimRacksUpdateExecute(r) +} + +/* +DcimRacksUpdate Method for DcimRacksUpdate + +Put a rack object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rack. + @return ApiDcimRacksUpdateRequest +*/ +func (a *DcimAPIService) DcimRacksUpdate(ctx context.Context, id int32) ApiDcimRacksUpdateRequest { + return ApiDcimRacksUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Rack +func (a *DcimAPIService) DcimRacksUpdateExecute(r ApiDcimRacksUpdateRequest) (*Rack, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Rack + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRacksUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/racks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRackRequest == nil { + return localVarReturnValue, nil, reportError("writableRackRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRackRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + rearPortTemplateRequest *[]RearPortTemplateRequest +} + +func (r ApiDcimRearPortTemplatesBulkDestroyRequest) RearPortTemplateRequest(rearPortTemplateRequest []RearPortTemplateRequest) ApiDcimRearPortTemplatesBulkDestroyRequest { + r.rearPortTemplateRequest = &rearPortTemplateRequest + return r +} + +func (r ApiDcimRearPortTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRearPortTemplatesBulkDestroyExecute(r) +} + +/* +DcimRearPortTemplatesBulkDestroy Method for DcimRearPortTemplatesBulkDestroy + +Delete a list of rear port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortTemplatesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesBulkDestroy(ctx context.Context) ApiDcimRearPortTemplatesBulkDestroyRequest { + return ApiDcimRearPortTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRearPortTemplatesBulkDestroyExecute(r ApiDcimRearPortTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rearPortTemplateRequest == nil { + return nil, reportError("rearPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rearPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rearPortTemplateRequest *[]RearPortTemplateRequest +} + +func (r ApiDcimRearPortTemplatesBulkPartialUpdateRequest) RearPortTemplateRequest(rearPortTemplateRequest []RearPortTemplateRequest) ApiDcimRearPortTemplatesBulkPartialUpdateRequest { + r.rearPortTemplateRequest = &rearPortTemplateRequest + return r +} + +func (r ApiDcimRearPortTemplatesBulkPartialUpdateRequest) Execute() ([]RearPortTemplate, *http.Response, error) { + return r.ApiService.DcimRearPortTemplatesBulkPartialUpdateExecute(r) +} + +/* +DcimRearPortTemplatesBulkPartialUpdate Method for DcimRearPortTemplatesBulkPartialUpdate + +Patch a list of rear port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortTemplatesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesBulkPartialUpdate(ctx context.Context) ApiDcimRearPortTemplatesBulkPartialUpdateRequest { + return ApiDcimRearPortTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RearPortTemplate +func (a *DcimAPIService) DcimRearPortTemplatesBulkPartialUpdateExecute(r ApiDcimRearPortTemplatesBulkPartialUpdateRequest) ([]RearPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RearPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rearPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("rearPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rearPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rearPortTemplateRequest *[]RearPortTemplateRequest +} + +func (r ApiDcimRearPortTemplatesBulkUpdateRequest) RearPortTemplateRequest(rearPortTemplateRequest []RearPortTemplateRequest) ApiDcimRearPortTemplatesBulkUpdateRequest { + r.rearPortTemplateRequest = &rearPortTemplateRequest + return r +} + +func (r ApiDcimRearPortTemplatesBulkUpdateRequest) Execute() ([]RearPortTemplate, *http.Response, error) { + return r.ApiService.DcimRearPortTemplatesBulkUpdateExecute(r) +} + +/* +DcimRearPortTemplatesBulkUpdate Method for DcimRearPortTemplatesBulkUpdate + +Put a list of rear port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortTemplatesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesBulkUpdate(ctx context.Context) ApiDcimRearPortTemplatesBulkUpdateRequest { + return ApiDcimRearPortTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RearPortTemplate +func (a *DcimAPIService) DcimRearPortTemplatesBulkUpdateExecute(r ApiDcimRearPortTemplatesBulkUpdateRequest) ([]RearPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RearPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rearPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("rearPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rearPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableRearPortTemplateRequest *WritableRearPortTemplateRequest +} + +func (r ApiDcimRearPortTemplatesCreateRequest) WritableRearPortTemplateRequest(writableRearPortTemplateRequest WritableRearPortTemplateRequest) ApiDcimRearPortTemplatesCreateRequest { + r.writableRearPortTemplateRequest = &writableRearPortTemplateRequest + return r +} + +func (r ApiDcimRearPortTemplatesCreateRequest) Execute() (*RearPortTemplate, *http.Response, error) { + return r.ApiService.DcimRearPortTemplatesCreateExecute(r) +} + +/* +DcimRearPortTemplatesCreate Method for DcimRearPortTemplatesCreate + +Post a list of rear port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortTemplatesCreateRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesCreate(ctx context.Context) ApiDcimRearPortTemplatesCreateRequest { + return ApiDcimRearPortTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RearPortTemplate +func (a *DcimAPIService) DcimRearPortTemplatesCreateExecute(r ApiDcimRearPortTemplatesCreateRequest) (*RearPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRearPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableRearPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRearPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRearPortTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRearPortTemplatesDestroyExecute(r) +} + +/* +DcimRearPortTemplatesDestroy Method for DcimRearPortTemplatesDestroy + +Delete a rear port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port template. + @return ApiDcimRearPortTemplatesDestroyRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesDestroy(ctx context.Context, id int32) ApiDcimRearPortTemplatesDestroyRequest { + return ApiDcimRearPortTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRearPortTemplatesDestroyExecute(r ApiDcimRearPortTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + devicetypeId *[]*int32 + devicetypeIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + moduletypeId *[]*int32 + moduletypeIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + positions *[]int32 + positionsEmpty *bool + positionsGt *[]int32 + positionsGte *[]int32 + positionsLt *[]int32 + positionsLte *[]int32 + positionsN *[]int32 + q *string + type_ *[]string + typeN *[]string + updatedByRequest *string +} + +func (r ApiDcimRearPortTemplatesListRequest) Color(color []string) ApiDcimRearPortTemplatesListRequest { + r.color = &color + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorEmpty(colorEmpty bool) ApiDcimRearPortTemplatesListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorIc(colorIc []string) ApiDcimRearPortTemplatesListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorIe(colorIe []string) ApiDcimRearPortTemplatesListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorIew(colorIew []string) ApiDcimRearPortTemplatesListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorIsw(colorIsw []string) ApiDcimRearPortTemplatesListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorN(colorN []string) ApiDcimRearPortTemplatesListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorNic(colorNic []string) ApiDcimRearPortTemplatesListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorNie(colorNie []string) ApiDcimRearPortTemplatesListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorNiew(colorNiew []string) ApiDcimRearPortTemplatesListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ColorNisw(colorNisw []string) ApiDcimRearPortTemplatesListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) Created(created []time.Time) ApiDcimRearPortTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimRearPortTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiDcimRearPortTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiDcimRearPortTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiDcimRearPortTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiDcimRearPortTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) CreatedN(createdN []time.Time) ApiDcimRearPortTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiDcimRearPortTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) Description(description []string) ApiDcimRearPortTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimRearPortTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionN(descriptionN []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimRearPortTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type (ID) +func (r ApiDcimRearPortTemplatesListRequest) DevicetypeId(devicetypeId []*int32) ApiDcimRearPortTemplatesListRequest { + r.devicetypeId = &devicetypeId + return r +} + +// Device type (ID) +func (r ApiDcimRearPortTemplatesListRequest) DevicetypeIdN(devicetypeIdN []*int32) ApiDcimRearPortTemplatesListRequest { + r.devicetypeIdN = &devicetypeIdN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) Id(id []int32) ApiDcimRearPortTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) IdEmpty(idEmpty bool) ApiDcimRearPortTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) IdGt(idGt []int32) ApiDcimRearPortTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) IdGte(idGte []int32) ApiDcimRearPortTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) IdLt(idLt []int32) ApiDcimRearPortTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) IdLte(idLte []int32) ApiDcimRearPortTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) IdN(idN []int32) ApiDcimRearPortTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimRearPortTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimRearPortTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimRearPortTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimRearPortTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimRearPortTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimRearPortTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimRearPortTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimRearPortTemplatesListRequest) Limit(limit int32) ApiDcimRearPortTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimRearPortTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module type (ID) +func (r ApiDcimRearPortTemplatesListRequest) ModuletypeId(moduletypeId []*int32) ApiDcimRearPortTemplatesListRequest { + r.moduletypeId = &moduletypeId + return r +} + +// Module type (ID) +func (r ApiDcimRearPortTemplatesListRequest) ModuletypeIdN(moduletypeIdN []*int32) ApiDcimRearPortTemplatesListRequest { + r.moduletypeIdN = &moduletypeIdN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) Name(name []string) ApiDcimRearPortTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameEmpty(nameEmpty bool) ApiDcimRearPortTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameIc(nameIc []string) ApiDcimRearPortTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameIe(nameIe []string) ApiDcimRearPortTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameIew(nameIew []string) ApiDcimRearPortTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameIsw(nameIsw []string) ApiDcimRearPortTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameN(nameN []string) ApiDcimRearPortTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameNic(nameNic []string) ApiDcimRearPortTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameNie(nameNie []string) ApiDcimRearPortTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameNiew(nameNiew []string) ApiDcimRearPortTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) NameNisw(nameNisw []string) ApiDcimRearPortTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimRearPortTemplatesListRequest) Offset(offset int32) ApiDcimRearPortTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimRearPortTemplatesListRequest) Ordering(ordering string) ApiDcimRearPortTemplatesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) Positions(positions []int32) ApiDcimRearPortTemplatesListRequest { + r.positions = &positions + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) PositionsEmpty(positionsEmpty bool) ApiDcimRearPortTemplatesListRequest { + r.positionsEmpty = &positionsEmpty + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) PositionsGt(positionsGt []int32) ApiDcimRearPortTemplatesListRequest { + r.positionsGt = &positionsGt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) PositionsGte(positionsGte []int32) ApiDcimRearPortTemplatesListRequest { + r.positionsGte = &positionsGte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) PositionsLt(positionsLt []int32) ApiDcimRearPortTemplatesListRequest { + r.positionsLt = &positionsLt + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) PositionsLte(positionsLte []int32) ApiDcimRearPortTemplatesListRequest { + r.positionsLte = &positionsLte + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) PositionsN(positionsN []int32) ApiDcimRearPortTemplatesListRequest { + r.positionsN = &positionsN + return r +} + +// Search +func (r ApiDcimRearPortTemplatesListRequest) Q(q string) ApiDcimRearPortTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) Type_(type_ []string) ApiDcimRearPortTemplatesListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) TypeN(typeN []string) ApiDcimRearPortTemplatesListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimRearPortTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimRearPortTemplatesListRequest) Execute() (*PaginatedRearPortTemplateList, *http.Response, error) { + return r.ApiService.DcimRearPortTemplatesListExecute(r) +} + +/* +DcimRearPortTemplatesList Method for DcimRearPortTemplatesList + +Get a list of rear port template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortTemplatesListRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesList(ctx context.Context) ApiDcimRearPortTemplatesListRequest { + return ApiDcimRearPortTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRearPortTemplateList +func (a *DcimAPIService) DcimRearPortTemplatesListExecute(r ApiDcimRearPortTemplatesListRequest) (*PaginatedRearPortTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRearPortTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.devicetypeId != nil { + t := *r.devicetypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id", t, "multi") + } + } + if r.devicetypeIdN != nil { + t := *r.devicetypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "devicetype_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduletypeId != nil { + t := *r.moduletypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id", t, "multi") + } + } + if r.moduletypeIdN != nil { + t := *r.moduletypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "moduletype_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.positions != nil { + t := *r.positions + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions", t, "multi") + } + } + if r.positionsEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__empty", r.positionsEmpty, "") + } + if r.positionsGt != nil { + t := *r.positionsGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gt", t, "multi") + } + } + if r.positionsGte != nil { + t := *r.positionsGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gte", t, "multi") + } + } + if r.positionsLt != nil { + t := *r.positionsLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lt", t, "multi") + } + } + if r.positionsLte != nil { + t := *r.positionsLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lte", t, "multi") + } + } + if r.positionsN != nil { + t := *r.positionsN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableRearPortTemplateRequest *PatchedWritableRearPortTemplateRequest +} + +func (r ApiDcimRearPortTemplatesPartialUpdateRequest) PatchedWritableRearPortTemplateRequest(patchedWritableRearPortTemplateRequest PatchedWritableRearPortTemplateRequest) ApiDcimRearPortTemplatesPartialUpdateRequest { + r.patchedWritableRearPortTemplateRequest = &patchedWritableRearPortTemplateRequest + return r +} + +func (r ApiDcimRearPortTemplatesPartialUpdateRequest) Execute() (*RearPortTemplate, *http.Response, error) { + return r.ApiService.DcimRearPortTemplatesPartialUpdateExecute(r) +} + +/* +DcimRearPortTemplatesPartialUpdate Method for DcimRearPortTemplatesPartialUpdate + +Patch a rear port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port template. + @return ApiDcimRearPortTemplatesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesPartialUpdate(ctx context.Context, id int32) ApiDcimRearPortTemplatesPartialUpdateRequest { + return ApiDcimRearPortTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RearPortTemplate +func (a *DcimAPIService) DcimRearPortTemplatesPartialUpdateExecute(r ApiDcimRearPortTemplatesPartialUpdateRequest) (*RearPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableRearPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRearPortTemplatesRetrieveRequest) Execute() (*RearPortTemplate, *http.Response, error) { + return r.ApiService.DcimRearPortTemplatesRetrieveExecute(r) +} + +/* +DcimRearPortTemplatesRetrieve Method for DcimRearPortTemplatesRetrieve + +Get a rear port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port template. + @return ApiDcimRearPortTemplatesRetrieveRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesRetrieve(ctx context.Context, id int32) ApiDcimRearPortTemplatesRetrieveRequest { + return ApiDcimRearPortTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RearPortTemplate +func (a *DcimAPIService) DcimRearPortTemplatesRetrieveExecute(r ApiDcimRearPortTemplatesRetrieveRequest) (*RearPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortTemplatesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableRearPortTemplateRequest *WritableRearPortTemplateRequest +} + +func (r ApiDcimRearPortTemplatesUpdateRequest) WritableRearPortTemplateRequest(writableRearPortTemplateRequest WritableRearPortTemplateRequest) ApiDcimRearPortTemplatesUpdateRequest { + r.writableRearPortTemplateRequest = &writableRearPortTemplateRequest + return r +} + +func (r ApiDcimRearPortTemplatesUpdateRequest) Execute() (*RearPortTemplate, *http.Response, error) { + return r.ApiService.DcimRearPortTemplatesUpdateExecute(r) +} + +/* +DcimRearPortTemplatesUpdate Method for DcimRearPortTemplatesUpdate + +Put a rear port template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port template. + @return ApiDcimRearPortTemplatesUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortTemplatesUpdate(ctx context.Context, id int32) ApiDcimRearPortTemplatesUpdateRequest { + return ApiDcimRearPortTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RearPortTemplate +func (a *DcimAPIService) DcimRearPortTemplatesUpdateExecute(r ApiDcimRearPortTemplatesUpdateRequest) (*RearPortTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPortTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-port-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRearPortTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableRearPortTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRearPortTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + rearPortRequest *[]RearPortRequest +} + +func (r ApiDcimRearPortsBulkDestroyRequest) RearPortRequest(rearPortRequest []RearPortRequest) ApiDcimRearPortsBulkDestroyRequest { + r.rearPortRequest = &rearPortRequest + return r +} + +func (r ApiDcimRearPortsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRearPortsBulkDestroyExecute(r) +} + +/* +DcimRearPortsBulkDestroy Method for DcimRearPortsBulkDestroy + +Delete a list of rear port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimRearPortsBulkDestroy(ctx context.Context) ApiDcimRearPortsBulkDestroyRequest { + return ApiDcimRearPortsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRearPortsBulkDestroyExecute(r ApiDcimRearPortsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rearPortRequest == nil { + return nil, reportError("rearPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rearPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRearPortsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rearPortRequest *[]RearPortRequest +} + +func (r ApiDcimRearPortsBulkPartialUpdateRequest) RearPortRequest(rearPortRequest []RearPortRequest) ApiDcimRearPortsBulkPartialUpdateRequest { + r.rearPortRequest = &rearPortRequest + return r +} + +func (r ApiDcimRearPortsBulkPartialUpdateRequest) Execute() ([]RearPort, *http.Response, error) { + return r.ApiService.DcimRearPortsBulkPartialUpdateExecute(r) +} + +/* +DcimRearPortsBulkPartialUpdate Method for DcimRearPortsBulkPartialUpdate + +Patch a list of rear port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortsBulkPartialUpdate(ctx context.Context) ApiDcimRearPortsBulkPartialUpdateRequest { + return ApiDcimRearPortsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RearPort +func (a *DcimAPIService) DcimRearPortsBulkPartialUpdateExecute(r ApiDcimRearPortsBulkPartialUpdateRequest) ([]RearPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RearPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rearPortRequest == nil { + return localVarReturnValue, nil, reportError("rearPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rearPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + rearPortRequest *[]RearPortRequest +} + +func (r ApiDcimRearPortsBulkUpdateRequest) RearPortRequest(rearPortRequest []RearPortRequest) ApiDcimRearPortsBulkUpdateRequest { + r.rearPortRequest = &rearPortRequest + return r +} + +func (r ApiDcimRearPortsBulkUpdateRequest) Execute() ([]RearPort, *http.Response, error) { + return r.ApiService.DcimRearPortsBulkUpdateExecute(r) +} + +/* +DcimRearPortsBulkUpdate Method for DcimRearPortsBulkUpdate + +Put a list of rear port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortsBulkUpdate(ctx context.Context) ApiDcimRearPortsBulkUpdateRequest { + return ApiDcimRearPortsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RearPort +func (a *DcimAPIService) DcimRearPortsBulkUpdateExecute(r ApiDcimRearPortsBulkUpdateRequest) ([]RearPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RearPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rearPortRequest == nil { + return localVarReturnValue, nil, reportError("rearPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rearPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableRearPortRequest *WritableRearPortRequest +} + +func (r ApiDcimRearPortsCreateRequest) WritableRearPortRequest(writableRearPortRequest WritableRearPortRequest) ApiDcimRearPortsCreateRequest { + r.writableRearPortRequest = &writableRearPortRequest + return r +} + +func (r ApiDcimRearPortsCreateRequest) Execute() (*RearPort, *http.Response, error) { + return r.ApiService.DcimRearPortsCreateExecute(r) +} + +/* +DcimRearPortsCreate Method for DcimRearPortsCreate + +Post a list of rear port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortsCreateRequest +*/ +func (a *DcimAPIService) DcimRearPortsCreate(ctx context.Context) ApiDcimRearPortsCreateRequest { + return ApiDcimRearPortsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RearPort +func (a *DcimAPIService) DcimRearPortsCreateExecute(r ApiDcimRearPortsCreateRequest) (*RearPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRearPortRequest == nil { + return localVarReturnValue, nil, reportError("writableRearPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRearPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRearPortsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRearPortsDestroyExecute(r) +} + +/* +DcimRearPortsDestroy Method for DcimRearPortsDestroy + +Delete a rear port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port. + @return ApiDcimRearPortsDestroyRequest +*/ +func (a *DcimAPIService) DcimRearPortsDestroy(ctx context.Context, id int32) ApiDcimRearPortsDestroyRequest { + return ApiDcimRearPortsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRearPortsDestroyExecute(r ApiDcimRearPortsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRearPortsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + cableEnd *string + cableEndN *string + cabled *bool + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + deviceRole *[]string + deviceRoleN *[]string + deviceRoleId *[]int32 + deviceRoleIdN *[]int32 + deviceType *[]string + deviceTypeN *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + label *[]string + labelEmpty *bool + labelIc *[]string + labelIe *[]string + labelIew *[]string + labelIsw *[]string + labelN *[]string + labelNic *[]string + labelNie *[]string + labelNiew *[]string + labelNisw *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + moduleId *[]*int32 + moduleIdN *[]*int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + occupied *bool + offset *int32 + ordering *string + positions *[]int32 + positionsEmpty *bool + positionsGt *[]int32 + positionsGte *[]int32 + positionsLt *[]int32 + positionsLte *[]int32 + positionsN *[]int32 + q *string + rack *[]string + rackN *[]string + rackId *[]int32 + rackIdN *[]int32 + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + type_ *[]string + typeN *[]string + updatedByRequest *string + virtualChassis *[]string + virtualChassisN *[]string + virtualChassisId *[]int32 + virtualChassisIdN *[]int32 +} + +func (r ApiDcimRearPortsListRequest) CableEnd(cableEnd string) ApiDcimRearPortsListRequest { + r.cableEnd = &cableEnd + return r +} + +func (r ApiDcimRearPortsListRequest) CableEndN(cableEndN string) ApiDcimRearPortsListRequest { + r.cableEndN = &cableEndN + return r +} + +func (r ApiDcimRearPortsListRequest) Cabled(cabled bool) ApiDcimRearPortsListRequest { + r.cabled = &cabled + return r +} + +func (r ApiDcimRearPortsListRequest) Color(color []string) ApiDcimRearPortsListRequest { + r.color = &color + return r +} + +func (r ApiDcimRearPortsListRequest) ColorEmpty(colorEmpty bool) ApiDcimRearPortsListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) ColorIc(colorIc []string) ApiDcimRearPortsListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiDcimRearPortsListRequest) ColorIe(colorIe []string) ApiDcimRearPortsListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiDcimRearPortsListRequest) ColorIew(colorIew []string) ApiDcimRearPortsListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiDcimRearPortsListRequest) ColorIsw(colorIsw []string) ApiDcimRearPortsListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiDcimRearPortsListRequest) ColorN(colorN []string) ApiDcimRearPortsListRequest { + r.colorN = &colorN + return r +} + +func (r ApiDcimRearPortsListRequest) ColorNic(colorNic []string) ApiDcimRearPortsListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiDcimRearPortsListRequest) ColorNie(colorNie []string) ApiDcimRearPortsListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiDcimRearPortsListRequest) ColorNiew(colorNiew []string) ApiDcimRearPortsListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiDcimRearPortsListRequest) ColorNisw(colorNisw []string) ApiDcimRearPortsListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiDcimRearPortsListRequest) Created(created []time.Time) ApiDcimRearPortsListRequest { + r.created = &created + return r +} + +func (r ApiDcimRearPortsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimRearPortsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) CreatedGt(createdGt []time.Time) ApiDcimRearPortsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimRearPortsListRequest) CreatedGte(createdGte []time.Time) ApiDcimRearPortsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimRearPortsListRequest) CreatedLt(createdLt []time.Time) ApiDcimRearPortsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimRearPortsListRequest) CreatedLte(createdLte []time.Time) ApiDcimRearPortsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimRearPortsListRequest) CreatedN(createdN []time.Time) ApiDcimRearPortsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimRearPortsListRequest) CreatedByRequest(createdByRequest string) ApiDcimRearPortsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimRearPortsListRequest) Description(description []string) ApiDcimRearPortsListRequest { + r.description = &description + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimRearPortsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionIc(descriptionIc []string) ApiDcimRearPortsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionIe(descriptionIe []string) ApiDcimRearPortsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionIew(descriptionIew []string) ApiDcimRearPortsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimRearPortsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionN(descriptionN []string) ApiDcimRearPortsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionNic(descriptionNic []string) ApiDcimRearPortsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionNie(descriptionNie []string) ApiDcimRearPortsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimRearPortsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimRearPortsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimRearPortsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiDcimRearPortsListRequest) Device(device []*string) ApiDcimRearPortsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiDcimRearPortsListRequest) DeviceN(deviceN []*string) ApiDcimRearPortsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiDcimRearPortsListRequest) DeviceId(deviceId []int32) ApiDcimRearPortsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiDcimRearPortsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimRearPortsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Device role (slug) +func (r ApiDcimRearPortsListRequest) DeviceRole(deviceRole []string) ApiDcimRearPortsListRequest { + r.deviceRole = &deviceRole + return r +} + +// Device role (slug) +func (r ApiDcimRearPortsListRequest) DeviceRoleN(deviceRoleN []string) ApiDcimRearPortsListRequest { + r.deviceRoleN = &deviceRoleN + return r +} + +// Device role (ID) +func (r ApiDcimRearPortsListRequest) DeviceRoleId(deviceRoleId []int32) ApiDcimRearPortsListRequest { + r.deviceRoleId = &deviceRoleId + return r +} + +// Device role (ID) +func (r ApiDcimRearPortsListRequest) DeviceRoleIdN(deviceRoleIdN []int32) ApiDcimRearPortsListRequest { + r.deviceRoleIdN = &deviceRoleIdN + return r +} + +// Device type (model) +func (r ApiDcimRearPortsListRequest) DeviceType(deviceType []string) ApiDcimRearPortsListRequest { + r.deviceType = &deviceType + return r +} + +// Device type (model) +func (r ApiDcimRearPortsListRequest) DeviceTypeN(deviceTypeN []string) ApiDcimRearPortsListRequest { + r.deviceTypeN = &deviceTypeN + return r +} + +// Device type (ID) +func (r ApiDcimRearPortsListRequest) DeviceTypeId(deviceTypeId []int32) ApiDcimRearPortsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type (ID) +func (r ApiDcimRearPortsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiDcimRearPortsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiDcimRearPortsListRequest) Id(id []int32) ApiDcimRearPortsListRequest { + r.id = &id + return r +} + +func (r ApiDcimRearPortsListRequest) IdEmpty(idEmpty bool) ApiDcimRearPortsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) IdGt(idGt []int32) ApiDcimRearPortsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimRearPortsListRequest) IdGte(idGte []int32) ApiDcimRearPortsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimRearPortsListRequest) IdLt(idLt []int32) ApiDcimRearPortsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimRearPortsListRequest) IdLte(idLte []int32) ApiDcimRearPortsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimRearPortsListRequest) IdN(idN []int32) ApiDcimRearPortsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimRearPortsListRequest) Label(label []string) ApiDcimRearPortsListRequest { + r.label = &label + return r +} + +func (r ApiDcimRearPortsListRequest) LabelEmpty(labelEmpty bool) ApiDcimRearPortsListRequest { + r.labelEmpty = &labelEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) LabelIc(labelIc []string) ApiDcimRearPortsListRequest { + r.labelIc = &labelIc + return r +} + +func (r ApiDcimRearPortsListRequest) LabelIe(labelIe []string) ApiDcimRearPortsListRequest { + r.labelIe = &labelIe + return r +} + +func (r ApiDcimRearPortsListRequest) LabelIew(labelIew []string) ApiDcimRearPortsListRequest { + r.labelIew = &labelIew + return r +} + +func (r ApiDcimRearPortsListRequest) LabelIsw(labelIsw []string) ApiDcimRearPortsListRequest { + r.labelIsw = &labelIsw + return r +} + +func (r ApiDcimRearPortsListRequest) LabelN(labelN []string) ApiDcimRearPortsListRequest { + r.labelN = &labelN + return r +} + +func (r ApiDcimRearPortsListRequest) LabelNic(labelNic []string) ApiDcimRearPortsListRequest { + r.labelNic = &labelNic + return r +} + +func (r ApiDcimRearPortsListRequest) LabelNie(labelNie []string) ApiDcimRearPortsListRequest { + r.labelNie = &labelNie + return r +} + +func (r ApiDcimRearPortsListRequest) LabelNiew(labelNiew []string) ApiDcimRearPortsListRequest { + r.labelNiew = &labelNiew + return r +} + +func (r ApiDcimRearPortsListRequest) LabelNisw(labelNisw []string) ApiDcimRearPortsListRequest { + r.labelNisw = &labelNisw + return r +} + +func (r ApiDcimRearPortsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimRearPortsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimRearPortsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimRearPortsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimRearPortsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimRearPortsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimRearPortsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimRearPortsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimRearPortsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimRearPortsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimRearPortsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimRearPortsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimRearPortsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimRearPortsListRequest) Limit(limit int32) ApiDcimRearPortsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiDcimRearPortsListRequest) Location(location []string) ApiDcimRearPortsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiDcimRearPortsListRequest) LocationN(locationN []string) ApiDcimRearPortsListRequest { + r.locationN = &locationN + return r +} + +// Location (ID) +func (r ApiDcimRearPortsListRequest) LocationId(locationId []int32) ApiDcimRearPortsListRequest { + r.locationId = &locationId + return r +} + +// Location (ID) +func (r ApiDcimRearPortsListRequest) LocationIdN(locationIdN []int32) ApiDcimRearPortsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiDcimRearPortsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimRearPortsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// Module (ID) +func (r ApiDcimRearPortsListRequest) ModuleId(moduleId []*int32) ApiDcimRearPortsListRequest { + r.moduleId = &moduleId + return r +} + +// Module (ID) +func (r ApiDcimRearPortsListRequest) ModuleIdN(moduleIdN []*int32) ApiDcimRearPortsListRequest { + r.moduleIdN = &moduleIdN + return r +} + +func (r ApiDcimRearPortsListRequest) Name(name []string) ApiDcimRearPortsListRequest { + r.name = &name + return r +} + +func (r ApiDcimRearPortsListRequest) NameEmpty(nameEmpty bool) ApiDcimRearPortsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) NameIc(nameIc []string) ApiDcimRearPortsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimRearPortsListRequest) NameIe(nameIe []string) ApiDcimRearPortsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimRearPortsListRequest) NameIew(nameIew []string) ApiDcimRearPortsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimRearPortsListRequest) NameIsw(nameIsw []string) ApiDcimRearPortsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimRearPortsListRequest) NameN(nameN []string) ApiDcimRearPortsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimRearPortsListRequest) NameNic(nameNic []string) ApiDcimRearPortsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimRearPortsListRequest) NameNie(nameNie []string) ApiDcimRearPortsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimRearPortsListRequest) NameNiew(nameNiew []string) ApiDcimRearPortsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimRearPortsListRequest) NameNisw(nameNisw []string) ApiDcimRearPortsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiDcimRearPortsListRequest) Occupied(occupied bool) ApiDcimRearPortsListRequest { + r.occupied = &occupied + return r +} + +// The initial index from which to return the results. +func (r ApiDcimRearPortsListRequest) Offset(offset int32) ApiDcimRearPortsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimRearPortsListRequest) Ordering(ordering string) ApiDcimRearPortsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiDcimRearPortsListRequest) Positions(positions []int32) ApiDcimRearPortsListRequest { + r.positions = &positions + return r +} + +func (r ApiDcimRearPortsListRequest) PositionsEmpty(positionsEmpty bool) ApiDcimRearPortsListRequest { + r.positionsEmpty = &positionsEmpty + return r +} + +func (r ApiDcimRearPortsListRequest) PositionsGt(positionsGt []int32) ApiDcimRearPortsListRequest { + r.positionsGt = &positionsGt + return r +} + +func (r ApiDcimRearPortsListRequest) PositionsGte(positionsGte []int32) ApiDcimRearPortsListRequest { + r.positionsGte = &positionsGte + return r +} + +func (r ApiDcimRearPortsListRequest) PositionsLt(positionsLt []int32) ApiDcimRearPortsListRequest { + r.positionsLt = &positionsLt + return r +} + +func (r ApiDcimRearPortsListRequest) PositionsLte(positionsLte []int32) ApiDcimRearPortsListRequest { + r.positionsLte = &positionsLte + return r +} + +func (r ApiDcimRearPortsListRequest) PositionsN(positionsN []int32) ApiDcimRearPortsListRequest { + r.positionsN = &positionsN + return r +} + +// Search +func (r ApiDcimRearPortsListRequest) Q(q string) ApiDcimRearPortsListRequest { + r.q = &q + return r +} + +// Rack (name) +func (r ApiDcimRearPortsListRequest) Rack(rack []string) ApiDcimRearPortsListRequest { + r.rack = &rack + return r +} + +// Rack (name) +func (r ApiDcimRearPortsListRequest) RackN(rackN []string) ApiDcimRearPortsListRequest { + r.rackN = &rackN + return r +} + +// Rack (ID) +func (r ApiDcimRearPortsListRequest) RackId(rackId []int32) ApiDcimRearPortsListRequest { + r.rackId = &rackId + return r +} + +// Rack (ID) +func (r ApiDcimRearPortsListRequest) RackIdN(rackIdN []int32) ApiDcimRearPortsListRequest { + r.rackIdN = &rackIdN + return r +} + +// Region (slug) +func (r ApiDcimRearPortsListRequest) Region(region []int32) ApiDcimRearPortsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimRearPortsListRequest) RegionN(regionN []int32) ApiDcimRearPortsListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimRearPortsListRequest) RegionId(regionId []int32) ApiDcimRearPortsListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimRearPortsListRequest) RegionIdN(regionIdN []int32) ApiDcimRearPortsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Device role (slug) +func (r ApiDcimRearPortsListRequest) Role(role []string) ApiDcimRearPortsListRequest { + r.role = &role + return r +} + +// Device role (slug) +func (r ApiDcimRearPortsListRequest) RoleN(roleN []string) ApiDcimRearPortsListRequest { + r.roleN = &roleN + return r +} + +// Device role (ID) +func (r ApiDcimRearPortsListRequest) RoleId(roleId []int32) ApiDcimRearPortsListRequest { + r.roleId = &roleId + return r +} + +// Device role (ID) +func (r ApiDcimRearPortsListRequest) RoleIdN(roleIdN []int32) ApiDcimRearPortsListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site name (slug) +func (r ApiDcimRearPortsListRequest) Site(site []string) ApiDcimRearPortsListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimRearPortsListRequest) SiteN(siteN []string) ApiDcimRearPortsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimRearPortsListRequest) SiteGroup(siteGroup []int32) ApiDcimRearPortsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimRearPortsListRequest) SiteGroupN(siteGroupN []int32) ApiDcimRearPortsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimRearPortsListRequest) SiteGroupId(siteGroupId []int32) ApiDcimRearPortsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimRearPortsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimRearPortsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimRearPortsListRequest) SiteId(siteId []int32) ApiDcimRearPortsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimRearPortsListRequest) SiteIdN(siteIdN []int32) ApiDcimRearPortsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimRearPortsListRequest) Tag(tag []string) ApiDcimRearPortsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimRearPortsListRequest) TagN(tagN []string) ApiDcimRearPortsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimRearPortsListRequest) Type_(type_ []string) ApiDcimRearPortsListRequest { + r.type_ = &type_ + return r +} + +func (r ApiDcimRearPortsListRequest) TypeN(typeN []string) ApiDcimRearPortsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiDcimRearPortsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimRearPortsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual Chassis +func (r ApiDcimRearPortsListRequest) VirtualChassis(virtualChassis []string) ApiDcimRearPortsListRequest { + r.virtualChassis = &virtualChassis + return r +} + +// Virtual Chassis +func (r ApiDcimRearPortsListRequest) VirtualChassisN(virtualChassisN []string) ApiDcimRearPortsListRequest { + r.virtualChassisN = &virtualChassisN + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimRearPortsListRequest) VirtualChassisId(virtualChassisId []int32) ApiDcimRearPortsListRequest { + r.virtualChassisId = &virtualChassisId + return r +} + +// Virtual Chassis (ID) +func (r ApiDcimRearPortsListRequest) VirtualChassisIdN(virtualChassisIdN []int32) ApiDcimRearPortsListRequest { + r.virtualChassisIdN = &virtualChassisIdN + return r +} + +func (r ApiDcimRearPortsListRequest) Execute() (*PaginatedRearPortList, *http.Response, error) { + return r.ApiService.DcimRearPortsListExecute(r) +} + +/* +DcimRearPortsList Method for DcimRearPortsList + +Get a list of rear port objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRearPortsListRequest +*/ +func (a *DcimAPIService) DcimRearPortsList(ctx context.Context) ApiDcimRearPortsListRequest { + return ApiDcimRearPortsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRearPortList +func (a *DcimAPIService) DcimRearPortsListExecute(r ApiDcimRearPortsListRequest) (*PaginatedRearPortList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRearPortList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cableEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end", r.cableEnd, "") + } + if r.cableEndN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cable_end__n", r.cableEndN, "") + } + if r.cabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cabled", r.cabled, "") + } + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.deviceRole != nil { + t := *r.deviceRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role", t, "multi") + } + } + if r.deviceRoleN != nil { + t := *r.deviceRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role__n", t, "multi") + } + } + if r.deviceRoleId != nil { + t := *r.deviceRoleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id", t, "multi") + } + } + if r.deviceRoleIdN != nil { + t := *r.deviceRoleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_role_id__n", t, "multi") + } + } + if r.deviceType != nil { + t := *r.deviceType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type", t, "multi") + } + } + if r.deviceTypeN != nil { + t := *r.deviceTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type__n", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.label != nil { + t := *r.label + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", t, "multi") + } + } + if r.labelEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__empty", r.labelEmpty, "") + } + if r.labelIc != nil { + t := *r.labelIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ic", t, "multi") + } + } + if r.labelIe != nil { + t := *r.labelIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__ie", t, "multi") + } + } + if r.labelIew != nil { + t := *r.labelIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__iew", t, "multi") + } + } + if r.labelIsw != nil { + t := *r.labelIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__isw", t, "multi") + } + } + if r.labelN != nil { + t := *r.labelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__n", t, "multi") + } + } + if r.labelNic != nil { + t := *r.labelNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nic", t, "multi") + } + } + if r.labelNie != nil { + t := *r.labelNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nie", t, "multi") + } + } + if r.labelNiew != nil { + t := *r.labelNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__niew", t, "multi") + } + } + if r.labelNisw != nil { + t := *r.labelNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "label__nisw", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.moduleId != nil { + t := *r.moduleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id", t, "multi") + } + } + if r.moduleIdN != nil { + t := *r.moduleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "module_id__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.occupied != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "occupied", r.occupied, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.positions != nil { + t := *r.positions + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions", t, "multi") + } + } + if r.positionsEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__empty", r.positionsEmpty, "") + } + if r.positionsGt != nil { + t := *r.positionsGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gt", t, "multi") + } + } + if r.positionsGte != nil { + t := *r.positionsGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__gte", t, "multi") + } + } + if r.positionsLt != nil { + t := *r.positionsLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lt", t, "multi") + } + } + if r.positionsLte != nil { + t := *r.positionsLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__lte", t, "multi") + } + } + if r.positionsN != nil { + t := *r.positionsN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "positions__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + t := *r.rack + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", t, "multi") + } + } + if r.rackN != nil { + t := *r.rackN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack__n", t, "multi") + } + } + if r.rackId != nil { + t := *r.rackId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id", t, "multi") + } + } + if r.rackIdN != nil { + t := *r.rackIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack_id__n", t, "multi") + } + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualChassis != nil { + t := *r.virtualChassis + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis", t, "multi") + } + } + if r.virtualChassisN != nil { + t := *r.virtualChassisN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis__n", t, "multi") + } + } + if r.virtualChassisId != nil { + t := *r.virtualChassisId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id", t, "multi") + } + } + if r.virtualChassisIdN != nil { + t := *r.virtualChassisIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_chassis_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableRearPortRequest *PatchedWritableRearPortRequest +} + +func (r ApiDcimRearPortsPartialUpdateRequest) PatchedWritableRearPortRequest(patchedWritableRearPortRequest PatchedWritableRearPortRequest) ApiDcimRearPortsPartialUpdateRequest { + r.patchedWritableRearPortRequest = &patchedWritableRearPortRequest + return r +} + +func (r ApiDcimRearPortsPartialUpdateRequest) Execute() (*RearPort, *http.Response, error) { + return r.ApiService.DcimRearPortsPartialUpdateExecute(r) +} + +/* +DcimRearPortsPartialUpdate Method for DcimRearPortsPartialUpdate + +Patch a rear port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port. + @return ApiDcimRearPortsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortsPartialUpdate(ctx context.Context, id int32) ApiDcimRearPortsPartialUpdateRequest { + return ApiDcimRearPortsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RearPort +func (a *DcimAPIService) DcimRearPortsPartialUpdateExecute(r ApiDcimRearPortsPartialUpdateRequest) (*RearPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableRearPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsPathsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRearPortsPathsRetrieveRequest) Execute() (*RearPort, *http.Response, error) { + return r.ApiService.DcimRearPortsPathsRetrieveExecute(r) +} + +/* +DcimRearPortsPathsRetrieve Method for DcimRearPortsPathsRetrieve + +Return all CablePaths which traverse a given pass-through port. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port. + @return ApiDcimRearPortsPathsRetrieveRequest +*/ +func (a *DcimAPIService) DcimRearPortsPathsRetrieve(ctx context.Context, id int32) ApiDcimRearPortsPathsRetrieveRequest { + return ApiDcimRearPortsPathsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RearPort +func (a *DcimAPIService) DcimRearPortsPathsRetrieveExecute(r ApiDcimRearPortsPathsRetrieveRequest) (*RearPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsPathsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/{id}/paths/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRearPortsRetrieveRequest) Execute() (*RearPort, *http.Response, error) { + return r.ApiService.DcimRearPortsRetrieveExecute(r) +} + +/* +DcimRearPortsRetrieve Method for DcimRearPortsRetrieve + +Get a rear port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port. + @return ApiDcimRearPortsRetrieveRequest +*/ +func (a *DcimAPIService) DcimRearPortsRetrieve(ctx context.Context, id int32) ApiDcimRearPortsRetrieveRequest { + return ApiDcimRearPortsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RearPort +func (a *DcimAPIService) DcimRearPortsRetrieveExecute(r ApiDcimRearPortsRetrieveRequest) (*RearPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRearPortsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableRearPortRequest *WritableRearPortRequest +} + +func (r ApiDcimRearPortsUpdateRequest) WritableRearPortRequest(writableRearPortRequest WritableRearPortRequest) ApiDcimRearPortsUpdateRequest { + r.writableRearPortRequest = &writableRearPortRequest + return r +} + +func (r ApiDcimRearPortsUpdateRequest) Execute() (*RearPort, *http.Response, error) { + return r.ApiService.DcimRearPortsUpdateExecute(r) +} + +/* +DcimRearPortsUpdate Method for DcimRearPortsUpdate + +Put a rear port object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this rear port. + @return ApiDcimRearPortsUpdateRequest +*/ +func (a *DcimAPIService) DcimRearPortsUpdate(ctx context.Context, id int32) ApiDcimRearPortsUpdateRequest { + return ApiDcimRearPortsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RearPort +func (a *DcimAPIService) DcimRearPortsUpdateExecute(r ApiDcimRearPortsUpdateRequest) (*RearPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RearPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRearPortsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/rear-ports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRearPortRequest == nil { + return localVarReturnValue, nil, reportError("writableRearPortRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRearPortRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRegionsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + regionRequest *[]RegionRequest +} + +func (r ApiDcimRegionsBulkDestroyRequest) RegionRequest(regionRequest []RegionRequest) ApiDcimRegionsBulkDestroyRequest { + r.regionRequest = ®ionRequest + return r +} + +func (r ApiDcimRegionsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRegionsBulkDestroyExecute(r) +} + +/* +DcimRegionsBulkDestroy Method for DcimRegionsBulkDestroy + +Delete a list of region objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRegionsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimRegionsBulkDestroy(ctx context.Context) ApiDcimRegionsBulkDestroyRequest { + return ApiDcimRegionsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRegionsBulkDestroyExecute(r ApiDcimRegionsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.regionRequest == nil { + return nil, reportError("regionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.regionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRegionsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + regionRequest *[]RegionRequest +} + +func (r ApiDcimRegionsBulkPartialUpdateRequest) RegionRequest(regionRequest []RegionRequest) ApiDcimRegionsBulkPartialUpdateRequest { + r.regionRequest = ®ionRequest + return r +} + +func (r ApiDcimRegionsBulkPartialUpdateRequest) Execute() ([]Region, *http.Response, error) { + return r.ApiService.DcimRegionsBulkPartialUpdateExecute(r) +} + +/* +DcimRegionsBulkPartialUpdate Method for DcimRegionsBulkPartialUpdate + +Patch a list of region objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRegionsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRegionsBulkPartialUpdate(ctx context.Context) ApiDcimRegionsBulkPartialUpdateRequest { + return ApiDcimRegionsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Region +func (a *DcimAPIService) DcimRegionsBulkPartialUpdateExecute(r ApiDcimRegionsBulkPartialUpdateRequest) ([]Region, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Region + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.regionRequest == nil { + return localVarReturnValue, nil, reportError("regionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.regionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRegionsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + regionRequest *[]RegionRequest +} + +func (r ApiDcimRegionsBulkUpdateRequest) RegionRequest(regionRequest []RegionRequest) ApiDcimRegionsBulkUpdateRequest { + r.regionRequest = ®ionRequest + return r +} + +func (r ApiDcimRegionsBulkUpdateRequest) Execute() ([]Region, *http.Response, error) { + return r.ApiService.DcimRegionsBulkUpdateExecute(r) +} + +/* +DcimRegionsBulkUpdate Method for DcimRegionsBulkUpdate + +Put a list of region objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRegionsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimRegionsBulkUpdate(ctx context.Context) ApiDcimRegionsBulkUpdateRequest { + return ApiDcimRegionsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Region +func (a *DcimAPIService) DcimRegionsBulkUpdateExecute(r ApiDcimRegionsBulkUpdateRequest) ([]Region, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Region + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.regionRequest == nil { + return localVarReturnValue, nil, reportError("regionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.regionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRegionsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableRegionRequest *WritableRegionRequest +} + +func (r ApiDcimRegionsCreateRequest) WritableRegionRequest(writableRegionRequest WritableRegionRequest) ApiDcimRegionsCreateRequest { + r.writableRegionRequest = &writableRegionRequest + return r +} + +func (r ApiDcimRegionsCreateRequest) Execute() (*Region, *http.Response, error) { + return r.ApiService.DcimRegionsCreateExecute(r) +} + +/* +DcimRegionsCreate Method for DcimRegionsCreate + +Post a list of region objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRegionsCreateRequest +*/ +func (a *DcimAPIService) DcimRegionsCreate(ctx context.Context) ApiDcimRegionsCreateRequest { + return ApiDcimRegionsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Region +func (a *DcimAPIService) DcimRegionsCreateExecute(r ApiDcimRegionsCreateRequest) (*Region, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Region + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRegionRequest == nil { + return localVarReturnValue, nil, reportError("writableRegionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRegionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRegionsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRegionsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimRegionsDestroyExecute(r) +} + +/* +DcimRegionsDestroy Method for DcimRegionsDestroy + +Delete a region object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this region. + @return ApiDcimRegionsDestroyRequest +*/ +func (a *DcimAPIService) DcimRegionsDestroy(ctx context.Context, id int32) ApiDcimRegionsDestroyRequest { + return ApiDcimRegionsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimRegionsDestroyExecute(r ApiDcimRegionsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimRegionsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parent *[]string + parentN *[]string + parentId *[]*int32 + parentIdN *[]*int32 + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Contact +func (r ApiDcimRegionsListRequest) Contact(contact []int32) ApiDcimRegionsListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimRegionsListRequest) ContactN(contactN []int32) ApiDcimRegionsListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimRegionsListRequest) ContactGroup(contactGroup []int32) ApiDcimRegionsListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimRegionsListRequest) ContactGroupN(contactGroupN []int32) ApiDcimRegionsListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimRegionsListRequest) ContactRole(contactRole []int32) ApiDcimRegionsListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimRegionsListRequest) ContactRoleN(contactRoleN []int32) ApiDcimRegionsListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimRegionsListRequest) Created(created []time.Time) ApiDcimRegionsListRequest { + r.created = &created + return r +} + +func (r ApiDcimRegionsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimRegionsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimRegionsListRequest) CreatedGt(createdGt []time.Time) ApiDcimRegionsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimRegionsListRequest) CreatedGte(createdGte []time.Time) ApiDcimRegionsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimRegionsListRequest) CreatedLt(createdLt []time.Time) ApiDcimRegionsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimRegionsListRequest) CreatedLte(createdLte []time.Time) ApiDcimRegionsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimRegionsListRequest) CreatedN(createdN []time.Time) ApiDcimRegionsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimRegionsListRequest) CreatedByRequest(createdByRequest string) ApiDcimRegionsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimRegionsListRequest) Description(description []string) ApiDcimRegionsListRequest { + r.description = &description + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimRegionsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionIc(descriptionIc []string) ApiDcimRegionsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionIe(descriptionIe []string) ApiDcimRegionsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionIew(descriptionIew []string) ApiDcimRegionsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimRegionsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionN(descriptionN []string) ApiDcimRegionsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionNic(descriptionNic []string) ApiDcimRegionsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionNie(descriptionNie []string) ApiDcimRegionsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimRegionsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimRegionsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimRegionsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimRegionsListRequest) Id(id []int32) ApiDcimRegionsListRequest { + r.id = &id + return r +} + +func (r ApiDcimRegionsListRequest) IdEmpty(idEmpty bool) ApiDcimRegionsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimRegionsListRequest) IdGt(idGt []int32) ApiDcimRegionsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimRegionsListRequest) IdGte(idGte []int32) ApiDcimRegionsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimRegionsListRequest) IdLt(idLt []int32) ApiDcimRegionsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimRegionsListRequest) IdLte(idLte []int32) ApiDcimRegionsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimRegionsListRequest) IdN(idN []int32) ApiDcimRegionsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimRegionsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimRegionsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimRegionsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimRegionsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimRegionsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimRegionsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimRegionsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimRegionsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimRegionsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimRegionsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimRegionsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimRegionsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimRegionsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimRegionsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimRegionsListRequest) Limit(limit int32) ApiDcimRegionsListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimRegionsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimRegionsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimRegionsListRequest) Name(name []string) ApiDcimRegionsListRequest { + r.name = &name + return r +} + +func (r ApiDcimRegionsListRequest) NameEmpty(nameEmpty bool) ApiDcimRegionsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimRegionsListRequest) NameIc(nameIc []string) ApiDcimRegionsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimRegionsListRequest) NameIe(nameIe []string) ApiDcimRegionsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimRegionsListRequest) NameIew(nameIew []string) ApiDcimRegionsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimRegionsListRequest) NameIsw(nameIsw []string) ApiDcimRegionsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimRegionsListRequest) NameN(nameN []string) ApiDcimRegionsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimRegionsListRequest) NameNic(nameNic []string) ApiDcimRegionsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimRegionsListRequest) NameNie(nameNie []string) ApiDcimRegionsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimRegionsListRequest) NameNiew(nameNiew []string) ApiDcimRegionsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimRegionsListRequest) NameNisw(nameNisw []string) ApiDcimRegionsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimRegionsListRequest) Offset(offset int32) ApiDcimRegionsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimRegionsListRequest) Ordering(ordering string) ApiDcimRegionsListRequest { + r.ordering = &ordering + return r +} + +// Parent region (slug) +func (r ApiDcimRegionsListRequest) Parent(parent []string) ApiDcimRegionsListRequest { + r.parent = &parent + return r +} + +// Parent region (slug) +func (r ApiDcimRegionsListRequest) ParentN(parentN []string) ApiDcimRegionsListRequest { + r.parentN = &parentN + return r +} + +// Parent region (ID) +func (r ApiDcimRegionsListRequest) ParentId(parentId []*int32) ApiDcimRegionsListRequest { + r.parentId = &parentId + return r +} + +// Parent region (ID) +func (r ApiDcimRegionsListRequest) ParentIdN(parentIdN []*int32) ApiDcimRegionsListRequest { + r.parentIdN = &parentIdN + return r +} + +// Search +func (r ApiDcimRegionsListRequest) Q(q string) ApiDcimRegionsListRequest { + r.q = &q + return r +} + +func (r ApiDcimRegionsListRequest) Slug(slug []string) ApiDcimRegionsListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimRegionsListRequest) SlugEmpty(slugEmpty bool) ApiDcimRegionsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimRegionsListRequest) SlugIc(slugIc []string) ApiDcimRegionsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimRegionsListRequest) SlugIe(slugIe []string) ApiDcimRegionsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimRegionsListRequest) SlugIew(slugIew []string) ApiDcimRegionsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimRegionsListRequest) SlugIsw(slugIsw []string) ApiDcimRegionsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimRegionsListRequest) SlugN(slugN []string) ApiDcimRegionsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimRegionsListRequest) SlugNic(slugNic []string) ApiDcimRegionsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimRegionsListRequest) SlugNie(slugNie []string) ApiDcimRegionsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimRegionsListRequest) SlugNiew(slugNiew []string) ApiDcimRegionsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimRegionsListRequest) SlugNisw(slugNisw []string) ApiDcimRegionsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimRegionsListRequest) Tag(tag []string) ApiDcimRegionsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimRegionsListRequest) TagN(tagN []string) ApiDcimRegionsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimRegionsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimRegionsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimRegionsListRequest) Execute() (*PaginatedRegionList, *http.Response, error) { + return r.ApiService.DcimRegionsListExecute(r) +} + +/* +DcimRegionsList Method for DcimRegionsList + +Get a list of region objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimRegionsListRequest +*/ +func (a *DcimAPIService) DcimRegionsList(ctx context.Context) ApiDcimRegionsListRequest { + return ApiDcimRegionsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRegionList +func (a *DcimAPIService) DcimRegionsListExecute(r ApiDcimRegionsListRequest) (*PaginatedRegionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRegionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.parentN != nil { + t := *r.parentN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", t, "multi") + } + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRegionsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableRegionRequest *PatchedWritableRegionRequest +} + +func (r ApiDcimRegionsPartialUpdateRequest) PatchedWritableRegionRequest(patchedWritableRegionRequest PatchedWritableRegionRequest) ApiDcimRegionsPartialUpdateRequest { + r.patchedWritableRegionRequest = &patchedWritableRegionRequest + return r +} + +func (r ApiDcimRegionsPartialUpdateRequest) Execute() (*Region, *http.Response, error) { + return r.ApiService.DcimRegionsPartialUpdateExecute(r) +} + +/* +DcimRegionsPartialUpdate Method for DcimRegionsPartialUpdate + +Patch a region object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this region. + @return ApiDcimRegionsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimRegionsPartialUpdate(ctx context.Context, id int32) ApiDcimRegionsPartialUpdateRequest { + return ApiDcimRegionsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Region +func (a *DcimAPIService) DcimRegionsPartialUpdateExecute(r ApiDcimRegionsPartialUpdateRequest) (*Region, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Region + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableRegionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRegionsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimRegionsRetrieveRequest) Execute() (*Region, *http.Response, error) { + return r.ApiService.DcimRegionsRetrieveExecute(r) +} + +/* +DcimRegionsRetrieve Method for DcimRegionsRetrieve + +Get a region object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this region. + @return ApiDcimRegionsRetrieveRequest +*/ +func (a *DcimAPIService) DcimRegionsRetrieve(ctx context.Context, id int32) ApiDcimRegionsRetrieveRequest { + return ApiDcimRegionsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Region +func (a *DcimAPIService) DcimRegionsRetrieveExecute(r ApiDcimRegionsRetrieveRequest) (*Region, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Region + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimRegionsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableRegionRequest *WritableRegionRequest +} + +func (r ApiDcimRegionsUpdateRequest) WritableRegionRequest(writableRegionRequest WritableRegionRequest) ApiDcimRegionsUpdateRequest { + r.writableRegionRequest = &writableRegionRequest + return r +} + +func (r ApiDcimRegionsUpdateRequest) Execute() (*Region, *http.Response, error) { + return r.ApiService.DcimRegionsUpdateExecute(r) +} + +/* +DcimRegionsUpdate Method for DcimRegionsUpdate + +Put a region object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this region. + @return ApiDcimRegionsUpdateRequest +*/ +func (a *DcimAPIService) DcimRegionsUpdate(ctx context.Context, id int32) ApiDcimRegionsUpdateRequest { + return ApiDcimRegionsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Region +func (a *DcimAPIService) DcimRegionsUpdateExecute(r ApiDcimRegionsUpdateRequest) (*Region, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Region + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimRegionsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/regions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRegionRequest == nil { + return localVarReturnValue, nil, reportError("writableRegionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRegionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + siteGroupRequest *[]SiteGroupRequest +} + +func (r ApiDcimSiteGroupsBulkDestroyRequest) SiteGroupRequest(siteGroupRequest []SiteGroupRequest) ApiDcimSiteGroupsBulkDestroyRequest { + r.siteGroupRequest = &siteGroupRequest + return r +} + +func (r ApiDcimSiteGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimSiteGroupsBulkDestroyExecute(r) +} + +/* +DcimSiteGroupsBulkDestroy Method for DcimSiteGroupsBulkDestroy + +Delete a list of site group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSiteGroupsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsBulkDestroy(ctx context.Context) ApiDcimSiteGroupsBulkDestroyRequest { + return ApiDcimSiteGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimSiteGroupsBulkDestroyExecute(r ApiDcimSiteGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.siteGroupRequest == nil { + return nil, reportError("siteGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.siteGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + siteGroupRequest *[]SiteGroupRequest +} + +func (r ApiDcimSiteGroupsBulkPartialUpdateRequest) SiteGroupRequest(siteGroupRequest []SiteGroupRequest) ApiDcimSiteGroupsBulkPartialUpdateRequest { + r.siteGroupRequest = &siteGroupRequest + return r +} + +func (r ApiDcimSiteGroupsBulkPartialUpdateRequest) Execute() ([]SiteGroup, *http.Response, error) { + return r.ApiService.DcimSiteGroupsBulkPartialUpdateExecute(r) +} + +/* +DcimSiteGroupsBulkPartialUpdate Method for DcimSiteGroupsBulkPartialUpdate + +Patch a list of site group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSiteGroupsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsBulkPartialUpdate(ctx context.Context) ApiDcimSiteGroupsBulkPartialUpdateRequest { + return ApiDcimSiteGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []SiteGroup +func (a *DcimAPIService) DcimSiteGroupsBulkPartialUpdateExecute(r ApiDcimSiteGroupsBulkPartialUpdateRequest) ([]SiteGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []SiteGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.siteGroupRequest == nil { + return localVarReturnValue, nil, reportError("siteGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.siteGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + siteGroupRequest *[]SiteGroupRequest +} + +func (r ApiDcimSiteGroupsBulkUpdateRequest) SiteGroupRequest(siteGroupRequest []SiteGroupRequest) ApiDcimSiteGroupsBulkUpdateRequest { + r.siteGroupRequest = &siteGroupRequest + return r +} + +func (r ApiDcimSiteGroupsBulkUpdateRequest) Execute() ([]SiteGroup, *http.Response, error) { + return r.ApiService.DcimSiteGroupsBulkUpdateExecute(r) +} + +/* +DcimSiteGroupsBulkUpdate Method for DcimSiteGroupsBulkUpdate + +Put a list of site group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSiteGroupsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsBulkUpdate(ctx context.Context) ApiDcimSiteGroupsBulkUpdateRequest { + return ApiDcimSiteGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []SiteGroup +func (a *DcimAPIService) DcimSiteGroupsBulkUpdateExecute(r ApiDcimSiteGroupsBulkUpdateRequest) ([]SiteGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []SiteGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.siteGroupRequest == nil { + return localVarReturnValue, nil, reportError("siteGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.siteGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableSiteGroupRequest *WritableSiteGroupRequest +} + +func (r ApiDcimSiteGroupsCreateRequest) WritableSiteGroupRequest(writableSiteGroupRequest WritableSiteGroupRequest) ApiDcimSiteGroupsCreateRequest { + r.writableSiteGroupRequest = &writableSiteGroupRequest + return r +} + +func (r ApiDcimSiteGroupsCreateRequest) Execute() (*SiteGroup, *http.Response, error) { + return r.ApiService.DcimSiteGroupsCreateExecute(r) +} + +/* +DcimSiteGroupsCreate Method for DcimSiteGroupsCreate + +Post a list of site group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSiteGroupsCreateRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsCreate(ctx context.Context) ApiDcimSiteGroupsCreateRequest { + return ApiDcimSiteGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SiteGroup +func (a *DcimAPIService) DcimSiteGroupsCreateExecute(r ApiDcimSiteGroupsCreateRequest) (*SiteGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SiteGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableSiteGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableSiteGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableSiteGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimSiteGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimSiteGroupsDestroyExecute(r) +} + +/* +DcimSiteGroupsDestroy Method for DcimSiteGroupsDestroy + +Delete a site group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site group. + @return ApiDcimSiteGroupsDestroyRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsDestroy(ctx context.Context, id int32) ApiDcimSiteGroupsDestroyRequest { + return ApiDcimSiteGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimSiteGroupsDestroyExecute(r ApiDcimSiteGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parent *[]string + parentN *[]string + parentId *[]*int32 + parentIdN *[]*int32 + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Contact +func (r ApiDcimSiteGroupsListRequest) Contact(contact []int32) ApiDcimSiteGroupsListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimSiteGroupsListRequest) ContactN(contactN []int32) ApiDcimSiteGroupsListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimSiteGroupsListRequest) ContactGroup(contactGroup []int32) ApiDcimSiteGroupsListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimSiteGroupsListRequest) ContactGroupN(contactGroupN []int32) ApiDcimSiteGroupsListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimSiteGroupsListRequest) ContactRole(contactRole []int32) ApiDcimSiteGroupsListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimSiteGroupsListRequest) ContactRoleN(contactRoleN []int32) ApiDcimSiteGroupsListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimSiteGroupsListRequest) Created(created []time.Time) ApiDcimSiteGroupsListRequest { + r.created = &created + return r +} + +func (r ApiDcimSiteGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimSiteGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimSiteGroupsListRequest) CreatedGt(createdGt []time.Time) ApiDcimSiteGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimSiteGroupsListRequest) CreatedGte(createdGte []time.Time) ApiDcimSiteGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimSiteGroupsListRequest) CreatedLt(createdLt []time.Time) ApiDcimSiteGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimSiteGroupsListRequest) CreatedLte(createdLte []time.Time) ApiDcimSiteGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimSiteGroupsListRequest) CreatedN(createdN []time.Time) ApiDcimSiteGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimSiteGroupsListRequest) CreatedByRequest(createdByRequest string) ApiDcimSiteGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimSiteGroupsListRequest) Description(description []string) ApiDcimSiteGroupsListRequest { + r.description = &description + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimSiteGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionIc(descriptionIc []string) ApiDcimSiteGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionIe(descriptionIe []string) ApiDcimSiteGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionIew(descriptionIew []string) ApiDcimSiteGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimSiteGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionN(descriptionN []string) ApiDcimSiteGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionNic(descriptionNic []string) ApiDcimSiteGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionNie(descriptionNie []string) ApiDcimSiteGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimSiteGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimSiteGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimSiteGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimSiteGroupsListRequest) Id(id []int32) ApiDcimSiteGroupsListRequest { + r.id = &id + return r +} + +func (r ApiDcimSiteGroupsListRequest) IdEmpty(idEmpty bool) ApiDcimSiteGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimSiteGroupsListRequest) IdGt(idGt []int32) ApiDcimSiteGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimSiteGroupsListRequest) IdGte(idGte []int32) ApiDcimSiteGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimSiteGroupsListRequest) IdLt(idLt []int32) ApiDcimSiteGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimSiteGroupsListRequest) IdLte(idLte []int32) ApiDcimSiteGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimSiteGroupsListRequest) IdN(idN []int32) ApiDcimSiteGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimSiteGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimSiteGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimSiteGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimSiteGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimSiteGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimSiteGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimSiteGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimSiteGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimSiteGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimSiteGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimSiteGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimSiteGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimSiteGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimSiteGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimSiteGroupsListRequest) Limit(limit int32) ApiDcimSiteGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimSiteGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimSiteGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimSiteGroupsListRequest) Name(name []string) ApiDcimSiteGroupsListRequest { + r.name = &name + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameEmpty(nameEmpty bool) ApiDcimSiteGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameIc(nameIc []string) ApiDcimSiteGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameIe(nameIe []string) ApiDcimSiteGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameIew(nameIew []string) ApiDcimSiteGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameIsw(nameIsw []string) ApiDcimSiteGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameN(nameN []string) ApiDcimSiteGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameNic(nameNic []string) ApiDcimSiteGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameNie(nameNie []string) ApiDcimSiteGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameNiew(nameNiew []string) ApiDcimSiteGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimSiteGroupsListRequest) NameNisw(nameNisw []string) ApiDcimSiteGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimSiteGroupsListRequest) Offset(offset int32) ApiDcimSiteGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimSiteGroupsListRequest) Ordering(ordering string) ApiDcimSiteGroupsListRequest { + r.ordering = &ordering + return r +} + +// Parent site group (slug) +func (r ApiDcimSiteGroupsListRequest) Parent(parent []string) ApiDcimSiteGroupsListRequest { + r.parent = &parent + return r +} + +// Parent site group (slug) +func (r ApiDcimSiteGroupsListRequest) ParentN(parentN []string) ApiDcimSiteGroupsListRequest { + r.parentN = &parentN + return r +} + +// Parent site group (ID) +func (r ApiDcimSiteGroupsListRequest) ParentId(parentId []*int32) ApiDcimSiteGroupsListRequest { + r.parentId = &parentId + return r +} + +// Parent site group (ID) +func (r ApiDcimSiteGroupsListRequest) ParentIdN(parentIdN []*int32) ApiDcimSiteGroupsListRequest { + r.parentIdN = &parentIdN + return r +} + +// Search +func (r ApiDcimSiteGroupsListRequest) Q(q string) ApiDcimSiteGroupsListRequest { + r.q = &q + return r +} + +func (r ApiDcimSiteGroupsListRequest) Slug(slug []string) ApiDcimSiteGroupsListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugEmpty(slugEmpty bool) ApiDcimSiteGroupsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugIc(slugIc []string) ApiDcimSiteGroupsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugIe(slugIe []string) ApiDcimSiteGroupsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugIew(slugIew []string) ApiDcimSiteGroupsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugIsw(slugIsw []string) ApiDcimSiteGroupsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugN(slugN []string) ApiDcimSiteGroupsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugNic(slugNic []string) ApiDcimSiteGroupsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugNie(slugNie []string) ApiDcimSiteGroupsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugNiew(slugNiew []string) ApiDcimSiteGroupsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimSiteGroupsListRequest) SlugNisw(slugNisw []string) ApiDcimSiteGroupsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimSiteGroupsListRequest) Tag(tag []string) ApiDcimSiteGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimSiteGroupsListRequest) TagN(tagN []string) ApiDcimSiteGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiDcimSiteGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimSiteGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimSiteGroupsListRequest) Execute() (*PaginatedSiteGroupList, *http.Response, error) { + return r.ApiService.DcimSiteGroupsListExecute(r) +} + +/* +DcimSiteGroupsList Method for DcimSiteGroupsList + +Get a list of site group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSiteGroupsListRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsList(ctx context.Context) ApiDcimSiteGroupsListRequest { + return ApiDcimSiteGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSiteGroupList +func (a *DcimAPIService) DcimSiteGroupsListExecute(r ApiDcimSiteGroupsListRequest) (*PaginatedSiteGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSiteGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.parentN != nil { + t := *r.parentN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", t, "multi") + } + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableSiteGroupRequest *PatchedWritableSiteGroupRequest +} + +func (r ApiDcimSiteGroupsPartialUpdateRequest) PatchedWritableSiteGroupRequest(patchedWritableSiteGroupRequest PatchedWritableSiteGroupRequest) ApiDcimSiteGroupsPartialUpdateRequest { + r.patchedWritableSiteGroupRequest = &patchedWritableSiteGroupRequest + return r +} + +func (r ApiDcimSiteGroupsPartialUpdateRequest) Execute() (*SiteGroup, *http.Response, error) { + return r.ApiService.DcimSiteGroupsPartialUpdateExecute(r) +} + +/* +DcimSiteGroupsPartialUpdate Method for DcimSiteGroupsPartialUpdate + +Patch a site group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site group. + @return ApiDcimSiteGroupsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsPartialUpdate(ctx context.Context, id int32) ApiDcimSiteGroupsPartialUpdateRequest { + return ApiDcimSiteGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SiteGroup +func (a *DcimAPIService) DcimSiteGroupsPartialUpdateExecute(r ApiDcimSiteGroupsPartialUpdateRequest) (*SiteGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SiteGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableSiteGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimSiteGroupsRetrieveRequest) Execute() (*SiteGroup, *http.Response, error) { + return r.ApiService.DcimSiteGroupsRetrieveExecute(r) +} + +/* +DcimSiteGroupsRetrieve Method for DcimSiteGroupsRetrieve + +Get a site group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site group. + @return ApiDcimSiteGroupsRetrieveRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsRetrieve(ctx context.Context, id int32) ApiDcimSiteGroupsRetrieveRequest { + return ApiDcimSiteGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SiteGroup +func (a *DcimAPIService) DcimSiteGroupsRetrieveExecute(r ApiDcimSiteGroupsRetrieveRequest) (*SiteGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SiteGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSiteGroupsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableSiteGroupRequest *WritableSiteGroupRequest +} + +func (r ApiDcimSiteGroupsUpdateRequest) WritableSiteGroupRequest(writableSiteGroupRequest WritableSiteGroupRequest) ApiDcimSiteGroupsUpdateRequest { + r.writableSiteGroupRequest = &writableSiteGroupRequest + return r +} + +func (r ApiDcimSiteGroupsUpdateRequest) Execute() (*SiteGroup, *http.Response, error) { + return r.ApiService.DcimSiteGroupsUpdateExecute(r) +} + +/* +DcimSiteGroupsUpdate Method for DcimSiteGroupsUpdate + +Put a site group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site group. + @return ApiDcimSiteGroupsUpdateRequest +*/ +func (a *DcimAPIService) DcimSiteGroupsUpdate(ctx context.Context, id int32) ApiDcimSiteGroupsUpdateRequest { + return ApiDcimSiteGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SiteGroup +func (a *DcimAPIService) DcimSiteGroupsUpdateExecute(r ApiDcimSiteGroupsUpdateRequest) (*SiteGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SiteGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSiteGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/site-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableSiteGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableSiteGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableSiteGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSitesBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + siteRequest *[]SiteRequest +} + +func (r ApiDcimSitesBulkDestroyRequest) SiteRequest(siteRequest []SiteRequest) ApiDcimSitesBulkDestroyRequest { + r.siteRequest = &siteRequest + return r +} + +func (r ApiDcimSitesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimSitesBulkDestroyExecute(r) +} + +/* +DcimSitesBulkDestroy Method for DcimSitesBulkDestroy + +Delete a list of site objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSitesBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimSitesBulkDestroy(ctx context.Context) ApiDcimSitesBulkDestroyRequest { + return ApiDcimSitesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimSitesBulkDestroyExecute(r ApiDcimSitesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.siteRequest == nil { + return nil, reportError("siteRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.siteRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimSitesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + siteRequest *[]SiteRequest +} + +func (r ApiDcimSitesBulkPartialUpdateRequest) SiteRequest(siteRequest []SiteRequest) ApiDcimSitesBulkPartialUpdateRequest { + r.siteRequest = &siteRequest + return r +} + +func (r ApiDcimSitesBulkPartialUpdateRequest) Execute() ([]Site, *http.Response, error) { + return r.ApiService.DcimSitesBulkPartialUpdateExecute(r) +} + +/* +DcimSitesBulkPartialUpdate Method for DcimSitesBulkPartialUpdate + +Patch a list of site objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSitesBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimSitesBulkPartialUpdate(ctx context.Context) ApiDcimSitesBulkPartialUpdateRequest { + return ApiDcimSitesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Site +func (a *DcimAPIService) DcimSitesBulkPartialUpdateExecute(r ApiDcimSitesBulkPartialUpdateRequest) ([]Site, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Site + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.siteRequest == nil { + return localVarReturnValue, nil, reportError("siteRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.siteRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSitesBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + siteRequest *[]SiteRequest +} + +func (r ApiDcimSitesBulkUpdateRequest) SiteRequest(siteRequest []SiteRequest) ApiDcimSitesBulkUpdateRequest { + r.siteRequest = &siteRequest + return r +} + +func (r ApiDcimSitesBulkUpdateRequest) Execute() ([]Site, *http.Response, error) { + return r.ApiService.DcimSitesBulkUpdateExecute(r) +} + +/* +DcimSitesBulkUpdate Method for DcimSitesBulkUpdate + +Put a list of site objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSitesBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimSitesBulkUpdate(ctx context.Context) ApiDcimSitesBulkUpdateRequest { + return ApiDcimSitesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Site +func (a *DcimAPIService) DcimSitesBulkUpdateExecute(r ApiDcimSitesBulkUpdateRequest) ([]Site, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Site + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.siteRequest == nil { + return localVarReturnValue, nil, reportError("siteRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.siteRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSitesCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableSiteRequest *WritableSiteRequest +} + +func (r ApiDcimSitesCreateRequest) WritableSiteRequest(writableSiteRequest WritableSiteRequest) ApiDcimSitesCreateRequest { + r.writableSiteRequest = &writableSiteRequest + return r +} + +func (r ApiDcimSitesCreateRequest) Execute() (*Site, *http.Response, error) { + return r.ApiService.DcimSitesCreateExecute(r) +} + +/* +DcimSitesCreate Method for DcimSitesCreate + +Post a list of site objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSitesCreateRequest +*/ +func (a *DcimAPIService) DcimSitesCreate(ctx context.Context) ApiDcimSitesCreateRequest { + return ApiDcimSitesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Site +func (a *DcimAPIService) DcimSitesCreateExecute(r ApiDcimSitesCreateRequest) (*Site, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Site + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableSiteRequest == nil { + return localVarReturnValue, nil, reportError("writableSiteRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableSiteRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSitesDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimSitesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimSitesDestroyExecute(r) +} + +/* +DcimSitesDestroy Method for DcimSitesDestroy + +Delete a site object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site. + @return ApiDcimSitesDestroyRequest +*/ +func (a *DcimAPIService) DcimSitesDestroy(ctx context.Context, id int32) ApiDcimSitesDestroyRequest { + return ApiDcimSitesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimSitesDestroyExecute(r ApiDcimSitesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimSitesListRequest struct { + ctx context.Context + ApiService *DcimAPIService + asn *[]int64 + asnN *[]int64 + asnId *[]int32 + asnIdN *[]int32 + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + facility *[]string + facilityEmpty *bool + facilityIc *[]string + facilityIe *[]string + facilityIew *[]string + facilityIsw *[]string + facilityN *[]string + facilityNic *[]string + facilityNie *[]string + facilityNiew *[]string + facilityNisw *[]string + group *[]int32 + groupN *[]int32 + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + latitude *[]float64 + latitudeEmpty *bool + latitudeGt *[]float64 + latitudeGte *[]float64 + latitudeLt *[]float64 + latitudeLte *[]float64 + latitudeN *[]float64 + limit *int32 + longitude *[]float64 + longitudeEmpty *bool + longitudeGt *[]float64 + longitudeGte *[]float64 + longitudeLt *[]float64 + longitudeLte *[]float64 + longitudeN *[]float64 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +// AS (ID) +func (r ApiDcimSitesListRequest) Asn(asn []int64) ApiDcimSitesListRequest { + r.asn = &asn + return r +} + +// AS (ID) +func (r ApiDcimSitesListRequest) AsnN(asnN []int64) ApiDcimSitesListRequest { + r.asnN = &asnN + return r +} + +// AS (ID) +func (r ApiDcimSitesListRequest) AsnId(asnId []int32) ApiDcimSitesListRequest { + r.asnId = &asnId + return r +} + +// AS (ID) +func (r ApiDcimSitesListRequest) AsnIdN(asnIdN []int32) ApiDcimSitesListRequest { + r.asnIdN = &asnIdN + return r +} + +// Contact +func (r ApiDcimSitesListRequest) Contact(contact []int32) ApiDcimSitesListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiDcimSitesListRequest) ContactN(contactN []int32) ApiDcimSitesListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiDcimSitesListRequest) ContactGroup(contactGroup []int32) ApiDcimSitesListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiDcimSitesListRequest) ContactGroupN(contactGroupN []int32) ApiDcimSitesListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiDcimSitesListRequest) ContactRole(contactRole []int32) ApiDcimSitesListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiDcimSitesListRequest) ContactRoleN(contactRoleN []int32) ApiDcimSitesListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiDcimSitesListRequest) Created(created []time.Time) ApiDcimSitesListRequest { + r.created = &created + return r +} + +func (r ApiDcimSitesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimSitesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimSitesListRequest) CreatedGt(createdGt []time.Time) ApiDcimSitesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimSitesListRequest) CreatedGte(createdGte []time.Time) ApiDcimSitesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimSitesListRequest) CreatedLt(createdLt []time.Time) ApiDcimSitesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimSitesListRequest) CreatedLte(createdLte []time.Time) ApiDcimSitesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimSitesListRequest) CreatedN(createdN []time.Time) ApiDcimSitesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimSitesListRequest) CreatedByRequest(createdByRequest string) ApiDcimSitesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimSitesListRequest) Description(description []string) ApiDcimSitesListRequest { + r.description = &description + return r +} + +func (r ApiDcimSitesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimSitesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimSitesListRequest) DescriptionIc(descriptionIc []string) ApiDcimSitesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimSitesListRequest) DescriptionIe(descriptionIe []string) ApiDcimSitesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimSitesListRequest) DescriptionIew(descriptionIew []string) ApiDcimSitesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimSitesListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimSitesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimSitesListRequest) DescriptionN(descriptionN []string) ApiDcimSitesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimSitesListRequest) DescriptionNic(descriptionNic []string) ApiDcimSitesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimSitesListRequest) DescriptionNie(descriptionNie []string) ApiDcimSitesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimSitesListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimSitesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimSitesListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimSitesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimSitesListRequest) Facility(facility []string) ApiDcimSitesListRequest { + r.facility = &facility + return r +} + +func (r ApiDcimSitesListRequest) FacilityEmpty(facilityEmpty bool) ApiDcimSitesListRequest { + r.facilityEmpty = &facilityEmpty + return r +} + +func (r ApiDcimSitesListRequest) FacilityIc(facilityIc []string) ApiDcimSitesListRequest { + r.facilityIc = &facilityIc + return r +} + +func (r ApiDcimSitesListRequest) FacilityIe(facilityIe []string) ApiDcimSitesListRequest { + r.facilityIe = &facilityIe + return r +} + +func (r ApiDcimSitesListRequest) FacilityIew(facilityIew []string) ApiDcimSitesListRequest { + r.facilityIew = &facilityIew + return r +} + +func (r ApiDcimSitesListRequest) FacilityIsw(facilityIsw []string) ApiDcimSitesListRequest { + r.facilityIsw = &facilityIsw + return r +} + +func (r ApiDcimSitesListRequest) FacilityN(facilityN []string) ApiDcimSitesListRequest { + r.facilityN = &facilityN + return r +} + +func (r ApiDcimSitesListRequest) FacilityNic(facilityNic []string) ApiDcimSitesListRequest { + r.facilityNic = &facilityNic + return r +} + +func (r ApiDcimSitesListRequest) FacilityNie(facilityNie []string) ApiDcimSitesListRequest { + r.facilityNie = &facilityNie + return r +} + +func (r ApiDcimSitesListRequest) FacilityNiew(facilityNiew []string) ApiDcimSitesListRequest { + r.facilityNiew = &facilityNiew + return r +} + +func (r ApiDcimSitesListRequest) FacilityNisw(facilityNisw []string) ApiDcimSitesListRequest { + r.facilityNisw = &facilityNisw + return r +} + +// Group (slug) +func (r ApiDcimSitesListRequest) Group(group []int32) ApiDcimSitesListRequest { + r.group = &group + return r +} + +// Group (slug) +func (r ApiDcimSitesListRequest) GroupN(groupN []int32) ApiDcimSitesListRequest { + r.groupN = &groupN + return r +} + +// Group (ID) +func (r ApiDcimSitesListRequest) GroupId(groupId []int32) ApiDcimSitesListRequest { + r.groupId = &groupId + return r +} + +// Group (ID) +func (r ApiDcimSitesListRequest) GroupIdN(groupIdN []int32) ApiDcimSitesListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiDcimSitesListRequest) Id(id []int32) ApiDcimSitesListRequest { + r.id = &id + return r +} + +func (r ApiDcimSitesListRequest) IdEmpty(idEmpty bool) ApiDcimSitesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimSitesListRequest) IdGt(idGt []int32) ApiDcimSitesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimSitesListRequest) IdGte(idGte []int32) ApiDcimSitesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimSitesListRequest) IdLt(idLt []int32) ApiDcimSitesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimSitesListRequest) IdLte(idLte []int32) ApiDcimSitesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimSitesListRequest) IdN(idN []int32) ApiDcimSitesListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimSitesListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimSitesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimSitesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimSitesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimSitesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimSitesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimSitesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimSitesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimSitesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimSitesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimSitesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimSitesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimSitesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimSitesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +func (r ApiDcimSitesListRequest) Latitude(latitude []float64) ApiDcimSitesListRequest { + r.latitude = &latitude + return r +} + +func (r ApiDcimSitesListRequest) LatitudeEmpty(latitudeEmpty bool) ApiDcimSitesListRequest { + r.latitudeEmpty = &latitudeEmpty + return r +} + +func (r ApiDcimSitesListRequest) LatitudeGt(latitudeGt []float64) ApiDcimSitesListRequest { + r.latitudeGt = &latitudeGt + return r +} + +func (r ApiDcimSitesListRequest) LatitudeGte(latitudeGte []float64) ApiDcimSitesListRequest { + r.latitudeGte = &latitudeGte + return r +} + +func (r ApiDcimSitesListRequest) LatitudeLt(latitudeLt []float64) ApiDcimSitesListRequest { + r.latitudeLt = &latitudeLt + return r +} + +func (r ApiDcimSitesListRequest) LatitudeLte(latitudeLte []float64) ApiDcimSitesListRequest { + r.latitudeLte = &latitudeLte + return r +} + +func (r ApiDcimSitesListRequest) LatitudeN(latitudeN []float64) ApiDcimSitesListRequest { + r.latitudeN = &latitudeN + return r +} + +// Number of results to return per page. +func (r ApiDcimSitesListRequest) Limit(limit int32) ApiDcimSitesListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimSitesListRequest) Longitude(longitude []float64) ApiDcimSitesListRequest { + r.longitude = &longitude + return r +} + +func (r ApiDcimSitesListRequest) LongitudeEmpty(longitudeEmpty bool) ApiDcimSitesListRequest { + r.longitudeEmpty = &longitudeEmpty + return r +} + +func (r ApiDcimSitesListRequest) LongitudeGt(longitudeGt []float64) ApiDcimSitesListRequest { + r.longitudeGt = &longitudeGt + return r +} + +func (r ApiDcimSitesListRequest) LongitudeGte(longitudeGte []float64) ApiDcimSitesListRequest { + r.longitudeGte = &longitudeGte + return r +} + +func (r ApiDcimSitesListRequest) LongitudeLt(longitudeLt []float64) ApiDcimSitesListRequest { + r.longitudeLt = &longitudeLt + return r +} + +func (r ApiDcimSitesListRequest) LongitudeLte(longitudeLte []float64) ApiDcimSitesListRequest { + r.longitudeLte = &longitudeLte + return r +} + +func (r ApiDcimSitesListRequest) LongitudeN(longitudeN []float64) ApiDcimSitesListRequest { + r.longitudeN = &longitudeN + return r +} + +func (r ApiDcimSitesListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimSitesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimSitesListRequest) Name(name []string) ApiDcimSitesListRequest { + r.name = &name + return r +} + +func (r ApiDcimSitesListRequest) NameEmpty(nameEmpty bool) ApiDcimSitesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimSitesListRequest) NameIc(nameIc []string) ApiDcimSitesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimSitesListRequest) NameIe(nameIe []string) ApiDcimSitesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimSitesListRequest) NameIew(nameIew []string) ApiDcimSitesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimSitesListRequest) NameIsw(nameIsw []string) ApiDcimSitesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimSitesListRequest) NameN(nameN []string) ApiDcimSitesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimSitesListRequest) NameNic(nameNic []string) ApiDcimSitesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimSitesListRequest) NameNie(nameNie []string) ApiDcimSitesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimSitesListRequest) NameNiew(nameNiew []string) ApiDcimSitesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimSitesListRequest) NameNisw(nameNisw []string) ApiDcimSitesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimSitesListRequest) Offset(offset int32) ApiDcimSitesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimSitesListRequest) Ordering(ordering string) ApiDcimSitesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimSitesListRequest) Q(q string) ApiDcimSitesListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiDcimSitesListRequest) Region(region []int32) ApiDcimSitesListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimSitesListRequest) RegionN(regionN []int32) ApiDcimSitesListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimSitesListRequest) RegionId(regionId []int32) ApiDcimSitesListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimSitesListRequest) RegionIdN(regionIdN []int32) ApiDcimSitesListRequest { + r.regionIdN = ®ionIdN + return r +} + +func (r ApiDcimSitesListRequest) Slug(slug []string) ApiDcimSitesListRequest { + r.slug = &slug + return r +} + +func (r ApiDcimSitesListRequest) SlugEmpty(slugEmpty bool) ApiDcimSitesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiDcimSitesListRequest) SlugIc(slugIc []string) ApiDcimSitesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiDcimSitesListRequest) SlugIe(slugIe []string) ApiDcimSitesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiDcimSitesListRequest) SlugIew(slugIew []string) ApiDcimSitesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiDcimSitesListRequest) SlugIsw(slugIsw []string) ApiDcimSitesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiDcimSitesListRequest) SlugN(slugN []string) ApiDcimSitesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiDcimSitesListRequest) SlugNic(slugNic []string) ApiDcimSitesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiDcimSitesListRequest) SlugNie(slugNie []string) ApiDcimSitesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiDcimSitesListRequest) SlugNiew(slugNiew []string) ApiDcimSitesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiDcimSitesListRequest) SlugNisw(slugNisw []string) ApiDcimSitesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiDcimSitesListRequest) Status(status []string) ApiDcimSitesListRequest { + r.status = &status + return r +} + +func (r ApiDcimSitesListRequest) StatusN(statusN []string) ApiDcimSitesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimSitesListRequest) Tag(tag []string) ApiDcimSitesListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimSitesListRequest) TagN(tagN []string) ApiDcimSitesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimSitesListRequest) Tenant(tenant []string) ApiDcimSitesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimSitesListRequest) TenantN(tenantN []string) ApiDcimSitesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimSitesListRequest) TenantGroup(tenantGroup []int32) ApiDcimSitesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimSitesListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimSitesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimSitesListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimSitesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimSitesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimSitesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimSitesListRequest) TenantId(tenantId []*int32) ApiDcimSitesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimSitesListRequest) TenantIdN(tenantIdN []*int32) ApiDcimSitesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimSitesListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimSitesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimSitesListRequest) Execute() (*PaginatedSiteList, *http.Response, error) { + return r.ApiService.DcimSitesListExecute(r) +} + +/* +DcimSitesList Method for DcimSitesList + +Get a list of site objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimSitesListRequest +*/ +func (a *DcimAPIService) DcimSitesList(ctx context.Context) ApiDcimSitesListRequest { + return ApiDcimSitesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSiteList +func (a *DcimAPIService) DcimSitesListExecute(r ApiDcimSitesListRequest) (*PaginatedSiteList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSiteList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.asn != nil { + t := *r.asn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn", t, "multi") + } + } + if r.asnN != nil { + t := *r.asnN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__n", t, "multi") + } + } + if r.asnId != nil { + t := *r.asnId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id", t, "multi") + } + } + if r.asnIdN != nil { + t := *r.asnIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn_id__n", t, "multi") + } + } + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.facility != nil { + t := *r.facility + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility", t, "multi") + } + } + if r.facilityEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__empty", r.facilityEmpty, "") + } + if r.facilityIc != nil { + t := *r.facilityIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__ic", t, "multi") + } + } + if r.facilityIe != nil { + t := *r.facilityIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__ie", t, "multi") + } + } + if r.facilityIew != nil { + t := *r.facilityIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__iew", t, "multi") + } + } + if r.facilityIsw != nil { + t := *r.facilityIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__isw", t, "multi") + } + } + if r.facilityN != nil { + t := *r.facilityN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__n", t, "multi") + } + } + if r.facilityNic != nil { + t := *r.facilityNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__nic", t, "multi") + } + } + if r.facilityNie != nil { + t := *r.facilityNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__nie", t, "multi") + } + } + if r.facilityNiew != nil { + t := *r.facilityNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__niew", t, "multi") + } + } + if r.facilityNisw != nil { + t := *r.facilityNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility__nisw", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.latitude != nil { + t := *r.latitude + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude", t, "multi") + } + } + if r.latitudeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__empty", r.latitudeEmpty, "") + } + if r.latitudeGt != nil { + t := *r.latitudeGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gt", t, "multi") + } + } + if r.latitudeGte != nil { + t := *r.latitudeGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__gte", t, "multi") + } + } + if r.latitudeLt != nil { + t := *r.latitudeLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lt", t, "multi") + } + } + if r.latitudeLte != nil { + t := *r.latitudeLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__lte", t, "multi") + } + } + if r.latitudeN != nil { + t := *r.latitudeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "latitude__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.longitude != nil { + t := *r.longitude + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude", t, "multi") + } + } + if r.longitudeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__empty", r.longitudeEmpty, "") + } + if r.longitudeGt != nil { + t := *r.longitudeGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gt", t, "multi") + } + } + if r.longitudeGte != nil { + t := *r.longitudeGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__gte", t, "multi") + } + } + if r.longitudeLt != nil { + t := *r.longitudeLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lt", t, "multi") + } + } + if r.longitudeLte != nil { + t := *r.longitudeLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__lte", t, "multi") + } + } + if r.longitudeN != nil { + t := *r.longitudeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "longitude__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSitesPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableSiteRequest *PatchedWritableSiteRequest +} + +func (r ApiDcimSitesPartialUpdateRequest) PatchedWritableSiteRequest(patchedWritableSiteRequest PatchedWritableSiteRequest) ApiDcimSitesPartialUpdateRequest { + r.patchedWritableSiteRequest = &patchedWritableSiteRequest + return r +} + +func (r ApiDcimSitesPartialUpdateRequest) Execute() (*Site, *http.Response, error) { + return r.ApiService.DcimSitesPartialUpdateExecute(r) +} + +/* +DcimSitesPartialUpdate Method for DcimSitesPartialUpdate + +Patch a site object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site. + @return ApiDcimSitesPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimSitesPartialUpdate(ctx context.Context, id int32) ApiDcimSitesPartialUpdateRequest { + return ApiDcimSitesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Site +func (a *DcimAPIService) DcimSitesPartialUpdateExecute(r ApiDcimSitesPartialUpdateRequest) (*Site, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Site + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableSiteRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSitesRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimSitesRetrieveRequest) Execute() (*Site, *http.Response, error) { + return r.ApiService.DcimSitesRetrieveExecute(r) +} + +/* +DcimSitesRetrieve Method for DcimSitesRetrieve + +Get a site object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site. + @return ApiDcimSitesRetrieveRequest +*/ +func (a *DcimAPIService) DcimSitesRetrieve(ctx context.Context, id int32) ApiDcimSitesRetrieveRequest { + return ApiDcimSitesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Site +func (a *DcimAPIService) DcimSitesRetrieveExecute(r ApiDcimSitesRetrieveRequest) (*Site, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Site + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimSitesUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableSiteRequest *WritableSiteRequest +} + +func (r ApiDcimSitesUpdateRequest) WritableSiteRequest(writableSiteRequest WritableSiteRequest) ApiDcimSitesUpdateRequest { + r.writableSiteRequest = &writableSiteRequest + return r +} + +func (r ApiDcimSitesUpdateRequest) Execute() (*Site, *http.Response, error) { + return r.ApiService.DcimSitesUpdateExecute(r) +} + +/* +DcimSitesUpdate Method for DcimSitesUpdate + +Put a site object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this site. + @return ApiDcimSitesUpdateRequest +*/ +func (a *DcimAPIService) DcimSitesUpdate(ctx context.Context, id int32) ApiDcimSitesUpdateRequest { + return ApiDcimSitesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Site +func (a *DcimAPIService) DcimSitesUpdateExecute(r ApiDcimSitesUpdateRequest) (*Site, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Site + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimSitesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/sites/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableSiteRequest == nil { + return localVarReturnValue, nil, reportError("writableSiteRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableSiteRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + virtualChassisRequest *[]VirtualChassisRequest +} + +func (r ApiDcimVirtualChassisBulkDestroyRequest) VirtualChassisRequest(virtualChassisRequest []VirtualChassisRequest) ApiDcimVirtualChassisBulkDestroyRequest { + r.virtualChassisRequest = &virtualChassisRequest + return r +} + +func (r ApiDcimVirtualChassisBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimVirtualChassisBulkDestroyExecute(r) +} + +/* +DcimVirtualChassisBulkDestroy Method for DcimVirtualChassisBulkDestroy + +Delete a list of virtual chassis objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualChassisBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisBulkDestroy(ctx context.Context) ApiDcimVirtualChassisBulkDestroyRequest { + return ApiDcimVirtualChassisBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimVirtualChassisBulkDestroyExecute(r ApiDcimVirtualChassisBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualChassisRequest == nil { + return nil, reportError("virtualChassisRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualChassisRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + virtualChassisRequest *[]VirtualChassisRequest +} + +func (r ApiDcimVirtualChassisBulkPartialUpdateRequest) VirtualChassisRequest(virtualChassisRequest []VirtualChassisRequest) ApiDcimVirtualChassisBulkPartialUpdateRequest { + r.virtualChassisRequest = &virtualChassisRequest + return r +} + +func (r ApiDcimVirtualChassisBulkPartialUpdateRequest) Execute() ([]VirtualChassis, *http.Response, error) { + return r.ApiService.DcimVirtualChassisBulkPartialUpdateExecute(r) +} + +/* +DcimVirtualChassisBulkPartialUpdate Method for DcimVirtualChassisBulkPartialUpdate + +Patch a list of virtual chassis objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualChassisBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisBulkPartialUpdate(ctx context.Context) ApiDcimVirtualChassisBulkPartialUpdateRequest { + return ApiDcimVirtualChassisBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualChassis +func (a *DcimAPIService) DcimVirtualChassisBulkPartialUpdateExecute(r ApiDcimVirtualChassisBulkPartialUpdateRequest) ([]VirtualChassis, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualChassis + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualChassisRequest == nil { + return localVarReturnValue, nil, reportError("virtualChassisRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualChassisRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + virtualChassisRequest *[]VirtualChassisRequest +} + +func (r ApiDcimVirtualChassisBulkUpdateRequest) VirtualChassisRequest(virtualChassisRequest []VirtualChassisRequest) ApiDcimVirtualChassisBulkUpdateRequest { + r.virtualChassisRequest = &virtualChassisRequest + return r +} + +func (r ApiDcimVirtualChassisBulkUpdateRequest) Execute() ([]VirtualChassis, *http.Response, error) { + return r.ApiService.DcimVirtualChassisBulkUpdateExecute(r) +} + +/* +DcimVirtualChassisBulkUpdate Method for DcimVirtualChassisBulkUpdate + +Put a list of virtual chassis objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualChassisBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisBulkUpdate(ctx context.Context) ApiDcimVirtualChassisBulkUpdateRequest { + return ApiDcimVirtualChassisBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualChassis +func (a *DcimAPIService) DcimVirtualChassisBulkUpdateExecute(r ApiDcimVirtualChassisBulkUpdateRequest) ([]VirtualChassis, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualChassis + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualChassisRequest == nil { + return localVarReturnValue, nil, reportError("virtualChassisRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualChassisRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableVirtualChassisRequest *WritableVirtualChassisRequest +} + +func (r ApiDcimVirtualChassisCreateRequest) WritableVirtualChassisRequest(writableVirtualChassisRequest WritableVirtualChassisRequest) ApiDcimVirtualChassisCreateRequest { + r.writableVirtualChassisRequest = &writableVirtualChassisRequest + return r +} + +func (r ApiDcimVirtualChassisCreateRequest) Execute() (*VirtualChassis, *http.Response, error) { + return r.ApiService.DcimVirtualChassisCreateExecute(r) +} + +/* +DcimVirtualChassisCreate Method for DcimVirtualChassisCreate + +Post a list of virtual chassis objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualChassisCreateRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisCreate(ctx context.Context) ApiDcimVirtualChassisCreateRequest { + return ApiDcimVirtualChassisCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VirtualChassis +func (a *DcimAPIService) DcimVirtualChassisCreateExecute(r ApiDcimVirtualChassisCreateRequest) (*VirtualChassis, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualChassis + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualChassisRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualChassisRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualChassisRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimVirtualChassisDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimVirtualChassisDestroyExecute(r) +} + +/* +DcimVirtualChassisDestroy Method for DcimVirtualChassisDestroy + +Delete a virtual chassis object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual chassis. + @return ApiDcimVirtualChassisDestroyRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisDestroy(ctx context.Context, id int32) ApiDcimVirtualChassisDestroyRequest { + return ApiDcimVirtualChassisDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimVirtualChassisDestroyExecute(r ApiDcimVirtualChassisDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + domain *[]string + domainEmpty *bool + domainIc *[]string + domainIe *[]string + domainIew *[]string + domainIsw *[]string + domainN *[]string + domainNic *[]string + domainNie *[]string + domainNiew *[]string + domainNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + master *[]*string + masterN *[]*string + masterId *[]*int32 + masterIdN *[]*int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantId *[]int32 + tenantIdN *[]int32 + updatedByRequest *string +} + +func (r ApiDcimVirtualChassisListRequest) Created(created []time.Time) ApiDcimVirtualChassisListRequest { + r.created = &created + return r +} + +func (r ApiDcimVirtualChassisListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimVirtualChassisListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimVirtualChassisListRequest) CreatedGt(createdGt []time.Time) ApiDcimVirtualChassisListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimVirtualChassisListRequest) CreatedGte(createdGte []time.Time) ApiDcimVirtualChassisListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimVirtualChassisListRequest) CreatedLt(createdLt []time.Time) ApiDcimVirtualChassisListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimVirtualChassisListRequest) CreatedLte(createdLte []time.Time) ApiDcimVirtualChassisListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimVirtualChassisListRequest) CreatedN(createdN []time.Time) ApiDcimVirtualChassisListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimVirtualChassisListRequest) CreatedByRequest(createdByRequest string) ApiDcimVirtualChassisListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimVirtualChassisListRequest) Description(description []string) ApiDcimVirtualChassisListRequest { + r.description = &description + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimVirtualChassisListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionIc(descriptionIc []string) ApiDcimVirtualChassisListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionIe(descriptionIe []string) ApiDcimVirtualChassisListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionIew(descriptionIew []string) ApiDcimVirtualChassisListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimVirtualChassisListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionN(descriptionN []string) ApiDcimVirtualChassisListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionNic(descriptionNic []string) ApiDcimVirtualChassisListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionNie(descriptionNie []string) ApiDcimVirtualChassisListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimVirtualChassisListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimVirtualChassisListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimVirtualChassisListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiDcimVirtualChassisListRequest) Domain(domain []string) ApiDcimVirtualChassisListRequest { + r.domain = &domain + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainEmpty(domainEmpty bool) ApiDcimVirtualChassisListRequest { + r.domainEmpty = &domainEmpty + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainIc(domainIc []string) ApiDcimVirtualChassisListRequest { + r.domainIc = &domainIc + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainIe(domainIe []string) ApiDcimVirtualChassisListRequest { + r.domainIe = &domainIe + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainIew(domainIew []string) ApiDcimVirtualChassisListRequest { + r.domainIew = &domainIew + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainIsw(domainIsw []string) ApiDcimVirtualChassisListRequest { + r.domainIsw = &domainIsw + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainN(domainN []string) ApiDcimVirtualChassisListRequest { + r.domainN = &domainN + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainNic(domainNic []string) ApiDcimVirtualChassisListRequest { + r.domainNic = &domainNic + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainNie(domainNie []string) ApiDcimVirtualChassisListRequest { + r.domainNie = &domainNie + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainNiew(domainNiew []string) ApiDcimVirtualChassisListRequest { + r.domainNiew = &domainNiew + return r +} + +func (r ApiDcimVirtualChassisListRequest) DomainNisw(domainNisw []string) ApiDcimVirtualChassisListRequest { + r.domainNisw = &domainNisw + return r +} + +func (r ApiDcimVirtualChassisListRequest) Id(id []int32) ApiDcimVirtualChassisListRequest { + r.id = &id + return r +} + +func (r ApiDcimVirtualChassisListRequest) IdEmpty(idEmpty bool) ApiDcimVirtualChassisListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimVirtualChassisListRequest) IdGt(idGt []int32) ApiDcimVirtualChassisListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimVirtualChassisListRequest) IdGte(idGte []int32) ApiDcimVirtualChassisListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimVirtualChassisListRequest) IdLt(idLt []int32) ApiDcimVirtualChassisListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimVirtualChassisListRequest) IdLte(idLte []int32) ApiDcimVirtualChassisListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimVirtualChassisListRequest) IdN(idN []int32) ApiDcimVirtualChassisListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimVirtualChassisListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimVirtualChassisListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimVirtualChassisListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimVirtualChassisListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimVirtualChassisListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimVirtualChassisListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimVirtualChassisListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimVirtualChassisListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimVirtualChassisListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimVirtualChassisListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimVirtualChassisListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimVirtualChassisListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimVirtualChassisListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimVirtualChassisListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimVirtualChassisListRequest) Limit(limit int32) ApiDcimVirtualChassisListRequest { + r.limit = &limit + return r +} + +// Master (name) +func (r ApiDcimVirtualChassisListRequest) Master(master []*string) ApiDcimVirtualChassisListRequest { + r.master = &master + return r +} + +// Master (name) +func (r ApiDcimVirtualChassisListRequest) MasterN(masterN []*string) ApiDcimVirtualChassisListRequest { + r.masterN = &masterN + return r +} + +// Master (ID) +func (r ApiDcimVirtualChassisListRequest) MasterId(masterId []*int32) ApiDcimVirtualChassisListRequest { + r.masterId = &masterId + return r +} + +// Master (ID) +func (r ApiDcimVirtualChassisListRequest) MasterIdN(masterIdN []*int32) ApiDcimVirtualChassisListRequest { + r.masterIdN = &masterIdN + return r +} + +func (r ApiDcimVirtualChassisListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimVirtualChassisListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimVirtualChassisListRequest) Name(name []string) ApiDcimVirtualChassisListRequest { + r.name = &name + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameEmpty(nameEmpty bool) ApiDcimVirtualChassisListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameIc(nameIc []string) ApiDcimVirtualChassisListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameIe(nameIe []string) ApiDcimVirtualChassisListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameIew(nameIew []string) ApiDcimVirtualChassisListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameIsw(nameIsw []string) ApiDcimVirtualChassisListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameN(nameN []string) ApiDcimVirtualChassisListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameNic(nameNic []string) ApiDcimVirtualChassisListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameNie(nameNie []string) ApiDcimVirtualChassisListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameNiew(nameNiew []string) ApiDcimVirtualChassisListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimVirtualChassisListRequest) NameNisw(nameNisw []string) ApiDcimVirtualChassisListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimVirtualChassisListRequest) Offset(offset int32) ApiDcimVirtualChassisListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimVirtualChassisListRequest) Ordering(ordering string) ApiDcimVirtualChassisListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiDcimVirtualChassisListRequest) Q(q string) ApiDcimVirtualChassisListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiDcimVirtualChassisListRequest) Region(region []int32) ApiDcimVirtualChassisListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiDcimVirtualChassisListRequest) RegionN(regionN []int32) ApiDcimVirtualChassisListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiDcimVirtualChassisListRequest) RegionId(regionId []int32) ApiDcimVirtualChassisListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiDcimVirtualChassisListRequest) RegionIdN(regionIdN []int32) ApiDcimVirtualChassisListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site name (slug) +func (r ApiDcimVirtualChassisListRequest) Site(site []string) ApiDcimVirtualChassisListRequest { + r.site = &site + return r +} + +// Site name (slug) +func (r ApiDcimVirtualChassisListRequest) SiteN(siteN []string) ApiDcimVirtualChassisListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiDcimVirtualChassisListRequest) SiteGroup(siteGroup []int32) ApiDcimVirtualChassisListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiDcimVirtualChassisListRequest) SiteGroupN(siteGroupN []int32) ApiDcimVirtualChassisListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiDcimVirtualChassisListRequest) SiteGroupId(siteGroupId []int32) ApiDcimVirtualChassisListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiDcimVirtualChassisListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiDcimVirtualChassisListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiDcimVirtualChassisListRequest) SiteId(siteId []int32) ApiDcimVirtualChassisListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiDcimVirtualChassisListRequest) SiteIdN(siteIdN []int32) ApiDcimVirtualChassisListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiDcimVirtualChassisListRequest) Tag(tag []string) ApiDcimVirtualChassisListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimVirtualChassisListRequest) TagN(tagN []string) ApiDcimVirtualChassisListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimVirtualChassisListRequest) Tenant(tenant []string) ApiDcimVirtualChassisListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimVirtualChassisListRequest) TenantN(tenantN []string) ApiDcimVirtualChassisListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant (ID) +func (r ApiDcimVirtualChassisListRequest) TenantId(tenantId []int32) ApiDcimVirtualChassisListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimVirtualChassisListRequest) TenantIdN(tenantIdN []int32) ApiDcimVirtualChassisListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimVirtualChassisListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimVirtualChassisListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimVirtualChassisListRequest) Execute() (*PaginatedVirtualChassisList, *http.Response, error) { + return r.ApiService.DcimVirtualChassisListExecute(r) +} + +/* +DcimVirtualChassisList Method for DcimVirtualChassisList + +Get a list of virtual chassis objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualChassisListRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisList(ctx context.Context) ApiDcimVirtualChassisListRequest { + return ApiDcimVirtualChassisListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVirtualChassisList +func (a *DcimAPIService) DcimVirtualChassisListExecute(r ApiDcimVirtualChassisListRequest) (*PaginatedVirtualChassisList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVirtualChassisList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.domain != nil { + t := *r.domain + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain", t, "multi") + } + } + if r.domainEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__empty", r.domainEmpty, "") + } + if r.domainIc != nil { + t := *r.domainIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__ic", t, "multi") + } + } + if r.domainIe != nil { + t := *r.domainIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__ie", t, "multi") + } + } + if r.domainIew != nil { + t := *r.domainIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__iew", t, "multi") + } + } + if r.domainIsw != nil { + t := *r.domainIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__isw", t, "multi") + } + } + if r.domainN != nil { + t := *r.domainN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__n", t, "multi") + } + } + if r.domainNic != nil { + t := *r.domainNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__nic", t, "multi") + } + } + if r.domainNie != nil { + t := *r.domainNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__nie", t, "multi") + } + } + if r.domainNiew != nil { + t := *r.domainNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__niew", t, "multi") + } + } + if r.domainNisw != nil { + t := *r.domainNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.master != nil { + t := *r.master + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "master", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "master", t, "multi") + } + } + if r.masterN != nil { + t := *r.masterN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "master__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "master__n", t, "multi") + } + } + if r.masterId != nil { + t := *r.masterId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "master_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "master_id", t, "multi") + } + } + if r.masterIdN != nil { + t := *r.masterIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "master_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "master_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableVirtualChassisRequest *PatchedWritableVirtualChassisRequest +} + +func (r ApiDcimVirtualChassisPartialUpdateRequest) PatchedWritableVirtualChassisRequest(patchedWritableVirtualChassisRequest PatchedWritableVirtualChassisRequest) ApiDcimVirtualChassisPartialUpdateRequest { + r.patchedWritableVirtualChassisRequest = &patchedWritableVirtualChassisRequest + return r +} + +func (r ApiDcimVirtualChassisPartialUpdateRequest) Execute() (*VirtualChassis, *http.Response, error) { + return r.ApiService.DcimVirtualChassisPartialUpdateExecute(r) +} + +/* +DcimVirtualChassisPartialUpdate Method for DcimVirtualChassisPartialUpdate + +Patch a virtual chassis object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual chassis. + @return ApiDcimVirtualChassisPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisPartialUpdate(ctx context.Context, id int32) ApiDcimVirtualChassisPartialUpdateRequest { + return ApiDcimVirtualChassisPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualChassis +func (a *DcimAPIService) DcimVirtualChassisPartialUpdateExecute(r ApiDcimVirtualChassisPartialUpdateRequest) (*VirtualChassis, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualChassis + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableVirtualChassisRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimVirtualChassisRetrieveRequest) Execute() (*VirtualChassis, *http.Response, error) { + return r.ApiService.DcimVirtualChassisRetrieveExecute(r) +} + +/* +DcimVirtualChassisRetrieve Method for DcimVirtualChassisRetrieve + +Get a virtual chassis object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual chassis. + @return ApiDcimVirtualChassisRetrieveRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisRetrieve(ctx context.Context, id int32) ApiDcimVirtualChassisRetrieveRequest { + return ApiDcimVirtualChassisRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualChassis +func (a *DcimAPIService) DcimVirtualChassisRetrieveExecute(r ApiDcimVirtualChassisRetrieveRequest) (*VirtualChassis, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualChassis + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualChassisUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableVirtualChassisRequest *WritableVirtualChassisRequest +} + +func (r ApiDcimVirtualChassisUpdateRequest) WritableVirtualChassisRequest(writableVirtualChassisRequest WritableVirtualChassisRequest) ApiDcimVirtualChassisUpdateRequest { + r.writableVirtualChassisRequest = &writableVirtualChassisRequest + return r +} + +func (r ApiDcimVirtualChassisUpdateRequest) Execute() (*VirtualChassis, *http.Response, error) { + return r.ApiService.DcimVirtualChassisUpdateExecute(r) +} + +/* +DcimVirtualChassisUpdate Method for DcimVirtualChassisUpdate + +Put a virtual chassis object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual chassis. + @return ApiDcimVirtualChassisUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualChassisUpdate(ctx context.Context, id int32) ApiDcimVirtualChassisUpdateRequest { + return ApiDcimVirtualChassisUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualChassis +func (a *DcimAPIService) DcimVirtualChassisUpdateExecute(r ApiDcimVirtualChassisUpdateRequest) (*VirtualChassis, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualChassis + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualChassisUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-chassis/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualChassisRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualChassisRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualChassisRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsBulkDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + virtualDeviceContextRequest *[]VirtualDeviceContextRequest +} + +func (r ApiDcimVirtualDeviceContextsBulkDestroyRequest) VirtualDeviceContextRequest(virtualDeviceContextRequest []VirtualDeviceContextRequest) ApiDcimVirtualDeviceContextsBulkDestroyRequest { + r.virtualDeviceContextRequest = &virtualDeviceContextRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsBulkDestroyExecute(r) +} + +/* +DcimVirtualDeviceContextsBulkDestroy Method for DcimVirtualDeviceContextsBulkDestroy + +Delete a list of virtual device context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualDeviceContextsBulkDestroyRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsBulkDestroy(ctx context.Context) ApiDcimVirtualDeviceContextsBulkDestroyRequest { + return ApiDcimVirtualDeviceContextsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimVirtualDeviceContextsBulkDestroyExecute(r ApiDcimVirtualDeviceContextsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualDeviceContextRequest == nil { + return nil, reportError("virtualDeviceContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualDeviceContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + virtualDeviceContextRequest *[]VirtualDeviceContextRequest +} + +func (r ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest) VirtualDeviceContextRequest(virtualDeviceContextRequest []VirtualDeviceContextRequest) ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest { + r.virtualDeviceContextRequest = &virtualDeviceContextRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest) Execute() ([]VirtualDeviceContext, *http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsBulkPartialUpdateExecute(r) +} + +/* +DcimVirtualDeviceContextsBulkPartialUpdate Method for DcimVirtualDeviceContextsBulkPartialUpdate + +Patch a list of virtual device context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsBulkPartialUpdate(ctx context.Context) ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest { + return ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualDeviceContext +func (a *DcimAPIService) DcimVirtualDeviceContextsBulkPartialUpdateExecute(r ApiDcimVirtualDeviceContextsBulkPartialUpdateRequest) ([]VirtualDeviceContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualDeviceContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualDeviceContextRequest == nil { + return localVarReturnValue, nil, reportError("virtualDeviceContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualDeviceContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsBulkUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + virtualDeviceContextRequest *[]VirtualDeviceContextRequest +} + +func (r ApiDcimVirtualDeviceContextsBulkUpdateRequest) VirtualDeviceContextRequest(virtualDeviceContextRequest []VirtualDeviceContextRequest) ApiDcimVirtualDeviceContextsBulkUpdateRequest { + r.virtualDeviceContextRequest = &virtualDeviceContextRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsBulkUpdateRequest) Execute() ([]VirtualDeviceContext, *http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsBulkUpdateExecute(r) +} + +/* +DcimVirtualDeviceContextsBulkUpdate Method for DcimVirtualDeviceContextsBulkUpdate + +Put a list of virtual device context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualDeviceContextsBulkUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsBulkUpdate(ctx context.Context) ApiDcimVirtualDeviceContextsBulkUpdateRequest { + return ApiDcimVirtualDeviceContextsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualDeviceContext +func (a *DcimAPIService) DcimVirtualDeviceContextsBulkUpdateExecute(r ApiDcimVirtualDeviceContextsBulkUpdateRequest) ([]VirtualDeviceContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualDeviceContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualDeviceContextRequest == nil { + return localVarReturnValue, nil, reportError("virtualDeviceContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualDeviceContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsCreateRequest struct { + ctx context.Context + ApiService *DcimAPIService + writableVirtualDeviceContextRequest *WritableVirtualDeviceContextRequest +} + +func (r ApiDcimVirtualDeviceContextsCreateRequest) WritableVirtualDeviceContextRequest(writableVirtualDeviceContextRequest WritableVirtualDeviceContextRequest) ApiDcimVirtualDeviceContextsCreateRequest { + r.writableVirtualDeviceContextRequest = &writableVirtualDeviceContextRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsCreateRequest) Execute() (*VirtualDeviceContext, *http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsCreateExecute(r) +} + +/* +DcimVirtualDeviceContextsCreate Method for DcimVirtualDeviceContextsCreate + +Post a list of virtual device context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualDeviceContextsCreateRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsCreate(ctx context.Context) ApiDcimVirtualDeviceContextsCreateRequest { + return ApiDcimVirtualDeviceContextsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VirtualDeviceContext +func (a *DcimAPIService) DcimVirtualDeviceContextsCreateExecute(r ApiDcimVirtualDeviceContextsCreateRequest) (*VirtualDeviceContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDeviceContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualDeviceContextRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualDeviceContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualDeviceContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsDestroyRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimVirtualDeviceContextsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsDestroyExecute(r) +} + +/* +DcimVirtualDeviceContextsDestroy Method for DcimVirtualDeviceContextsDestroy + +Delete a virtual device context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual device context. + @return ApiDcimVirtualDeviceContextsDestroyRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsDestroy(ctx context.Context, id int32) ApiDcimVirtualDeviceContextsDestroyRequest { + return ApiDcimVirtualDeviceContextsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DcimAPIService) DcimVirtualDeviceContextsDestroyExecute(r ApiDcimVirtualDeviceContextsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsListRequest struct { + ctx context.Context + ApiService *DcimAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]int32 + deviceN *[]int32 + deviceId *[]int32 + deviceIdN *[]int32 + hasPrimaryIp *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + primaryIp4Id *[]int32 + primaryIp4IdN *[]int32 + primaryIp6Id *[]int32 + primaryIp6IdN *[]int32 + q *string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiDcimVirtualDeviceContextsListRequest) Created(created []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.created = &created + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) CreatedGt(createdGt []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) CreatedGte(createdGte []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) CreatedLt(createdLt []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) CreatedLte(createdLte []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) CreatedN(createdN []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) CreatedByRequest(createdByRequest string) ApiDcimVirtualDeviceContextsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) Description(description []string) ApiDcimVirtualDeviceContextsListRequest { + r.description = &description + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionIc(descriptionIc []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionIe(descriptionIe []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionIew(descriptionIew []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionIsw(descriptionIsw []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionN(descriptionN []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionNic(descriptionNic []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionNie(descriptionNie []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionNiew(descriptionNiew []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) DescriptionNisw(descriptionNisw []string) ApiDcimVirtualDeviceContextsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device model +func (r ApiDcimVirtualDeviceContextsListRequest) Device(device []int32) ApiDcimVirtualDeviceContextsListRequest { + r.device = &device + return r +} + +// Device model +func (r ApiDcimVirtualDeviceContextsListRequest) DeviceN(deviceN []int32) ApiDcimVirtualDeviceContextsListRequest { + r.deviceN = &deviceN + return r +} + +// VDC (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) DeviceId(deviceId []int32) ApiDcimVirtualDeviceContextsListRequest { + r.deviceId = &deviceId + return r +} + +// VDC (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) DeviceIdN(deviceIdN []int32) ApiDcimVirtualDeviceContextsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +// Has a primary IP +func (r ApiDcimVirtualDeviceContextsListRequest) HasPrimaryIp(hasPrimaryIp bool) ApiDcimVirtualDeviceContextsListRequest { + r.hasPrimaryIp = &hasPrimaryIp + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) Id(id []int32) ApiDcimVirtualDeviceContextsListRequest { + r.id = &id + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) IdEmpty(idEmpty bool) ApiDcimVirtualDeviceContextsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) IdGt(idGt []int32) ApiDcimVirtualDeviceContextsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) IdGte(idGte []int32) ApiDcimVirtualDeviceContextsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) IdLt(idLt []int32) ApiDcimVirtualDeviceContextsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) IdLte(idLte []int32) ApiDcimVirtualDeviceContextsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) IdN(idN []int32) ApiDcimVirtualDeviceContextsListRequest { + r.idN = &idN + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) LastUpdated(lastUpdated []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiDcimVirtualDeviceContextsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiDcimVirtualDeviceContextsListRequest) Limit(limit int32) ApiDcimVirtualDeviceContextsListRequest { + r.limit = &limit + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) ModifiedByRequest(modifiedByRequest string) ApiDcimVirtualDeviceContextsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) Name(name []string) ApiDcimVirtualDeviceContextsListRequest { + r.name = &name + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameEmpty(nameEmpty bool) ApiDcimVirtualDeviceContextsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameIc(nameIc []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameIe(nameIe []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameIew(nameIew []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameIsw(nameIsw []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameN(nameN []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameNic(nameNic []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameNie(nameNie []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameNiew(nameNiew []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) NameNisw(nameNisw []string) ApiDcimVirtualDeviceContextsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiDcimVirtualDeviceContextsListRequest) Offset(offset int32) ApiDcimVirtualDeviceContextsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiDcimVirtualDeviceContextsListRequest) Ordering(ordering string) ApiDcimVirtualDeviceContextsListRequest { + r.ordering = &ordering + return r +} + +// Primary IPv4 (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) PrimaryIp4Id(primaryIp4Id []int32) ApiDcimVirtualDeviceContextsListRequest { + r.primaryIp4Id = &primaryIp4Id + return r +} + +// Primary IPv4 (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) PrimaryIp4IdN(primaryIp4IdN []int32) ApiDcimVirtualDeviceContextsListRequest { + r.primaryIp4IdN = &primaryIp4IdN + return r +} + +// Primary IPv6 (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) PrimaryIp6Id(primaryIp6Id []int32) ApiDcimVirtualDeviceContextsListRequest { + r.primaryIp6Id = &primaryIp6Id + return r +} + +// Primary IPv6 (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) PrimaryIp6IdN(primaryIp6IdN []int32) ApiDcimVirtualDeviceContextsListRequest { + r.primaryIp6IdN = &primaryIp6IdN + return r +} + +// Search +func (r ApiDcimVirtualDeviceContextsListRequest) Q(q string) ApiDcimVirtualDeviceContextsListRequest { + r.q = &q + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) Status(status []string) ApiDcimVirtualDeviceContextsListRequest { + r.status = &status + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) StatusN(statusN []string) ApiDcimVirtualDeviceContextsListRequest { + r.statusN = &statusN + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) Tag(tag []string) ApiDcimVirtualDeviceContextsListRequest { + r.tag = &tag + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) TagN(tagN []string) ApiDcimVirtualDeviceContextsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiDcimVirtualDeviceContextsListRequest) Tenant(tenant []string) ApiDcimVirtualDeviceContextsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiDcimVirtualDeviceContextsListRequest) TenantN(tenantN []string) ApiDcimVirtualDeviceContextsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiDcimVirtualDeviceContextsListRequest) TenantGroup(tenantGroup []int32) ApiDcimVirtualDeviceContextsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiDcimVirtualDeviceContextsListRequest) TenantGroupN(tenantGroupN []int32) ApiDcimVirtualDeviceContextsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) TenantGroupId(tenantGroupId []int32) ApiDcimVirtualDeviceContextsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiDcimVirtualDeviceContextsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) TenantId(tenantId []*int32) ApiDcimVirtualDeviceContextsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiDcimVirtualDeviceContextsListRequest) TenantIdN(tenantIdN []*int32) ApiDcimVirtualDeviceContextsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) UpdatedByRequest(updatedByRequest string) ApiDcimVirtualDeviceContextsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsListRequest) Execute() (*PaginatedVirtualDeviceContextList, *http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsListExecute(r) +} + +/* +DcimVirtualDeviceContextsList Method for DcimVirtualDeviceContextsList + +Get a list of virtual device context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDcimVirtualDeviceContextsListRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsList(ctx context.Context) ApiDcimVirtualDeviceContextsListRequest { + return ApiDcimVirtualDeviceContextsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVirtualDeviceContextList +func (a *DcimAPIService) DcimVirtualDeviceContextsListExecute(r ApiDcimVirtualDeviceContextsListRequest) (*PaginatedVirtualDeviceContextList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVirtualDeviceContextList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.hasPrimaryIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_primary_ip", r.hasPrimaryIp, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.primaryIp4Id != nil { + t := *r.primaryIp4Id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id", t, "multi") + } + } + if r.primaryIp4IdN != nil { + t := *r.primaryIp4IdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id__n", t, "multi") + } + } + if r.primaryIp6Id != nil { + t := *r.primaryIp6Id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id", t, "multi") + } + } + if r.primaryIp6IdN != nil { + t := *r.primaryIp6IdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsPartialUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + patchedWritableVirtualDeviceContextRequest *PatchedWritableVirtualDeviceContextRequest +} + +func (r ApiDcimVirtualDeviceContextsPartialUpdateRequest) PatchedWritableVirtualDeviceContextRequest(patchedWritableVirtualDeviceContextRequest PatchedWritableVirtualDeviceContextRequest) ApiDcimVirtualDeviceContextsPartialUpdateRequest { + r.patchedWritableVirtualDeviceContextRequest = &patchedWritableVirtualDeviceContextRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsPartialUpdateRequest) Execute() (*VirtualDeviceContext, *http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsPartialUpdateExecute(r) +} + +/* +DcimVirtualDeviceContextsPartialUpdate Method for DcimVirtualDeviceContextsPartialUpdate + +Patch a virtual device context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual device context. + @return ApiDcimVirtualDeviceContextsPartialUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsPartialUpdate(ctx context.Context, id int32) ApiDcimVirtualDeviceContextsPartialUpdateRequest { + return ApiDcimVirtualDeviceContextsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualDeviceContext +func (a *DcimAPIService) DcimVirtualDeviceContextsPartialUpdateExecute(r ApiDcimVirtualDeviceContextsPartialUpdateRequest) (*VirtualDeviceContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDeviceContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableVirtualDeviceContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsRetrieveRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 +} + +func (r ApiDcimVirtualDeviceContextsRetrieveRequest) Execute() (*VirtualDeviceContext, *http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsRetrieveExecute(r) +} + +/* +DcimVirtualDeviceContextsRetrieve Method for DcimVirtualDeviceContextsRetrieve + +Get a virtual device context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual device context. + @return ApiDcimVirtualDeviceContextsRetrieveRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsRetrieve(ctx context.Context, id int32) ApiDcimVirtualDeviceContextsRetrieveRequest { + return ApiDcimVirtualDeviceContextsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualDeviceContext +func (a *DcimAPIService) DcimVirtualDeviceContextsRetrieveExecute(r ApiDcimVirtualDeviceContextsRetrieveRequest) (*VirtualDeviceContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDeviceContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDcimVirtualDeviceContextsUpdateRequest struct { + ctx context.Context + ApiService *DcimAPIService + id int32 + writableVirtualDeviceContextRequest *WritableVirtualDeviceContextRequest +} + +func (r ApiDcimVirtualDeviceContextsUpdateRequest) WritableVirtualDeviceContextRequest(writableVirtualDeviceContextRequest WritableVirtualDeviceContextRequest) ApiDcimVirtualDeviceContextsUpdateRequest { + r.writableVirtualDeviceContextRequest = &writableVirtualDeviceContextRequest + return r +} + +func (r ApiDcimVirtualDeviceContextsUpdateRequest) Execute() (*VirtualDeviceContext, *http.Response, error) { + return r.ApiService.DcimVirtualDeviceContextsUpdateExecute(r) +} + +/* +DcimVirtualDeviceContextsUpdate Method for DcimVirtualDeviceContextsUpdate + +Put a virtual device context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual device context. + @return ApiDcimVirtualDeviceContextsUpdateRequest +*/ +func (a *DcimAPIService) DcimVirtualDeviceContextsUpdate(ctx context.Context, id int32) ApiDcimVirtualDeviceContextsUpdateRequest { + return ApiDcimVirtualDeviceContextsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualDeviceContext +func (a *DcimAPIService) DcimVirtualDeviceContextsUpdateExecute(r ApiDcimVirtualDeviceContextsUpdateRequest) (*VirtualDeviceContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDeviceContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DcimAPIService.DcimVirtualDeviceContextsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/dcim/virtual-device-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualDeviceContextRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualDeviceContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualDeviceContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_extras.go b/vendor/github.com/netbox-community/go-netbox/v3/api_extras.go new file mode 100644 index 00000000..1c4a15a8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_extras.go @@ -0,0 +1,29387 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// ExtrasAPIService ExtrasAPI service +type ExtrasAPIService service + +type ApiExtrasBookmarksBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + bookmarkRequest *[]BookmarkRequest +} + +func (r ApiExtrasBookmarksBulkDestroyRequest) BookmarkRequest(bookmarkRequest []BookmarkRequest) ApiExtrasBookmarksBulkDestroyRequest { + r.bookmarkRequest = &bookmarkRequest + return r +} + +func (r ApiExtrasBookmarksBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasBookmarksBulkDestroyExecute(r) +} + +/* +ExtrasBookmarksBulkDestroy Method for ExtrasBookmarksBulkDestroy + +Delete a list of bookmark objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasBookmarksBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksBulkDestroy(ctx context.Context) ApiExtrasBookmarksBulkDestroyRequest { + return ApiExtrasBookmarksBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasBookmarksBulkDestroyExecute(r ApiExtrasBookmarksBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bookmarkRequest == nil { + return nil, reportError("bookmarkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.bookmarkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + bookmarkRequest *[]BookmarkRequest +} + +func (r ApiExtrasBookmarksBulkPartialUpdateRequest) BookmarkRequest(bookmarkRequest []BookmarkRequest) ApiExtrasBookmarksBulkPartialUpdateRequest { + r.bookmarkRequest = &bookmarkRequest + return r +} + +func (r ApiExtrasBookmarksBulkPartialUpdateRequest) Execute() ([]Bookmark, *http.Response, error) { + return r.ApiService.ExtrasBookmarksBulkPartialUpdateExecute(r) +} + +/* +ExtrasBookmarksBulkPartialUpdate Method for ExtrasBookmarksBulkPartialUpdate + +Patch a list of bookmark objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasBookmarksBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksBulkPartialUpdate(ctx context.Context) ApiExtrasBookmarksBulkPartialUpdateRequest { + return ApiExtrasBookmarksBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Bookmark +func (a *ExtrasAPIService) ExtrasBookmarksBulkPartialUpdateExecute(r ApiExtrasBookmarksBulkPartialUpdateRequest) ([]Bookmark, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Bookmark + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bookmarkRequest == nil { + return localVarReturnValue, nil, reportError("bookmarkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.bookmarkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + bookmarkRequest *[]BookmarkRequest +} + +func (r ApiExtrasBookmarksBulkUpdateRequest) BookmarkRequest(bookmarkRequest []BookmarkRequest) ApiExtrasBookmarksBulkUpdateRequest { + r.bookmarkRequest = &bookmarkRequest + return r +} + +func (r ApiExtrasBookmarksBulkUpdateRequest) Execute() ([]Bookmark, *http.Response, error) { + return r.ApiService.ExtrasBookmarksBulkUpdateExecute(r) +} + +/* +ExtrasBookmarksBulkUpdate Method for ExtrasBookmarksBulkUpdate + +Put a list of bookmark objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasBookmarksBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksBulkUpdate(ctx context.Context) ApiExtrasBookmarksBulkUpdateRequest { + return ApiExtrasBookmarksBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Bookmark +func (a *ExtrasAPIService) ExtrasBookmarksBulkUpdateExecute(r ApiExtrasBookmarksBulkUpdateRequest) ([]Bookmark, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Bookmark + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bookmarkRequest == nil { + return localVarReturnValue, nil, reportError("bookmarkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.bookmarkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableBookmarkRequest *WritableBookmarkRequest +} + +func (r ApiExtrasBookmarksCreateRequest) WritableBookmarkRequest(writableBookmarkRequest WritableBookmarkRequest) ApiExtrasBookmarksCreateRequest { + r.writableBookmarkRequest = &writableBookmarkRequest + return r +} + +func (r ApiExtrasBookmarksCreateRequest) Execute() (*Bookmark, *http.Response, error) { + return r.ApiService.ExtrasBookmarksCreateExecute(r) +} + +/* +ExtrasBookmarksCreate Method for ExtrasBookmarksCreate + +Post a list of bookmark objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasBookmarksCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksCreate(ctx context.Context) ApiExtrasBookmarksCreateRequest { + return ApiExtrasBookmarksCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Bookmark +func (a *ExtrasAPIService) ExtrasBookmarksCreateExecute(r ApiExtrasBookmarksCreateRequest) (*Bookmark, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Bookmark + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableBookmarkRequest == nil { + return localVarReturnValue, nil, reportError("writableBookmarkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableBookmarkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasBookmarksDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasBookmarksDestroyExecute(r) +} + +/* +ExtrasBookmarksDestroy Method for ExtrasBookmarksDestroy + +Delete a bookmark object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this bookmark. + @return ApiExtrasBookmarksDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksDestroy(ctx context.Context, id int32) ApiExtrasBookmarksDestroyRequest { + return ApiExtrasBookmarksDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasBookmarksDestroyExecute(r ApiExtrasBookmarksDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + created *time.Time + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + objectId *[]int32 + objectIdEmpty *bool + objectIdGt *[]int32 + objectIdGte *[]int32 + objectIdLt *[]int32 + objectIdLte *[]int32 + objectIdN *[]int32 + objectType *string + objectTypeN *string + objectTypeId *[]int32 + objectTypeIdEmpty *[]int32 + objectTypeIdGt *[]int32 + objectTypeIdGte *[]int32 + objectTypeIdLt *[]int32 + objectTypeIdLte *[]int32 + objectTypeIdN *[]int32 + offset *int32 + ordering *string + user *[]string + userN *[]string + userId *[]int32 + userIdN *[]int32 +} + +func (r ApiExtrasBookmarksListRequest) Created(created time.Time) ApiExtrasBookmarksListRequest { + r.created = &created + return r +} + +func (r ApiExtrasBookmarksListRequest) Id(id []int32) ApiExtrasBookmarksListRequest { + r.id = &id + return r +} + +func (r ApiExtrasBookmarksListRequest) IdEmpty(idEmpty bool) ApiExtrasBookmarksListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasBookmarksListRequest) IdGt(idGt []int32) ApiExtrasBookmarksListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasBookmarksListRequest) IdGte(idGte []int32) ApiExtrasBookmarksListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasBookmarksListRequest) IdLt(idLt []int32) ApiExtrasBookmarksListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasBookmarksListRequest) IdLte(idLte []int32) ApiExtrasBookmarksListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasBookmarksListRequest) IdN(idN []int32) ApiExtrasBookmarksListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasBookmarksListRequest) Limit(limit int32) ApiExtrasBookmarksListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectId(objectId []int32) ApiExtrasBookmarksListRequest { + r.objectId = &objectId + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectIdEmpty(objectIdEmpty bool) ApiExtrasBookmarksListRequest { + r.objectIdEmpty = &objectIdEmpty + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectIdGt(objectIdGt []int32) ApiExtrasBookmarksListRequest { + r.objectIdGt = &objectIdGt + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectIdGte(objectIdGte []int32) ApiExtrasBookmarksListRequest { + r.objectIdGte = &objectIdGte + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectIdLt(objectIdLt []int32) ApiExtrasBookmarksListRequest { + r.objectIdLt = &objectIdLt + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectIdLte(objectIdLte []int32) ApiExtrasBookmarksListRequest { + r.objectIdLte = &objectIdLte + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectIdN(objectIdN []int32) ApiExtrasBookmarksListRequest { + r.objectIdN = &objectIdN + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectType(objectType string) ApiExtrasBookmarksListRequest { + r.objectType = &objectType + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeN(objectTypeN string) ApiExtrasBookmarksListRequest { + r.objectTypeN = &objectTypeN + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeId(objectTypeId []int32) ApiExtrasBookmarksListRequest { + r.objectTypeId = &objectTypeId + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeIdEmpty(objectTypeIdEmpty []int32) ApiExtrasBookmarksListRequest { + r.objectTypeIdEmpty = &objectTypeIdEmpty + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeIdGt(objectTypeIdGt []int32) ApiExtrasBookmarksListRequest { + r.objectTypeIdGt = &objectTypeIdGt + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeIdGte(objectTypeIdGte []int32) ApiExtrasBookmarksListRequest { + r.objectTypeIdGte = &objectTypeIdGte + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeIdLt(objectTypeIdLt []int32) ApiExtrasBookmarksListRequest { + r.objectTypeIdLt = &objectTypeIdLt + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeIdLte(objectTypeIdLte []int32) ApiExtrasBookmarksListRequest { + r.objectTypeIdLte = &objectTypeIdLte + return r +} + +func (r ApiExtrasBookmarksListRequest) ObjectTypeIdN(objectTypeIdN []int32) ApiExtrasBookmarksListRequest { + r.objectTypeIdN = &objectTypeIdN + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasBookmarksListRequest) Offset(offset int32) ApiExtrasBookmarksListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasBookmarksListRequest) Ordering(ordering string) ApiExtrasBookmarksListRequest { + r.ordering = &ordering + return r +} + +// User (name) +func (r ApiExtrasBookmarksListRequest) User(user []string) ApiExtrasBookmarksListRequest { + r.user = &user + return r +} + +// User (name) +func (r ApiExtrasBookmarksListRequest) UserN(userN []string) ApiExtrasBookmarksListRequest { + r.userN = &userN + return r +} + +// User (ID) +func (r ApiExtrasBookmarksListRequest) UserId(userId []int32) ApiExtrasBookmarksListRequest { + r.userId = &userId + return r +} + +// User (ID) +func (r ApiExtrasBookmarksListRequest) UserIdN(userIdN []int32) ApiExtrasBookmarksListRequest { + r.userIdN = &userIdN + return r +} + +func (r ApiExtrasBookmarksListRequest) Execute() (*PaginatedBookmarkList, *http.Response, error) { + return r.ApiService.ExtrasBookmarksListExecute(r) +} + +/* +ExtrasBookmarksList Method for ExtrasBookmarksList + +Get a list of bookmark objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasBookmarksListRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksList(ctx context.Context) ApiExtrasBookmarksListRequest { + return ApiExtrasBookmarksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedBookmarkList +func (a *ExtrasAPIService) ExtrasBookmarksListExecute(r ApiExtrasBookmarksListRequest) (*PaginatedBookmarkList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedBookmarkList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.objectId != nil { + t := *r.objectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", t, "multi") + } + } + if r.objectIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__empty", r.objectIdEmpty, "") + } + if r.objectIdGt != nil { + t := *r.objectIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", t, "multi") + } + } + if r.objectIdGte != nil { + t := *r.objectIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", t, "multi") + } + } + if r.objectIdLt != nil { + t := *r.objectIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", t, "multi") + } + } + if r.objectIdLte != nil { + t := *r.objectIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", t, "multi") + } + } + if r.objectIdN != nil { + t := *r.objectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", t, "multi") + } + } + if r.objectType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type", r.objectType, "") + } + if r.objectTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type__n", r.objectTypeN, "") + } + if r.objectTypeId != nil { + t := *r.objectTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id", t, "multi") + } + } + if r.objectTypeIdEmpty != nil { + t := *r.objectTypeIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__empty", t, "multi") + } + } + if r.objectTypeIdGt != nil { + t := *r.objectTypeIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__gt", t, "multi") + } + } + if r.objectTypeIdGte != nil { + t := *r.objectTypeIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__gte", t, "multi") + } + } + if r.objectTypeIdLt != nil { + t := *r.objectTypeIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__lt", t, "multi") + } + } + if r.objectTypeIdLte != nil { + t := *r.objectTypeIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__lte", t, "multi") + } + } + if r.objectTypeIdN != nil { + t := *r.objectTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_type_id__n", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.user != nil { + t := *r.user + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", t, "multi") + } + } + if r.userN != nil { + t := *r.userN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", t, "multi") + } + } + if r.userId != nil { + t := *r.userId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", t, "multi") + } + } + if r.userIdN != nil { + t := *r.userIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableBookmarkRequest *PatchedWritableBookmarkRequest +} + +func (r ApiExtrasBookmarksPartialUpdateRequest) PatchedWritableBookmarkRequest(patchedWritableBookmarkRequest PatchedWritableBookmarkRequest) ApiExtrasBookmarksPartialUpdateRequest { + r.patchedWritableBookmarkRequest = &patchedWritableBookmarkRequest + return r +} + +func (r ApiExtrasBookmarksPartialUpdateRequest) Execute() (*Bookmark, *http.Response, error) { + return r.ApiService.ExtrasBookmarksPartialUpdateExecute(r) +} + +/* +ExtrasBookmarksPartialUpdate Method for ExtrasBookmarksPartialUpdate + +Patch a bookmark object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this bookmark. + @return ApiExtrasBookmarksPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksPartialUpdate(ctx context.Context, id int32) ApiExtrasBookmarksPartialUpdateRequest { + return ApiExtrasBookmarksPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Bookmark +func (a *ExtrasAPIService) ExtrasBookmarksPartialUpdateExecute(r ApiExtrasBookmarksPartialUpdateRequest) (*Bookmark, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Bookmark + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableBookmarkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasBookmarksRetrieveRequest) Execute() (*Bookmark, *http.Response, error) { + return r.ApiService.ExtrasBookmarksRetrieveExecute(r) +} + +/* +ExtrasBookmarksRetrieve Method for ExtrasBookmarksRetrieve + +Get a bookmark object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this bookmark. + @return ApiExtrasBookmarksRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksRetrieve(ctx context.Context, id int32) ApiExtrasBookmarksRetrieveRequest { + return ApiExtrasBookmarksRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Bookmark +func (a *ExtrasAPIService) ExtrasBookmarksRetrieveExecute(r ApiExtrasBookmarksRetrieveRequest) (*Bookmark, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Bookmark + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasBookmarksUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableBookmarkRequest *WritableBookmarkRequest +} + +func (r ApiExtrasBookmarksUpdateRequest) WritableBookmarkRequest(writableBookmarkRequest WritableBookmarkRequest) ApiExtrasBookmarksUpdateRequest { + r.writableBookmarkRequest = &writableBookmarkRequest + return r +} + +func (r ApiExtrasBookmarksUpdateRequest) Execute() (*Bookmark, *http.Response, error) { + return r.ApiService.ExtrasBookmarksUpdateExecute(r) +} + +/* +ExtrasBookmarksUpdate Method for ExtrasBookmarksUpdate + +Put a bookmark object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this bookmark. + @return ApiExtrasBookmarksUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasBookmarksUpdate(ctx context.Context, id int32) ApiExtrasBookmarksUpdateRequest { + return ApiExtrasBookmarksUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Bookmark +func (a *ExtrasAPIService) ExtrasBookmarksUpdateExecute(r ApiExtrasBookmarksUpdateRequest) (*Bookmark, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Bookmark + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasBookmarksUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/bookmarks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableBookmarkRequest == nil { + return localVarReturnValue, nil, reportError("writableBookmarkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableBookmarkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + configContextRequest *[]ConfigContextRequest +} + +func (r ApiExtrasConfigContextsBulkDestroyRequest) ConfigContextRequest(configContextRequest []ConfigContextRequest) ApiExtrasConfigContextsBulkDestroyRequest { + r.configContextRequest = &configContextRequest + return r +} + +func (r ApiExtrasConfigContextsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasConfigContextsBulkDestroyExecute(r) +} + +/* +ExtrasConfigContextsBulkDestroy Method for ExtrasConfigContextsBulkDestroy + +Delete a list of config context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigContextsBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsBulkDestroy(ctx context.Context) ApiExtrasConfigContextsBulkDestroyRequest { + return ApiExtrasConfigContextsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasConfigContextsBulkDestroyExecute(r ApiExtrasConfigContextsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.configContextRequest == nil { + return nil, reportError("configContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.configContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + configContextRequest *[]ConfigContextRequest +} + +func (r ApiExtrasConfigContextsBulkPartialUpdateRequest) ConfigContextRequest(configContextRequest []ConfigContextRequest) ApiExtrasConfigContextsBulkPartialUpdateRequest { + r.configContextRequest = &configContextRequest + return r +} + +func (r ApiExtrasConfigContextsBulkPartialUpdateRequest) Execute() ([]ConfigContext, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsBulkPartialUpdateExecute(r) +} + +/* +ExtrasConfigContextsBulkPartialUpdate Method for ExtrasConfigContextsBulkPartialUpdate + +Patch a list of config context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigContextsBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsBulkPartialUpdate(ctx context.Context) ApiExtrasConfigContextsBulkPartialUpdateRequest { + return ApiExtrasConfigContextsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConfigContext +func (a *ExtrasAPIService) ExtrasConfigContextsBulkPartialUpdateExecute(r ApiExtrasConfigContextsBulkPartialUpdateRequest) ([]ConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.configContextRequest == nil { + return localVarReturnValue, nil, reportError("configContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.configContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + configContextRequest *[]ConfigContextRequest +} + +func (r ApiExtrasConfigContextsBulkUpdateRequest) ConfigContextRequest(configContextRequest []ConfigContextRequest) ApiExtrasConfigContextsBulkUpdateRequest { + r.configContextRequest = &configContextRequest + return r +} + +func (r ApiExtrasConfigContextsBulkUpdateRequest) Execute() ([]ConfigContext, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsBulkUpdateExecute(r) +} + +/* +ExtrasConfigContextsBulkUpdate Method for ExtrasConfigContextsBulkUpdate + +Put a list of config context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigContextsBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsBulkUpdate(ctx context.Context) ApiExtrasConfigContextsBulkUpdateRequest { + return ApiExtrasConfigContextsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConfigContext +func (a *ExtrasAPIService) ExtrasConfigContextsBulkUpdateExecute(r ApiExtrasConfigContextsBulkUpdateRequest) ([]ConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.configContextRequest == nil { + return localVarReturnValue, nil, reportError("configContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.configContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableConfigContextRequest *WritableConfigContextRequest +} + +func (r ApiExtrasConfigContextsCreateRequest) WritableConfigContextRequest(writableConfigContextRequest WritableConfigContextRequest) ApiExtrasConfigContextsCreateRequest { + r.writableConfigContextRequest = &writableConfigContextRequest + return r +} + +func (r ApiExtrasConfigContextsCreateRequest) Execute() (*ConfigContext, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsCreateExecute(r) +} + +/* +ExtrasConfigContextsCreate Method for ExtrasConfigContextsCreate + +Post a list of config context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigContextsCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsCreate(ctx context.Context) ApiExtrasConfigContextsCreateRequest { + return ApiExtrasConfigContextsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ConfigContext +func (a *ExtrasAPIService) ExtrasConfigContextsCreateExecute(r ApiExtrasConfigContextsCreateRequest) (*ConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasConfigContextsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasConfigContextsDestroyExecute(r) +} + +/* +ExtrasConfigContextsDestroy Method for ExtrasConfigContextsDestroy + +Delete a config context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config context. + @return ApiExtrasConfigContextsDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsDestroy(ctx context.Context, id int32) ApiExtrasConfigContextsDestroyRequest { + return ApiExtrasConfigContextsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasConfigContextsDestroyExecute(r ApiExtrasConfigContextsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + clusterGroup *[]string + clusterGroupN *[]string + clusterGroupId *[]int32 + clusterGroupIdN *[]int32 + clusterId *[]int32 + clusterIdN *[]int32 + clusterType *[]string + clusterTypeN *[]string + clusterTypeId *[]int32 + clusterTypeIdN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + dataFileId *[]*int32 + dataFileIdN *[]*int32 + dataSourceId *[]*int32 + dataSourceIdN *[]*int32 + dataSynced *[]time.Time + dataSyncedEmpty *bool + dataSyncedGt *[]time.Time + dataSyncedGte *[]time.Time + dataSyncedLt *[]time.Time + dataSyncedLte *[]time.Time + dataSyncedN *[]time.Time + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + deviceTypeId *[]int32 + deviceTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + isActive *bool + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *[]string + locationN *[]string + locationId *[]int32 + locationIdN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + platform *[]string + platformN *[]string + platformId *[]int32 + platformIdN *[]int32 + q *string + region *[]string + regionN *[]string + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]string + siteGroupN *[]string + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + tagId *[]int32 + tagIdN *[]int32 + tenant *[]string + tenantN *[]string + tenantGroup *[]string + tenantGroupN *[]string + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]int32 + tenantIdN *[]int32 + updatedByRequest *string +} + +// Cluster group (slug) +func (r ApiExtrasConfigContextsListRequest) ClusterGroup(clusterGroup []string) ApiExtrasConfigContextsListRequest { + r.clusterGroup = &clusterGroup + return r +} + +// Cluster group (slug) +func (r ApiExtrasConfigContextsListRequest) ClusterGroupN(clusterGroupN []string) ApiExtrasConfigContextsListRequest { + r.clusterGroupN = &clusterGroupN + return r +} + +// Cluster group +func (r ApiExtrasConfigContextsListRequest) ClusterGroupId(clusterGroupId []int32) ApiExtrasConfigContextsListRequest { + r.clusterGroupId = &clusterGroupId + return r +} + +// Cluster group +func (r ApiExtrasConfigContextsListRequest) ClusterGroupIdN(clusterGroupIdN []int32) ApiExtrasConfigContextsListRequest { + r.clusterGroupIdN = &clusterGroupIdN + return r +} + +// Cluster +func (r ApiExtrasConfigContextsListRequest) ClusterId(clusterId []int32) ApiExtrasConfigContextsListRequest { + r.clusterId = &clusterId + return r +} + +// Cluster +func (r ApiExtrasConfigContextsListRequest) ClusterIdN(clusterIdN []int32) ApiExtrasConfigContextsListRequest { + r.clusterIdN = &clusterIdN + return r +} + +// Cluster type (slug) +func (r ApiExtrasConfigContextsListRequest) ClusterType(clusterType []string) ApiExtrasConfigContextsListRequest { + r.clusterType = &clusterType + return r +} + +// Cluster type (slug) +func (r ApiExtrasConfigContextsListRequest) ClusterTypeN(clusterTypeN []string) ApiExtrasConfigContextsListRequest { + r.clusterTypeN = &clusterTypeN + return r +} + +// Cluster type +func (r ApiExtrasConfigContextsListRequest) ClusterTypeId(clusterTypeId []int32) ApiExtrasConfigContextsListRequest { + r.clusterTypeId = &clusterTypeId + return r +} + +// Cluster type +func (r ApiExtrasConfigContextsListRequest) ClusterTypeIdN(clusterTypeIdN []int32) ApiExtrasConfigContextsListRequest { + r.clusterTypeIdN = &clusterTypeIdN + return r +} + +func (r ApiExtrasConfigContextsListRequest) Created(created []time.Time) ApiExtrasConfigContextsListRequest { + r.created = &created + return r +} + +func (r ApiExtrasConfigContextsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiExtrasConfigContextsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiExtrasConfigContextsListRequest) CreatedGt(createdGt []time.Time) ApiExtrasConfigContextsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiExtrasConfigContextsListRequest) CreatedGte(createdGte []time.Time) ApiExtrasConfigContextsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiExtrasConfigContextsListRequest) CreatedLt(createdLt []time.Time) ApiExtrasConfigContextsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiExtrasConfigContextsListRequest) CreatedLte(createdLte []time.Time) ApiExtrasConfigContextsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiExtrasConfigContextsListRequest) CreatedN(createdN []time.Time) ApiExtrasConfigContextsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiExtrasConfigContextsListRequest) CreatedByRequest(createdByRequest string) ApiExtrasConfigContextsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +// Data file (ID) +func (r ApiExtrasConfigContextsListRequest) DataFileId(dataFileId []*int32) ApiExtrasConfigContextsListRequest { + r.dataFileId = &dataFileId + return r +} + +// Data file (ID) +func (r ApiExtrasConfigContextsListRequest) DataFileIdN(dataFileIdN []*int32) ApiExtrasConfigContextsListRequest { + r.dataFileIdN = &dataFileIdN + return r +} + +// Data source (ID) +func (r ApiExtrasConfigContextsListRequest) DataSourceId(dataSourceId []*int32) ApiExtrasConfigContextsListRequest { + r.dataSourceId = &dataSourceId + return r +} + +// Data source (ID) +func (r ApiExtrasConfigContextsListRequest) DataSourceIdN(dataSourceIdN []*int32) ApiExtrasConfigContextsListRequest { + r.dataSourceIdN = &dataSourceIdN + return r +} + +func (r ApiExtrasConfigContextsListRequest) DataSynced(dataSynced []time.Time) ApiExtrasConfigContextsListRequest { + r.dataSynced = &dataSynced + return r +} + +func (r ApiExtrasConfigContextsListRequest) DataSyncedEmpty(dataSyncedEmpty bool) ApiExtrasConfigContextsListRequest { + r.dataSyncedEmpty = &dataSyncedEmpty + return r +} + +func (r ApiExtrasConfigContextsListRequest) DataSyncedGt(dataSyncedGt []time.Time) ApiExtrasConfigContextsListRequest { + r.dataSyncedGt = &dataSyncedGt + return r +} + +func (r ApiExtrasConfigContextsListRequest) DataSyncedGte(dataSyncedGte []time.Time) ApiExtrasConfigContextsListRequest { + r.dataSyncedGte = &dataSyncedGte + return r +} + +func (r ApiExtrasConfigContextsListRequest) DataSyncedLt(dataSyncedLt []time.Time) ApiExtrasConfigContextsListRequest { + r.dataSyncedLt = &dataSyncedLt + return r +} + +func (r ApiExtrasConfigContextsListRequest) DataSyncedLte(dataSyncedLte []time.Time) ApiExtrasConfigContextsListRequest { + r.dataSyncedLte = &dataSyncedLte + return r +} + +func (r ApiExtrasConfigContextsListRequest) DataSyncedN(dataSyncedN []time.Time) ApiExtrasConfigContextsListRequest { + r.dataSyncedN = &dataSyncedN + return r +} + +func (r ApiExtrasConfigContextsListRequest) Description(description []string) ApiExtrasConfigContextsListRequest { + r.description = &description + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasConfigContextsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionIc(descriptionIc []string) ApiExtrasConfigContextsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionIe(descriptionIe []string) ApiExtrasConfigContextsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionIew(descriptionIew []string) ApiExtrasConfigContextsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasConfigContextsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionN(descriptionN []string) ApiExtrasConfigContextsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionNic(descriptionNic []string) ApiExtrasConfigContextsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionNie(descriptionNie []string) ApiExtrasConfigContextsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasConfigContextsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasConfigContextsListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasConfigContextsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device type +func (r ApiExtrasConfigContextsListRequest) DeviceTypeId(deviceTypeId []int32) ApiExtrasConfigContextsListRequest { + r.deviceTypeId = &deviceTypeId + return r +} + +// Device type +func (r ApiExtrasConfigContextsListRequest) DeviceTypeIdN(deviceTypeIdN []int32) ApiExtrasConfigContextsListRequest { + r.deviceTypeIdN = &deviceTypeIdN + return r +} + +func (r ApiExtrasConfigContextsListRequest) Id(id []int32) ApiExtrasConfigContextsListRequest { + r.id = &id + return r +} + +func (r ApiExtrasConfigContextsListRequest) IdEmpty(idEmpty bool) ApiExtrasConfigContextsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasConfigContextsListRequest) IdGt(idGt []int32) ApiExtrasConfigContextsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasConfigContextsListRequest) IdGte(idGte []int32) ApiExtrasConfigContextsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasConfigContextsListRequest) IdLt(idLt []int32) ApiExtrasConfigContextsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasConfigContextsListRequest) IdLte(idLte []int32) ApiExtrasConfigContextsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasConfigContextsListRequest) IdN(idN []int32) ApiExtrasConfigContextsListRequest { + r.idN = &idN + return r +} + +func (r ApiExtrasConfigContextsListRequest) IsActive(isActive bool) ApiExtrasConfigContextsListRequest { + r.isActive = &isActive + return r +} + +func (r ApiExtrasConfigContextsListRequest) LastUpdated(lastUpdated []time.Time) ApiExtrasConfigContextsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiExtrasConfigContextsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiExtrasConfigContextsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiExtrasConfigContextsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiExtrasConfigContextsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiExtrasConfigContextsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiExtrasConfigContextsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiExtrasConfigContextsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiExtrasConfigContextsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiExtrasConfigContextsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiExtrasConfigContextsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiExtrasConfigContextsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiExtrasConfigContextsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiExtrasConfigContextsListRequest) Limit(limit int32) ApiExtrasConfigContextsListRequest { + r.limit = &limit + return r +} + +// Location (slug) +func (r ApiExtrasConfigContextsListRequest) Location(location []string) ApiExtrasConfigContextsListRequest { + r.location = &location + return r +} + +// Location (slug) +func (r ApiExtrasConfigContextsListRequest) LocationN(locationN []string) ApiExtrasConfigContextsListRequest { + r.locationN = &locationN + return r +} + +// Location +func (r ApiExtrasConfigContextsListRequest) LocationId(locationId []int32) ApiExtrasConfigContextsListRequest { + r.locationId = &locationId + return r +} + +// Location +func (r ApiExtrasConfigContextsListRequest) LocationIdN(locationIdN []int32) ApiExtrasConfigContextsListRequest { + r.locationIdN = &locationIdN + return r +} + +func (r ApiExtrasConfigContextsListRequest) ModifiedByRequest(modifiedByRequest string) ApiExtrasConfigContextsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiExtrasConfigContextsListRequest) Name(name []string) ApiExtrasConfigContextsListRequest { + r.name = &name + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameEmpty(nameEmpty bool) ApiExtrasConfigContextsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameIc(nameIc []string) ApiExtrasConfigContextsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameIe(nameIe []string) ApiExtrasConfigContextsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameIew(nameIew []string) ApiExtrasConfigContextsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameIsw(nameIsw []string) ApiExtrasConfigContextsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameN(nameN []string) ApiExtrasConfigContextsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameNic(nameNic []string) ApiExtrasConfigContextsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameNie(nameNie []string) ApiExtrasConfigContextsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameNiew(nameNiew []string) ApiExtrasConfigContextsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasConfigContextsListRequest) NameNisw(nameNisw []string) ApiExtrasConfigContextsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasConfigContextsListRequest) Offset(offset int32) ApiExtrasConfigContextsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasConfigContextsListRequest) Ordering(ordering string) ApiExtrasConfigContextsListRequest { + r.ordering = &ordering + return r +} + +// Platform (slug) +func (r ApiExtrasConfigContextsListRequest) Platform(platform []string) ApiExtrasConfigContextsListRequest { + r.platform = &platform + return r +} + +// Platform (slug) +func (r ApiExtrasConfigContextsListRequest) PlatformN(platformN []string) ApiExtrasConfigContextsListRequest { + r.platformN = &platformN + return r +} + +// Platform +func (r ApiExtrasConfigContextsListRequest) PlatformId(platformId []int32) ApiExtrasConfigContextsListRequest { + r.platformId = &platformId + return r +} + +// Platform +func (r ApiExtrasConfigContextsListRequest) PlatformIdN(platformIdN []int32) ApiExtrasConfigContextsListRequest { + r.platformIdN = &platformIdN + return r +} + +// Search +func (r ApiExtrasConfigContextsListRequest) Q(q string) ApiExtrasConfigContextsListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiExtrasConfigContextsListRequest) Region(region []string) ApiExtrasConfigContextsListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiExtrasConfigContextsListRequest) RegionN(regionN []string) ApiExtrasConfigContextsListRequest { + r.regionN = ®ionN + return r +} + +// Region +func (r ApiExtrasConfigContextsListRequest) RegionId(regionId []int32) ApiExtrasConfigContextsListRequest { + r.regionId = ®ionId + return r +} + +// Region +func (r ApiExtrasConfigContextsListRequest) RegionIdN(regionIdN []int32) ApiExtrasConfigContextsListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Role (slug) +func (r ApiExtrasConfigContextsListRequest) Role(role []string) ApiExtrasConfigContextsListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiExtrasConfigContextsListRequest) RoleN(roleN []string) ApiExtrasConfigContextsListRequest { + r.roleN = &roleN + return r +} + +// Role +func (r ApiExtrasConfigContextsListRequest) RoleId(roleId []int32) ApiExtrasConfigContextsListRequest { + r.roleId = &roleId + return r +} + +// Role +func (r ApiExtrasConfigContextsListRequest) RoleIdN(roleIdN []int32) ApiExtrasConfigContextsListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site (slug) +func (r ApiExtrasConfigContextsListRequest) Site(site []string) ApiExtrasConfigContextsListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiExtrasConfigContextsListRequest) SiteN(siteN []string) ApiExtrasConfigContextsListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiExtrasConfigContextsListRequest) SiteGroup(siteGroup []string) ApiExtrasConfigContextsListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiExtrasConfigContextsListRequest) SiteGroupN(siteGroupN []string) ApiExtrasConfigContextsListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group +func (r ApiExtrasConfigContextsListRequest) SiteGroupId(siteGroupId []int32) ApiExtrasConfigContextsListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group +func (r ApiExtrasConfigContextsListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiExtrasConfigContextsListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site +func (r ApiExtrasConfigContextsListRequest) SiteId(siteId []int32) ApiExtrasConfigContextsListRequest { + r.siteId = &siteId + return r +} + +// Site +func (r ApiExtrasConfigContextsListRequest) SiteIdN(siteIdN []int32) ApiExtrasConfigContextsListRequest { + r.siteIdN = &siteIdN + return r +} + +// Tag (slug) +func (r ApiExtrasConfigContextsListRequest) Tag(tag []string) ApiExtrasConfigContextsListRequest { + r.tag = &tag + return r +} + +// Tag (slug) +func (r ApiExtrasConfigContextsListRequest) TagN(tagN []string) ApiExtrasConfigContextsListRequest { + r.tagN = &tagN + return r +} + +// Tag +func (r ApiExtrasConfigContextsListRequest) TagId(tagId []int32) ApiExtrasConfigContextsListRequest { + r.tagId = &tagId + return r +} + +// Tag +func (r ApiExtrasConfigContextsListRequest) TagIdN(tagIdN []int32) ApiExtrasConfigContextsListRequest { + r.tagIdN = &tagIdN + return r +} + +// Tenant (slug) +func (r ApiExtrasConfigContextsListRequest) Tenant(tenant []string) ApiExtrasConfigContextsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiExtrasConfigContextsListRequest) TenantN(tenantN []string) ApiExtrasConfigContextsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant group (slug) +func (r ApiExtrasConfigContextsListRequest) TenantGroup(tenantGroup []string) ApiExtrasConfigContextsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant group (slug) +func (r ApiExtrasConfigContextsListRequest) TenantGroupN(tenantGroupN []string) ApiExtrasConfigContextsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant group +func (r ApiExtrasConfigContextsListRequest) TenantGroupId(tenantGroupId []int32) ApiExtrasConfigContextsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant group +func (r ApiExtrasConfigContextsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiExtrasConfigContextsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant +func (r ApiExtrasConfigContextsListRequest) TenantId(tenantId []int32) ApiExtrasConfigContextsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant +func (r ApiExtrasConfigContextsListRequest) TenantIdN(tenantIdN []int32) ApiExtrasConfigContextsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiExtrasConfigContextsListRequest) UpdatedByRequest(updatedByRequest string) ApiExtrasConfigContextsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiExtrasConfigContextsListRequest) Execute() (*PaginatedConfigContextList, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsListExecute(r) +} + +/* +ExtrasConfigContextsList Method for ExtrasConfigContextsList + +Get a list of config context objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigContextsListRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsList(ctx context.Context) ApiExtrasConfigContextsListRequest { + return ApiExtrasConfigContextsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConfigContextList +func (a *ExtrasAPIService) ExtrasConfigContextsListExecute(r ApiExtrasConfigContextsListRequest) (*PaginatedConfigContextList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConfigContextList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clusterGroup != nil { + t := *r.clusterGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group", t, "multi") + } + } + if r.clusterGroupN != nil { + t := *r.clusterGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group__n", t, "multi") + } + } + if r.clusterGroupId != nil { + t := *r.clusterGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id", t, "multi") + } + } + if r.clusterGroupIdN != nil { + t := *r.clusterGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id__n", t, "multi") + } + } + if r.clusterId != nil { + t := *r.clusterId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", t, "multi") + } + } + if r.clusterIdN != nil { + t := *r.clusterIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", t, "multi") + } + } + if r.clusterType != nil { + t := *r.clusterType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type", t, "multi") + } + } + if r.clusterTypeN != nil { + t := *r.clusterTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type__n", t, "multi") + } + } + if r.clusterTypeId != nil { + t := *r.clusterTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id", t, "multi") + } + } + if r.clusterTypeIdN != nil { + t := *r.clusterTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.dataFileId != nil { + t := *r.dataFileId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id", t, "multi") + } + } + if r.dataFileIdN != nil { + t := *r.dataFileIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id__n", t, "multi") + } + } + if r.dataSourceId != nil { + t := *r.dataSourceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id", t, "multi") + } + } + if r.dataSourceIdN != nil { + t := *r.dataSourceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id__n", t, "multi") + } + } + if r.dataSynced != nil { + t := *r.dataSynced + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced", t, "multi") + } + } + if r.dataSyncedEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__empty", r.dataSyncedEmpty, "") + } + if r.dataSyncedGt != nil { + t := *r.dataSyncedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gt", t, "multi") + } + } + if r.dataSyncedGte != nil { + t := *r.dataSyncedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gte", t, "multi") + } + } + if r.dataSyncedLt != nil { + t := *r.dataSyncedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lt", t, "multi") + } + } + if r.dataSyncedLte != nil { + t := *r.dataSyncedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lte", t, "multi") + } + } + if r.dataSyncedN != nil { + t := *r.dataSyncedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__n", t, "multi") + } + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.deviceTypeId != nil { + t := *r.deviceTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id", t, "multi") + } + } + if r.deviceTypeIdN != nil { + t := *r.deviceTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.isActive != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_active", r.isActive, "") + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + t := *r.location + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", t, "multi") + } + } + if r.locationN != nil { + t := *r.locationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location__n", t, "multi") + } + } + if r.locationId != nil { + t := *r.locationId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id", t, "multi") + } + } + if r.locationIdN != nil { + t := *r.locationIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "location_id__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.platform != nil { + t := *r.platform + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform", t, "multi") + } + } + if r.platformN != nil { + t := *r.platformN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform__n", t, "multi") + } + } + if r.platformId != nil { + t := *r.platformId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id", t, "multi") + } + } + if r.platformIdN != nil { + t := *r.platformIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tagId != nil { + t := *r.tagId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag_id", t, "multi") + } + } + if r.tagIdN != nil { + t := *r.tagIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag_id__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableConfigContextRequest *PatchedWritableConfigContextRequest +} + +func (r ApiExtrasConfigContextsPartialUpdateRequest) PatchedWritableConfigContextRequest(patchedWritableConfigContextRequest PatchedWritableConfigContextRequest) ApiExtrasConfigContextsPartialUpdateRequest { + r.patchedWritableConfigContextRequest = &patchedWritableConfigContextRequest + return r +} + +func (r ApiExtrasConfigContextsPartialUpdateRequest) Execute() (*ConfigContext, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsPartialUpdateExecute(r) +} + +/* +ExtrasConfigContextsPartialUpdate Method for ExtrasConfigContextsPartialUpdate + +Patch a config context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config context. + @return ApiExtrasConfigContextsPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsPartialUpdate(ctx context.Context, id int32) ApiExtrasConfigContextsPartialUpdateRequest { + return ApiExtrasConfigContextsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigContext +func (a *ExtrasAPIService) ExtrasConfigContextsPartialUpdateExecute(r ApiExtrasConfigContextsPartialUpdateRequest) (*ConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasConfigContextsRetrieveRequest) Execute() (*ConfigContext, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsRetrieveExecute(r) +} + +/* +ExtrasConfigContextsRetrieve Method for ExtrasConfigContextsRetrieve + +Get a config context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config context. + @return ApiExtrasConfigContextsRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsRetrieve(ctx context.Context, id int32) ApiExtrasConfigContextsRetrieveRequest { + return ApiExtrasConfigContextsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigContext +func (a *ExtrasAPIService) ExtrasConfigContextsRetrieveExecute(r ApiExtrasConfigContextsRetrieveRequest) (*ConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsSyncCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableConfigContextRequest *WritableConfigContextRequest +} + +func (r ApiExtrasConfigContextsSyncCreateRequest) WritableConfigContextRequest(writableConfigContextRequest WritableConfigContextRequest) ApiExtrasConfigContextsSyncCreateRequest { + r.writableConfigContextRequest = &writableConfigContextRequest + return r +} + +func (r ApiExtrasConfigContextsSyncCreateRequest) Execute() (*ConfigContext, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsSyncCreateExecute(r) +} + +/* +ExtrasConfigContextsSyncCreate Method for ExtrasConfigContextsSyncCreate + +Provide a /sync API endpoint to synchronize an object's data from its associated DataFile (if any). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config context. + @return ApiExtrasConfigContextsSyncCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsSyncCreate(ctx context.Context, id int32) ApiExtrasConfigContextsSyncCreateRequest { + return ApiExtrasConfigContextsSyncCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigContext +func (a *ExtrasAPIService) ExtrasConfigContextsSyncCreateExecute(r ApiExtrasConfigContextsSyncCreateRequest) (*ConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsSyncCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/{id}/sync/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigContextsUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableConfigContextRequest *WritableConfigContextRequest +} + +func (r ApiExtrasConfigContextsUpdateRequest) WritableConfigContextRequest(writableConfigContextRequest WritableConfigContextRequest) ApiExtrasConfigContextsUpdateRequest { + r.writableConfigContextRequest = &writableConfigContextRequest + return r +} + +func (r ApiExtrasConfigContextsUpdateRequest) Execute() (*ConfigContext, *http.Response, error) { + return r.ApiService.ExtrasConfigContextsUpdateExecute(r) +} + +/* +ExtrasConfigContextsUpdate Method for ExtrasConfigContextsUpdate + +Put a config context object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config context. + @return ApiExtrasConfigContextsUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigContextsUpdate(ctx context.Context, id int32) ApiExtrasConfigContextsUpdateRequest { + return ApiExtrasConfigContextsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigContext +func (a *ExtrasAPIService) ExtrasConfigContextsUpdateExecute(r ApiExtrasConfigContextsUpdateRequest) (*ConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigContextsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-contexts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + configTemplateRequest *[]ConfigTemplateRequest +} + +func (r ApiExtrasConfigTemplatesBulkDestroyRequest) ConfigTemplateRequest(configTemplateRequest []ConfigTemplateRequest) ApiExtrasConfigTemplatesBulkDestroyRequest { + r.configTemplateRequest = &configTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesBulkDestroyExecute(r) +} + +/* +ExtrasConfigTemplatesBulkDestroy Method for ExtrasConfigTemplatesBulkDestroy + +Delete a list of config template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigTemplatesBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesBulkDestroy(ctx context.Context) ApiExtrasConfigTemplatesBulkDestroyRequest { + return ApiExtrasConfigTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasConfigTemplatesBulkDestroyExecute(r ApiExtrasConfigTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.configTemplateRequest == nil { + return nil, reportError("configTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.configTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + configTemplateRequest *[]ConfigTemplateRequest +} + +func (r ApiExtrasConfigTemplatesBulkPartialUpdateRequest) ConfigTemplateRequest(configTemplateRequest []ConfigTemplateRequest) ApiExtrasConfigTemplatesBulkPartialUpdateRequest { + r.configTemplateRequest = &configTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesBulkPartialUpdateRequest) Execute() ([]ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesBulkPartialUpdateExecute(r) +} + +/* +ExtrasConfigTemplatesBulkPartialUpdate Method for ExtrasConfigTemplatesBulkPartialUpdate + +Patch a list of config template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigTemplatesBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesBulkPartialUpdate(ctx context.Context) ApiExtrasConfigTemplatesBulkPartialUpdateRequest { + return ApiExtrasConfigTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesBulkPartialUpdateExecute(r ApiExtrasConfigTemplatesBulkPartialUpdateRequest) ([]ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.configTemplateRequest == nil { + return localVarReturnValue, nil, reportError("configTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.configTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + configTemplateRequest *[]ConfigTemplateRequest +} + +func (r ApiExtrasConfigTemplatesBulkUpdateRequest) ConfigTemplateRequest(configTemplateRequest []ConfigTemplateRequest) ApiExtrasConfigTemplatesBulkUpdateRequest { + r.configTemplateRequest = &configTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesBulkUpdateRequest) Execute() ([]ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesBulkUpdateExecute(r) +} + +/* +ExtrasConfigTemplatesBulkUpdate Method for ExtrasConfigTemplatesBulkUpdate + +Put a list of config template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigTemplatesBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesBulkUpdate(ctx context.Context) ApiExtrasConfigTemplatesBulkUpdateRequest { + return ApiExtrasConfigTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesBulkUpdateExecute(r ApiExtrasConfigTemplatesBulkUpdateRequest) ([]ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.configTemplateRequest == nil { + return localVarReturnValue, nil, reportError("configTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.configTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableConfigTemplateRequest *WritableConfigTemplateRequest +} + +func (r ApiExtrasConfigTemplatesCreateRequest) WritableConfigTemplateRequest(writableConfigTemplateRequest WritableConfigTemplateRequest) ApiExtrasConfigTemplatesCreateRequest { + r.writableConfigTemplateRequest = &writableConfigTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesCreateRequest) Execute() (*ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesCreateExecute(r) +} + +/* +ExtrasConfigTemplatesCreate Method for ExtrasConfigTemplatesCreate + +Post a list of config template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigTemplatesCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesCreate(ctx context.Context) ApiExtrasConfigTemplatesCreateRequest { + return ApiExtrasConfigTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesCreateExecute(r ApiExtrasConfigTemplatesCreateRequest) (*ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConfigTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConfigTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConfigTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasConfigTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesDestroyExecute(r) +} + +/* +ExtrasConfigTemplatesDestroy Method for ExtrasConfigTemplatesDestroy + +Delete a config template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config template. + @return ApiExtrasConfigTemplatesDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesDestroy(ctx context.Context, id int32) ApiExtrasConfigTemplatesDestroyRequest { + return ApiExtrasConfigTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasConfigTemplatesDestroyExecute(r ApiExtrasConfigTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + dataFileId *[]*int32 + dataFileIdN *[]*int32 + dataSourceId *[]*int32 + dataSourceIdN *[]*int32 + dataSynced *[]time.Time + dataSyncedEmpty *bool + dataSyncedGt *[]time.Time + dataSyncedGte *[]time.Time + dataSyncedLt *[]time.Time + dataSyncedLte *[]time.Time + dataSyncedN *[]time.Time + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + tag *[]string + tagN *[]string +} + +// Data file (ID) +func (r ApiExtrasConfigTemplatesListRequest) DataFileId(dataFileId []*int32) ApiExtrasConfigTemplatesListRequest { + r.dataFileId = &dataFileId + return r +} + +// Data file (ID) +func (r ApiExtrasConfigTemplatesListRequest) DataFileIdN(dataFileIdN []*int32) ApiExtrasConfigTemplatesListRequest { + r.dataFileIdN = &dataFileIdN + return r +} + +// Data source (ID) +func (r ApiExtrasConfigTemplatesListRequest) DataSourceId(dataSourceId []*int32) ApiExtrasConfigTemplatesListRequest { + r.dataSourceId = &dataSourceId + return r +} + +// Data source (ID) +func (r ApiExtrasConfigTemplatesListRequest) DataSourceIdN(dataSourceIdN []*int32) ApiExtrasConfigTemplatesListRequest { + r.dataSourceIdN = &dataSourceIdN + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DataSynced(dataSynced []time.Time) ApiExtrasConfigTemplatesListRequest { + r.dataSynced = &dataSynced + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DataSyncedEmpty(dataSyncedEmpty bool) ApiExtrasConfigTemplatesListRequest { + r.dataSyncedEmpty = &dataSyncedEmpty + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DataSyncedGt(dataSyncedGt []time.Time) ApiExtrasConfigTemplatesListRequest { + r.dataSyncedGt = &dataSyncedGt + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DataSyncedGte(dataSyncedGte []time.Time) ApiExtrasConfigTemplatesListRequest { + r.dataSyncedGte = &dataSyncedGte + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DataSyncedLt(dataSyncedLt []time.Time) ApiExtrasConfigTemplatesListRequest { + r.dataSyncedLt = &dataSyncedLt + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DataSyncedLte(dataSyncedLte []time.Time) ApiExtrasConfigTemplatesListRequest { + r.dataSyncedLte = &dataSyncedLte + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DataSyncedN(dataSyncedN []time.Time) ApiExtrasConfigTemplatesListRequest { + r.dataSyncedN = &dataSyncedN + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) Description(description []string) ApiExtrasConfigTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasConfigTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionN(descriptionN []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasConfigTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) Id(id []int32) ApiExtrasConfigTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) IdEmpty(idEmpty bool) ApiExtrasConfigTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) IdGt(idGt []int32) ApiExtrasConfigTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) IdGte(idGte []int32) ApiExtrasConfigTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) IdLt(idLt []int32) ApiExtrasConfigTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) IdLte(idLte []int32) ApiExtrasConfigTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) IdN(idN []int32) ApiExtrasConfigTemplatesListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasConfigTemplatesListRequest) Limit(limit int32) ApiExtrasConfigTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) Name(name []string) ApiExtrasConfigTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameEmpty(nameEmpty bool) ApiExtrasConfigTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameIc(nameIc []string) ApiExtrasConfigTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameIe(nameIe []string) ApiExtrasConfigTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameIew(nameIew []string) ApiExtrasConfigTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameIsw(nameIsw []string) ApiExtrasConfigTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameN(nameN []string) ApiExtrasConfigTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameNic(nameNic []string) ApiExtrasConfigTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameNie(nameNie []string) ApiExtrasConfigTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameNiew(nameNiew []string) ApiExtrasConfigTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) NameNisw(nameNisw []string) ApiExtrasConfigTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasConfigTemplatesListRequest) Offset(offset int32) ApiExtrasConfigTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasConfigTemplatesListRequest) Ordering(ordering string) ApiExtrasConfigTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasConfigTemplatesListRequest) Q(q string) ApiExtrasConfigTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) Tag(tag []string) ApiExtrasConfigTemplatesListRequest { + r.tag = &tag + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) TagN(tagN []string) ApiExtrasConfigTemplatesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiExtrasConfigTemplatesListRequest) Execute() (*PaginatedConfigTemplateList, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesListExecute(r) +} + +/* +ExtrasConfigTemplatesList Method for ExtrasConfigTemplatesList + +Get a list of config template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasConfigTemplatesListRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesList(ctx context.Context) ApiExtrasConfigTemplatesListRequest { + return ApiExtrasConfigTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConfigTemplateList +func (a *ExtrasAPIService) ExtrasConfigTemplatesListExecute(r ApiExtrasConfigTemplatesListRequest) (*PaginatedConfigTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConfigTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.dataFileId != nil { + t := *r.dataFileId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id", t, "multi") + } + } + if r.dataFileIdN != nil { + t := *r.dataFileIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id__n", t, "multi") + } + } + if r.dataSourceId != nil { + t := *r.dataSourceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id", t, "multi") + } + } + if r.dataSourceIdN != nil { + t := *r.dataSourceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id__n", t, "multi") + } + } + if r.dataSynced != nil { + t := *r.dataSynced + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced", t, "multi") + } + } + if r.dataSyncedEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__empty", r.dataSyncedEmpty, "") + } + if r.dataSyncedGt != nil { + t := *r.dataSyncedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gt", t, "multi") + } + } + if r.dataSyncedGte != nil { + t := *r.dataSyncedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gte", t, "multi") + } + } + if r.dataSyncedLt != nil { + t := *r.dataSyncedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lt", t, "multi") + } + } + if r.dataSyncedLte != nil { + t := *r.dataSyncedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lte", t, "multi") + } + } + if r.dataSyncedN != nil { + t := *r.dataSyncedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__n", t, "multi") + } + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableConfigTemplateRequest *PatchedWritableConfigTemplateRequest +} + +func (r ApiExtrasConfigTemplatesPartialUpdateRequest) PatchedWritableConfigTemplateRequest(patchedWritableConfigTemplateRequest PatchedWritableConfigTemplateRequest) ApiExtrasConfigTemplatesPartialUpdateRequest { + r.patchedWritableConfigTemplateRequest = &patchedWritableConfigTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesPartialUpdateRequest) Execute() (*ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesPartialUpdateExecute(r) +} + +/* +ExtrasConfigTemplatesPartialUpdate Method for ExtrasConfigTemplatesPartialUpdate + +Patch a config template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config template. + @return ApiExtrasConfigTemplatesPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesPartialUpdate(ctx context.Context, id int32) ApiExtrasConfigTemplatesPartialUpdateRequest { + return ApiExtrasConfigTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesPartialUpdateExecute(r ApiExtrasConfigTemplatesPartialUpdateRequest) (*ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableConfigTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesRenderCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableConfigTemplateRequest *WritableConfigTemplateRequest + format *DcimDevicesRenderConfigCreateFormatParameter +} + +func (r ApiExtrasConfigTemplatesRenderCreateRequest) WritableConfigTemplateRequest(writableConfigTemplateRequest WritableConfigTemplateRequest) ApiExtrasConfigTemplatesRenderCreateRequest { + r.writableConfigTemplateRequest = &writableConfigTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesRenderCreateRequest) Format(format DcimDevicesRenderConfigCreateFormatParameter) ApiExtrasConfigTemplatesRenderCreateRequest { + r.format = &format + return r +} + +func (r ApiExtrasConfigTemplatesRenderCreateRequest) Execute() (*ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesRenderCreateExecute(r) +} + +/* +ExtrasConfigTemplatesRenderCreate Method for ExtrasConfigTemplatesRenderCreate + +Render a ConfigTemplate using the context data provided (if any). If the client requests "text/plain" data, +return the raw rendered content, rather than serialized JSON. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config template. + @return ApiExtrasConfigTemplatesRenderCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesRenderCreate(ctx context.Context, id int32) ApiExtrasConfigTemplatesRenderCreateRequest { + return ApiExtrasConfigTemplatesRenderCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesRenderCreateExecute(r ApiExtrasConfigTemplatesRenderCreateRequest) (*ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesRenderCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/{id}/render/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConfigTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConfigTemplateRequest is required and must be specified") + } + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConfigTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasConfigTemplatesRetrieveRequest) Execute() (*ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesRetrieveExecute(r) +} + +/* +ExtrasConfigTemplatesRetrieve Method for ExtrasConfigTemplatesRetrieve + +Get a config template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config template. + @return ApiExtrasConfigTemplatesRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesRetrieve(ctx context.Context, id int32) ApiExtrasConfigTemplatesRetrieveRequest { + return ApiExtrasConfigTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesRetrieveExecute(r ApiExtrasConfigTemplatesRetrieveRequest) (*ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesSyncCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableConfigTemplateRequest *WritableConfigTemplateRequest +} + +func (r ApiExtrasConfigTemplatesSyncCreateRequest) WritableConfigTemplateRequest(writableConfigTemplateRequest WritableConfigTemplateRequest) ApiExtrasConfigTemplatesSyncCreateRequest { + r.writableConfigTemplateRequest = &writableConfigTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesSyncCreateRequest) Execute() (*ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesSyncCreateExecute(r) +} + +/* +ExtrasConfigTemplatesSyncCreate Method for ExtrasConfigTemplatesSyncCreate + +Provide a /sync API endpoint to synchronize an object's data from its associated DataFile (if any). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config template. + @return ApiExtrasConfigTemplatesSyncCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesSyncCreate(ctx context.Context, id int32) ApiExtrasConfigTemplatesSyncCreateRequest { + return ApiExtrasConfigTemplatesSyncCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesSyncCreateExecute(r ApiExtrasConfigTemplatesSyncCreateRequest) (*ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesSyncCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/{id}/sync/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConfigTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConfigTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConfigTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasConfigTemplatesUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableConfigTemplateRequest *WritableConfigTemplateRequest +} + +func (r ApiExtrasConfigTemplatesUpdateRequest) WritableConfigTemplateRequest(writableConfigTemplateRequest WritableConfigTemplateRequest) ApiExtrasConfigTemplatesUpdateRequest { + r.writableConfigTemplateRequest = &writableConfigTemplateRequest + return r +} + +func (r ApiExtrasConfigTemplatesUpdateRequest) Execute() (*ConfigTemplate, *http.Response, error) { + return r.ApiService.ExtrasConfigTemplatesUpdateExecute(r) +} + +/* +ExtrasConfigTemplatesUpdate Method for ExtrasConfigTemplatesUpdate + +Put a config template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this config template. + @return ApiExtrasConfigTemplatesUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasConfigTemplatesUpdate(ctx context.Context, id int32) ApiExtrasConfigTemplatesUpdateRequest { + return ApiExtrasConfigTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ConfigTemplate +func (a *ExtrasAPIService) ExtrasConfigTemplatesUpdateExecute(r ApiExtrasConfigTemplatesUpdateRequest) (*ConfigTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConfigTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasConfigTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/config-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableConfigTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableConfigTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableConfigTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasContentTypesListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + appLabel *string + id *int32 + limit *int32 + model *string + offset *int32 + ordering *string + q *string +} + +func (r ApiExtrasContentTypesListRequest) AppLabel(appLabel string) ApiExtrasContentTypesListRequest { + r.appLabel = &appLabel + return r +} + +func (r ApiExtrasContentTypesListRequest) Id(id int32) ApiExtrasContentTypesListRequest { + r.id = &id + return r +} + +// Number of results to return per page. +func (r ApiExtrasContentTypesListRequest) Limit(limit int32) ApiExtrasContentTypesListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasContentTypesListRequest) Model(model string) ApiExtrasContentTypesListRequest { + r.model = &model + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasContentTypesListRequest) Offset(offset int32) ApiExtrasContentTypesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasContentTypesListRequest) Ordering(ordering string) ApiExtrasContentTypesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasContentTypesListRequest) Q(q string) ApiExtrasContentTypesListRequest { + r.q = &q + return r +} + +func (r ApiExtrasContentTypesListRequest) Execute() (*PaginatedContentTypeList, *http.Response, error) { + return r.ApiService.ExtrasContentTypesListExecute(r) +} + +/* +ExtrasContentTypesList Method for ExtrasContentTypesList + +Read-only list of ContentTypes. Limit results to ContentTypes pertinent to NetBox objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasContentTypesListRequest +*/ +func (a *ExtrasAPIService) ExtrasContentTypesList(ctx context.Context) ApiExtrasContentTypesListRequest { + return ApiExtrasContentTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedContentTypeList +func (a *ExtrasAPIService) ExtrasContentTypesListExecute(r ApiExtrasContentTypesListRequest) (*PaginatedContentTypeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedContentTypeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasContentTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/content-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.appLabel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "app_label", r.appLabel, "") + } + if r.id != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.model != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", r.model, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasContentTypesRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasContentTypesRetrieveRequest) Execute() (*ContentType, *http.Response, error) { + return r.ApiService.ExtrasContentTypesRetrieveExecute(r) +} + +/* +ExtrasContentTypesRetrieve Method for ExtrasContentTypesRetrieve + +Read-only list of ContentTypes. Limit results to ContentTypes pertinent to NetBox objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this content type. + @return ApiExtrasContentTypesRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasContentTypesRetrieve(ctx context.Context, id int32) ApiExtrasContentTypesRetrieveRequest { + return ApiExtrasContentTypesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContentType +func (a *ExtrasAPIService) ExtrasContentTypesRetrieveExecute(r ApiExtrasContentTypesRetrieveRequest) (*ContentType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContentType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasContentTypesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/content-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customFieldChoiceSetRequest *[]CustomFieldChoiceSetRequest +} + +func (r ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest) CustomFieldChoiceSetRequest(customFieldChoiceSetRequest []CustomFieldChoiceSetRequest) ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest { + r.customFieldChoiceSetRequest = &customFieldChoiceSetRequest + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsBulkDestroyExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsBulkDestroy Method for ExtrasCustomFieldChoiceSetsBulkDestroy + +Delete a list of custom field choice set objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsBulkDestroy(ctx context.Context) ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest { + return ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsBulkDestroyExecute(r ApiExtrasCustomFieldChoiceSetsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customFieldChoiceSetRequest == nil { + return nil, reportError("customFieldChoiceSetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customFieldChoiceSetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customFieldChoiceSetRequest *[]CustomFieldChoiceSetRequest +} + +func (r ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest) CustomFieldChoiceSetRequest(customFieldChoiceSetRequest []CustomFieldChoiceSetRequest) ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest { + r.customFieldChoiceSetRequest = &customFieldChoiceSetRequest + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest) Execute() ([]CustomFieldChoiceSet, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsBulkPartialUpdateExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsBulkPartialUpdate Method for ExtrasCustomFieldChoiceSetsBulkPartialUpdate + +Patch a list of custom field choice set objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsBulkPartialUpdate(ctx context.Context) ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest { + return ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CustomFieldChoiceSet +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsBulkPartialUpdateExecute(r ApiExtrasCustomFieldChoiceSetsBulkPartialUpdateRequest) ([]CustomFieldChoiceSet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CustomFieldChoiceSet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customFieldChoiceSetRequest == nil { + return localVarReturnValue, nil, reportError("customFieldChoiceSetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customFieldChoiceSetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customFieldChoiceSetRequest *[]CustomFieldChoiceSetRequest +} + +func (r ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest) CustomFieldChoiceSetRequest(customFieldChoiceSetRequest []CustomFieldChoiceSetRequest) ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest { + r.customFieldChoiceSetRequest = &customFieldChoiceSetRequest + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest) Execute() ([]CustomFieldChoiceSet, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsBulkUpdateExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsBulkUpdate Method for ExtrasCustomFieldChoiceSetsBulkUpdate + +Put a list of custom field choice set objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsBulkUpdate(ctx context.Context) ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest { + return ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CustomFieldChoiceSet +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsBulkUpdateExecute(r ApiExtrasCustomFieldChoiceSetsBulkUpdateRequest) ([]CustomFieldChoiceSet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CustomFieldChoiceSet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customFieldChoiceSetRequest == nil { + return localVarReturnValue, nil, reportError("customFieldChoiceSetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customFieldChoiceSetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsChoicesRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasCustomFieldChoiceSetsChoicesRetrieveRequest) Execute() (*CustomFieldChoiceSet, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsChoicesRetrieveExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsChoicesRetrieve Method for ExtrasCustomFieldChoiceSetsChoicesRetrieve + +Provides an endpoint to iterate through each choice in a set. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field choice set. + @return ApiExtrasCustomFieldChoiceSetsChoicesRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsChoicesRetrieve(ctx context.Context, id int32) ApiExtrasCustomFieldChoiceSetsChoicesRetrieveRequest { + return ApiExtrasCustomFieldChoiceSetsChoicesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomFieldChoiceSet +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsChoicesRetrieveExecute(r ApiExtrasCustomFieldChoiceSetsChoicesRetrieveRequest) (*CustomFieldChoiceSet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomFieldChoiceSet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsChoicesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/{id}/choices/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableCustomFieldChoiceSetRequest *WritableCustomFieldChoiceSetRequest +} + +func (r ApiExtrasCustomFieldChoiceSetsCreateRequest) WritableCustomFieldChoiceSetRequest(writableCustomFieldChoiceSetRequest WritableCustomFieldChoiceSetRequest) ApiExtrasCustomFieldChoiceSetsCreateRequest { + r.writableCustomFieldChoiceSetRequest = &writableCustomFieldChoiceSetRequest + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsCreateRequest) Execute() (*CustomFieldChoiceSet, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsCreateExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsCreate Method for ExtrasCustomFieldChoiceSetsCreate + +Post a list of custom field choice set objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldChoiceSetsCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsCreate(ctx context.Context) ApiExtrasCustomFieldChoiceSetsCreateRequest { + return ApiExtrasCustomFieldChoiceSetsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CustomFieldChoiceSet +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsCreateExecute(r ApiExtrasCustomFieldChoiceSetsCreateRequest) (*CustomFieldChoiceSet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomFieldChoiceSet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCustomFieldChoiceSetRequest == nil { + return localVarReturnValue, nil, reportError("writableCustomFieldChoiceSetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCustomFieldChoiceSetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasCustomFieldChoiceSetsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsDestroyExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsDestroy Method for ExtrasCustomFieldChoiceSetsDestroy + +Delete a custom field choice set object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field choice set. + @return ApiExtrasCustomFieldChoiceSetsDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsDestroy(ctx context.Context, id int32) ApiExtrasCustomFieldChoiceSetsDestroyRequest { + return ApiExtrasCustomFieldChoiceSetsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsDestroyExecute(r ApiExtrasCustomFieldChoiceSetsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + baseChoices *string + baseChoicesN *string + choice *[]string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + orderAlphabetically *bool + ordering *string + q *string +} + +// Base set of predefined choices (optional) +func (r ApiExtrasCustomFieldChoiceSetsListRequest) BaseChoices(baseChoices string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.baseChoices = &baseChoices + return r +} + +// Base set of predefined choices (optional) +func (r ApiExtrasCustomFieldChoiceSetsListRequest) BaseChoicesN(baseChoicesN string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.baseChoicesN = &baseChoicesN + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Choice(choice []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.choice = &choice + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Description(description []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.description = &description + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionIc(descriptionIc []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionIe(descriptionIe []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionIew(descriptionIew []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionN(descriptionN []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionNic(descriptionNic []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionNie(descriptionNie []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Id(id []int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.id = &id + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) IdEmpty(idEmpty bool) ApiExtrasCustomFieldChoiceSetsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) IdGt(idGt []int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) IdGte(idGte []int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) IdLt(idLt []int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) IdLte(idLte []int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) IdN(idN []int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Limit(limit int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Name(name []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.name = &name + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameEmpty(nameEmpty bool) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameIc(nameIc []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameIe(nameIe []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameIew(nameIew []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameIsw(nameIsw []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameN(nameN []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameNic(nameNic []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameNie(nameNie []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameNiew(nameNiew []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) NameNisw(nameNisw []string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Offset(offset int32) ApiExtrasCustomFieldChoiceSetsListRequest { + r.offset = &offset + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) OrderAlphabetically(orderAlphabetically bool) ApiExtrasCustomFieldChoiceSetsListRequest { + r.orderAlphabetically = &orderAlphabetically + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Ordering(ordering string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Q(q string) ApiExtrasCustomFieldChoiceSetsListRequest { + r.q = &q + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsListRequest) Execute() (*PaginatedCustomFieldChoiceSetList, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsListExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsList Method for ExtrasCustomFieldChoiceSetsList + +Get a list of custom field choice set objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldChoiceSetsListRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsList(ctx context.Context) ApiExtrasCustomFieldChoiceSetsListRequest { + return ApiExtrasCustomFieldChoiceSetsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCustomFieldChoiceSetList +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsListExecute(r ApiExtrasCustomFieldChoiceSetsListRequest) (*PaginatedCustomFieldChoiceSetList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCustomFieldChoiceSetList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.baseChoices != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "base_choices", r.baseChoices, "") + } + if r.baseChoicesN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "base_choices__n", r.baseChoicesN, "") + } + if r.choice != nil { + t := *r.choice + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice", t, "multi") + } + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.orderAlphabetically != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order_alphabetically", r.orderAlphabetically, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableCustomFieldChoiceSetRequest *PatchedWritableCustomFieldChoiceSetRequest +} + +func (r ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest) PatchedWritableCustomFieldChoiceSetRequest(patchedWritableCustomFieldChoiceSetRequest PatchedWritableCustomFieldChoiceSetRequest) ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest { + r.patchedWritableCustomFieldChoiceSetRequest = &patchedWritableCustomFieldChoiceSetRequest + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest) Execute() (*CustomFieldChoiceSet, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsPartialUpdateExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsPartialUpdate Method for ExtrasCustomFieldChoiceSetsPartialUpdate + +Patch a custom field choice set object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field choice set. + @return ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsPartialUpdate(ctx context.Context, id int32) ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest { + return ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomFieldChoiceSet +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsPartialUpdateExecute(r ApiExtrasCustomFieldChoiceSetsPartialUpdateRequest) (*CustomFieldChoiceSet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomFieldChoiceSet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableCustomFieldChoiceSetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasCustomFieldChoiceSetsRetrieveRequest) Execute() (*CustomFieldChoiceSet, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsRetrieveExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsRetrieve Method for ExtrasCustomFieldChoiceSetsRetrieve + +Get a custom field choice set object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field choice set. + @return ApiExtrasCustomFieldChoiceSetsRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsRetrieve(ctx context.Context, id int32) ApiExtrasCustomFieldChoiceSetsRetrieveRequest { + return ApiExtrasCustomFieldChoiceSetsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomFieldChoiceSet +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsRetrieveExecute(r ApiExtrasCustomFieldChoiceSetsRetrieveRequest) (*CustomFieldChoiceSet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomFieldChoiceSet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldChoiceSetsUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableCustomFieldChoiceSetRequest *WritableCustomFieldChoiceSetRequest +} + +func (r ApiExtrasCustomFieldChoiceSetsUpdateRequest) WritableCustomFieldChoiceSetRequest(writableCustomFieldChoiceSetRequest WritableCustomFieldChoiceSetRequest) ApiExtrasCustomFieldChoiceSetsUpdateRequest { + r.writableCustomFieldChoiceSetRequest = &writableCustomFieldChoiceSetRequest + return r +} + +func (r ApiExtrasCustomFieldChoiceSetsUpdateRequest) Execute() (*CustomFieldChoiceSet, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldChoiceSetsUpdateExecute(r) +} + +/* +ExtrasCustomFieldChoiceSetsUpdate Method for ExtrasCustomFieldChoiceSetsUpdate + +Put a custom field choice set object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field choice set. + @return ApiExtrasCustomFieldChoiceSetsUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsUpdate(ctx context.Context, id int32) ApiExtrasCustomFieldChoiceSetsUpdateRequest { + return ApiExtrasCustomFieldChoiceSetsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomFieldChoiceSet +func (a *ExtrasAPIService) ExtrasCustomFieldChoiceSetsUpdateExecute(r ApiExtrasCustomFieldChoiceSetsUpdateRequest) (*CustomFieldChoiceSet, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomFieldChoiceSet + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldChoiceSetsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-field-choice-sets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCustomFieldChoiceSetRequest == nil { + return localVarReturnValue, nil, reportError("writableCustomFieldChoiceSetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCustomFieldChoiceSetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customFieldRequest *[]CustomFieldRequest +} + +func (r ApiExtrasCustomFieldsBulkDestroyRequest) CustomFieldRequest(customFieldRequest []CustomFieldRequest) ApiExtrasCustomFieldsBulkDestroyRequest { + r.customFieldRequest = &customFieldRequest + return r +} + +func (r ApiExtrasCustomFieldsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasCustomFieldsBulkDestroyExecute(r) +} + +/* +ExtrasCustomFieldsBulkDestroy Method for ExtrasCustomFieldsBulkDestroy + +Delete a list of custom field objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldsBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsBulkDestroy(ctx context.Context) ApiExtrasCustomFieldsBulkDestroyRequest { + return ApiExtrasCustomFieldsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasCustomFieldsBulkDestroyExecute(r ApiExtrasCustomFieldsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customFieldRequest == nil { + return nil, reportError("customFieldRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customFieldRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customFieldRequest *[]CustomFieldRequest +} + +func (r ApiExtrasCustomFieldsBulkPartialUpdateRequest) CustomFieldRequest(customFieldRequest []CustomFieldRequest) ApiExtrasCustomFieldsBulkPartialUpdateRequest { + r.customFieldRequest = &customFieldRequest + return r +} + +func (r ApiExtrasCustomFieldsBulkPartialUpdateRequest) Execute() ([]CustomField, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldsBulkPartialUpdateExecute(r) +} + +/* +ExtrasCustomFieldsBulkPartialUpdate Method for ExtrasCustomFieldsBulkPartialUpdate + +Patch a list of custom field objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldsBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsBulkPartialUpdate(ctx context.Context) ApiExtrasCustomFieldsBulkPartialUpdateRequest { + return ApiExtrasCustomFieldsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CustomField +func (a *ExtrasAPIService) ExtrasCustomFieldsBulkPartialUpdateExecute(r ApiExtrasCustomFieldsBulkPartialUpdateRequest) ([]CustomField, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CustomField + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customFieldRequest == nil { + return localVarReturnValue, nil, reportError("customFieldRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customFieldRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customFieldRequest *[]CustomFieldRequest +} + +func (r ApiExtrasCustomFieldsBulkUpdateRequest) CustomFieldRequest(customFieldRequest []CustomFieldRequest) ApiExtrasCustomFieldsBulkUpdateRequest { + r.customFieldRequest = &customFieldRequest + return r +} + +func (r ApiExtrasCustomFieldsBulkUpdateRequest) Execute() ([]CustomField, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldsBulkUpdateExecute(r) +} + +/* +ExtrasCustomFieldsBulkUpdate Method for ExtrasCustomFieldsBulkUpdate + +Put a list of custom field objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldsBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsBulkUpdate(ctx context.Context) ApiExtrasCustomFieldsBulkUpdateRequest { + return ApiExtrasCustomFieldsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CustomField +func (a *ExtrasAPIService) ExtrasCustomFieldsBulkUpdateExecute(r ApiExtrasCustomFieldsBulkUpdateRequest) ([]CustomField, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CustomField + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customFieldRequest == nil { + return localVarReturnValue, nil, reportError("customFieldRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customFieldRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableCustomFieldRequest *WritableCustomFieldRequest +} + +func (r ApiExtrasCustomFieldsCreateRequest) WritableCustomFieldRequest(writableCustomFieldRequest WritableCustomFieldRequest) ApiExtrasCustomFieldsCreateRequest { + r.writableCustomFieldRequest = &writableCustomFieldRequest + return r +} + +func (r ApiExtrasCustomFieldsCreateRequest) Execute() (*CustomField, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldsCreateExecute(r) +} + +/* +ExtrasCustomFieldsCreate Method for ExtrasCustomFieldsCreate + +Post a list of custom field objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldsCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsCreate(ctx context.Context) ApiExtrasCustomFieldsCreateRequest { + return ApiExtrasCustomFieldsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CustomField +func (a *ExtrasAPIService) ExtrasCustomFieldsCreateExecute(r ApiExtrasCustomFieldsCreateRequest) (*CustomField, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomField + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCustomFieldRequest == nil { + return localVarReturnValue, nil, reportError("writableCustomFieldRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCustomFieldRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasCustomFieldsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasCustomFieldsDestroyExecute(r) +} + +/* +ExtrasCustomFieldsDestroy Method for ExtrasCustomFieldsDestroy + +Delete a custom field object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field. + @return ApiExtrasCustomFieldsDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsDestroy(ctx context.Context, id int32) ApiExtrasCustomFieldsDestroyRequest { + return ApiExtrasCustomFieldsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasCustomFieldsDestroyExecute(r ApiExtrasCustomFieldsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + choiceSet *[]string + choiceSetN *[]string + choiceSetId *[]*int32 + choiceSetIdN *[]*int32 + contentTypeId *[]int32 + contentTypeIdEmpty *[]int32 + contentTypeIdGt *[]int32 + contentTypeIdGte *[]int32 + contentTypeIdLt *[]int32 + contentTypeIdLte *[]int32 + contentTypeIdN *[]int32 + contentTypes *string + contentTypesIc *string + contentTypesIe *string + contentTypesIew *string + contentTypesIsw *string + contentTypesN *string + contentTypesNic *string + contentTypesNie *string + contentTypesNiew *string + contentTypesNisw *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + filterLogic *string + filterLogicN *string + groupName *[]string + groupNameEmpty *bool + groupNameIc *[]string + groupNameIe *[]string + groupNameIew *[]string + groupNameIsw *[]string + groupNameN *[]string + groupNameNic *[]string + groupNameNie *[]string + groupNameNiew *[]string + groupNameNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + isCloneable *bool + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + required *bool + searchWeight *[]int32 + searchWeightEmpty *bool + searchWeightGt *[]int32 + searchWeightGte *[]int32 + searchWeightLt *[]int32 + searchWeightLte *[]int32 + searchWeightN *[]int32 + type_ *[]string + typeN *[]string + uiEditable *string + uiEditableN *string + uiVisible *string + uiVisibleN *string + weight *[]int32 + weightEmpty *bool + weightGt *[]int32 + weightGte *[]int32 + weightLt *[]int32 + weightLte *[]int32 + weightN *[]int32 +} + +func (r ApiExtrasCustomFieldsListRequest) ChoiceSet(choiceSet []string) ApiExtrasCustomFieldsListRequest { + r.choiceSet = &choiceSet + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ChoiceSetN(choiceSetN []string) ApiExtrasCustomFieldsListRequest { + r.choiceSetN = &choiceSetN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ChoiceSetId(choiceSetId []*int32) ApiExtrasCustomFieldsListRequest { + r.choiceSetId = &choiceSetId + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ChoiceSetIdN(choiceSetIdN []*int32) ApiExtrasCustomFieldsListRequest { + r.choiceSetIdN = &choiceSetIdN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypeId(contentTypeId []int32) ApiExtrasCustomFieldsListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypeIdEmpty(contentTypeIdEmpty []int32) ApiExtrasCustomFieldsListRequest { + r.contentTypeIdEmpty = &contentTypeIdEmpty + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypeIdGt(contentTypeIdGt []int32) ApiExtrasCustomFieldsListRequest { + r.contentTypeIdGt = &contentTypeIdGt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypeIdGte(contentTypeIdGte []int32) ApiExtrasCustomFieldsListRequest { + r.contentTypeIdGte = &contentTypeIdGte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypeIdLt(contentTypeIdLt []int32) ApiExtrasCustomFieldsListRequest { + r.contentTypeIdLt = &contentTypeIdLt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypeIdLte(contentTypeIdLte []int32) ApiExtrasCustomFieldsListRequest { + r.contentTypeIdLte = &contentTypeIdLte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypeIdN(contentTypeIdN []int32) ApiExtrasCustomFieldsListRequest { + r.contentTypeIdN = &contentTypeIdN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypes(contentTypes string) ApiExtrasCustomFieldsListRequest { + r.contentTypes = &contentTypes + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesIc(contentTypesIc string) ApiExtrasCustomFieldsListRequest { + r.contentTypesIc = &contentTypesIc + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesIe(contentTypesIe string) ApiExtrasCustomFieldsListRequest { + r.contentTypesIe = &contentTypesIe + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesIew(contentTypesIew string) ApiExtrasCustomFieldsListRequest { + r.contentTypesIew = &contentTypesIew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesIsw(contentTypesIsw string) ApiExtrasCustomFieldsListRequest { + r.contentTypesIsw = &contentTypesIsw + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesN(contentTypesN string) ApiExtrasCustomFieldsListRequest { + r.contentTypesN = &contentTypesN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesNic(contentTypesNic string) ApiExtrasCustomFieldsListRequest { + r.contentTypesNic = &contentTypesNic + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesNie(contentTypesNie string) ApiExtrasCustomFieldsListRequest { + r.contentTypesNie = &contentTypesNie + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesNiew(contentTypesNiew string) ApiExtrasCustomFieldsListRequest { + r.contentTypesNiew = &contentTypesNiew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) ContentTypesNisw(contentTypesNisw string) ApiExtrasCustomFieldsListRequest { + r.contentTypesNisw = &contentTypesNisw + return r +} + +func (r ApiExtrasCustomFieldsListRequest) Description(description []string) ApiExtrasCustomFieldsListRequest { + r.description = &description + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasCustomFieldsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionIc(descriptionIc []string) ApiExtrasCustomFieldsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionIe(descriptionIe []string) ApiExtrasCustomFieldsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionIew(descriptionIew []string) ApiExtrasCustomFieldsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasCustomFieldsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionN(descriptionN []string) ApiExtrasCustomFieldsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionNic(descriptionNic []string) ApiExtrasCustomFieldsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionNie(descriptionNie []string) ApiExtrasCustomFieldsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasCustomFieldsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasCustomFieldsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Loose matches any instance of a given string; exact matches the entire field. +func (r ApiExtrasCustomFieldsListRequest) FilterLogic(filterLogic string) ApiExtrasCustomFieldsListRequest { + r.filterLogic = &filterLogic + return r +} + +// Loose matches any instance of a given string; exact matches the entire field. +func (r ApiExtrasCustomFieldsListRequest) FilterLogicN(filterLogicN string) ApiExtrasCustomFieldsListRequest { + r.filterLogicN = &filterLogicN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupName(groupName []string) ApiExtrasCustomFieldsListRequest { + r.groupName = &groupName + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameEmpty(groupNameEmpty bool) ApiExtrasCustomFieldsListRequest { + r.groupNameEmpty = &groupNameEmpty + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameIc(groupNameIc []string) ApiExtrasCustomFieldsListRequest { + r.groupNameIc = &groupNameIc + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameIe(groupNameIe []string) ApiExtrasCustomFieldsListRequest { + r.groupNameIe = &groupNameIe + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameIew(groupNameIew []string) ApiExtrasCustomFieldsListRequest { + r.groupNameIew = &groupNameIew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameIsw(groupNameIsw []string) ApiExtrasCustomFieldsListRequest { + r.groupNameIsw = &groupNameIsw + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameN(groupNameN []string) ApiExtrasCustomFieldsListRequest { + r.groupNameN = &groupNameN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameNic(groupNameNic []string) ApiExtrasCustomFieldsListRequest { + r.groupNameNic = &groupNameNic + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameNie(groupNameNie []string) ApiExtrasCustomFieldsListRequest { + r.groupNameNie = &groupNameNie + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameNiew(groupNameNiew []string) ApiExtrasCustomFieldsListRequest { + r.groupNameNiew = &groupNameNiew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) GroupNameNisw(groupNameNisw []string) ApiExtrasCustomFieldsListRequest { + r.groupNameNisw = &groupNameNisw + return r +} + +func (r ApiExtrasCustomFieldsListRequest) Id(id []int32) ApiExtrasCustomFieldsListRequest { + r.id = &id + return r +} + +func (r ApiExtrasCustomFieldsListRequest) IdEmpty(idEmpty bool) ApiExtrasCustomFieldsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasCustomFieldsListRequest) IdGt(idGt []int32) ApiExtrasCustomFieldsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) IdGte(idGte []int32) ApiExtrasCustomFieldsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) IdLt(idLt []int32) ApiExtrasCustomFieldsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) IdLte(idLte []int32) ApiExtrasCustomFieldsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) IdN(idN []int32) ApiExtrasCustomFieldsListRequest { + r.idN = &idN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) IsCloneable(isCloneable bool) ApiExtrasCustomFieldsListRequest { + r.isCloneable = &isCloneable + return r +} + +// Number of results to return per page. +func (r ApiExtrasCustomFieldsListRequest) Limit(limit int32) ApiExtrasCustomFieldsListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasCustomFieldsListRequest) Name(name []string) ApiExtrasCustomFieldsListRequest { + r.name = &name + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameEmpty(nameEmpty bool) ApiExtrasCustomFieldsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameIc(nameIc []string) ApiExtrasCustomFieldsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameIe(nameIe []string) ApiExtrasCustomFieldsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameIew(nameIew []string) ApiExtrasCustomFieldsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameIsw(nameIsw []string) ApiExtrasCustomFieldsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameN(nameN []string) ApiExtrasCustomFieldsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameNic(nameNic []string) ApiExtrasCustomFieldsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameNie(nameNie []string) ApiExtrasCustomFieldsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameNiew(nameNiew []string) ApiExtrasCustomFieldsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasCustomFieldsListRequest) NameNisw(nameNisw []string) ApiExtrasCustomFieldsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasCustomFieldsListRequest) Offset(offset int32) ApiExtrasCustomFieldsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasCustomFieldsListRequest) Ordering(ordering string) ApiExtrasCustomFieldsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasCustomFieldsListRequest) Q(q string) ApiExtrasCustomFieldsListRequest { + r.q = &q + return r +} + +func (r ApiExtrasCustomFieldsListRequest) Required(required bool) ApiExtrasCustomFieldsListRequest { + r.required = &required + return r +} + +func (r ApiExtrasCustomFieldsListRequest) SearchWeight(searchWeight []int32) ApiExtrasCustomFieldsListRequest { + r.searchWeight = &searchWeight + return r +} + +func (r ApiExtrasCustomFieldsListRequest) SearchWeightEmpty(searchWeightEmpty bool) ApiExtrasCustomFieldsListRequest { + r.searchWeightEmpty = &searchWeightEmpty + return r +} + +func (r ApiExtrasCustomFieldsListRequest) SearchWeightGt(searchWeightGt []int32) ApiExtrasCustomFieldsListRequest { + r.searchWeightGt = &searchWeightGt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) SearchWeightGte(searchWeightGte []int32) ApiExtrasCustomFieldsListRequest { + r.searchWeightGte = &searchWeightGte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) SearchWeightLt(searchWeightLt []int32) ApiExtrasCustomFieldsListRequest { + r.searchWeightLt = &searchWeightLt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) SearchWeightLte(searchWeightLte []int32) ApiExtrasCustomFieldsListRequest { + r.searchWeightLte = &searchWeightLte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) SearchWeightN(searchWeightN []int32) ApiExtrasCustomFieldsListRequest { + r.searchWeightN = &searchWeightN + return r +} + +// The type of data this custom field holds +func (r ApiExtrasCustomFieldsListRequest) Type_(type_ []string) ApiExtrasCustomFieldsListRequest { + r.type_ = &type_ + return r +} + +// The type of data this custom field holds +func (r ApiExtrasCustomFieldsListRequest) TypeN(typeN []string) ApiExtrasCustomFieldsListRequest { + r.typeN = &typeN + return r +} + +// Specifies whether the custom field value can be edited in the UI +func (r ApiExtrasCustomFieldsListRequest) UiEditable(uiEditable string) ApiExtrasCustomFieldsListRequest { + r.uiEditable = &uiEditable + return r +} + +// Specifies whether the custom field value can be edited in the UI +func (r ApiExtrasCustomFieldsListRequest) UiEditableN(uiEditableN string) ApiExtrasCustomFieldsListRequest { + r.uiEditableN = &uiEditableN + return r +} + +// Specifies whether the custom field is displayed in the UI +func (r ApiExtrasCustomFieldsListRequest) UiVisible(uiVisible string) ApiExtrasCustomFieldsListRequest { + r.uiVisible = &uiVisible + return r +} + +// Specifies whether the custom field is displayed in the UI +func (r ApiExtrasCustomFieldsListRequest) UiVisibleN(uiVisibleN string) ApiExtrasCustomFieldsListRequest { + r.uiVisibleN = &uiVisibleN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) Weight(weight []int32) ApiExtrasCustomFieldsListRequest { + r.weight = &weight + return r +} + +func (r ApiExtrasCustomFieldsListRequest) WeightEmpty(weightEmpty bool) ApiExtrasCustomFieldsListRequest { + r.weightEmpty = &weightEmpty + return r +} + +func (r ApiExtrasCustomFieldsListRequest) WeightGt(weightGt []int32) ApiExtrasCustomFieldsListRequest { + r.weightGt = &weightGt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) WeightGte(weightGte []int32) ApiExtrasCustomFieldsListRequest { + r.weightGte = &weightGte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) WeightLt(weightLt []int32) ApiExtrasCustomFieldsListRequest { + r.weightLt = &weightLt + return r +} + +func (r ApiExtrasCustomFieldsListRequest) WeightLte(weightLte []int32) ApiExtrasCustomFieldsListRequest { + r.weightLte = &weightLte + return r +} + +func (r ApiExtrasCustomFieldsListRequest) WeightN(weightN []int32) ApiExtrasCustomFieldsListRequest { + r.weightN = &weightN + return r +} + +func (r ApiExtrasCustomFieldsListRequest) Execute() (*PaginatedCustomFieldList, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldsListExecute(r) +} + +/* +ExtrasCustomFieldsList Method for ExtrasCustomFieldsList + +Get a list of custom field objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomFieldsListRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsList(ctx context.Context) ApiExtrasCustomFieldsListRequest { + return ApiExtrasCustomFieldsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCustomFieldList +func (a *ExtrasAPIService) ExtrasCustomFieldsListExecute(r ApiExtrasCustomFieldsListRequest) (*PaginatedCustomFieldList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCustomFieldList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.choiceSet != nil { + t := *r.choiceSet + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set", t, "multi") + } + } + if r.choiceSetN != nil { + t := *r.choiceSetN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set__n", t, "multi") + } + } + if r.choiceSetId != nil { + t := *r.choiceSetId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set_id", t, "multi") + } + } + if r.choiceSetIdN != nil { + t := *r.choiceSetIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "choice_set_id__n", t, "multi") + } + } + if r.contentTypeId != nil { + t := *r.contentTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", t, "multi") + } + } + if r.contentTypeIdEmpty != nil { + t := *r.contentTypeIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", t, "multi") + } + } + if r.contentTypeIdGt != nil { + t := *r.contentTypeIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", t, "multi") + } + } + if r.contentTypeIdGte != nil { + t := *r.contentTypeIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", t, "multi") + } + } + if r.contentTypeIdLt != nil { + t := *r.contentTypeIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", t, "multi") + } + } + if r.contentTypeIdLte != nil { + t := *r.contentTypeIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", t, "multi") + } + } + if r.contentTypeIdN != nil { + t := *r.contentTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", t, "multi") + } + } + if r.contentTypes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types", r.contentTypes, "") + } + if r.contentTypesIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ic", r.contentTypesIc, "") + } + if r.contentTypesIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ie", r.contentTypesIe, "") + } + if r.contentTypesIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__iew", r.contentTypesIew, "") + } + if r.contentTypesIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__isw", r.contentTypesIsw, "") + } + if r.contentTypesN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__n", r.contentTypesN, "") + } + if r.contentTypesNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nic", r.contentTypesNic, "") + } + if r.contentTypesNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nie", r.contentTypesNie, "") + } + if r.contentTypesNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__niew", r.contentTypesNiew, "") + } + if r.contentTypesNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nisw", r.contentTypesNisw, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.filterLogic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter_logic", r.filterLogic, "") + } + if r.filterLogicN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter_logic__n", r.filterLogicN, "") + } + if r.groupName != nil { + t := *r.groupName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name", t, "multi") + } + } + if r.groupNameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__empty", r.groupNameEmpty, "") + } + if r.groupNameIc != nil { + t := *r.groupNameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ic", t, "multi") + } + } + if r.groupNameIe != nil { + t := *r.groupNameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ie", t, "multi") + } + } + if r.groupNameIew != nil { + t := *r.groupNameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__iew", t, "multi") + } + } + if r.groupNameIsw != nil { + t := *r.groupNameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__isw", t, "multi") + } + } + if r.groupNameN != nil { + t := *r.groupNameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__n", t, "multi") + } + } + if r.groupNameNic != nil { + t := *r.groupNameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nic", t, "multi") + } + } + if r.groupNameNie != nil { + t := *r.groupNameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nie", t, "multi") + } + } + if r.groupNameNiew != nil { + t := *r.groupNameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__niew", t, "multi") + } + } + if r.groupNameNisw != nil { + t := *r.groupNameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.isCloneable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_cloneable", r.isCloneable, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.required != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "required", r.required, "") + } + if r.searchWeight != nil { + t := *r.searchWeight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight", t, "multi") + } + } + if r.searchWeightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__empty", r.searchWeightEmpty, "") + } + if r.searchWeightGt != nil { + t := *r.searchWeightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__gt", t, "multi") + } + } + if r.searchWeightGte != nil { + t := *r.searchWeightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__gte", t, "multi") + } + } + if r.searchWeightLt != nil { + t := *r.searchWeightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__lt", t, "multi") + } + } + if r.searchWeightLte != nil { + t := *r.searchWeightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__lte", t, "multi") + } + } + if r.searchWeightN != nil { + t := *r.searchWeightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "search_weight__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.uiEditable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ui_editable", r.uiEditable, "") + } + if r.uiEditableN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ui_editable__n", r.uiEditableN, "") + } + if r.uiVisible != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ui_visible", r.uiVisible, "") + } + if r.uiVisibleN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ui_visible__n", r.uiVisibleN, "") + } + if r.weight != nil { + t := *r.weight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", t, "multi") + } + } + if r.weightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__empty", r.weightEmpty, "") + } + if r.weightGt != nil { + t := *r.weightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", t, "multi") + } + } + if r.weightGte != nil { + t := *r.weightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", t, "multi") + } + } + if r.weightLt != nil { + t := *r.weightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", t, "multi") + } + } + if r.weightLte != nil { + t := *r.weightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", t, "multi") + } + } + if r.weightN != nil { + t := *r.weightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableCustomFieldRequest *PatchedWritableCustomFieldRequest +} + +func (r ApiExtrasCustomFieldsPartialUpdateRequest) PatchedWritableCustomFieldRequest(patchedWritableCustomFieldRequest PatchedWritableCustomFieldRequest) ApiExtrasCustomFieldsPartialUpdateRequest { + r.patchedWritableCustomFieldRequest = &patchedWritableCustomFieldRequest + return r +} + +func (r ApiExtrasCustomFieldsPartialUpdateRequest) Execute() (*CustomField, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldsPartialUpdateExecute(r) +} + +/* +ExtrasCustomFieldsPartialUpdate Method for ExtrasCustomFieldsPartialUpdate + +Patch a custom field object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field. + @return ApiExtrasCustomFieldsPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsPartialUpdate(ctx context.Context, id int32) ApiExtrasCustomFieldsPartialUpdateRequest { + return ApiExtrasCustomFieldsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomField +func (a *ExtrasAPIService) ExtrasCustomFieldsPartialUpdateExecute(r ApiExtrasCustomFieldsPartialUpdateRequest) (*CustomField, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomField + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableCustomFieldRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasCustomFieldsRetrieveRequest) Execute() (*CustomField, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldsRetrieveExecute(r) +} + +/* +ExtrasCustomFieldsRetrieve Method for ExtrasCustomFieldsRetrieve + +Get a custom field object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field. + @return ApiExtrasCustomFieldsRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsRetrieve(ctx context.Context, id int32) ApiExtrasCustomFieldsRetrieveRequest { + return ApiExtrasCustomFieldsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomField +func (a *ExtrasAPIService) ExtrasCustomFieldsRetrieveExecute(r ApiExtrasCustomFieldsRetrieveRequest) (*CustomField, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomField + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomFieldsUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableCustomFieldRequest *WritableCustomFieldRequest +} + +func (r ApiExtrasCustomFieldsUpdateRequest) WritableCustomFieldRequest(writableCustomFieldRequest WritableCustomFieldRequest) ApiExtrasCustomFieldsUpdateRequest { + r.writableCustomFieldRequest = &writableCustomFieldRequest + return r +} + +func (r ApiExtrasCustomFieldsUpdateRequest) Execute() (*CustomField, *http.Response, error) { + return r.ApiService.ExtrasCustomFieldsUpdateExecute(r) +} + +/* +ExtrasCustomFieldsUpdate Method for ExtrasCustomFieldsUpdate + +Put a custom field object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom field. + @return ApiExtrasCustomFieldsUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomFieldsUpdate(ctx context.Context, id int32) ApiExtrasCustomFieldsUpdateRequest { + return ApiExtrasCustomFieldsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomField +func (a *ExtrasAPIService) ExtrasCustomFieldsUpdateExecute(r ApiExtrasCustomFieldsUpdateRequest) (*CustomField, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomField + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomFieldsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-fields/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableCustomFieldRequest == nil { + return localVarReturnValue, nil, reportError("writableCustomFieldRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableCustomFieldRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customLinkRequest *[]CustomLinkRequest +} + +func (r ApiExtrasCustomLinksBulkDestroyRequest) CustomLinkRequest(customLinkRequest []CustomLinkRequest) ApiExtrasCustomLinksBulkDestroyRequest { + r.customLinkRequest = &customLinkRequest + return r +} + +func (r ApiExtrasCustomLinksBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasCustomLinksBulkDestroyExecute(r) +} + +/* +ExtrasCustomLinksBulkDestroy Method for ExtrasCustomLinksBulkDestroy + +Delete a list of custom link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomLinksBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksBulkDestroy(ctx context.Context) ApiExtrasCustomLinksBulkDestroyRequest { + return ApiExtrasCustomLinksBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasCustomLinksBulkDestroyExecute(r ApiExtrasCustomLinksBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customLinkRequest == nil { + return nil, reportError("customLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customLinkRequest *[]CustomLinkRequest +} + +func (r ApiExtrasCustomLinksBulkPartialUpdateRequest) CustomLinkRequest(customLinkRequest []CustomLinkRequest) ApiExtrasCustomLinksBulkPartialUpdateRequest { + r.customLinkRequest = &customLinkRequest + return r +} + +func (r ApiExtrasCustomLinksBulkPartialUpdateRequest) Execute() ([]CustomLink, *http.Response, error) { + return r.ApiService.ExtrasCustomLinksBulkPartialUpdateExecute(r) +} + +/* +ExtrasCustomLinksBulkPartialUpdate Method for ExtrasCustomLinksBulkPartialUpdate + +Patch a list of custom link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomLinksBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksBulkPartialUpdate(ctx context.Context) ApiExtrasCustomLinksBulkPartialUpdateRequest { + return ApiExtrasCustomLinksBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CustomLink +func (a *ExtrasAPIService) ExtrasCustomLinksBulkPartialUpdateExecute(r ApiExtrasCustomLinksBulkPartialUpdateRequest) ([]CustomLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CustomLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customLinkRequest == nil { + return localVarReturnValue, nil, reportError("customLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customLinkRequest *[]CustomLinkRequest +} + +func (r ApiExtrasCustomLinksBulkUpdateRequest) CustomLinkRequest(customLinkRequest []CustomLinkRequest) ApiExtrasCustomLinksBulkUpdateRequest { + r.customLinkRequest = &customLinkRequest + return r +} + +func (r ApiExtrasCustomLinksBulkUpdateRequest) Execute() ([]CustomLink, *http.Response, error) { + return r.ApiService.ExtrasCustomLinksBulkUpdateExecute(r) +} + +/* +ExtrasCustomLinksBulkUpdate Method for ExtrasCustomLinksBulkUpdate + +Put a list of custom link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomLinksBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksBulkUpdate(ctx context.Context) ApiExtrasCustomLinksBulkUpdateRequest { + return ApiExtrasCustomLinksBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []CustomLink +func (a *ExtrasAPIService) ExtrasCustomLinksBulkUpdateExecute(r ApiExtrasCustomLinksBulkUpdateRequest) ([]CustomLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CustomLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customLinkRequest == nil { + return localVarReturnValue, nil, reportError("customLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + customLinkRequest *CustomLinkRequest +} + +func (r ApiExtrasCustomLinksCreateRequest) CustomLinkRequest(customLinkRequest CustomLinkRequest) ApiExtrasCustomLinksCreateRequest { + r.customLinkRequest = &customLinkRequest + return r +} + +func (r ApiExtrasCustomLinksCreateRequest) Execute() (*CustomLink, *http.Response, error) { + return r.ApiService.ExtrasCustomLinksCreateExecute(r) +} + +/* +ExtrasCustomLinksCreate Method for ExtrasCustomLinksCreate + +Post a list of custom link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomLinksCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksCreate(ctx context.Context) ApiExtrasCustomLinksCreateRequest { + return ApiExtrasCustomLinksCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CustomLink +func (a *ExtrasAPIService) ExtrasCustomLinksCreateExecute(r ApiExtrasCustomLinksCreateRequest) (*CustomLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customLinkRequest == nil { + return localVarReturnValue, nil, reportError("customLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasCustomLinksDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasCustomLinksDestroyExecute(r) +} + +/* +ExtrasCustomLinksDestroy Method for ExtrasCustomLinksDestroy + +Delete a custom link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom link. + @return ApiExtrasCustomLinksDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksDestroy(ctx context.Context, id int32) ApiExtrasCustomLinksDestroyRequest { + return ApiExtrasCustomLinksDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasCustomLinksDestroyExecute(r ApiExtrasCustomLinksDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + contentTypeId *[]int32 + contentTypeIdEmpty *[]int32 + contentTypeIdGt *[]int32 + contentTypeIdGte *[]int32 + contentTypeIdLt *[]int32 + contentTypeIdLte *[]int32 + contentTypeIdN *[]int32 + contentTypes *string + contentTypesIc *string + contentTypesIe *string + contentTypesIew *string + contentTypesIsw *string + contentTypesN *string + contentTypesNic *string + contentTypesNie *string + contentTypesNiew *string + contentTypesNisw *string + enabled *bool + groupName *[]string + groupNameEmpty *bool + groupNameIc *[]string + groupNameIe *[]string + groupNameIew *[]string + groupNameIsw *[]string + groupNameN *[]string + groupNameNic *[]string + groupNameNie *[]string + groupNameNiew *[]string + groupNameNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + linkText *string + linkTextIc *string + linkTextIe *string + linkTextIew *string + linkTextIsw *string + linkTextN *string + linkTextNic *string + linkTextNie *string + linkTextNiew *string + linkTextNisw *string + linkUrl *string + linkUrlIc *string + linkUrlIe *string + linkUrlIew *string + linkUrlIsw *string + linkUrlN *string + linkUrlNic *string + linkUrlNie *string + linkUrlNiew *string + linkUrlNisw *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + newWindow *bool + offset *int32 + ordering *string + q *string + weight *[]int32 + weightEmpty *bool + weightGt *[]int32 + weightGte *[]int32 + weightLt *[]int32 + weightLte *[]int32 + weightN *[]int32 +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypeId(contentTypeId []int32) ApiExtrasCustomLinksListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypeIdEmpty(contentTypeIdEmpty []int32) ApiExtrasCustomLinksListRequest { + r.contentTypeIdEmpty = &contentTypeIdEmpty + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypeIdGt(contentTypeIdGt []int32) ApiExtrasCustomLinksListRequest { + r.contentTypeIdGt = &contentTypeIdGt + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypeIdGte(contentTypeIdGte []int32) ApiExtrasCustomLinksListRequest { + r.contentTypeIdGte = &contentTypeIdGte + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypeIdLt(contentTypeIdLt []int32) ApiExtrasCustomLinksListRequest { + r.contentTypeIdLt = &contentTypeIdLt + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypeIdLte(contentTypeIdLte []int32) ApiExtrasCustomLinksListRequest { + r.contentTypeIdLte = &contentTypeIdLte + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypeIdN(contentTypeIdN []int32) ApiExtrasCustomLinksListRequest { + r.contentTypeIdN = &contentTypeIdN + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypes(contentTypes string) ApiExtrasCustomLinksListRequest { + r.contentTypes = &contentTypes + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesIc(contentTypesIc string) ApiExtrasCustomLinksListRequest { + r.contentTypesIc = &contentTypesIc + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesIe(contentTypesIe string) ApiExtrasCustomLinksListRequest { + r.contentTypesIe = &contentTypesIe + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesIew(contentTypesIew string) ApiExtrasCustomLinksListRequest { + r.contentTypesIew = &contentTypesIew + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesIsw(contentTypesIsw string) ApiExtrasCustomLinksListRequest { + r.contentTypesIsw = &contentTypesIsw + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesN(contentTypesN string) ApiExtrasCustomLinksListRequest { + r.contentTypesN = &contentTypesN + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesNic(contentTypesNic string) ApiExtrasCustomLinksListRequest { + r.contentTypesNic = &contentTypesNic + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesNie(contentTypesNie string) ApiExtrasCustomLinksListRequest { + r.contentTypesNie = &contentTypesNie + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesNiew(contentTypesNiew string) ApiExtrasCustomLinksListRequest { + r.contentTypesNiew = &contentTypesNiew + return r +} + +func (r ApiExtrasCustomLinksListRequest) ContentTypesNisw(contentTypesNisw string) ApiExtrasCustomLinksListRequest { + r.contentTypesNisw = &contentTypesNisw + return r +} + +func (r ApiExtrasCustomLinksListRequest) Enabled(enabled bool) ApiExtrasCustomLinksListRequest { + r.enabled = &enabled + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupName(groupName []string) ApiExtrasCustomLinksListRequest { + r.groupName = &groupName + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameEmpty(groupNameEmpty bool) ApiExtrasCustomLinksListRequest { + r.groupNameEmpty = &groupNameEmpty + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameIc(groupNameIc []string) ApiExtrasCustomLinksListRequest { + r.groupNameIc = &groupNameIc + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameIe(groupNameIe []string) ApiExtrasCustomLinksListRequest { + r.groupNameIe = &groupNameIe + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameIew(groupNameIew []string) ApiExtrasCustomLinksListRequest { + r.groupNameIew = &groupNameIew + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameIsw(groupNameIsw []string) ApiExtrasCustomLinksListRequest { + r.groupNameIsw = &groupNameIsw + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameN(groupNameN []string) ApiExtrasCustomLinksListRequest { + r.groupNameN = &groupNameN + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameNic(groupNameNic []string) ApiExtrasCustomLinksListRequest { + r.groupNameNic = &groupNameNic + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameNie(groupNameNie []string) ApiExtrasCustomLinksListRequest { + r.groupNameNie = &groupNameNie + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameNiew(groupNameNiew []string) ApiExtrasCustomLinksListRequest { + r.groupNameNiew = &groupNameNiew + return r +} + +func (r ApiExtrasCustomLinksListRequest) GroupNameNisw(groupNameNisw []string) ApiExtrasCustomLinksListRequest { + r.groupNameNisw = &groupNameNisw + return r +} + +func (r ApiExtrasCustomLinksListRequest) Id(id []int32) ApiExtrasCustomLinksListRequest { + r.id = &id + return r +} + +func (r ApiExtrasCustomLinksListRequest) IdEmpty(idEmpty bool) ApiExtrasCustomLinksListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasCustomLinksListRequest) IdGt(idGt []int32) ApiExtrasCustomLinksListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasCustomLinksListRequest) IdGte(idGte []int32) ApiExtrasCustomLinksListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasCustomLinksListRequest) IdLt(idLt []int32) ApiExtrasCustomLinksListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasCustomLinksListRequest) IdLte(idLte []int32) ApiExtrasCustomLinksListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasCustomLinksListRequest) IdN(idN []int32) ApiExtrasCustomLinksListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasCustomLinksListRequest) Limit(limit int32) ApiExtrasCustomLinksListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkText(linkText string) ApiExtrasCustomLinksListRequest { + r.linkText = &linkText + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextIc(linkTextIc string) ApiExtrasCustomLinksListRequest { + r.linkTextIc = &linkTextIc + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextIe(linkTextIe string) ApiExtrasCustomLinksListRequest { + r.linkTextIe = &linkTextIe + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextIew(linkTextIew string) ApiExtrasCustomLinksListRequest { + r.linkTextIew = &linkTextIew + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextIsw(linkTextIsw string) ApiExtrasCustomLinksListRequest { + r.linkTextIsw = &linkTextIsw + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextN(linkTextN string) ApiExtrasCustomLinksListRequest { + r.linkTextN = &linkTextN + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextNic(linkTextNic string) ApiExtrasCustomLinksListRequest { + r.linkTextNic = &linkTextNic + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextNie(linkTextNie string) ApiExtrasCustomLinksListRequest { + r.linkTextNie = &linkTextNie + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextNiew(linkTextNiew string) ApiExtrasCustomLinksListRequest { + r.linkTextNiew = &linkTextNiew + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkTextNisw(linkTextNisw string) ApiExtrasCustomLinksListRequest { + r.linkTextNisw = &linkTextNisw + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrl(linkUrl string) ApiExtrasCustomLinksListRequest { + r.linkUrl = &linkUrl + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlIc(linkUrlIc string) ApiExtrasCustomLinksListRequest { + r.linkUrlIc = &linkUrlIc + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlIe(linkUrlIe string) ApiExtrasCustomLinksListRequest { + r.linkUrlIe = &linkUrlIe + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlIew(linkUrlIew string) ApiExtrasCustomLinksListRequest { + r.linkUrlIew = &linkUrlIew + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlIsw(linkUrlIsw string) ApiExtrasCustomLinksListRequest { + r.linkUrlIsw = &linkUrlIsw + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlN(linkUrlN string) ApiExtrasCustomLinksListRequest { + r.linkUrlN = &linkUrlN + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlNic(linkUrlNic string) ApiExtrasCustomLinksListRequest { + r.linkUrlNic = &linkUrlNic + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlNie(linkUrlNie string) ApiExtrasCustomLinksListRequest { + r.linkUrlNie = &linkUrlNie + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlNiew(linkUrlNiew string) ApiExtrasCustomLinksListRequest { + r.linkUrlNiew = &linkUrlNiew + return r +} + +func (r ApiExtrasCustomLinksListRequest) LinkUrlNisw(linkUrlNisw string) ApiExtrasCustomLinksListRequest { + r.linkUrlNisw = &linkUrlNisw + return r +} + +func (r ApiExtrasCustomLinksListRequest) Name(name []string) ApiExtrasCustomLinksListRequest { + r.name = &name + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameEmpty(nameEmpty bool) ApiExtrasCustomLinksListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameIc(nameIc []string) ApiExtrasCustomLinksListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameIe(nameIe []string) ApiExtrasCustomLinksListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameIew(nameIew []string) ApiExtrasCustomLinksListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameIsw(nameIsw []string) ApiExtrasCustomLinksListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameN(nameN []string) ApiExtrasCustomLinksListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameNic(nameNic []string) ApiExtrasCustomLinksListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameNie(nameNie []string) ApiExtrasCustomLinksListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameNiew(nameNiew []string) ApiExtrasCustomLinksListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasCustomLinksListRequest) NameNisw(nameNisw []string) ApiExtrasCustomLinksListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiExtrasCustomLinksListRequest) NewWindow(newWindow bool) ApiExtrasCustomLinksListRequest { + r.newWindow = &newWindow + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasCustomLinksListRequest) Offset(offset int32) ApiExtrasCustomLinksListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasCustomLinksListRequest) Ordering(ordering string) ApiExtrasCustomLinksListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasCustomLinksListRequest) Q(q string) ApiExtrasCustomLinksListRequest { + r.q = &q + return r +} + +func (r ApiExtrasCustomLinksListRequest) Weight(weight []int32) ApiExtrasCustomLinksListRequest { + r.weight = &weight + return r +} + +func (r ApiExtrasCustomLinksListRequest) WeightEmpty(weightEmpty bool) ApiExtrasCustomLinksListRequest { + r.weightEmpty = &weightEmpty + return r +} + +func (r ApiExtrasCustomLinksListRequest) WeightGt(weightGt []int32) ApiExtrasCustomLinksListRequest { + r.weightGt = &weightGt + return r +} + +func (r ApiExtrasCustomLinksListRequest) WeightGte(weightGte []int32) ApiExtrasCustomLinksListRequest { + r.weightGte = &weightGte + return r +} + +func (r ApiExtrasCustomLinksListRequest) WeightLt(weightLt []int32) ApiExtrasCustomLinksListRequest { + r.weightLt = &weightLt + return r +} + +func (r ApiExtrasCustomLinksListRequest) WeightLte(weightLte []int32) ApiExtrasCustomLinksListRequest { + r.weightLte = &weightLte + return r +} + +func (r ApiExtrasCustomLinksListRequest) WeightN(weightN []int32) ApiExtrasCustomLinksListRequest { + r.weightN = &weightN + return r +} + +func (r ApiExtrasCustomLinksListRequest) Execute() (*PaginatedCustomLinkList, *http.Response, error) { + return r.ApiService.ExtrasCustomLinksListExecute(r) +} + +/* +ExtrasCustomLinksList Method for ExtrasCustomLinksList + +Get a list of custom link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasCustomLinksListRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksList(ctx context.Context) ApiExtrasCustomLinksListRequest { + return ApiExtrasCustomLinksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCustomLinkList +func (a *ExtrasAPIService) ExtrasCustomLinksListExecute(r ApiExtrasCustomLinksListRequest) (*PaginatedCustomLinkList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCustomLinkList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contentTypeId != nil { + t := *r.contentTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", t, "multi") + } + } + if r.contentTypeIdEmpty != nil { + t := *r.contentTypeIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", t, "multi") + } + } + if r.contentTypeIdGt != nil { + t := *r.contentTypeIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", t, "multi") + } + } + if r.contentTypeIdGte != nil { + t := *r.contentTypeIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", t, "multi") + } + } + if r.contentTypeIdLt != nil { + t := *r.contentTypeIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", t, "multi") + } + } + if r.contentTypeIdLte != nil { + t := *r.contentTypeIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", t, "multi") + } + } + if r.contentTypeIdN != nil { + t := *r.contentTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", t, "multi") + } + } + if r.contentTypes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types", r.contentTypes, "") + } + if r.contentTypesIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ic", r.contentTypesIc, "") + } + if r.contentTypesIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ie", r.contentTypesIe, "") + } + if r.contentTypesIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__iew", r.contentTypesIew, "") + } + if r.contentTypesIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__isw", r.contentTypesIsw, "") + } + if r.contentTypesN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__n", r.contentTypesN, "") + } + if r.contentTypesNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nic", r.contentTypesNic, "") + } + if r.contentTypesNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nie", r.contentTypesNie, "") + } + if r.contentTypesNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__niew", r.contentTypesNiew, "") + } + if r.contentTypesNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nisw", r.contentTypesNisw, "") + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.groupName != nil { + t := *r.groupName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name", t, "multi") + } + } + if r.groupNameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__empty", r.groupNameEmpty, "") + } + if r.groupNameIc != nil { + t := *r.groupNameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ic", t, "multi") + } + } + if r.groupNameIe != nil { + t := *r.groupNameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__ie", t, "multi") + } + } + if r.groupNameIew != nil { + t := *r.groupNameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__iew", t, "multi") + } + } + if r.groupNameIsw != nil { + t := *r.groupNameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__isw", t, "multi") + } + } + if r.groupNameN != nil { + t := *r.groupNameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__n", t, "multi") + } + } + if r.groupNameNic != nil { + t := *r.groupNameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nic", t, "multi") + } + } + if r.groupNameNie != nil { + t := *r.groupNameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nie", t, "multi") + } + } + if r.groupNameNiew != nil { + t := *r.groupNameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__niew", t, "multi") + } + } + if r.groupNameNisw != nil { + t := *r.groupNameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_name__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.linkText != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text", r.linkText, "") + } + if r.linkTextIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__ic", r.linkTextIc, "") + } + if r.linkTextIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__ie", r.linkTextIe, "") + } + if r.linkTextIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__iew", r.linkTextIew, "") + } + if r.linkTextIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__isw", r.linkTextIsw, "") + } + if r.linkTextN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__n", r.linkTextN, "") + } + if r.linkTextNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__nic", r.linkTextNic, "") + } + if r.linkTextNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__nie", r.linkTextNie, "") + } + if r.linkTextNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__niew", r.linkTextNiew, "") + } + if r.linkTextNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_text__nisw", r.linkTextNisw, "") + } + if r.linkUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url", r.linkUrl, "") + } + if r.linkUrlIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__ic", r.linkUrlIc, "") + } + if r.linkUrlIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__ie", r.linkUrlIe, "") + } + if r.linkUrlIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__iew", r.linkUrlIew, "") + } + if r.linkUrlIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__isw", r.linkUrlIsw, "") + } + if r.linkUrlN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__n", r.linkUrlN, "") + } + if r.linkUrlNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__nic", r.linkUrlNic, "") + } + if r.linkUrlNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__nie", r.linkUrlNie, "") + } + if r.linkUrlNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__niew", r.linkUrlNiew, "") + } + if r.linkUrlNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link_url__nisw", r.linkUrlNisw, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.newWindow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "new_window", r.newWindow, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.weight != nil { + t := *r.weight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", t, "multi") + } + } + if r.weightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__empty", r.weightEmpty, "") + } + if r.weightGt != nil { + t := *r.weightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", t, "multi") + } + } + if r.weightGte != nil { + t := *r.weightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", t, "multi") + } + } + if r.weightLt != nil { + t := *r.weightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", t, "multi") + } + } + if r.weightLte != nil { + t := *r.weightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", t, "multi") + } + } + if r.weightN != nil { + t := *r.weightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedCustomLinkRequest *PatchedCustomLinkRequest +} + +func (r ApiExtrasCustomLinksPartialUpdateRequest) PatchedCustomLinkRequest(patchedCustomLinkRequest PatchedCustomLinkRequest) ApiExtrasCustomLinksPartialUpdateRequest { + r.patchedCustomLinkRequest = &patchedCustomLinkRequest + return r +} + +func (r ApiExtrasCustomLinksPartialUpdateRequest) Execute() (*CustomLink, *http.Response, error) { + return r.ApiService.ExtrasCustomLinksPartialUpdateExecute(r) +} + +/* +ExtrasCustomLinksPartialUpdate Method for ExtrasCustomLinksPartialUpdate + +Patch a custom link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom link. + @return ApiExtrasCustomLinksPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksPartialUpdate(ctx context.Context, id int32) ApiExtrasCustomLinksPartialUpdateRequest { + return ApiExtrasCustomLinksPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomLink +func (a *ExtrasAPIService) ExtrasCustomLinksPartialUpdateExecute(r ApiExtrasCustomLinksPartialUpdateRequest) (*CustomLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedCustomLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasCustomLinksRetrieveRequest) Execute() (*CustomLink, *http.Response, error) { + return r.ApiService.ExtrasCustomLinksRetrieveExecute(r) +} + +/* +ExtrasCustomLinksRetrieve Method for ExtrasCustomLinksRetrieve + +Get a custom link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom link. + @return ApiExtrasCustomLinksRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksRetrieve(ctx context.Context, id int32) ApiExtrasCustomLinksRetrieveRequest { + return ApiExtrasCustomLinksRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomLink +func (a *ExtrasAPIService) ExtrasCustomLinksRetrieveExecute(r ApiExtrasCustomLinksRetrieveRequest) (*CustomLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasCustomLinksUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + customLinkRequest *CustomLinkRequest +} + +func (r ApiExtrasCustomLinksUpdateRequest) CustomLinkRequest(customLinkRequest CustomLinkRequest) ApiExtrasCustomLinksUpdateRequest { + r.customLinkRequest = &customLinkRequest + return r +} + +func (r ApiExtrasCustomLinksUpdateRequest) Execute() (*CustomLink, *http.Response, error) { + return r.ApiService.ExtrasCustomLinksUpdateExecute(r) +} + +/* +ExtrasCustomLinksUpdate Method for ExtrasCustomLinksUpdate + +Put a custom link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this custom link. + @return ApiExtrasCustomLinksUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasCustomLinksUpdate(ctx context.Context, id int32) ApiExtrasCustomLinksUpdateRequest { + return ApiExtrasCustomLinksUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CustomLink +func (a *ExtrasAPIService) ExtrasCustomLinksUpdateExecute(r ApiExtrasCustomLinksUpdateRequest) (*CustomLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CustomLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasCustomLinksUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/custom-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.customLinkRequest == nil { + return localVarReturnValue, nil, reportError("customLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasDashboardDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService +} + +func (r ApiExtrasDashboardDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasDashboardDestroyExecute(r) +} + +/* +ExtrasDashboardDestroy Method for ExtrasDashboardDestroy + +Delete a list of dashboard objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasDashboardDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasDashboardDestroy(ctx context.Context) ApiExtrasDashboardDestroyRequest { + return ApiExtrasDashboardDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasDashboardDestroyExecute(r ApiExtrasDashboardDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasDashboardDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/dashboard/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasDashboardPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + patchedDashboardRequest *PatchedDashboardRequest +} + +func (r ApiExtrasDashboardPartialUpdateRequest) PatchedDashboardRequest(patchedDashboardRequest PatchedDashboardRequest) ApiExtrasDashboardPartialUpdateRequest { + r.patchedDashboardRequest = &patchedDashboardRequest + return r +} + +func (r ApiExtrasDashboardPartialUpdateRequest) Execute() (*Dashboard, *http.Response, error) { + return r.ApiService.ExtrasDashboardPartialUpdateExecute(r) +} + +/* +ExtrasDashboardPartialUpdate Method for ExtrasDashboardPartialUpdate + +Patch a list of dashboard objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasDashboardPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasDashboardPartialUpdate(ctx context.Context) ApiExtrasDashboardPartialUpdateRequest { + return ApiExtrasDashboardPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Dashboard +func (a *ExtrasAPIService) ExtrasDashboardPartialUpdateExecute(r ApiExtrasDashboardPartialUpdateRequest) (*Dashboard, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Dashboard + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasDashboardPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/dashboard/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDashboardRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasDashboardRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService +} + +func (r ApiExtrasDashboardRetrieveRequest) Execute() (*Dashboard, *http.Response, error) { + return r.ApiService.ExtrasDashboardRetrieveExecute(r) +} + +/* +ExtrasDashboardRetrieve Method for ExtrasDashboardRetrieve + +Get a list of dashboard objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasDashboardRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasDashboardRetrieve(ctx context.Context) ApiExtrasDashboardRetrieveRequest { + return ApiExtrasDashboardRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Dashboard +func (a *ExtrasAPIService) ExtrasDashboardRetrieveExecute(r ApiExtrasDashboardRetrieveRequest) (*Dashboard, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Dashboard + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasDashboardRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/dashboard/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasDashboardUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + dashboardRequest *DashboardRequest +} + +func (r ApiExtrasDashboardUpdateRequest) DashboardRequest(dashboardRequest DashboardRequest) ApiExtrasDashboardUpdateRequest { + r.dashboardRequest = &dashboardRequest + return r +} + +func (r ApiExtrasDashboardUpdateRequest) Execute() (*Dashboard, *http.Response, error) { + return r.ApiService.ExtrasDashboardUpdateExecute(r) +} + +/* +ExtrasDashboardUpdate Method for ExtrasDashboardUpdate + +Put a list of dashboard objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasDashboardUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasDashboardUpdate(ctx context.Context) ApiExtrasDashboardUpdateRequest { + return ApiExtrasDashboardUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Dashboard +func (a *ExtrasAPIService) ExtrasDashboardUpdateExecute(r ApiExtrasDashboardUpdateRequest) (*Dashboard, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Dashboard + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasDashboardUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/dashboard/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dashboardRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + eventRuleRequest *[]EventRuleRequest +} + +func (r ApiExtrasEventRulesBulkDestroyRequest) EventRuleRequest(eventRuleRequest []EventRuleRequest) ApiExtrasEventRulesBulkDestroyRequest { + r.eventRuleRequest = &eventRuleRequest + return r +} + +func (r ApiExtrasEventRulesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasEventRulesBulkDestroyExecute(r) +} + +/* +ExtrasEventRulesBulkDestroy Method for ExtrasEventRulesBulkDestroy + +Delete a list of event rule objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasEventRulesBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesBulkDestroy(ctx context.Context) ApiExtrasEventRulesBulkDestroyRequest { + return ApiExtrasEventRulesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasEventRulesBulkDestroyExecute(r ApiExtrasEventRulesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.eventRuleRequest == nil { + return nil, reportError("eventRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.eventRuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + eventRuleRequest *[]EventRuleRequest +} + +func (r ApiExtrasEventRulesBulkPartialUpdateRequest) EventRuleRequest(eventRuleRequest []EventRuleRequest) ApiExtrasEventRulesBulkPartialUpdateRequest { + r.eventRuleRequest = &eventRuleRequest + return r +} + +func (r ApiExtrasEventRulesBulkPartialUpdateRequest) Execute() ([]EventRule, *http.Response, error) { + return r.ApiService.ExtrasEventRulesBulkPartialUpdateExecute(r) +} + +/* +ExtrasEventRulesBulkPartialUpdate Method for ExtrasEventRulesBulkPartialUpdate + +Patch a list of event rule objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasEventRulesBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesBulkPartialUpdate(ctx context.Context) ApiExtrasEventRulesBulkPartialUpdateRequest { + return ApiExtrasEventRulesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []EventRule +func (a *ExtrasAPIService) ExtrasEventRulesBulkPartialUpdateExecute(r ApiExtrasEventRulesBulkPartialUpdateRequest) ([]EventRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []EventRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.eventRuleRequest == nil { + return localVarReturnValue, nil, reportError("eventRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.eventRuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + eventRuleRequest *[]EventRuleRequest +} + +func (r ApiExtrasEventRulesBulkUpdateRequest) EventRuleRequest(eventRuleRequest []EventRuleRequest) ApiExtrasEventRulesBulkUpdateRequest { + r.eventRuleRequest = &eventRuleRequest + return r +} + +func (r ApiExtrasEventRulesBulkUpdateRequest) Execute() ([]EventRule, *http.Response, error) { + return r.ApiService.ExtrasEventRulesBulkUpdateExecute(r) +} + +/* +ExtrasEventRulesBulkUpdate Method for ExtrasEventRulesBulkUpdate + +Put a list of event rule objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasEventRulesBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesBulkUpdate(ctx context.Context) ApiExtrasEventRulesBulkUpdateRequest { + return ApiExtrasEventRulesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []EventRule +func (a *ExtrasAPIService) ExtrasEventRulesBulkUpdateExecute(r ApiExtrasEventRulesBulkUpdateRequest) ([]EventRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []EventRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.eventRuleRequest == nil { + return localVarReturnValue, nil, reportError("eventRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.eventRuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableEventRuleRequest *WritableEventRuleRequest +} + +func (r ApiExtrasEventRulesCreateRequest) WritableEventRuleRequest(writableEventRuleRequest WritableEventRuleRequest) ApiExtrasEventRulesCreateRequest { + r.writableEventRuleRequest = &writableEventRuleRequest + return r +} + +func (r ApiExtrasEventRulesCreateRequest) Execute() (*EventRule, *http.Response, error) { + return r.ApiService.ExtrasEventRulesCreateExecute(r) +} + +/* +ExtrasEventRulesCreate Method for ExtrasEventRulesCreate + +Post a list of event rule objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasEventRulesCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesCreate(ctx context.Context) ApiExtrasEventRulesCreateRequest { + return ApiExtrasEventRulesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return EventRule +func (a *ExtrasAPIService) ExtrasEventRulesCreateExecute(r ApiExtrasEventRulesCreateRequest) (*EventRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableEventRuleRequest == nil { + return localVarReturnValue, nil, reportError("writableEventRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableEventRuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasEventRulesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasEventRulesDestroyExecute(r) +} + +/* +ExtrasEventRulesDestroy Method for ExtrasEventRulesDestroy + +Delete a event rule object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this event rule. + @return ApiExtrasEventRulesDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesDestroy(ctx context.Context, id int32) ApiExtrasEventRulesDestroyRequest { + return ApiExtrasEventRulesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasEventRulesDestroyExecute(r ApiExtrasEventRulesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + actionObjectId *[]int32 + actionObjectIdEmpty *[]int32 + actionObjectIdGt *[]int32 + actionObjectIdGte *[]int32 + actionObjectIdLt *[]int32 + actionObjectIdLte *[]int32 + actionObjectIdN *[]int32 + actionObjectType *string + actionObjectTypeN *string + actionType *[]string + actionTypeN *[]string + contentTypeId *[]int32 + contentTypeIdEmpty *[]int32 + contentTypeIdGt *[]int32 + contentTypeIdGte *[]int32 + contentTypeIdLt *[]int32 + contentTypeIdLte *[]int32 + contentTypeIdN *[]int32 + contentTypes *string + contentTypesIc *string + contentTypesIe *string + contentTypesIew *string + contentTypesIsw *string + contentTypesN *string + contentTypesNic *string + contentTypesNie *string + contentTypesNiew *string + contentTypesNisw *string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + enabled *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + tag *[]string + tagN *[]string + typeCreate *bool + typeDelete *bool + typeJobEnd *bool + typeJobStart *bool + typeUpdate *bool + updatedByRequest *string +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectId(actionObjectId []int32) ApiExtrasEventRulesListRequest { + r.actionObjectId = &actionObjectId + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectIdEmpty(actionObjectIdEmpty []int32) ApiExtrasEventRulesListRequest { + r.actionObjectIdEmpty = &actionObjectIdEmpty + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectIdGt(actionObjectIdGt []int32) ApiExtrasEventRulesListRequest { + r.actionObjectIdGt = &actionObjectIdGt + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectIdGte(actionObjectIdGte []int32) ApiExtrasEventRulesListRequest { + r.actionObjectIdGte = &actionObjectIdGte + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectIdLt(actionObjectIdLt []int32) ApiExtrasEventRulesListRequest { + r.actionObjectIdLt = &actionObjectIdLt + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectIdLte(actionObjectIdLte []int32) ApiExtrasEventRulesListRequest { + r.actionObjectIdLte = &actionObjectIdLte + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectIdN(actionObjectIdN []int32) ApiExtrasEventRulesListRequest { + r.actionObjectIdN = &actionObjectIdN + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectType(actionObjectType string) ApiExtrasEventRulesListRequest { + r.actionObjectType = &actionObjectType + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionObjectTypeN(actionObjectTypeN string) ApiExtrasEventRulesListRequest { + r.actionObjectTypeN = &actionObjectTypeN + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionType(actionType []string) ApiExtrasEventRulesListRequest { + r.actionType = &actionType + return r +} + +func (r ApiExtrasEventRulesListRequest) ActionTypeN(actionTypeN []string) ApiExtrasEventRulesListRequest { + r.actionTypeN = &actionTypeN + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypeId(contentTypeId []int32) ApiExtrasEventRulesListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypeIdEmpty(contentTypeIdEmpty []int32) ApiExtrasEventRulesListRequest { + r.contentTypeIdEmpty = &contentTypeIdEmpty + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypeIdGt(contentTypeIdGt []int32) ApiExtrasEventRulesListRequest { + r.contentTypeIdGt = &contentTypeIdGt + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypeIdGte(contentTypeIdGte []int32) ApiExtrasEventRulesListRequest { + r.contentTypeIdGte = &contentTypeIdGte + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypeIdLt(contentTypeIdLt []int32) ApiExtrasEventRulesListRequest { + r.contentTypeIdLt = &contentTypeIdLt + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypeIdLte(contentTypeIdLte []int32) ApiExtrasEventRulesListRequest { + r.contentTypeIdLte = &contentTypeIdLte + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypeIdN(contentTypeIdN []int32) ApiExtrasEventRulesListRequest { + r.contentTypeIdN = &contentTypeIdN + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypes(contentTypes string) ApiExtrasEventRulesListRequest { + r.contentTypes = &contentTypes + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesIc(contentTypesIc string) ApiExtrasEventRulesListRequest { + r.contentTypesIc = &contentTypesIc + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesIe(contentTypesIe string) ApiExtrasEventRulesListRequest { + r.contentTypesIe = &contentTypesIe + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesIew(contentTypesIew string) ApiExtrasEventRulesListRequest { + r.contentTypesIew = &contentTypesIew + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesIsw(contentTypesIsw string) ApiExtrasEventRulesListRequest { + r.contentTypesIsw = &contentTypesIsw + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesN(contentTypesN string) ApiExtrasEventRulesListRequest { + r.contentTypesN = &contentTypesN + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesNic(contentTypesNic string) ApiExtrasEventRulesListRequest { + r.contentTypesNic = &contentTypesNic + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesNie(contentTypesNie string) ApiExtrasEventRulesListRequest { + r.contentTypesNie = &contentTypesNie + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesNiew(contentTypesNiew string) ApiExtrasEventRulesListRequest { + r.contentTypesNiew = &contentTypesNiew + return r +} + +func (r ApiExtrasEventRulesListRequest) ContentTypesNisw(contentTypesNisw string) ApiExtrasEventRulesListRequest { + r.contentTypesNisw = &contentTypesNisw + return r +} + +func (r ApiExtrasEventRulesListRequest) Created(created []time.Time) ApiExtrasEventRulesListRequest { + r.created = &created + return r +} + +func (r ApiExtrasEventRulesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiExtrasEventRulesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiExtrasEventRulesListRequest) CreatedGt(createdGt []time.Time) ApiExtrasEventRulesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiExtrasEventRulesListRequest) CreatedGte(createdGte []time.Time) ApiExtrasEventRulesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiExtrasEventRulesListRequest) CreatedLt(createdLt []time.Time) ApiExtrasEventRulesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiExtrasEventRulesListRequest) CreatedLte(createdLte []time.Time) ApiExtrasEventRulesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiExtrasEventRulesListRequest) CreatedN(createdN []time.Time) ApiExtrasEventRulesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiExtrasEventRulesListRequest) CreatedByRequest(createdByRequest string) ApiExtrasEventRulesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiExtrasEventRulesListRequest) Description(description []string) ApiExtrasEventRulesListRequest { + r.description = &description + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasEventRulesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionIc(descriptionIc []string) ApiExtrasEventRulesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionIe(descriptionIe []string) ApiExtrasEventRulesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionIew(descriptionIew []string) ApiExtrasEventRulesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasEventRulesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionN(descriptionN []string) ApiExtrasEventRulesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionNic(descriptionNic []string) ApiExtrasEventRulesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionNie(descriptionNie []string) ApiExtrasEventRulesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasEventRulesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasEventRulesListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasEventRulesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiExtrasEventRulesListRequest) Enabled(enabled bool) ApiExtrasEventRulesListRequest { + r.enabled = &enabled + return r +} + +func (r ApiExtrasEventRulesListRequest) Id(id []int32) ApiExtrasEventRulesListRequest { + r.id = &id + return r +} + +func (r ApiExtrasEventRulesListRequest) IdEmpty(idEmpty bool) ApiExtrasEventRulesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasEventRulesListRequest) IdGt(idGt []int32) ApiExtrasEventRulesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasEventRulesListRequest) IdGte(idGte []int32) ApiExtrasEventRulesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasEventRulesListRequest) IdLt(idLt []int32) ApiExtrasEventRulesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasEventRulesListRequest) IdLte(idLte []int32) ApiExtrasEventRulesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasEventRulesListRequest) IdN(idN []int32) ApiExtrasEventRulesListRequest { + r.idN = &idN + return r +} + +func (r ApiExtrasEventRulesListRequest) LastUpdated(lastUpdated []time.Time) ApiExtrasEventRulesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiExtrasEventRulesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiExtrasEventRulesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiExtrasEventRulesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiExtrasEventRulesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiExtrasEventRulesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiExtrasEventRulesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiExtrasEventRulesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiExtrasEventRulesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiExtrasEventRulesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiExtrasEventRulesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiExtrasEventRulesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiExtrasEventRulesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiExtrasEventRulesListRequest) Limit(limit int32) ApiExtrasEventRulesListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasEventRulesListRequest) ModifiedByRequest(modifiedByRequest string) ApiExtrasEventRulesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiExtrasEventRulesListRequest) Name(name []string) ApiExtrasEventRulesListRequest { + r.name = &name + return r +} + +func (r ApiExtrasEventRulesListRequest) NameEmpty(nameEmpty bool) ApiExtrasEventRulesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasEventRulesListRequest) NameIc(nameIc []string) ApiExtrasEventRulesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasEventRulesListRequest) NameIe(nameIe []string) ApiExtrasEventRulesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasEventRulesListRequest) NameIew(nameIew []string) ApiExtrasEventRulesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasEventRulesListRequest) NameIsw(nameIsw []string) ApiExtrasEventRulesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasEventRulesListRequest) NameN(nameN []string) ApiExtrasEventRulesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasEventRulesListRequest) NameNic(nameNic []string) ApiExtrasEventRulesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasEventRulesListRequest) NameNie(nameNie []string) ApiExtrasEventRulesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasEventRulesListRequest) NameNiew(nameNiew []string) ApiExtrasEventRulesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasEventRulesListRequest) NameNisw(nameNisw []string) ApiExtrasEventRulesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasEventRulesListRequest) Offset(offset int32) ApiExtrasEventRulesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasEventRulesListRequest) Ordering(ordering string) ApiExtrasEventRulesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasEventRulesListRequest) Q(q string) ApiExtrasEventRulesListRequest { + r.q = &q + return r +} + +func (r ApiExtrasEventRulesListRequest) Tag(tag []string) ApiExtrasEventRulesListRequest { + r.tag = &tag + return r +} + +func (r ApiExtrasEventRulesListRequest) TagN(tagN []string) ApiExtrasEventRulesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiExtrasEventRulesListRequest) TypeCreate(typeCreate bool) ApiExtrasEventRulesListRequest { + r.typeCreate = &typeCreate + return r +} + +func (r ApiExtrasEventRulesListRequest) TypeDelete(typeDelete bool) ApiExtrasEventRulesListRequest { + r.typeDelete = &typeDelete + return r +} + +func (r ApiExtrasEventRulesListRequest) TypeJobEnd(typeJobEnd bool) ApiExtrasEventRulesListRequest { + r.typeJobEnd = &typeJobEnd + return r +} + +func (r ApiExtrasEventRulesListRequest) TypeJobStart(typeJobStart bool) ApiExtrasEventRulesListRequest { + r.typeJobStart = &typeJobStart + return r +} + +func (r ApiExtrasEventRulesListRequest) TypeUpdate(typeUpdate bool) ApiExtrasEventRulesListRequest { + r.typeUpdate = &typeUpdate + return r +} + +func (r ApiExtrasEventRulesListRequest) UpdatedByRequest(updatedByRequest string) ApiExtrasEventRulesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiExtrasEventRulesListRequest) Execute() (*PaginatedEventRuleList, *http.Response, error) { + return r.ApiService.ExtrasEventRulesListExecute(r) +} + +/* +ExtrasEventRulesList Method for ExtrasEventRulesList + +Get a list of event rule objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasEventRulesListRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesList(ctx context.Context) ApiExtrasEventRulesListRequest { + return ApiExtrasEventRulesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEventRuleList +func (a *ExtrasAPIService) ExtrasEventRulesListExecute(r ApiExtrasEventRulesListRequest) (*PaginatedEventRuleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEventRuleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.actionObjectId != nil { + t := *r.actionObjectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id", t, "multi") + } + } + if r.actionObjectIdEmpty != nil { + t := *r.actionObjectIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__empty", t, "multi") + } + } + if r.actionObjectIdGt != nil { + t := *r.actionObjectIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__gt", t, "multi") + } + } + if r.actionObjectIdGte != nil { + t := *r.actionObjectIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__gte", t, "multi") + } + } + if r.actionObjectIdLt != nil { + t := *r.actionObjectIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__lt", t, "multi") + } + } + if r.actionObjectIdLte != nil { + t := *r.actionObjectIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__lte", t, "multi") + } + } + if r.actionObjectIdN != nil { + t := *r.actionObjectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_id__n", t, "multi") + } + } + if r.actionObjectType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_type", r.actionObjectType, "") + } + if r.actionObjectTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_object_type__n", r.actionObjectTypeN, "") + } + if r.actionType != nil { + t := *r.actionType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_type", t, "multi") + } + } + if r.actionTypeN != nil { + t := *r.actionTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "action_type__n", t, "multi") + } + } + if r.contentTypeId != nil { + t := *r.contentTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", t, "multi") + } + } + if r.contentTypeIdEmpty != nil { + t := *r.contentTypeIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", t, "multi") + } + } + if r.contentTypeIdGt != nil { + t := *r.contentTypeIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", t, "multi") + } + } + if r.contentTypeIdGte != nil { + t := *r.contentTypeIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", t, "multi") + } + } + if r.contentTypeIdLt != nil { + t := *r.contentTypeIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", t, "multi") + } + } + if r.contentTypeIdLte != nil { + t := *r.contentTypeIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", t, "multi") + } + } + if r.contentTypeIdN != nil { + t := *r.contentTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", t, "multi") + } + } + if r.contentTypes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types", r.contentTypes, "") + } + if r.contentTypesIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ic", r.contentTypesIc, "") + } + if r.contentTypesIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ie", r.contentTypesIe, "") + } + if r.contentTypesIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__iew", r.contentTypesIew, "") + } + if r.contentTypesIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__isw", r.contentTypesIsw, "") + } + if r.contentTypesN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__n", r.contentTypesN, "") + } + if r.contentTypesNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nic", r.contentTypesNic, "") + } + if r.contentTypesNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nie", r.contentTypesNie, "") + } + if r.contentTypesNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__niew", r.contentTypesNiew, "") + } + if r.contentTypesNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nisw", r.contentTypesNisw, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.typeCreate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_create", r.typeCreate, "") + } + if r.typeDelete != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_delete", r.typeDelete, "") + } + if r.typeJobEnd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_job_end", r.typeJobEnd, "") + } + if r.typeJobStart != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_job_start", r.typeJobStart, "") + } + if r.typeUpdate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_update", r.typeUpdate, "") + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableEventRuleRequest *PatchedWritableEventRuleRequest +} + +func (r ApiExtrasEventRulesPartialUpdateRequest) PatchedWritableEventRuleRequest(patchedWritableEventRuleRequest PatchedWritableEventRuleRequest) ApiExtrasEventRulesPartialUpdateRequest { + r.patchedWritableEventRuleRequest = &patchedWritableEventRuleRequest + return r +} + +func (r ApiExtrasEventRulesPartialUpdateRequest) Execute() (*EventRule, *http.Response, error) { + return r.ApiService.ExtrasEventRulesPartialUpdateExecute(r) +} + +/* +ExtrasEventRulesPartialUpdate Method for ExtrasEventRulesPartialUpdate + +Patch a event rule object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this event rule. + @return ApiExtrasEventRulesPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesPartialUpdate(ctx context.Context, id int32) ApiExtrasEventRulesPartialUpdateRequest { + return ApiExtrasEventRulesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EventRule +func (a *ExtrasAPIService) ExtrasEventRulesPartialUpdateExecute(r ApiExtrasEventRulesPartialUpdateRequest) (*EventRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableEventRuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasEventRulesRetrieveRequest) Execute() (*EventRule, *http.Response, error) { + return r.ApiService.ExtrasEventRulesRetrieveExecute(r) +} + +/* +ExtrasEventRulesRetrieve Method for ExtrasEventRulesRetrieve + +Get a event rule object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this event rule. + @return ApiExtrasEventRulesRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesRetrieve(ctx context.Context, id int32) ApiExtrasEventRulesRetrieveRequest { + return ApiExtrasEventRulesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EventRule +func (a *ExtrasAPIService) ExtrasEventRulesRetrieveExecute(r ApiExtrasEventRulesRetrieveRequest) (*EventRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasEventRulesUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableEventRuleRequest *WritableEventRuleRequest +} + +func (r ApiExtrasEventRulesUpdateRequest) WritableEventRuleRequest(writableEventRuleRequest WritableEventRuleRequest) ApiExtrasEventRulesUpdateRequest { + r.writableEventRuleRequest = &writableEventRuleRequest + return r +} + +func (r ApiExtrasEventRulesUpdateRequest) Execute() (*EventRule, *http.Response, error) { + return r.ApiService.ExtrasEventRulesUpdateExecute(r) +} + +/* +ExtrasEventRulesUpdate Method for ExtrasEventRulesUpdate + +Put a event rule object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this event rule. + @return ApiExtrasEventRulesUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasEventRulesUpdate(ctx context.Context, id int32) ApiExtrasEventRulesUpdateRequest { + return ApiExtrasEventRulesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EventRule +func (a *ExtrasAPIService) ExtrasEventRulesUpdateExecute(r ApiExtrasEventRulesUpdateRequest) (*EventRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasEventRulesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/event-rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableEventRuleRequest == nil { + return localVarReturnValue, nil, reportError("writableEventRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableEventRuleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + exportTemplateRequest *[]ExportTemplateRequest +} + +func (r ApiExtrasExportTemplatesBulkDestroyRequest) ExportTemplateRequest(exportTemplateRequest []ExportTemplateRequest) ApiExtrasExportTemplatesBulkDestroyRequest { + r.exportTemplateRequest = &exportTemplateRequest + return r +} + +func (r ApiExtrasExportTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasExportTemplatesBulkDestroyExecute(r) +} + +/* +ExtrasExportTemplatesBulkDestroy Method for ExtrasExportTemplatesBulkDestroy + +Delete a list of export template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasExportTemplatesBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesBulkDestroy(ctx context.Context) ApiExtrasExportTemplatesBulkDestroyRequest { + return ApiExtrasExportTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasExportTemplatesBulkDestroyExecute(r ApiExtrasExportTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.exportTemplateRequest == nil { + return nil, reportError("exportTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.exportTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + exportTemplateRequest *[]ExportTemplateRequest +} + +func (r ApiExtrasExportTemplatesBulkPartialUpdateRequest) ExportTemplateRequest(exportTemplateRequest []ExportTemplateRequest) ApiExtrasExportTemplatesBulkPartialUpdateRequest { + r.exportTemplateRequest = &exportTemplateRequest + return r +} + +func (r ApiExtrasExportTemplatesBulkPartialUpdateRequest) Execute() ([]ExportTemplate, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesBulkPartialUpdateExecute(r) +} + +/* +ExtrasExportTemplatesBulkPartialUpdate Method for ExtrasExportTemplatesBulkPartialUpdate + +Patch a list of export template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasExportTemplatesBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesBulkPartialUpdate(ctx context.Context) ApiExtrasExportTemplatesBulkPartialUpdateRequest { + return ApiExtrasExportTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ExportTemplate +func (a *ExtrasAPIService) ExtrasExportTemplatesBulkPartialUpdateExecute(r ApiExtrasExportTemplatesBulkPartialUpdateRequest) ([]ExportTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ExportTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.exportTemplateRequest == nil { + return localVarReturnValue, nil, reportError("exportTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.exportTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + exportTemplateRequest *[]ExportTemplateRequest +} + +func (r ApiExtrasExportTemplatesBulkUpdateRequest) ExportTemplateRequest(exportTemplateRequest []ExportTemplateRequest) ApiExtrasExportTemplatesBulkUpdateRequest { + r.exportTemplateRequest = &exportTemplateRequest + return r +} + +func (r ApiExtrasExportTemplatesBulkUpdateRequest) Execute() ([]ExportTemplate, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesBulkUpdateExecute(r) +} + +/* +ExtrasExportTemplatesBulkUpdate Method for ExtrasExportTemplatesBulkUpdate + +Put a list of export template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasExportTemplatesBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesBulkUpdate(ctx context.Context) ApiExtrasExportTemplatesBulkUpdateRequest { + return ApiExtrasExportTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ExportTemplate +func (a *ExtrasAPIService) ExtrasExportTemplatesBulkUpdateExecute(r ApiExtrasExportTemplatesBulkUpdateRequest) ([]ExportTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ExportTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.exportTemplateRequest == nil { + return localVarReturnValue, nil, reportError("exportTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.exportTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableExportTemplateRequest *WritableExportTemplateRequest +} + +func (r ApiExtrasExportTemplatesCreateRequest) WritableExportTemplateRequest(writableExportTemplateRequest WritableExportTemplateRequest) ApiExtrasExportTemplatesCreateRequest { + r.writableExportTemplateRequest = &writableExportTemplateRequest + return r +} + +func (r ApiExtrasExportTemplatesCreateRequest) Execute() (*ExportTemplate, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesCreateExecute(r) +} + +/* +ExtrasExportTemplatesCreate Method for ExtrasExportTemplatesCreate + +Post a list of export template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasExportTemplatesCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesCreate(ctx context.Context) ApiExtrasExportTemplatesCreateRequest { + return ApiExtrasExportTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ExportTemplate +func (a *ExtrasAPIService) ExtrasExportTemplatesCreateExecute(r ApiExtrasExportTemplatesCreateRequest) (*ExportTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExportTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableExportTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableExportTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableExportTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasExportTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasExportTemplatesDestroyExecute(r) +} + +/* +ExtrasExportTemplatesDestroy Method for ExtrasExportTemplatesDestroy + +Delete a export template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this export template. + @return ApiExtrasExportTemplatesDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesDestroy(ctx context.Context, id int32) ApiExtrasExportTemplatesDestroyRequest { + return ApiExtrasExportTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasExportTemplatesDestroyExecute(r ApiExtrasExportTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + contentTypeId *[]int32 + contentTypeIdEmpty *[]int32 + contentTypeIdGt *[]int32 + contentTypeIdGte *[]int32 + contentTypeIdLt *[]int32 + contentTypeIdLte *[]int32 + contentTypeIdN *[]int32 + contentTypes *string + contentTypesIc *string + contentTypesIe *string + contentTypesIew *string + contentTypesIsw *string + contentTypesN *string + contentTypesNic *string + contentTypesNie *string + contentTypesNiew *string + contentTypesNisw *string + dataFileId *[]*int32 + dataFileIdN *[]*int32 + dataSourceId *[]*int32 + dataSourceIdN *[]*int32 + dataSynced *[]time.Time + dataSyncedEmpty *bool + dataSyncedGt *[]time.Time + dataSyncedGte *[]time.Time + dataSyncedLt *[]time.Time + dataSyncedLte *[]time.Time + dataSyncedN *[]time.Time + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypeId(contentTypeId []int32) ApiExtrasExportTemplatesListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypeIdEmpty(contentTypeIdEmpty []int32) ApiExtrasExportTemplatesListRequest { + r.contentTypeIdEmpty = &contentTypeIdEmpty + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypeIdGt(contentTypeIdGt []int32) ApiExtrasExportTemplatesListRequest { + r.contentTypeIdGt = &contentTypeIdGt + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypeIdGte(contentTypeIdGte []int32) ApiExtrasExportTemplatesListRequest { + r.contentTypeIdGte = &contentTypeIdGte + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypeIdLt(contentTypeIdLt []int32) ApiExtrasExportTemplatesListRequest { + r.contentTypeIdLt = &contentTypeIdLt + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypeIdLte(contentTypeIdLte []int32) ApiExtrasExportTemplatesListRequest { + r.contentTypeIdLte = &contentTypeIdLte + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypeIdN(contentTypeIdN []int32) ApiExtrasExportTemplatesListRequest { + r.contentTypeIdN = &contentTypeIdN + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypes(contentTypes string) ApiExtrasExportTemplatesListRequest { + r.contentTypes = &contentTypes + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesIc(contentTypesIc string) ApiExtrasExportTemplatesListRequest { + r.contentTypesIc = &contentTypesIc + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesIe(contentTypesIe string) ApiExtrasExportTemplatesListRequest { + r.contentTypesIe = &contentTypesIe + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesIew(contentTypesIew string) ApiExtrasExportTemplatesListRequest { + r.contentTypesIew = &contentTypesIew + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesIsw(contentTypesIsw string) ApiExtrasExportTemplatesListRequest { + r.contentTypesIsw = &contentTypesIsw + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesN(contentTypesN string) ApiExtrasExportTemplatesListRequest { + r.contentTypesN = &contentTypesN + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesNic(contentTypesNic string) ApiExtrasExportTemplatesListRequest { + r.contentTypesNic = &contentTypesNic + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesNie(contentTypesNie string) ApiExtrasExportTemplatesListRequest { + r.contentTypesNie = &contentTypesNie + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesNiew(contentTypesNiew string) ApiExtrasExportTemplatesListRequest { + r.contentTypesNiew = &contentTypesNiew + return r +} + +func (r ApiExtrasExportTemplatesListRequest) ContentTypesNisw(contentTypesNisw string) ApiExtrasExportTemplatesListRequest { + r.contentTypesNisw = &contentTypesNisw + return r +} + +// Data file (ID) +func (r ApiExtrasExportTemplatesListRequest) DataFileId(dataFileId []*int32) ApiExtrasExportTemplatesListRequest { + r.dataFileId = &dataFileId + return r +} + +// Data file (ID) +func (r ApiExtrasExportTemplatesListRequest) DataFileIdN(dataFileIdN []*int32) ApiExtrasExportTemplatesListRequest { + r.dataFileIdN = &dataFileIdN + return r +} + +// Data source (ID) +func (r ApiExtrasExportTemplatesListRequest) DataSourceId(dataSourceId []*int32) ApiExtrasExportTemplatesListRequest { + r.dataSourceId = &dataSourceId + return r +} + +// Data source (ID) +func (r ApiExtrasExportTemplatesListRequest) DataSourceIdN(dataSourceIdN []*int32) ApiExtrasExportTemplatesListRequest { + r.dataSourceIdN = &dataSourceIdN + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DataSynced(dataSynced []time.Time) ApiExtrasExportTemplatesListRequest { + r.dataSynced = &dataSynced + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DataSyncedEmpty(dataSyncedEmpty bool) ApiExtrasExportTemplatesListRequest { + r.dataSyncedEmpty = &dataSyncedEmpty + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DataSyncedGt(dataSyncedGt []time.Time) ApiExtrasExportTemplatesListRequest { + r.dataSyncedGt = &dataSyncedGt + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DataSyncedGte(dataSyncedGte []time.Time) ApiExtrasExportTemplatesListRequest { + r.dataSyncedGte = &dataSyncedGte + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DataSyncedLt(dataSyncedLt []time.Time) ApiExtrasExportTemplatesListRequest { + r.dataSyncedLt = &dataSyncedLt + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DataSyncedLte(dataSyncedLte []time.Time) ApiExtrasExportTemplatesListRequest { + r.dataSyncedLte = &dataSyncedLte + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DataSyncedN(dataSyncedN []time.Time) ApiExtrasExportTemplatesListRequest { + r.dataSyncedN = &dataSyncedN + return r +} + +func (r ApiExtrasExportTemplatesListRequest) Description(description []string) ApiExtrasExportTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasExportTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiExtrasExportTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiExtrasExportTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiExtrasExportTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasExportTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionN(descriptionN []string) ApiExtrasExportTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiExtrasExportTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiExtrasExportTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasExportTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasExportTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasExportTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiExtrasExportTemplatesListRequest) Id(id []int32) ApiExtrasExportTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiExtrasExportTemplatesListRequest) IdEmpty(idEmpty bool) ApiExtrasExportTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasExportTemplatesListRequest) IdGt(idGt []int32) ApiExtrasExportTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasExportTemplatesListRequest) IdGte(idGte []int32) ApiExtrasExportTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasExportTemplatesListRequest) IdLt(idLt []int32) ApiExtrasExportTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasExportTemplatesListRequest) IdLte(idLte []int32) ApiExtrasExportTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasExportTemplatesListRequest) IdN(idN []int32) ApiExtrasExportTemplatesListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasExportTemplatesListRequest) Limit(limit int32) ApiExtrasExportTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasExportTemplatesListRequest) Name(name []string) ApiExtrasExportTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameEmpty(nameEmpty bool) ApiExtrasExportTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameIc(nameIc []string) ApiExtrasExportTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameIe(nameIe []string) ApiExtrasExportTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameIew(nameIew []string) ApiExtrasExportTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameIsw(nameIsw []string) ApiExtrasExportTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameN(nameN []string) ApiExtrasExportTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameNic(nameNic []string) ApiExtrasExportTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameNie(nameNie []string) ApiExtrasExportTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameNiew(nameNiew []string) ApiExtrasExportTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasExportTemplatesListRequest) NameNisw(nameNisw []string) ApiExtrasExportTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasExportTemplatesListRequest) Offset(offset int32) ApiExtrasExportTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasExportTemplatesListRequest) Ordering(ordering string) ApiExtrasExportTemplatesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasExportTemplatesListRequest) Q(q string) ApiExtrasExportTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiExtrasExportTemplatesListRequest) Execute() (*PaginatedExportTemplateList, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesListExecute(r) +} + +/* +ExtrasExportTemplatesList Method for ExtrasExportTemplatesList + +Get a list of export template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasExportTemplatesListRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesList(ctx context.Context) ApiExtrasExportTemplatesListRequest { + return ApiExtrasExportTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedExportTemplateList +func (a *ExtrasAPIService) ExtrasExportTemplatesListExecute(r ApiExtrasExportTemplatesListRequest) (*PaginatedExportTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedExportTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contentTypeId != nil { + t := *r.contentTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", t, "multi") + } + } + if r.contentTypeIdEmpty != nil { + t := *r.contentTypeIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", t, "multi") + } + } + if r.contentTypeIdGt != nil { + t := *r.contentTypeIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", t, "multi") + } + } + if r.contentTypeIdGte != nil { + t := *r.contentTypeIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", t, "multi") + } + } + if r.contentTypeIdLt != nil { + t := *r.contentTypeIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", t, "multi") + } + } + if r.contentTypeIdLte != nil { + t := *r.contentTypeIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", t, "multi") + } + } + if r.contentTypeIdN != nil { + t := *r.contentTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", t, "multi") + } + } + if r.contentTypes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types", r.contentTypes, "") + } + if r.contentTypesIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ic", r.contentTypesIc, "") + } + if r.contentTypesIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ie", r.contentTypesIe, "") + } + if r.contentTypesIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__iew", r.contentTypesIew, "") + } + if r.contentTypesIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__isw", r.contentTypesIsw, "") + } + if r.contentTypesN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__n", r.contentTypesN, "") + } + if r.contentTypesNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nic", r.contentTypesNic, "") + } + if r.contentTypesNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nie", r.contentTypesNie, "") + } + if r.contentTypesNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__niew", r.contentTypesNiew, "") + } + if r.contentTypesNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nisw", r.contentTypesNisw, "") + } + if r.dataFileId != nil { + t := *r.dataFileId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id", t, "multi") + } + } + if r.dataFileIdN != nil { + t := *r.dataFileIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_file_id__n", t, "multi") + } + } + if r.dataSourceId != nil { + t := *r.dataSourceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id", t, "multi") + } + } + if r.dataSourceIdN != nil { + t := *r.dataSourceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_source_id__n", t, "multi") + } + } + if r.dataSynced != nil { + t := *r.dataSynced + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced", t, "multi") + } + } + if r.dataSyncedEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__empty", r.dataSyncedEmpty, "") + } + if r.dataSyncedGt != nil { + t := *r.dataSyncedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gt", t, "multi") + } + } + if r.dataSyncedGte != nil { + t := *r.dataSyncedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__gte", t, "multi") + } + } + if r.dataSyncedLt != nil { + t := *r.dataSyncedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lt", t, "multi") + } + } + if r.dataSyncedLte != nil { + t := *r.dataSyncedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__lte", t, "multi") + } + } + if r.dataSyncedN != nil { + t := *r.dataSyncedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "data_synced__n", t, "multi") + } + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableExportTemplateRequest *PatchedWritableExportTemplateRequest +} + +func (r ApiExtrasExportTemplatesPartialUpdateRequest) PatchedWritableExportTemplateRequest(patchedWritableExportTemplateRequest PatchedWritableExportTemplateRequest) ApiExtrasExportTemplatesPartialUpdateRequest { + r.patchedWritableExportTemplateRequest = &patchedWritableExportTemplateRequest + return r +} + +func (r ApiExtrasExportTemplatesPartialUpdateRequest) Execute() (*ExportTemplate, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesPartialUpdateExecute(r) +} + +/* +ExtrasExportTemplatesPartialUpdate Method for ExtrasExportTemplatesPartialUpdate + +Patch a export template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this export template. + @return ApiExtrasExportTemplatesPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesPartialUpdate(ctx context.Context, id int32) ApiExtrasExportTemplatesPartialUpdateRequest { + return ApiExtrasExportTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ExportTemplate +func (a *ExtrasAPIService) ExtrasExportTemplatesPartialUpdateExecute(r ApiExtrasExportTemplatesPartialUpdateRequest) (*ExportTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExportTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableExportTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasExportTemplatesRetrieveRequest) Execute() (*ExportTemplate, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesRetrieveExecute(r) +} + +/* +ExtrasExportTemplatesRetrieve Method for ExtrasExportTemplatesRetrieve + +Get a export template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this export template. + @return ApiExtrasExportTemplatesRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesRetrieve(ctx context.Context, id int32) ApiExtrasExportTemplatesRetrieveRequest { + return ApiExtrasExportTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ExportTemplate +func (a *ExtrasAPIService) ExtrasExportTemplatesRetrieveExecute(r ApiExtrasExportTemplatesRetrieveRequest) (*ExportTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExportTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesSyncCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableExportTemplateRequest *WritableExportTemplateRequest +} + +func (r ApiExtrasExportTemplatesSyncCreateRequest) WritableExportTemplateRequest(writableExportTemplateRequest WritableExportTemplateRequest) ApiExtrasExportTemplatesSyncCreateRequest { + r.writableExportTemplateRequest = &writableExportTemplateRequest + return r +} + +func (r ApiExtrasExportTemplatesSyncCreateRequest) Execute() (*ExportTemplate, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesSyncCreateExecute(r) +} + +/* +ExtrasExportTemplatesSyncCreate Method for ExtrasExportTemplatesSyncCreate + +Provide a /sync API endpoint to synchronize an object's data from its associated DataFile (if any). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this export template. + @return ApiExtrasExportTemplatesSyncCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesSyncCreate(ctx context.Context, id int32) ApiExtrasExportTemplatesSyncCreateRequest { + return ApiExtrasExportTemplatesSyncCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ExportTemplate +func (a *ExtrasAPIService) ExtrasExportTemplatesSyncCreateExecute(r ApiExtrasExportTemplatesSyncCreateRequest) (*ExportTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExportTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesSyncCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/{id}/sync/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableExportTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableExportTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableExportTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasExportTemplatesUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableExportTemplateRequest *WritableExportTemplateRequest +} + +func (r ApiExtrasExportTemplatesUpdateRequest) WritableExportTemplateRequest(writableExportTemplateRequest WritableExportTemplateRequest) ApiExtrasExportTemplatesUpdateRequest { + r.writableExportTemplateRequest = &writableExportTemplateRequest + return r +} + +func (r ApiExtrasExportTemplatesUpdateRequest) Execute() (*ExportTemplate, *http.Response, error) { + return r.ApiService.ExtrasExportTemplatesUpdateExecute(r) +} + +/* +ExtrasExportTemplatesUpdate Method for ExtrasExportTemplatesUpdate + +Put a export template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this export template. + @return ApiExtrasExportTemplatesUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasExportTemplatesUpdate(ctx context.Context, id int32) ApiExtrasExportTemplatesUpdateRequest { + return ApiExtrasExportTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ExportTemplate +func (a *ExtrasAPIService) ExtrasExportTemplatesUpdateExecute(r ApiExtrasExportTemplatesUpdateRequest) (*ExportTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExportTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasExportTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/export-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableExportTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableExportTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableExportTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + imageAttachmentRequest *[]ImageAttachmentRequest +} + +func (r ApiExtrasImageAttachmentsBulkDestroyRequest) ImageAttachmentRequest(imageAttachmentRequest []ImageAttachmentRequest) ApiExtrasImageAttachmentsBulkDestroyRequest { + r.imageAttachmentRequest = &imageAttachmentRequest + return r +} + +func (r ApiExtrasImageAttachmentsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsBulkDestroyExecute(r) +} + +/* +ExtrasImageAttachmentsBulkDestroy Method for ExtrasImageAttachmentsBulkDestroy + +Delete a list of image attachment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasImageAttachmentsBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsBulkDestroy(ctx context.Context) ApiExtrasImageAttachmentsBulkDestroyRequest { + return ApiExtrasImageAttachmentsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasImageAttachmentsBulkDestroyExecute(r ApiExtrasImageAttachmentsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageAttachmentRequest == nil { + return nil, reportError("imageAttachmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.imageAttachmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + imageAttachmentRequest *[]ImageAttachmentRequest +} + +func (r ApiExtrasImageAttachmentsBulkPartialUpdateRequest) ImageAttachmentRequest(imageAttachmentRequest []ImageAttachmentRequest) ApiExtrasImageAttachmentsBulkPartialUpdateRequest { + r.imageAttachmentRequest = &imageAttachmentRequest + return r +} + +func (r ApiExtrasImageAttachmentsBulkPartialUpdateRequest) Execute() ([]ImageAttachment, *http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsBulkPartialUpdateExecute(r) +} + +/* +ExtrasImageAttachmentsBulkPartialUpdate Method for ExtrasImageAttachmentsBulkPartialUpdate + +Patch a list of image attachment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasImageAttachmentsBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsBulkPartialUpdate(ctx context.Context) ApiExtrasImageAttachmentsBulkPartialUpdateRequest { + return ApiExtrasImageAttachmentsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ImageAttachment +func (a *ExtrasAPIService) ExtrasImageAttachmentsBulkPartialUpdateExecute(r ApiExtrasImageAttachmentsBulkPartialUpdateRequest) ([]ImageAttachment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ImageAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageAttachmentRequest == nil { + return localVarReturnValue, nil, reportError("imageAttachmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.imageAttachmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + imageAttachmentRequest *[]ImageAttachmentRequest +} + +func (r ApiExtrasImageAttachmentsBulkUpdateRequest) ImageAttachmentRequest(imageAttachmentRequest []ImageAttachmentRequest) ApiExtrasImageAttachmentsBulkUpdateRequest { + r.imageAttachmentRequest = &imageAttachmentRequest + return r +} + +func (r ApiExtrasImageAttachmentsBulkUpdateRequest) Execute() ([]ImageAttachment, *http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsBulkUpdateExecute(r) +} + +/* +ExtrasImageAttachmentsBulkUpdate Method for ExtrasImageAttachmentsBulkUpdate + +Put a list of image attachment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasImageAttachmentsBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsBulkUpdate(ctx context.Context) ApiExtrasImageAttachmentsBulkUpdateRequest { + return ApiExtrasImageAttachmentsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ImageAttachment +func (a *ExtrasAPIService) ExtrasImageAttachmentsBulkUpdateExecute(r ApiExtrasImageAttachmentsBulkUpdateRequest) ([]ImageAttachment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ImageAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageAttachmentRequest == nil { + return localVarReturnValue, nil, reportError("imageAttachmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.imageAttachmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + imageAttachmentRequest *ImageAttachmentRequest +} + +func (r ApiExtrasImageAttachmentsCreateRequest) ImageAttachmentRequest(imageAttachmentRequest ImageAttachmentRequest) ApiExtrasImageAttachmentsCreateRequest { + r.imageAttachmentRequest = &imageAttachmentRequest + return r +} + +func (r ApiExtrasImageAttachmentsCreateRequest) Execute() (*ImageAttachment, *http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsCreateExecute(r) +} + +/* +ExtrasImageAttachmentsCreate Method for ExtrasImageAttachmentsCreate + +Post a list of image attachment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasImageAttachmentsCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsCreate(ctx context.Context) ApiExtrasImageAttachmentsCreateRequest { + return ApiExtrasImageAttachmentsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ImageAttachment +func (a *ExtrasAPIService) ExtrasImageAttachmentsCreateExecute(r ApiExtrasImageAttachmentsCreateRequest) (*ImageAttachment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageAttachmentRequest == nil { + return localVarReturnValue, nil, reportError("imageAttachmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.imageAttachmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasImageAttachmentsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsDestroyExecute(r) +} + +/* +ExtrasImageAttachmentsDestroy Method for ExtrasImageAttachmentsDestroy + +Delete a image attachment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this image attachment. + @return ApiExtrasImageAttachmentsDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsDestroy(ctx context.Context, id int32) ApiExtrasImageAttachmentsDestroyRequest { + return ApiExtrasImageAttachmentsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasImageAttachmentsDestroyExecute(r ApiExtrasImageAttachmentsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + contentType *string + contentTypeN *string + contentTypeId *int32 + contentTypeIdN *int32 + created *time.Time + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + objectId *[]int32 + objectIdEmpty *bool + objectIdGt *[]int32 + objectIdGte *[]int32 + objectIdLt *[]int32 + objectIdLte *[]int32 + objectIdN *[]int32 + offset *int32 + ordering *string + q *string +} + +func (r ApiExtrasImageAttachmentsListRequest) ContentType(contentType string) ApiExtrasImageAttachmentsListRequest { + r.contentType = &contentType + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ContentTypeN(contentTypeN string) ApiExtrasImageAttachmentsListRequest { + r.contentTypeN = &contentTypeN + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ContentTypeId(contentTypeId int32) ApiExtrasImageAttachmentsListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ContentTypeIdN(contentTypeIdN int32) ApiExtrasImageAttachmentsListRequest { + r.contentTypeIdN = &contentTypeIdN + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) Created(created time.Time) ApiExtrasImageAttachmentsListRequest { + r.created = &created + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) Id(id []int32) ApiExtrasImageAttachmentsListRequest { + r.id = &id + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) IdEmpty(idEmpty bool) ApiExtrasImageAttachmentsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) IdGt(idGt []int32) ApiExtrasImageAttachmentsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) IdGte(idGte []int32) ApiExtrasImageAttachmentsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) IdLt(idLt []int32) ApiExtrasImageAttachmentsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) IdLte(idLte []int32) ApiExtrasImageAttachmentsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) IdN(idN []int32) ApiExtrasImageAttachmentsListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasImageAttachmentsListRequest) Limit(limit int32) ApiExtrasImageAttachmentsListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) Name(name []string) ApiExtrasImageAttachmentsListRequest { + r.name = &name + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameEmpty(nameEmpty bool) ApiExtrasImageAttachmentsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameIc(nameIc []string) ApiExtrasImageAttachmentsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameIe(nameIe []string) ApiExtrasImageAttachmentsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameIew(nameIew []string) ApiExtrasImageAttachmentsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameIsw(nameIsw []string) ApiExtrasImageAttachmentsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameN(nameN []string) ApiExtrasImageAttachmentsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameNic(nameNic []string) ApiExtrasImageAttachmentsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameNie(nameNie []string) ApiExtrasImageAttachmentsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameNiew(nameNiew []string) ApiExtrasImageAttachmentsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) NameNisw(nameNisw []string) ApiExtrasImageAttachmentsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ObjectId(objectId []int32) ApiExtrasImageAttachmentsListRequest { + r.objectId = &objectId + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ObjectIdEmpty(objectIdEmpty bool) ApiExtrasImageAttachmentsListRequest { + r.objectIdEmpty = &objectIdEmpty + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ObjectIdGt(objectIdGt []int32) ApiExtrasImageAttachmentsListRequest { + r.objectIdGt = &objectIdGt + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ObjectIdGte(objectIdGte []int32) ApiExtrasImageAttachmentsListRequest { + r.objectIdGte = &objectIdGte + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ObjectIdLt(objectIdLt []int32) ApiExtrasImageAttachmentsListRequest { + r.objectIdLt = &objectIdLt + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ObjectIdLte(objectIdLte []int32) ApiExtrasImageAttachmentsListRequest { + r.objectIdLte = &objectIdLte + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) ObjectIdN(objectIdN []int32) ApiExtrasImageAttachmentsListRequest { + r.objectIdN = &objectIdN + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasImageAttachmentsListRequest) Offset(offset int32) ApiExtrasImageAttachmentsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasImageAttachmentsListRequest) Ordering(ordering string) ApiExtrasImageAttachmentsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasImageAttachmentsListRequest) Q(q string) ApiExtrasImageAttachmentsListRequest { + r.q = &q + return r +} + +func (r ApiExtrasImageAttachmentsListRequest) Execute() (*PaginatedImageAttachmentList, *http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsListExecute(r) +} + +/* +ExtrasImageAttachmentsList Method for ExtrasImageAttachmentsList + +Get a list of image attachment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasImageAttachmentsListRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsList(ctx context.Context) ApiExtrasImageAttachmentsListRequest { + return ApiExtrasImageAttachmentsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedImageAttachmentList +func (a *ExtrasAPIService) ExtrasImageAttachmentsListExecute(r ApiExtrasImageAttachmentsListRequest) (*PaginatedImageAttachmentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedImageAttachmentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contentType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type", r.contentType, "") + } + if r.contentTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type__n", r.contentTypeN, "") + } + if r.contentTypeId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", r.contentTypeId, "") + } + if r.contentTypeIdN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", r.contentTypeIdN, "") + } + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.objectId != nil { + t := *r.objectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", t, "multi") + } + } + if r.objectIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__empty", r.objectIdEmpty, "") + } + if r.objectIdGt != nil { + t := *r.objectIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", t, "multi") + } + } + if r.objectIdGte != nil { + t := *r.objectIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", t, "multi") + } + } + if r.objectIdLt != nil { + t := *r.objectIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", t, "multi") + } + } + if r.objectIdLte != nil { + t := *r.objectIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", t, "multi") + } + } + if r.objectIdN != nil { + t := *r.objectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedImageAttachmentRequest *PatchedImageAttachmentRequest +} + +func (r ApiExtrasImageAttachmentsPartialUpdateRequest) PatchedImageAttachmentRequest(patchedImageAttachmentRequest PatchedImageAttachmentRequest) ApiExtrasImageAttachmentsPartialUpdateRequest { + r.patchedImageAttachmentRequest = &patchedImageAttachmentRequest + return r +} + +func (r ApiExtrasImageAttachmentsPartialUpdateRequest) Execute() (*ImageAttachment, *http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsPartialUpdateExecute(r) +} + +/* +ExtrasImageAttachmentsPartialUpdate Method for ExtrasImageAttachmentsPartialUpdate + +Patch a image attachment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this image attachment. + @return ApiExtrasImageAttachmentsPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsPartialUpdate(ctx context.Context, id int32) ApiExtrasImageAttachmentsPartialUpdateRequest { + return ApiExtrasImageAttachmentsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ImageAttachment +func (a *ExtrasAPIService) ExtrasImageAttachmentsPartialUpdateExecute(r ApiExtrasImageAttachmentsPartialUpdateRequest) (*ImageAttachment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedImageAttachmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasImageAttachmentsRetrieveRequest) Execute() (*ImageAttachment, *http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsRetrieveExecute(r) +} + +/* +ExtrasImageAttachmentsRetrieve Method for ExtrasImageAttachmentsRetrieve + +Get a image attachment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this image attachment. + @return ApiExtrasImageAttachmentsRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsRetrieve(ctx context.Context, id int32) ApiExtrasImageAttachmentsRetrieveRequest { + return ApiExtrasImageAttachmentsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ImageAttachment +func (a *ExtrasAPIService) ExtrasImageAttachmentsRetrieveExecute(r ApiExtrasImageAttachmentsRetrieveRequest) (*ImageAttachment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasImageAttachmentsUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + imageAttachmentRequest *ImageAttachmentRequest +} + +func (r ApiExtrasImageAttachmentsUpdateRequest) ImageAttachmentRequest(imageAttachmentRequest ImageAttachmentRequest) ApiExtrasImageAttachmentsUpdateRequest { + r.imageAttachmentRequest = &imageAttachmentRequest + return r +} + +func (r ApiExtrasImageAttachmentsUpdateRequest) Execute() (*ImageAttachment, *http.Response, error) { + return r.ApiService.ExtrasImageAttachmentsUpdateExecute(r) +} + +/* +ExtrasImageAttachmentsUpdate Method for ExtrasImageAttachmentsUpdate + +Put a image attachment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this image attachment. + @return ApiExtrasImageAttachmentsUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasImageAttachmentsUpdate(ctx context.Context, id int32) ApiExtrasImageAttachmentsUpdateRequest { + return ApiExtrasImageAttachmentsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ImageAttachment +func (a *ExtrasAPIService) ExtrasImageAttachmentsUpdateExecute(r ApiExtrasImageAttachmentsUpdateRequest) (*ImageAttachment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasImageAttachmentsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/image-attachments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.imageAttachmentRequest == nil { + return localVarReturnValue, nil, reportError("imageAttachmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.imageAttachmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + journalEntryRequest *[]JournalEntryRequest +} + +func (r ApiExtrasJournalEntriesBulkDestroyRequest) JournalEntryRequest(journalEntryRequest []JournalEntryRequest) ApiExtrasJournalEntriesBulkDestroyRequest { + r.journalEntryRequest = &journalEntryRequest + return r +} + +func (r ApiExtrasJournalEntriesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasJournalEntriesBulkDestroyExecute(r) +} + +/* +ExtrasJournalEntriesBulkDestroy Method for ExtrasJournalEntriesBulkDestroy + +Delete a list of journal entry objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasJournalEntriesBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesBulkDestroy(ctx context.Context) ApiExtrasJournalEntriesBulkDestroyRequest { + return ApiExtrasJournalEntriesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasJournalEntriesBulkDestroyExecute(r ApiExtrasJournalEntriesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.journalEntryRequest == nil { + return nil, reportError("journalEntryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.journalEntryRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + journalEntryRequest *[]JournalEntryRequest +} + +func (r ApiExtrasJournalEntriesBulkPartialUpdateRequest) JournalEntryRequest(journalEntryRequest []JournalEntryRequest) ApiExtrasJournalEntriesBulkPartialUpdateRequest { + r.journalEntryRequest = &journalEntryRequest + return r +} + +func (r ApiExtrasJournalEntriesBulkPartialUpdateRequest) Execute() ([]JournalEntry, *http.Response, error) { + return r.ApiService.ExtrasJournalEntriesBulkPartialUpdateExecute(r) +} + +/* +ExtrasJournalEntriesBulkPartialUpdate Method for ExtrasJournalEntriesBulkPartialUpdate + +Patch a list of journal entry objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasJournalEntriesBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesBulkPartialUpdate(ctx context.Context) ApiExtrasJournalEntriesBulkPartialUpdateRequest { + return ApiExtrasJournalEntriesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []JournalEntry +func (a *ExtrasAPIService) ExtrasJournalEntriesBulkPartialUpdateExecute(r ApiExtrasJournalEntriesBulkPartialUpdateRequest) ([]JournalEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []JournalEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.journalEntryRequest == nil { + return localVarReturnValue, nil, reportError("journalEntryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.journalEntryRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + journalEntryRequest *[]JournalEntryRequest +} + +func (r ApiExtrasJournalEntriesBulkUpdateRequest) JournalEntryRequest(journalEntryRequest []JournalEntryRequest) ApiExtrasJournalEntriesBulkUpdateRequest { + r.journalEntryRequest = &journalEntryRequest + return r +} + +func (r ApiExtrasJournalEntriesBulkUpdateRequest) Execute() ([]JournalEntry, *http.Response, error) { + return r.ApiService.ExtrasJournalEntriesBulkUpdateExecute(r) +} + +/* +ExtrasJournalEntriesBulkUpdate Method for ExtrasJournalEntriesBulkUpdate + +Put a list of journal entry objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasJournalEntriesBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesBulkUpdate(ctx context.Context) ApiExtrasJournalEntriesBulkUpdateRequest { + return ApiExtrasJournalEntriesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []JournalEntry +func (a *ExtrasAPIService) ExtrasJournalEntriesBulkUpdateExecute(r ApiExtrasJournalEntriesBulkUpdateRequest) ([]JournalEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []JournalEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.journalEntryRequest == nil { + return localVarReturnValue, nil, reportError("journalEntryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.journalEntryRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + writableJournalEntryRequest *WritableJournalEntryRequest +} + +func (r ApiExtrasJournalEntriesCreateRequest) WritableJournalEntryRequest(writableJournalEntryRequest WritableJournalEntryRequest) ApiExtrasJournalEntriesCreateRequest { + r.writableJournalEntryRequest = &writableJournalEntryRequest + return r +} + +func (r ApiExtrasJournalEntriesCreateRequest) Execute() (*JournalEntry, *http.Response, error) { + return r.ApiService.ExtrasJournalEntriesCreateExecute(r) +} + +/* +ExtrasJournalEntriesCreate Method for ExtrasJournalEntriesCreate + +Post a list of journal entry objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasJournalEntriesCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesCreate(ctx context.Context) ApiExtrasJournalEntriesCreateRequest { + return ApiExtrasJournalEntriesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return JournalEntry +func (a *ExtrasAPIService) ExtrasJournalEntriesCreateExecute(r ApiExtrasJournalEntriesCreateRequest) (*JournalEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JournalEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableJournalEntryRequest == nil { + return localVarReturnValue, nil, reportError("writableJournalEntryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableJournalEntryRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasJournalEntriesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasJournalEntriesDestroyExecute(r) +} + +/* +ExtrasJournalEntriesDestroy Method for ExtrasJournalEntriesDestroy + +Delete a journal entry object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this journal entry. + @return ApiExtrasJournalEntriesDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesDestroy(ctx context.Context, id int32) ApiExtrasJournalEntriesDestroyRequest { + return ApiExtrasJournalEntriesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasJournalEntriesDestroyExecute(r ApiExtrasJournalEntriesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + assignedObjectId *[]int32 + assignedObjectIdEmpty *bool + assignedObjectIdGt *[]int32 + assignedObjectIdGte *[]int32 + assignedObjectIdLt *[]int32 + assignedObjectIdLte *[]int32 + assignedObjectIdN *[]int32 + assignedObjectType *string + assignedObjectTypeN *string + assignedObjectTypeId *[]int32 + assignedObjectTypeIdN *[]int32 + createdAfter *time.Time + createdBefore *time.Time + createdBy *[]string + createdByN *[]string + createdById *[]*int32 + createdByIdN *[]*int32 + createdByRequest *string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + kind *[]string + kindN *[]string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + q *string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectId(assignedObjectId []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectId = &assignedObjectId + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectIdEmpty(assignedObjectIdEmpty bool) ApiExtrasJournalEntriesListRequest { + r.assignedObjectIdEmpty = &assignedObjectIdEmpty + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectIdGt(assignedObjectIdGt []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectIdGt = &assignedObjectIdGt + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectIdGte(assignedObjectIdGte []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectIdGte = &assignedObjectIdGte + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectIdLt(assignedObjectIdLt []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectIdLt = &assignedObjectIdLt + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectIdLte(assignedObjectIdLte []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectIdLte = &assignedObjectIdLte + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectIdN(assignedObjectIdN []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectIdN = &assignedObjectIdN + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectType(assignedObjectType string) ApiExtrasJournalEntriesListRequest { + r.assignedObjectType = &assignedObjectType + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectTypeN(assignedObjectTypeN string) ApiExtrasJournalEntriesListRequest { + r.assignedObjectTypeN = &assignedObjectTypeN + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectTypeId(assignedObjectTypeId []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectTypeId = &assignedObjectTypeId + return r +} + +func (r ApiExtrasJournalEntriesListRequest) AssignedObjectTypeIdN(assignedObjectTypeIdN []int32) ApiExtrasJournalEntriesListRequest { + r.assignedObjectTypeIdN = &assignedObjectTypeIdN + return r +} + +func (r ApiExtrasJournalEntriesListRequest) CreatedAfter(createdAfter time.Time) ApiExtrasJournalEntriesListRequest { + r.createdAfter = &createdAfter + return r +} + +func (r ApiExtrasJournalEntriesListRequest) CreatedBefore(createdBefore time.Time) ApiExtrasJournalEntriesListRequest { + r.createdBefore = &createdBefore + return r +} + +// User (name) +func (r ApiExtrasJournalEntriesListRequest) CreatedBy(createdBy []string) ApiExtrasJournalEntriesListRequest { + r.createdBy = &createdBy + return r +} + +// User (name) +func (r ApiExtrasJournalEntriesListRequest) CreatedByN(createdByN []string) ApiExtrasJournalEntriesListRequest { + r.createdByN = &createdByN + return r +} + +// User (ID) +func (r ApiExtrasJournalEntriesListRequest) CreatedById(createdById []*int32) ApiExtrasJournalEntriesListRequest { + r.createdById = &createdById + return r +} + +// User (ID) +func (r ApiExtrasJournalEntriesListRequest) CreatedByIdN(createdByIdN []*int32) ApiExtrasJournalEntriesListRequest { + r.createdByIdN = &createdByIdN + return r +} + +func (r ApiExtrasJournalEntriesListRequest) CreatedByRequest(createdByRequest string) ApiExtrasJournalEntriesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiExtrasJournalEntriesListRequest) Id(id []int32) ApiExtrasJournalEntriesListRequest { + r.id = &id + return r +} + +func (r ApiExtrasJournalEntriesListRequest) IdEmpty(idEmpty bool) ApiExtrasJournalEntriesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasJournalEntriesListRequest) IdGt(idGt []int32) ApiExtrasJournalEntriesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasJournalEntriesListRequest) IdGte(idGte []int32) ApiExtrasJournalEntriesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasJournalEntriesListRequest) IdLt(idLt []int32) ApiExtrasJournalEntriesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasJournalEntriesListRequest) IdLte(idLte []int32) ApiExtrasJournalEntriesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasJournalEntriesListRequest) IdN(idN []int32) ApiExtrasJournalEntriesListRequest { + r.idN = &idN + return r +} + +func (r ApiExtrasJournalEntriesListRequest) Kind(kind []string) ApiExtrasJournalEntriesListRequest { + r.kind = &kind + return r +} + +func (r ApiExtrasJournalEntriesListRequest) KindN(kindN []string) ApiExtrasJournalEntriesListRequest { + r.kindN = &kindN + return r +} + +func (r ApiExtrasJournalEntriesListRequest) LastUpdated(lastUpdated []time.Time) ApiExtrasJournalEntriesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiExtrasJournalEntriesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiExtrasJournalEntriesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiExtrasJournalEntriesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiExtrasJournalEntriesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiExtrasJournalEntriesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiExtrasJournalEntriesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiExtrasJournalEntriesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiExtrasJournalEntriesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiExtrasJournalEntriesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiExtrasJournalEntriesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiExtrasJournalEntriesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiExtrasJournalEntriesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiExtrasJournalEntriesListRequest) Limit(limit int32) ApiExtrasJournalEntriesListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasJournalEntriesListRequest) ModifiedByRequest(modifiedByRequest string) ApiExtrasJournalEntriesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasJournalEntriesListRequest) Offset(offset int32) ApiExtrasJournalEntriesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasJournalEntriesListRequest) Ordering(ordering string) ApiExtrasJournalEntriesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasJournalEntriesListRequest) Q(q string) ApiExtrasJournalEntriesListRequest { + r.q = &q + return r +} + +func (r ApiExtrasJournalEntriesListRequest) Tag(tag []string) ApiExtrasJournalEntriesListRequest { + r.tag = &tag + return r +} + +func (r ApiExtrasJournalEntriesListRequest) TagN(tagN []string) ApiExtrasJournalEntriesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiExtrasJournalEntriesListRequest) UpdatedByRequest(updatedByRequest string) ApiExtrasJournalEntriesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiExtrasJournalEntriesListRequest) Execute() (*PaginatedJournalEntryList, *http.Response, error) { + return r.ApiService.ExtrasJournalEntriesListExecute(r) +} + +/* +ExtrasJournalEntriesList Method for ExtrasJournalEntriesList + +Get a list of journal entry objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasJournalEntriesListRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesList(ctx context.Context) ApiExtrasJournalEntriesListRequest { + return ApiExtrasJournalEntriesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedJournalEntryList +func (a *ExtrasAPIService) ExtrasJournalEntriesListExecute(r ApiExtrasJournalEntriesListRequest) (*PaginatedJournalEntryList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedJournalEntryList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.assignedObjectId != nil { + t := *r.assignedObjectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id", t, "multi") + } + } + if r.assignedObjectIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__empty", r.assignedObjectIdEmpty, "") + } + if r.assignedObjectIdGt != nil { + t := *r.assignedObjectIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__gt", t, "multi") + } + } + if r.assignedObjectIdGte != nil { + t := *r.assignedObjectIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__gte", t, "multi") + } + } + if r.assignedObjectIdLt != nil { + t := *r.assignedObjectIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__lt", t, "multi") + } + } + if r.assignedObjectIdLte != nil { + t := *r.assignedObjectIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__lte", t, "multi") + } + } + if r.assignedObjectIdN != nil { + t := *r.assignedObjectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_id__n", t, "multi") + } + } + if r.assignedObjectType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type", r.assignedObjectType, "") + } + if r.assignedObjectTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type__n", r.assignedObjectTypeN, "") + } + if r.assignedObjectTypeId != nil { + t := *r.assignedObjectTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type_id", t, "multi") + } + } + if r.assignedObjectTypeIdN != nil { + t := *r.assignedObjectTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type_id__n", t, "multi") + } + } + if r.createdAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_after", r.createdAfter, "") + } + if r.createdBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_before", r.createdBefore, "") + } + if r.createdBy != nil { + t := *r.createdBy + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by", t, "multi") + } + } + if r.createdByN != nil { + t := *r.createdByN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by__n", t, "multi") + } + } + if r.createdById != nil { + t := *r.createdById + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_id", t, "multi") + } + } + if r.createdByIdN != nil { + t := *r.createdByIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_id__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.kind != nil { + t := *r.kind + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "kind", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "kind", t, "multi") + } + } + if r.kindN != nil { + t := *r.kindN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "kind__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "kind__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWritableJournalEntryRequest *PatchedWritableJournalEntryRequest +} + +func (r ApiExtrasJournalEntriesPartialUpdateRequest) PatchedWritableJournalEntryRequest(patchedWritableJournalEntryRequest PatchedWritableJournalEntryRequest) ApiExtrasJournalEntriesPartialUpdateRequest { + r.patchedWritableJournalEntryRequest = &patchedWritableJournalEntryRequest + return r +} + +func (r ApiExtrasJournalEntriesPartialUpdateRequest) Execute() (*JournalEntry, *http.Response, error) { + return r.ApiService.ExtrasJournalEntriesPartialUpdateExecute(r) +} + +/* +ExtrasJournalEntriesPartialUpdate Method for ExtrasJournalEntriesPartialUpdate + +Patch a journal entry object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this journal entry. + @return ApiExtrasJournalEntriesPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesPartialUpdate(ctx context.Context, id int32) ApiExtrasJournalEntriesPartialUpdateRequest { + return ApiExtrasJournalEntriesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return JournalEntry +func (a *ExtrasAPIService) ExtrasJournalEntriesPartialUpdateExecute(r ApiExtrasJournalEntriesPartialUpdateRequest) (*JournalEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JournalEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableJournalEntryRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasJournalEntriesRetrieveRequest) Execute() (*JournalEntry, *http.Response, error) { + return r.ApiService.ExtrasJournalEntriesRetrieveExecute(r) +} + +/* +ExtrasJournalEntriesRetrieve Method for ExtrasJournalEntriesRetrieve + +Get a journal entry object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this journal entry. + @return ApiExtrasJournalEntriesRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesRetrieve(ctx context.Context, id int32) ApiExtrasJournalEntriesRetrieveRequest { + return ApiExtrasJournalEntriesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return JournalEntry +func (a *ExtrasAPIService) ExtrasJournalEntriesRetrieveExecute(r ApiExtrasJournalEntriesRetrieveRequest) (*JournalEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JournalEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasJournalEntriesUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + writableJournalEntryRequest *WritableJournalEntryRequest +} + +func (r ApiExtrasJournalEntriesUpdateRequest) WritableJournalEntryRequest(writableJournalEntryRequest WritableJournalEntryRequest) ApiExtrasJournalEntriesUpdateRequest { + r.writableJournalEntryRequest = &writableJournalEntryRequest + return r +} + +func (r ApiExtrasJournalEntriesUpdateRequest) Execute() (*JournalEntry, *http.Response, error) { + return r.ApiService.ExtrasJournalEntriesUpdateExecute(r) +} + +/* +ExtrasJournalEntriesUpdate Method for ExtrasJournalEntriesUpdate + +Put a journal entry object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this journal entry. + @return ApiExtrasJournalEntriesUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasJournalEntriesUpdate(ctx context.Context, id int32) ApiExtrasJournalEntriesUpdateRequest { + return ApiExtrasJournalEntriesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return JournalEntry +func (a *ExtrasAPIService) ExtrasJournalEntriesUpdateExecute(r ApiExtrasJournalEntriesUpdateRequest) (*JournalEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JournalEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasJournalEntriesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/journal-entries/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableJournalEntryRequest == nil { + return localVarReturnValue, nil, reportError("writableJournalEntryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableJournalEntryRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasObjectChangesListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + action *string + actionN *string + changedObjectId *[]int32 + changedObjectIdEmpty *bool + changedObjectIdGt *[]int32 + changedObjectIdGte *[]int32 + changedObjectIdLt *[]int32 + changedObjectIdLte *[]int32 + changedObjectIdN *[]int32 + changedObjectType *string + changedObjectTypeN *string + changedObjectTypeId *[]int32 + changedObjectTypeIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + objectRepr *[]string + objectReprEmpty *bool + objectReprIc *[]string + objectReprIe *[]string + objectReprIew *[]string + objectReprIsw *[]string + objectReprN *[]string + objectReprNic *[]string + objectReprNie *[]string + objectReprNiew *[]string + objectReprNisw *[]string + offset *int32 + ordering *string + q *string + requestId *string + timeAfter *time.Time + timeBefore *time.Time + user *[]string + userN *[]string + userId *[]*int32 + userIdN *[]*int32 + userName *[]string + userNameEmpty *bool + userNameIc *[]string + userNameIe *[]string + userNameIew *[]string + userNameIsw *[]string + userNameN *[]string + userNameNic *[]string + userNameNie *[]string + userNameNiew *[]string + userNameNisw *[]string +} + +func (r ApiExtrasObjectChangesListRequest) Action(action string) ApiExtrasObjectChangesListRequest { + r.action = &action + return r +} + +func (r ApiExtrasObjectChangesListRequest) ActionN(actionN string) ApiExtrasObjectChangesListRequest { + r.actionN = &actionN + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectId(changedObjectId []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectId = &changedObjectId + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectIdEmpty(changedObjectIdEmpty bool) ApiExtrasObjectChangesListRequest { + r.changedObjectIdEmpty = &changedObjectIdEmpty + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectIdGt(changedObjectIdGt []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectIdGt = &changedObjectIdGt + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectIdGte(changedObjectIdGte []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectIdGte = &changedObjectIdGte + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectIdLt(changedObjectIdLt []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectIdLt = &changedObjectIdLt + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectIdLte(changedObjectIdLte []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectIdLte = &changedObjectIdLte + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectIdN(changedObjectIdN []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectIdN = &changedObjectIdN + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectType(changedObjectType string) ApiExtrasObjectChangesListRequest { + r.changedObjectType = &changedObjectType + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectTypeN(changedObjectTypeN string) ApiExtrasObjectChangesListRequest { + r.changedObjectTypeN = &changedObjectTypeN + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectTypeId(changedObjectTypeId []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectTypeId = &changedObjectTypeId + return r +} + +func (r ApiExtrasObjectChangesListRequest) ChangedObjectTypeIdN(changedObjectTypeIdN []int32) ApiExtrasObjectChangesListRequest { + r.changedObjectTypeIdN = &changedObjectTypeIdN + return r +} + +func (r ApiExtrasObjectChangesListRequest) Id(id []int32) ApiExtrasObjectChangesListRequest { + r.id = &id + return r +} + +func (r ApiExtrasObjectChangesListRequest) IdEmpty(idEmpty bool) ApiExtrasObjectChangesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasObjectChangesListRequest) IdGt(idGt []int32) ApiExtrasObjectChangesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasObjectChangesListRequest) IdGte(idGte []int32) ApiExtrasObjectChangesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasObjectChangesListRequest) IdLt(idLt []int32) ApiExtrasObjectChangesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasObjectChangesListRequest) IdLte(idLte []int32) ApiExtrasObjectChangesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasObjectChangesListRequest) IdN(idN []int32) ApiExtrasObjectChangesListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasObjectChangesListRequest) Limit(limit int32) ApiExtrasObjectChangesListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectRepr(objectRepr []string) ApiExtrasObjectChangesListRequest { + r.objectRepr = &objectRepr + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprEmpty(objectReprEmpty bool) ApiExtrasObjectChangesListRequest { + r.objectReprEmpty = &objectReprEmpty + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprIc(objectReprIc []string) ApiExtrasObjectChangesListRequest { + r.objectReprIc = &objectReprIc + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprIe(objectReprIe []string) ApiExtrasObjectChangesListRequest { + r.objectReprIe = &objectReprIe + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprIew(objectReprIew []string) ApiExtrasObjectChangesListRequest { + r.objectReprIew = &objectReprIew + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprIsw(objectReprIsw []string) ApiExtrasObjectChangesListRequest { + r.objectReprIsw = &objectReprIsw + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprN(objectReprN []string) ApiExtrasObjectChangesListRequest { + r.objectReprN = &objectReprN + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprNic(objectReprNic []string) ApiExtrasObjectChangesListRequest { + r.objectReprNic = &objectReprNic + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprNie(objectReprNie []string) ApiExtrasObjectChangesListRequest { + r.objectReprNie = &objectReprNie + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprNiew(objectReprNiew []string) ApiExtrasObjectChangesListRequest { + r.objectReprNiew = &objectReprNiew + return r +} + +func (r ApiExtrasObjectChangesListRequest) ObjectReprNisw(objectReprNisw []string) ApiExtrasObjectChangesListRequest { + r.objectReprNisw = &objectReprNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasObjectChangesListRequest) Offset(offset int32) ApiExtrasObjectChangesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasObjectChangesListRequest) Ordering(ordering string) ApiExtrasObjectChangesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasObjectChangesListRequest) Q(q string) ApiExtrasObjectChangesListRequest { + r.q = &q + return r +} + +func (r ApiExtrasObjectChangesListRequest) RequestId(requestId string) ApiExtrasObjectChangesListRequest { + r.requestId = &requestId + return r +} + +func (r ApiExtrasObjectChangesListRequest) TimeAfter(timeAfter time.Time) ApiExtrasObjectChangesListRequest { + r.timeAfter = &timeAfter + return r +} + +func (r ApiExtrasObjectChangesListRequest) TimeBefore(timeBefore time.Time) ApiExtrasObjectChangesListRequest { + r.timeBefore = &timeBefore + return r +} + +// User name +func (r ApiExtrasObjectChangesListRequest) User(user []string) ApiExtrasObjectChangesListRequest { + r.user = &user + return r +} + +// User name +func (r ApiExtrasObjectChangesListRequest) UserN(userN []string) ApiExtrasObjectChangesListRequest { + r.userN = &userN + return r +} + +// User (ID) +func (r ApiExtrasObjectChangesListRequest) UserId(userId []*int32) ApiExtrasObjectChangesListRequest { + r.userId = &userId + return r +} + +// User (ID) +func (r ApiExtrasObjectChangesListRequest) UserIdN(userIdN []*int32) ApiExtrasObjectChangesListRequest { + r.userIdN = &userIdN + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserName(userName []string) ApiExtrasObjectChangesListRequest { + r.userName = &userName + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameEmpty(userNameEmpty bool) ApiExtrasObjectChangesListRequest { + r.userNameEmpty = &userNameEmpty + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameIc(userNameIc []string) ApiExtrasObjectChangesListRequest { + r.userNameIc = &userNameIc + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameIe(userNameIe []string) ApiExtrasObjectChangesListRequest { + r.userNameIe = &userNameIe + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameIew(userNameIew []string) ApiExtrasObjectChangesListRequest { + r.userNameIew = &userNameIew + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameIsw(userNameIsw []string) ApiExtrasObjectChangesListRequest { + r.userNameIsw = &userNameIsw + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameN(userNameN []string) ApiExtrasObjectChangesListRequest { + r.userNameN = &userNameN + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameNic(userNameNic []string) ApiExtrasObjectChangesListRequest { + r.userNameNic = &userNameNic + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameNie(userNameNie []string) ApiExtrasObjectChangesListRequest { + r.userNameNie = &userNameNie + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameNiew(userNameNiew []string) ApiExtrasObjectChangesListRequest { + r.userNameNiew = &userNameNiew + return r +} + +func (r ApiExtrasObjectChangesListRequest) UserNameNisw(userNameNisw []string) ApiExtrasObjectChangesListRequest { + r.userNameNisw = &userNameNisw + return r +} + +func (r ApiExtrasObjectChangesListRequest) Execute() (*PaginatedObjectChangeList, *http.Response, error) { + return r.ApiService.ExtrasObjectChangesListExecute(r) +} + +/* +ExtrasObjectChangesList Method for ExtrasObjectChangesList + +Retrieve a list of recent changes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasObjectChangesListRequest +*/ +func (a *ExtrasAPIService) ExtrasObjectChangesList(ctx context.Context) ApiExtrasObjectChangesListRequest { + return ApiExtrasObjectChangesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedObjectChangeList +func (a *ExtrasAPIService) ExtrasObjectChangesListExecute(r ApiExtrasObjectChangesListRequest) (*PaginatedObjectChangeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedObjectChangeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasObjectChangesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/object-changes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "") + } + if r.actionN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action__n", r.actionN, "") + } + if r.changedObjectId != nil { + t := *r.changedObjectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id", t, "multi") + } + } + if r.changedObjectIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__empty", r.changedObjectIdEmpty, "") + } + if r.changedObjectIdGt != nil { + t := *r.changedObjectIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__gt", t, "multi") + } + } + if r.changedObjectIdGte != nil { + t := *r.changedObjectIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__gte", t, "multi") + } + } + if r.changedObjectIdLt != nil { + t := *r.changedObjectIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__lt", t, "multi") + } + } + if r.changedObjectIdLte != nil { + t := *r.changedObjectIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__lte", t, "multi") + } + } + if r.changedObjectIdN != nil { + t := *r.changedObjectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_id__n", t, "multi") + } + } + if r.changedObjectType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_type", r.changedObjectType, "") + } + if r.changedObjectTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_type__n", r.changedObjectTypeN, "") + } + if r.changedObjectTypeId != nil { + t := *r.changedObjectTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_type_id", t, "multi") + } + } + if r.changedObjectTypeIdN != nil { + t := *r.changedObjectTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "changed_object_type_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.objectRepr != nil { + t := *r.objectRepr + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr", t, "multi") + } + } + if r.objectReprEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__empty", r.objectReprEmpty, "") + } + if r.objectReprIc != nil { + t := *r.objectReprIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__ic", t, "multi") + } + } + if r.objectReprIe != nil { + t := *r.objectReprIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__ie", t, "multi") + } + } + if r.objectReprIew != nil { + t := *r.objectReprIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__iew", t, "multi") + } + } + if r.objectReprIsw != nil { + t := *r.objectReprIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__isw", t, "multi") + } + } + if r.objectReprN != nil { + t := *r.objectReprN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__n", t, "multi") + } + } + if r.objectReprNic != nil { + t := *r.objectReprNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__nic", t, "multi") + } + } + if r.objectReprNie != nil { + t := *r.objectReprNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__nie", t, "multi") + } + } + if r.objectReprNiew != nil { + t := *r.objectReprNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__niew", t, "multi") + } + } + if r.objectReprNisw != nil { + t := *r.objectReprNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_repr__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.requestId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "request_id", r.requestId, "") + } + if r.timeAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "time_after", r.timeAfter, "") + } + if r.timeBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "time_before", r.timeBefore, "") + } + if r.user != nil { + t := *r.user + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", t, "multi") + } + } + if r.userN != nil { + t := *r.userN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", t, "multi") + } + } + if r.userId != nil { + t := *r.userId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", t, "multi") + } + } + if r.userIdN != nil { + t := *r.userIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", t, "multi") + } + } + if r.userName != nil { + t := *r.userName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name", t, "multi") + } + } + if r.userNameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__empty", r.userNameEmpty, "") + } + if r.userNameIc != nil { + t := *r.userNameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__ic", t, "multi") + } + } + if r.userNameIe != nil { + t := *r.userNameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__ie", t, "multi") + } + } + if r.userNameIew != nil { + t := *r.userNameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__iew", t, "multi") + } + } + if r.userNameIsw != nil { + t := *r.userNameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__isw", t, "multi") + } + } + if r.userNameN != nil { + t := *r.userNameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__n", t, "multi") + } + } + if r.userNameNic != nil { + t := *r.userNameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__nic", t, "multi") + } + } + if r.userNameNie != nil { + t := *r.userNameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__nie", t, "multi") + } + } + if r.userNameNiew != nil { + t := *r.userNameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__niew", t, "multi") + } + } + if r.userNameNisw != nil { + t := *r.userNameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_name__nisw", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasObjectChangesRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasObjectChangesRetrieveRequest) Execute() (*ObjectChange, *http.Response, error) { + return r.ApiService.ExtrasObjectChangesRetrieveExecute(r) +} + +/* +ExtrasObjectChangesRetrieve Method for ExtrasObjectChangesRetrieve + +Retrieve a list of recent changes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this object change. + @return ApiExtrasObjectChangesRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasObjectChangesRetrieve(ctx context.Context, id int32) ApiExtrasObjectChangesRetrieveRequest { + return ApiExtrasObjectChangesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ObjectChange +func (a *ExtrasAPIService) ExtrasObjectChangesRetrieveExecute(r ApiExtrasObjectChangesRetrieveRequest) (*ObjectChange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ObjectChange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasObjectChangesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/object-changes/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + savedFilterRequest *[]SavedFilterRequest +} + +func (r ApiExtrasSavedFiltersBulkDestroyRequest) SavedFilterRequest(savedFilterRequest []SavedFilterRequest) ApiExtrasSavedFiltersBulkDestroyRequest { + r.savedFilterRequest = &savedFilterRequest + return r +} + +func (r ApiExtrasSavedFiltersBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasSavedFiltersBulkDestroyExecute(r) +} + +/* +ExtrasSavedFiltersBulkDestroy Method for ExtrasSavedFiltersBulkDestroy + +Delete a list of saved filter objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasSavedFiltersBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersBulkDestroy(ctx context.Context) ApiExtrasSavedFiltersBulkDestroyRequest { + return ApiExtrasSavedFiltersBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasSavedFiltersBulkDestroyExecute(r ApiExtrasSavedFiltersBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.savedFilterRequest == nil { + return nil, reportError("savedFilterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.savedFilterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + savedFilterRequest *[]SavedFilterRequest +} + +func (r ApiExtrasSavedFiltersBulkPartialUpdateRequest) SavedFilterRequest(savedFilterRequest []SavedFilterRequest) ApiExtrasSavedFiltersBulkPartialUpdateRequest { + r.savedFilterRequest = &savedFilterRequest + return r +} + +func (r ApiExtrasSavedFiltersBulkPartialUpdateRequest) Execute() ([]SavedFilter, *http.Response, error) { + return r.ApiService.ExtrasSavedFiltersBulkPartialUpdateExecute(r) +} + +/* +ExtrasSavedFiltersBulkPartialUpdate Method for ExtrasSavedFiltersBulkPartialUpdate + +Patch a list of saved filter objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasSavedFiltersBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersBulkPartialUpdate(ctx context.Context) ApiExtrasSavedFiltersBulkPartialUpdateRequest { + return ApiExtrasSavedFiltersBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []SavedFilter +func (a *ExtrasAPIService) ExtrasSavedFiltersBulkPartialUpdateExecute(r ApiExtrasSavedFiltersBulkPartialUpdateRequest) ([]SavedFilter, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []SavedFilter + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.savedFilterRequest == nil { + return localVarReturnValue, nil, reportError("savedFilterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.savedFilterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + savedFilterRequest *[]SavedFilterRequest +} + +func (r ApiExtrasSavedFiltersBulkUpdateRequest) SavedFilterRequest(savedFilterRequest []SavedFilterRequest) ApiExtrasSavedFiltersBulkUpdateRequest { + r.savedFilterRequest = &savedFilterRequest + return r +} + +func (r ApiExtrasSavedFiltersBulkUpdateRequest) Execute() ([]SavedFilter, *http.Response, error) { + return r.ApiService.ExtrasSavedFiltersBulkUpdateExecute(r) +} + +/* +ExtrasSavedFiltersBulkUpdate Method for ExtrasSavedFiltersBulkUpdate + +Put a list of saved filter objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasSavedFiltersBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersBulkUpdate(ctx context.Context) ApiExtrasSavedFiltersBulkUpdateRequest { + return ApiExtrasSavedFiltersBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []SavedFilter +func (a *ExtrasAPIService) ExtrasSavedFiltersBulkUpdateExecute(r ApiExtrasSavedFiltersBulkUpdateRequest) ([]SavedFilter, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []SavedFilter + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.savedFilterRequest == nil { + return localVarReturnValue, nil, reportError("savedFilterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.savedFilterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + savedFilterRequest *SavedFilterRequest +} + +func (r ApiExtrasSavedFiltersCreateRequest) SavedFilterRequest(savedFilterRequest SavedFilterRequest) ApiExtrasSavedFiltersCreateRequest { + r.savedFilterRequest = &savedFilterRequest + return r +} + +func (r ApiExtrasSavedFiltersCreateRequest) Execute() (*SavedFilter, *http.Response, error) { + return r.ApiService.ExtrasSavedFiltersCreateExecute(r) +} + +/* +ExtrasSavedFiltersCreate Method for ExtrasSavedFiltersCreate + +Post a list of saved filter objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasSavedFiltersCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersCreate(ctx context.Context) ApiExtrasSavedFiltersCreateRequest { + return ApiExtrasSavedFiltersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SavedFilter +func (a *ExtrasAPIService) ExtrasSavedFiltersCreateExecute(r ApiExtrasSavedFiltersCreateRequest) (*SavedFilter, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SavedFilter + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.savedFilterRequest == nil { + return localVarReturnValue, nil, reportError("savedFilterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.savedFilterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasSavedFiltersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasSavedFiltersDestroyExecute(r) +} + +/* +ExtrasSavedFiltersDestroy Method for ExtrasSavedFiltersDestroy + +Delete a saved filter object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this saved filter. + @return ApiExtrasSavedFiltersDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersDestroy(ctx context.Context, id int32) ApiExtrasSavedFiltersDestroyRequest { + return ApiExtrasSavedFiltersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasSavedFiltersDestroyExecute(r ApiExtrasSavedFiltersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + contentTypeId *[]int32 + contentTypeIdEmpty *[]int32 + contentTypeIdGt *[]int32 + contentTypeIdGte *[]int32 + contentTypeIdLt *[]int32 + contentTypeIdLte *[]int32 + contentTypeIdN *[]int32 + contentTypes *string + contentTypesIc *string + contentTypesIe *string + contentTypesIew *string + contentTypesIsw *string + contentTypesN *string + contentTypesNic *string + contentTypesNie *string + contentTypesNiew *string + contentTypesNisw *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + enabled *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + shared *bool + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + usable *bool + user *[]string + userN *[]string + userId *[]*int32 + userIdN *[]*int32 + weight *[]int32 + weightEmpty *bool + weightGt *[]int32 + weightGte *[]int32 + weightLt *[]int32 + weightLte *[]int32 + weightN *[]int32 +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypeId(contentTypeId []int32) ApiExtrasSavedFiltersListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypeIdEmpty(contentTypeIdEmpty []int32) ApiExtrasSavedFiltersListRequest { + r.contentTypeIdEmpty = &contentTypeIdEmpty + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypeIdGt(contentTypeIdGt []int32) ApiExtrasSavedFiltersListRequest { + r.contentTypeIdGt = &contentTypeIdGt + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypeIdGte(contentTypeIdGte []int32) ApiExtrasSavedFiltersListRequest { + r.contentTypeIdGte = &contentTypeIdGte + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypeIdLt(contentTypeIdLt []int32) ApiExtrasSavedFiltersListRequest { + r.contentTypeIdLt = &contentTypeIdLt + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypeIdLte(contentTypeIdLte []int32) ApiExtrasSavedFiltersListRequest { + r.contentTypeIdLte = &contentTypeIdLte + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypeIdN(contentTypeIdN []int32) ApiExtrasSavedFiltersListRequest { + r.contentTypeIdN = &contentTypeIdN + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypes(contentTypes string) ApiExtrasSavedFiltersListRequest { + r.contentTypes = &contentTypes + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesIc(contentTypesIc string) ApiExtrasSavedFiltersListRequest { + r.contentTypesIc = &contentTypesIc + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesIe(contentTypesIe string) ApiExtrasSavedFiltersListRequest { + r.contentTypesIe = &contentTypesIe + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesIew(contentTypesIew string) ApiExtrasSavedFiltersListRequest { + r.contentTypesIew = &contentTypesIew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesIsw(contentTypesIsw string) ApiExtrasSavedFiltersListRequest { + r.contentTypesIsw = &contentTypesIsw + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesN(contentTypesN string) ApiExtrasSavedFiltersListRequest { + r.contentTypesN = &contentTypesN + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesNic(contentTypesNic string) ApiExtrasSavedFiltersListRequest { + r.contentTypesNic = &contentTypesNic + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesNie(contentTypesNie string) ApiExtrasSavedFiltersListRequest { + r.contentTypesNie = &contentTypesNie + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesNiew(contentTypesNiew string) ApiExtrasSavedFiltersListRequest { + r.contentTypesNiew = &contentTypesNiew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) ContentTypesNisw(contentTypesNisw string) ApiExtrasSavedFiltersListRequest { + r.contentTypesNisw = &contentTypesNisw + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Description(description []string) ApiExtrasSavedFiltersListRequest { + r.description = &description + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasSavedFiltersListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionIc(descriptionIc []string) ApiExtrasSavedFiltersListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionIe(descriptionIe []string) ApiExtrasSavedFiltersListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionIew(descriptionIew []string) ApiExtrasSavedFiltersListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasSavedFiltersListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionN(descriptionN []string) ApiExtrasSavedFiltersListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionNic(descriptionNic []string) ApiExtrasSavedFiltersListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionNie(descriptionNie []string) ApiExtrasSavedFiltersListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasSavedFiltersListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasSavedFiltersListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Enabled(enabled bool) ApiExtrasSavedFiltersListRequest { + r.enabled = &enabled + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Id(id []int32) ApiExtrasSavedFiltersListRequest { + r.id = &id + return r +} + +func (r ApiExtrasSavedFiltersListRequest) IdEmpty(idEmpty bool) ApiExtrasSavedFiltersListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasSavedFiltersListRequest) IdGt(idGt []int32) ApiExtrasSavedFiltersListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasSavedFiltersListRequest) IdGte(idGte []int32) ApiExtrasSavedFiltersListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasSavedFiltersListRequest) IdLt(idLt []int32) ApiExtrasSavedFiltersListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasSavedFiltersListRequest) IdLte(idLte []int32) ApiExtrasSavedFiltersListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasSavedFiltersListRequest) IdN(idN []int32) ApiExtrasSavedFiltersListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiExtrasSavedFiltersListRequest) Limit(limit int32) ApiExtrasSavedFiltersListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Name(name []string) ApiExtrasSavedFiltersListRequest { + r.name = &name + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameEmpty(nameEmpty bool) ApiExtrasSavedFiltersListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameIc(nameIc []string) ApiExtrasSavedFiltersListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameIe(nameIe []string) ApiExtrasSavedFiltersListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameIew(nameIew []string) ApiExtrasSavedFiltersListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameIsw(nameIsw []string) ApiExtrasSavedFiltersListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameN(nameN []string) ApiExtrasSavedFiltersListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameNic(nameNic []string) ApiExtrasSavedFiltersListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameNie(nameNie []string) ApiExtrasSavedFiltersListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameNiew(nameNiew []string) ApiExtrasSavedFiltersListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) NameNisw(nameNisw []string) ApiExtrasSavedFiltersListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasSavedFiltersListRequest) Offset(offset int32) ApiExtrasSavedFiltersListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasSavedFiltersListRequest) Ordering(ordering string) ApiExtrasSavedFiltersListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasSavedFiltersListRequest) Q(q string) ApiExtrasSavedFiltersListRequest { + r.q = &q + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Shared(shared bool) ApiExtrasSavedFiltersListRequest { + r.shared = &shared + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Slug(slug []string) ApiExtrasSavedFiltersListRequest { + r.slug = &slug + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugEmpty(slugEmpty bool) ApiExtrasSavedFiltersListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugIc(slugIc []string) ApiExtrasSavedFiltersListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugIe(slugIe []string) ApiExtrasSavedFiltersListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugIew(slugIew []string) ApiExtrasSavedFiltersListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugIsw(slugIsw []string) ApiExtrasSavedFiltersListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugN(slugN []string) ApiExtrasSavedFiltersListRequest { + r.slugN = &slugN + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugNic(slugNic []string) ApiExtrasSavedFiltersListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugNie(slugNie []string) ApiExtrasSavedFiltersListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugNiew(slugNiew []string) ApiExtrasSavedFiltersListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiExtrasSavedFiltersListRequest) SlugNisw(slugNisw []string) ApiExtrasSavedFiltersListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Usable(usable bool) ApiExtrasSavedFiltersListRequest { + r.usable = &usable + return r +} + +// User (name) +func (r ApiExtrasSavedFiltersListRequest) User(user []string) ApiExtrasSavedFiltersListRequest { + r.user = &user + return r +} + +// User (name) +func (r ApiExtrasSavedFiltersListRequest) UserN(userN []string) ApiExtrasSavedFiltersListRequest { + r.userN = &userN + return r +} + +// User (ID) +func (r ApiExtrasSavedFiltersListRequest) UserId(userId []*int32) ApiExtrasSavedFiltersListRequest { + r.userId = &userId + return r +} + +// User (ID) +func (r ApiExtrasSavedFiltersListRequest) UserIdN(userIdN []*int32) ApiExtrasSavedFiltersListRequest { + r.userIdN = &userIdN + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Weight(weight []int32) ApiExtrasSavedFiltersListRequest { + r.weight = &weight + return r +} + +func (r ApiExtrasSavedFiltersListRequest) WeightEmpty(weightEmpty bool) ApiExtrasSavedFiltersListRequest { + r.weightEmpty = &weightEmpty + return r +} + +func (r ApiExtrasSavedFiltersListRequest) WeightGt(weightGt []int32) ApiExtrasSavedFiltersListRequest { + r.weightGt = &weightGt + return r +} + +func (r ApiExtrasSavedFiltersListRequest) WeightGte(weightGte []int32) ApiExtrasSavedFiltersListRequest { + r.weightGte = &weightGte + return r +} + +func (r ApiExtrasSavedFiltersListRequest) WeightLt(weightLt []int32) ApiExtrasSavedFiltersListRequest { + r.weightLt = &weightLt + return r +} + +func (r ApiExtrasSavedFiltersListRequest) WeightLte(weightLte []int32) ApiExtrasSavedFiltersListRequest { + r.weightLte = &weightLte + return r +} + +func (r ApiExtrasSavedFiltersListRequest) WeightN(weightN []int32) ApiExtrasSavedFiltersListRequest { + r.weightN = &weightN + return r +} + +func (r ApiExtrasSavedFiltersListRequest) Execute() (*PaginatedSavedFilterList, *http.Response, error) { + return r.ApiService.ExtrasSavedFiltersListExecute(r) +} + +/* +ExtrasSavedFiltersList Method for ExtrasSavedFiltersList + +Get a list of saved filter objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasSavedFiltersListRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersList(ctx context.Context) ApiExtrasSavedFiltersListRequest { + return ApiExtrasSavedFiltersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSavedFilterList +func (a *ExtrasAPIService) ExtrasSavedFiltersListExecute(r ApiExtrasSavedFiltersListRequest) (*PaginatedSavedFilterList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSavedFilterList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contentTypeId != nil { + t := *r.contentTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", t, "multi") + } + } + if r.contentTypeIdEmpty != nil { + t := *r.contentTypeIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__empty", t, "multi") + } + } + if r.contentTypeIdGt != nil { + t := *r.contentTypeIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gt", t, "multi") + } + } + if r.contentTypeIdGte != nil { + t := *r.contentTypeIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__gte", t, "multi") + } + } + if r.contentTypeIdLt != nil { + t := *r.contentTypeIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lt", t, "multi") + } + } + if r.contentTypeIdLte != nil { + t := *r.contentTypeIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__lte", t, "multi") + } + } + if r.contentTypeIdN != nil { + t := *r.contentTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", t, "multi") + } + } + if r.contentTypes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types", r.contentTypes, "") + } + if r.contentTypesIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ic", r.contentTypesIc, "") + } + if r.contentTypesIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__ie", r.contentTypesIe, "") + } + if r.contentTypesIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__iew", r.contentTypesIew, "") + } + if r.contentTypesIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__isw", r.contentTypesIsw, "") + } + if r.contentTypesN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__n", r.contentTypesN, "") + } + if r.contentTypesNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nic", r.contentTypesNic, "") + } + if r.contentTypesNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nie", r.contentTypesNie, "") + } + if r.contentTypesNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__niew", r.contentTypesNiew, "") + } + if r.contentTypesNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_types__nisw", r.contentTypesNisw, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.shared != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "shared", r.shared, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.usable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "usable", r.usable, "") + } + if r.user != nil { + t := *r.user + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", t, "multi") + } + } + if r.userN != nil { + t := *r.userN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", t, "multi") + } + } + if r.userId != nil { + t := *r.userId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", t, "multi") + } + } + if r.userIdN != nil { + t := *r.userIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", t, "multi") + } + } + if r.weight != nil { + t := *r.weight + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight", t, "multi") + } + } + if r.weightEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__empty", r.weightEmpty, "") + } + if r.weightGt != nil { + t := *r.weightGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gt", t, "multi") + } + } + if r.weightGte != nil { + t := *r.weightGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__gte", t, "multi") + } + } + if r.weightLt != nil { + t := *r.weightLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lt", t, "multi") + } + } + if r.weightLte != nil { + t := *r.weightLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__lte", t, "multi") + } + } + if r.weightN != nil { + t := *r.weightN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "weight__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedSavedFilterRequest *PatchedSavedFilterRequest +} + +func (r ApiExtrasSavedFiltersPartialUpdateRequest) PatchedSavedFilterRequest(patchedSavedFilterRequest PatchedSavedFilterRequest) ApiExtrasSavedFiltersPartialUpdateRequest { + r.patchedSavedFilterRequest = &patchedSavedFilterRequest + return r +} + +func (r ApiExtrasSavedFiltersPartialUpdateRequest) Execute() (*SavedFilter, *http.Response, error) { + return r.ApiService.ExtrasSavedFiltersPartialUpdateExecute(r) +} + +/* +ExtrasSavedFiltersPartialUpdate Method for ExtrasSavedFiltersPartialUpdate + +Patch a saved filter object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this saved filter. + @return ApiExtrasSavedFiltersPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersPartialUpdate(ctx context.Context, id int32) ApiExtrasSavedFiltersPartialUpdateRequest { + return ApiExtrasSavedFiltersPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SavedFilter +func (a *ExtrasAPIService) ExtrasSavedFiltersPartialUpdateExecute(r ApiExtrasSavedFiltersPartialUpdateRequest) (*SavedFilter, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SavedFilter + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSavedFilterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasSavedFiltersRetrieveRequest) Execute() (*SavedFilter, *http.Response, error) { + return r.ApiService.ExtrasSavedFiltersRetrieveExecute(r) +} + +/* +ExtrasSavedFiltersRetrieve Method for ExtrasSavedFiltersRetrieve + +Get a saved filter object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this saved filter. + @return ApiExtrasSavedFiltersRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersRetrieve(ctx context.Context, id int32) ApiExtrasSavedFiltersRetrieveRequest { + return ApiExtrasSavedFiltersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SavedFilter +func (a *ExtrasAPIService) ExtrasSavedFiltersRetrieveExecute(r ApiExtrasSavedFiltersRetrieveRequest) (*SavedFilter, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SavedFilter + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasSavedFiltersUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + savedFilterRequest *SavedFilterRequest +} + +func (r ApiExtrasSavedFiltersUpdateRequest) SavedFilterRequest(savedFilterRequest SavedFilterRequest) ApiExtrasSavedFiltersUpdateRequest { + r.savedFilterRequest = &savedFilterRequest + return r +} + +func (r ApiExtrasSavedFiltersUpdateRequest) Execute() (*SavedFilter, *http.Response, error) { + return r.ApiService.ExtrasSavedFiltersUpdateExecute(r) +} + +/* +ExtrasSavedFiltersUpdate Method for ExtrasSavedFiltersUpdate + +Put a saved filter object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this saved filter. + @return ApiExtrasSavedFiltersUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasSavedFiltersUpdate(ctx context.Context, id int32) ApiExtrasSavedFiltersUpdateRequest { + return ApiExtrasSavedFiltersUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SavedFilter +func (a *ExtrasAPIService) ExtrasSavedFiltersUpdateExecute(r ApiExtrasSavedFiltersUpdateRequest) (*SavedFilter, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SavedFilter + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasSavedFiltersUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/saved-filters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.savedFilterRequest == nil { + return localVarReturnValue, nil, reportError("savedFilterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.savedFilterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasTagsBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + tagRequest *[]TagRequest +} + +func (r ApiExtrasTagsBulkDestroyRequest) TagRequest(tagRequest []TagRequest) ApiExtrasTagsBulkDestroyRequest { + r.tagRequest = &tagRequest + return r +} + +func (r ApiExtrasTagsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasTagsBulkDestroyExecute(r) +} + +/* +ExtrasTagsBulkDestroy Method for ExtrasTagsBulkDestroy + +Delete a list of tag objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasTagsBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsBulkDestroy(ctx context.Context) ApiExtrasTagsBulkDestroyRequest { + return ApiExtrasTagsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasTagsBulkDestroyExecute(r ApiExtrasTagsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tagRequest == nil { + return nil, reportError("tagRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tagRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasTagsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + tagRequest *[]TagRequest +} + +func (r ApiExtrasTagsBulkPartialUpdateRequest) TagRequest(tagRequest []TagRequest) ApiExtrasTagsBulkPartialUpdateRequest { + r.tagRequest = &tagRequest + return r +} + +func (r ApiExtrasTagsBulkPartialUpdateRequest) Execute() ([]Tag, *http.Response, error) { + return r.ApiService.ExtrasTagsBulkPartialUpdateExecute(r) +} + +/* +ExtrasTagsBulkPartialUpdate Method for ExtrasTagsBulkPartialUpdate + +Patch a list of tag objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasTagsBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsBulkPartialUpdate(ctx context.Context) ApiExtrasTagsBulkPartialUpdateRequest { + return ApiExtrasTagsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Tag +func (a *ExtrasAPIService) ExtrasTagsBulkPartialUpdateExecute(r ApiExtrasTagsBulkPartialUpdateRequest) ([]Tag, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Tag + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tagRequest == nil { + return localVarReturnValue, nil, reportError("tagRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tagRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasTagsBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + tagRequest *[]TagRequest +} + +func (r ApiExtrasTagsBulkUpdateRequest) TagRequest(tagRequest []TagRequest) ApiExtrasTagsBulkUpdateRequest { + r.tagRequest = &tagRequest + return r +} + +func (r ApiExtrasTagsBulkUpdateRequest) Execute() ([]Tag, *http.Response, error) { + return r.ApiService.ExtrasTagsBulkUpdateExecute(r) +} + +/* +ExtrasTagsBulkUpdate Method for ExtrasTagsBulkUpdate + +Put a list of tag objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasTagsBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsBulkUpdate(ctx context.Context) ApiExtrasTagsBulkUpdateRequest { + return ApiExtrasTagsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Tag +func (a *ExtrasAPIService) ExtrasTagsBulkUpdateExecute(r ApiExtrasTagsBulkUpdateRequest) ([]Tag, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Tag + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tagRequest == nil { + return localVarReturnValue, nil, reportError("tagRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tagRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasTagsCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + tagRequest *TagRequest +} + +func (r ApiExtrasTagsCreateRequest) TagRequest(tagRequest TagRequest) ApiExtrasTagsCreateRequest { + r.tagRequest = &tagRequest + return r +} + +func (r ApiExtrasTagsCreateRequest) Execute() (*Tag, *http.Response, error) { + return r.ApiService.ExtrasTagsCreateExecute(r) +} + +/* +ExtrasTagsCreate Method for ExtrasTagsCreate + +Post a list of tag objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasTagsCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsCreate(ctx context.Context) ApiExtrasTagsCreateRequest { + return ApiExtrasTagsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Tag +func (a *ExtrasAPIService) ExtrasTagsCreateExecute(r ApiExtrasTagsCreateRequest) (*Tag, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tag + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tagRequest == nil { + return localVarReturnValue, nil, reportError("tagRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tagRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasTagsDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasTagsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasTagsDestroyExecute(r) +} + +/* +ExtrasTagsDestroy Method for ExtrasTagsDestroy + +Delete a tag object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tag. + @return ApiExtrasTagsDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsDestroy(ctx context.Context, id int32) ApiExtrasTagsDestroyRequest { + return ApiExtrasTagsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasTagsDestroyExecute(r ApiExtrasTagsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasTagsListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + color *[]string + colorEmpty *bool + colorIc *[]string + colorIe *[]string + colorIew *[]string + colorIsw *[]string + colorN *[]string + colorNic *[]string + colorNie *[]string + colorNiew *[]string + colorNisw *[]string + contentType *[]string + contentTypeId *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + forObjectTypeId *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + objectTypes *[]int32 + objectTypesN *[]int32 + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + updatedByRequest *string +} + +func (r ApiExtrasTagsListRequest) Color(color []string) ApiExtrasTagsListRequest { + r.color = &color + return r +} + +func (r ApiExtrasTagsListRequest) ColorEmpty(colorEmpty bool) ApiExtrasTagsListRequest { + r.colorEmpty = &colorEmpty + return r +} + +func (r ApiExtrasTagsListRequest) ColorIc(colorIc []string) ApiExtrasTagsListRequest { + r.colorIc = &colorIc + return r +} + +func (r ApiExtrasTagsListRequest) ColorIe(colorIe []string) ApiExtrasTagsListRequest { + r.colorIe = &colorIe + return r +} + +func (r ApiExtrasTagsListRequest) ColorIew(colorIew []string) ApiExtrasTagsListRequest { + r.colorIew = &colorIew + return r +} + +func (r ApiExtrasTagsListRequest) ColorIsw(colorIsw []string) ApiExtrasTagsListRequest { + r.colorIsw = &colorIsw + return r +} + +func (r ApiExtrasTagsListRequest) ColorN(colorN []string) ApiExtrasTagsListRequest { + r.colorN = &colorN + return r +} + +func (r ApiExtrasTagsListRequest) ColorNic(colorNic []string) ApiExtrasTagsListRequest { + r.colorNic = &colorNic + return r +} + +func (r ApiExtrasTagsListRequest) ColorNie(colorNie []string) ApiExtrasTagsListRequest { + r.colorNie = &colorNie + return r +} + +func (r ApiExtrasTagsListRequest) ColorNiew(colorNiew []string) ApiExtrasTagsListRequest { + r.colorNiew = &colorNiew + return r +} + +func (r ApiExtrasTagsListRequest) ColorNisw(colorNisw []string) ApiExtrasTagsListRequest { + r.colorNisw = &colorNisw + return r +} + +func (r ApiExtrasTagsListRequest) ContentType(contentType []string) ApiExtrasTagsListRequest { + r.contentType = &contentType + return r +} + +func (r ApiExtrasTagsListRequest) ContentTypeId(contentTypeId []int32) ApiExtrasTagsListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiExtrasTagsListRequest) Created(created []time.Time) ApiExtrasTagsListRequest { + r.created = &created + return r +} + +func (r ApiExtrasTagsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiExtrasTagsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiExtrasTagsListRequest) CreatedGt(createdGt []time.Time) ApiExtrasTagsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiExtrasTagsListRequest) CreatedGte(createdGte []time.Time) ApiExtrasTagsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiExtrasTagsListRequest) CreatedLt(createdLt []time.Time) ApiExtrasTagsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiExtrasTagsListRequest) CreatedLte(createdLte []time.Time) ApiExtrasTagsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiExtrasTagsListRequest) CreatedN(createdN []time.Time) ApiExtrasTagsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiExtrasTagsListRequest) CreatedByRequest(createdByRequest string) ApiExtrasTagsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiExtrasTagsListRequest) Description(description []string) ApiExtrasTagsListRequest { + r.description = &description + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasTagsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionIc(descriptionIc []string) ApiExtrasTagsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionIe(descriptionIe []string) ApiExtrasTagsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionIew(descriptionIew []string) ApiExtrasTagsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasTagsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionN(descriptionN []string) ApiExtrasTagsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionNic(descriptionNic []string) ApiExtrasTagsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionNie(descriptionNie []string) ApiExtrasTagsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasTagsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasTagsListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasTagsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiExtrasTagsListRequest) ForObjectTypeId(forObjectTypeId []int32) ApiExtrasTagsListRequest { + r.forObjectTypeId = &forObjectTypeId + return r +} + +func (r ApiExtrasTagsListRequest) Id(id []int32) ApiExtrasTagsListRequest { + r.id = &id + return r +} + +func (r ApiExtrasTagsListRequest) IdEmpty(idEmpty bool) ApiExtrasTagsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasTagsListRequest) IdGt(idGt []int32) ApiExtrasTagsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasTagsListRequest) IdGte(idGte []int32) ApiExtrasTagsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasTagsListRequest) IdLt(idLt []int32) ApiExtrasTagsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasTagsListRequest) IdLte(idLte []int32) ApiExtrasTagsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasTagsListRequest) IdN(idN []int32) ApiExtrasTagsListRequest { + r.idN = &idN + return r +} + +func (r ApiExtrasTagsListRequest) LastUpdated(lastUpdated []time.Time) ApiExtrasTagsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiExtrasTagsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiExtrasTagsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiExtrasTagsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiExtrasTagsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiExtrasTagsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiExtrasTagsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiExtrasTagsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiExtrasTagsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiExtrasTagsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiExtrasTagsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiExtrasTagsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiExtrasTagsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiExtrasTagsListRequest) Limit(limit int32) ApiExtrasTagsListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasTagsListRequest) ModifiedByRequest(modifiedByRequest string) ApiExtrasTagsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiExtrasTagsListRequest) Name(name []string) ApiExtrasTagsListRequest { + r.name = &name + return r +} + +func (r ApiExtrasTagsListRequest) NameEmpty(nameEmpty bool) ApiExtrasTagsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasTagsListRequest) NameIc(nameIc []string) ApiExtrasTagsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasTagsListRequest) NameIe(nameIe []string) ApiExtrasTagsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasTagsListRequest) NameIew(nameIew []string) ApiExtrasTagsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasTagsListRequest) NameIsw(nameIsw []string) ApiExtrasTagsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasTagsListRequest) NameN(nameN []string) ApiExtrasTagsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasTagsListRequest) NameNic(nameNic []string) ApiExtrasTagsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasTagsListRequest) NameNie(nameNie []string) ApiExtrasTagsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasTagsListRequest) NameNiew(nameNiew []string) ApiExtrasTagsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasTagsListRequest) NameNisw(nameNisw []string) ApiExtrasTagsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiExtrasTagsListRequest) ObjectTypes(objectTypes []int32) ApiExtrasTagsListRequest { + r.objectTypes = &objectTypes + return r +} + +func (r ApiExtrasTagsListRequest) ObjectTypesN(objectTypesN []int32) ApiExtrasTagsListRequest { + r.objectTypesN = &objectTypesN + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasTagsListRequest) Offset(offset int32) ApiExtrasTagsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasTagsListRequest) Ordering(ordering string) ApiExtrasTagsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiExtrasTagsListRequest) Q(q string) ApiExtrasTagsListRequest { + r.q = &q + return r +} + +func (r ApiExtrasTagsListRequest) Slug(slug []string) ApiExtrasTagsListRequest { + r.slug = &slug + return r +} + +func (r ApiExtrasTagsListRequest) SlugEmpty(slugEmpty bool) ApiExtrasTagsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiExtrasTagsListRequest) SlugIc(slugIc []string) ApiExtrasTagsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiExtrasTagsListRequest) SlugIe(slugIe []string) ApiExtrasTagsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiExtrasTagsListRequest) SlugIew(slugIew []string) ApiExtrasTagsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiExtrasTagsListRequest) SlugIsw(slugIsw []string) ApiExtrasTagsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiExtrasTagsListRequest) SlugN(slugN []string) ApiExtrasTagsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiExtrasTagsListRequest) SlugNic(slugNic []string) ApiExtrasTagsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiExtrasTagsListRequest) SlugNie(slugNie []string) ApiExtrasTagsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiExtrasTagsListRequest) SlugNiew(slugNiew []string) ApiExtrasTagsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiExtrasTagsListRequest) SlugNisw(slugNisw []string) ApiExtrasTagsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiExtrasTagsListRequest) UpdatedByRequest(updatedByRequest string) ApiExtrasTagsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiExtrasTagsListRequest) Execute() (*PaginatedTagList, *http.Response, error) { + return r.ApiService.ExtrasTagsListExecute(r) +} + +/* +ExtrasTagsList Method for ExtrasTagsList + +Get a list of tag objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasTagsListRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsList(ctx context.Context) ApiExtrasTagsListRequest { + return ApiExtrasTagsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTagList +func (a *ExtrasAPIService) ExtrasTagsListExecute(r ApiExtrasTagsListRequest) (*PaginatedTagList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTagList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.color != nil { + t := *r.color + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color", t, "multi") + } + } + if r.colorEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__empty", r.colorEmpty, "") + } + if r.colorIc != nil { + t := *r.colorIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ic", t, "multi") + } + } + if r.colorIe != nil { + t := *r.colorIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__ie", t, "multi") + } + } + if r.colorIew != nil { + t := *r.colorIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__iew", t, "multi") + } + } + if r.colorIsw != nil { + t := *r.colorIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__isw", t, "multi") + } + } + if r.colorN != nil { + t := *r.colorN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__n", t, "multi") + } + } + if r.colorNic != nil { + t := *r.colorNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nic", t, "multi") + } + } + if r.colorNie != nil { + t := *r.colorNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nie", t, "multi") + } + } + if r.colorNiew != nil { + t := *r.colorNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__niew", t, "multi") + } + } + if r.colorNisw != nil { + t := *r.colorNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "color__nisw", t, "multi") + } + } + if r.contentType != nil { + t := *r.contentType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type", t, "multi") + } + } + if r.contentTypeId != nil { + t := *r.contentTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.forObjectTypeId != nil { + t := *r.forObjectTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "for_object_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "for_object_type_id", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.objectTypes != nil { + t := *r.objectTypes + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types", t, "multi") + } + } + if r.objectTypesN != nil { + t := *r.objectTypesN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types__n", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasTagsPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedTagRequest *PatchedTagRequest +} + +func (r ApiExtrasTagsPartialUpdateRequest) PatchedTagRequest(patchedTagRequest PatchedTagRequest) ApiExtrasTagsPartialUpdateRequest { + r.patchedTagRequest = &patchedTagRequest + return r +} + +func (r ApiExtrasTagsPartialUpdateRequest) Execute() (*Tag, *http.Response, error) { + return r.ApiService.ExtrasTagsPartialUpdateExecute(r) +} + +/* +ExtrasTagsPartialUpdate Method for ExtrasTagsPartialUpdate + +Patch a tag object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tag. + @return ApiExtrasTagsPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsPartialUpdate(ctx context.Context, id int32) ApiExtrasTagsPartialUpdateRequest { + return ApiExtrasTagsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tag +func (a *ExtrasAPIService) ExtrasTagsPartialUpdateExecute(r ApiExtrasTagsPartialUpdateRequest) (*Tag, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tag + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTagRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasTagsRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasTagsRetrieveRequest) Execute() (*Tag, *http.Response, error) { + return r.ApiService.ExtrasTagsRetrieveExecute(r) +} + +/* +ExtrasTagsRetrieve Method for ExtrasTagsRetrieve + +Get a tag object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tag. + @return ApiExtrasTagsRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsRetrieve(ctx context.Context, id int32) ApiExtrasTagsRetrieveRequest { + return ApiExtrasTagsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tag +func (a *ExtrasAPIService) ExtrasTagsRetrieveExecute(r ApiExtrasTagsRetrieveRequest) (*Tag, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tag + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasTagsUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + tagRequest *TagRequest +} + +func (r ApiExtrasTagsUpdateRequest) TagRequest(tagRequest TagRequest) ApiExtrasTagsUpdateRequest { + r.tagRequest = &tagRequest + return r +} + +func (r ApiExtrasTagsUpdateRequest) Execute() (*Tag, *http.Response, error) { + return r.ApiService.ExtrasTagsUpdateExecute(r) +} + +/* +ExtrasTagsUpdate Method for ExtrasTagsUpdate + +Put a tag object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tag. + @return ApiExtrasTagsUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasTagsUpdate(ctx context.Context, id int32) ApiExtrasTagsUpdateRequest { + return ApiExtrasTagsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tag +func (a *ExtrasAPIService) ExtrasTagsUpdateExecute(r ApiExtrasTagsUpdateRequest) (*Tag, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tag + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasTagsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/tags/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tagRequest == nil { + return localVarReturnValue, nil, reportError("tagRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tagRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksBulkDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + webhookRequest *[]WebhookRequest +} + +func (r ApiExtrasWebhooksBulkDestroyRequest) WebhookRequest(webhookRequest []WebhookRequest) ApiExtrasWebhooksBulkDestroyRequest { + r.webhookRequest = &webhookRequest + return r +} + +func (r ApiExtrasWebhooksBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasWebhooksBulkDestroyExecute(r) +} + +/* +ExtrasWebhooksBulkDestroy Method for ExtrasWebhooksBulkDestroy + +Delete a list of webhook objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasWebhooksBulkDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksBulkDestroy(ctx context.Context) ApiExtrasWebhooksBulkDestroyRequest { + return ApiExtrasWebhooksBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasWebhooksBulkDestroyExecute(r ApiExtrasWebhooksBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webhookRequest == nil { + return nil, reportError("webhookRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webhookRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + webhookRequest *[]WebhookRequest +} + +func (r ApiExtrasWebhooksBulkPartialUpdateRequest) WebhookRequest(webhookRequest []WebhookRequest) ApiExtrasWebhooksBulkPartialUpdateRequest { + r.webhookRequest = &webhookRequest + return r +} + +func (r ApiExtrasWebhooksBulkPartialUpdateRequest) Execute() ([]Webhook, *http.Response, error) { + return r.ApiService.ExtrasWebhooksBulkPartialUpdateExecute(r) +} + +/* +ExtrasWebhooksBulkPartialUpdate Method for ExtrasWebhooksBulkPartialUpdate + +Patch a list of webhook objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasWebhooksBulkPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksBulkPartialUpdate(ctx context.Context) ApiExtrasWebhooksBulkPartialUpdateRequest { + return ApiExtrasWebhooksBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Webhook +func (a *ExtrasAPIService) ExtrasWebhooksBulkPartialUpdateExecute(r ApiExtrasWebhooksBulkPartialUpdateRequest) ([]Webhook, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Webhook + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webhookRequest == nil { + return localVarReturnValue, nil, reportError("webhookRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webhookRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksBulkUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + webhookRequest *[]WebhookRequest +} + +func (r ApiExtrasWebhooksBulkUpdateRequest) WebhookRequest(webhookRequest []WebhookRequest) ApiExtrasWebhooksBulkUpdateRequest { + r.webhookRequest = &webhookRequest + return r +} + +func (r ApiExtrasWebhooksBulkUpdateRequest) Execute() ([]Webhook, *http.Response, error) { + return r.ApiService.ExtrasWebhooksBulkUpdateExecute(r) +} + +/* +ExtrasWebhooksBulkUpdate Method for ExtrasWebhooksBulkUpdate + +Put a list of webhook objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasWebhooksBulkUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksBulkUpdate(ctx context.Context) ApiExtrasWebhooksBulkUpdateRequest { + return ApiExtrasWebhooksBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Webhook +func (a *ExtrasAPIService) ExtrasWebhooksBulkUpdateExecute(r ApiExtrasWebhooksBulkUpdateRequest) ([]Webhook, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Webhook + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webhookRequest == nil { + return localVarReturnValue, nil, reportError("webhookRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webhookRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksCreateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + webhookRequest *WebhookRequest +} + +func (r ApiExtrasWebhooksCreateRequest) WebhookRequest(webhookRequest WebhookRequest) ApiExtrasWebhooksCreateRequest { + r.webhookRequest = &webhookRequest + return r +} + +func (r ApiExtrasWebhooksCreateRequest) Execute() (*Webhook, *http.Response, error) { + return r.ApiService.ExtrasWebhooksCreateExecute(r) +} + +/* +ExtrasWebhooksCreate Method for ExtrasWebhooksCreate + +Post a list of webhook objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasWebhooksCreateRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksCreate(ctx context.Context) ApiExtrasWebhooksCreateRequest { + return ApiExtrasWebhooksCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Webhook +func (a *ExtrasAPIService) ExtrasWebhooksCreateExecute(r ApiExtrasWebhooksCreateRequest) (*Webhook, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Webhook + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webhookRequest == nil { + return localVarReturnValue, nil, reportError("webhookRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webhookRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksDestroyRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasWebhooksDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ExtrasWebhooksDestroyExecute(r) +} + +/* +ExtrasWebhooksDestroy Method for ExtrasWebhooksDestroy + +Delete a webhook object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this webhook. + @return ApiExtrasWebhooksDestroyRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksDestroy(ctx context.Context, id int32) ApiExtrasWebhooksDestroyRequest { + return ApiExtrasWebhooksDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ExtrasAPIService) ExtrasWebhooksDestroyExecute(r ApiExtrasWebhooksDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksListRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + caFilePath *[]string + caFilePathEmpty *bool + caFilePathIc *[]string + caFilePathIe *[]string + caFilePathIew *[]string + caFilePathIsw *[]string + caFilePathN *[]string + caFilePathNic *[]string + caFilePathNie *[]string + caFilePathNiew *[]string + caFilePathNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + httpContentType *[]string + httpContentTypeEmpty *bool + httpContentTypeIc *[]string + httpContentTypeIe *[]string + httpContentTypeIew *[]string + httpContentTypeIsw *[]string + httpContentTypeN *[]string + httpContentTypeNic *[]string + httpContentTypeNie *[]string + httpContentTypeNiew *[]string + httpContentTypeNisw *[]string + httpMethod *[]string + httpMethodN *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + payloadUrl *[]string + q *string + secret *[]string + secretEmpty *bool + secretIc *[]string + secretIe *[]string + secretIew *[]string + secretIsw *[]string + secretN *[]string + secretNic *[]string + secretNie *[]string + secretNiew *[]string + secretNisw *[]string + sslVerification *bool + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiExtrasWebhooksListRequest) CaFilePath(caFilePath []string) ApiExtrasWebhooksListRequest { + r.caFilePath = &caFilePath + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathEmpty(caFilePathEmpty bool) ApiExtrasWebhooksListRequest { + r.caFilePathEmpty = &caFilePathEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathIc(caFilePathIc []string) ApiExtrasWebhooksListRequest { + r.caFilePathIc = &caFilePathIc + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathIe(caFilePathIe []string) ApiExtrasWebhooksListRequest { + r.caFilePathIe = &caFilePathIe + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathIew(caFilePathIew []string) ApiExtrasWebhooksListRequest { + r.caFilePathIew = &caFilePathIew + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathIsw(caFilePathIsw []string) ApiExtrasWebhooksListRequest { + r.caFilePathIsw = &caFilePathIsw + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathN(caFilePathN []string) ApiExtrasWebhooksListRequest { + r.caFilePathN = &caFilePathN + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathNic(caFilePathNic []string) ApiExtrasWebhooksListRequest { + r.caFilePathNic = &caFilePathNic + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathNie(caFilePathNie []string) ApiExtrasWebhooksListRequest { + r.caFilePathNie = &caFilePathNie + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathNiew(caFilePathNiew []string) ApiExtrasWebhooksListRequest { + r.caFilePathNiew = &caFilePathNiew + return r +} + +func (r ApiExtrasWebhooksListRequest) CaFilePathNisw(caFilePathNisw []string) ApiExtrasWebhooksListRequest { + r.caFilePathNisw = &caFilePathNisw + return r +} + +func (r ApiExtrasWebhooksListRequest) Created(created []time.Time) ApiExtrasWebhooksListRequest { + r.created = &created + return r +} + +func (r ApiExtrasWebhooksListRequest) CreatedEmpty(createdEmpty []time.Time) ApiExtrasWebhooksListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) CreatedGt(createdGt []time.Time) ApiExtrasWebhooksListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiExtrasWebhooksListRequest) CreatedGte(createdGte []time.Time) ApiExtrasWebhooksListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiExtrasWebhooksListRequest) CreatedLt(createdLt []time.Time) ApiExtrasWebhooksListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiExtrasWebhooksListRequest) CreatedLte(createdLte []time.Time) ApiExtrasWebhooksListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiExtrasWebhooksListRequest) CreatedN(createdN []time.Time) ApiExtrasWebhooksListRequest { + r.createdN = &createdN + return r +} + +func (r ApiExtrasWebhooksListRequest) CreatedByRequest(createdByRequest string) ApiExtrasWebhooksListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiExtrasWebhooksListRequest) Description(description []string) ApiExtrasWebhooksListRequest { + r.description = &description + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionEmpty(descriptionEmpty bool) ApiExtrasWebhooksListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionIc(descriptionIc []string) ApiExtrasWebhooksListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionIe(descriptionIe []string) ApiExtrasWebhooksListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionIew(descriptionIew []string) ApiExtrasWebhooksListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionIsw(descriptionIsw []string) ApiExtrasWebhooksListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionN(descriptionN []string) ApiExtrasWebhooksListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionNic(descriptionNic []string) ApiExtrasWebhooksListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionNie(descriptionNie []string) ApiExtrasWebhooksListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionNiew(descriptionNiew []string) ApiExtrasWebhooksListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiExtrasWebhooksListRequest) DescriptionNisw(descriptionNisw []string) ApiExtrasWebhooksListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentType(httpContentType []string) ApiExtrasWebhooksListRequest { + r.httpContentType = &httpContentType + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeEmpty(httpContentTypeEmpty bool) ApiExtrasWebhooksListRequest { + r.httpContentTypeEmpty = &httpContentTypeEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeIc(httpContentTypeIc []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeIc = &httpContentTypeIc + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeIe(httpContentTypeIe []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeIe = &httpContentTypeIe + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeIew(httpContentTypeIew []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeIew = &httpContentTypeIew + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeIsw(httpContentTypeIsw []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeIsw = &httpContentTypeIsw + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeN(httpContentTypeN []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeN = &httpContentTypeN + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeNic(httpContentTypeNic []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeNic = &httpContentTypeNic + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeNie(httpContentTypeNie []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeNie = &httpContentTypeNie + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeNiew(httpContentTypeNiew []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeNiew = &httpContentTypeNiew + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpContentTypeNisw(httpContentTypeNisw []string) ApiExtrasWebhooksListRequest { + r.httpContentTypeNisw = &httpContentTypeNisw + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpMethod(httpMethod []string) ApiExtrasWebhooksListRequest { + r.httpMethod = &httpMethod + return r +} + +func (r ApiExtrasWebhooksListRequest) HttpMethodN(httpMethodN []string) ApiExtrasWebhooksListRequest { + r.httpMethodN = &httpMethodN + return r +} + +func (r ApiExtrasWebhooksListRequest) Id(id []int32) ApiExtrasWebhooksListRequest { + r.id = &id + return r +} + +func (r ApiExtrasWebhooksListRequest) IdEmpty(idEmpty bool) ApiExtrasWebhooksListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) IdGt(idGt []int32) ApiExtrasWebhooksListRequest { + r.idGt = &idGt + return r +} + +func (r ApiExtrasWebhooksListRequest) IdGte(idGte []int32) ApiExtrasWebhooksListRequest { + r.idGte = &idGte + return r +} + +func (r ApiExtrasWebhooksListRequest) IdLt(idLt []int32) ApiExtrasWebhooksListRequest { + r.idLt = &idLt + return r +} + +func (r ApiExtrasWebhooksListRequest) IdLte(idLte []int32) ApiExtrasWebhooksListRequest { + r.idLte = &idLte + return r +} + +func (r ApiExtrasWebhooksListRequest) IdN(idN []int32) ApiExtrasWebhooksListRequest { + r.idN = &idN + return r +} + +func (r ApiExtrasWebhooksListRequest) LastUpdated(lastUpdated []time.Time) ApiExtrasWebhooksListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiExtrasWebhooksListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiExtrasWebhooksListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiExtrasWebhooksListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiExtrasWebhooksListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiExtrasWebhooksListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiExtrasWebhooksListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiExtrasWebhooksListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiExtrasWebhooksListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiExtrasWebhooksListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiExtrasWebhooksListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiExtrasWebhooksListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiExtrasWebhooksListRequest) Limit(limit int32) ApiExtrasWebhooksListRequest { + r.limit = &limit + return r +} + +func (r ApiExtrasWebhooksListRequest) ModifiedByRequest(modifiedByRequest string) ApiExtrasWebhooksListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiExtrasWebhooksListRequest) Name(name []string) ApiExtrasWebhooksListRequest { + r.name = &name + return r +} + +func (r ApiExtrasWebhooksListRequest) NameEmpty(nameEmpty bool) ApiExtrasWebhooksListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) NameIc(nameIc []string) ApiExtrasWebhooksListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiExtrasWebhooksListRequest) NameIe(nameIe []string) ApiExtrasWebhooksListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiExtrasWebhooksListRequest) NameIew(nameIew []string) ApiExtrasWebhooksListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiExtrasWebhooksListRequest) NameIsw(nameIsw []string) ApiExtrasWebhooksListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiExtrasWebhooksListRequest) NameN(nameN []string) ApiExtrasWebhooksListRequest { + r.nameN = &nameN + return r +} + +func (r ApiExtrasWebhooksListRequest) NameNic(nameNic []string) ApiExtrasWebhooksListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiExtrasWebhooksListRequest) NameNie(nameNie []string) ApiExtrasWebhooksListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiExtrasWebhooksListRequest) NameNiew(nameNiew []string) ApiExtrasWebhooksListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiExtrasWebhooksListRequest) NameNisw(nameNisw []string) ApiExtrasWebhooksListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiExtrasWebhooksListRequest) Offset(offset int32) ApiExtrasWebhooksListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiExtrasWebhooksListRequest) Ordering(ordering string) ApiExtrasWebhooksListRequest { + r.ordering = &ordering + return r +} + +func (r ApiExtrasWebhooksListRequest) PayloadUrl(payloadUrl []string) ApiExtrasWebhooksListRequest { + r.payloadUrl = &payloadUrl + return r +} + +// Search +func (r ApiExtrasWebhooksListRequest) Q(q string) ApiExtrasWebhooksListRequest { + r.q = &q + return r +} + +func (r ApiExtrasWebhooksListRequest) Secret(secret []string) ApiExtrasWebhooksListRequest { + r.secret = &secret + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretEmpty(secretEmpty bool) ApiExtrasWebhooksListRequest { + r.secretEmpty = &secretEmpty + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretIc(secretIc []string) ApiExtrasWebhooksListRequest { + r.secretIc = &secretIc + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretIe(secretIe []string) ApiExtrasWebhooksListRequest { + r.secretIe = &secretIe + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretIew(secretIew []string) ApiExtrasWebhooksListRequest { + r.secretIew = &secretIew + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretIsw(secretIsw []string) ApiExtrasWebhooksListRequest { + r.secretIsw = &secretIsw + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretN(secretN []string) ApiExtrasWebhooksListRequest { + r.secretN = &secretN + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretNic(secretNic []string) ApiExtrasWebhooksListRequest { + r.secretNic = &secretNic + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretNie(secretNie []string) ApiExtrasWebhooksListRequest { + r.secretNie = &secretNie + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretNiew(secretNiew []string) ApiExtrasWebhooksListRequest { + r.secretNiew = &secretNiew + return r +} + +func (r ApiExtrasWebhooksListRequest) SecretNisw(secretNisw []string) ApiExtrasWebhooksListRequest { + r.secretNisw = &secretNisw + return r +} + +func (r ApiExtrasWebhooksListRequest) SslVerification(sslVerification bool) ApiExtrasWebhooksListRequest { + r.sslVerification = &sslVerification + return r +} + +func (r ApiExtrasWebhooksListRequest) Tag(tag []string) ApiExtrasWebhooksListRequest { + r.tag = &tag + return r +} + +func (r ApiExtrasWebhooksListRequest) TagN(tagN []string) ApiExtrasWebhooksListRequest { + r.tagN = &tagN + return r +} + +func (r ApiExtrasWebhooksListRequest) UpdatedByRequest(updatedByRequest string) ApiExtrasWebhooksListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiExtrasWebhooksListRequest) Execute() (*PaginatedWebhookList, *http.Response, error) { + return r.ApiService.ExtrasWebhooksListExecute(r) +} + +/* +ExtrasWebhooksList Method for ExtrasWebhooksList + +Get a list of webhook objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExtrasWebhooksListRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksList(ctx context.Context) ApiExtrasWebhooksListRequest { + return ApiExtrasWebhooksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWebhookList +func (a *ExtrasAPIService) ExtrasWebhooksListExecute(r ApiExtrasWebhooksListRequest) (*PaginatedWebhookList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWebhookList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.caFilePath != nil { + t := *r.caFilePath + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path", t, "multi") + } + } + if r.caFilePathEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__empty", r.caFilePathEmpty, "") + } + if r.caFilePathIc != nil { + t := *r.caFilePathIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__ic", t, "multi") + } + } + if r.caFilePathIe != nil { + t := *r.caFilePathIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__ie", t, "multi") + } + } + if r.caFilePathIew != nil { + t := *r.caFilePathIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__iew", t, "multi") + } + } + if r.caFilePathIsw != nil { + t := *r.caFilePathIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__isw", t, "multi") + } + } + if r.caFilePathN != nil { + t := *r.caFilePathN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__n", t, "multi") + } + } + if r.caFilePathNic != nil { + t := *r.caFilePathNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__nic", t, "multi") + } + } + if r.caFilePathNie != nil { + t := *r.caFilePathNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__nie", t, "multi") + } + } + if r.caFilePathNiew != nil { + t := *r.caFilePathNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__niew", t, "multi") + } + } + if r.caFilePathNisw != nil { + t := *r.caFilePathNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ca_file_path__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.httpContentType != nil { + t := *r.httpContentType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type", t, "multi") + } + } + if r.httpContentTypeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__empty", r.httpContentTypeEmpty, "") + } + if r.httpContentTypeIc != nil { + t := *r.httpContentTypeIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__ic", t, "multi") + } + } + if r.httpContentTypeIe != nil { + t := *r.httpContentTypeIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__ie", t, "multi") + } + } + if r.httpContentTypeIew != nil { + t := *r.httpContentTypeIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__iew", t, "multi") + } + } + if r.httpContentTypeIsw != nil { + t := *r.httpContentTypeIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__isw", t, "multi") + } + } + if r.httpContentTypeN != nil { + t := *r.httpContentTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__n", t, "multi") + } + } + if r.httpContentTypeNic != nil { + t := *r.httpContentTypeNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__nic", t, "multi") + } + } + if r.httpContentTypeNie != nil { + t := *r.httpContentTypeNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__nie", t, "multi") + } + } + if r.httpContentTypeNiew != nil { + t := *r.httpContentTypeNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__niew", t, "multi") + } + } + if r.httpContentTypeNisw != nil { + t := *r.httpContentTypeNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_content_type__nisw", t, "multi") + } + } + if r.httpMethod != nil { + t := *r.httpMethod + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_method", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_method", t, "multi") + } + } + if r.httpMethodN != nil { + t := *r.httpMethodN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_method__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "http_method__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.payloadUrl != nil { + t := *r.payloadUrl + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "payload_url", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "payload_url", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.secret != nil { + t := *r.secret + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret", t, "multi") + } + } + if r.secretEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__empty", r.secretEmpty, "") + } + if r.secretIc != nil { + t := *r.secretIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__ic", t, "multi") + } + } + if r.secretIe != nil { + t := *r.secretIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__ie", t, "multi") + } + } + if r.secretIew != nil { + t := *r.secretIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__iew", t, "multi") + } + } + if r.secretIsw != nil { + t := *r.secretIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__isw", t, "multi") + } + } + if r.secretN != nil { + t := *r.secretN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__n", t, "multi") + } + } + if r.secretNic != nil { + t := *r.secretNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__nic", t, "multi") + } + } + if r.secretNie != nil { + t := *r.secretNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__nie", t, "multi") + } + } + if r.secretNiew != nil { + t := *r.secretNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__niew", t, "multi") + } + } + if r.secretNisw != nil { + t := *r.secretNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "secret__nisw", t, "multi") + } + } + if r.sslVerification != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssl_verification", r.sslVerification, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksPartialUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + patchedWebhookRequest *PatchedWebhookRequest +} + +func (r ApiExtrasWebhooksPartialUpdateRequest) PatchedWebhookRequest(patchedWebhookRequest PatchedWebhookRequest) ApiExtrasWebhooksPartialUpdateRequest { + r.patchedWebhookRequest = &patchedWebhookRequest + return r +} + +func (r ApiExtrasWebhooksPartialUpdateRequest) Execute() (*Webhook, *http.Response, error) { + return r.ApiService.ExtrasWebhooksPartialUpdateExecute(r) +} + +/* +ExtrasWebhooksPartialUpdate Method for ExtrasWebhooksPartialUpdate + +Patch a webhook object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this webhook. + @return ApiExtrasWebhooksPartialUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksPartialUpdate(ctx context.Context, id int32) ApiExtrasWebhooksPartialUpdateRequest { + return ApiExtrasWebhooksPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Webhook +func (a *ExtrasAPIService) ExtrasWebhooksPartialUpdateExecute(r ApiExtrasWebhooksPartialUpdateRequest) (*Webhook, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Webhook + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWebhookRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksRetrieveRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 +} + +func (r ApiExtrasWebhooksRetrieveRequest) Execute() (*Webhook, *http.Response, error) { + return r.ApiService.ExtrasWebhooksRetrieveExecute(r) +} + +/* +ExtrasWebhooksRetrieve Method for ExtrasWebhooksRetrieve + +Get a webhook object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this webhook. + @return ApiExtrasWebhooksRetrieveRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksRetrieve(ctx context.Context, id int32) ApiExtrasWebhooksRetrieveRequest { + return ApiExtrasWebhooksRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Webhook +func (a *ExtrasAPIService) ExtrasWebhooksRetrieveExecute(r ApiExtrasWebhooksRetrieveRequest) (*Webhook, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Webhook + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExtrasWebhooksUpdateRequest struct { + ctx context.Context + ApiService *ExtrasAPIService + id int32 + webhookRequest *WebhookRequest +} + +func (r ApiExtrasWebhooksUpdateRequest) WebhookRequest(webhookRequest WebhookRequest) ApiExtrasWebhooksUpdateRequest { + r.webhookRequest = &webhookRequest + return r +} + +func (r ApiExtrasWebhooksUpdateRequest) Execute() (*Webhook, *http.Response, error) { + return r.ApiService.ExtrasWebhooksUpdateExecute(r) +} + +/* +ExtrasWebhooksUpdate Method for ExtrasWebhooksUpdate + +Put a webhook object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this webhook. + @return ApiExtrasWebhooksUpdateRequest +*/ +func (a *ExtrasAPIService) ExtrasWebhooksUpdate(ctx context.Context, id int32) ApiExtrasWebhooksUpdateRequest { + return ApiExtrasWebhooksUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Webhook +func (a *ExtrasAPIService) ExtrasWebhooksUpdateExecute(r ApiExtrasWebhooksUpdateRequest) (*Webhook, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Webhook + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtrasAPIService.ExtrasWebhooksUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/extras/webhooks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webhookRequest == nil { + return localVarReturnValue, nil, reportError("webhookRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webhookRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_ipam.go b/vendor/github.com/netbox-community/go-netbox/v3/api_ipam.go new file mode 100644 index 00000000..ab45aa9c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_ipam.go @@ -0,0 +1,37078 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// IpamAPIService IpamAPI service +type IpamAPIService service + +type ApiIpamAggregatesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + aggregateRequest *[]AggregateRequest +} + +func (r ApiIpamAggregatesBulkDestroyRequest) AggregateRequest(aggregateRequest []AggregateRequest) ApiIpamAggregatesBulkDestroyRequest { + r.aggregateRequest = &aggregateRequest + return r +} + +func (r ApiIpamAggregatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamAggregatesBulkDestroyExecute(r) +} + +/* +IpamAggregatesBulkDestroy Method for IpamAggregatesBulkDestroy + +Delete a list of aggregate objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAggregatesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamAggregatesBulkDestroy(ctx context.Context) ApiIpamAggregatesBulkDestroyRequest { + return ApiIpamAggregatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamAggregatesBulkDestroyExecute(r ApiIpamAggregatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aggregateRequest == nil { + return nil, reportError("aggregateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aggregateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamAggregatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + aggregateRequest *[]AggregateRequest +} + +func (r ApiIpamAggregatesBulkPartialUpdateRequest) AggregateRequest(aggregateRequest []AggregateRequest) ApiIpamAggregatesBulkPartialUpdateRequest { + r.aggregateRequest = &aggregateRequest + return r +} + +func (r ApiIpamAggregatesBulkPartialUpdateRequest) Execute() ([]Aggregate, *http.Response, error) { + return r.ApiService.IpamAggregatesBulkPartialUpdateExecute(r) +} + +/* +IpamAggregatesBulkPartialUpdate Method for IpamAggregatesBulkPartialUpdate + +Patch a list of aggregate objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAggregatesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamAggregatesBulkPartialUpdate(ctx context.Context) ApiIpamAggregatesBulkPartialUpdateRequest { + return ApiIpamAggregatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Aggregate +func (a *IpamAPIService) IpamAggregatesBulkPartialUpdateExecute(r ApiIpamAggregatesBulkPartialUpdateRequest) ([]Aggregate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Aggregate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aggregateRequest == nil { + return localVarReturnValue, nil, reportError("aggregateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aggregateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAggregatesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + aggregateRequest *[]AggregateRequest +} + +func (r ApiIpamAggregatesBulkUpdateRequest) AggregateRequest(aggregateRequest []AggregateRequest) ApiIpamAggregatesBulkUpdateRequest { + r.aggregateRequest = &aggregateRequest + return r +} + +func (r ApiIpamAggregatesBulkUpdateRequest) Execute() ([]Aggregate, *http.Response, error) { + return r.ApiService.IpamAggregatesBulkUpdateExecute(r) +} + +/* +IpamAggregatesBulkUpdate Method for IpamAggregatesBulkUpdate + +Put a list of aggregate objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAggregatesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamAggregatesBulkUpdate(ctx context.Context) ApiIpamAggregatesBulkUpdateRequest { + return ApiIpamAggregatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Aggregate +func (a *IpamAPIService) IpamAggregatesBulkUpdateExecute(r ApiIpamAggregatesBulkUpdateRequest) ([]Aggregate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Aggregate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aggregateRequest == nil { + return localVarReturnValue, nil, reportError("aggregateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aggregateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAggregatesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableAggregateRequest *WritableAggregateRequest +} + +func (r ApiIpamAggregatesCreateRequest) WritableAggregateRequest(writableAggregateRequest WritableAggregateRequest) ApiIpamAggregatesCreateRequest { + r.writableAggregateRequest = &writableAggregateRequest + return r +} + +func (r ApiIpamAggregatesCreateRequest) Execute() (*Aggregate, *http.Response, error) { + return r.ApiService.IpamAggregatesCreateExecute(r) +} + +/* +IpamAggregatesCreate Method for IpamAggregatesCreate + +Post a list of aggregate objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAggregatesCreateRequest +*/ +func (a *IpamAPIService) IpamAggregatesCreate(ctx context.Context) ApiIpamAggregatesCreateRequest { + return ApiIpamAggregatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Aggregate +func (a *IpamAPIService) IpamAggregatesCreateExecute(r ApiIpamAggregatesCreateRequest) (*Aggregate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Aggregate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableAggregateRequest == nil { + return localVarReturnValue, nil, reportError("writableAggregateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableAggregateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAggregatesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamAggregatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamAggregatesDestroyExecute(r) +} + +/* +IpamAggregatesDestroy Method for IpamAggregatesDestroy + +Delete a aggregate object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this aggregate. + @return ApiIpamAggregatesDestroyRequest +*/ +func (a *IpamAPIService) IpamAggregatesDestroy(ctx context.Context, id int32) ApiIpamAggregatesDestroyRequest { + return ApiIpamAggregatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamAggregatesDestroyExecute(r ApiIpamAggregatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamAggregatesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + dateAdded *[]string + dateAddedEmpty *bool + dateAddedGt *[]string + dateAddedGte *[]string + dateAddedLt *[]string + dateAddedLte *[]string + dateAddedN *[]string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + family *float32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + prefix *string + q *string + rir *[]string + rirN *[]string + rirId *[]int32 + rirIdN *[]int32 + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiIpamAggregatesListRequest) Created(created []time.Time) ApiIpamAggregatesListRequest { + r.created = &created + return r +} + +func (r ApiIpamAggregatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamAggregatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamAggregatesListRequest) CreatedGt(createdGt []time.Time) ApiIpamAggregatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamAggregatesListRequest) CreatedGte(createdGte []time.Time) ApiIpamAggregatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamAggregatesListRequest) CreatedLt(createdLt []time.Time) ApiIpamAggregatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamAggregatesListRequest) CreatedLte(createdLte []time.Time) ApiIpamAggregatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamAggregatesListRequest) CreatedN(createdN []time.Time) ApiIpamAggregatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamAggregatesListRequest) CreatedByRequest(createdByRequest string) ApiIpamAggregatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamAggregatesListRequest) DateAdded(dateAdded []string) ApiIpamAggregatesListRequest { + r.dateAdded = &dateAdded + return r +} + +func (r ApiIpamAggregatesListRequest) DateAddedEmpty(dateAddedEmpty bool) ApiIpamAggregatesListRequest { + r.dateAddedEmpty = &dateAddedEmpty + return r +} + +func (r ApiIpamAggregatesListRequest) DateAddedGt(dateAddedGt []string) ApiIpamAggregatesListRequest { + r.dateAddedGt = &dateAddedGt + return r +} + +func (r ApiIpamAggregatesListRequest) DateAddedGte(dateAddedGte []string) ApiIpamAggregatesListRequest { + r.dateAddedGte = &dateAddedGte + return r +} + +func (r ApiIpamAggregatesListRequest) DateAddedLt(dateAddedLt []string) ApiIpamAggregatesListRequest { + r.dateAddedLt = &dateAddedLt + return r +} + +func (r ApiIpamAggregatesListRequest) DateAddedLte(dateAddedLte []string) ApiIpamAggregatesListRequest { + r.dateAddedLte = &dateAddedLte + return r +} + +func (r ApiIpamAggregatesListRequest) DateAddedN(dateAddedN []string) ApiIpamAggregatesListRequest { + r.dateAddedN = &dateAddedN + return r +} + +func (r ApiIpamAggregatesListRequest) Description(description []string) ApiIpamAggregatesListRequest { + r.description = &description + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamAggregatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionIc(descriptionIc []string) ApiIpamAggregatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionIe(descriptionIe []string) ApiIpamAggregatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionIew(descriptionIew []string) ApiIpamAggregatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamAggregatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionN(descriptionN []string) ApiIpamAggregatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionNic(descriptionNic []string) ApiIpamAggregatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionNie(descriptionNie []string) ApiIpamAggregatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamAggregatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamAggregatesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamAggregatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamAggregatesListRequest) Family(family float32) ApiIpamAggregatesListRequest { + r.family = &family + return r +} + +func (r ApiIpamAggregatesListRequest) Id(id []int32) ApiIpamAggregatesListRequest { + r.id = &id + return r +} + +func (r ApiIpamAggregatesListRequest) IdEmpty(idEmpty bool) ApiIpamAggregatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamAggregatesListRequest) IdGt(idGt []int32) ApiIpamAggregatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamAggregatesListRequest) IdGte(idGte []int32) ApiIpamAggregatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamAggregatesListRequest) IdLt(idLt []int32) ApiIpamAggregatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamAggregatesListRequest) IdLte(idLte []int32) ApiIpamAggregatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamAggregatesListRequest) IdN(idN []int32) ApiIpamAggregatesListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamAggregatesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamAggregatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamAggregatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamAggregatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamAggregatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamAggregatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamAggregatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamAggregatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamAggregatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamAggregatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamAggregatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamAggregatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamAggregatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamAggregatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamAggregatesListRequest) Limit(limit int32) ApiIpamAggregatesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamAggregatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamAggregatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiIpamAggregatesListRequest) Offset(offset int32) ApiIpamAggregatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamAggregatesListRequest) Ordering(ordering string) ApiIpamAggregatesListRequest { + r.ordering = &ordering + return r +} + +// Prefix +func (r ApiIpamAggregatesListRequest) Prefix(prefix string) ApiIpamAggregatesListRequest { + r.prefix = &prefix + return r +} + +// Search +func (r ApiIpamAggregatesListRequest) Q(q string) ApiIpamAggregatesListRequest { + r.q = &q + return r +} + +// RIR (slug) +func (r ApiIpamAggregatesListRequest) Rir(rir []string) ApiIpamAggregatesListRequest { + r.rir = &rir + return r +} + +// RIR (slug) +func (r ApiIpamAggregatesListRequest) RirN(rirN []string) ApiIpamAggregatesListRequest { + r.rirN = &rirN + return r +} + +// RIR (ID) +func (r ApiIpamAggregatesListRequest) RirId(rirId []int32) ApiIpamAggregatesListRequest { + r.rirId = &rirId + return r +} + +// RIR (ID) +func (r ApiIpamAggregatesListRequest) RirIdN(rirIdN []int32) ApiIpamAggregatesListRequest { + r.rirIdN = &rirIdN + return r +} + +func (r ApiIpamAggregatesListRequest) Tag(tag []string) ApiIpamAggregatesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamAggregatesListRequest) TagN(tagN []string) ApiIpamAggregatesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamAggregatesListRequest) Tenant(tenant []string) ApiIpamAggregatesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamAggregatesListRequest) TenantN(tenantN []string) ApiIpamAggregatesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamAggregatesListRequest) TenantGroup(tenantGroup []int32) ApiIpamAggregatesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamAggregatesListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamAggregatesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamAggregatesListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamAggregatesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamAggregatesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamAggregatesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamAggregatesListRequest) TenantId(tenantId []*int32) ApiIpamAggregatesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamAggregatesListRequest) TenantIdN(tenantIdN []*int32) ApiIpamAggregatesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamAggregatesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamAggregatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamAggregatesListRequest) Execute() (*PaginatedAggregateList, *http.Response, error) { + return r.ApiService.IpamAggregatesListExecute(r) +} + +/* +IpamAggregatesList Method for IpamAggregatesList + +Get a list of aggregate objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAggregatesListRequest +*/ +func (a *IpamAPIService) IpamAggregatesList(ctx context.Context) ApiIpamAggregatesListRequest { + return ApiIpamAggregatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAggregateList +func (a *IpamAPIService) IpamAggregatesListExecute(r ApiIpamAggregatesListRequest) (*PaginatedAggregateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAggregateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.dateAdded != nil { + t := *r.dateAdded + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added", t, "multi") + } + } + if r.dateAddedEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__empty", r.dateAddedEmpty, "") + } + if r.dateAddedGt != nil { + t := *r.dateAddedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__gt", t, "multi") + } + } + if r.dateAddedGte != nil { + t := *r.dateAddedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__gte", t, "multi") + } + } + if r.dateAddedLt != nil { + t := *r.dateAddedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__lt", t, "multi") + } + } + if r.dateAddedLte != nil { + t := *r.dateAddedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__lte", t, "multi") + } + } + if r.dateAddedN != nil { + t := *r.dateAddedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_added__n", t, "multi") + } + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.family != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "family", r.family, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rir != nil { + t := *r.rir + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir", t, "multi") + } + } + if r.rirN != nil { + t := *r.rirN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir__n", t, "multi") + } + } + if r.rirId != nil { + t := *r.rirId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id", t, "multi") + } + } + if r.rirIdN != nil { + t := *r.rirIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAggregatesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableAggregateRequest *PatchedWritableAggregateRequest +} + +func (r ApiIpamAggregatesPartialUpdateRequest) PatchedWritableAggregateRequest(patchedWritableAggregateRequest PatchedWritableAggregateRequest) ApiIpamAggregatesPartialUpdateRequest { + r.patchedWritableAggregateRequest = &patchedWritableAggregateRequest + return r +} + +func (r ApiIpamAggregatesPartialUpdateRequest) Execute() (*Aggregate, *http.Response, error) { + return r.ApiService.IpamAggregatesPartialUpdateExecute(r) +} + +/* +IpamAggregatesPartialUpdate Method for IpamAggregatesPartialUpdate + +Patch a aggregate object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this aggregate. + @return ApiIpamAggregatesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamAggregatesPartialUpdate(ctx context.Context, id int32) ApiIpamAggregatesPartialUpdateRequest { + return ApiIpamAggregatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Aggregate +func (a *IpamAPIService) IpamAggregatesPartialUpdateExecute(r ApiIpamAggregatesPartialUpdateRequest) (*Aggregate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Aggregate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableAggregateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAggregatesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamAggregatesRetrieveRequest) Execute() (*Aggregate, *http.Response, error) { + return r.ApiService.IpamAggregatesRetrieveExecute(r) +} + +/* +IpamAggregatesRetrieve Method for IpamAggregatesRetrieve + +Get a aggregate object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this aggregate. + @return ApiIpamAggregatesRetrieveRequest +*/ +func (a *IpamAPIService) IpamAggregatesRetrieve(ctx context.Context, id int32) ApiIpamAggregatesRetrieveRequest { + return ApiIpamAggregatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Aggregate +func (a *IpamAPIService) IpamAggregatesRetrieveExecute(r ApiIpamAggregatesRetrieveRequest) (*Aggregate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Aggregate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAggregatesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableAggregateRequest *WritableAggregateRequest +} + +func (r ApiIpamAggregatesUpdateRequest) WritableAggregateRequest(writableAggregateRequest WritableAggregateRequest) ApiIpamAggregatesUpdateRequest { + r.writableAggregateRequest = &writableAggregateRequest + return r +} + +func (r ApiIpamAggregatesUpdateRequest) Execute() (*Aggregate, *http.Response, error) { + return r.ApiService.IpamAggregatesUpdateExecute(r) +} + +/* +IpamAggregatesUpdate Method for IpamAggregatesUpdate + +Put a aggregate object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this aggregate. + @return ApiIpamAggregatesUpdateRequest +*/ +func (a *IpamAPIService) IpamAggregatesUpdate(ctx context.Context, id int32) ApiIpamAggregatesUpdateRequest { + return ApiIpamAggregatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Aggregate +func (a *IpamAPIService) IpamAggregatesUpdateExecute(r ApiIpamAggregatesUpdateRequest) (*Aggregate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Aggregate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAggregatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/aggregates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableAggregateRequest == nil { + return localVarReturnValue, nil, reportError("writableAggregateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableAggregateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesAvailableAsnsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + aSNRequest *[]ASNRequest +} + +func (r ApiIpamAsnRangesAvailableAsnsCreateRequest) ASNRequest(aSNRequest []ASNRequest) ApiIpamAsnRangesAvailableAsnsCreateRequest { + r.aSNRequest = &aSNRequest + return r +} + +func (r ApiIpamAsnRangesAvailableAsnsCreateRequest) Execute() ([]ASN, *http.Response, error) { + return r.ApiService.IpamAsnRangesAvailableAsnsCreateExecute(r) +} + +/* +IpamAsnRangesAvailableAsnsCreate Method for IpamAsnRangesAvailableAsnsCreate + +Post a ASN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamAsnRangesAvailableAsnsCreateRequest +*/ +func (a *IpamAPIService) IpamAsnRangesAvailableAsnsCreate(ctx context.Context, id int32) ApiIpamAsnRangesAvailableAsnsCreateRequest { + return ApiIpamAsnRangesAvailableAsnsCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []ASN +func (a *IpamAPIService) IpamAsnRangesAvailableAsnsCreateExecute(r ApiIpamAsnRangesAvailableAsnsCreateRequest) ([]ASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesAvailableAsnsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/{id}/available-asns/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aSNRequest == nil { + return localVarReturnValue, nil, reportError("aSNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aSNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesAvailableAsnsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamAsnRangesAvailableAsnsListRequest) Execute() ([]AvailableASN, *http.Response, error) { + return r.ApiService.IpamAsnRangesAvailableAsnsListExecute(r) +} + +/* +IpamAsnRangesAvailableAsnsList Method for IpamAsnRangesAvailableAsnsList + +Get a ASN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamAsnRangesAvailableAsnsListRequest +*/ +func (a *IpamAPIService) IpamAsnRangesAvailableAsnsList(ctx context.Context, id int32) ApiIpamAsnRangesAvailableAsnsListRequest { + return ApiIpamAsnRangesAvailableAsnsListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []AvailableASN +func (a *IpamAPIService) IpamAsnRangesAvailableAsnsListExecute(r ApiIpamAsnRangesAvailableAsnsListRequest) ([]AvailableASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AvailableASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesAvailableAsnsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/{id}/available-asns/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + aSNRangeRequest *[]ASNRangeRequest +} + +func (r ApiIpamAsnRangesBulkDestroyRequest) ASNRangeRequest(aSNRangeRequest []ASNRangeRequest) ApiIpamAsnRangesBulkDestroyRequest { + r.aSNRangeRequest = &aSNRangeRequest + return r +} + +func (r ApiIpamAsnRangesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamAsnRangesBulkDestroyExecute(r) +} + +/* +IpamAsnRangesBulkDestroy Method for IpamAsnRangesBulkDestroy + +Delete a list of ASN range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnRangesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamAsnRangesBulkDestroy(ctx context.Context) ApiIpamAsnRangesBulkDestroyRequest { + return ApiIpamAsnRangesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamAsnRangesBulkDestroyExecute(r ApiIpamAsnRangesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aSNRangeRequest == nil { + return nil, reportError("aSNRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aSNRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + aSNRangeRequest *[]ASNRangeRequest +} + +func (r ApiIpamAsnRangesBulkPartialUpdateRequest) ASNRangeRequest(aSNRangeRequest []ASNRangeRequest) ApiIpamAsnRangesBulkPartialUpdateRequest { + r.aSNRangeRequest = &aSNRangeRequest + return r +} + +func (r ApiIpamAsnRangesBulkPartialUpdateRequest) Execute() ([]ASNRange, *http.Response, error) { + return r.ApiService.IpamAsnRangesBulkPartialUpdateExecute(r) +} + +/* +IpamAsnRangesBulkPartialUpdate Method for IpamAsnRangesBulkPartialUpdate + +Patch a list of ASN range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnRangesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnRangesBulkPartialUpdate(ctx context.Context) ApiIpamAsnRangesBulkPartialUpdateRequest { + return ApiIpamAsnRangesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ASNRange +func (a *IpamAPIService) IpamAsnRangesBulkPartialUpdateExecute(r ApiIpamAsnRangesBulkPartialUpdateRequest) ([]ASNRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ASNRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aSNRangeRequest == nil { + return localVarReturnValue, nil, reportError("aSNRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aSNRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + aSNRangeRequest *[]ASNRangeRequest +} + +func (r ApiIpamAsnRangesBulkUpdateRequest) ASNRangeRequest(aSNRangeRequest []ASNRangeRequest) ApiIpamAsnRangesBulkUpdateRequest { + r.aSNRangeRequest = &aSNRangeRequest + return r +} + +func (r ApiIpamAsnRangesBulkUpdateRequest) Execute() ([]ASNRange, *http.Response, error) { + return r.ApiService.IpamAsnRangesBulkUpdateExecute(r) +} + +/* +IpamAsnRangesBulkUpdate Method for IpamAsnRangesBulkUpdate + +Put a list of ASN range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnRangesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnRangesBulkUpdate(ctx context.Context) ApiIpamAsnRangesBulkUpdateRequest { + return ApiIpamAsnRangesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ASNRange +func (a *IpamAPIService) IpamAsnRangesBulkUpdateExecute(r ApiIpamAsnRangesBulkUpdateRequest) ([]ASNRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ASNRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aSNRangeRequest == nil { + return localVarReturnValue, nil, reportError("aSNRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aSNRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableASNRangeRequest *WritableASNRangeRequest +} + +func (r ApiIpamAsnRangesCreateRequest) WritableASNRangeRequest(writableASNRangeRequest WritableASNRangeRequest) ApiIpamAsnRangesCreateRequest { + r.writableASNRangeRequest = &writableASNRangeRequest + return r +} + +func (r ApiIpamAsnRangesCreateRequest) Execute() (*ASNRange, *http.Response, error) { + return r.ApiService.IpamAsnRangesCreateExecute(r) +} + +/* +IpamAsnRangesCreate Method for IpamAsnRangesCreate + +Post a list of ASN range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnRangesCreateRequest +*/ +func (a *IpamAPIService) IpamAsnRangesCreate(ctx context.Context) ApiIpamAsnRangesCreateRequest { + return ApiIpamAsnRangesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ASNRange +func (a *IpamAPIService) IpamAsnRangesCreateExecute(r ApiIpamAsnRangesCreateRequest) (*ASNRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASNRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableASNRangeRequest == nil { + return localVarReturnValue, nil, reportError("writableASNRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableASNRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamAsnRangesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamAsnRangesDestroyExecute(r) +} + +/* +IpamAsnRangesDestroy Method for IpamAsnRangesDestroy + +Delete a ASN range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN range. + @return ApiIpamAsnRangesDestroyRequest +*/ +func (a *IpamAPIService) IpamAsnRangesDestroy(ctx context.Context, id int32) ApiIpamAsnRangesDestroyRequest { + return ApiIpamAsnRangesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamAsnRangesDestroyExecute(r ApiIpamAsnRangesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + end *[]int32 + endEmpty *bool + endGt *[]int32 + endGte *[]int32 + endLt *[]int32 + endLte *[]int32 + endN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + rir *[]string + rirN *[]string + rirId *[]int32 + rirIdN *[]int32 + start *[]int32 + startEmpty *bool + startGt *[]int32 + startGte *[]int32 + startLt *[]int32 + startLte *[]int32 + startN *[]int32 + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiIpamAsnRangesListRequest) Created(created []time.Time) ApiIpamAsnRangesListRequest { + r.created = &created + return r +} + +func (r ApiIpamAsnRangesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamAsnRangesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamAsnRangesListRequest) CreatedGt(createdGt []time.Time) ApiIpamAsnRangesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamAsnRangesListRequest) CreatedGte(createdGte []time.Time) ApiIpamAsnRangesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamAsnRangesListRequest) CreatedLt(createdLt []time.Time) ApiIpamAsnRangesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamAsnRangesListRequest) CreatedLte(createdLte []time.Time) ApiIpamAsnRangesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamAsnRangesListRequest) CreatedN(createdN []time.Time) ApiIpamAsnRangesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamAsnRangesListRequest) CreatedByRequest(createdByRequest string) ApiIpamAsnRangesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamAsnRangesListRequest) Description(description []string) ApiIpamAsnRangesListRequest { + r.description = &description + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamAsnRangesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionIc(descriptionIc []string) ApiIpamAsnRangesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionIe(descriptionIe []string) ApiIpamAsnRangesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionIew(descriptionIew []string) ApiIpamAsnRangesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamAsnRangesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionN(descriptionN []string) ApiIpamAsnRangesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionNic(descriptionNic []string) ApiIpamAsnRangesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionNie(descriptionNie []string) ApiIpamAsnRangesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamAsnRangesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamAsnRangesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamAsnRangesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamAsnRangesListRequest) End(end []int32) ApiIpamAsnRangesListRequest { + r.end = &end + return r +} + +func (r ApiIpamAsnRangesListRequest) EndEmpty(endEmpty bool) ApiIpamAsnRangesListRequest { + r.endEmpty = &endEmpty + return r +} + +func (r ApiIpamAsnRangesListRequest) EndGt(endGt []int32) ApiIpamAsnRangesListRequest { + r.endGt = &endGt + return r +} + +func (r ApiIpamAsnRangesListRequest) EndGte(endGte []int32) ApiIpamAsnRangesListRequest { + r.endGte = &endGte + return r +} + +func (r ApiIpamAsnRangesListRequest) EndLt(endLt []int32) ApiIpamAsnRangesListRequest { + r.endLt = &endLt + return r +} + +func (r ApiIpamAsnRangesListRequest) EndLte(endLte []int32) ApiIpamAsnRangesListRequest { + r.endLte = &endLte + return r +} + +func (r ApiIpamAsnRangesListRequest) EndN(endN []int32) ApiIpamAsnRangesListRequest { + r.endN = &endN + return r +} + +func (r ApiIpamAsnRangesListRequest) Id(id []int32) ApiIpamAsnRangesListRequest { + r.id = &id + return r +} + +func (r ApiIpamAsnRangesListRequest) IdEmpty(idEmpty bool) ApiIpamAsnRangesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamAsnRangesListRequest) IdGt(idGt []int32) ApiIpamAsnRangesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamAsnRangesListRequest) IdGte(idGte []int32) ApiIpamAsnRangesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamAsnRangesListRequest) IdLt(idLt []int32) ApiIpamAsnRangesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamAsnRangesListRequest) IdLte(idLte []int32) ApiIpamAsnRangesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamAsnRangesListRequest) IdN(idN []int32) ApiIpamAsnRangesListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamAsnRangesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamAsnRangesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamAsnRangesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamAsnRangesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamAsnRangesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamAsnRangesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamAsnRangesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamAsnRangesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamAsnRangesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamAsnRangesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamAsnRangesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamAsnRangesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamAsnRangesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamAsnRangesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamAsnRangesListRequest) Limit(limit int32) ApiIpamAsnRangesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamAsnRangesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamAsnRangesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamAsnRangesListRequest) Name(name []string) ApiIpamAsnRangesListRequest { + r.name = &name + return r +} + +func (r ApiIpamAsnRangesListRequest) NameEmpty(nameEmpty bool) ApiIpamAsnRangesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamAsnRangesListRequest) NameIc(nameIc []string) ApiIpamAsnRangesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamAsnRangesListRequest) NameIe(nameIe []string) ApiIpamAsnRangesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamAsnRangesListRequest) NameIew(nameIew []string) ApiIpamAsnRangesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamAsnRangesListRequest) NameIsw(nameIsw []string) ApiIpamAsnRangesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamAsnRangesListRequest) NameN(nameN []string) ApiIpamAsnRangesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamAsnRangesListRequest) NameNic(nameNic []string) ApiIpamAsnRangesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamAsnRangesListRequest) NameNie(nameNie []string) ApiIpamAsnRangesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamAsnRangesListRequest) NameNiew(nameNiew []string) ApiIpamAsnRangesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamAsnRangesListRequest) NameNisw(nameNisw []string) ApiIpamAsnRangesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamAsnRangesListRequest) Offset(offset int32) ApiIpamAsnRangesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamAsnRangesListRequest) Ordering(ordering string) ApiIpamAsnRangesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamAsnRangesListRequest) Q(q string) ApiIpamAsnRangesListRequest { + r.q = &q + return r +} + +// RIR (slug) +func (r ApiIpamAsnRangesListRequest) Rir(rir []string) ApiIpamAsnRangesListRequest { + r.rir = &rir + return r +} + +// RIR (slug) +func (r ApiIpamAsnRangesListRequest) RirN(rirN []string) ApiIpamAsnRangesListRequest { + r.rirN = &rirN + return r +} + +// RIR (ID) +func (r ApiIpamAsnRangesListRequest) RirId(rirId []int32) ApiIpamAsnRangesListRequest { + r.rirId = &rirId + return r +} + +// RIR (ID) +func (r ApiIpamAsnRangesListRequest) RirIdN(rirIdN []int32) ApiIpamAsnRangesListRequest { + r.rirIdN = &rirIdN + return r +} + +func (r ApiIpamAsnRangesListRequest) Start(start []int32) ApiIpamAsnRangesListRequest { + r.start = &start + return r +} + +func (r ApiIpamAsnRangesListRequest) StartEmpty(startEmpty bool) ApiIpamAsnRangesListRequest { + r.startEmpty = &startEmpty + return r +} + +func (r ApiIpamAsnRangesListRequest) StartGt(startGt []int32) ApiIpamAsnRangesListRequest { + r.startGt = &startGt + return r +} + +func (r ApiIpamAsnRangesListRequest) StartGte(startGte []int32) ApiIpamAsnRangesListRequest { + r.startGte = &startGte + return r +} + +func (r ApiIpamAsnRangesListRequest) StartLt(startLt []int32) ApiIpamAsnRangesListRequest { + r.startLt = &startLt + return r +} + +func (r ApiIpamAsnRangesListRequest) StartLte(startLte []int32) ApiIpamAsnRangesListRequest { + r.startLte = &startLte + return r +} + +func (r ApiIpamAsnRangesListRequest) StartN(startN []int32) ApiIpamAsnRangesListRequest { + r.startN = &startN + return r +} + +func (r ApiIpamAsnRangesListRequest) Tag(tag []string) ApiIpamAsnRangesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamAsnRangesListRequest) TagN(tagN []string) ApiIpamAsnRangesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamAsnRangesListRequest) Tenant(tenant []string) ApiIpamAsnRangesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamAsnRangesListRequest) TenantN(tenantN []string) ApiIpamAsnRangesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamAsnRangesListRequest) TenantGroup(tenantGroup []int32) ApiIpamAsnRangesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamAsnRangesListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamAsnRangesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamAsnRangesListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamAsnRangesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamAsnRangesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamAsnRangesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamAsnRangesListRequest) TenantId(tenantId []*int32) ApiIpamAsnRangesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamAsnRangesListRequest) TenantIdN(tenantIdN []*int32) ApiIpamAsnRangesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamAsnRangesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamAsnRangesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamAsnRangesListRequest) Execute() (*PaginatedASNRangeList, *http.Response, error) { + return r.ApiService.IpamAsnRangesListExecute(r) +} + +/* +IpamAsnRangesList Method for IpamAsnRangesList + +Get a list of ASN range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnRangesListRequest +*/ +func (a *IpamAPIService) IpamAsnRangesList(ctx context.Context) ApiIpamAsnRangesListRequest { + return ApiIpamAsnRangesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedASNRangeList +func (a *IpamAPIService) IpamAsnRangesListExecute(r ApiIpamAsnRangesListRequest) (*PaginatedASNRangeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedASNRangeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.end != nil { + t := *r.end + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "end", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "end", t, "multi") + } + } + if r.endEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__empty", r.endEmpty, "") + } + if r.endGt != nil { + t := *r.endGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__gt", t, "multi") + } + } + if r.endGte != nil { + t := *r.endGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__gte", t, "multi") + } + } + if r.endLt != nil { + t := *r.endLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__lt", t, "multi") + } + } + if r.endLte != nil { + t := *r.endLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__lte", t, "multi") + } + } + if r.endN != nil { + t := *r.endN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "end__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rir != nil { + t := *r.rir + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir", t, "multi") + } + } + if r.rirN != nil { + t := *r.rirN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir__n", t, "multi") + } + } + if r.rirId != nil { + t := *r.rirId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id", t, "multi") + } + } + if r.rirIdN != nil { + t := *r.rirIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id__n", t, "multi") + } + } + if r.start != nil { + t := *r.start + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "start", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "start", t, "multi") + } + } + if r.startEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__empty", r.startEmpty, "") + } + if r.startGt != nil { + t := *r.startGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__gt", t, "multi") + } + } + if r.startGte != nil { + t := *r.startGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__gte", t, "multi") + } + } + if r.startLt != nil { + t := *r.startLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__lt", t, "multi") + } + } + if r.startLte != nil { + t := *r.startLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__lte", t, "multi") + } + } + if r.startN != nil { + t := *r.startN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "start__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableASNRangeRequest *PatchedWritableASNRangeRequest +} + +func (r ApiIpamAsnRangesPartialUpdateRequest) PatchedWritableASNRangeRequest(patchedWritableASNRangeRequest PatchedWritableASNRangeRequest) ApiIpamAsnRangesPartialUpdateRequest { + r.patchedWritableASNRangeRequest = &patchedWritableASNRangeRequest + return r +} + +func (r ApiIpamAsnRangesPartialUpdateRequest) Execute() (*ASNRange, *http.Response, error) { + return r.ApiService.IpamAsnRangesPartialUpdateExecute(r) +} + +/* +IpamAsnRangesPartialUpdate Method for IpamAsnRangesPartialUpdate + +Patch a ASN range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN range. + @return ApiIpamAsnRangesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnRangesPartialUpdate(ctx context.Context, id int32) ApiIpamAsnRangesPartialUpdateRequest { + return ApiIpamAsnRangesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ASNRange +func (a *IpamAPIService) IpamAsnRangesPartialUpdateExecute(r ApiIpamAsnRangesPartialUpdateRequest) (*ASNRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASNRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableASNRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamAsnRangesRetrieveRequest) Execute() (*ASNRange, *http.Response, error) { + return r.ApiService.IpamAsnRangesRetrieveExecute(r) +} + +/* +IpamAsnRangesRetrieve Method for IpamAsnRangesRetrieve + +Get a ASN range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN range. + @return ApiIpamAsnRangesRetrieveRequest +*/ +func (a *IpamAPIService) IpamAsnRangesRetrieve(ctx context.Context, id int32) ApiIpamAsnRangesRetrieveRequest { + return ApiIpamAsnRangesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ASNRange +func (a *IpamAPIService) IpamAsnRangesRetrieveExecute(r ApiIpamAsnRangesRetrieveRequest) (*ASNRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASNRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnRangesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableASNRangeRequest *WritableASNRangeRequest +} + +func (r ApiIpamAsnRangesUpdateRequest) WritableASNRangeRequest(writableASNRangeRequest WritableASNRangeRequest) ApiIpamAsnRangesUpdateRequest { + r.writableASNRangeRequest = &writableASNRangeRequest + return r +} + +func (r ApiIpamAsnRangesUpdateRequest) Execute() (*ASNRange, *http.Response, error) { + return r.ApiService.IpamAsnRangesUpdateExecute(r) +} + +/* +IpamAsnRangesUpdate Method for IpamAsnRangesUpdate + +Put a ASN range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN range. + @return ApiIpamAsnRangesUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnRangesUpdate(ctx context.Context, id int32) ApiIpamAsnRangesUpdateRequest { + return ApiIpamAsnRangesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ASNRange +func (a *IpamAPIService) IpamAsnRangesUpdateExecute(r ApiIpamAsnRangesUpdateRequest) (*ASNRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASNRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnRangesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asn-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableASNRangeRequest == nil { + return localVarReturnValue, nil, reportError("writableASNRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableASNRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnsBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + aSNRequest *[]ASNRequest +} + +func (r ApiIpamAsnsBulkDestroyRequest) ASNRequest(aSNRequest []ASNRequest) ApiIpamAsnsBulkDestroyRequest { + r.aSNRequest = &aSNRequest + return r +} + +func (r ApiIpamAsnsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamAsnsBulkDestroyExecute(r) +} + +/* +IpamAsnsBulkDestroy Method for IpamAsnsBulkDestroy + +Delete a list of ASN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnsBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamAsnsBulkDestroy(ctx context.Context) ApiIpamAsnsBulkDestroyRequest { + return ApiIpamAsnsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamAsnsBulkDestroyExecute(r ApiIpamAsnsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aSNRequest == nil { + return nil, reportError("aSNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aSNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamAsnsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + aSNRequest *[]ASNRequest +} + +func (r ApiIpamAsnsBulkPartialUpdateRequest) ASNRequest(aSNRequest []ASNRequest) ApiIpamAsnsBulkPartialUpdateRequest { + r.aSNRequest = &aSNRequest + return r +} + +func (r ApiIpamAsnsBulkPartialUpdateRequest) Execute() ([]ASN, *http.Response, error) { + return r.ApiService.IpamAsnsBulkPartialUpdateExecute(r) +} + +/* +IpamAsnsBulkPartialUpdate Method for IpamAsnsBulkPartialUpdate + +Patch a list of ASN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnsBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnsBulkPartialUpdate(ctx context.Context) ApiIpamAsnsBulkPartialUpdateRequest { + return ApiIpamAsnsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ASN +func (a *IpamAPIService) IpamAsnsBulkPartialUpdateExecute(r ApiIpamAsnsBulkPartialUpdateRequest) ([]ASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aSNRequest == nil { + return localVarReturnValue, nil, reportError("aSNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aSNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnsBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + aSNRequest *[]ASNRequest +} + +func (r ApiIpamAsnsBulkUpdateRequest) ASNRequest(aSNRequest []ASNRequest) ApiIpamAsnsBulkUpdateRequest { + r.aSNRequest = &aSNRequest + return r +} + +func (r ApiIpamAsnsBulkUpdateRequest) Execute() ([]ASN, *http.Response, error) { + return r.ApiService.IpamAsnsBulkUpdateExecute(r) +} + +/* +IpamAsnsBulkUpdate Method for IpamAsnsBulkUpdate + +Put a list of ASN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnsBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnsBulkUpdate(ctx context.Context) ApiIpamAsnsBulkUpdateRequest { + return ApiIpamAsnsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ASN +func (a *IpamAPIService) IpamAsnsBulkUpdateExecute(r ApiIpamAsnsBulkUpdateRequest) ([]ASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.aSNRequest == nil { + return localVarReturnValue, nil, reportError("aSNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.aSNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableASNRequest *WritableASNRequest +} + +func (r ApiIpamAsnsCreateRequest) WritableASNRequest(writableASNRequest WritableASNRequest) ApiIpamAsnsCreateRequest { + r.writableASNRequest = &writableASNRequest + return r +} + +func (r ApiIpamAsnsCreateRequest) Execute() (*ASN, *http.Response, error) { + return r.ApiService.IpamAsnsCreateExecute(r) +} + +/* +IpamAsnsCreate Method for IpamAsnsCreate + +Post a list of ASN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnsCreateRequest +*/ +func (a *IpamAPIService) IpamAsnsCreate(ctx context.Context) ApiIpamAsnsCreateRequest { + return ApiIpamAsnsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ASN +func (a *IpamAPIService) IpamAsnsCreateExecute(r ApiIpamAsnsCreateRequest) (*ASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableASNRequest == nil { + return localVarReturnValue, nil, reportError("writableASNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableASNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnsDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamAsnsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamAsnsDestroyExecute(r) +} + +/* +IpamAsnsDestroy Method for IpamAsnsDestroy + +Delete a ASN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN. + @return ApiIpamAsnsDestroyRequest +*/ +func (a *IpamAPIService) IpamAsnsDestroy(ctx context.Context, id int32) ApiIpamAsnsDestroyRequest { + return ApiIpamAsnsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamAsnsDestroyExecute(r ApiIpamAsnsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamAsnsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + asn *[]int32 + asnEmpty *bool + asnGt *[]int32 + asnGte *[]int32 + asnLt *[]int32 + asnLte *[]int32 + asnN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + q *string + rir *[]string + rirN *[]string + rirId *[]int32 + rirIdN *[]int32 + site *[]string + siteN *[]string + siteId *[]int32 + siteIdN *[]int32 + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiIpamAsnsListRequest) Asn(asn []int32) ApiIpamAsnsListRequest { + r.asn = &asn + return r +} + +func (r ApiIpamAsnsListRequest) AsnEmpty(asnEmpty bool) ApiIpamAsnsListRequest { + r.asnEmpty = &asnEmpty + return r +} + +func (r ApiIpamAsnsListRequest) AsnGt(asnGt []int32) ApiIpamAsnsListRequest { + r.asnGt = &asnGt + return r +} + +func (r ApiIpamAsnsListRequest) AsnGte(asnGte []int32) ApiIpamAsnsListRequest { + r.asnGte = &asnGte + return r +} + +func (r ApiIpamAsnsListRequest) AsnLt(asnLt []int32) ApiIpamAsnsListRequest { + r.asnLt = &asnLt + return r +} + +func (r ApiIpamAsnsListRequest) AsnLte(asnLte []int32) ApiIpamAsnsListRequest { + r.asnLte = &asnLte + return r +} + +func (r ApiIpamAsnsListRequest) AsnN(asnN []int32) ApiIpamAsnsListRequest { + r.asnN = &asnN + return r +} + +func (r ApiIpamAsnsListRequest) Created(created []time.Time) ApiIpamAsnsListRequest { + r.created = &created + return r +} + +func (r ApiIpamAsnsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamAsnsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamAsnsListRequest) CreatedGt(createdGt []time.Time) ApiIpamAsnsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamAsnsListRequest) CreatedGte(createdGte []time.Time) ApiIpamAsnsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamAsnsListRequest) CreatedLt(createdLt []time.Time) ApiIpamAsnsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamAsnsListRequest) CreatedLte(createdLte []time.Time) ApiIpamAsnsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamAsnsListRequest) CreatedN(createdN []time.Time) ApiIpamAsnsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamAsnsListRequest) CreatedByRequest(createdByRequest string) ApiIpamAsnsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamAsnsListRequest) Description(description []string) ApiIpamAsnsListRequest { + r.description = &description + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamAsnsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionIc(descriptionIc []string) ApiIpamAsnsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionIe(descriptionIe []string) ApiIpamAsnsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionIew(descriptionIew []string) ApiIpamAsnsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamAsnsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionN(descriptionN []string) ApiIpamAsnsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionNic(descriptionNic []string) ApiIpamAsnsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionNie(descriptionNie []string) ApiIpamAsnsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamAsnsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamAsnsListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamAsnsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamAsnsListRequest) Id(id []int32) ApiIpamAsnsListRequest { + r.id = &id + return r +} + +func (r ApiIpamAsnsListRequest) IdEmpty(idEmpty bool) ApiIpamAsnsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamAsnsListRequest) IdGt(idGt []int32) ApiIpamAsnsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamAsnsListRequest) IdGte(idGte []int32) ApiIpamAsnsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamAsnsListRequest) IdLt(idLt []int32) ApiIpamAsnsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamAsnsListRequest) IdLte(idLte []int32) ApiIpamAsnsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamAsnsListRequest) IdN(idN []int32) ApiIpamAsnsListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamAsnsListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamAsnsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamAsnsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamAsnsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamAsnsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamAsnsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamAsnsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamAsnsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamAsnsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamAsnsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamAsnsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamAsnsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamAsnsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamAsnsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamAsnsListRequest) Limit(limit int32) ApiIpamAsnsListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamAsnsListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamAsnsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiIpamAsnsListRequest) Offset(offset int32) ApiIpamAsnsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamAsnsListRequest) Ordering(ordering string) ApiIpamAsnsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamAsnsListRequest) Q(q string) ApiIpamAsnsListRequest { + r.q = &q + return r +} + +// RIR (slug) +func (r ApiIpamAsnsListRequest) Rir(rir []string) ApiIpamAsnsListRequest { + r.rir = &rir + return r +} + +// RIR (slug) +func (r ApiIpamAsnsListRequest) RirN(rirN []string) ApiIpamAsnsListRequest { + r.rirN = &rirN + return r +} + +// RIR (ID) +func (r ApiIpamAsnsListRequest) RirId(rirId []int32) ApiIpamAsnsListRequest { + r.rirId = &rirId + return r +} + +// RIR (ID) +func (r ApiIpamAsnsListRequest) RirIdN(rirIdN []int32) ApiIpamAsnsListRequest { + r.rirIdN = &rirIdN + return r +} + +// Site (slug) +func (r ApiIpamAsnsListRequest) Site(site []string) ApiIpamAsnsListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiIpamAsnsListRequest) SiteN(siteN []string) ApiIpamAsnsListRequest { + r.siteN = &siteN + return r +} + +// Site (ID) +func (r ApiIpamAsnsListRequest) SiteId(siteId []int32) ApiIpamAsnsListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiIpamAsnsListRequest) SiteIdN(siteIdN []int32) ApiIpamAsnsListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiIpamAsnsListRequest) Tag(tag []string) ApiIpamAsnsListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamAsnsListRequest) TagN(tagN []string) ApiIpamAsnsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamAsnsListRequest) Tenant(tenant []string) ApiIpamAsnsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamAsnsListRequest) TenantN(tenantN []string) ApiIpamAsnsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamAsnsListRequest) TenantGroup(tenantGroup []int32) ApiIpamAsnsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamAsnsListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamAsnsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamAsnsListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamAsnsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamAsnsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamAsnsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamAsnsListRequest) TenantId(tenantId []*int32) ApiIpamAsnsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamAsnsListRequest) TenantIdN(tenantIdN []*int32) ApiIpamAsnsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamAsnsListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamAsnsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamAsnsListRequest) Execute() (*PaginatedASNList, *http.Response, error) { + return r.ApiService.IpamAsnsListExecute(r) +} + +/* +IpamAsnsList Method for IpamAsnsList + +Get a list of ASN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamAsnsListRequest +*/ +func (a *IpamAPIService) IpamAsnsList(ctx context.Context) ApiIpamAsnsListRequest { + return ApiIpamAsnsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedASNList +func (a *IpamAPIService) IpamAsnsListExecute(r ApiIpamAsnsListRequest) (*PaginatedASNList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedASNList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.asn != nil { + t := *r.asn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn", t, "multi") + } + } + if r.asnEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__empty", r.asnEmpty, "") + } + if r.asnGt != nil { + t := *r.asnGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__gt", t, "multi") + } + } + if r.asnGte != nil { + t := *r.asnGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__gte", t, "multi") + } + } + if r.asnLt != nil { + t := *r.asnLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__lt", t, "multi") + } + } + if r.asnLte != nil { + t := *r.asnLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__lte", t, "multi") + } + } + if r.asnN != nil { + t := *r.asnN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "asn__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rir != nil { + t := *r.rir + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir", t, "multi") + } + } + if r.rirN != nil { + t := *r.rirN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir__n", t, "multi") + } + } + if r.rirId != nil { + t := *r.rirId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id", t, "multi") + } + } + if r.rirIdN != nil { + t := *r.rirIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rir_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnsPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableASNRequest *PatchedWritableASNRequest +} + +func (r ApiIpamAsnsPartialUpdateRequest) PatchedWritableASNRequest(patchedWritableASNRequest PatchedWritableASNRequest) ApiIpamAsnsPartialUpdateRequest { + r.patchedWritableASNRequest = &patchedWritableASNRequest + return r +} + +func (r ApiIpamAsnsPartialUpdateRequest) Execute() (*ASN, *http.Response, error) { + return r.ApiService.IpamAsnsPartialUpdateExecute(r) +} + +/* +IpamAsnsPartialUpdate Method for IpamAsnsPartialUpdate + +Patch a ASN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN. + @return ApiIpamAsnsPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnsPartialUpdate(ctx context.Context, id int32) ApiIpamAsnsPartialUpdateRequest { + return ApiIpamAsnsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ASN +func (a *IpamAPIService) IpamAsnsPartialUpdateExecute(r ApiIpamAsnsPartialUpdateRequest) (*ASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableASNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnsRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamAsnsRetrieveRequest) Execute() (*ASN, *http.Response, error) { + return r.ApiService.IpamAsnsRetrieveExecute(r) +} + +/* +IpamAsnsRetrieve Method for IpamAsnsRetrieve + +Get a ASN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN. + @return ApiIpamAsnsRetrieveRequest +*/ +func (a *IpamAPIService) IpamAsnsRetrieve(ctx context.Context, id int32) ApiIpamAsnsRetrieveRequest { + return ApiIpamAsnsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ASN +func (a *IpamAPIService) IpamAsnsRetrieveExecute(r ApiIpamAsnsRetrieveRequest) (*ASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamAsnsUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableASNRequest *WritableASNRequest +} + +func (r ApiIpamAsnsUpdateRequest) WritableASNRequest(writableASNRequest WritableASNRequest) ApiIpamAsnsUpdateRequest { + r.writableASNRequest = &writableASNRequest + return r +} + +func (r ApiIpamAsnsUpdateRequest) Execute() (*ASN, *http.Response, error) { + return r.ApiService.IpamAsnsUpdateExecute(r) +} + +/* +IpamAsnsUpdate Method for IpamAsnsUpdate + +Put a ASN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this ASN. + @return ApiIpamAsnsUpdateRequest +*/ +func (a *IpamAPIService) IpamAsnsUpdate(ctx context.Context, id int32) ApiIpamAsnsUpdateRequest { + return ApiIpamAsnsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ASN +func (a *IpamAPIService) IpamAsnsUpdateExecute(r ApiIpamAsnsUpdateRequest) (*ASN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ASN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamAsnsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/asns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableASNRequest == nil { + return localVarReturnValue, nil, reportError("writableASNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableASNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + fHRPGroupAssignmentRequest *[]FHRPGroupAssignmentRequest +} + +func (r ApiIpamFhrpGroupAssignmentsBulkDestroyRequest) FHRPGroupAssignmentRequest(fHRPGroupAssignmentRequest []FHRPGroupAssignmentRequest) ApiIpamFhrpGroupAssignmentsBulkDestroyRequest { + r.fHRPGroupAssignmentRequest = &fHRPGroupAssignmentRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsBulkDestroyExecute(r) +} + +/* +IpamFhrpGroupAssignmentsBulkDestroy Method for IpamFhrpGroupAssignmentsBulkDestroy + +Delete a list of FHRP group assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupAssignmentsBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsBulkDestroy(ctx context.Context) ApiIpamFhrpGroupAssignmentsBulkDestroyRequest { + return ApiIpamFhrpGroupAssignmentsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamFhrpGroupAssignmentsBulkDestroyExecute(r ApiIpamFhrpGroupAssignmentsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupAssignmentRequest == nil { + return nil, reportError("fHRPGroupAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + fHRPGroupAssignmentRequest *[]FHRPGroupAssignmentRequest +} + +func (r ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest) FHRPGroupAssignmentRequest(fHRPGroupAssignmentRequest []FHRPGroupAssignmentRequest) ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest { + r.fHRPGroupAssignmentRequest = &fHRPGroupAssignmentRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest) Execute() ([]FHRPGroupAssignment, *http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsBulkPartialUpdateExecute(r) +} + +/* +IpamFhrpGroupAssignmentsBulkPartialUpdate Method for IpamFhrpGroupAssignmentsBulkPartialUpdate + +Patch a list of FHRP group assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsBulkPartialUpdate(ctx context.Context) ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest { + return ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FHRPGroupAssignment +func (a *IpamAPIService) IpamFhrpGroupAssignmentsBulkPartialUpdateExecute(r ApiIpamFhrpGroupAssignmentsBulkPartialUpdateRequest) ([]FHRPGroupAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FHRPGroupAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("fHRPGroupAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + fHRPGroupAssignmentRequest *[]FHRPGroupAssignmentRequest +} + +func (r ApiIpamFhrpGroupAssignmentsBulkUpdateRequest) FHRPGroupAssignmentRequest(fHRPGroupAssignmentRequest []FHRPGroupAssignmentRequest) ApiIpamFhrpGroupAssignmentsBulkUpdateRequest { + r.fHRPGroupAssignmentRequest = &fHRPGroupAssignmentRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsBulkUpdateRequest) Execute() ([]FHRPGroupAssignment, *http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsBulkUpdateExecute(r) +} + +/* +IpamFhrpGroupAssignmentsBulkUpdate Method for IpamFhrpGroupAssignmentsBulkUpdate + +Put a list of FHRP group assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupAssignmentsBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsBulkUpdate(ctx context.Context) ApiIpamFhrpGroupAssignmentsBulkUpdateRequest { + return ApiIpamFhrpGroupAssignmentsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FHRPGroupAssignment +func (a *IpamAPIService) IpamFhrpGroupAssignmentsBulkUpdateExecute(r ApiIpamFhrpGroupAssignmentsBulkUpdateRequest) ([]FHRPGroupAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FHRPGroupAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("fHRPGroupAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableFHRPGroupAssignmentRequest *WritableFHRPGroupAssignmentRequest +} + +func (r ApiIpamFhrpGroupAssignmentsCreateRequest) WritableFHRPGroupAssignmentRequest(writableFHRPGroupAssignmentRequest WritableFHRPGroupAssignmentRequest) ApiIpamFhrpGroupAssignmentsCreateRequest { + r.writableFHRPGroupAssignmentRequest = &writableFHRPGroupAssignmentRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsCreateRequest) Execute() (*FHRPGroupAssignment, *http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsCreateExecute(r) +} + +/* +IpamFhrpGroupAssignmentsCreate Method for IpamFhrpGroupAssignmentsCreate + +Post a list of FHRP group assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupAssignmentsCreateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsCreate(ctx context.Context) ApiIpamFhrpGroupAssignmentsCreateRequest { + return ApiIpamFhrpGroupAssignmentsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FHRPGroupAssignment +func (a *IpamAPIService) IpamFhrpGroupAssignmentsCreateExecute(r ApiIpamFhrpGroupAssignmentsCreateRequest) (*FHRPGroupAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroupAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableFHRPGroupAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("writableFHRPGroupAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableFHRPGroupAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamFhrpGroupAssignmentsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsDestroyExecute(r) +} + +/* +IpamFhrpGroupAssignmentsDestroy Method for IpamFhrpGroupAssignmentsDestroy + +Delete a FHRP group assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group assignment. + @return ApiIpamFhrpGroupAssignmentsDestroyRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsDestroy(ctx context.Context, id int32) ApiIpamFhrpGroupAssignmentsDestroyRequest { + return ApiIpamFhrpGroupAssignmentsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamFhrpGroupAssignmentsDestroyExecute(r ApiIpamFhrpGroupAssignmentsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + device *[]string + deviceId *[]int32 + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interfaceId *[]int32 + interfaceIdEmpty *bool + interfaceIdGt *[]int32 + interfaceIdGte *[]int32 + interfaceIdLt *[]int32 + interfaceIdLte *[]int32 + interfaceIdN *[]int32 + interfaceType *string + interfaceTypeN *string + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + priority *[]int32 + priorityEmpty *bool + priorityGt *[]int32 + priorityGte *[]int32 + priorityLt *[]int32 + priorityLte *[]int32 + priorityN *[]int32 + updatedByRequest *string + virtualMachine *[]string + virtualMachineId *[]int32 +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) Created(created []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.created = &created + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) CreatedGt(createdGt []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) CreatedGte(createdGte []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) CreatedLt(createdLt []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) CreatedLte(createdLte []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) CreatedN(createdN []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) CreatedByRequest(createdByRequest string) ApiIpamFhrpGroupAssignmentsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) Device(device []string) ApiIpamFhrpGroupAssignmentsListRequest { + r.device = &device + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) DeviceId(deviceId []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.deviceId = &deviceId + return r +} + +// Group (ID) +func (r ApiIpamFhrpGroupAssignmentsListRequest) GroupId(groupId []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.groupId = &groupId + return r +} + +// Group (ID) +func (r ApiIpamFhrpGroupAssignmentsListRequest) GroupIdN(groupIdN []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) Id(id []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.id = &id + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) IdEmpty(idEmpty bool) ApiIpamFhrpGroupAssignmentsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) IdGt(idGt []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) IdGte(idGte []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) IdLt(idLt []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) IdLte(idLte []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) IdN(idN []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceId(interfaceId []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceId = &interfaceId + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceIdEmpty(interfaceIdEmpty bool) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceIdEmpty = &interfaceIdEmpty + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceIdGt(interfaceIdGt []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceIdGt = &interfaceIdGt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceIdGte(interfaceIdGte []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceIdGte = &interfaceIdGte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceIdLt(interfaceIdLt []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceIdLt = &interfaceIdLt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceIdLte(interfaceIdLte []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceIdLte = &interfaceIdLte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceIdN(interfaceIdN []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceIdN = &interfaceIdN + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceType(interfaceType string) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceType = &interfaceType + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) InterfaceTypeN(interfaceTypeN string) ApiIpamFhrpGroupAssignmentsListRequest { + r.interfaceTypeN = &interfaceTypeN + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamFhrpGroupAssignmentsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamFhrpGroupAssignmentsListRequest) Limit(limit int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamFhrpGroupAssignmentsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiIpamFhrpGroupAssignmentsListRequest) Offset(offset int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamFhrpGroupAssignmentsListRequest) Ordering(ordering string) ApiIpamFhrpGroupAssignmentsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) Priority(priority []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.priority = &priority + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) PriorityEmpty(priorityEmpty bool) ApiIpamFhrpGroupAssignmentsListRequest { + r.priorityEmpty = &priorityEmpty + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) PriorityGt(priorityGt []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.priorityGt = &priorityGt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) PriorityGte(priorityGte []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.priorityGte = &priorityGte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) PriorityLt(priorityLt []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.priorityLt = &priorityLt + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) PriorityLte(priorityLte []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.priorityLte = &priorityLte + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) PriorityN(priorityN []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.priorityN = &priorityN + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamFhrpGroupAssignmentsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) VirtualMachine(virtualMachine []string) ApiIpamFhrpGroupAssignmentsListRequest { + r.virtualMachine = &virtualMachine + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) VirtualMachineId(virtualMachineId []int32) ApiIpamFhrpGroupAssignmentsListRequest { + r.virtualMachineId = &virtualMachineId + return r +} + +func (r ApiIpamFhrpGroupAssignmentsListRequest) Execute() (*PaginatedFHRPGroupAssignmentList, *http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsListExecute(r) +} + +/* +IpamFhrpGroupAssignmentsList Method for IpamFhrpGroupAssignmentsList + +Get a list of FHRP group assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupAssignmentsListRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsList(ctx context.Context) ApiIpamFhrpGroupAssignmentsListRequest { + return ApiIpamFhrpGroupAssignmentsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedFHRPGroupAssignmentList +func (a *IpamAPIService) IpamFhrpGroupAssignmentsListExecute(r ApiIpamFhrpGroupAssignmentsListRequest) (*PaginatedFHRPGroupAssignmentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedFHRPGroupAssignmentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interfaceId != nil { + t := *r.interfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", t, "multi") + } + } + if r.interfaceIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__empty", r.interfaceIdEmpty, "") + } + if r.interfaceIdGt != nil { + t := *r.interfaceIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__gt", t, "multi") + } + } + if r.interfaceIdGte != nil { + t := *r.interfaceIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__gte", t, "multi") + } + } + if r.interfaceIdLt != nil { + t := *r.interfaceIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__lt", t, "multi") + } + } + if r.interfaceIdLte != nil { + t := *r.interfaceIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__lte", t, "multi") + } + } + if r.interfaceIdN != nil { + t := *r.interfaceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", t, "multi") + } + } + if r.interfaceType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_type", r.interfaceType, "") + } + if r.interfaceTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_type__n", r.interfaceTypeN, "") + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.priority != nil { + t := *r.priority + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority", t, "multi") + } + } + if r.priorityEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__empty", r.priorityEmpty, "") + } + if r.priorityGt != nil { + t := *r.priorityGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__gt", t, "multi") + } + } + if r.priorityGte != nil { + t := *r.priorityGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__gte", t, "multi") + } + } + if r.priorityLt != nil { + t := *r.priorityLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__lt", t, "multi") + } + } + if r.priorityLte != nil { + t := *r.priorityLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__lte", t, "multi") + } + } + if r.priorityN != nil { + t := *r.priorityN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualMachine != nil { + t := *r.virtualMachine + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", t, "multi") + } + } + if r.virtualMachineId != nil { + t := *r.virtualMachineId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableFHRPGroupAssignmentRequest *PatchedWritableFHRPGroupAssignmentRequest +} + +func (r ApiIpamFhrpGroupAssignmentsPartialUpdateRequest) PatchedWritableFHRPGroupAssignmentRequest(patchedWritableFHRPGroupAssignmentRequest PatchedWritableFHRPGroupAssignmentRequest) ApiIpamFhrpGroupAssignmentsPartialUpdateRequest { + r.patchedWritableFHRPGroupAssignmentRequest = &patchedWritableFHRPGroupAssignmentRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsPartialUpdateRequest) Execute() (*FHRPGroupAssignment, *http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsPartialUpdateExecute(r) +} + +/* +IpamFhrpGroupAssignmentsPartialUpdate Method for IpamFhrpGroupAssignmentsPartialUpdate + +Patch a FHRP group assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group assignment. + @return ApiIpamFhrpGroupAssignmentsPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsPartialUpdate(ctx context.Context, id int32) ApiIpamFhrpGroupAssignmentsPartialUpdateRequest { + return ApiIpamFhrpGroupAssignmentsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FHRPGroupAssignment +func (a *IpamAPIService) IpamFhrpGroupAssignmentsPartialUpdateExecute(r ApiIpamFhrpGroupAssignmentsPartialUpdateRequest) (*FHRPGroupAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroupAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableFHRPGroupAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamFhrpGroupAssignmentsRetrieveRequest) Execute() (*FHRPGroupAssignment, *http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsRetrieveExecute(r) +} + +/* +IpamFhrpGroupAssignmentsRetrieve Method for IpamFhrpGroupAssignmentsRetrieve + +Get a FHRP group assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group assignment. + @return ApiIpamFhrpGroupAssignmentsRetrieveRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsRetrieve(ctx context.Context, id int32) ApiIpamFhrpGroupAssignmentsRetrieveRequest { + return ApiIpamFhrpGroupAssignmentsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FHRPGroupAssignment +func (a *IpamAPIService) IpamFhrpGroupAssignmentsRetrieveExecute(r ApiIpamFhrpGroupAssignmentsRetrieveRequest) (*FHRPGroupAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroupAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupAssignmentsUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableFHRPGroupAssignmentRequest *WritableFHRPGroupAssignmentRequest +} + +func (r ApiIpamFhrpGroupAssignmentsUpdateRequest) WritableFHRPGroupAssignmentRequest(writableFHRPGroupAssignmentRequest WritableFHRPGroupAssignmentRequest) ApiIpamFhrpGroupAssignmentsUpdateRequest { + r.writableFHRPGroupAssignmentRequest = &writableFHRPGroupAssignmentRequest + return r +} + +func (r ApiIpamFhrpGroupAssignmentsUpdateRequest) Execute() (*FHRPGroupAssignment, *http.Response, error) { + return r.ApiService.IpamFhrpGroupAssignmentsUpdateExecute(r) +} + +/* +IpamFhrpGroupAssignmentsUpdate Method for IpamFhrpGroupAssignmentsUpdate + +Put a FHRP group assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group assignment. + @return ApiIpamFhrpGroupAssignmentsUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupAssignmentsUpdate(ctx context.Context, id int32) ApiIpamFhrpGroupAssignmentsUpdateRequest { + return ApiIpamFhrpGroupAssignmentsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FHRPGroupAssignment +func (a *IpamAPIService) IpamFhrpGroupAssignmentsUpdateExecute(r ApiIpamFhrpGroupAssignmentsUpdateRequest) (*FHRPGroupAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroupAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupAssignmentsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-group-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableFHRPGroupAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("writableFHRPGroupAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableFHRPGroupAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + fHRPGroupRequest *[]FHRPGroupRequest +} + +func (r ApiIpamFhrpGroupsBulkDestroyRequest) FHRPGroupRequest(fHRPGroupRequest []FHRPGroupRequest) ApiIpamFhrpGroupsBulkDestroyRequest { + r.fHRPGroupRequest = &fHRPGroupRequest + return r +} + +func (r ApiIpamFhrpGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamFhrpGroupsBulkDestroyExecute(r) +} + +/* +IpamFhrpGroupsBulkDestroy Method for IpamFhrpGroupsBulkDestroy + +Delete a list of FHRP group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupsBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsBulkDestroy(ctx context.Context) ApiIpamFhrpGroupsBulkDestroyRequest { + return ApiIpamFhrpGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamFhrpGroupsBulkDestroyExecute(r ApiIpamFhrpGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupRequest == nil { + return nil, reportError("fHRPGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + fHRPGroupRequest *[]FHRPGroupRequest +} + +func (r ApiIpamFhrpGroupsBulkPartialUpdateRequest) FHRPGroupRequest(fHRPGroupRequest []FHRPGroupRequest) ApiIpamFhrpGroupsBulkPartialUpdateRequest { + r.fHRPGroupRequest = &fHRPGroupRequest + return r +} + +func (r ApiIpamFhrpGroupsBulkPartialUpdateRequest) Execute() ([]FHRPGroup, *http.Response, error) { + return r.ApiService.IpamFhrpGroupsBulkPartialUpdateExecute(r) +} + +/* +IpamFhrpGroupsBulkPartialUpdate Method for IpamFhrpGroupsBulkPartialUpdate + +Patch a list of FHRP group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupsBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsBulkPartialUpdate(ctx context.Context) ApiIpamFhrpGroupsBulkPartialUpdateRequest { + return ApiIpamFhrpGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FHRPGroup +func (a *IpamAPIService) IpamFhrpGroupsBulkPartialUpdateExecute(r ApiIpamFhrpGroupsBulkPartialUpdateRequest) ([]FHRPGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FHRPGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupRequest == nil { + return localVarReturnValue, nil, reportError("fHRPGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + fHRPGroupRequest *[]FHRPGroupRequest +} + +func (r ApiIpamFhrpGroupsBulkUpdateRequest) FHRPGroupRequest(fHRPGroupRequest []FHRPGroupRequest) ApiIpamFhrpGroupsBulkUpdateRequest { + r.fHRPGroupRequest = &fHRPGroupRequest + return r +} + +func (r ApiIpamFhrpGroupsBulkUpdateRequest) Execute() ([]FHRPGroup, *http.Response, error) { + return r.ApiService.IpamFhrpGroupsBulkUpdateExecute(r) +} + +/* +IpamFhrpGroupsBulkUpdate Method for IpamFhrpGroupsBulkUpdate + +Put a list of FHRP group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupsBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsBulkUpdate(ctx context.Context) ApiIpamFhrpGroupsBulkUpdateRequest { + return ApiIpamFhrpGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FHRPGroup +func (a *IpamAPIService) IpamFhrpGroupsBulkUpdateExecute(r ApiIpamFhrpGroupsBulkUpdateRequest) ([]FHRPGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FHRPGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupRequest == nil { + return localVarReturnValue, nil, reportError("fHRPGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + fHRPGroupRequest *FHRPGroupRequest +} + +func (r ApiIpamFhrpGroupsCreateRequest) FHRPGroupRequest(fHRPGroupRequest FHRPGroupRequest) ApiIpamFhrpGroupsCreateRequest { + r.fHRPGroupRequest = &fHRPGroupRequest + return r +} + +func (r ApiIpamFhrpGroupsCreateRequest) Execute() (*FHRPGroup, *http.Response, error) { + return r.ApiService.IpamFhrpGroupsCreateExecute(r) +} + +/* +IpamFhrpGroupsCreate Method for IpamFhrpGroupsCreate + +Post a list of FHRP group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupsCreateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsCreate(ctx context.Context) ApiIpamFhrpGroupsCreateRequest { + return ApiIpamFhrpGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FHRPGroup +func (a *IpamAPIService) IpamFhrpGroupsCreateExecute(r ApiIpamFhrpGroupsCreateRequest) (*FHRPGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupRequest == nil { + return localVarReturnValue, nil, reportError("fHRPGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamFhrpGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamFhrpGroupsDestroyExecute(r) +} + +/* +IpamFhrpGroupsDestroy Method for IpamFhrpGroupsDestroy + +Delete a FHRP group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group. + @return ApiIpamFhrpGroupsDestroyRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsDestroy(ctx context.Context, id int32) ApiIpamFhrpGroupsDestroyRequest { + return ApiIpamFhrpGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamFhrpGroupsDestroyExecute(r ApiIpamFhrpGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + authKey *[]string + authKeyEmpty *bool + authKeyIc *[]string + authKeyIe *[]string + authKeyIew *[]string + authKeyIsw *[]string + authKeyN *[]string + authKeyNic *[]string + authKeyNie *[]string + authKeyNiew *[]string + authKeyNisw *[]string + authType *[]string + authTypeN *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + groupId *[]int32 + groupIdEmpty *bool + groupIdGt *[]int32 + groupIdGte *[]int32 + groupIdLt *[]int32 + groupIdLte *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + protocol *[]string + protocolN *[]string + q *string + relatedIp *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKey(authKey []string) ApiIpamFhrpGroupsListRequest { + r.authKey = &authKey + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyEmpty(authKeyEmpty bool) ApiIpamFhrpGroupsListRequest { + r.authKeyEmpty = &authKeyEmpty + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyIc(authKeyIc []string) ApiIpamFhrpGroupsListRequest { + r.authKeyIc = &authKeyIc + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyIe(authKeyIe []string) ApiIpamFhrpGroupsListRequest { + r.authKeyIe = &authKeyIe + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyIew(authKeyIew []string) ApiIpamFhrpGroupsListRequest { + r.authKeyIew = &authKeyIew + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyIsw(authKeyIsw []string) ApiIpamFhrpGroupsListRequest { + r.authKeyIsw = &authKeyIsw + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyN(authKeyN []string) ApiIpamFhrpGroupsListRequest { + r.authKeyN = &authKeyN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyNic(authKeyNic []string) ApiIpamFhrpGroupsListRequest { + r.authKeyNic = &authKeyNic + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyNie(authKeyNie []string) ApiIpamFhrpGroupsListRequest { + r.authKeyNie = &authKeyNie + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyNiew(authKeyNiew []string) ApiIpamFhrpGroupsListRequest { + r.authKeyNiew = &authKeyNiew + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthKeyNisw(authKeyNisw []string) ApiIpamFhrpGroupsListRequest { + r.authKeyNisw = &authKeyNisw + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthType(authType []string) ApiIpamFhrpGroupsListRequest { + r.authType = &authType + return r +} + +func (r ApiIpamFhrpGroupsListRequest) AuthTypeN(authTypeN []string) ApiIpamFhrpGroupsListRequest { + r.authTypeN = &authTypeN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) Created(created []time.Time) ApiIpamFhrpGroupsListRequest { + r.created = &created + return r +} + +func (r ApiIpamFhrpGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamFhrpGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamFhrpGroupsListRequest) CreatedGt(createdGt []time.Time) ApiIpamFhrpGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) CreatedGte(createdGte []time.Time) ApiIpamFhrpGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) CreatedLt(createdLt []time.Time) ApiIpamFhrpGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) CreatedLte(createdLte []time.Time) ApiIpamFhrpGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) CreatedN(createdN []time.Time) ApiIpamFhrpGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) CreatedByRequest(createdByRequest string) ApiIpamFhrpGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamFhrpGroupsListRequest) Description(description []string) ApiIpamFhrpGroupsListRequest { + r.description = &description + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamFhrpGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionIc(descriptionIc []string) ApiIpamFhrpGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionIe(descriptionIe []string) ApiIpamFhrpGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionIew(descriptionIew []string) ApiIpamFhrpGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamFhrpGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionN(descriptionN []string) ApiIpamFhrpGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionNic(descriptionNic []string) ApiIpamFhrpGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionNie(descriptionNie []string) ApiIpamFhrpGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamFhrpGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamFhrpGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamFhrpGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamFhrpGroupsListRequest) GroupId(groupId []int32) ApiIpamFhrpGroupsListRequest { + r.groupId = &groupId + return r +} + +func (r ApiIpamFhrpGroupsListRequest) GroupIdEmpty(groupIdEmpty bool) ApiIpamFhrpGroupsListRequest { + r.groupIdEmpty = &groupIdEmpty + return r +} + +func (r ApiIpamFhrpGroupsListRequest) GroupIdGt(groupIdGt []int32) ApiIpamFhrpGroupsListRequest { + r.groupIdGt = &groupIdGt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) GroupIdGte(groupIdGte []int32) ApiIpamFhrpGroupsListRequest { + r.groupIdGte = &groupIdGte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) GroupIdLt(groupIdLt []int32) ApiIpamFhrpGroupsListRequest { + r.groupIdLt = &groupIdLt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) GroupIdLte(groupIdLte []int32) ApiIpamFhrpGroupsListRequest { + r.groupIdLte = &groupIdLte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) GroupIdN(groupIdN []int32) ApiIpamFhrpGroupsListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) Id(id []int32) ApiIpamFhrpGroupsListRequest { + r.id = &id + return r +} + +func (r ApiIpamFhrpGroupsListRequest) IdEmpty(idEmpty bool) ApiIpamFhrpGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamFhrpGroupsListRequest) IdGt(idGt []int32) ApiIpamFhrpGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) IdGte(idGte []int32) ApiIpamFhrpGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) IdLt(idLt []int32) ApiIpamFhrpGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) IdLte(idLte []int32) ApiIpamFhrpGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) IdN(idN []int32) ApiIpamFhrpGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamFhrpGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamFhrpGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamFhrpGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamFhrpGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamFhrpGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamFhrpGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamFhrpGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamFhrpGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamFhrpGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamFhrpGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamFhrpGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamFhrpGroupsListRequest) Limit(limit int32) ApiIpamFhrpGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamFhrpGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamFhrpGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamFhrpGroupsListRequest) Name(name []string) ApiIpamFhrpGroupsListRequest { + r.name = &name + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameEmpty(nameEmpty bool) ApiIpamFhrpGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameIc(nameIc []string) ApiIpamFhrpGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameIe(nameIe []string) ApiIpamFhrpGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameIew(nameIew []string) ApiIpamFhrpGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameIsw(nameIsw []string) ApiIpamFhrpGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameN(nameN []string) ApiIpamFhrpGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameNic(nameNic []string) ApiIpamFhrpGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameNie(nameNie []string) ApiIpamFhrpGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameNiew(nameNiew []string) ApiIpamFhrpGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamFhrpGroupsListRequest) NameNisw(nameNisw []string) ApiIpamFhrpGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamFhrpGroupsListRequest) Offset(offset int32) ApiIpamFhrpGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamFhrpGroupsListRequest) Ordering(ordering string) ApiIpamFhrpGroupsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiIpamFhrpGroupsListRequest) Protocol(protocol []string) ApiIpamFhrpGroupsListRequest { + r.protocol = &protocol + return r +} + +func (r ApiIpamFhrpGroupsListRequest) ProtocolN(protocolN []string) ApiIpamFhrpGroupsListRequest { + r.protocolN = &protocolN + return r +} + +// Search +func (r ApiIpamFhrpGroupsListRequest) Q(q string) ApiIpamFhrpGroupsListRequest { + r.q = &q + return r +} + +func (r ApiIpamFhrpGroupsListRequest) RelatedIp(relatedIp []string) ApiIpamFhrpGroupsListRequest { + r.relatedIp = &relatedIp + return r +} + +func (r ApiIpamFhrpGroupsListRequest) Tag(tag []string) ApiIpamFhrpGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamFhrpGroupsListRequest) TagN(tagN []string) ApiIpamFhrpGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiIpamFhrpGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamFhrpGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamFhrpGroupsListRequest) Execute() (*PaginatedFHRPGroupList, *http.Response, error) { + return r.ApiService.IpamFhrpGroupsListExecute(r) +} + +/* +IpamFhrpGroupsList Method for IpamFhrpGroupsList + +Get a list of FHRP group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamFhrpGroupsListRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsList(ctx context.Context) ApiIpamFhrpGroupsListRequest { + return ApiIpamFhrpGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedFHRPGroupList +func (a *IpamAPIService) IpamFhrpGroupsListExecute(r ApiIpamFhrpGroupsListRequest) (*PaginatedFHRPGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedFHRPGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.authKey != nil { + t := *r.authKey + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key", t, "multi") + } + } + if r.authKeyEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__empty", r.authKeyEmpty, "") + } + if r.authKeyIc != nil { + t := *r.authKeyIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__ic", t, "multi") + } + } + if r.authKeyIe != nil { + t := *r.authKeyIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__ie", t, "multi") + } + } + if r.authKeyIew != nil { + t := *r.authKeyIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__iew", t, "multi") + } + } + if r.authKeyIsw != nil { + t := *r.authKeyIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__isw", t, "multi") + } + } + if r.authKeyN != nil { + t := *r.authKeyN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__n", t, "multi") + } + } + if r.authKeyNic != nil { + t := *r.authKeyNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__nic", t, "multi") + } + } + if r.authKeyNie != nil { + t := *r.authKeyNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__nie", t, "multi") + } + } + if r.authKeyNiew != nil { + t := *r.authKeyNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__niew", t, "multi") + } + } + if r.authKeyNisw != nil { + t := *r.authKeyNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_key__nisw", t, "multi") + } + } + if r.authType != nil { + t := *r.authType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type", t, "multi") + } + } + if r.authTypeN != nil { + t := *r.authTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__empty", r.groupIdEmpty, "") + } + if r.groupIdGt != nil { + t := *r.groupIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__gt", t, "multi") + } + } + if r.groupIdGte != nil { + t := *r.groupIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__gte", t, "multi") + } + } + if r.groupIdLt != nil { + t := *r.groupIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__lt", t, "multi") + } + } + if r.groupIdLte != nil { + t := *r.groupIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__lte", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.protocol != nil { + t := *r.protocol + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", t, "multi") + } + } + if r.protocolN != nil { + t := *r.protocolN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.relatedIp != nil { + t := *r.relatedIp + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "related_ip", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "related_ip", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedFHRPGroupRequest *PatchedFHRPGroupRequest +} + +func (r ApiIpamFhrpGroupsPartialUpdateRequest) PatchedFHRPGroupRequest(patchedFHRPGroupRequest PatchedFHRPGroupRequest) ApiIpamFhrpGroupsPartialUpdateRequest { + r.patchedFHRPGroupRequest = &patchedFHRPGroupRequest + return r +} + +func (r ApiIpamFhrpGroupsPartialUpdateRequest) Execute() (*FHRPGroup, *http.Response, error) { + return r.ApiService.IpamFhrpGroupsPartialUpdateExecute(r) +} + +/* +IpamFhrpGroupsPartialUpdate Method for IpamFhrpGroupsPartialUpdate + +Patch a FHRP group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group. + @return ApiIpamFhrpGroupsPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsPartialUpdate(ctx context.Context, id int32) ApiIpamFhrpGroupsPartialUpdateRequest { + return ApiIpamFhrpGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FHRPGroup +func (a *IpamAPIService) IpamFhrpGroupsPartialUpdateExecute(r ApiIpamFhrpGroupsPartialUpdateRequest) (*FHRPGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedFHRPGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamFhrpGroupsRetrieveRequest) Execute() (*FHRPGroup, *http.Response, error) { + return r.ApiService.IpamFhrpGroupsRetrieveExecute(r) +} + +/* +IpamFhrpGroupsRetrieve Method for IpamFhrpGroupsRetrieve + +Get a FHRP group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group. + @return ApiIpamFhrpGroupsRetrieveRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsRetrieve(ctx context.Context, id int32) ApiIpamFhrpGroupsRetrieveRequest { + return ApiIpamFhrpGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FHRPGroup +func (a *IpamAPIService) IpamFhrpGroupsRetrieveExecute(r ApiIpamFhrpGroupsRetrieveRequest) (*FHRPGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamFhrpGroupsUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + fHRPGroupRequest *FHRPGroupRequest +} + +func (r ApiIpamFhrpGroupsUpdateRequest) FHRPGroupRequest(fHRPGroupRequest FHRPGroupRequest) ApiIpamFhrpGroupsUpdateRequest { + r.fHRPGroupRequest = &fHRPGroupRequest + return r +} + +func (r ApiIpamFhrpGroupsUpdateRequest) Execute() (*FHRPGroup, *http.Response, error) { + return r.ApiService.IpamFhrpGroupsUpdateExecute(r) +} + +/* +IpamFhrpGroupsUpdate Method for IpamFhrpGroupsUpdate + +Put a FHRP group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this FHRP group. + @return ApiIpamFhrpGroupsUpdateRequest +*/ +func (a *IpamAPIService) IpamFhrpGroupsUpdate(ctx context.Context, id int32) ApiIpamFhrpGroupsUpdateRequest { + return ApiIpamFhrpGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FHRPGroup +func (a *IpamAPIService) IpamFhrpGroupsUpdateExecute(r ApiIpamFhrpGroupsUpdateRequest) (*FHRPGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FHRPGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamFhrpGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/fhrp-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fHRPGroupRequest == nil { + return localVarReturnValue, nil, reportError("fHRPGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fHRPGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + iPAddressRequest *[]IPAddressRequest +} + +func (r ApiIpamIpAddressesBulkDestroyRequest) IPAddressRequest(iPAddressRequest []IPAddressRequest) ApiIpamIpAddressesBulkDestroyRequest { + r.iPAddressRequest = &iPAddressRequest + return r +} + +func (r ApiIpamIpAddressesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamIpAddressesBulkDestroyExecute(r) +} + +/* +IpamIpAddressesBulkDestroy Method for IpamIpAddressesBulkDestroy + +Delete a list of IP address objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpAddressesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamIpAddressesBulkDestroy(ctx context.Context) ApiIpamIpAddressesBulkDestroyRequest { + return ApiIpamIpAddressesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamIpAddressesBulkDestroyExecute(r ApiIpamIpAddressesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPAddressRequest == nil { + return nil, reportError("iPAddressRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + iPAddressRequest *[]IPAddressRequest +} + +func (r ApiIpamIpAddressesBulkPartialUpdateRequest) IPAddressRequest(iPAddressRequest []IPAddressRequest) ApiIpamIpAddressesBulkPartialUpdateRequest { + r.iPAddressRequest = &iPAddressRequest + return r +} + +func (r ApiIpamIpAddressesBulkPartialUpdateRequest) Execute() ([]IPAddress, *http.Response, error) { + return r.ApiService.IpamIpAddressesBulkPartialUpdateExecute(r) +} + +/* +IpamIpAddressesBulkPartialUpdate Method for IpamIpAddressesBulkPartialUpdate + +Patch a list of IP address objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpAddressesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamIpAddressesBulkPartialUpdate(ctx context.Context) ApiIpamIpAddressesBulkPartialUpdateRequest { + return ApiIpamIpAddressesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPAddress +func (a *IpamAPIService) IpamIpAddressesBulkPartialUpdateExecute(r ApiIpamIpAddressesBulkPartialUpdateRequest) ([]IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPAddressRequest == nil { + return localVarReturnValue, nil, reportError("iPAddressRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + iPAddressRequest *[]IPAddressRequest +} + +func (r ApiIpamIpAddressesBulkUpdateRequest) IPAddressRequest(iPAddressRequest []IPAddressRequest) ApiIpamIpAddressesBulkUpdateRequest { + r.iPAddressRequest = &iPAddressRequest + return r +} + +func (r ApiIpamIpAddressesBulkUpdateRequest) Execute() ([]IPAddress, *http.Response, error) { + return r.ApiService.IpamIpAddressesBulkUpdateExecute(r) +} + +/* +IpamIpAddressesBulkUpdate Method for IpamIpAddressesBulkUpdate + +Put a list of IP address objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpAddressesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamIpAddressesBulkUpdate(ctx context.Context) ApiIpamIpAddressesBulkUpdateRequest { + return ApiIpamIpAddressesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPAddress +func (a *IpamAPIService) IpamIpAddressesBulkUpdateExecute(r ApiIpamIpAddressesBulkUpdateRequest) ([]IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPAddressRequest == nil { + return localVarReturnValue, nil, reportError("iPAddressRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableIPAddressRequest *WritableIPAddressRequest +} + +func (r ApiIpamIpAddressesCreateRequest) WritableIPAddressRequest(writableIPAddressRequest WritableIPAddressRequest) ApiIpamIpAddressesCreateRequest { + r.writableIPAddressRequest = &writableIPAddressRequest + return r +} + +func (r ApiIpamIpAddressesCreateRequest) Execute() (*IPAddress, *http.Response, error) { + return r.ApiService.IpamIpAddressesCreateExecute(r) +} + +/* +IpamIpAddressesCreate Method for IpamIpAddressesCreate + +Post a list of IP address objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpAddressesCreateRequest +*/ +func (a *IpamAPIService) IpamIpAddressesCreate(ctx context.Context) ApiIpamIpAddressesCreateRequest { + return ApiIpamIpAddressesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IPAddress +func (a *IpamAPIService) IpamIpAddressesCreateExecute(r ApiIpamIpAddressesCreateRequest) (*IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPAddressRequest == nil { + return localVarReturnValue, nil, reportError("writableIPAddressRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamIpAddressesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamIpAddressesDestroyExecute(r) +} + +/* +IpamIpAddressesDestroy Method for IpamIpAddressesDestroy + +Delete a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP address. + @return ApiIpamIpAddressesDestroyRequest +*/ +func (a *IpamAPIService) IpamIpAddressesDestroy(ctx context.Context, id int32) ApiIpamIpAddressesDestroyRequest { + return ApiIpamIpAddressesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamIpAddressesDestroyExecute(r ApiIpamIpAddressesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + address *[]string + assigned *bool + assignedToInterface *bool + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]string + deviceId *[]int32 + dnsName *[]string + dnsNameEmpty *bool + dnsNameIc *[]string + dnsNameIe *[]string + dnsNameIew *[]string + dnsNameIsw *[]string + dnsNameN *[]string + dnsNameNic *[]string + dnsNameNie *[]string + dnsNameNiew *[]string + dnsNameNisw *[]string + family *float32 + fhrpgroupId *[]int32 + fhrpgroupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interface_ *[]string + interfaceN *[]string + interfaceId *[]int32 + interfaceIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + maskLength *[]int32 + maskLengthGte *float32 + maskLengthLte *float32 + modifiedByRequest *string + offset *int32 + ordering *string + parent *[]string + presentInVrf *string + presentInVrfId *string + q *string + role *[]string + roleN *[]string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + virtualMachine *[]string + virtualMachineId *[]int32 + vminterface *[]string + vminterfaceN *[]string + vminterfaceId *[]int32 + vminterfaceIdN *[]int32 + vrf *[]*string + vrfN *[]*string + vrfId *[]*int32 + vrfIdN *[]*int32 +} + +func (r ApiIpamIpAddressesListRequest) Address(address []string) ApiIpamIpAddressesListRequest { + r.address = &address + return r +} + +// Is assigned +func (r ApiIpamIpAddressesListRequest) Assigned(assigned bool) ApiIpamIpAddressesListRequest { + r.assigned = &assigned + return r +} + +// Is assigned to an interface +func (r ApiIpamIpAddressesListRequest) AssignedToInterface(assignedToInterface bool) ApiIpamIpAddressesListRequest { + r.assignedToInterface = &assignedToInterface + return r +} + +func (r ApiIpamIpAddressesListRequest) Created(created []time.Time) ApiIpamIpAddressesListRequest { + r.created = &created + return r +} + +func (r ApiIpamIpAddressesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamIpAddressesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamIpAddressesListRequest) CreatedGt(createdGt []time.Time) ApiIpamIpAddressesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamIpAddressesListRequest) CreatedGte(createdGte []time.Time) ApiIpamIpAddressesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamIpAddressesListRequest) CreatedLt(createdLt []time.Time) ApiIpamIpAddressesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamIpAddressesListRequest) CreatedLte(createdLte []time.Time) ApiIpamIpAddressesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamIpAddressesListRequest) CreatedN(createdN []time.Time) ApiIpamIpAddressesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamIpAddressesListRequest) CreatedByRequest(createdByRequest string) ApiIpamIpAddressesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamIpAddressesListRequest) Description(description []string) ApiIpamIpAddressesListRequest { + r.description = &description + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamIpAddressesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionIc(descriptionIc []string) ApiIpamIpAddressesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionIe(descriptionIe []string) ApiIpamIpAddressesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionIew(descriptionIew []string) ApiIpamIpAddressesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamIpAddressesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionN(descriptionN []string) ApiIpamIpAddressesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionNic(descriptionNic []string) ApiIpamIpAddressesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionNie(descriptionNie []string) ApiIpamIpAddressesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamIpAddressesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamIpAddressesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamIpAddressesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamIpAddressesListRequest) Device(device []string) ApiIpamIpAddressesListRequest { + r.device = &device + return r +} + +func (r ApiIpamIpAddressesListRequest) DeviceId(deviceId []int32) ApiIpamIpAddressesListRequest { + r.deviceId = &deviceId + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsName(dnsName []string) ApiIpamIpAddressesListRequest { + r.dnsName = &dnsName + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameEmpty(dnsNameEmpty bool) ApiIpamIpAddressesListRequest { + r.dnsNameEmpty = &dnsNameEmpty + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameIc(dnsNameIc []string) ApiIpamIpAddressesListRequest { + r.dnsNameIc = &dnsNameIc + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameIe(dnsNameIe []string) ApiIpamIpAddressesListRequest { + r.dnsNameIe = &dnsNameIe + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameIew(dnsNameIew []string) ApiIpamIpAddressesListRequest { + r.dnsNameIew = &dnsNameIew + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameIsw(dnsNameIsw []string) ApiIpamIpAddressesListRequest { + r.dnsNameIsw = &dnsNameIsw + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameN(dnsNameN []string) ApiIpamIpAddressesListRequest { + r.dnsNameN = &dnsNameN + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameNic(dnsNameNic []string) ApiIpamIpAddressesListRequest { + r.dnsNameNic = &dnsNameNic + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameNie(dnsNameNie []string) ApiIpamIpAddressesListRequest { + r.dnsNameNie = &dnsNameNie + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameNiew(dnsNameNiew []string) ApiIpamIpAddressesListRequest { + r.dnsNameNiew = &dnsNameNiew + return r +} + +func (r ApiIpamIpAddressesListRequest) DnsNameNisw(dnsNameNisw []string) ApiIpamIpAddressesListRequest { + r.dnsNameNisw = &dnsNameNisw + return r +} + +func (r ApiIpamIpAddressesListRequest) Family(family float32) ApiIpamIpAddressesListRequest { + r.family = &family + return r +} + +// FHRP group (ID) +func (r ApiIpamIpAddressesListRequest) FhrpgroupId(fhrpgroupId []int32) ApiIpamIpAddressesListRequest { + r.fhrpgroupId = &fhrpgroupId + return r +} + +// FHRP group (ID) +func (r ApiIpamIpAddressesListRequest) FhrpgroupIdN(fhrpgroupIdN []int32) ApiIpamIpAddressesListRequest { + r.fhrpgroupIdN = &fhrpgroupIdN + return r +} + +func (r ApiIpamIpAddressesListRequest) Id(id []int32) ApiIpamIpAddressesListRequest { + r.id = &id + return r +} + +func (r ApiIpamIpAddressesListRequest) IdEmpty(idEmpty bool) ApiIpamIpAddressesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamIpAddressesListRequest) IdGt(idGt []int32) ApiIpamIpAddressesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamIpAddressesListRequest) IdGte(idGte []int32) ApiIpamIpAddressesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamIpAddressesListRequest) IdLt(idLt []int32) ApiIpamIpAddressesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamIpAddressesListRequest) IdLte(idLte []int32) ApiIpamIpAddressesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamIpAddressesListRequest) IdN(idN []int32) ApiIpamIpAddressesListRequest { + r.idN = &idN + return r +} + +// Interface (name) +func (r ApiIpamIpAddressesListRequest) Interface_(interface_ []string) ApiIpamIpAddressesListRequest { + r.interface_ = &interface_ + return r +} + +// Interface (name) +func (r ApiIpamIpAddressesListRequest) InterfaceN(interfaceN []string) ApiIpamIpAddressesListRequest { + r.interfaceN = &interfaceN + return r +} + +// Interface (ID) +func (r ApiIpamIpAddressesListRequest) InterfaceId(interfaceId []int32) ApiIpamIpAddressesListRequest { + r.interfaceId = &interfaceId + return r +} + +// Interface (ID) +func (r ApiIpamIpAddressesListRequest) InterfaceIdN(interfaceIdN []int32) ApiIpamIpAddressesListRequest { + r.interfaceIdN = &interfaceIdN + return r +} + +func (r ApiIpamIpAddressesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamIpAddressesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamIpAddressesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamIpAddressesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamIpAddressesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamIpAddressesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamIpAddressesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamIpAddressesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamIpAddressesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamIpAddressesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamIpAddressesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamIpAddressesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamIpAddressesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamIpAddressesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamIpAddressesListRequest) Limit(limit int32) ApiIpamIpAddressesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamIpAddressesListRequest) MaskLength(maskLength []int32) ApiIpamIpAddressesListRequest { + r.maskLength = &maskLength + return r +} + +func (r ApiIpamIpAddressesListRequest) MaskLengthGte(maskLengthGte float32) ApiIpamIpAddressesListRequest { + r.maskLengthGte = &maskLengthGte + return r +} + +func (r ApiIpamIpAddressesListRequest) MaskLengthLte(maskLengthLte float32) ApiIpamIpAddressesListRequest { + r.maskLengthLte = &maskLengthLte + return r +} + +func (r ApiIpamIpAddressesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamIpAddressesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiIpamIpAddressesListRequest) Offset(offset int32) ApiIpamIpAddressesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamIpAddressesListRequest) Ordering(ordering string) ApiIpamIpAddressesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiIpamIpAddressesListRequest) Parent(parent []string) ApiIpamIpAddressesListRequest { + r.parent = &parent + return r +} + +func (r ApiIpamIpAddressesListRequest) PresentInVrf(presentInVrf string) ApiIpamIpAddressesListRequest { + r.presentInVrf = &presentInVrf + return r +} + +func (r ApiIpamIpAddressesListRequest) PresentInVrfId(presentInVrfId string) ApiIpamIpAddressesListRequest { + r.presentInVrfId = &presentInVrfId + return r +} + +// Search +func (r ApiIpamIpAddressesListRequest) Q(q string) ApiIpamIpAddressesListRequest { + r.q = &q + return r +} + +// The functional role of this IP +func (r ApiIpamIpAddressesListRequest) Role(role []string) ApiIpamIpAddressesListRequest { + r.role = &role + return r +} + +// The functional role of this IP +func (r ApiIpamIpAddressesListRequest) RoleN(roleN []string) ApiIpamIpAddressesListRequest { + r.roleN = &roleN + return r +} + +// The operational status of this IP +func (r ApiIpamIpAddressesListRequest) Status(status []string) ApiIpamIpAddressesListRequest { + r.status = &status + return r +} + +// The operational status of this IP +func (r ApiIpamIpAddressesListRequest) StatusN(statusN []string) ApiIpamIpAddressesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiIpamIpAddressesListRequest) Tag(tag []string) ApiIpamIpAddressesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamIpAddressesListRequest) TagN(tagN []string) ApiIpamIpAddressesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamIpAddressesListRequest) Tenant(tenant []string) ApiIpamIpAddressesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamIpAddressesListRequest) TenantN(tenantN []string) ApiIpamIpAddressesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamIpAddressesListRequest) TenantGroup(tenantGroup []int32) ApiIpamIpAddressesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamIpAddressesListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamIpAddressesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamIpAddressesListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamIpAddressesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamIpAddressesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamIpAddressesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamIpAddressesListRequest) TenantId(tenantId []*int32) ApiIpamIpAddressesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamIpAddressesListRequest) TenantIdN(tenantIdN []*int32) ApiIpamIpAddressesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamIpAddressesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamIpAddressesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamIpAddressesListRequest) VirtualMachine(virtualMachine []string) ApiIpamIpAddressesListRequest { + r.virtualMachine = &virtualMachine + return r +} + +func (r ApiIpamIpAddressesListRequest) VirtualMachineId(virtualMachineId []int32) ApiIpamIpAddressesListRequest { + r.virtualMachineId = &virtualMachineId + return r +} + +// VM interface (name) +func (r ApiIpamIpAddressesListRequest) Vminterface(vminterface []string) ApiIpamIpAddressesListRequest { + r.vminterface = &vminterface + return r +} + +// VM interface (name) +func (r ApiIpamIpAddressesListRequest) VminterfaceN(vminterfaceN []string) ApiIpamIpAddressesListRequest { + r.vminterfaceN = &vminterfaceN + return r +} + +// VM interface (ID) +func (r ApiIpamIpAddressesListRequest) VminterfaceId(vminterfaceId []int32) ApiIpamIpAddressesListRequest { + r.vminterfaceId = &vminterfaceId + return r +} + +// VM interface (ID) +func (r ApiIpamIpAddressesListRequest) VminterfaceIdN(vminterfaceIdN []int32) ApiIpamIpAddressesListRequest { + r.vminterfaceIdN = &vminterfaceIdN + return r +} + +// VRF (RD) +func (r ApiIpamIpAddressesListRequest) Vrf(vrf []*string) ApiIpamIpAddressesListRequest { + r.vrf = &vrf + return r +} + +// VRF (RD) +func (r ApiIpamIpAddressesListRequest) VrfN(vrfN []*string) ApiIpamIpAddressesListRequest { + r.vrfN = &vrfN + return r +} + +// VRF +func (r ApiIpamIpAddressesListRequest) VrfId(vrfId []*int32) ApiIpamIpAddressesListRequest { + r.vrfId = &vrfId + return r +} + +// VRF +func (r ApiIpamIpAddressesListRequest) VrfIdN(vrfIdN []*int32) ApiIpamIpAddressesListRequest { + r.vrfIdN = &vrfIdN + return r +} + +func (r ApiIpamIpAddressesListRequest) Execute() (*PaginatedIPAddressList, *http.Response, error) { + return r.ApiService.IpamIpAddressesListExecute(r) +} + +/* +IpamIpAddressesList Method for IpamIpAddressesList + +Get a list of IP address objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpAddressesListRequest +*/ +func (a *IpamAPIService) IpamIpAddressesList(ctx context.Context) ApiIpamIpAddressesListRequest { + return ApiIpamIpAddressesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIPAddressList +func (a *IpamAPIService) IpamIpAddressesListExecute(r ApiIpamIpAddressesListRequest) (*PaginatedIPAddressList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIPAddressList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.address != nil { + t := *r.address + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address", t, "multi") + } + } + if r.assigned != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned", r.assigned, "") + } + if r.assignedToInterface != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_to_interface", r.assignedToInterface, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.dnsName != nil { + t := *r.dnsName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name", t, "multi") + } + } + if r.dnsNameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__empty", r.dnsNameEmpty, "") + } + if r.dnsNameIc != nil { + t := *r.dnsNameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__ic", t, "multi") + } + } + if r.dnsNameIe != nil { + t := *r.dnsNameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__ie", t, "multi") + } + } + if r.dnsNameIew != nil { + t := *r.dnsNameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__iew", t, "multi") + } + } + if r.dnsNameIsw != nil { + t := *r.dnsNameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__isw", t, "multi") + } + } + if r.dnsNameN != nil { + t := *r.dnsNameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__n", t, "multi") + } + } + if r.dnsNameNic != nil { + t := *r.dnsNameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__nic", t, "multi") + } + } + if r.dnsNameNie != nil { + t := *r.dnsNameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__nie", t, "multi") + } + } + if r.dnsNameNiew != nil { + t := *r.dnsNameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__niew", t, "multi") + } + } + if r.dnsNameNisw != nil { + t := *r.dnsNameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "dns_name__nisw", t, "multi") + } + } + if r.family != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "family", r.family, "") + } + if r.fhrpgroupId != nil { + t := *r.fhrpgroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fhrpgroup_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fhrpgroup_id", t, "multi") + } + } + if r.fhrpgroupIdN != nil { + t := *r.fhrpgroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fhrpgroup_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fhrpgroup_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interface_ != nil { + t := *r.interface_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface", t, "multi") + } + } + if r.interfaceN != nil { + t := *r.interfaceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface__n", t, "multi") + } + } + if r.interfaceId != nil { + t := *r.interfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", t, "multi") + } + } + if r.interfaceIdN != nil { + t := *r.interfaceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.maskLength != nil { + t := *r.maskLength + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length", t, "multi") + } + } + if r.maskLengthGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length__gte", r.maskLengthGte, "") + } + if r.maskLengthLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length__lte", r.maskLengthLte, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.presentInVrf != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "present_in_vrf", r.presentInVrf, "") + } + if r.presentInVrfId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "present_in_vrf_id", r.presentInVrfId, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualMachine != nil { + t := *r.virtualMachine + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", t, "multi") + } + } + if r.virtualMachineId != nil { + t := *r.virtualMachineId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", t, "multi") + } + } + if r.vminterface != nil { + t := *r.vminterface + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface", t, "multi") + } + } + if r.vminterfaceN != nil { + t := *r.vminterfaceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface__n", t, "multi") + } + } + if r.vminterfaceId != nil { + t := *r.vminterfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id", t, "multi") + } + } + if r.vminterfaceIdN != nil { + t := *r.vminterfaceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id__n", t, "multi") + } + } + if r.vrf != nil { + t := *r.vrf + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", t, "multi") + } + } + if r.vrfN != nil { + t := *r.vrfN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", t, "multi") + } + } + if r.vrfId != nil { + t := *r.vrfId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", t, "multi") + } + } + if r.vrfIdN != nil { + t := *r.vrfIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableIPAddressRequest *PatchedWritableIPAddressRequest +} + +func (r ApiIpamIpAddressesPartialUpdateRequest) PatchedWritableIPAddressRequest(patchedWritableIPAddressRequest PatchedWritableIPAddressRequest) ApiIpamIpAddressesPartialUpdateRequest { + r.patchedWritableIPAddressRequest = &patchedWritableIPAddressRequest + return r +} + +func (r ApiIpamIpAddressesPartialUpdateRequest) Execute() (*IPAddress, *http.Response, error) { + return r.ApiService.IpamIpAddressesPartialUpdateExecute(r) +} + +/* +IpamIpAddressesPartialUpdate Method for IpamIpAddressesPartialUpdate + +Patch a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP address. + @return ApiIpamIpAddressesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamIpAddressesPartialUpdate(ctx context.Context, id int32) ApiIpamIpAddressesPartialUpdateRequest { + return ApiIpamIpAddressesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAddress +func (a *IpamAPIService) IpamIpAddressesPartialUpdateExecute(r ApiIpamIpAddressesPartialUpdateRequest) (*IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableIPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamIpAddressesRetrieveRequest) Execute() (*IPAddress, *http.Response, error) { + return r.ApiService.IpamIpAddressesRetrieveExecute(r) +} + +/* +IpamIpAddressesRetrieve Method for IpamIpAddressesRetrieve + +Get a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP address. + @return ApiIpamIpAddressesRetrieveRequest +*/ +func (a *IpamAPIService) IpamIpAddressesRetrieve(ctx context.Context, id int32) ApiIpamIpAddressesRetrieveRequest { + return ApiIpamIpAddressesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAddress +func (a *IpamAPIService) IpamIpAddressesRetrieveExecute(r ApiIpamIpAddressesRetrieveRequest) (*IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpAddressesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableIPAddressRequest *WritableIPAddressRequest +} + +func (r ApiIpamIpAddressesUpdateRequest) WritableIPAddressRequest(writableIPAddressRequest WritableIPAddressRequest) ApiIpamIpAddressesUpdateRequest { + r.writableIPAddressRequest = &writableIPAddressRequest + return r +} + +func (r ApiIpamIpAddressesUpdateRequest) Execute() (*IPAddress, *http.Response, error) { + return r.ApiService.IpamIpAddressesUpdateExecute(r) +} + +/* +IpamIpAddressesUpdate Method for IpamIpAddressesUpdate + +Put a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP address. + @return ApiIpamIpAddressesUpdateRequest +*/ +func (a *IpamAPIService) IpamIpAddressesUpdate(ctx context.Context, id int32) ApiIpamIpAddressesUpdateRequest { + return ApiIpamIpAddressesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAddress +func (a *IpamAPIService) IpamIpAddressesUpdateExecute(r ApiIpamIpAddressesUpdateRequest) (*IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpAddressesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-addresses/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPAddressRequest == nil { + return localVarReturnValue, nil, reportError("writableIPAddressRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesAvailableIpsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + iPAddressRequest *[]IPAddressRequest +} + +func (r ApiIpamIpRangesAvailableIpsCreateRequest) IPAddressRequest(iPAddressRequest []IPAddressRequest) ApiIpamIpRangesAvailableIpsCreateRequest { + r.iPAddressRequest = &iPAddressRequest + return r +} + +func (r ApiIpamIpRangesAvailableIpsCreateRequest) Execute() ([]IPAddress, *http.Response, error) { + return r.ApiService.IpamIpRangesAvailableIpsCreateExecute(r) +} + +/* +IpamIpRangesAvailableIpsCreate Method for IpamIpRangesAvailableIpsCreate + +Post a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamIpRangesAvailableIpsCreateRequest +*/ +func (a *IpamAPIService) IpamIpRangesAvailableIpsCreate(ctx context.Context, id int32) ApiIpamIpRangesAvailableIpsCreateRequest { + return ApiIpamIpRangesAvailableIpsCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []IPAddress +func (a *IpamAPIService) IpamIpRangesAvailableIpsCreateExecute(r ApiIpamIpRangesAvailableIpsCreateRequest) ([]IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesAvailableIpsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/{id}/available-ips/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPAddressRequest == nil { + return localVarReturnValue, nil, reportError("iPAddressRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesAvailableIpsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamIpRangesAvailableIpsListRequest) Execute() ([]AvailableIP, *http.Response, error) { + return r.ApiService.IpamIpRangesAvailableIpsListExecute(r) +} + +/* +IpamIpRangesAvailableIpsList Method for IpamIpRangesAvailableIpsList + +Get a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamIpRangesAvailableIpsListRequest +*/ +func (a *IpamAPIService) IpamIpRangesAvailableIpsList(ctx context.Context, id int32) ApiIpamIpRangesAvailableIpsListRequest { + return ApiIpamIpRangesAvailableIpsListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []AvailableIP +func (a *IpamAPIService) IpamIpRangesAvailableIpsListExecute(r ApiIpamIpRangesAvailableIpsListRequest) ([]AvailableIP, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AvailableIP + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesAvailableIpsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/{id}/available-ips/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + iPRangeRequest *[]IPRangeRequest +} + +func (r ApiIpamIpRangesBulkDestroyRequest) IPRangeRequest(iPRangeRequest []IPRangeRequest) ApiIpamIpRangesBulkDestroyRequest { + r.iPRangeRequest = &iPRangeRequest + return r +} + +func (r ApiIpamIpRangesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamIpRangesBulkDestroyExecute(r) +} + +/* +IpamIpRangesBulkDestroy Method for IpamIpRangesBulkDestroy + +Delete a list of IP range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpRangesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamIpRangesBulkDestroy(ctx context.Context) ApiIpamIpRangesBulkDestroyRequest { + return ApiIpamIpRangesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamIpRangesBulkDestroyExecute(r ApiIpamIpRangesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPRangeRequest == nil { + return nil, reportError("iPRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamIpRangesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + iPRangeRequest *[]IPRangeRequest +} + +func (r ApiIpamIpRangesBulkPartialUpdateRequest) IPRangeRequest(iPRangeRequest []IPRangeRequest) ApiIpamIpRangesBulkPartialUpdateRequest { + r.iPRangeRequest = &iPRangeRequest + return r +} + +func (r ApiIpamIpRangesBulkPartialUpdateRequest) Execute() ([]IPRange, *http.Response, error) { + return r.ApiService.IpamIpRangesBulkPartialUpdateExecute(r) +} + +/* +IpamIpRangesBulkPartialUpdate Method for IpamIpRangesBulkPartialUpdate + +Patch a list of IP range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpRangesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamIpRangesBulkPartialUpdate(ctx context.Context) ApiIpamIpRangesBulkPartialUpdateRequest { + return ApiIpamIpRangesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPRange +func (a *IpamAPIService) IpamIpRangesBulkPartialUpdateExecute(r ApiIpamIpRangesBulkPartialUpdateRequest) ([]IPRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPRangeRequest == nil { + return localVarReturnValue, nil, reportError("iPRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + iPRangeRequest *[]IPRangeRequest +} + +func (r ApiIpamIpRangesBulkUpdateRequest) IPRangeRequest(iPRangeRequest []IPRangeRequest) ApiIpamIpRangesBulkUpdateRequest { + r.iPRangeRequest = &iPRangeRequest + return r +} + +func (r ApiIpamIpRangesBulkUpdateRequest) Execute() ([]IPRange, *http.Response, error) { + return r.ApiService.IpamIpRangesBulkUpdateExecute(r) +} + +/* +IpamIpRangesBulkUpdate Method for IpamIpRangesBulkUpdate + +Put a list of IP range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpRangesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamIpRangesBulkUpdate(ctx context.Context) ApiIpamIpRangesBulkUpdateRequest { + return ApiIpamIpRangesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPRange +func (a *IpamAPIService) IpamIpRangesBulkUpdateExecute(r ApiIpamIpRangesBulkUpdateRequest) ([]IPRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPRangeRequest == nil { + return localVarReturnValue, nil, reportError("iPRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableIPRangeRequest *WritableIPRangeRequest +} + +func (r ApiIpamIpRangesCreateRequest) WritableIPRangeRequest(writableIPRangeRequest WritableIPRangeRequest) ApiIpamIpRangesCreateRequest { + r.writableIPRangeRequest = &writableIPRangeRequest + return r +} + +func (r ApiIpamIpRangesCreateRequest) Execute() (*IPRange, *http.Response, error) { + return r.ApiService.IpamIpRangesCreateExecute(r) +} + +/* +IpamIpRangesCreate Method for IpamIpRangesCreate + +Post a list of IP range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpRangesCreateRequest +*/ +func (a *IpamAPIService) IpamIpRangesCreate(ctx context.Context) ApiIpamIpRangesCreateRequest { + return ApiIpamIpRangesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IPRange +func (a *IpamAPIService) IpamIpRangesCreateExecute(r ApiIpamIpRangesCreateRequest) (*IPRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPRangeRequest == nil { + return localVarReturnValue, nil, reportError("writableIPRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamIpRangesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamIpRangesDestroyExecute(r) +} + +/* +IpamIpRangesDestroy Method for IpamIpRangesDestroy + +Delete a IP range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP range. + @return ApiIpamIpRangesDestroyRequest +*/ +func (a *IpamAPIService) IpamIpRangesDestroy(ctx context.Context, id int32) ApiIpamIpRangesDestroyRequest { + return ApiIpamIpRangesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamIpRangesDestroyExecute(r ApiIpamIpRangesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamIpRangesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + contains *string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + endAddress *[]string + family *float32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + markUtilized *bool + modifiedByRequest *string + offset *int32 + ordering *string + parent *[]string + q *string + role *[]string + roleN *[]string + roleId *[]*int32 + roleIdN *[]*int32 + startAddress *[]string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + vrf *[]*string + vrfN *[]*string + vrfId *[]*int32 + vrfIdN *[]*int32 +} + +// Ranges which contain this prefix or IP +func (r ApiIpamIpRangesListRequest) Contains(contains string) ApiIpamIpRangesListRequest { + r.contains = &contains + return r +} + +func (r ApiIpamIpRangesListRequest) Created(created []time.Time) ApiIpamIpRangesListRequest { + r.created = &created + return r +} + +func (r ApiIpamIpRangesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamIpRangesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamIpRangesListRequest) CreatedGt(createdGt []time.Time) ApiIpamIpRangesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamIpRangesListRequest) CreatedGte(createdGte []time.Time) ApiIpamIpRangesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamIpRangesListRequest) CreatedLt(createdLt []time.Time) ApiIpamIpRangesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamIpRangesListRequest) CreatedLte(createdLte []time.Time) ApiIpamIpRangesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamIpRangesListRequest) CreatedN(createdN []time.Time) ApiIpamIpRangesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamIpRangesListRequest) CreatedByRequest(createdByRequest string) ApiIpamIpRangesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamIpRangesListRequest) Description(description []string) ApiIpamIpRangesListRequest { + r.description = &description + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamIpRangesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionIc(descriptionIc []string) ApiIpamIpRangesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionIe(descriptionIe []string) ApiIpamIpRangesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionIew(descriptionIew []string) ApiIpamIpRangesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamIpRangesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionN(descriptionN []string) ApiIpamIpRangesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionNic(descriptionNic []string) ApiIpamIpRangesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionNie(descriptionNie []string) ApiIpamIpRangesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamIpRangesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamIpRangesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamIpRangesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamIpRangesListRequest) EndAddress(endAddress []string) ApiIpamIpRangesListRequest { + r.endAddress = &endAddress + return r +} + +func (r ApiIpamIpRangesListRequest) Family(family float32) ApiIpamIpRangesListRequest { + r.family = &family + return r +} + +func (r ApiIpamIpRangesListRequest) Id(id []int32) ApiIpamIpRangesListRequest { + r.id = &id + return r +} + +func (r ApiIpamIpRangesListRequest) IdEmpty(idEmpty bool) ApiIpamIpRangesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamIpRangesListRequest) IdGt(idGt []int32) ApiIpamIpRangesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamIpRangesListRequest) IdGte(idGte []int32) ApiIpamIpRangesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamIpRangesListRequest) IdLt(idLt []int32) ApiIpamIpRangesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamIpRangesListRequest) IdLte(idLte []int32) ApiIpamIpRangesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamIpRangesListRequest) IdN(idN []int32) ApiIpamIpRangesListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamIpRangesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamIpRangesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamIpRangesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamIpRangesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamIpRangesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamIpRangesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamIpRangesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamIpRangesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamIpRangesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamIpRangesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamIpRangesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamIpRangesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamIpRangesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamIpRangesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamIpRangesListRequest) Limit(limit int32) ApiIpamIpRangesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamIpRangesListRequest) MarkUtilized(markUtilized bool) ApiIpamIpRangesListRequest { + r.markUtilized = &markUtilized + return r +} + +func (r ApiIpamIpRangesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamIpRangesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiIpamIpRangesListRequest) Offset(offset int32) ApiIpamIpRangesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamIpRangesListRequest) Ordering(ordering string) ApiIpamIpRangesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiIpamIpRangesListRequest) Parent(parent []string) ApiIpamIpRangesListRequest { + r.parent = &parent + return r +} + +// Search +func (r ApiIpamIpRangesListRequest) Q(q string) ApiIpamIpRangesListRequest { + r.q = &q + return r +} + +// Role (slug) +func (r ApiIpamIpRangesListRequest) Role(role []string) ApiIpamIpRangesListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiIpamIpRangesListRequest) RoleN(roleN []string) ApiIpamIpRangesListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiIpamIpRangesListRequest) RoleId(roleId []*int32) ApiIpamIpRangesListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiIpamIpRangesListRequest) RoleIdN(roleIdN []*int32) ApiIpamIpRangesListRequest { + r.roleIdN = &roleIdN + return r +} + +func (r ApiIpamIpRangesListRequest) StartAddress(startAddress []string) ApiIpamIpRangesListRequest { + r.startAddress = &startAddress + return r +} + +// Operational status of this range +func (r ApiIpamIpRangesListRequest) Status(status []string) ApiIpamIpRangesListRequest { + r.status = &status + return r +} + +// Operational status of this range +func (r ApiIpamIpRangesListRequest) StatusN(statusN []string) ApiIpamIpRangesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiIpamIpRangesListRequest) Tag(tag []string) ApiIpamIpRangesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamIpRangesListRequest) TagN(tagN []string) ApiIpamIpRangesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamIpRangesListRequest) Tenant(tenant []string) ApiIpamIpRangesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamIpRangesListRequest) TenantN(tenantN []string) ApiIpamIpRangesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamIpRangesListRequest) TenantGroup(tenantGroup []int32) ApiIpamIpRangesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamIpRangesListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamIpRangesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamIpRangesListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamIpRangesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamIpRangesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamIpRangesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamIpRangesListRequest) TenantId(tenantId []*int32) ApiIpamIpRangesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamIpRangesListRequest) TenantIdN(tenantIdN []*int32) ApiIpamIpRangesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamIpRangesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamIpRangesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// VRF (RD) +func (r ApiIpamIpRangesListRequest) Vrf(vrf []*string) ApiIpamIpRangesListRequest { + r.vrf = &vrf + return r +} + +// VRF (RD) +func (r ApiIpamIpRangesListRequest) VrfN(vrfN []*string) ApiIpamIpRangesListRequest { + r.vrfN = &vrfN + return r +} + +// VRF +func (r ApiIpamIpRangesListRequest) VrfId(vrfId []*int32) ApiIpamIpRangesListRequest { + r.vrfId = &vrfId + return r +} + +// VRF +func (r ApiIpamIpRangesListRequest) VrfIdN(vrfIdN []*int32) ApiIpamIpRangesListRequest { + r.vrfIdN = &vrfIdN + return r +} + +func (r ApiIpamIpRangesListRequest) Execute() (*PaginatedIPRangeList, *http.Response, error) { + return r.ApiService.IpamIpRangesListExecute(r) +} + +/* +IpamIpRangesList Method for IpamIpRangesList + +Get a list of IP range objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamIpRangesListRequest +*/ +func (a *IpamAPIService) IpamIpRangesList(ctx context.Context) ApiIpamIpRangesListRequest { + return ApiIpamIpRangesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIPRangeList +func (a *IpamAPIService) IpamIpRangesListExecute(r ApiIpamIpRangesListRequest) (*PaginatedIPRangeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIPRangeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "contains", r.contains, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.endAddress != nil { + t := *r.endAddress + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "end_address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "end_address", t, "multi") + } + } + if r.family != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "family", r.family, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.markUtilized != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mark_utilized", r.markUtilized, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.startAddress != nil { + t := *r.startAddress + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "start_address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "start_address", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vrf != nil { + t := *r.vrf + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", t, "multi") + } + } + if r.vrfN != nil { + t := *r.vrfN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", t, "multi") + } + } + if r.vrfId != nil { + t := *r.vrfId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", t, "multi") + } + } + if r.vrfIdN != nil { + t := *r.vrfIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableIPRangeRequest *PatchedWritableIPRangeRequest +} + +func (r ApiIpamIpRangesPartialUpdateRequest) PatchedWritableIPRangeRequest(patchedWritableIPRangeRequest PatchedWritableIPRangeRequest) ApiIpamIpRangesPartialUpdateRequest { + r.patchedWritableIPRangeRequest = &patchedWritableIPRangeRequest + return r +} + +func (r ApiIpamIpRangesPartialUpdateRequest) Execute() (*IPRange, *http.Response, error) { + return r.ApiService.IpamIpRangesPartialUpdateExecute(r) +} + +/* +IpamIpRangesPartialUpdate Method for IpamIpRangesPartialUpdate + +Patch a IP range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP range. + @return ApiIpamIpRangesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamIpRangesPartialUpdate(ctx context.Context, id int32) ApiIpamIpRangesPartialUpdateRequest { + return ApiIpamIpRangesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPRange +func (a *IpamAPIService) IpamIpRangesPartialUpdateExecute(r ApiIpamIpRangesPartialUpdateRequest) (*IPRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableIPRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamIpRangesRetrieveRequest) Execute() (*IPRange, *http.Response, error) { + return r.ApiService.IpamIpRangesRetrieveExecute(r) +} + +/* +IpamIpRangesRetrieve Method for IpamIpRangesRetrieve + +Get a IP range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP range. + @return ApiIpamIpRangesRetrieveRequest +*/ +func (a *IpamAPIService) IpamIpRangesRetrieve(ctx context.Context, id int32) ApiIpamIpRangesRetrieveRequest { + return ApiIpamIpRangesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPRange +func (a *IpamAPIService) IpamIpRangesRetrieveExecute(r ApiIpamIpRangesRetrieveRequest) (*IPRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamIpRangesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableIPRangeRequest *WritableIPRangeRequest +} + +func (r ApiIpamIpRangesUpdateRequest) WritableIPRangeRequest(writableIPRangeRequest WritableIPRangeRequest) ApiIpamIpRangesUpdateRequest { + r.writableIPRangeRequest = &writableIPRangeRequest + return r +} + +func (r ApiIpamIpRangesUpdateRequest) Execute() (*IPRange, *http.Response, error) { + return r.ApiService.IpamIpRangesUpdateExecute(r) +} + +/* +IpamIpRangesUpdate Method for IpamIpRangesUpdate + +Put a IP range object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IP range. + @return ApiIpamIpRangesUpdateRequest +*/ +func (a *IpamAPIService) IpamIpRangesUpdate(ctx context.Context, id int32) ApiIpamIpRangesUpdateRequest { + return ApiIpamIpRangesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPRange +func (a *IpamAPIService) IpamIpRangesUpdateExecute(r ApiIpamIpRangesUpdateRequest) (*IPRange, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamIpRangesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/ip-ranges/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPRangeRequest == nil { + return localVarReturnValue, nil, reportError("writableIPRangeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPRangeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesAvailableIpsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + iPAddressRequest *[]IPAddressRequest +} + +func (r ApiIpamPrefixesAvailableIpsCreateRequest) IPAddressRequest(iPAddressRequest []IPAddressRequest) ApiIpamPrefixesAvailableIpsCreateRequest { + r.iPAddressRequest = &iPAddressRequest + return r +} + +func (r ApiIpamPrefixesAvailableIpsCreateRequest) Execute() ([]IPAddress, *http.Response, error) { + return r.ApiService.IpamPrefixesAvailableIpsCreateExecute(r) +} + +/* +IpamPrefixesAvailableIpsCreate Method for IpamPrefixesAvailableIpsCreate + +Post a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamPrefixesAvailableIpsCreateRequest +*/ +func (a *IpamAPIService) IpamPrefixesAvailableIpsCreate(ctx context.Context, id int32) ApiIpamPrefixesAvailableIpsCreateRequest { + return ApiIpamPrefixesAvailableIpsCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []IPAddress +func (a *IpamAPIService) IpamPrefixesAvailableIpsCreateExecute(r ApiIpamPrefixesAvailableIpsCreateRequest) ([]IPAddress, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPAddress + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesAvailableIpsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/available-ips/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPAddressRequest == nil { + return localVarReturnValue, nil, reportError("iPAddressRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPAddressRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesAvailableIpsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamPrefixesAvailableIpsListRequest) Execute() ([]AvailableIP, *http.Response, error) { + return r.ApiService.IpamPrefixesAvailableIpsListExecute(r) +} + +/* +IpamPrefixesAvailableIpsList Method for IpamPrefixesAvailableIpsList + +Get a IP address object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamPrefixesAvailableIpsListRequest +*/ +func (a *IpamAPIService) IpamPrefixesAvailableIpsList(ctx context.Context, id int32) ApiIpamPrefixesAvailableIpsListRequest { + return ApiIpamPrefixesAvailableIpsListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []AvailableIP +func (a *IpamAPIService) IpamPrefixesAvailableIpsListExecute(r ApiIpamPrefixesAvailableIpsListRequest) ([]AvailableIP, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AvailableIP + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesAvailableIpsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/available-ips/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesAvailablePrefixesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + prefixRequest *[]PrefixRequest +} + +func (r ApiIpamPrefixesAvailablePrefixesCreateRequest) PrefixRequest(prefixRequest []PrefixRequest) ApiIpamPrefixesAvailablePrefixesCreateRequest { + r.prefixRequest = &prefixRequest + return r +} + +func (r ApiIpamPrefixesAvailablePrefixesCreateRequest) Execute() ([]Prefix, *http.Response, error) { + return r.ApiService.IpamPrefixesAvailablePrefixesCreateExecute(r) +} + +/* +IpamPrefixesAvailablePrefixesCreate Method for IpamPrefixesAvailablePrefixesCreate + +Post a prefix object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamPrefixesAvailablePrefixesCreateRequest +*/ +func (a *IpamAPIService) IpamPrefixesAvailablePrefixesCreate(ctx context.Context, id int32) ApiIpamPrefixesAvailablePrefixesCreateRequest { + return ApiIpamPrefixesAvailablePrefixesCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []Prefix +func (a *IpamAPIService) IpamPrefixesAvailablePrefixesCreateExecute(r ApiIpamPrefixesAvailablePrefixesCreateRequest) ([]Prefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Prefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesAvailablePrefixesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/available-prefixes/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.prefixRequest == nil { + return localVarReturnValue, nil, reportError("prefixRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.prefixRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesAvailablePrefixesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamPrefixesAvailablePrefixesListRequest) Execute() ([]AvailablePrefix, *http.Response, error) { + return r.ApiService.IpamPrefixesAvailablePrefixesListExecute(r) +} + +/* +IpamPrefixesAvailablePrefixesList Method for IpamPrefixesAvailablePrefixesList + +Get a prefix object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamPrefixesAvailablePrefixesListRequest +*/ +func (a *IpamAPIService) IpamPrefixesAvailablePrefixesList(ctx context.Context, id int32) ApiIpamPrefixesAvailablePrefixesListRequest { + return ApiIpamPrefixesAvailablePrefixesListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []AvailablePrefix +func (a *IpamAPIService) IpamPrefixesAvailablePrefixesListExecute(r ApiIpamPrefixesAvailablePrefixesListRequest) ([]AvailablePrefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AvailablePrefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesAvailablePrefixesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/available-prefixes/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + prefixRequest *[]PrefixRequest +} + +func (r ApiIpamPrefixesBulkDestroyRequest) PrefixRequest(prefixRequest []PrefixRequest) ApiIpamPrefixesBulkDestroyRequest { + r.prefixRequest = &prefixRequest + return r +} + +func (r ApiIpamPrefixesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamPrefixesBulkDestroyExecute(r) +} + +/* +IpamPrefixesBulkDestroy Method for IpamPrefixesBulkDestroy + +Delete a list of prefix objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamPrefixesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamPrefixesBulkDestroy(ctx context.Context) ApiIpamPrefixesBulkDestroyRequest { + return ApiIpamPrefixesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamPrefixesBulkDestroyExecute(r ApiIpamPrefixesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.prefixRequest == nil { + return nil, reportError("prefixRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.prefixRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamPrefixesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + prefixRequest *[]PrefixRequest +} + +func (r ApiIpamPrefixesBulkPartialUpdateRequest) PrefixRequest(prefixRequest []PrefixRequest) ApiIpamPrefixesBulkPartialUpdateRequest { + r.prefixRequest = &prefixRequest + return r +} + +func (r ApiIpamPrefixesBulkPartialUpdateRequest) Execute() ([]Prefix, *http.Response, error) { + return r.ApiService.IpamPrefixesBulkPartialUpdateExecute(r) +} + +/* +IpamPrefixesBulkPartialUpdate Method for IpamPrefixesBulkPartialUpdate + +Patch a list of prefix objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamPrefixesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamPrefixesBulkPartialUpdate(ctx context.Context) ApiIpamPrefixesBulkPartialUpdateRequest { + return ApiIpamPrefixesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Prefix +func (a *IpamAPIService) IpamPrefixesBulkPartialUpdateExecute(r ApiIpamPrefixesBulkPartialUpdateRequest) ([]Prefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Prefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.prefixRequest == nil { + return localVarReturnValue, nil, reportError("prefixRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.prefixRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + prefixRequest *[]PrefixRequest +} + +func (r ApiIpamPrefixesBulkUpdateRequest) PrefixRequest(prefixRequest []PrefixRequest) ApiIpamPrefixesBulkUpdateRequest { + r.prefixRequest = &prefixRequest + return r +} + +func (r ApiIpamPrefixesBulkUpdateRequest) Execute() ([]Prefix, *http.Response, error) { + return r.ApiService.IpamPrefixesBulkUpdateExecute(r) +} + +/* +IpamPrefixesBulkUpdate Method for IpamPrefixesBulkUpdate + +Put a list of prefix objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamPrefixesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamPrefixesBulkUpdate(ctx context.Context) ApiIpamPrefixesBulkUpdateRequest { + return ApiIpamPrefixesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Prefix +func (a *IpamAPIService) IpamPrefixesBulkUpdateExecute(r ApiIpamPrefixesBulkUpdateRequest) ([]Prefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Prefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.prefixRequest == nil { + return localVarReturnValue, nil, reportError("prefixRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.prefixRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writablePrefixRequest *WritablePrefixRequest +} + +func (r ApiIpamPrefixesCreateRequest) WritablePrefixRequest(writablePrefixRequest WritablePrefixRequest) ApiIpamPrefixesCreateRequest { + r.writablePrefixRequest = &writablePrefixRequest + return r +} + +func (r ApiIpamPrefixesCreateRequest) Execute() (*Prefix, *http.Response, error) { + return r.ApiService.IpamPrefixesCreateExecute(r) +} + +/* +IpamPrefixesCreate Method for IpamPrefixesCreate + +Post a list of prefix objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamPrefixesCreateRequest +*/ +func (a *IpamAPIService) IpamPrefixesCreate(ctx context.Context) ApiIpamPrefixesCreateRequest { + return ApiIpamPrefixesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Prefix +func (a *IpamAPIService) IpamPrefixesCreateExecute(r ApiIpamPrefixesCreateRequest) (*Prefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePrefixRequest == nil { + return localVarReturnValue, nil, reportError("writablePrefixRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePrefixRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamPrefixesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamPrefixesDestroyExecute(r) +} + +/* +IpamPrefixesDestroy Method for IpamPrefixesDestroy + +Delete a prefix object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this prefix. + @return ApiIpamPrefixesDestroyRequest +*/ +func (a *IpamAPIService) IpamPrefixesDestroy(ctx context.Context, id int32) ApiIpamPrefixesDestroyRequest { + return ApiIpamPrefixesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamPrefixesDestroyExecute(r ApiIpamPrefixesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamPrefixesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + children *[]int32 + childrenEmpty *[]int32 + childrenGt *[]int32 + childrenGte *[]int32 + childrenLt *[]int32 + childrenLte *[]int32 + childrenN *[]int32 + contains *string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + depth *[]int32 + depthEmpty *[]int32 + depthGt *[]int32 + depthGte *[]int32 + depthLt *[]int32 + depthLte *[]int32 + depthN *[]int32 + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + family *float32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + isPool *bool + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + markUtilized *bool + maskLength *[]int32 + maskLengthGte *float32 + maskLengthLte *float32 + modifiedByRequest *string + offset *int32 + ordering *string + prefix *[]string + presentInVrf *string + presentInVrfId *string + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]*int32 + roleIdN *[]*int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]*int32 + siteIdN *[]*int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + vlanId *[]*int32 + vlanIdN *[]*int32 + vlanVid *int32 + vlanVidEmpty *int32 + vlanVidGt *int32 + vlanVidGte *int32 + vlanVidLt *int32 + vlanVidLte *int32 + vlanVidN *int32 + vrf *[]*string + vrfN *[]*string + vrfId *[]*int32 + vrfIdN *[]*int32 + within *string + withinInclude *string +} + +func (r ApiIpamPrefixesListRequest) Children(children []int32) ApiIpamPrefixesListRequest { + r.children = &children + return r +} + +func (r ApiIpamPrefixesListRequest) ChildrenEmpty(childrenEmpty []int32) ApiIpamPrefixesListRequest { + r.childrenEmpty = &childrenEmpty + return r +} + +func (r ApiIpamPrefixesListRequest) ChildrenGt(childrenGt []int32) ApiIpamPrefixesListRequest { + r.childrenGt = &childrenGt + return r +} + +func (r ApiIpamPrefixesListRequest) ChildrenGte(childrenGte []int32) ApiIpamPrefixesListRequest { + r.childrenGte = &childrenGte + return r +} + +func (r ApiIpamPrefixesListRequest) ChildrenLt(childrenLt []int32) ApiIpamPrefixesListRequest { + r.childrenLt = &childrenLt + return r +} + +func (r ApiIpamPrefixesListRequest) ChildrenLte(childrenLte []int32) ApiIpamPrefixesListRequest { + r.childrenLte = &childrenLte + return r +} + +func (r ApiIpamPrefixesListRequest) ChildrenN(childrenN []int32) ApiIpamPrefixesListRequest { + r.childrenN = &childrenN + return r +} + +// Prefixes which contain this prefix or IP +func (r ApiIpamPrefixesListRequest) Contains(contains string) ApiIpamPrefixesListRequest { + r.contains = &contains + return r +} + +func (r ApiIpamPrefixesListRequest) Created(created []time.Time) ApiIpamPrefixesListRequest { + r.created = &created + return r +} + +func (r ApiIpamPrefixesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamPrefixesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamPrefixesListRequest) CreatedGt(createdGt []time.Time) ApiIpamPrefixesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamPrefixesListRequest) CreatedGte(createdGte []time.Time) ApiIpamPrefixesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamPrefixesListRequest) CreatedLt(createdLt []time.Time) ApiIpamPrefixesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamPrefixesListRequest) CreatedLte(createdLte []time.Time) ApiIpamPrefixesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamPrefixesListRequest) CreatedN(createdN []time.Time) ApiIpamPrefixesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamPrefixesListRequest) CreatedByRequest(createdByRequest string) ApiIpamPrefixesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamPrefixesListRequest) Depth(depth []int32) ApiIpamPrefixesListRequest { + r.depth = &depth + return r +} + +func (r ApiIpamPrefixesListRequest) DepthEmpty(depthEmpty []int32) ApiIpamPrefixesListRequest { + r.depthEmpty = &depthEmpty + return r +} + +func (r ApiIpamPrefixesListRequest) DepthGt(depthGt []int32) ApiIpamPrefixesListRequest { + r.depthGt = &depthGt + return r +} + +func (r ApiIpamPrefixesListRequest) DepthGte(depthGte []int32) ApiIpamPrefixesListRequest { + r.depthGte = &depthGte + return r +} + +func (r ApiIpamPrefixesListRequest) DepthLt(depthLt []int32) ApiIpamPrefixesListRequest { + r.depthLt = &depthLt + return r +} + +func (r ApiIpamPrefixesListRequest) DepthLte(depthLte []int32) ApiIpamPrefixesListRequest { + r.depthLte = &depthLte + return r +} + +func (r ApiIpamPrefixesListRequest) DepthN(depthN []int32) ApiIpamPrefixesListRequest { + r.depthN = &depthN + return r +} + +func (r ApiIpamPrefixesListRequest) Description(description []string) ApiIpamPrefixesListRequest { + r.description = &description + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamPrefixesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionIc(descriptionIc []string) ApiIpamPrefixesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionIe(descriptionIe []string) ApiIpamPrefixesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionIew(descriptionIew []string) ApiIpamPrefixesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamPrefixesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionN(descriptionN []string) ApiIpamPrefixesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionNic(descriptionNic []string) ApiIpamPrefixesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionNie(descriptionNie []string) ApiIpamPrefixesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamPrefixesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamPrefixesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamPrefixesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamPrefixesListRequest) Family(family float32) ApiIpamPrefixesListRequest { + r.family = &family + return r +} + +func (r ApiIpamPrefixesListRequest) Id(id []int32) ApiIpamPrefixesListRequest { + r.id = &id + return r +} + +func (r ApiIpamPrefixesListRequest) IdEmpty(idEmpty bool) ApiIpamPrefixesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamPrefixesListRequest) IdGt(idGt []int32) ApiIpamPrefixesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamPrefixesListRequest) IdGte(idGte []int32) ApiIpamPrefixesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamPrefixesListRequest) IdLt(idLt []int32) ApiIpamPrefixesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamPrefixesListRequest) IdLte(idLte []int32) ApiIpamPrefixesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamPrefixesListRequest) IdN(idN []int32) ApiIpamPrefixesListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamPrefixesListRequest) IsPool(isPool bool) ApiIpamPrefixesListRequest { + r.isPool = &isPool + return r +} + +func (r ApiIpamPrefixesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamPrefixesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamPrefixesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamPrefixesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamPrefixesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamPrefixesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamPrefixesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamPrefixesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamPrefixesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamPrefixesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamPrefixesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamPrefixesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamPrefixesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamPrefixesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamPrefixesListRequest) Limit(limit int32) ApiIpamPrefixesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamPrefixesListRequest) MarkUtilized(markUtilized bool) ApiIpamPrefixesListRequest { + r.markUtilized = &markUtilized + return r +} + +func (r ApiIpamPrefixesListRequest) MaskLength(maskLength []int32) ApiIpamPrefixesListRequest { + r.maskLength = &maskLength + return r +} + +func (r ApiIpamPrefixesListRequest) MaskLengthGte(maskLengthGte float32) ApiIpamPrefixesListRequest { + r.maskLengthGte = &maskLengthGte + return r +} + +func (r ApiIpamPrefixesListRequest) MaskLengthLte(maskLengthLte float32) ApiIpamPrefixesListRequest { + r.maskLengthLte = &maskLengthLte + return r +} + +func (r ApiIpamPrefixesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamPrefixesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiIpamPrefixesListRequest) Offset(offset int32) ApiIpamPrefixesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamPrefixesListRequest) Ordering(ordering string) ApiIpamPrefixesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiIpamPrefixesListRequest) Prefix(prefix []string) ApiIpamPrefixesListRequest { + r.prefix = &prefix + return r +} + +func (r ApiIpamPrefixesListRequest) PresentInVrf(presentInVrf string) ApiIpamPrefixesListRequest { + r.presentInVrf = &presentInVrf + return r +} + +func (r ApiIpamPrefixesListRequest) PresentInVrfId(presentInVrfId string) ApiIpamPrefixesListRequest { + r.presentInVrfId = &presentInVrfId + return r +} + +// Search +func (r ApiIpamPrefixesListRequest) Q(q string) ApiIpamPrefixesListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiIpamPrefixesListRequest) Region(region []int32) ApiIpamPrefixesListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiIpamPrefixesListRequest) RegionN(regionN []int32) ApiIpamPrefixesListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiIpamPrefixesListRequest) RegionId(regionId []int32) ApiIpamPrefixesListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiIpamPrefixesListRequest) RegionIdN(regionIdN []int32) ApiIpamPrefixesListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Role (slug) +func (r ApiIpamPrefixesListRequest) Role(role []string) ApiIpamPrefixesListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiIpamPrefixesListRequest) RoleN(roleN []string) ApiIpamPrefixesListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiIpamPrefixesListRequest) RoleId(roleId []*int32) ApiIpamPrefixesListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiIpamPrefixesListRequest) RoleIdN(roleIdN []*int32) ApiIpamPrefixesListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site (slug) +func (r ApiIpamPrefixesListRequest) Site(site []string) ApiIpamPrefixesListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiIpamPrefixesListRequest) SiteN(siteN []string) ApiIpamPrefixesListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiIpamPrefixesListRequest) SiteGroup(siteGroup []int32) ApiIpamPrefixesListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiIpamPrefixesListRequest) SiteGroupN(siteGroupN []int32) ApiIpamPrefixesListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiIpamPrefixesListRequest) SiteGroupId(siteGroupId []int32) ApiIpamPrefixesListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiIpamPrefixesListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiIpamPrefixesListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiIpamPrefixesListRequest) SiteId(siteId []*int32) ApiIpamPrefixesListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiIpamPrefixesListRequest) SiteIdN(siteIdN []*int32) ApiIpamPrefixesListRequest { + r.siteIdN = &siteIdN + return r +} + +// Operational status of this prefix +func (r ApiIpamPrefixesListRequest) Status(status []string) ApiIpamPrefixesListRequest { + r.status = &status + return r +} + +// Operational status of this prefix +func (r ApiIpamPrefixesListRequest) StatusN(statusN []string) ApiIpamPrefixesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiIpamPrefixesListRequest) Tag(tag []string) ApiIpamPrefixesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamPrefixesListRequest) TagN(tagN []string) ApiIpamPrefixesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamPrefixesListRequest) Tenant(tenant []string) ApiIpamPrefixesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamPrefixesListRequest) TenantN(tenantN []string) ApiIpamPrefixesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamPrefixesListRequest) TenantGroup(tenantGroup []int32) ApiIpamPrefixesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamPrefixesListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamPrefixesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamPrefixesListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamPrefixesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamPrefixesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamPrefixesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamPrefixesListRequest) TenantId(tenantId []*int32) ApiIpamPrefixesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamPrefixesListRequest) TenantIdN(tenantIdN []*int32) ApiIpamPrefixesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamPrefixesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamPrefixesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// VLAN (ID) +func (r ApiIpamPrefixesListRequest) VlanId(vlanId []*int32) ApiIpamPrefixesListRequest { + r.vlanId = &vlanId + return r +} + +// VLAN (ID) +func (r ApiIpamPrefixesListRequest) VlanIdN(vlanIdN []*int32) ApiIpamPrefixesListRequest { + r.vlanIdN = &vlanIdN + return r +} + +// VLAN number (1-4094) +func (r ApiIpamPrefixesListRequest) VlanVid(vlanVid int32) ApiIpamPrefixesListRequest { + r.vlanVid = &vlanVid + return r +} + +// VLAN number (1-4094) +func (r ApiIpamPrefixesListRequest) VlanVidEmpty(vlanVidEmpty int32) ApiIpamPrefixesListRequest { + r.vlanVidEmpty = &vlanVidEmpty + return r +} + +// VLAN number (1-4094) +func (r ApiIpamPrefixesListRequest) VlanVidGt(vlanVidGt int32) ApiIpamPrefixesListRequest { + r.vlanVidGt = &vlanVidGt + return r +} + +// VLAN number (1-4094) +func (r ApiIpamPrefixesListRequest) VlanVidGte(vlanVidGte int32) ApiIpamPrefixesListRequest { + r.vlanVidGte = &vlanVidGte + return r +} + +// VLAN number (1-4094) +func (r ApiIpamPrefixesListRequest) VlanVidLt(vlanVidLt int32) ApiIpamPrefixesListRequest { + r.vlanVidLt = &vlanVidLt + return r +} + +// VLAN number (1-4094) +func (r ApiIpamPrefixesListRequest) VlanVidLte(vlanVidLte int32) ApiIpamPrefixesListRequest { + r.vlanVidLte = &vlanVidLte + return r +} + +// VLAN number (1-4094) +func (r ApiIpamPrefixesListRequest) VlanVidN(vlanVidN int32) ApiIpamPrefixesListRequest { + r.vlanVidN = &vlanVidN + return r +} + +// VRF (RD) +func (r ApiIpamPrefixesListRequest) Vrf(vrf []*string) ApiIpamPrefixesListRequest { + r.vrf = &vrf + return r +} + +// VRF (RD) +func (r ApiIpamPrefixesListRequest) VrfN(vrfN []*string) ApiIpamPrefixesListRequest { + r.vrfN = &vrfN + return r +} + +// VRF +func (r ApiIpamPrefixesListRequest) VrfId(vrfId []*int32) ApiIpamPrefixesListRequest { + r.vrfId = &vrfId + return r +} + +// VRF +func (r ApiIpamPrefixesListRequest) VrfIdN(vrfIdN []*int32) ApiIpamPrefixesListRequest { + r.vrfIdN = &vrfIdN + return r +} + +// Within prefix +func (r ApiIpamPrefixesListRequest) Within(within string) ApiIpamPrefixesListRequest { + r.within = &within + return r +} + +// Within and including prefix +func (r ApiIpamPrefixesListRequest) WithinInclude(withinInclude string) ApiIpamPrefixesListRequest { + r.withinInclude = &withinInclude + return r +} + +func (r ApiIpamPrefixesListRequest) Execute() (*PaginatedPrefixList, *http.Response, error) { + return r.ApiService.IpamPrefixesListExecute(r) +} + +/* +IpamPrefixesList Method for IpamPrefixesList + +Get a list of prefix objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamPrefixesListRequest +*/ +func (a *IpamAPIService) IpamPrefixesList(ctx context.Context) ApiIpamPrefixesListRequest { + return ApiIpamPrefixesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPrefixList +func (a *IpamAPIService) IpamPrefixesListExecute(r ApiIpamPrefixesListRequest) (*PaginatedPrefixList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPrefixList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.children != nil { + t := *r.children + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "children", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "children", t, "multi") + } + } + if r.childrenEmpty != nil { + t := *r.childrenEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__empty", t, "multi") + } + } + if r.childrenGt != nil { + t := *r.childrenGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__gt", t, "multi") + } + } + if r.childrenGte != nil { + t := *r.childrenGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__gte", t, "multi") + } + } + if r.childrenLt != nil { + t := *r.childrenLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__lt", t, "multi") + } + } + if r.childrenLte != nil { + t := *r.childrenLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__lte", t, "multi") + } + } + if r.childrenN != nil { + t := *r.childrenN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "children__n", t, "multi") + } + } + if r.contains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "contains", r.contains, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.depth != nil { + t := *r.depth + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth", t, "multi") + } + } + if r.depthEmpty != nil { + t := *r.depthEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__empty", t, "multi") + } + } + if r.depthGt != nil { + t := *r.depthGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__gt", t, "multi") + } + } + if r.depthGte != nil { + t := *r.depthGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__gte", t, "multi") + } + } + if r.depthLt != nil { + t := *r.depthLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__lt", t, "multi") + } + } + if r.depthLte != nil { + t := *r.depthLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__lte", t, "multi") + } + } + if r.depthN != nil { + t := *r.depthN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "depth__n", t, "multi") + } + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.family != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "family", r.family, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.isPool != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_pool", r.isPool, "") + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.markUtilized != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mark_utilized", r.markUtilized, "") + } + if r.maskLength != nil { + t := *r.maskLength + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length", t, "multi") + } + } + if r.maskLengthGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length__gte", r.maskLengthGte, "") + } + if r.maskLengthLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mask_length__lte", r.maskLengthLte, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.prefix != nil { + t := *r.prefix + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", t, "multi") + } + } + if r.presentInVrf != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "present_in_vrf", r.presentInVrf, "") + } + if r.presentInVrfId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "present_in_vrf_id", r.presentInVrfId, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vlanId != nil { + t := *r.vlanId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", t, "multi") + } + } + if r.vlanIdN != nil { + t := *r.vlanIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id__n", t, "multi") + } + } + if r.vlanVid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid", r.vlanVid, "") + } + if r.vlanVidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__empty", r.vlanVidEmpty, "") + } + if r.vlanVidGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__gt", r.vlanVidGt, "") + } + if r.vlanVidGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__gte", r.vlanVidGte, "") + } + if r.vlanVidLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__lt", r.vlanVidLt, "") + } + if r.vlanVidLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__lte", r.vlanVidLte, "") + } + if r.vlanVidN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__n", r.vlanVidN, "") + } + if r.vrf != nil { + t := *r.vrf + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", t, "multi") + } + } + if r.vrfN != nil { + t := *r.vrfN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", t, "multi") + } + } + if r.vrfId != nil { + t := *r.vrfId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", t, "multi") + } + } + if r.vrfIdN != nil { + t := *r.vrfIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", t, "multi") + } + } + if r.within != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "within", r.within, "") + } + if r.withinInclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "within_include", r.withinInclude, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritablePrefixRequest *PatchedWritablePrefixRequest +} + +func (r ApiIpamPrefixesPartialUpdateRequest) PatchedWritablePrefixRequest(patchedWritablePrefixRequest PatchedWritablePrefixRequest) ApiIpamPrefixesPartialUpdateRequest { + r.patchedWritablePrefixRequest = &patchedWritablePrefixRequest + return r +} + +func (r ApiIpamPrefixesPartialUpdateRequest) Execute() (*Prefix, *http.Response, error) { + return r.ApiService.IpamPrefixesPartialUpdateExecute(r) +} + +/* +IpamPrefixesPartialUpdate Method for IpamPrefixesPartialUpdate + +Patch a prefix object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this prefix. + @return ApiIpamPrefixesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamPrefixesPartialUpdate(ctx context.Context, id int32) ApiIpamPrefixesPartialUpdateRequest { + return ApiIpamPrefixesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Prefix +func (a *IpamAPIService) IpamPrefixesPartialUpdateExecute(r ApiIpamPrefixesPartialUpdateRequest) (*Prefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritablePrefixRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamPrefixesRetrieveRequest) Execute() (*Prefix, *http.Response, error) { + return r.ApiService.IpamPrefixesRetrieveExecute(r) +} + +/* +IpamPrefixesRetrieve Method for IpamPrefixesRetrieve + +Get a prefix object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this prefix. + @return ApiIpamPrefixesRetrieveRequest +*/ +func (a *IpamAPIService) IpamPrefixesRetrieve(ctx context.Context, id int32) ApiIpamPrefixesRetrieveRequest { + return ApiIpamPrefixesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Prefix +func (a *IpamAPIService) IpamPrefixesRetrieveExecute(r ApiIpamPrefixesRetrieveRequest) (*Prefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamPrefixesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writablePrefixRequest *WritablePrefixRequest +} + +func (r ApiIpamPrefixesUpdateRequest) WritablePrefixRequest(writablePrefixRequest WritablePrefixRequest) ApiIpamPrefixesUpdateRequest { + r.writablePrefixRequest = &writablePrefixRequest + return r +} + +func (r ApiIpamPrefixesUpdateRequest) Execute() (*Prefix, *http.Response, error) { + return r.ApiService.IpamPrefixesUpdateExecute(r) +} + +/* +IpamPrefixesUpdate Method for IpamPrefixesUpdate + +Put a prefix object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this prefix. + @return ApiIpamPrefixesUpdateRequest +*/ +func (a *IpamAPIService) IpamPrefixesUpdate(ctx context.Context, id int32) ApiIpamPrefixesUpdateRequest { + return ApiIpamPrefixesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Prefix +func (a *IpamAPIService) IpamPrefixesUpdateExecute(r ApiIpamPrefixesUpdateRequest) (*Prefix, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prefix + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamPrefixesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/prefixes/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writablePrefixRequest == nil { + return localVarReturnValue, nil, reportError("writablePrefixRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writablePrefixRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRirsBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + rIRRequest *[]RIRRequest +} + +func (r ApiIpamRirsBulkDestroyRequest) RIRRequest(rIRRequest []RIRRequest) ApiIpamRirsBulkDestroyRequest { + r.rIRRequest = &rIRRequest + return r +} + +func (r ApiIpamRirsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamRirsBulkDestroyExecute(r) +} + +/* +IpamRirsBulkDestroy Method for IpamRirsBulkDestroy + +Delete a list of RIR objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRirsBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamRirsBulkDestroy(ctx context.Context) ApiIpamRirsBulkDestroyRequest { + return ApiIpamRirsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamRirsBulkDestroyExecute(r ApiIpamRirsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rIRRequest == nil { + return nil, reportError("rIRRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rIRRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamRirsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + rIRRequest *[]RIRRequest +} + +func (r ApiIpamRirsBulkPartialUpdateRequest) RIRRequest(rIRRequest []RIRRequest) ApiIpamRirsBulkPartialUpdateRequest { + r.rIRRequest = &rIRRequest + return r +} + +func (r ApiIpamRirsBulkPartialUpdateRequest) Execute() ([]RIR, *http.Response, error) { + return r.ApiService.IpamRirsBulkPartialUpdateExecute(r) +} + +/* +IpamRirsBulkPartialUpdate Method for IpamRirsBulkPartialUpdate + +Patch a list of RIR objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRirsBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamRirsBulkPartialUpdate(ctx context.Context) ApiIpamRirsBulkPartialUpdateRequest { + return ApiIpamRirsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RIR +func (a *IpamAPIService) IpamRirsBulkPartialUpdateExecute(r ApiIpamRirsBulkPartialUpdateRequest) ([]RIR, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RIR + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rIRRequest == nil { + return localVarReturnValue, nil, reportError("rIRRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rIRRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRirsBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + rIRRequest *[]RIRRequest +} + +func (r ApiIpamRirsBulkUpdateRequest) RIRRequest(rIRRequest []RIRRequest) ApiIpamRirsBulkUpdateRequest { + r.rIRRequest = &rIRRequest + return r +} + +func (r ApiIpamRirsBulkUpdateRequest) Execute() ([]RIR, *http.Response, error) { + return r.ApiService.IpamRirsBulkUpdateExecute(r) +} + +/* +IpamRirsBulkUpdate Method for IpamRirsBulkUpdate + +Put a list of RIR objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRirsBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamRirsBulkUpdate(ctx context.Context) ApiIpamRirsBulkUpdateRequest { + return ApiIpamRirsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RIR +func (a *IpamAPIService) IpamRirsBulkUpdateExecute(r ApiIpamRirsBulkUpdateRequest) ([]RIR, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RIR + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rIRRequest == nil { + return localVarReturnValue, nil, reportError("rIRRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rIRRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRirsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + rIRRequest *RIRRequest +} + +func (r ApiIpamRirsCreateRequest) RIRRequest(rIRRequest RIRRequest) ApiIpamRirsCreateRequest { + r.rIRRequest = &rIRRequest + return r +} + +func (r ApiIpamRirsCreateRequest) Execute() (*RIR, *http.Response, error) { + return r.ApiService.IpamRirsCreateExecute(r) +} + +/* +IpamRirsCreate Method for IpamRirsCreate + +Post a list of RIR objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRirsCreateRequest +*/ +func (a *IpamAPIService) IpamRirsCreate(ctx context.Context) ApiIpamRirsCreateRequest { + return ApiIpamRirsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RIR +func (a *IpamAPIService) IpamRirsCreateExecute(r ApiIpamRirsCreateRequest) (*RIR, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RIR + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rIRRequest == nil { + return localVarReturnValue, nil, reportError("rIRRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rIRRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRirsDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamRirsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamRirsDestroyExecute(r) +} + +/* +IpamRirsDestroy Method for IpamRirsDestroy + +Delete a RIR object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RIR. + @return ApiIpamRirsDestroyRequest +*/ +func (a *IpamAPIService) IpamRirsDestroy(ctx context.Context, id int32) ApiIpamRirsDestroyRequest { + return ApiIpamRirsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamRirsDestroyExecute(r ApiIpamRirsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamRirsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + isPrivate *bool + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiIpamRirsListRequest) Created(created []time.Time) ApiIpamRirsListRequest { + r.created = &created + return r +} + +func (r ApiIpamRirsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamRirsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamRirsListRequest) CreatedGt(createdGt []time.Time) ApiIpamRirsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamRirsListRequest) CreatedGte(createdGte []time.Time) ApiIpamRirsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamRirsListRequest) CreatedLt(createdLt []time.Time) ApiIpamRirsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamRirsListRequest) CreatedLte(createdLte []time.Time) ApiIpamRirsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamRirsListRequest) CreatedN(createdN []time.Time) ApiIpamRirsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamRirsListRequest) CreatedByRequest(createdByRequest string) ApiIpamRirsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamRirsListRequest) Description(description []string) ApiIpamRirsListRequest { + r.description = &description + return r +} + +func (r ApiIpamRirsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamRirsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamRirsListRequest) DescriptionIc(descriptionIc []string) ApiIpamRirsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamRirsListRequest) DescriptionIe(descriptionIe []string) ApiIpamRirsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamRirsListRequest) DescriptionIew(descriptionIew []string) ApiIpamRirsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamRirsListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamRirsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamRirsListRequest) DescriptionN(descriptionN []string) ApiIpamRirsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamRirsListRequest) DescriptionNic(descriptionNic []string) ApiIpamRirsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamRirsListRequest) DescriptionNie(descriptionNie []string) ApiIpamRirsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamRirsListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamRirsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamRirsListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamRirsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamRirsListRequest) Id(id []int32) ApiIpamRirsListRequest { + r.id = &id + return r +} + +func (r ApiIpamRirsListRequest) IdEmpty(idEmpty bool) ApiIpamRirsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamRirsListRequest) IdGt(idGt []int32) ApiIpamRirsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamRirsListRequest) IdGte(idGte []int32) ApiIpamRirsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamRirsListRequest) IdLt(idLt []int32) ApiIpamRirsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamRirsListRequest) IdLte(idLte []int32) ApiIpamRirsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamRirsListRequest) IdN(idN []int32) ApiIpamRirsListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamRirsListRequest) IsPrivate(isPrivate bool) ApiIpamRirsListRequest { + r.isPrivate = &isPrivate + return r +} + +func (r ApiIpamRirsListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamRirsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamRirsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamRirsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamRirsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamRirsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamRirsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamRirsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamRirsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamRirsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamRirsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamRirsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamRirsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamRirsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamRirsListRequest) Limit(limit int32) ApiIpamRirsListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamRirsListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamRirsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamRirsListRequest) Name(name []string) ApiIpamRirsListRequest { + r.name = &name + return r +} + +func (r ApiIpamRirsListRequest) NameEmpty(nameEmpty bool) ApiIpamRirsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamRirsListRequest) NameIc(nameIc []string) ApiIpamRirsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamRirsListRequest) NameIe(nameIe []string) ApiIpamRirsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamRirsListRequest) NameIew(nameIew []string) ApiIpamRirsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamRirsListRequest) NameIsw(nameIsw []string) ApiIpamRirsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamRirsListRequest) NameN(nameN []string) ApiIpamRirsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamRirsListRequest) NameNic(nameNic []string) ApiIpamRirsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamRirsListRequest) NameNie(nameNie []string) ApiIpamRirsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamRirsListRequest) NameNiew(nameNiew []string) ApiIpamRirsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamRirsListRequest) NameNisw(nameNisw []string) ApiIpamRirsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamRirsListRequest) Offset(offset int32) ApiIpamRirsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamRirsListRequest) Ordering(ordering string) ApiIpamRirsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamRirsListRequest) Q(q string) ApiIpamRirsListRequest { + r.q = &q + return r +} + +func (r ApiIpamRirsListRequest) Slug(slug []string) ApiIpamRirsListRequest { + r.slug = &slug + return r +} + +func (r ApiIpamRirsListRequest) SlugEmpty(slugEmpty bool) ApiIpamRirsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiIpamRirsListRequest) SlugIc(slugIc []string) ApiIpamRirsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiIpamRirsListRequest) SlugIe(slugIe []string) ApiIpamRirsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiIpamRirsListRequest) SlugIew(slugIew []string) ApiIpamRirsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiIpamRirsListRequest) SlugIsw(slugIsw []string) ApiIpamRirsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiIpamRirsListRequest) SlugN(slugN []string) ApiIpamRirsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiIpamRirsListRequest) SlugNic(slugNic []string) ApiIpamRirsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiIpamRirsListRequest) SlugNie(slugNie []string) ApiIpamRirsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiIpamRirsListRequest) SlugNiew(slugNiew []string) ApiIpamRirsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiIpamRirsListRequest) SlugNisw(slugNisw []string) ApiIpamRirsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiIpamRirsListRequest) Tag(tag []string) ApiIpamRirsListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamRirsListRequest) TagN(tagN []string) ApiIpamRirsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiIpamRirsListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamRirsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamRirsListRequest) Execute() (*PaginatedRIRList, *http.Response, error) { + return r.ApiService.IpamRirsListExecute(r) +} + +/* +IpamRirsList Method for IpamRirsList + +Get a list of RIR objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRirsListRequest +*/ +func (a *IpamAPIService) IpamRirsList(ctx context.Context) ApiIpamRirsListRequest { + return ApiIpamRirsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRIRList +func (a *IpamAPIService) IpamRirsListExecute(r ApiIpamRirsListRequest) (*PaginatedRIRList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRIRList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.isPrivate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_private", r.isPrivate, "") + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRirsPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedRIRRequest *PatchedRIRRequest +} + +func (r ApiIpamRirsPartialUpdateRequest) PatchedRIRRequest(patchedRIRRequest PatchedRIRRequest) ApiIpamRirsPartialUpdateRequest { + r.patchedRIRRequest = &patchedRIRRequest + return r +} + +func (r ApiIpamRirsPartialUpdateRequest) Execute() (*RIR, *http.Response, error) { + return r.ApiService.IpamRirsPartialUpdateExecute(r) +} + +/* +IpamRirsPartialUpdate Method for IpamRirsPartialUpdate + +Patch a RIR object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RIR. + @return ApiIpamRirsPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamRirsPartialUpdate(ctx context.Context, id int32) ApiIpamRirsPartialUpdateRequest { + return ApiIpamRirsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RIR +func (a *IpamAPIService) IpamRirsPartialUpdateExecute(r ApiIpamRirsPartialUpdateRequest) (*RIR, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RIR + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRIRRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRirsRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamRirsRetrieveRequest) Execute() (*RIR, *http.Response, error) { + return r.ApiService.IpamRirsRetrieveExecute(r) +} + +/* +IpamRirsRetrieve Method for IpamRirsRetrieve + +Get a RIR object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RIR. + @return ApiIpamRirsRetrieveRequest +*/ +func (a *IpamAPIService) IpamRirsRetrieve(ctx context.Context, id int32) ApiIpamRirsRetrieveRequest { + return ApiIpamRirsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RIR +func (a *IpamAPIService) IpamRirsRetrieveExecute(r ApiIpamRirsRetrieveRequest) (*RIR, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RIR + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRirsUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + rIRRequest *RIRRequest +} + +func (r ApiIpamRirsUpdateRequest) RIRRequest(rIRRequest RIRRequest) ApiIpamRirsUpdateRequest { + r.rIRRequest = &rIRRequest + return r +} + +func (r ApiIpamRirsUpdateRequest) Execute() (*RIR, *http.Response, error) { + return r.ApiService.IpamRirsUpdateExecute(r) +} + +/* +IpamRirsUpdate Method for IpamRirsUpdate + +Put a RIR object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RIR. + @return ApiIpamRirsUpdateRequest +*/ +func (a *IpamAPIService) IpamRirsUpdate(ctx context.Context, id int32) ApiIpamRirsUpdateRequest { + return ApiIpamRirsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RIR +func (a *IpamAPIService) IpamRirsUpdateExecute(r ApiIpamRirsUpdateRequest) (*RIR, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RIR + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRirsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/rirs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rIRRequest == nil { + return localVarReturnValue, nil, reportError("rIRRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rIRRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRolesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + roleRequest *[]RoleRequest +} + +func (r ApiIpamRolesBulkDestroyRequest) RoleRequest(roleRequest []RoleRequest) ApiIpamRolesBulkDestroyRequest { + r.roleRequest = &roleRequest + return r +} + +func (r ApiIpamRolesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamRolesBulkDestroyExecute(r) +} + +/* +IpamRolesBulkDestroy Method for IpamRolesBulkDestroy + +Delete a list of role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRolesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamRolesBulkDestroy(ctx context.Context) ApiIpamRolesBulkDestroyRequest { + return ApiIpamRolesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamRolesBulkDestroyExecute(r ApiIpamRolesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.roleRequest == nil { + return nil, reportError("roleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.roleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamRolesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + roleRequest *[]RoleRequest +} + +func (r ApiIpamRolesBulkPartialUpdateRequest) RoleRequest(roleRequest []RoleRequest) ApiIpamRolesBulkPartialUpdateRequest { + r.roleRequest = &roleRequest + return r +} + +func (r ApiIpamRolesBulkPartialUpdateRequest) Execute() ([]Role, *http.Response, error) { + return r.ApiService.IpamRolesBulkPartialUpdateExecute(r) +} + +/* +IpamRolesBulkPartialUpdate Method for IpamRolesBulkPartialUpdate + +Patch a list of role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRolesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamRolesBulkPartialUpdate(ctx context.Context) ApiIpamRolesBulkPartialUpdateRequest { + return ApiIpamRolesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Role +func (a *IpamAPIService) IpamRolesBulkPartialUpdateExecute(r ApiIpamRolesBulkPartialUpdateRequest) ([]Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.roleRequest == nil { + return localVarReturnValue, nil, reportError("roleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.roleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRolesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + roleRequest *[]RoleRequest +} + +func (r ApiIpamRolesBulkUpdateRequest) RoleRequest(roleRequest []RoleRequest) ApiIpamRolesBulkUpdateRequest { + r.roleRequest = &roleRequest + return r +} + +func (r ApiIpamRolesBulkUpdateRequest) Execute() ([]Role, *http.Response, error) { + return r.ApiService.IpamRolesBulkUpdateExecute(r) +} + +/* +IpamRolesBulkUpdate Method for IpamRolesBulkUpdate + +Put a list of role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRolesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamRolesBulkUpdate(ctx context.Context) ApiIpamRolesBulkUpdateRequest { + return ApiIpamRolesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Role +func (a *IpamAPIService) IpamRolesBulkUpdateExecute(r ApiIpamRolesBulkUpdateRequest) ([]Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.roleRequest == nil { + return localVarReturnValue, nil, reportError("roleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.roleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRolesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + roleRequest *RoleRequest +} + +func (r ApiIpamRolesCreateRequest) RoleRequest(roleRequest RoleRequest) ApiIpamRolesCreateRequest { + r.roleRequest = &roleRequest + return r +} + +func (r ApiIpamRolesCreateRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.IpamRolesCreateExecute(r) +} + +/* +IpamRolesCreate Method for IpamRolesCreate + +Post a list of role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRolesCreateRequest +*/ +func (a *IpamAPIService) IpamRolesCreate(ctx context.Context) ApiIpamRolesCreateRequest { + return ApiIpamRolesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Role +func (a *IpamAPIService) IpamRolesCreateExecute(r ApiIpamRolesCreateRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.roleRequest == nil { + return localVarReturnValue, nil, reportError("roleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.roleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRolesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamRolesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamRolesDestroyExecute(r) +} + +/* +IpamRolesDestroy Method for IpamRolesDestroy + +Delete a role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this role. + @return ApiIpamRolesDestroyRequest +*/ +func (a *IpamAPIService) IpamRolesDestroy(ctx context.Context, id int32) ApiIpamRolesDestroyRequest { + return ApiIpamRolesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamRolesDestroyExecute(r ApiIpamRolesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamRolesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiIpamRolesListRequest) Created(created []time.Time) ApiIpamRolesListRequest { + r.created = &created + return r +} + +func (r ApiIpamRolesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamRolesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamRolesListRequest) CreatedGt(createdGt []time.Time) ApiIpamRolesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamRolesListRequest) CreatedGte(createdGte []time.Time) ApiIpamRolesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamRolesListRequest) CreatedLt(createdLt []time.Time) ApiIpamRolesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamRolesListRequest) CreatedLte(createdLte []time.Time) ApiIpamRolesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamRolesListRequest) CreatedN(createdN []time.Time) ApiIpamRolesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamRolesListRequest) CreatedByRequest(createdByRequest string) ApiIpamRolesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamRolesListRequest) Description(description []string) ApiIpamRolesListRequest { + r.description = &description + return r +} + +func (r ApiIpamRolesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamRolesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamRolesListRequest) DescriptionIc(descriptionIc []string) ApiIpamRolesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamRolesListRequest) DescriptionIe(descriptionIe []string) ApiIpamRolesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamRolesListRequest) DescriptionIew(descriptionIew []string) ApiIpamRolesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamRolesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamRolesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamRolesListRequest) DescriptionN(descriptionN []string) ApiIpamRolesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamRolesListRequest) DescriptionNic(descriptionNic []string) ApiIpamRolesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamRolesListRequest) DescriptionNie(descriptionNie []string) ApiIpamRolesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamRolesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamRolesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamRolesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamRolesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamRolesListRequest) Id(id []int32) ApiIpamRolesListRequest { + r.id = &id + return r +} + +func (r ApiIpamRolesListRequest) IdEmpty(idEmpty bool) ApiIpamRolesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamRolesListRequest) IdGt(idGt []int32) ApiIpamRolesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamRolesListRequest) IdGte(idGte []int32) ApiIpamRolesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamRolesListRequest) IdLt(idLt []int32) ApiIpamRolesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamRolesListRequest) IdLte(idLte []int32) ApiIpamRolesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamRolesListRequest) IdN(idN []int32) ApiIpamRolesListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamRolesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamRolesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamRolesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamRolesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamRolesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamRolesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamRolesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamRolesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamRolesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamRolesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamRolesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamRolesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamRolesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamRolesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamRolesListRequest) Limit(limit int32) ApiIpamRolesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamRolesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamRolesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamRolesListRequest) Name(name []string) ApiIpamRolesListRequest { + r.name = &name + return r +} + +func (r ApiIpamRolesListRequest) NameEmpty(nameEmpty bool) ApiIpamRolesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamRolesListRequest) NameIc(nameIc []string) ApiIpamRolesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamRolesListRequest) NameIe(nameIe []string) ApiIpamRolesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamRolesListRequest) NameIew(nameIew []string) ApiIpamRolesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamRolesListRequest) NameIsw(nameIsw []string) ApiIpamRolesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamRolesListRequest) NameN(nameN []string) ApiIpamRolesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamRolesListRequest) NameNic(nameNic []string) ApiIpamRolesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamRolesListRequest) NameNie(nameNie []string) ApiIpamRolesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamRolesListRequest) NameNiew(nameNiew []string) ApiIpamRolesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamRolesListRequest) NameNisw(nameNisw []string) ApiIpamRolesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamRolesListRequest) Offset(offset int32) ApiIpamRolesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamRolesListRequest) Ordering(ordering string) ApiIpamRolesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamRolesListRequest) Q(q string) ApiIpamRolesListRequest { + r.q = &q + return r +} + +func (r ApiIpamRolesListRequest) Slug(slug []string) ApiIpamRolesListRequest { + r.slug = &slug + return r +} + +func (r ApiIpamRolesListRequest) SlugEmpty(slugEmpty bool) ApiIpamRolesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiIpamRolesListRequest) SlugIc(slugIc []string) ApiIpamRolesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiIpamRolesListRequest) SlugIe(slugIe []string) ApiIpamRolesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiIpamRolesListRequest) SlugIew(slugIew []string) ApiIpamRolesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiIpamRolesListRequest) SlugIsw(slugIsw []string) ApiIpamRolesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiIpamRolesListRequest) SlugN(slugN []string) ApiIpamRolesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiIpamRolesListRequest) SlugNic(slugNic []string) ApiIpamRolesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiIpamRolesListRequest) SlugNie(slugNie []string) ApiIpamRolesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiIpamRolesListRequest) SlugNiew(slugNiew []string) ApiIpamRolesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiIpamRolesListRequest) SlugNisw(slugNisw []string) ApiIpamRolesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiIpamRolesListRequest) Tag(tag []string) ApiIpamRolesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamRolesListRequest) TagN(tagN []string) ApiIpamRolesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiIpamRolesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamRolesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamRolesListRequest) Execute() (*PaginatedRoleList, *http.Response, error) { + return r.ApiService.IpamRolesListExecute(r) +} + +/* +IpamRolesList Method for IpamRolesList + +Get a list of role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRolesListRequest +*/ +func (a *IpamAPIService) IpamRolesList(ctx context.Context) ApiIpamRolesListRequest { + return ApiIpamRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRoleList +func (a *IpamAPIService) IpamRolesListExecute(r ApiIpamRolesListRequest) (*PaginatedRoleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRoleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRolesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedRoleRequest *PatchedRoleRequest +} + +func (r ApiIpamRolesPartialUpdateRequest) PatchedRoleRequest(patchedRoleRequest PatchedRoleRequest) ApiIpamRolesPartialUpdateRequest { + r.patchedRoleRequest = &patchedRoleRequest + return r +} + +func (r ApiIpamRolesPartialUpdateRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.IpamRolesPartialUpdateExecute(r) +} + +/* +IpamRolesPartialUpdate Method for IpamRolesPartialUpdate + +Patch a role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this role. + @return ApiIpamRolesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamRolesPartialUpdate(ctx context.Context, id int32) ApiIpamRolesPartialUpdateRequest { + return ApiIpamRolesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Role +func (a *IpamAPIService) IpamRolesPartialUpdateExecute(r ApiIpamRolesPartialUpdateRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRolesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamRolesRetrieveRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.IpamRolesRetrieveExecute(r) +} + +/* +IpamRolesRetrieve Method for IpamRolesRetrieve + +Get a role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this role. + @return ApiIpamRolesRetrieveRequest +*/ +func (a *IpamAPIService) IpamRolesRetrieve(ctx context.Context, id int32) ApiIpamRolesRetrieveRequest { + return ApiIpamRolesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Role +func (a *IpamAPIService) IpamRolesRetrieveExecute(r ApiIpamRolesRetrieveRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRolesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + roleRequest *RoleRequest +} + +func (r ApiIpamRolesUpdateRequest) RoleRequest(roleRequest RoleRequest) ApiIpamRolesUpdateRequest { + r.roleRequest = &roleRequest + return r +} + +func (r ApiIpamRolesUpdateRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.IpamRolesUpdateExecute(r) +} + +/* +IpamRolesUpdate Method for IpamRolesUpdate + +Put a role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this role. + @return ApiIpamRolesUpdateRequest +*/ +func (a *IpamAPIService) IpamRolesUpdate(ctx context.Context, id int32) ApiIpamRolesUpdateRequest { + return ApiIpamRolesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Role +func (a *IpamAPIService) IpamRolesUpdateExecute(r ApiIpamRolesUpdateRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRolesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.roleRequest == nil { + return localVarReturnValue, nil, reportError("roleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.roleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + routeTargetRequest *[]RouteTargetRequest +} + +func (r ApiIpamRouteTargetsBulkDestroyRequest) RouteTargetRequest(routeTargetRequest []RouteTargetRequest) ApiIpamRouteTargetsBulkDestroyRequest { + r.routeTargetRequest = &routeTargetRequest + return r +} + +func (r ApiIpamRouteTargetsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamRouteTargetsBulkDestroyExecute(r) +} + +/* +IpamRouteTargetsBulkDestroy Method for IpamRouteTargetsBulkDestroy + +Delete a list of route target objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRouteTargetsBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsBulkDestroy(ctx context.Context) ApiIpamRouteTargetsBulkDestroyRequest { + return ApiIpamRouteTargetsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamRouteTargetsBulkDestroyExecute(r ApiIpamRouteTargetsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.routeTargetRequest == nil { + return nil, reportError("routeTargetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.routeTargetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + routeTargetRequest *[]RouteTargetRequest +} + +func (r ApiIpamRouteTargetsBulkPartialUpdateRequest) RouteTargetRequest(routeTargetRequest []RouteTargetRequest) ApiIpamRouteTargetsBulkPartialUpdateRequest { + r.routeTargetRequest = &routeTargetRequest + return r +} + +func (r ApiIpamRouteTargetsBulkPartialUpdateRequest) Execute() ([]RouteTarget, *http.Response, error) { + return r.ApiService.IpamRouteTargetsBulkPartialUpdateExecute(r) +} + +/* +IpamRouteTargetsBulkPartialUpdate Method for IpamRouteTargetsBulkPartialUpdate + +Patch a list of route target objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRouteTargetsBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsBulkPartialUpdate(ctx context.Context) ApiIpamRouteTargetsBulkPartialUpdateRequest { + return ApiIpamRouteTargetsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RouteTarget +func (a *IpamAPIService) IpamRouteTargetsBulkPartialUpdateExecute(r ApiIpamRouteTargetsBulkPartialUpdateRequest) ([]RouteTarget, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RouteTarget + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.routeTargetRequest == nil { + return localVarReturnValue, nil, reportError("routeTargetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.routeTargetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + routeTargetRequest *[]RouteTargetRequest +} + +func (r ApiIpamRouteTargetsBulkUpdateRequest) RouteTargetRequest(routeTargetRequest []RouteTargetRequest) ApiIpamRouteTargetsBulkUpdateRequest { + r.routeTargetRequest = &routeTargetRequest + return r +} + +func (r ApiIpamRouteTargetsBulkUpdateRequest) Execute() ([]RouteTarget, *http.Response, error) { + return r.ApiService.IpamRouteTargetsBulkUpdateExecute(r) +} + +/* +IpamRouteTargetsBulkUpdate Method for IpamRouteTargetsBulkUpdate + +Put a list of route target objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRouteTargetsBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsBulkUpdate(ctx context.Context) ApiIpamRouteTargetsBulkUpdateRequest { + return ApiIpamRouteTargetsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []RouteTarget +func (a *IpamAPIService) IpamRouteTargetsBulkUpdateExecute(r ApiIpamRouteTargetsBulkUpdateRequest) ([]RouteTarget, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []RouteTarget + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.routeTargetRequest == nil { + return localVarReturnValue, nil, reportError("routeTargetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.routeTargetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableRouteTargetRequest *WritableRouteTargetRequest +} + +func (r ApiIpamRouteTargetsCreateRequest) WritableRouteTargetRequest(writableRouteTargetRequest WritableRouteTargetRequest) ApiIpamRouteTargetsCreateRequest { + r.writableRouteTargetRequest = &writableRouteTargetRequest + return r +} + +func (r ApiIpamRouteTargetsCreateRequest) Execute() (*RouteTarget, *http.Response, error) { + return r.ApiService.IpamRouteTargetsCreateExecute(r) +} + +/* +IpamRouteTargetsCreate Method for IpamRouteTargetsCreate + +Post a list of route target objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRouteTargetsCreateRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsCreate(ctx context.Context) ApiIpamRouteTargetsCreateRequest { + return ApiIpamRouteTargetsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RouteTarget +func (a *IpamAPIService) IpamRouteTargetsCreateExecute(r ApiIpamRouteTargetsCreateRequest) (*RouteTarget, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteTarget + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRouteTargetRequest == nil { + return localVarReturnValue, nil, reportError("writableRouteTargetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRouteTargetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamRouteTargetsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamRouteTargetsDestroyExecute(r) +} + +/* +IpamRouteTargetsDestroy Method for IpamRouteTargetsDestroy + +Delete a route target object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this route target. + @return ApiIpamRouteTargetsDestroyRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsDestroy(ctx context.Context, id int32) ApiIpamRouteTargetsDestroyRequest { + return ApiIpamRouteTargetsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamRouteTargetsDestroyExecute(r ApiIpamRouteTargetsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + exportingVrf *[]*string + exportingVrfN *[]*string + exportingVrfId *[]int32 + exportingVrfIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + importingVrf *[]*string + importingVrfN *[]*string + importingVrfId *[]int32 + importingVrfIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiIpamRouteTargetsListRequest) Created(created []time.Time) ApiIpamRouteTargetsListRequest { + r.created = &created + return r +} + +func (r ApiIpamRouteTargetsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamRouteTargetsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamRouteTargetsListRequest) CreatedGt(createdGt []time.Time) ApiIpamRouteTargetsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamRouteTargetsListRequest) CreatedGte(createdGte []time.Time) ApiIpamRouteTargetsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamRouteTargetsListRequest) CreatedLt(createdLt []time.Time) ApiIpamRouteTargetsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamRouteTargetsListRequest) CreatedLte(createdLte []time.Time) ApiIpamRouteTargetsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamRouteTargetsListRequest) CreatedN(createdN []time.Time) ApiIpamRouteTargetsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamRouteTargetsListRequest) CreatedByRequest(createdByRequest string) ApiIpamRouteTargetsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamRouteTargetsListRequest) Description(description []string) ApiIpamRouteTargetsListRequest { + r.description = &description + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamRouteTargetsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionIc(descriptionIc []string) ApiIpamRouteTargetsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionIe(descriptionIe []string) ApiIpamRouteTargetsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionIew(descriptionIew []string) ApiIpamRouteTargetsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamRouteTargetsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionN(descriptionN []string) ApiIpamRouteTargetsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionNic(descriptionNic []string) ApiIpamRouteTargetsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionNie(descriptionNie []string) ApiIpamRouteTargetsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamRouteTargetsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamRouteTargetsListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamRouteTargetsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Export VRF (RD) +func (r ApiIpamRouteTargetsListRequest) ExportingVrf(exportingVrf []*string) ApiIpamRouteTargetsListRequest { + r.exportingVrf = &exportingVrf + return r +} + +// Export VRF (RD) +func (r ApiIpamRouteTargetsListRequest) ExportingVrfN(exportingVrfN []*string) ApiIpamRouteTargetsListRequest { + r.exportingVrfN = &exportingVrfN + return r +} + +// Exporting VRF +func (r ApiIpamRouteTargetsListRequest) ExportingVrfId(exportingVrfId []int32) ApiIpamRouteTargetsListRequest { + r.exportingVrfId = &exportingVrfId + return r +} + +// Exporting VRF +func (r ApiIpamRouteTargetsListRequest) ExportingVrfIdN(exportingVrfIdN []int32) ApiIpamRouteTargetsListRequest { + r.exportingVrfIdN = &exportingVrfIdN + return r +} + +func (r ApiIpamRouteTargetsListRequest) Id(id []int32) ApiIpamRouteTargetsListRequest { + r.id = &id + return r +} + +func (r ApiIpamRouteTargetsListRequest) IdEmpty(idEmpty bool) ApiIpamRouteTargetsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamRouteTargetsListRequest) IdGt(idGt []int32) ApiIpamRouteTargetsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamRouteTargetsListRequest) IdGte(idGte []int32) ApiIpamRouteTargetsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamRouteTargetsListRequest) IdLt(idLt []int32) ApiIpamRouteTargetsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamRouteTargetsListRequest) IdLte(idLte []int32) ApiIpamRouteTargetsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamRouteTargetsListRequest) IdN(idN []int32) ApiIpamRouteTargetsListRequest { + r.idN = &idN + return r +} + +// Import VRF (RD) +func (r ApiIpamRouteTargetsListRequest) ImportingVrf(importingVrf []*string) ApiIpamRouteTargetsListRequest { + r.importingVrf = &importingVrf + return r +} + +// Import VRF (RD) +func (r ApiIpamRouteTargetsListRequest) ImportingVrfN(importingVrfN []*string) ApiIpamRouteTargetsListRequest { + r.importingVrfN = &importingVrfN + return r +} + +// Importing VRF +func (r ApiIpamRouteTargetsListRequest) ImportingVrfId(importingVrfId []int32) ApiIpamRouteTargetsListRequest { + r.importingVrfId = &importingVrfId + return r +} + +// Importing VRF +func (r ApiIpamRouteTargetsListRequest) ImportingVrfIdN(importingVrfIdN []int32) ApiIpamRouteTargetsListRequest { + r.importingVrfIdN = &importingVrfIdN + return r +} + +func (r ApiIpamRouteTargetsListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamRouteTargetsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamRouteTargetsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamRouteTargetsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamRouteTargetsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamRouteTargetsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamRouteTargetsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamRouteTargetsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamRouteTargetsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamRouteTargetsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamRouteTargetsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamRouteTargetsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamRouteTargetsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamRouteTargetsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamRouteTargetsListRequest) Limit(limit int32) ApiIpamRouteTargetsListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamRouteTargetsListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamRouteTargetsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamRouteTargetsListRequest) Name(name []string) ApiIpamRouteTargetsListRequest { + r.name = &name + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameEmpty(nameEmpty bool) ApiIpamRouteTargetsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameIc(nameIc []string) ApiIpamRouteTargetsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameIe(nameIe []string) ApiIpamRouteTargetsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameIew(nameIew []string) ApiIpamRouteTargetsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameIsw(nameIsw []string) ApiIpamRouteTargetsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameN(nameN []string) ApiIpamRouteTargetsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameNic(nameNic []string) ApiIpamRouteTargetsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameNie(nameNie []string) ApiIpamRouteTargetsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameNiew(nameNiew []string) ApiIpamRouteTargetsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamRouteTargetsListRequest) NameNisw(nameNisw []string) ApiIpamRouteTargetsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamRouteTargetsListRequest) Offset(offset int32) ApiIpamRouteTargetsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamRouteTargetsListRequest) Ordering(ordering string) ApiIpamRouteTargetsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamRouteTargetsListRequest) Q(q string) ApiIpamRouteTargetsListRequest { + r.q = &q + return r +} + +func (r ApiIpamRouteTargetsListRequest) Tag(tag []string) ApiIpamRouteTargetsListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamRouteTargetsListRequest) TagN(tagN []string) ApiIpamRouteTargetsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamRouteTargetsListRequest) Tenant(tenant []string) ApiIpamRouteTargetsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamRouteTargetsListRequest) TenantN(tenantN []string) ApiIpamRouteTargetsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamRouteTargetsListRequest) TenantGroup(tenantGroup []int32) ApiIpamRouteTargetsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamRouteTargetsListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamRouteTargetsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamRouteTargetsListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamRouteTargetsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamRouteTargetsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamRouteTargetsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamRouteTargetsListRequest) TenantId(tenantId []*int32) ApiIpamRouteTargetsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamRouteTargetsListRequest) TenantIdN(tenantIdN []*int32) ApiIpamRouteTargetsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamRouteTargetsListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamRouteTargetsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamRouteTargetsListRequest) Execute() (*PaginatedRouteTargetList, *http.Response, error) { + return r.ApiService.IpamRouteTargetsListExecute(r) +} + +/* +IpamRouteTargetsList Method for IpamRouteTargetsList + +Get a list of route target objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamRouteTargetsListRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsList(ctx context.Context) ApiIpamRouteTargetsListRequest { + return ApiIpamRouteTargetsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRouteTargetList +func (a *IpamAPIService) IpamRouteTargetsListExecute(r ApiIpamRouteTargetsListRequest) (*PaginatedRouteTargetList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRouteTargetList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.exportingVrf != nil { + t := *r.exportingVrf + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf", t, "multi") + } + } + if r.exportingVrfN != nil { + t := *r.exportingVrfN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf__n", t, "multi") + } + } + if r.exportingVrfId != nil { + t := *r.exportingVrfId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf_id", t, "multi") + } + } + if r.exportingVrfIdN != nil { + t := *r.exportingVrfIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "exporting_vrf_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.importingVrf != nil { + t := *r.importingVrf + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf", t, "multi") + } + } + if r.importingVrfN != nil { + t := *r.importingVrfN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf__n", t, "multi") + } + } + if r.importingVrfId != nil { + t := *r.importingVrfId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf_id", t, "multi") + } + } + if r.importingVrfIdN != nil { + t := *r.importingVrfIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "importing_vrf_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableRouteTargetRequest *PatchedWritableRouteTargetRequest +} + +func (r ApiIpamRouteTargetsPartialUpdateRequest) PatchedWritableRouteTargetRequest(patchedWritableRouteTargetRequest PatchedWritableRouteTargetRequest) ApiIpamRouteTargetsPartialUpdateRequest { + r.patchedWritableRouteTargetRequest = &patchedWritableRouteTargetRequest + return r +} + +func (r ApiIpamRouteTargetsPartialUpdateRequest) Execute() (*RouteTarget, *http.Response, error) { + return r.ApiService.IpamRouteTargetsPartialUpdateExecute(r) +} + +/* +IpamRouteTargetsPartialUpdate Method for IpamRouteTargetsPartialUpdate + +Patch a route target object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this route target. + @return ApiIpamRouteTargetsPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsPartialUpdate(ctx context.Context, id int32) ApiIpamRouteTargetsPartialUpdateRequest { + return ApiIpamRouteTargetsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RouteTarget +func (a *IpamAPIService) IpamRouteTargetsPartialUpdateExecute(r ApiIpamRouteTargetsPartialUpdateRequest) (*RouteTarget, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteTarget + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableRouteTargetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamRouteTargetsRetrieveRequest) Execute() (*RouteTarget, *http.Response, error) { + return r.ApiService.IpamRouteTargetsRetrieveExecute(r) +} + +/* +IpamRouteTargetsRetrieve Method for IpamRouteTargetsRetrieve + +Get a route target object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this route target. + @return ApiIpamRouteTargetsRetrieveRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsRetrieve(ctx context.Context, id int32) ApiIpamRouteTargetsRetrieveRequest { + return ApiIpamRouteTargetsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RouteTarget +func (a *IpamAPIService) IpamRouteTargetsRetrieveExecute(r ApiIpamRouteTargetsRetrieveRequest) (*RouteTarget, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteTarget + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamRouteTargetsUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableRouteTargetRequest *WritableRouteTargetRequest +} + +func (r ApiIpamRouteTargetsUpdateRequest) WritableRouteTargetRequest(writableRouteTargetRequest WritableRouteTargetRequest) ApiIpamRouteTargetsUpdateRequest { + r.writableRouteTargetRequest = &writableRouteTargetRequest + return r +} + +func (r ApiIpamRouteTargetsUpdateRequest) Execute() (*RouteTarget, *http.Response, error) { + return r.ApiService.IpamRouteTargetsUpdateExecute(r) +} + +/* +IpamRouteTargetsUpdate Method for IpamRouteTargetsUpdate + +Put a route target object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this route target. + @return ApiIpamRouteTargetsUpdateRequest +*/ +func (a *IpamAPIService) IpamRouteTargetsUpdate(ctx context.Context, id int32) ApiIpamRouteTargetsUpdateRequest { + return ApiIpamRouteTargetsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RouteTarget +func (a *IpamAPIService) IpamRouteTargetsUpdateExecute(r ApiIpamRouteTargetsUpdateRequest) (*RouteTarget, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteTarget + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamRouteTargetsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/route-targets/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableRouteTargetRequest == nil { + return localVarReturnValue, nil, reportError("writableRouteTargetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableRouteTargetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + serviceTemplateRequest *[]ServiceTemplateRequest +} + +func (r ApiIpamServiceTemplatesBulkDestroyRequest) ServiceTemplateRequest(serviceTemplateRequest []ServiceTemplateRequest) ApiIpamServiceTemplatesBulkDestroyRequest { + r.serviceTemplateRequest = &serviceTemplateRequest + return r +} + +func (r ApiIpamServiceTemplatesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamServiceTemplatesBulkDestroyExecute(r) +} + +/* +IpamServiceTemplatesBulkDestroy Method for IpamServiceTemplatesBulkDestroy + +Delete a list of service template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServiceTemplatesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesBulkDestroy(ctx context.Context) ApiIpamServiceTemplatesBulkDestroyRequest { + return ApiIpamServiceTemplatesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamServiceTemplatesBulkDestroyExecute(r ApiIpamServiceTemplatesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceTemplateRequest == nil { + return nil, reportError("serviceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + serviceTemplateRequest *[]ServiceTemplateRequest +} + +func (r ApiIpamServiceTemplatesBulkPartialUpdateRequest) ServiceTemplateRequest(serviceTemplateRequest []ServiceTemplateRequest) ApiIpamServiceTemplatesBulkPartialUpdateRequest { + r.serviceTemplateRequest = &serviceTemplateRequest + return r +} + +func (r ApiIpamServiceTemplatesBulkPartialUpdateRequest) Execute() ([]ServiceTemplate, *http.Response, error) { + return r.ApiService.IpamServiceTemplatesBulkPartialUpdateExecute(r) +} + +/* +IpamServiceTemplatesBulkPartialUpdate Method for IpamServiceTemplatesBulkPartialUpdate + +Patch a list of service template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServiceTemplatesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesBulkPartialUpdate(ctx context.Context) ApiIpamServiceTemplatesBulkPartialUpdateRequest { + return ApiIpamServiceTemplatesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ServiceTemplate +func (a *IpamAPIService) IpamServiceTemplatesBulkPartialUpdateExecute(r ApiIpamServiceTemplatesBulkPartialUpdateRequest) ([]ServiceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ServiceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("serviceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + serviceTemplateRequest *[]ServiceTemplateRequest +} + +func (r ApiIpamServiceTemplatesBulkUpdateRequest) ServiceTemplateRequest(serviceTemplateRequest []ServiceTemplateRequest) ApiIpamServiceTemplatesBulkUpdateRequest { + r.serviceTemplateRequest = &serviceTemplateRequest + return r +} + +func (r ApiIpamServiceTemplatesBulkUpdateRequest) Execute() ([]ServiceTemplate, *http.Response, error) { + return r.ApiService.IpamServiceTemplatesBulkUpdateExecute(r) +} + +/* +IpamServiceTemplatesBulkUpdate Method for IpamServiceTemplatesBulkUpdate + +Put a list of service template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServiceTemplatesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesBulkUpdate(ctx context.Context) ApiIpamServiceTemplatesBulkUpdateRequest { + return ApiIpamServiceTemplatesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ServiceTemplate +func (a *IpamAPIService) IpamServiceTemplatesBulkUpdateExecute(r ApiIpamServiceTemplatesBulkUpdateRequest) ([]ServiceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ServiceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("serviceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableServiceTemplateRequest *WritableServiceTemplateRequest +} + +func (r ApiIpamServiceTemplatesCreateRequest) WritableServiceTemplateRequest(writableServiceTemplateRequest WritableServiceTemplateRequest) ApiIpamServiceTemplatesCreateRequest { + r.writableServiceTemplateRequest = &writableServiceTemplateRequest + return r +} + +func (r ApiIpamServiceTemplatesCreateRequest) Execute() (*ServiceTemplate, *http.Response, error) { + return r.ApiService.IpamServiceTemplatesCreateExecute(r) +} + +/* +IpamServiceTemplatesCreate Method for IpamServiceTemplatesCreate + +Post a list of service template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServiceTemplatesCreateRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesCreate(ctx context.Context) ApiIpamServiceTemplatesCreateRequest { + return ApiIpamServiceTemplatesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ServiceTemplate +func (a *IpamAPIService) IpamServiceTemplatesCreateExecute(r ApiIpamServiceTemplatesCreateRequest) (*ServiceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableServiceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableServiceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableServiceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamServiceTemplatesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamServiceTemplatesDestroyExecute(r) +} + +/* +IpamServiceTemplatesDestroy Method for IpamServiceTemplatesDestroy + +Delete a service template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service template. + @return ApiIpamServiceTemplatesDestroyRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesDestroy(ctx context.Context, id int32) ApiIpamServiceTemplatesDestroyRequest { + return ApiIpamServiceTemplatesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamServiceTemplatesDestroyExecute(r ApiIpamServiceTemplatesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + port *float32 + protocol *string + protocolN *string + q *string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiIpamServiceTemplatesListRequest) Created(created []time.Time) ApiIpamServiceTemplatesListRequest { + r.created = &created + return r +} + +func (r ApiIpamServiceTemplatesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamServiceTemplatesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamServiceTemplatesListRequest) CreatedGt(createdGt []time.Time) ApiIpamServiceTemplatesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamServiceTemplatesListRequest) CreatedGte(createdGte []time.Time) ApiIpamServiceTemplatesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamServiceTemplatesListRequest) CreatedLt(createdLt []time.Time) ApiIpamServiceTemplatesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamServiceTemplatesListRequest) CreatedLte(createdLte []time.Time) ApiIpamServiceTemplatesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamServiceTemplatesListRequest) CreatedN(createdN []time.Time) ApiIpamServiceTemplatesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamServiceTemplatesListRequest) CreatedByRequest(createdByRequest string) ApiIpamServiceTemplatesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamServiceTemplatesListRequest) Description(description []string) ApiIpamServiceTemplatesListRequest { + r.description = &description + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamServiceTemplatesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionIc(descriptionIc []string) ApiIpamServiceTemplatesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionIe(descriptionIe []string) ApiIpamServiceTemplatesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionIew(descriptionIew []string) ApiIpamServiceTemplatesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamServiceTemplatesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionN(descriptionN []string) ApiIpamServiceTemplatesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionNic(descriptionNic []string) ApiIpamServiceTemplatesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionNie(descriptionNie []string) ApiIpamServiceTemplatesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamServiceTemplatesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamServiceTemplatesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamServiceTemplatesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamServiceTemplatesListRequest) Id(id []int32) ApiIpamServiceTemplatesListRequest { + r.id = &id + return r +} + +func (r ApiIpamServiceTemplatesListRequest) IdEmpty(idEmpty bool) ApiIpamServiceTemplatesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamServiceTemplatesListRequest) IdGt(idGt []int32) ApiIpamServiceTemplatesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamServiceTemplatesListRequest) IdGte(idGte []int32) ApiIpamServiceTemplatesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamServiceTemplatesListRequest) IdLt(idLt []int32) ApiIpamServiceTemplatesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamServiceTemplatesListRequest) IdLte(idLte []int32) ApiIpamServiceTemplatesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamServiceTemplatesListRequest) IdN(idN []int32) ApiIpamServiceTemplatesListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamServiceTemplatesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamServiceTemplatesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamServiceTemplatesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamServiceTemplatesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamServiceTemplatesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamServiceTemplatesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamServiceTemplatesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamServiceTemplatesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamServiceTemplatesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamServiceTemplatesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamServiceTemplatesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamServiceTemplatesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamServiceTemplatesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamServiceTemplatesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamServiceTemplatesListRequest) Limit(limit int32) ApiIpamServiceTemplatesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamServiceTemplatesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamServiceTemplatesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamServiceTemplatesListRequest) Name(name []string) ApiIpamServiceTemplatesListRequest { + r.name = &name + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameEmpty(nameEmpty bool) ApiIpamServiceTemplatesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameIc(nameIc []string) ApiIpamServiceTemplatesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameIe(nameIe []string) ApiIpamServiceTemplatesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameIew(nameIew []string) ApiIpamServiceTemplatesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameIsw(nameIsw []string) ApiIpamServiceTemplatesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameN(nameN []string) ApiIpamServiceTemplatesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameNic(nameNic []string) ApiIpamServiceTemplatesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameNie(nameNie []string) ApiIpamServiceTemplatesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameNiew(nameNiew []string) ApiIpamServiceTemplatesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamServiceTemplatesListRequest) NameNisw(nameNisw []string) ApiIpamServiceTemplatesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamServiceTemplatesListRequest) Offset(offset int32) ApiIpamServiceTemplatesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamServiceTemplatesListRequest) Ordering(ordering string) ApiIpamServiceTemplatesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiIpamServiceTemplatesListRequest) Port(port float32) ApiIpamServiceTemplatesListRequest { + r.port = &port + return r +} + +func (r ApiIpamServiceTemplatesListRequest) Protocol(protocol string) ApiIpamServiceTemplatesListRequest { + r.protocol = &protocol + return r +} + +func (r ApiIpamServiceTemplatesListRequest) ProtocolN(protocolN string) ApiIpamServiceTemplatesListRequest { + r.protocolN = &protocolN + return r +} + +// Search +func (r ApiIpamServiceTemplatesListRequest) Q(q string) ApiIpamServiceTemplatesListRequest { + r.q = &q + return r +} + +func (r ApiIpamServiceTemplatesListRequest) Tag(tag []string) ApiIpamServiceTemplatesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamServiceTemplatesListRequest) TagN(tagN []string) ApiIpamServiceTemplatesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiIpamServiceTemplatesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamServiceTemplatesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamServiceTemplatesListRequest) Execute() (*PaginatedServiceTemplateList, *http.Response, error) { + return r.ApiService.IpamServiceTemplatesListExecute(r) +} + +/* +IpamServiceTemplatesList Method for IpamServiceTemplatesList + +Get a list of service template objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServiceTemplatesListRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesList(ctx context.Context) ApiIpamServiceTemplatesListRequest { + return ApiIpamServiceTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedServiceTemplateList +func (a *IpamAPIService) IpamServiceTemplatesListExecute(r ApiIpamServiceTemplatesListRequest) (*PaginatedServiceTemplateList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedServiceTemplateList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.port != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "port", r.port, "") + } + if r.protocol != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", r.protocol, "") + } + if r.protocolN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol__n", r.protocolN, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableServiceTemplateRequest *PatchedWritableServiceTemplateRequest +} + +func (r ApiIpamServiceTemplatesPartialUpdateRequest) PatchedWritableServiceTemplateRequest(patchedWritableServiceTemplateRequest PatchedWritableServiceTemplateRequest) ApiIpamServiceTemplatesPartialUpdateRequest { + r.patchedWritableServiceTemplateRequest = &patchedWritableServiceTemplateRequest + return r +} + +func (r ApiIpamServiceTemplatesPartialUpdateRequest) Execute() (*ServiceTemplate, *http.Response, error) { + return r.ApiService.IpamServiceTemplatesPartialUpdateExecute(r) +} + +/* +IpamServiceTemplatesPartialUpdate Method for IpamServiceTemplatesPartialUpdate + +Patch a service template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service template. + @return ApiIpamServiceTemplatesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesPartialUpdate(ctx context.Context, id int32) ApiIpamServiceTemplatesPartialUpdateRequest { + return ApiIpamServiceTemplatesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ServiceTemplate +func (a *IpamAPIService) IpamServiceTemplatesPartialUpdateExecute(r ApiIpamServiceTemplatesPartialUpdateRequest) (*ServiceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableServiceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamServiceTemplatesRetrieveRequest) Execute() (*ServiceTemplate, *http.Response, error) { + return r.ApiService.IpamServiceTemplatesRetrieveExecute(r) +} + +/* +IpamServiceTemplatesRetrieve Method for IpamServiceTemplatesRetrieve + +Get a service template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service template. + @return ApiIpamServiceTemplatesRetrieveRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesRetrieve(ctx context.Context, id int32) ApiIpamServiceTemplatesRetrieveRequest { + return ApiIpamServiceTemplatesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ServiceTemplate +func (a *IpamAPIService) IpamServiceTemplatesRetrieveExecute(r ApiIpamServiceTemplatesRetrieveRequest) (*ServiceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServiceTemplatesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableServiceTemplateRequest *WritableServiceTemplateRequest +} + +func (r ApiIpamServiceTemplatesUpdateRequest) WritableServiceTemplateRequest(writableServiceTemplateRequest WritableServiceTemplateRequest) ApiIpamServiceTemplatesUpdateRequest { + r.writableServiceTemplateRequest = &writableServiceTemplateRequest + return r +} + +func (r ApiIpamServiceTemplatesUpdateRequest) Execute() (*ServiceTemplate, *http.Response, error) { + return r.ApiService.IpamServiceTemplatesUpdateExecute(r) +} + +/* +IpamServiceTemplatesUpdate Method for IpamServiceTemplatesUpdate + +Put a service template object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service template. + @return ApiIpamServiceTemplatesUpdateRequest +*/ +func (a *IpamAPIService) IpamServiceTemplatesUpdate(ctx context.Context, id int32) ApiIpamServiceTemplatesUpdateRequest { + return ApiIpamServiceTemplatesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ServiceTemplate +func (a *IpamAPIService) IpamServiceTemplatesUpdateExecute(r ApiIpamServiceTemplatesUpdateRequest) (*ServiceTemplate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceTemplate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServiceTemplatesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/service-templates/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableServiceTemplateRequest == nil { + return localVarReturnValue, nil, reportError("writableServiceTemplateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableServiceTemplateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServicesBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + serviceRequest *[]ServiceRequest +} + +func (r ApiIpamServicesBulkDestroyRequest) ServiceRequest(serviceRequest []ServiceRequest) ApiIpamServicesBulkDestroyRequest { + r.serviceRequest = &serviceRequest + return r +} + +func (r ApiIpamServicesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamServicesBulkDestroyExecute(r) +} + +/* +IpamServicesBulkDestroy Method for IpamServicesBulkDestroy + +Delete a list of service objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServicesBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamServicesBulkDestroy(ctx context.Context) ApiIpamServicesBulkDestroyRequest { + return ApiIpamServicesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamServicesBulkDestroyExecute(r ApiIpamServicesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceRequest == nil { + return nil, reportError("serviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamServicesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + serviceRequest *[]ServiceRequest +} + +func (r ApiIpamServicesBulkPartialUpdateRequest) ServiceRequest(serviceRequest []ServiceRequest) ApiIpamServicesBulkPartialUpdateRequest { + r.serviceRequest = &serviceRequest + return r +} + +func (r ApiIpamServicesBulkPartialUpdateRequest) Execute() ([]Service, *http.Response, error) { + return r.ApiService.IpamServicesBulkPartialUpdateExecute(r) +} + +/* +IpamServicesBulkPartialUpdate Method for IpamServicesBulkPartialUpdate + +Patch a list of service objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServicesBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamServicesBulkPartialUpdate(ctx context.Context) ApiIpamServicesBulkPartialUpdateRequest { + return ApiIpamServicesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Service +func (a *IpamAPIService) IpamServicesBulkPartialUpdateExecute(r ApiIpamServicesBulkPartialUpdateRequest) ([]Service, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Service + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceRequest == nil { + return localVarReturnValue, nil, reportError("serviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServicesBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + serviceRequest *[]ServiceRequest +} + +func (r ApiIpamServicesBulkUpdateRequest) ServiceRequest(serviceRequest []ServiceRequest) ApiIpamServicesBulkUpdateRequest { + r.serviceRequest = &serviceRequest + return r +} + +func (r ApiIpamServicesBulkUpdateRequest) Execute() ([]Service, *http.Response, error) { + return r.ApiService.IpamServicesBulkUpdateExecute(r) +} + +/* +IpamServicesBulkUpdate Method for IpamServicesBulkUpdate + +Put a list of service objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServicesBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamServicesBulkUpdate(ctx context.Context) ApiIpamServicesBulkUpdateRequest { + return ApiIpamServicesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Service +func (a *IpamAPIService) IpamServicesBulkUpdateExecute(r ApiIpamServicesBulkUpdateRequest) ([]Service, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Service + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceRequest == nil { + return localVarReturnValue, nil, reportError("serviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServicesCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableServiceRequest *WritableServiceRequest +} + +func (r ApiIpamServicesCreateRequest) WritableServiceRequest(writableServiceRequest WritableServiceRequest) ApiIpamServicesCreateRequest { + r.writableServiceRequest = &writableServiceRequest + return r +} + +func (r ApiIpamServicesCreateRequest) Execute() (*Service, *http.Response, error) { + return r.ApiService.IpamServicesCreateExecute(r) +} + +/* +IpamServicesCreate Method for IpamServicesCreate + +Post a list of service objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServicesCreateRequest +*/ +func (a *IpamAPIService) IpamServicesCreate(ctx context.Context) ApiIpamServicesCreateRequest { + return ApiIpamServicesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Service +func (a *IpamAPIService) IpamServicesCreateExecute(r ApiIpamServicesCreateRequest) (*Service, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Service + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableServiceRequest == nil { + return localVarReturnValue, nil, reportError("writableServiceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableServiceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServicesDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamServicesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamServicesDestroyExecute(r) +} + +/* +IpamServicesDestroy Method for IpamServicesDestroy + +Delete a service object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service. + @return ApiIpamServicesDestroyRequest +*/ +func (a *IpamAPIService) IpamServicesDestroy(ctx context.Context, id int32) ApiIpamServicesDestroyRequest { + return ApiIpamServicesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamServicesDestroyExecute(r ApiIpamServicesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamServicesListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]*int32 + deviceIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + ipaddress *[]string + ipaddressN *[]string + ipaddressId *[]int32 + ipaddressIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + port *float32 + protocol *string + protocolN *string + q *string + tag *[]string + tagN *[]string + updatedByRequest *string + virtualMachine *[]string + virtualMachineN *[]string + virtualMachineId *[]*int32 + virtualMachineIdN *[]*int32 +} + +func (r ApiIpamServicesListRequest) Created(created []time.Time) ApiIpamServicesListRequest { + r.created = &created + return r +} + +func (r ApiIpamServicesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamServicesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamServicesListRequest) CreatedGt(createdGt []time.Time) ApiIpamServicesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamServicesListRequest) CreatedGte(createdGte []time.Time) ApiIpamServicesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamServicesListRequest) CreatedLt(createdLt []time.Time) ApiIpamServicesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamServicesListRequest) CreatedLte(createdLte []time.Time) ApiIpamServicesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamServicesListRequest) CreatedN(createdN []time.Time) ApiIpamServicesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamServicesListRequest) CreatedByRequest(createdByRequest string) ApiIpamServicesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamServicesListRequest) Description(description []string) ApiIpamServicesListRequest { + r.description = &description + return r +} + +func (r ApiIpamServicesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamServicesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamServicesListRequest) DescriptionIc(descriptionIc []string) ApiIpamServicesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamServicesListRequest) DescriptionIe(descriptionIe []string) ApiIpamServicesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamServicesListRequest) DescriptionIew(descriptionIew []string) ApiIpamServicesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamServicesListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamServicesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamServicesListRequest) DescriptionN(descriptionN []string) ApiIpamServicesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamServicesListRequest) DescriptionNic(descriptionNic []string) ApiIpamServicesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamServicesListRequest) DescriptionNie(descriptionNie []string) ApiIpamServicesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamServicesListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamServicesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamServicesListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamServicesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device (name) +func (r ApiIpamServicesListRequest) Device(device []*string) ApiIpamServicesListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiIpamServicesListRequest) DeviceN(deviceN []*string) ApiIpamServicesListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiIpamServicesListRequest) DeviceId(deviceId []*int32) ApiIpamServicesListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiIpamServicesListRequest) DeviceIdN(deviceIdN []*int32) ApiIpamServicesListRequest { + r.deviceIdN = &deviceIdN + return r +} + +func (r ApiIpamServicesListRequest) Id(id []int32) ApiIpamServicesListRequest { + r.id = &id + return r +} + +func (r ApiIpamServicesListRequest) IdEmpty(idEmpty bool) ApiIpamServicesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamServicesListRequest) IdGt(idGt []int32) ApiIpamServicesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamServicesListRequest) IdGte(idGte []int32) ApiIpamServicesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamServicesListRequest) IdLt(idLt []int32) ApiIpamServicesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamServicesListRequest) IdLte(idLte []int32) ApiIpamServicesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamServicesListRequest) IdN(idN []int32) ApiIpamServicesListRequest { + r.idN = &idN + return r +} + +// IP address +func (r ApiIpamServicesListRequest) Ipaddress(ipaddress []string) ApiIpamServicesListRequest { + r.ipaddress = &ipaddress + return r +} + +// IP address +func (r ApiIpamServicesListRequest) IpaddressN(ipaddressN []string) ApiIpamServicesListRequest { + r.ipaddressN = &ipaddressN + return r +} + +// IP address (ID) +func (r ApiIpamServicesListRequest) IpaddressId(ipaddressId []int32) ApiIpamServicesListRequest { + r.ipaddressId = &ipaddressId + return r +} + +// IP address (ID) +func (r ApiIpamServicesListRequest) IpaddressIdN(ipaddressIdN []int32) ApiIpamServicesListRequest { + r.ipaddressIdN = &ipaddressIdN + return r +} + +func (r ApiIpamServicesListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamServicesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamServicesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamServicesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamServicesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamServicesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamServicesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamServicesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamServicesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamServicesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamServicesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamServicesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamServicesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamServicesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamServicesListRequest) Limit(limit int32) ApiIpamServicesListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamServicesListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamServicesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamServicesListRequest) Name(name []string) ApiIpamServicesListRequest { + r.name = &name + return r +} + +func (r ApiIpamServicesListRequest) NameEmpty(nameEmpty bool) ApiIpamServicesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamServicesListRequest) NameIc(nameIc []string) ApiIpamServicesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamServicesListRequest) NameIe(nameIe []string) ApiIpamServicesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamServicesListRequest) NameIew(nameIew []string) ApiIpamServicesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamServicesListRequest) NameIsw(nameIsw []string) ApiIpamServicesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamServicesListRequest) NameN(nameN []string) ApiIpamServicesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamServicesListRequest) NameNic(nameNic []string) ApiIpamServicesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamServicesListRequest) NameNie(nameNie []string) ApiIpamServicesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamServicesListRequest) NameNiew(nameNiew []string) ApiIpamServicesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamServicesListRequest) NameNisw(nameNisw []string) ApiIpamServicesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamServicesListRequest) Offset(offset int32) ApiIpamServicesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamServicesListRequest) Ordering(ordering string) ApiIpamServicesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiIpamServicesListRequest) Port(port float32) ApiIpamServicesListRequest { + r.port = &port + return r +} + +func (r ApiIpamServicesListRequest) Protocol(protocol string) ApiIpamServicesListRequest { + r.protocol = &protocol + return r +} + +func (r ApiIpamServicesListRequest) ProtocolN(protocolN string) ApiIpamServicesListRequest { + r.protocolN = &protocolN + return r +} + +// Search +func (r ApiIpamServicesListRequest) Q(q string) ApiIpamServicesListRequest { + r.q = &q + return r +} + +func (r ApiIpamServicesListRequest) Tag(tag []string) ApiIpamServicesListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamServicesListRequest) TagN(tagN []string) ApiIpamServicesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiIpamServicesListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamServicesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual machine (name) +func (r ApiIpamServicesListRequest) VirtualMachine(virtualMachine []string) ApiIpamServicesListRequest { + r.virtualMachine = &virtualMachine + return r +} + +// Virtual machine (name) +func (r ApiIpamServicesListRequest) VirtualMachineN(virtualMachineN []string) ApiIpamServicesListRequest { + r.virtualMachineN = &virtualMachineN + return r +} + +// Virtual machine (ID) +func (r ApiIpamServicesListRequest) VirtualMachineId(virtualMachineId []*int32) ApiIpamServicesListRequest { + r.virtualMachineId = &virtualMachineId + return r +} + +// Virtual machine (ID) +func (r ApiIpamServicesListRequest) VirtualMachineIdN(virtualMachineIdN []*int32) ApiIpamServicesListRequest { + r.virtualMachineIdN = &virtualMachineIdN + return r +} + +func (r ApiIpamServicesListRequest) Execute() (*PaginatedServiceList, *http.Response, error) { + return r.ApiService.IpamServicesListExecute(r) +} + +/* +IpamServicesList Method for IpamServicesList + +Get a list of service objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamServicesListRequest +*/ +func (a *IpamAPIService) IpamServicesList(ctx context.Context) ApiIpamServicesListRequest { + return ApiIpamServicesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedServiceList +func (a *IpamAPIService) IpamServicesListExecute(r ApiIpamServicesListRequest) (*PaginatedServiceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedServiceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.ipaddress != nil { + t := *r.ipaddress + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress", t, "multi") + } + } + if r.ipaddressN != nil { + t := *r.ipaddressN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress__n", t, "multi") + } + } + if r.ipaddressId != nil { + t := *r.ipaddressId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress_id", t, "multi") + } + } + if r.ipaddressIdN != nil { + t := *r.ipaddressIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipaddress_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.port != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "port", r.port, "") + } + if r.protocol != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", r.protocol, "") + } + if r.protocolN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol__n", r.protocolN, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualMachine != nil { + t := *r.virtualMachine + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", t, "multi") + } + } + if r.virtualMachineN != nil { + t := *r.virtualMachineN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", t, "multi") + } + } + if r.virtualMachineId != nil { + t := *r.virtualMachineId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", t, "multi") + } + } + if r.virtualMachineIdN != nil { + t := *r.virtualMachineIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServicesPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableServiceRequest *PatchedWritableServiceRequest +} + +func (r ApiIpamServicesPartialUpdateRequest) PatchedWritableServiceRequest(patchedWritableServiceRequest PatchedWritableServiceRequest) ApiIpamServicesPartialUpdateRequest { + r.patchedWritableServiceRequest = &patchedWritableServiceRequest + return r +} + +func (r ApiIpamServicesPartialUpdateRequest) Execute() (*Service, *http.Response, error) { + return r.ApiService.IpamServicesPartialUpdateExecute(r) +} + +/* +IpamServicesPartialUpdate Method for IpamServicesPartialUpdate + +Patch a service object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service. + @return ApiIpamServicesPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamServicesPartialUpdate(ctx context.Context, id int32) ApiIpamServicesPartialUpdateRequest { + return ApiIpamServicesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Service +func (a *IpamAPIService) IpamServicesPartialUpdateExecute(r ApiIpamServicesPartialUpdateRequest) (*Service, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Service + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableServiceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServicesRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamServicesRetrieveRequest) Execute() (*Service, *http.Response, error) { + return r.ApiService.IpamServicesRetrieveExecute(r) +} + +/* +IpamServicesRetrieve Method for IpamServicesRetrieve + +Get a service object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service. + @return ApiIpamServicesRetrieveRequest +*/ +func (a *IpamAPIService) IpamServicesRetrieve(ctx context.Context, id int32) ApiIpamServicesRetrieveRequest { + return ApiIpamServicesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Service +func (a *IpamAPIService) IpamServicesRetrieveExecute(r ApiIpamServicesRetrieveRequest) (*Service, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Service + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamServicesUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableServiceRequest *WritableServiceRequest +} + +func (r ApiIpamServicesUpdateRequest) WritableServiceRequest(writableServiceRequest WritableServiceRequest) ApiIpamServicesUpdateRequest { + r.writableServiceRequest = &writableServiceRequest + return r +} + +func (r ApiIpamServicesUpdateRequest) Execute() (*Service, *http.Response, error) { + return r.ApiService.IpamServicesUpdateExecute(r) +} + +/* +IpamServicesUpdate Method for IpamServicesUpdate + +Put a service object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this service. + @return ApiIpamServicesUpdateRequest +*/ +func (a *IpamAPIService) IpamServicesUpdate(ctx context.Context, id int32) ApiIpamServicesUpdateRequest { + return ApiIpamServicesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Service +func (a *IpamAPIService) IpamServicesUpdateExecute(r ApiIpamServicesUpdateRequest) (*Service, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Service + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamServicesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/services/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableServiceRequest == nil { + return localVarReturnValue, nil, reportError("writableServiceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableServiceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsAvailableVlansCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + vLANRequest *[]VLANRequest +} + +func (r ApiIpamVlanGroupsAvailableVlansCreateRequest) VLANRequest(vLANRequest []VLANRequest) ApiIpamVlanGroupsAvailableVlansCreateRequest { + r.vLANRequest = &vLANRequest + return r +} + +func (r ApiIpamVlanGroupsAvailableVlansCreateRequest) Execute() ([]VLAN, *http.Response, error) { + return r.ApiService.IpamVlanGroupsAvailableVlansCreateExecute(r) +} + +/* +IpamVlanGroupsAvailableVlansCreate Method for IpamVlanGroupsAvailableVlansCreate + +Post a VLAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamVlanGroupsAvailableVlansCreateRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsAvailableVlansCreate(ctx context.Context, id int32) ApiIpamVlanGroupsAvailableVlansCreateRequest { + return ApiIpamVlanGroupsAvailableVlansCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []VLAN +func (a *IpamAPIService) IpamVlanGroupsAvailableVlansCreateExecute(r ApiIpamVlanGroupsAvailableVlansCreateRequest) ([]VLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsAvailableVlansCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/{id}/available-vlans/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANRequest == nil { + return localVarReturnValue, nil, reportError("vLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsAvailableVlansListRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamVlanGroupsAvailableVlansListRequest) Execute() ([]AvailableVLAN, *http.Response, error) { + return r.ApiService.IpamVlanGroupsAvailableVlansListExecute(r) +} + +/* +IpamVlanGroupsAvailableVlansList Method for IpamVlanGroupsAvailableVlansList + +Get a VLAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiIpamVlanGroupsAvailableVlansListRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsAvailableVlansList(ctx context.Context, id int32) ApiIpamVlanGroupsAvailableVlansListRequest { + return ApiIpamVlanGroupsAvailableVlansListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []AvailableVLAN +func (a *IpamAPIService) IpamVlanGroupsAvailableVlansListExecute(r ApiIpamVlanGroupsAvailableVlansListRequest) ([]AvailableVLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AvailableVLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsAvailableVlansList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/{id}/available-vlans/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + vLANGroupRequest *[]VLANGroupRequest +} + +func (r ApiIpamVlanGroupsBulkDestroyRequest) VLANGroupRequest(vLANGroupRequest []VLANGroupRequest) ApiIpamVlanGroupsBulkDestroyRequest { + r.vLANGroupRequest = &vLANGroupRequest + return r +} + +func (r ApiIpamVlanGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamVlanGroupsBulkDestroyExecute(r) +} + +/* +IpamVlanGroupsBulkDestroy Method for IpamVlanGroupsBulkDestroy + +Delete a list of VLAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlanGroupsBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsBulkDestroy(ctx context.Context) ApiIpamVlanGroupsBulkDestroyRequest { + return ApiIpamVlanGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamVlanGroupsBulkDestroyExecute(r ApiIpamVlanGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANGroupRequest == nil { + return nil, reportError("vLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + vLANGroupRequest *[]VLANGroupRequest +} + +func (r ApiIpamVlanGroupsBulkPartialUpdateRequest) VLANGroupRequest(vLANGroupRequest []VLANGroupRequest) ApiIpamVlanGroupsBulkPartialUpdateRequest { + r.vLANGroupRequest = &vLANGroupRequest + return r +} + +func (r ApiIpamVlanGroupsBulkPartialUpdateRequest) Execute() ([]VLANGroup, *http.Response, error) { + return r.ApiService.IpamVlanGroupsBulkPartialUpdateExecute(r) +} + +/* +IpamVlanGroupsBulkPartialUpdate Method for IpamVlanGroupsBulkPartialUpdate + +Patch a list of VLAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlanGroupsBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsBulkPartialUpdate(ctx context.Context) ApiIpamVlanGroupsBulkPartialUpdateRequest { + return ApiIpamVlanGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VLANGroup +func (a *IpamAPIService) IpamVlanGroupsBulkPartialUpdateExecute(r ApiIpamVlanGroupsBulkPartialUpdateRequest) ([]VLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("vLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + vLANGroupRequest *[]VLANGroupRequest +} + +func (r ApiIpamVlanGroupsBulkUpdateRequest) VLANGroupRequest(vLANGroupRequest []VLANGroupRequest) ApiIpamVlanGroupsBulkUpdateRequest { + r.vLANGroupRequest = &vLANGroupRequest + return r +} + +func (r ApiIpamVlanGroupsBulkUpdateRequest) Execute() ([]VLANGroup, *http.Response, error) { + return r.ApiService.IpamVlanGroupsBulkUpdateExecute(r) +} + +/* +IpamVlanGroupsBulkUpdate Method for IpamVlanGroupsBulkUpdate + +Put a list of VLAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlanGroupsBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsBulkUpdate(ctx context.Context) ApiIpamVlanGroupsBulkUpdateRequest { + return ApiIpamVlanGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VLANGroup +func (a *IpamAPIService) IpamVlanGroupsBulkUpdateExecute(r ApiIpamVlanGroupsBulkUpdateRequest) ([]VLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("vLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + vLANGroupRequest *VLANGroupRequest +} + +func (r ApiIpamVlanGroupsCreateRequest) VLANGroupRequest(vLANGroupRequest VLANGroupRequest) ApiIpamVlanGroupsCreateRequest { + r.vLANGroupRequest = &vLANGroupRequest + return r +} + +func (r ApiIpamVlanGroupsCreateRequest) Execute() (*VLANGroup, *http.Response, error) { + return r.ApiService.IpamVlanGroupsCreateExecute(r) +} + +/* +IpamVlanGroupsCreate Method for IpamVlanGroupsCreate + +Post a list of VLAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlanGroupsCreateRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsCreate(ctx context.Context) ApiIpamVlanGroupsCreateRequest { + return ApiIpamVlanGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VLANGroup +func (a *IpamAPIService) IpamVlanGroupsCreateExecute(r ApiIpamVlanGroupsCreateRequest) (*VLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("vLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamVlanGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamVlanGroupsDestroyExecute(r) +} + +/* +IpamVlanGroupsDestroy Method for IpamVlanGroupsDestroy + +Delete a VLAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN group. + @return ApiIpamVlanGroupsDestroyRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsDestroy(ctx context.Context, id int32) ApiIpamVlanGroupsDestroyRequest { + return ApiIpamVlanGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamVlanGroupsDestroyExecute(r ApiIpamVlanGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + cluster *int32 + clustergroup *float32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + location *int32 + maxVid *[]int32 + maxVidEmpty *bool + maxVidGt *[]int32 + maxVidGte *[]int32 + maxVidLt *[]int32 + maxVidLte *[]int32 + maxVidN *[]int32 + minVid *[]int32 + minVidEmpty *bool + minVidGt *[]int32 + minVidGte *[]int32 + minVidLt *[]int32 + minVidLte *[]int32 + minVidN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + rack *int32 + region *int32 + scopeId *[]int32 + scopeIdEmpty *bool + scopeIdGt *[]int32 + scopeIdGte *[]int32 + scopeIdLt *[]int32 + scopeIdLte *[]int32 + scopeIdN *[]int32 + scopeType *string + scopeTypeN *string + site *int32 + sitegroup *float32 + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiIpamVlanGroupsListRequest) Cluster(cluster int32) ApiIpamVlanGroupsListRequest { + r.cluster = &cluster + return r +} + +func (r ApiIpamVlanGroupsListRequest) Clustergroup(clustergroup float32) ApiIpamVlanGroupsListRequest { + r.clustergroup = &clustergroup + return r +} + +func (r ApiIpamVlanGroupsListRequest) Created(created []time.Time) ApiIpamVlanGroupsListRequest { + r.created = &created + return r +} + +func (r ApiIpamVlanGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamVlanGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) CreatedGt(createdGt []time.Time) ApiIpamVlanGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamVlanGroupsListRequest) CreatedGte(createdGte []time.Time) ApiIpamVlanGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamVlanGroupsListRequest) CreatedLt(createdLt []time.Time) ApiIpamVlanGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamVlanGroupsListRequest) CreatedLte(createdLte []time.Time) ApiIpamVlanGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamVlanGroupsListRequest) CreatedN(createdN []time.Time) ApiIpamVlanGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamVlanGroupsListRequest) CreatedByRequest(createdByRequest string) ApiIpamVlanGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamVlanGroupsListRequest) Description(description []string) ApiIpamVlanGroupsListRequest { + r.description = &description + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamVlanGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionIc(descriptionIc []string) ApiIpamVlanGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionIe(descriptionIe []string) ApiIpamVlanGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionIew(descriptionIew []string) ApiIpamVlanGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamVlanGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionN(descriptionN []string) ApiIpamVlanGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionNic(descriptionNic []string) ApiIpamVlanGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionNie(descriptionNie []string) ApiIpamVlanGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamVlanGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamVlanGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamVlanGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamVlanGroupsListRequest) Id(id []int32) ApiIpamVlanGroupsListRequest { + r.id = &id + return r +} + +func (r ApiIpamVlanGroupsListRequest) IdEmpty(idEmpty bool) ApiIpamVlanGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) IdGt(idGt []int32) ApiIpamVlanGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamVlanGroupsListRequest) IdGte(idGte []int32) ApiIpamVlanGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamVlanGroupsListRequest) IdLt(idLt []int32) ApiIpamVlanGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamVlanGroupsListRequest) IdLte(idLte []int32) ApiIpamVlanGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamVlanGroupsListRequest) IdN(idN []int32) ApiIpamVlanGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiIpamVlanGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamVlanGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamVlanGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamVlanGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamVlanGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamVlanGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamVlanGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamVlanGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamVlanGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamVlanGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamVlanGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamVlanGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamVlanGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamVlanGroupsListRequest) Limit(limit int32) ApiIpamVlanGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamVlanGroupsListRequest) Location(location int32) ApiIpamVlanGroupsListRequest { + r.location = &location + return r +} + +func (r ApiIpamVlanGroupsListRequest) MaxVid(maxVid []int32) ApiIpamVlanGroupsListRequest { + r.maxVid = &maxVid + return r +} + +func (r ApiIpamVlanGroupsListRequest) MaxVidEmpty(maxVidEmpty bool) ApiIpamVlanGroupsListRequest { + r.maxVidEmpty = &maxVidEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) MaxVidGt(maxVidGt []int32) ApiIpamVlanGroupsListRequest { + r.maxVidGt = &maxVidGt + return r +} + +func (r ApiIpamVlanGroupsListRequest) MaxVidGte(maxVidGte []int32) ApiIpamVlanGroupsListRequest { + r.maxVidGte = &maxVidGte + return r +} + +func (r ApiIpamVlanGroupsListRequest) MaxVidLt(maxVidLt []int32) ApiIpamVlanGroupsListRequest { + r.maxVidLt = &maxVidLt + return r +} + +func (r ApiIpamVlanGroupsListRequest) MaxVidLte(maxVidLte []int32) ApiIpamVlanGroupsListRequest { + r.maxVidLte = &maxVidLte + return r +} + +func (r ApiIpamVlanGroupsListRequest) MaxVidN(maxVidN []int32) ApiIpamVlanGroupsListRequest { + r.maxVidN = &maxVidN + return r +} + +func (r ApiIpamVlanGroupsListRequest) MinVid(minVid []int32) ApiIpamVlanGroupsListRequest { + r.minVid = &minVid + return r +} + +func (r ApiIpamVlanGroupsListRequest) MinVidEmpty(minVidEmpty bool) ApiIpamVlanGroupsListRequest { + r.minVidEmpty = &minVidEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) MinVidGt(minVidGt []int32) ApiIpamVlanGroupsListRequest { + r.minVidGt = &minVidGt + return r +} + +func (r ApiIpamVlanGroupsListRequest) MinVidGte(minVidGte []int32) ApiIpamVlanGroupsListRequest { + r.minVidGte = &minVidGte + return r +} + +func (r ApiIpamVlanGroupsListRequest) MinVidLt(minVidLt []int32) ApiIpamVlanGroupsListRequest { + r.minVidLt = &minVidLt + return r +} + +func (r ApiIpamVlanGroupsListRequest) MinVidLte(minVidLte []int32) ApiIpamVlanGroupsListRequest { + r.minVidLte = &minVidLte + return r +} + +func (r ApiIpamVlanGroupsListRequest) MinVidN(minVidN []int32) ApiIpamVlanGroupsListRequest { + r.minVidN = &minVidN + return r +} + +func (r ApiIpamVlanGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamVlanGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamVlanGroupsListRequest) Name(name []string) ApiIpamVlanGroupsListRequest { + r.name = &name + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameEmpty(nameEmpty bool) ApiIpamVlanGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameIc(nameIc []string) ApiIpamVlanGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameIe(nameIe []string) ApiIpamVlanGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameIew(nameIew []string) ApiIpamVlanGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameIsw(nameIsw []string) ApiIpamVlanGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameN(nameN []string) ApiIpamVlanGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameNic(nameNic []string) ApiIpamVlanGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameNie(nameNie []string) ApiIpamVlanGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameNiew(nameNiew []string) ApiIpamVlanGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamVlanGroupsListRequest) NameNisw(nameNisw []string) ApiIpamVlanGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamVlanGroupsListRequest) Offset(offset int32) ApiIpamVlanGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamVlanGroupsListRequest) Ordering(ordering string) ApiIpamVlanGroupsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamVlanGroupsListRequest) Q(q string) ApiIpamVlanGroupsListRequest { + r.q = &q + return r +} + +func (r ApiIpamVlanGroupsListRequest) Rack(rack int32) ApiIpamVlanGroupsListRequest { + r.rack = &rack + return r +} + +func (r ApiIpamVlanGroupsListRequest) Region(region int32) ApiIpamVlanGroupsListRequest { + r.region = ®ion + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeId(scopeId []int32) ApiIpamVlanGroupsListRequest { + r.scopeId = &scopeId + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeIdEmpty(scopeIdEmpty bool) ApiIpamVlanGroupsListRequest { + r.scopeIdEmpty = &scopeIdEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeIdGt(scopeIdGt []int32) ApiIpamVlanGroupsListRequest { + r.scopeIdGt = &scopeIdGt + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeIdGte(scopeIdGte []int32) ApiIpamVlanGroupsListRequest { + r.scopeIdGte = &scopeIdGte + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeIdLt(scopeIdLt []int32) ApiIpamVlanGroupsListRequest { + r.scopeIdLt = &scopeIdLt + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeIdLte(scopeIdLte []int32) ApiIpamVlanGroupsListRequest { + r.scopeIdLte = &scopeIdLte + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeIdN(scopeIdN []int32) ApiIpamVlanGroupsListRequest { + r.scopeIdN = &scopeIdN + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeType(scopeType string) ApiIpamVlanGroupsListRequest { + r.scopeType = &scopeType + return r +} + +func (r ApiIpamVlanGroupsListRequest) ScopeTypeN(scopeTypeN string) ApiIpamVlanGroupsListRequest { + r.scopeTypeN = &scopeTypeN + return r +} + +func (r ApiIpamVlanGroupsListRequest) Site(site int32) ApiIpamVlanGroupsListRequest { + r.site = &site + return r +} + +func (r ApiIpamVlanGroupsListRequest) Sitegroup(sitegroup float32) ApiIpamVlanGroupsListRequest { + r.sitegroup = &sitegroup + return r +} + +func (r ApiIpamVlanGroupsListRequest) Slug(slug []string) ApiIpamVlanGroupsListRequest { + r.slug = &slug + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugEmpty(slugEmpty bool) ApiIpamVlanGroupsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugIc(slugIc []string) ApiIpamVlanGroupsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugIe(slugIe []string) ApiIpamVlanGroupsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugIew(slugIew []string) ApiIpamVlanGroupsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugIsw(slugIsw []string) ApiIpamVlanGroupsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugN(slugN []string) ApiIpamVlanGroupsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugNic(slugNic []string) ApiIpamVlanGroupsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugNie(slugNie []string) ApiIpamVlanGroupsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugNiew(slugNiew []string) ApiIpamVlanGroupsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiIpamVlanGroupsListRequest) SlugNisw(slugNisw []string) ApiIpamVlanGroupsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiIpamVlanGroupsListRequest) Tag(tag []string) ApiIpamVlanGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamVlanGroupsListRequest) TagN(tagN []string) ApiIpamVlanGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiIpamVlanGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamVlanGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamVlanGroupsListRequest) Execute() (*PaginatedVLANGroupList, *http.Response, error) { + return r.ApiService.IpamVlanGroupsListExecute(r) +} + +/* +IpamVlanGroupsList Method for IpamVlanGroupsList + +Get a list of VLAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlanGroupsListRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsList(ctx context.Context) ApiIpamVlanGroupsListRequest { + return ApiIpamVlanGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVLANGroupList +func (a *IpamAPIService) IpamVlanGroupsListExecute(r ApiIpamVlanGroupsListRequest) (*PaginatedVLANGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVLANGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cluster != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster", r.cluster, "") + } + if r.clustergroup != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clustergroup", r.clustergroup, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.location != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "location", r.location, "") + } + if r.maxVid != nil { + t := *r.maxVid + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid", t, "multi") + } + } + if r.maxVidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__empty", r.maxVidEmpty, "") + } + if r.maxVidGt != nil { + t := *r.maxVidGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__gt", t, "multi") + } + } + if r.maxVidGte != nil { + t := *r.maxVidGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__gte", t, "multi") + } + } + if r.maxVidLt != nil { + t := *r.maxVidLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__lt", t, "multi") + } + } + if r.maxVidLte != nil { + t := *r.maxVidLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__lte", t, "multi") + } + } + if r.maxVidN != nil { + t := *r.maxVidN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_vid__n", t, "multi") + } + } + if r.minVid != nil { + t := *r.minVid + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid", t, "multi") + } + } + if r.minVidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__empty", r.minVidEmpty, "") + } + if r.minVidGt != nil { + t := *r.minVidGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__gt", t, "multi") + } + } + if r.minVidGte != nil { + t := *r.minVidGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__gte", t, "multi") + } + } + if r.minVidLt != nil { + t := *r.minVidLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__lt", t, "multi") + } + } + if r.minVidLte != nil { + t := *r.minVidLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__lte", t, "multi") + } + } + if r.minVidN != nil { + t := *r.minVidN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "min_vid__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rack != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rack", r.rack, "") + } + if r.region != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", r.region, "") + } + if r.scopeId != nil { + t := *r.scopeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id", t, "multi") + } + } + if r.scopeIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__empty", r.scopeIdEmpty, "") + } + if r.scopeIdGt != nil { + t := *r.scopeIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__gt", t, "multi") + } + } + if r.scopeIdGte != nil { + t := *r.scopeIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__gte", t, "multi") + } + } + if r.scopeIdLt != nil { + t := *r.scopeIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__lt", t, "multi") + } + } + if r.scopeIdLte != nil { + t := *r.scopeIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__lte", t, "multi") + } + } + if r.scopeIdN != nil { + t := *r.scopeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_id__n", t, "multi") + } + } + if r.scopeType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_type", r.scopeType, "") + } + if r.scopeTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_type__n", r.scopeTypeN, "") + } + if r.site != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", r.site, "") + } + if r.sitegroup != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sitegroup", r.sitegroup, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedVLANGroupRequest *PatchedVLANGroupRequest +} + +func (r ApiIpamVlanGroupsPartialUpdateRequest) PatchedVLANGroupRequest(patchedVLANGroupRequest PatchedVLANGroupRequest) ApiIpamVlanGroupsPartialUpdateRequest { + r.patchedVLANGroupRequest = &patchedVLANGroupRequest + return r +} + +func (r ApiIpamVlanGroupsPartialUpdateRequest) Execute() (*VLANGroup, *http.Response, error) { + return r.ApiService.IpamVlanGroupsPartialUpdateExecute(r) +} + +/* +IpamVlanGroupsPartialUpdate Method for IpamVlanGroupsPartialUpdate + +Patch a VLAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN group. + @return ApiIpamVlanGroupsPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsPartialUpdate(ctx context.Context, id int32) ApiIpamVlanGroupsPartialUpdateRequest { + return ApiIpamVlanGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VLANGroup +func (a *IpamAPIService) IpamVlanGroupsPartialUpdateExecute(r ApiIpamVlanGroupsPartialUpdateRequest) (*VLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedVLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamVlanGroupsRetrieveRequest) Execute() (*VLANGroup, *http.Response, error) { + return r.ApiService.IpamVlanGroupsRetrieveExecute(r) +} + +/* +IpamVlanGroupsRetrieve Method for IpamVlanGroupsRetrieve + +Get a VLAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN group. + @return ApiIpamVlanGroupsRetrieveRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsRetrieve(ctx context.Context, id int32) ApiIpamVlanGroupsRetrieveRequest { + return ApiIpamVlanGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VLANGroup +func (a *IpamAPIService) IpamVlanGroupsRetrieveExecute(r ApiIpamVlanGroupsRetrieveRequest) (*VLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlanGroupsUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + vLANGroupRequest *VLANGroupRequest +} + +func (r ApiIpamVlanGroupsUpdateRequest) VLANGroupRequest(vLANGroupRequest VLANGroupRequest) ApiIpamVlanGroupsUpdateRequest { + r.vLANGroupRequest = &vLANGroupRequest + return r +} + +func (r ApiIpamVlanGroupsUpdateRequest) Execute() (*VLANGroup, *http.Response, error) { + return r.ApiService.IpamVlanGroupsUpdateExecute(r) +} + +/* +IpamVlanGroupsUpdate Method for IpamVlanGroupsUpdate + +Put a VLAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN group. + @return ApiIpamVlanGroupsUpdateRequest +*/ +func (a *IpamAPIService) IpamVlanGroupsUpdate(ctx context.Context, id int32) ApiIpamVlanGroupsUpdateRequest { + return ApiIpamVlanGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VLANGroup +func (a *IpamAPIService) IpamVlanGroupsUpdateExecute(r ApiIpamVlanGroupsUpdateRequest) (*VLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlanGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("vLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlansBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + vLANRequest *[]VLANRequest +} + +func (r ApiIpamVlansBulkDestroyRequest) VLANRequest(vLANRequest []VLANRequest) ApiIpamVlansBulkDestroyRequest { + r.vLANRequest = &vLANRequest + return r +} + +func (r ApiIpamVlansBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamVlansBulkDestroyExecute(r) +} + +/* +IpamVlansBulkDestroy Method for IpamVlansBulkDestroy + +Delete a list of VLAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlansBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamVlansBulkDestroy(ctx context.Context) ApiIpamVlansBulkDestroyRequest { + return ApiIpamVlansBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamVlansBulkDestroyExecute(r ApiIpamVlansBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANRequest == nil { + return nil, reportError("vLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamVlansBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + vLANRequest *[]VLANRequest +} + +func (r ApiIpamVlansBulkPartialUpdateRequest) VLANRequest(vLANRequest []VLANRequest) ApiIpamVlansBulkPartialUpdateRequest { + r.vLANRequest = &vLANRequest + return r +} + +func (r ApiIpamVlansBulkPartialUpdateRequest) Execute() ([]VLAN, *http.Response, error) { + return r.ApiService.IpamVlansBulkPartialUpdateExecute(r) +} + +/* +IpamVlansBulkPartialUpdate Method for IpamVlansBulkPartialUpdate + +Patch a list of VLAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlansBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamVlansBulkPartialUpdate(ctx context.Context) ApiIpamVlansBulkPartialUpdateRequest { + return ApiIpamVlansBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VLAN +func (a *IpamAPIService) IpamVlansBulkPartialUpdateExecute(r ApiIpamVlansBulkPartialUpdateRequest) ([]VLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANRequest == nil { + return localVarReturnValue, nil, reportError("vLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlansBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + vLANRequest *[]VLANRequest +} + +func (r ApiIpamVlansBulkUpdateRequest) VLANRequest(vLANRequest []VLANRequest) ApiIpamVlansBulkUpdateRequest { + r.vLANRequest = &vLANRequest + return r +} + +func (r ApiIpamVlansBulkUpdateRequest) Execute() ([]VLAN, *http.Response, error) { + return r.ApiService.IpamVlansBulkUpdateExecute(r) +} + +/* +IpamVlansBulkUpdate Method for IpamVlansBulkUpdate + +Put a list of VLAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlansBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamVlansBulkUpdate(ctx context.Context) ApiIpamVlansBulkUpdateRequest { + return ApiIpamVlansBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VLAN +func (a *IpamAPIService) IpamVlansBulkUpdateExecute(r ApiIpamVlansBulkUpdateRequest) ([]VLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vLANRequest == nil { + return localVarReturnValue, nil, reportError("vLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlansCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableVLANRequest *WritableVLANRequest +} + +func (r ApiIpamVlansCreateRequest) WritableVLANRequest(writableVLANRequest WritableVLANRequest) ApiIpamVlansCreateRequest { + r.writableVLANRequest = &writableVLANRequest + return r +} + +func (r ApiIpamVlansCreateRequest) Execute() (*VLAN, *http.Response, error) { + return r.ApiService.IpamVlansCreateExecute(r) +} + +/* +IpamVlansCreate Method for IpamVlansCreate + +Post a list of VLAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlansCreateRequest +*/ +func (a *IpamAPIService) IpamVlansCreate(ctx context.Context) ApiIpamVlansCreateRequest { + return ApiIpamVlansCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VLAN +func (a *IpamAPIService) IpamVlansCreateExecute(r ApiIpamVlansCreateRequest) (*VLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVLANRequest == nil { + return localVarReturnValue, nil, reportError("writableVLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlansDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamVlansDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamVlansDestroyExecute(r) +} + +/* +IpamVlansDestroy Method for IpamVlansDestroy + +Delete a VLAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN. + @return ApiIpamVlansDestroyRequest +*/ +func (a *IpamAPIService) IpamVlansDestroy(ctx context.Context, id int32) ApiIpamVlansDestroyRequest { + return ApiIpamVlansDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamVlansDestroyExecute(r ApiIpamVlansDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamVlansListRequest struct { + ctx context.Context + ApiService *IpamAPIService + availableAtSite *string + availableOnDevice *string + availableOnVirtualmachine *string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + group *[]string + groupN *[]string + groupId *[]*int32 + groupIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + l2vpn *[]*int64 + l2vpnN *[]*int64 + l2vpnId *[]int32 + l2vpnIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]*int32 + roleIdN *[]*int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]*int32 + siteIdN *[]*int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + vid *[]int32 + vidEmpty *bool + vidGt *[]int32 + vidGte *[]int32 + vidLt *[]int32 + vidLte *[]int32 + vidN *[]int32 +} + +func (r ApiIpamVlansListRequest) AvailableAtSite(availableAtSite string) ApiIpamVlansListRequest { + r.availableAtSite = &availableAtSite + return r +} + +func (r ApiIpamVlansListRequest) AvailableOnDevice(availableOnDevice string) ApiIpamVlansListRequest { + r.availableOnDevice = &availableOnDevice + return r +} + +func (r ApiIpamVlansListRequest) AvailableOnVirtualmachine(availableOnVirtualmachine string) ApiIpamVlansListRequest { + r.availableOnVirtualmachine = &availableOnVirtualmachine + return r +} + +func (r ApiIpamVlansListRequest) Created(created []time.Time) ApiIpamVlansListRequest { + r.created = &created + return r +} + +func (r ApiIpamVlansListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamVlansListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamVlansListRequest) CreatedGt(createdGt []time.Time) ApiIpamVlansListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamVlansListRequest) CreatedGte(createdGte []time.Time) ApiIpamVlansListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamVlansListRequest) CreatedLt(createdLt []time.Time) ApiIpamVlansListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamVlansListRequest) CreatedLte(createdLte []time.Time) ApiIpamVlansListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamVlansListRequest) CreatedN(createdN []time.Time) ApiIpamVlansListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamVlansListRequest) CreatedByRequest(createdByRequest string) ApiIpamVlansListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamVlansListRequest) Description(description []string) ApiIpamVlansListRequest { + r.description = &description + return r +} + +func (r ApiIpamVlansListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamVlansListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamVlansListRequest) DescriptionIc(descriptionIc []string) ApiIpamVlansListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamVlansListRequest) DescriptionIe(descriptionIe []string) ApiIpamVlansListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamVlansListRequest) DescriptionIew(descriptionIew []string) ApiIpamVlansListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamVlansListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamVlansListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamVlansListRequest) DescriptionN(descriptionN []string) ApiIpamVlansListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamVlansListRequest) DescriptionNic(descriptionNic []string) ApiIpamVlansListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamVlansListRequest) DescriptionNie(descriptionNie []string) ApiIpamVlansListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamVlansListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamVlansListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamVlansListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamVlansListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Group +func (r ApiIpamVlansListRequest) Group(group []string) ApiIpamVlansListRequest { + r.group = &group + return r +} + +// Group +func (r ApiIpamVlansListRequest) GroupN(groupN []string) ApiIpamVlansListRequest { + r.groupN = &groupN + return r +} + +// Group (ID) +func (r ApiIpamVlansListRequest) GroupId(groupId []*int32) ApiIpamVlansListRequest { + r.groupId = &groupId + return r +} + +// Group (ID) +func (r ApiIpamVlansListRequest) GroupIdN(groupIdN []*int32) ApiIpamVlansListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiIpamVlansListRequest) Id(id []int32) ApiIpamVlansListRequest { + r.id = &id + return r +} + +func (r ApiIpamVlansListRequest) IdEmpty(idEmpty bool) ApiIpamVlansListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamVlansListRequest) IdGt(idGt []int32) ApiIpamVlansListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamVlansListRequest) IdGte(idGte []int32) ApiIpamVlansListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamVlansListRequest) IdLt(idLt []int32) ApiIpamVlansListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamVlansListRequest) IdLte(idLte []int32) ApiIpamVlansListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamVlansListRequest) IdN(idN []int32) ApiIpamVlansListRequest { + r.idN = &idN + return r +} + +// L2VPN +func (r ApiIpamVlansListRequest) L2vpn(l2vpn []*int64) ApiIpamVlansListRequest { + r.l2vpn = &l2vpn + return r +} + +// L2VPN +func (r ApiIpamVlansListRequest) L2vpnN(l2vpnN []*int64) ApiIpamVlansListRequest { + r.l2vpnN = &l2vpnN + return r +} + +// L2VPN (ID) +func (r ApiIpamVlansListRequest) L2vpnId(l2vpnId []int32) ApiIpamVlansListRequest { + r.l2vpnId = &l2vpnId + return r +} + +// L2VPN (ID) +func (r ApiIpamVlansListRequest) L2vpnIdN(l2vpnIdN []int32) ApiIpamVlansListRequest { + r.l2vpnIdN = &l2vpnIdN + return r +} + +func (r ApiIpamVlansListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamVlansListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamVlansListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamVlansListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamVlansListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamVlansListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamVlansListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamVlansListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamVlansListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamVlansListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamVlansListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamVlansListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamVlansListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamVlansListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamVlansListRequest) Limit(limit int32) ApiIpamVlansListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamVlansListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamVlansListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamVlansListRequest) Name(name []string) ApiIpamVlansListRequest { + r.name = &name + return r +} + +func (r ApiIpamVlansListRequest) NameEmpty(nameEmpty bool) ApiIpamVlansListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamVlansListRequest) NameIc(nameIc []string) ApiIpamVlansListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamVlansListRequest) NameIe(nameIe []string) ApiIpamVlansListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamVlansListRequest) NameIew(nameIew []string) ApiIpamVlansListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamVlansListRequest) NameIsw(nameIsw []string) ApiIpamVlansListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamVlansListRequest) NameN(nameN []string) ApiIpamVlansListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamVlansListRequest) NameNic(nameNic []string) ApiIpamVlansListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamVlansListRequest) NameNie(nameNie []string) ApiIpamVlansListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamVlansListRequest) NameNiew(nameNiew []string) ApiIpamVlansListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamVlansListRequest) NameNisw(nameNisw []string) ApiIpamVlansListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamVlansListRequest) Offset(offset int32) ApiIpamVlansListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamVlansListRequest) Ordering(ordering string) ApiIpamVlansListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamVlansListRequest) Q(q string) ApiIpamVlansListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiIpamVlansListRequest) Region(region []int32) ApiIpamVlansListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiIpamVlansListRequest) RegionN(regionN []int32) ApiIpamVlansListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiIpamVlansListRequest) RegionId(regionId []int32) ApiIpamVlansListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiIpamVlansListRequest) RegionIdN(regionIdN []int32) ApiIpamVlansListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Role (slug) +func (r ApiIpamVlansListRequest) Role(role []string) ApiIpamVlansListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiIpamVlansListRequest) RoleN(roleN []string) ApiIpamVlansListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiIpamVlansListRequest) RoleId(roleId []*int32) ApiIpamVlansListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiIpamVlansListRequest) RoleIdN(roleIdN []*int32) ApiIpamVlansListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site (slug) +func (r ApiIpamVlansListRequest) Site(site []string) ApiIpamVlansListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiIpamVlansListRequest) SiteN(siteN []string) ApiIpamVlansListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiIpamVlansListRequest) SiteGroup(siteGroup []int32) ApiIpamVlansListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiIpamVlansListRequest) SiteGroupN(siteGroupN []int32) ApiIpamVlansListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiIpamVlansListRequest) SiteGroupId(siteGroupId []int32) ApiIpamVlansListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiIpamVlansListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiIpamVlansListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiIpamVlansListRequest) SiteId(siteId []*int32) ApiIpamVlansListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiIpamVlansListRequest) SiteIdN(siteIdN []*int32) ApiIpamVlansListRequest { + r.siteIdN = &siteIdN + return r +} + +// Operational status of this VLAN +func (r ApiIpamVlansListRequest) Status(status []string) ApiIpamVlansListRequest { + r.status = &status + return r +} + +// Operational status of this VLAN +func (r ApiIpamVlansListRequest) StatusN(statusN []string) ApiIpamVlansListRequest { + r.statusN = &statusN + return r +} + +func (r ApiIpamVlansListRequest) Tag(tag []string) ApiIpamVlansListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamVlansListRequest) TagN(tagN []string) ApiIpamVlansListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamVlansListRequest) Tenant(tenant []string) ApiIpamVlansListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamVlansListRequest) TenantN(tenantN []string) ApiIpamVlansListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamVlansListRequest) TenantGroup(tenantGroup []int32) ApiIpamVlansListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamVlansListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamVlansListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamVlansListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamVlansListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamVlansListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamVlansListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamVlansListRequest) TenantId(tenantId []*int32) ApiIpamVlansListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamVlansListRequest) TenantIdN(tenantIdN []*int32) ApiIpamVlansListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamVlansListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamVlansListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamVlansListRequest) Vid(vid []int32) ApiIpamVlansListRequest { + r.vid = &vid + return r +} + +func (r ApiIpamVlansListRequest) VidEmpty(vidEmpty bool) ApiIpamVlansListRequest { + r.vidEmpty = &vidEmpty + return r +} + +func (r ApiIpamVlansListRequest) VidGt(vidGt []int32) ApiIpamVlansListRequest { + r.vidGt = &vidGt + return r +} + +func (r ApiIpamVlansListRequest) VidGte(vidGte []int32) ApiIpamVlansListRequest { + r.vidGte = &vidGte + return r +} + +func (r ApiIpamVlansListRequest) VidLt(vidLt []int32) ApiIpamVlansListRequest { + r.vidLt = &vidLt + return r +} + +func (r ApiIpamVlansListRequest) VidLte(vidLte []int32) ApiIpamVlansListRequest { + r.vidLte = &vidLte + return r +} + +func (r ApiIpamVlansListRequest) VidN(vidN []int32) ApiIpamVlansListRequest { + r.vidN = &vidN + return r +} + +func (r ApiIpamVlansListRequest) Execute() (*PaginatedVLANList, *http.Response, error) { + return r.ApiService.IpamVlansListExecute(r) +} + +/* +IpamVlansList Method for IpamVlansList + +Get a list of VLAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVlansListRequest +*/ +func (a *IpamAPIService) IpamVlansList(ctx context.Context) ApiIpamVlansListRequest { + return ApiIpamVlansListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVLANList +func (a *IpamAPIService) IpamVlansListExecute(r ApiIpamVlansListRequest) (*PaginatedVLANList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVLANList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.availableAtSite != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "available_at_site", r.availableAtSite, "") + } + if r.availableOnDevice != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "available_on_device", r.availableOnDevice, "") + } + if r.availableOnVirtualmachine != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "available_on_virtualmachine", r.availableOnVirtualmachine, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.l2vpn != nil { + t := *r.l2vpn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", t, "multi") + } + } + if r.l2vpnN != nil { + t := *r.l2vpnN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", t, "multi") + } + } + if r.l2vpnId != nil { + t := *r.l2vpnId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", t, "multi") + } + } + if r.l2vpnIdN != nil { + t := *r.l2vpnIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vid != nil { + t := *r.vid + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid", t, "multi") + } + } + if r.vidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__empty", r.vidEmpty, "") + } + if r.vidGt != nil { + t := *r.vidGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__gt", t, "multi") + } + } + if r.vidGte != nil { + t := *r.vidGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__gte", t, "multi") + } + } + if r.vidLt != nil { + t := *r.vidLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__lt", t, "multi") + } + } + if r.vidLte != nil { + t := *r.vidLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__lte", t, "multi") + } + } + if r.vidN != nil { + t := *r.vidN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vid__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlansPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableVLANRequest *PatchedWritableVLANRequest +} + +func (r ApiIpamVlansPartialUpdateRequest) PatchedWritableVLANRequest(patchedWritableVLANRequest PatchedWritableVLANRequest) ApiIpamVlansPartialUpdateRequest { + r.patchedWritableVLANRequest = &patchedWritableVLANRequest + return r +} + +func (r ApiIpamVlansPartialUpdateRequest) Execute() (*VLAN, *http.Response, error) { + return r.ApiService.IpamVlansPartialUpdateExecute(r) +} + +/* +IpamVlansPartialUpdate Method for IpamVlansPartialUpdate + +Patch a VLAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN. + @return ApiIpamVlansPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamVlansPartialUpdate(ctx context.Context, id int32) ApiIpamVlansPartialUpdateRequest { + return ApiIpamVlansPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VLAN +func (a *IpamAPIService) IpamVlansPartialUpdateExecute(r ApiIpamVlansPartialUpdateRequest) (*VLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableVLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlansRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamVlansRetrieveRequest) Execute() (*VLAN, *http.Response, error) { + return r.ApiService.IpamVlansRetrieveExecute(r) +} + +/* +IpamVlansRetrieve Method for IpamVlansRetrieve + +Get a VLAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN. + @return ApiIpamVlansRetrieveRequest +*/ +func (a *IpamAPIService) IpamVlansRetrieve(ctx context.Context, id int32) ApiIpamVlansRetrieveRequest { + return ApiIpamVlansRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VLAN +func (a *IpamAPIService) IpamVlansRetrieveExecute(r ApiIpamVlansRetrieveRequest) (*VLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVlansUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableVLANRequest *WritableVLANRequest +} + +func (r ApiIpamVlansUpdateRequest) WritableVLANRequest(writableVLANRequest WritableVLANRequest) ApiIpamVlansUpdateRequest { + r.writableVLANRequest = &writableVLANRequest + return r +} + +func (r ApiIpamVlansUpdateRequest) Execute() (*VLAN, *http.Response, error) { + return r.ApiService.IpamVlansUpdateExecute(r) +} + +/* +IpamVlansUpdate Method for IpamVlansUpdate + +Put a VLAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VLAN. + @return ApiIpamVlansUpdateRequest +*/ +func (a *IpamAPIService) IpamVlansUpdate(ctx context.Context, id int32) ApiIpamVlansUpdateRequest { + return ApiIpamVlansUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VLAN +func (a *IpamAPIService) IpamVlansUpdateExecute(r ApiIpamVlansUpdateRequest) (*VLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVlansUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vlans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVLANRequest == nil { + return localVarReturnValue, nil, reportError("writableVLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVrfsBulkDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + vRFRequest *[]VRFRequest +} + +func (r ApiIpamVrfsBulkDestroyRequest) VRFRequest(vRFRequest []VRFRequest) ApiIpamVrfsBulkDestroyRequest { + r.vRFRequest = &vRFRequest + return r +} + +func (r ApiIpamVrfsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamVrfsBulkDestroyExecute(r) +} + +/* +IpamVrfsBulkDestroy Method for IpamVrfsBulkDestroy + +Delete a list of VRF objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVrfsBulkDestroyRequest +*/ +func (a *IpamAPIService) IpamVrfsBulkDestroy(ctx context.Context) ApiIpamVrfsBulkDestroyRequest { + return ApiIpamVrfsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamVrfsBulkDestroyExecute(r ApiIpamVrfsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vRFRequest == nil { + return nil, reportError("vRFRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vRFRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamVrfsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + vRFRequest *[]VRFRequest +} + +func (r ApiIpamVrfsBulkPartialUpdateRequest) VRFRequest(vRFRequest []VRFRequest) ApiIpamVrfsBulkPartialUpdateRequest { + r.vRFRequest = &vRFRequest + return r +} + +func (r ApiIpamVrfsBulkPartialUpdateRequest) Execute() ([]VRF, *http.Response, error) { + return r.ApiService.IpamVrfsBulkPartialUpdateExecute(r) +} + +/* +IpamVrfsBulkPartialUpdate Method for IpamVrfsBulkPartialUpdate + +Patch a list of VRF objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVrfsBulkPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamVrfsBulkPartialUpdate(ctx context.Context) ApiIpamVrfsBulkPartialUpdateRequest { + return ApiIpamVrfsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VRF +func (a *IpamAPIService) IpamVrfsBulkPartialUpdateExecute(r ApiIpamVrfsBulkPartialUpdateRequest) ([]VRF, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VRF + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vRFRequest == nil { + return localVarReturnValue, nil, reportError("vRFRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vRFRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVrfsBulkUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + vRFRequest *[]VRFRequest +} + +func (r ApiIpamVrfsBulkUpdateRequest) VRFRequest(vRFRequest []VRFRequest) ApiIpamVrfsBulkUpdateRequest { + r.vRFRequest = &vRFRequest + return r +} + +func (r ApiIpamVrfsBulkUpdateRequest) Execute() ([]VRF, *http.Response, error) { + return r.ApiService.IpamVrfsBulkUpdateExecute(r) +} + +/* +IpamVrfsBulkUpdate Method for IpamVrfsBulkUpdate + +Put a list of VRF objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVrfsBulkUpdateRequest +*/ +func (a *IpamAPIService) IpamVrfsBulkUpdate(ctx context.Context) ApiIpamVrfsBulkUpdateRequest { + return ApiIpamVrfsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VRF +func (a *IpamAPIService) IpamVrfsBulkUpdateExecute(r ApiIpamVrfsBulkUpdateRequest) ([]VRF, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VRF + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vRFRequest == nil { + return localVarReturnValue, nil, reportError("vRFRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vRFRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVrfsCreateRequest struct { + ctx context.Context + ApiService *IpamAPIService + writableVRFRequest *WritableVRFRequest +} + +func (r ApiIpamVrfsCreateRequest) WritableVRFRequest(writableVRFRequest WritableVRFRequest) ApiIpamVrfsCreateRequest { + r.writableVRFRequest = &writableVRFRequest + return r +} + +func (r ApiIpamVrfsCreateRequest) Execute() (*VRF, *http.Response, error) { + return r.ApiService.IpamVrfsCreateExecute(r) +} + +/* +IpamVrfsCreate Method for IpamVrfsCreate + +Post a list of VRF objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVrfsCreateRequest +*/ +func (a *IpamAPIService) IpamVrfsCreate(ctx context.Context) ApiIpamVrfsCreateRequest { + return ApiIpamVrfsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VRF +func (a *IpamAPIService) IpamVrfsCreateExecute(r ApiIpamVrfsCreateRequest) (*VRF, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VRF + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVRFRequest == nil { + return localVarReturnValue, nil, reportError("writableVRFRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVRFRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVrfsDestroyRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamVrfsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.IpamVrfsDestroyExecute(r) +} + +/* +IpamVrfsDestroy Method for IpamVrfsDestroy + +Delete a VRF object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VRF. + @return ApiIpamVrfsDestroyRequest +*/ +func (a *IpamAPIService) IpamVrfsDestroy(ctx context.Context, id int32) ApiIpamVrfsDestroyRequest { + return ApiIpamVrfsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IpamAPIService) IpamVrfsDestroyExecute(r ApiIpamVrfsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiIpamVrfsListRequest struct { + ctx context.Context + ApiService *IpamAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + enforceUnique *bool + exportTarget *[]string + exportTargetN *[]string + exportTargetId *[]int32 + exportTargetIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + importTarget *[]string + importTargetN *[]string + importTargetId *[]int32 + importTargetIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + rd *[]string + rdEmpty *bool + rdIc *[]string + rdIe *[]string + rdIew *[]string + rdIsw *[]string + rdN *[]string + rdNic *[]string + rdNie *[]string + rdNiew *[]string + rdNisw *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiIpamVrfsListRequest) Created(created []time.Time) ApiIpamVrfsListRequest { + r.created = &created + return r +} + +func (r ApiIpamVrfsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiIpamVrfsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiIpamVrfsListRequest) CreatedGt(createdGt []time.Time) ApiIpamVrfsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiIpamVrfsListRequest) CreatedGte(createdGte []time.Time) ApiIpamVrfsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiIpamVrfsListRequest) CreatedLt(createdLt []time.Time) ApiIpamVrfsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiIpamVrfsListRequest) CreatedLte(createdLte []time.Time) ApiIpamVrfsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiIpamVrfsListRequest) CreatedN(createdN []time.Time) ApiIpamVrfsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiIpamVrfsListRequest) CreatedByRequest(createdByRequest string) ApiIpamVrfsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiIpamVrfsListRequest) Description(description []string) ApiIpamVrfsListRequest { + r.description = &description + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiIpamVrfsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionIc(descriptionIc []string) ApiIpamVrfsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionIe(descriptionIe []string) ApiIpamVrfsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionIew(descriptionIew []string) ApiIpamVrfsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionIsw(descriptionIsw []string) ApiIpamVrfsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionN(descriptionN []string) ApiIpamVrfsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionNic(descriptionNic []string) ApiIpamVrfsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionNie(descriptionNie []string) ApiIpamVrfsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionNiew(descriptionNiew []string) ApiIpamVrfsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiIpamVrfsListRequest) DescriptionNisw(descriptionNisw []string) ApiIpamVrfsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiIpamVrfsListRequest) EnforceUnique(enforceUnique bool) ApiIpamVrfsListRequest { + r.enforceUnique = &enforceUnique + return r +} + +// Export target (name) +func (r ApiIpamVrfsListRequest) ExportTarget(exportTarget []string) ApiIpamVrfsListRequest { + r.exportTarget = &exportTarget + return r +} + +// Export target (name) +func (r ApiIpamVrfsListRequest) ExportTargetN(exportTargetN []string) ApiIpamVrfsListRequest { + r.exportTargetN = &exportTargetN + return r +} + +// Export target +func (r ApiIpamVrfsListRequest) ExportTargetId(exportTargetId []int32) ApiIpamVrfsListRequest { + r.exportTargetId = &exportTargetId + return r +} + +// Export target +func (r ApiIpamVrfsListRequest) ExportTargetIdN(exportTargetIdN []int32) ApiIpamVrfsListRequest { + r.exportTargetIdN = &exportTargetIdN + return r +} + +func (r ApiIpamVrfsListRequest) Id(id []int32) ApiIpamVrfsListRequest { + r.id = &id + return r +} + +func (r ApiIpamVrfsListRequest) IdEmpty(idEmpty bool) ApiIpamVrfsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiIpamVrfsListRequest) IdGt(idGt []int32) ApiIpamVrfsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiIpamVrfsListRequest) IdGte(idGte []int32) ApiIpamVrfsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiIpamVrfsListRequest) IdLt(idLt []int32) ApiIpamVrfsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiIpamVrfsListRequest) IdLte(idLte []int32) ApiIpamVrfsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiIpamVrfsListRequest) IdN(idN []int32) ApiIpamVrfsListRequest { + r.idN = &idN + return r +} + +// Import target (name) +func (r ApiIpamVrfsListRequest) ImportTarget(importTarget []string) ApiIpamVrfsListRequest { + r.importTarget = &importTarget + return r +} + +// Import target (name) +func (r ApiIpamVrfsListRequest) ImportTargetN(importTargetN []string) ApiIpamVrfsListRequest { + r.importTargetN = &importTargetN + return r +} + +// Import target +func (r ApiIpamVrfsListRequest) ImportTargetId(importTargetId []int32) ApiIpamVrfsListRequest { + r.importTargetId = &importTargetId + return r +} + +// Import target +func (r ApiIpamVrfsListRequest) ImportTargetIdN(importTargetIdN []int32) ApiIpamVrfsListRequest { + r.importTargetIdN = &importTargetIdN + return r +} + +func (r ApiIpamVrfsListRequest) LastUpdated(lastUpdated []time.Time) ApiIpamVrfsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiIpamVrfsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiIpamVrfsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiIpamVrfsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiIpamVrfsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiIpamVrfsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiIpamVrfsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiIpamVrfsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiIpamVrfsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiIpamVrfsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiIpamVrfsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiIpamVrfsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiIpamVrfsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiIpamVrfsListRequest) Limit(limit int32) ApiIpamVrfsListRequest { + r.limit = &limit + return r +} + +func (r ApiIpamVrfsListRequest) ModifiedByRequest(modifiedByRequest string) ApiIpamVrfsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiIpamVrfsListRequest) Name(name []string) ApiIpamVrfsListRequest { + r.name = &name + return r +} + +func (r ApiIpamVrfsListRequest) NameEmpty(nameEmpty bool) ApiIpamVrfsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiIpamVrfsListRequest) NameIc(nameIc []string) ApiIpamVrfsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiIpamVrfsListRequest) NameIe(nameIe []string) ApiIpamVrfsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiIpamVrfsListRequest) NameIew(nameIew []string) ApiIpamVrfsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiIpamVrfsListRequest) NameIsw(nameIsw []string) ApiIpamVrfsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiIpamVrfsListRequest) NameN(nameN []string) ApiIpamVrfsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiIpamVrfsListRequest) NameNic(nameNic []string) ApiIpamVrfsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiIpamVrfsListRequest) NameNie(nameNie []string) ApiIpamVrfsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiIpamVrfsListRequest) NameNiew(nameNiew []string) ApiIpamVrfsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiIpamVrfsListRequest) NameNisw(nameNisw []string) ApiIpamVrfsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiIpamVrfsListRequest) Offset(offset int32) ApiIpamVrfsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiIpamVrfsListRequest) Ordering(ordering string) ApiIpamVrfsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiIpamVrfsListRequest) Q(q string) ApiIpamVrfsListRequest { + r.q = &q + return r +} + +func (r ApiIpamVrfsListRequest) Rd(rd []string) ApiIpamVrfsListRequest { + r.rd = &rd + return r +} + +func (r ApiIpamVrfsListRequest) RdEmpty(rdEmpty bool) ApiIpamVrfsListRequest { + r.rdEmpty = &rdEmpty + return r +} + +func (r ApiIpamVrfsListRequest) RdIc(rdIc []string) ApiIpamVrfsListRequest { + r.rdIc = &rdIc + return r +} + +func (r ApiIpamVrfsListRequest) RdIe(rdIe []string) ApiIpamVrfsListRequest { + r.rdIe = &rdIe + return r +} + +func (r ApiIpamVrfsListRequest) RdIew(rdIew []string) ApiIpamVrfsListRequest { + r.rdIew = &rdIew + return r +} + +func (r ApiIpamVrfsListRequest) RdIsw(rdIsw []string) ApiIpamVrfsListRequest { + r.rdIsw = &rdIsw + return r +} + +func (r ApiIpamVrfsListRequest) RdN(rdN []string) ApiIpamVrfsListRequest { + r.rdN = &rdN + return r +} + +func (r ApiIpamVrfsListRequest) RdNic(rdNic []string) ApiIpamVrfsListRequest { + r.rdNic = &rdNic + return r +} + +func (r ApiIpamVrfsListRequest) RdNie(rdNie []string) ApiIpamVrfsListRequest { + r.rdNie = &rdNie + return r +} + +func (r ApiIpamVrfsListRequest) RdNiew(rdNiew []string) ApiIpamVrfsListRequest { + r.rdNiew = &rdNiew + return r +} + +func (r ApiIpamVrfsListRequest) RdNisw(rdNisw []string) ApiIpamVrfsListRequest { + r.rdNisw = &rdNisw + return r +} + +func (r ApiIpamVrfsListRequest) Tag(tag []string) ApiIpamVrfsListRequest { + r.tag = &tag + return r +} + +func (r ApiIpamVrfsListRequest) TagN(tagN []string) ApiIpamVrfsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiIpamVrfsListRequest) Tenant(tenant []string) ApiIpamVrfsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiIpamVrfsListRequest) TenantN(tenantN []string) ApiIpamVrfsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiIpamVrfsListRequest) TenantGroup(tenantGroup []int32) ApiIpamVrfsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiIpamVrfsListRequest) TenantGroupN(tenantGroupN []int32) ApiIpamVrfsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiIpamVrfsListRequest) TenantGroupId(tenantGroupId []int32) ApiIpamVrfsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiIpamVrfsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiIpamVrfsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiIpamVrfsListRequest) TenantId(tenantId []*int32) ApiIpamVrfsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiIpamVrfsListRequest) TenantIdN(tenantIdN []*int32) ApiIpamVrfsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiIpamVrfsListRequest) UpdatedByRequest(updatedByRequest string) ApiIpamVrfsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiIpamVrfsListRequest) Execute() (*PaginatedVRFList, *http.Response, error) { + return r.ApiService.IpamVrfsListExecute(r) +} + +/* +IpamVrfsList Method for IpamVrfsList + +Get a list of VRF objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiIpamVrfsListRequest +*/ +func (a *IpamAPIService) IpamVrfsList(ctx context.Context) ApiIpamVrfsListRequest { + return ApiIpamVrfsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVRFList +func (a *IpamAPIService) IpamVrfsListExecute(r ApiIpamVrfsListRequest) (*PaginatedVRFList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVRFList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.enforceUnique != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enforce_unique", r.enforceUnique, "") + } + if r.exportTarget != nil { + t := *r.exportTarget + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target", t, "multi") + } + } + if r.exportTargetN != nil { + t := *r.exportTargetN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target__n", t, "multi") + } + } + if r.exportTargetId != nil { + t := *r.exportTargetId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id", t, "multi") + } + } + if r.exportTargetIdN != nil { + t := *r.exportTargetIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.importTarget != nil { + t := *r.importTarget + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target", t, "multi") + } + } + if r.importTargetN != nil { + t := *r.importTargetN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target__n", t, "multi") + } + } + if r.importTargetId != nil { + t := *r.importTargetId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id", t, "multi") + } + } + if r.importTargetIdN != nil { + t := *r.importTargetIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.rd != nil { + t := *r.rd + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd", t, "multi") + } + } + if r.rdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__empty", r.rdEmpty, "") + } + if r.rdIc != nil { + t := *r.rdIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__ic", t, "multi") + } + } + if r.rdIe != nil { + t := *r.rdIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__ie", t, "multi") + } + } + if r.rdIew != nil { + t := *r.rdIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__iew", t, "multi") + } + } + if r.rdIsw != nil { + t := *r.rdIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__isw", t, "multi") + } + } + if r.rdN != nil { + t := *r.rdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__n", t, "multi") + } + } + if r.rdNic != nil { + t := *r.rdNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__nic", t, "multi") + } + } + if r.rdNie != nil { + t := *r.rdNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__nie", t, "multi") + } + } + if r.rdNiew != nil { + t := *r.rdNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__niew", t, "multi") + } + } + if r.rdNisw != nil { + t := *r.rdNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "rd__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVrfsPartialUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + patchedWritableVRFRequest *PatchedWritableVRFRequest +} + +func (r ApiIpamVrfsPartialUpdateRequest) PatchedWritableVRFRequest(patchedWritableVRFRequest PatchedWritableVRFRequest) ApiIpamVrfsPartialUpdateRequest { + r.patchedWritableVRFRequest = &patchedWritableVRFRequest + return r +} + +func (r ApiIpamVrfsPartialUpdateRequest) Execute() (*VRF, *http.Response, error) { + return r.ApiService.IpamVrfsPartialUpdateExecute(r) +} + +/* +IpamVrfsPartialUpdate Method for IpamVrfsPartialUpdate + +Patch a VRF object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VRF. + @return ApiIpamVrfsPartialUpdateRequest +*/ +func (a *IpamAPIService) IpamVrfsPartialUpdate(ctx context.Context, id int32) ApiIpamVrfsPartialUpdateRequest { + return ApiIpamVrfsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VRF +func (a *IpamAPIService) IpamVrfsPartialUpdateExecute(r ApiIpamVrfsPartialUpdateRequest) (*VRF, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VRF + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableVRFRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVrfsRetrieveRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 +} + +func (r ApiIpamVrfsRetrieveRequest) Execute() (*VRF, *http.Response, error) { + return r.ApiService.IpamVrfsRetrieveExecute(r) +} + +/* +IpamVrfsRetrieve Method for IpamVrfsRetrieve + +Get a VRF object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VRF. + @return ApiIpamVrfsRetrieveRequest +*/ +func (a *IpamAPIService) IpamVrfsRetrieve(ctx context.Context, id int32) ApiIpamVrfsRetrieveRequest { + return ApiIpamVrfsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VRF +func (a *IpamAPIService) IpamVrfsRetrieveExecute(r ApiIpamVrfsRetrieveRequest) (*VRF, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VRF + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiIpamVrfsUpdateRequest struct { + ctx context.Context + ApiService *IpamAPIService + id int32 + writableVRFRequest *WritableVRFRequest +} + +func (r ApiIpamVrfsUpdateRequest) WritableVRFRequest(writableVRFRequest WritableVRFRequest) ApiIpamVrfsUpdateRequest { + r.writableVRFRequest = &writableVRFRequest + return r +} + +func (r ApiIpamVrfsUpdateRequest) Execute() (*VRF, *http.Response, error) { + return r.ApiService.IpamVrfsUpdateExecute(r) +} + +/* +IpamVrfsUpdate Method for IpamVrfsUpdate + +Put a VRF object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this VRF. + @return ApiIpamVrfsUpdateRequest +*/ +func (a *IpamAPIService) IpamVrfsUpdate(ctx context.Context, id int32) ApiIpamVrfsUpdateRequest { + return ApiIpamVrfsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VRF +func (a *IpamAPIService) IpamVrfsUpdateExecute(r ApiIpamVrfsUpdateRequest) (*VRF, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VRF + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IpamAPIService.IpamVrfsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/ipam/vrfs/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVRFRequest == nil { + return localVarReturnValue, nil, reportError("writableVRFRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVRFRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_schema.go b/vendor/github.com/netbox-community/go-netbox/v3/api_schema.go new file mode 100644 index 00000000..1dca067c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_schema.go @@ -0,0 +1,148 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// SchemaAPIService SchemaAPI service +type SchemaAPIService service + +type ApiSchemaRetrieveRequest struct { + ctx context.Context + ApiService *SchemaAPIService + format *SchemaRetrieveFormatParameter +} + +func (r ApiSchemaRetrieveRequest) Format(format SchemaRetrieveFormatParameter) ApiSchemaRetrieveRequest { + r.format = &format + return r +} + +func (r ApiSchemaRetrieveRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.SchemaRetrieveExecute(r) +} + +/* +SchemaRetrieve Method for SchemaRetrieve + +OpenApi3 schema for this API. Format can be selected via content negotiation. + +- YAML: application/vnd.oai.openapi +- JSON: application/vnd.oai.openapi+json + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSchemaRetrieveRequest +*/ +func (a *SchemaAPIService) SchemaRetrieve(ctx context.Context) ApiSchemaRetrieveRequest { + return ApiSchemaRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *SchemaAPIService) SchemaRetrieveExecute(r ApiSchemaRetrieveRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchemaAPIService.SchemaRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/schema/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.oai.openapi", "application/yaml", "application/vnd.oai.openapi+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_status.go b/vendor/github.com/netbox-community/go-netbox/v3/api_status.go new file mode 100644 index 00000000..f08dfde3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_status.go @@ -0,0 +1,136 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// StatusAPIService StatusAPI service +type StatusAPIService service + +type ApiStatusRetrieveRequest struct { + ctx context.Context + ApiService *StatusAPIService +} + +func (r ApiStatusRetrieveRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.StatusRetrieveExecute(r) +} + +/* +StatusRetrieve Method for StatusRetrieve + +A lightweight read-only endpoint for conveying NetBox's current operational status. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStatusRetrieveRequest +*/ +func (a *StatusAPIService) StatusRetrieve(ctx context.Context) ApiStatusRetrieveRequest { + return ApiStatusRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *StatusAPIService) StatusRetrieveExecute(r ApiStatusRetrieveRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatusAPIService.StatusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/status/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_tenancy.go b/vendor/github.com/netbox-community/go-netbox/v3/api_tenancy.go new file mode 100644 index 00000000..34e4c4b4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_tenancy.go @@ -0,0 +1,13353 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// TenancyAPIService TenancyAPI service +type TenancyAPIService service + +type ApiTenancyContactAssignmentsBulkDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactAssignmentRequest *[]ContactAssignmentRequest +} + +func (r ApiTenancyContactAssignmentsBulkDestroyRequest) ContactAssignmentRequest(contactAssignmentRequest []ContactAssignmentRequest) ApiTenancyContactAssignmentsBulkDestroyRequest { + r.contactAssignmentRequest = &contactAssignmentRequest + return r +} + +func (r ApiTenancyContactAssignmentsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactAssignmentsBulkDestroyExecute(r) +} + +/* +TenancyContactAssignmentsBulkDestroy Method for TenancyContactAssignmentsBulkDestroy + +Delete a list of contact assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactAssignmentsBulkDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsBulkDestroy(ctx context.Context) ApiTenancyContactAssignmentsBulkDestroyRequest { + return ApiTenancyContactAssignmentsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactAssignmentsBulkDestroyExecute(r ApiTenancyContactAssignmentsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactAssignmentRequest == nil { + return nil, reportError("contactAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactAssignmentRequest *[]ContactAssignmentRequest +} + +func (r ApiTenancyContactAssignmentsBulkPartialUpdateRequest) ContactAssignmentRequest(contactAssignmentRequest []ContactAssignmentRequest) ApiTenancyContactAssignmentsBulkPartialUpdateRequest { + r.contactAssignmentRequest = &contactAssignmentRequest + return r +} + +func (r ApiTenancyContactAssignmentsBulkPartialUpdateRequest) Execute() ([]ContactAssignment, *http.Response, error) { + return r.ApiService.TenancyContactAssignmentsBulkPartialUpdateExecute(r) +} + +/* +TenancyContactAssignmentsBulkPartialUpdate Method for TenancyContactAssignmentsBulkPartialUpdate + +Patch a list of contact assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactAssignmentsBulkPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsBulkPartialUpdate(ctx context.Context) ApiTenancyContactAssignmentsBulkPartialUpdateRequest { + return ApiTenancyContactAssignmentsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ContactAssignment +func (a *TenancyAPIService) TenancyContactAssignmentsBulkPartialUpdateExecute(r ApiTenancyContactAssignmentsBulkPartialUpdateRequest) ([]ContactAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ContactAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("contactAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsBulkUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactAssignmentRequest *[]ContactAssignmentRequest +} + +func (r ApiTenancyContactAssignmentsBulkUpdateRequest) ContactAssignmentRequest(contactAssignmentRequest []ContactAssignmentRequest) ApiTenancyContactAssignmentsBulkUpdateRequest { + r.contactAssignmentRequest = &contactAssignmentRequest + return r +} + +func (r ApiTenancyContactAssignmentsBulkUpdateRequest) Execute() ([]ContactAssignment, *http.Response, error) { + return r.ApiService.TenancyContactAssignmentsBulkUpdateExecute(r) +} + +/* +TenancyContactAssignmentsBulkUpdate Method for TenancyContactAssignmentsBulkUpdate + +Put a list of contact assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactAssignmentsBulkUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsBulkUpdate(ctx context.Context) ApiTenancyContactAssignmentsBulkUpdateRequest { + return ApiTenancyContactAssignmentsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ContactAssignment +func (a *TenancyAPIService) TenancyContactAssignmentsBulkUpdateExecute(r ApiTenancyContactAssignmentsBulkUpdateRequest) ([]ContactAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ContactAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("contactAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsCreateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + writableContactAssignmentRequest *WritableContactAssignmentRequest +} + +func (r ApiTenancyContactAssignmentsCreateRequest) WritableContactAssignmentRequest(writableContactAssignmentRequest WritableContactAssignmentRequest) ApiTenancyContactAssignmentsCreateRequest { + r.writableContactAssignmentRequest = &writableContactAssignmentRequest + return r +} + +func (r ApiTenancyContactAssignmentsCreateRequest) Execute() (*ContactAssignment, *http.Response, error) { + return r.ApiService.TenancyContactAssignmentsCreateExecute(r) +} + +/* +TenancyContactAssignmentsCreate Method for TenancyContactAssignmentsCreate + +Post a list of contact assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactAssignmentsCreateRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsCreate(ctx context.Context) ApiTenancyContactAssignmentsCreateRequest { + return ApiTenancyContactAssignmentsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ContactAssignment +func (a *TenancyAPIService) TenancyContactAssignmentsCreateExecute(r ApiTenancyContactAssignmentsCreateRequest) (*ContactAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableContactAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("writableContactAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableContactAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactAssignmentsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactAssignmentsDestroyExecute(r) +} + +/* +TenancyContactAssignmentsDestroy Method for TenancyContactAssignmentsDestroy + +Delete a contact assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact assignment. + @return ApiTenancyContactAssignmentsDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsDestroy(ctx context.Context, id int32) ApiTenancyContactAssignmentsDestroyRequest { + return ApiTenancyContactAssignmentsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactAssignmentsDestroyExecute(r ApiTenancyContactAssignmentsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsListRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactId *[]int32 + contactIdN *[]int32 + contentType *string + contentTypeN *string + contentTypeId *int32 + contentTypeIdN *int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + group *[]int32 + groupN *[]int32 + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + objectId *[]int32 + objectIdEmpty *bool + objectIdGt *[]int32 + objectIdGte *[]int32 + objectIdLt *[]int32 + objectIdLte *[]int32 + objectIdN *[]int32 + offset *int32 + ordering *string + priority *string + priorityN *string + q *string + role *[]string + roleN *[]string + roleId *[]int32 + roleIdN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Contact (ID) +func (r ApiTenancyContactAssignmentsListRequest) ContactId(contactId []int32) ApiTenancyContactAssignmentsListRequest { + r.contactId = &contactId + return r +} + +// Contact (ID) +func (r ApiTenancyContactAssignmentsListRequest) ContactIdN(contactIdN []int32) ApiTenancyContactAssignmentsListRequest { + r.contactIdN = &contactIdN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ContentType(contentType string) ApiTenancyContactAssignmentsListRequest { + r.contentType = &contentType + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ContentTypeN(contentTypeN string) ApiTenancyContactAssignmentsListRequest { + r.contentTypeN = &contentTypeN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ContentTypeId(contentTypeId int32) ApiTenancyContactAssignmentsListRequest { + r.contentTypeId = &contentTypeId + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ContentTypeIdN(contentTypeIdN int32) ApiTenancyContactAssignmentsListRequest { + r.contentTypeIdN = &contentTypeIdN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) Created(created []time.Time) ApiTenancyContactAssignmentsListRequest { + r.created = &created + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiTenancyContactAssignmentsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) CreatedGt(createdGt []time.Time) ApiTenancyContactAssignmentsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) CreatedGte(createdGte []time.Time) ApiTenancyContactAssignmentsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) CreatedLt(createdLt []time.Time) ApiTenancyContactAssignmentsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) CreatedLte(createdLte []time.Time) ApiTenancyContactAssignmentsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) CreatedN(createdN []time.Time) ApiTenancyContactAssignmentsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) CreatedByRequest(createdByRequest string) ApiTenancyContactAssignmentsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +// Contact group (slug) +func (r ApiTenancyContactAssignmentsListRequest) Group(group []int32) ApiTenancyContactAssignmentsListRequest { + r.group = &group + return r +} + +// Contact group (slug) +func (r ApiTenancyContactAssignmentsListRequest) GroupN(groupN []int32) ApiTenancyContactAssignmentsListRequest { + r.groupN = &groupN + return r +} + +// Contact group (ID) +func (r ApiTenancyContactAssignmentsListRequest) GroupId(groupId []int32) ApiTenancyContactAssignmentsListRequest { + r.groupId = &groupId + return r +} + +// Contact group (ID) +func (r ApiTenancyContactAssignmentsListRequest) GroupIdN(groupIdN []int32) ApiTenancyContactAssignmentsListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) Id(id []int32) ApiTenancyContactAssignmentsListRequest { + r.id = &id + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) IdEmpty(idEmpty bool) ApiTenancyContactAssignmentsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) IdGt(idGt []int32) ApiTenancyContactAssignmentsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) IdGte(idGte []int32) ApiTenancyContactAssignmentsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) IdLt(idLt []int32) ApiTenancyContactAssignmentsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) IdLte(idLte []int32) ApiTenancyContactAssignmentsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) IdN(idN []int32) ApiTenancyContactAssignmentsListRequest { + r.idN = &idN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) LastUpdated(lastUpdated []time.Time) ApiTenancyContactAssignmentsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiTenancyContactAssignmentsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiTenancyContactAssignmentsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiTenancyContactAssignmentsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiTenancyContactAssignmentsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiTenancyContactAssignmentsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiTenancyContactAssignmentsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiTenancyContactAssignmentsListRequest) Limit(limit int32) ApiTenancyContactAssignmentsListRequest { + r.limit = &limit + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ModifiedByRequest(modifiedByRequest string) ApiTenancyContactAssignmentsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ObjectId(objectId []int32) ApiTenancyContactAssignmentsListRequest { + r.objectId = &objectId + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ObjectIdEmpty(objectIdEmpty bool) ApiTenancyContactAssignmentsListRequest { + r.objectIdEmpty = &objectIdEmpty + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ObjectIdGt(objectIdGt []int32) ApiTenancyContactAssignmentsListRequest { + r.objectIdGt = &objectIdGt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ObjectIdGte(objectIdGte []int32) ApiTenancyContactAssignmentsListRequest { + r.objectIdGte = &objectIdGte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ObjectIdLt(objectIdLt []int32) ApiTenancyContactAssignmentsListRequest { + r.objectIdLt = &objectIdLt + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ObjectIdLte(objectIdLte []int32) ApiTenancyContactAssignmentsListRequest { + r.objectIdLte = &objectIdLte + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) ObjectIdN(objectIdN []int32) ApiTenancyContactAssignmentsListRequest { + r.objectIdN = &objectIdN + return r +} + +// The initial index from which to return the results. +func (r ApiTenancyContactAssignmentsListRequest) Offset(offset int32) ApiTenancyContactAssignmentsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiTenancyContactAssignmentsListRequest) Ordering(ordering string) ApiTenancyContactAssignmentsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) Priority(priority string) ApiTenancyContactAssignmentsListRequest { + r.priority = &priority + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) PriorityN(priorityN string) ApiTenancyContactAssignmentsListRequest { + r.priorityN = &priorityN + return r +} + +// Search +func (r ApiTenancyContactAssignmentsListRequest) Q(q string) ApiTenancyContactAssignmentsListRequest { + r.q = &q + return r +} + +// Contact role (slug) +func (r ApiTenancyContactAssignmentsListRequest) Role(role []string) ApiTenancyContactAssignmentsListRequest { + r.role = &role + return r +} + +// Contact role (slug) +func (r ApiTenancyContactAssignmentsListRequest) RoleN(roleN []string) ApiTenancyContactAssignmentsListRequest { + r.roleN = &roleN + return r +} + +// Contact role (ID) +func (r ApiTenancyContactAssignmentsListRequest) RoleId(roleId []int32) ApiTenancyContactAssignmentsListRequest { + r.roleId = &roleId + return r +} + +// Contact role (ID) +func (r ApiTenancyContactAssignmentsListRequest) RoleIdN(roleIdN []int32) ApiTenancyContactAssignmentsListRequest { + r.roleIdN = &roleIdN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) Tag(tag []string) ApiTenancyContactAssignmentsListRequest { + r.tag = &tag + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) TagN(tagN []string) ApiTenancyContactAssignmentsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) UpdatedByRequest(updatedByRequest string) ApiTenancyContactAssignmentsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiTenancyContactAssignmentsListRequest) Execute() (*PaginatedContactAssignmentList, *http.Response, error) { + return r.ApiService.TenancyContactAssignmentsListExecute(r) +} + +/* +TenancyContactAssignmentsList Method for TenancyContactAssignmentsList + +Get a list of contact assignment objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactAssignmentsListRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsList(ctx context.Context) ApiTenancyContactAssignmentsListRequest { + return ApiTenancyContactAssignmentsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedContactAssignmentList +func (a *TenancyAPIService) TenancyContactAssignmentsListExecute(r ApiTenancyContactAssignmentsListRequest) (*PaginatedContactAssignmentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedContactAssignmentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contactId != nil { + t := *r.contactId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_id", t, "multi") + } + } + if r.contactIdN != nil { + t := *r.contactIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_id__n", t, "multi") + } + } + if r.contentType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type", r.contentType, "") + } + if r.contentTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type__n", r.contentTypeN, "") + } + if r.contentTypeId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id", r.contentTypeId, "") + } + if r.contentTypeIdN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type_id__n", r.contentTypeIdN, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.objectId != nil { + t := *r.objectId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id", t, "multi") + } + } + if r.objectIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__empty", r.objectIdEmpty, "") + } + if r.objectIdGt != nil { + t := *r.objectIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gt", t, "multi") + } + } + if r.objectIdGte != nil { + t := *r.objectIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__gte", t, "multi") + } + } + if r.objectIdLt != nil { + t := *r.objectIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lt", t, "multi") + } + } + if r.objectIdLte != nil { + t := *r.objectIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__lte", t, "multi") + } + } + if r.objectIdN != nil { + t := *r.objectIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_id__n", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.priority != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority", r.priority, "") + } + if r.priorityN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "priority__n", r.priorityN, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + patchedWritableContactAssignmentRequest *PatchedWritableContactAssignmentRequest +} + +func (r ApiTenancyContactAssignmentsPartialUpdateRequest) PatchedWritableContactAssignmentRequest(patchedWritableContactAssignmentRequest PatchedWritableContactAssignmentRequest) ApiTenancyContactAssignmentsPartialUpdateRequest { + r.patchedWritableContactAssignmentRequest = &patchedWritableContactAssignmentRequest + return r +} + +func (r ApiTenancyContactAssignmentsPartialUpdateRequest) Execute() (*ContactAssignment, *http.Response, error) { + return r.ApiService.TenancyContactAssignmentsPartialUpdateExecute(r) +} + +/* +TenancyContactAssignmentsPartialUpdate Method for TenancyContactAssignmentsPartialUpdate + +Patch a contact assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact assignment. + @return ApiTenancyContactAssignmentsPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsPartialUpdate(ctx context.Context, id int32) ApiTenancyContactAssignmentsPartialUpdateRequest { + return ApiTenancyContactAssignmentsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactAssignment +func (a *TenancyAPIService) TenancyContactAssignmentsPartialUpdateExecute(r ApiTenancyContactAssignmentsPartialUpdateRequest) (*ContactAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableContactAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsRetrieveRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactAssignmentsRetrieveRequest) Execute() (*ContactAssignment, *http.Response, error) { + return r.ApiService.TenancyContactAssignmentsRetrieveExecute(r) +} + +/* +TenancyContactAssignmentsRetrieve Method for TenancyContactAssignmentsRetrieve + +Get a contact assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact assignment. + @return ApiTenancyContactAssignmentsRetrieveRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsRetrieve(ctx context.Context, id int32) ApiTenancyContactAssignmentsRetrieveRequest { + return ApiTenancyContactAssignmentsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactAssignment +func (a *TenancyAPIService) TenancyContactAssignmentsRetrieveExecute(r ApiTenancyContactAssignmentsRetrieveRequest) (*ContactAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactAssignmentsUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + writableContactAssignmentRequest *WritableContactAssignmentRequest +} + +func (r ApiTenancyContactAssignmentsUpdateRequest) WritableContactAssignmentRequest(writableContactAssignmentRequest WritableContactAssignmentRequest) ApiTenancyContactAssignmentsUpdateRequest { + r.writableContactAssignmentRequest = &writableContactAssignmentRequest + return r +} + +func (r ApiTenancyContactAssignmentsUpdateRequest) Execute() (*ContactAssignment, *http.Response, error) { + return r.ApiService.TenancyContactAssignmentsUpdateExecute(r) +} + +/* +TenancyContactAssignmentsUpdate Method for TenancyContactAssignmentsUpdate + +Put a contact assignment object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact assignment. + @return ApiTenancyContactAssignmentsUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactAssignmentsUpdate(ctx context.Context, id int32) ApiTenancyContactAssignmentsUpdateRequest { + return ApiTenancyContactAssignmentsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactAssignment +func (a *TenancyAPIService) TenancyContactAssignmentsUpdateExecute(r ApiTenancyContactAssignmentsUpdateRequest) (*ContactAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactAssignmentsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-assignments/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableContactAssignmentRequest == nil { + return localVarReturnValue, nil, reportError("writableContactAssignmentRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableContactAssignmentRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactGroupRequest *[]ContactGroupRequest +} + +func (r ApiTenancyContactGroupsBulkDestroyRequest) ContactGroupRequest(contactGroupRequest []ContactGroupRequest) ApiTenancyContactGroupsBulkDestroyRequest { + r.contactGroupRequest = &contactGroupRequest + return r +} + +func (r ApiTenancyContactGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactGroupsBulkDestroyExecute(r) +} + +/* +TenancyContactGroupsBulkDestroy Method for TenancyContactGroupsBulkDestroy + +Delete a list of contact group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactGroupsBulkDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsBulkDestroy(ctx context.Context) ApiTenancyContactGroupsBulkDestroyRequest { + return ApiTenancyContactGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactGroupsBulkDestroyExecute(r ApiTenancyContactGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactGroupRequest == nil { + return nil, reportError("contactGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactGroupRequest *[]ContactGroupRequest +} + +func (r ApiTenancyContactGroupsBulkPartialUpdateRequest) ContactGroupRequest(contactGroupRequest []ContactGroupRequest) ApiTenancyContactGroupsBulkPartialUpdateRequest { + r.contactGroupRequest = &contactGroupRequest + return r +} + +func (r ApiTenancyContactGroupsBulkPartialUpdateRequest) Execute() ([]ContactGroup, *http.Response, error) { + return r.ApiService.TenancyContactGroupsBulkPartialUpdateExecute(r) +} + +/* +TenancyContactGroupsBulkPartialUpdate Method for TenancyContactGroupsBulkPartialUpdate + +Patch a list of contact group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactGroupsBulkPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsBulkPartialUpdate(ctx context.Context) ApiTenancyContactGroupsBulkPartialUpdateRequest { + return ApiTenancyContactGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ContactGroup +func (a *TenancyAPIService) TenancyContactGroupsBulkPartialUpdateExecute(r ApiTenancyContactGroupsBulkPartialUpdateRequest) ([]ContactGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ContactGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactGroupRequest == nil { + return localVarReturnValue, nil, reportError("contactGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactGroupRequest *[]ContactGroupRequest +} + +func (r ApiTenancyContactGroupsBulkUpdateRequest) ContactGroupRequest(contactGroupRequest []ContactGroupRequest) ApiTenancyContactGroupsBulkUpdateRequest { + r.contactGroupRequest = &contactGroupRequest + return r +} + +func (r ApiTenancyContactGroupsBulkUpdateRequest) Execute() ([]ContactGroup, *http.Response, error) { + return r.ApiService.TenancyContactGroupsBulkUpdateExecute(r) +} + +/* +TenancyContactGroupsBulkUpdate Method for TenancyContactGroupsBulkUpdate + +Put a list of contact group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactGroupsBulkUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsBulkUpdate(ctx context.Context) ApiTenancyContactGroupsBulkUpdateRequest { + return ApiTenancyContactGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ContactGroup +func (a *TenancyAPIService) TenancyContactGroupsBulkUpdateExecute(r ApiTenancyContactGroupsBulkUpdateRequest) ([]ContactGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ContactGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactGroupRequest == nil { + return localVarReturnValue, nil, reportError("contactGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsCreateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + writableContactGroupRequest *WritableContactGroupRequest +} + +func (r ApiTenancyContactGroupsCreateRequest) WritableContactGroupRequest(writableContactGroupRequest WritableContactGroupRequest) ApiTenancyContactGroupsCreateRequest { + r.writableContactGroupRequest = &writableContactGroupRequest + return r +} + +func (r ApiTenancyContactGroupsCreateRequest) Execute() (*ContactGroup, *http.Response, error) { + return r.ApiService.TenancyContactGroupsCreateExecute(r) +} + +/* +TenancyContactGroupsCreate Method for TenancyContactGroupsCreate + +Post a list of contact group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactGroupsCreateRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsCreate(ctx context.Context) ApiTenancyContactGroupsCreateRequest { + return ApiTenancyContactGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ContactGroup +func (a *TenancyAPIService) TenancyContactGroupsCreateExecute(r ApiTenancyContactGroupsCreateRequest) (*ContactGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableContactGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableContactGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableContactGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactGroupsDestroyExecute(r) +} + +/* +TenancyContactGroupsDestroy Method for TenancyContactGroupsDestroy + +Delete a contact group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact group. + @return ApiTenancyContactGroupsDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsDestroy(ctx context.Context, id int32) ApiTenancyContactGroupsDestroyRequest { + return ApiTenancyContactGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactGroupsDestroyExecute(r ApiTenancyContactGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsListRequest struct { + ctx context.Context + ApiService *TenancyAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parent *[]string + parentN *[]string + parentId *[]*int32 + parentIdN *[]*int32 + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiTenancyContactGroupsListRequest) Created(created []time.Time) ApiTenancyContactGroupsListRequest { + r.created = &created + return r +} + +func (r ApiTenancyContactGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiTenancyContactGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiTenancyContactGroupsListRequest) CreatedGt(createdGt []time.Time) ApiTenancyContactGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiTenancyContactGroupsListRequest) CreatedGte(createdGte []time.Time) ApiTenancyContactGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiTenancyContactGroupsListRequest) CreatedLt(createdLt []time.Time) ApiTenancyContactGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiTenancyContactGroupsListRequest) CreatedLte(createdLte []time.Time) ApiTenancyContactGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiTenancyContactGroupsListRequest) CreatedN(createdN []time.Time) ApiTenancyContactGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiTenancyContactGroupsListRequest) CreatedByRequest(createdByRequest string) ApiTenancyContactGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiTenancyContactGroupsListRequest) Description(description []string) ApiTenancyContactGroupsListRequest { + r.description = &description + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiTenancyContactGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionIc(descriptionIc []string) ApiTenancyContactGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionIe(descriptionIe []string) ApiTenancyContactGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionIew(descriptionIew []string) ApiTenancyContactGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiTenancyContactGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionN(descriptionN []string) ApiTenancyContactGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionNic(descriptionNic []string) ApiTenancyContactGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionNie(descriptionNie []string) ApiTenancyContactGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiTenancyContactGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiTenancyContactGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiTenancyContactGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiTenancyContactGroupsListRequest) Id(id []int32) ApiTenancyContactGroupsListRequest { + r.id = &id + return r +} + +func (r ApiTenancyContactGroupsListRequest) IdEmpty(idEmpty bool) ApiTenancyContactGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiTenancyContactGroupsListRequest) IdGt(idGt []int32) ApiTenancyContactGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiTenancyContactGroupsListRequest) IdGte(idGte []int32) ApiTenancyContactGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiTenancyContactGroupsListRequest) IdLt(idLt []int32) ApiTenancyContactGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiTenancyContactGroupsListRequest) IdLte(idLte []int32) ApiTenancyContactGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiTenancyContactGroupsListRequest) IdN(idN []int32) ApiTenancyContactGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiTenancyContactGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiTenancyContactGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiTenancyContactGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiTenancyContactGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiTenancyContactGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiTenancyContactGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiTenancyContactGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiTenancyContactGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiTenancyContactGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiTenancyContactGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiTenancyContactGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiTenancyContactGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiTenancyContactGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiTenancyContactGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiTenancyContactGroupsListRequest) Limit(limit int32) ApiTenancyContactGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiTenancyContactGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiTenancyContactGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiTenancyContactGroupsListRequest) Name(name []string) ApiTenancyContactGroupsListRequest { + r.name = &name + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameEmpty(nameEmpty bool) ApiTenancyContactGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameIc(nameIc []string) ApiTenancyContactGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameIe(nameIe []string) ApiTenancyContactGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameIew(nameIew []string) ApiTenancyContactGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameIsw(nameIsw []string) ApiTenancyContactGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameN(nameN []string) ApiTenancyContactGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameNic(nameNic []string) ApiTenancyContactGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameNie(nameNie []string) ApiTenancyContactGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameNiew(nameNiew []string) ApiTenancyContactGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiTenancyContactGroupsListRequest) NameNisw(nameNisw []string) ApiTenancyContactGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiTenancyContactGroupsListRequest) Offset(offset int32) ApiTenancyContactGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiTenancyContactGroupsListRequest) Ordering(ordering string) ApiTenancyContactGroupsListRequest { + r.ordering = &ordering + return r +} + +// Contact group (slug) +func (r ApiTenancyContactGroupsListRequest) Parent(parent []string) ApiTenancyContactGroupsListRequest { + r.parent = &parent + return r +} + +// Contact group (slug) +func (r ApiTenancyContactGroupsListRequest) ParentN(parentN []string) ApiTenancyContactGroupsListRequest { + r.parentN = &parentN + return r +} + +// Contact group (ID) +func (r ApiTenancyContactGroupsListRequest) ParentId(parentId []*int32) ApiTenancyContactGroupsListRequest { + r.parentId = &parentId + return r +} + +// Contact group (ID) +func (r ApiTenancyContactGroupsListRequest) ParentIdN(parentIdN []*int32) ApiTenancyContactGroupsListRequest { + r.parentIdN = &parentIdN + return r +} + +// Search +func (r ApiTenancyContactGroupsListRequest) Q(q string) ApiTenancyContactGroupsListRequest { + r.q = &q + return r +} + +func (r ApiTenancyContactGroupsListRequest) Slug(slug []string) ApiTenancyContactGroupsListRequest { + r.slug = &slug + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugEmpty(slugEmpty bool) ApiTenancyContactGroupsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugIc(slugIc []string) ApiTenancyContactGroupsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugIe(slugIe []string) ApiTenancyContactGroupsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugIew(slugIew []string) ApiTenancyContactGroupsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugIsw(slugIsw []string) ApiTenancyContactGroupsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugN(slugN []string) ApiTenancyContactGroupsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugNic(slugNic []string) ApiTenancyContactGroupsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugNie(slugNie []string) ApiTenancyContactGroupsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugNiew(slugNiew []string) ApiTenancyContactGroupsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiTenancyContactGroupsListRequest) SlugNisw(slugNisw []string) ApiTenancyContactGroupsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiTenancyContactGroupsListRequest) Tag(tag []string) ApiTenancyContactGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiTenancyContactGroupsListRequest) TagN(tagN []string) ApiTenancyContactGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiTenancyContactGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiTenancyContactGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiTenancyContactGroupsListRequest) Execute() (*PaginatedContactGroupList, *http.Response, error) { + return r.ApiService.TenancyContactGroupsListExecute(r) +} + +/* +TenancyContactGroupsList Method for TenancyContactGroupsList + +Get a list of contact group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactGroupsListRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsList(ctx context.Context) ApiTenancyContactGroupsListRequest { + return ApiTenancyContactGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedContactGroupList +func (a *TenancyAPIService) TenancyContactGroupsListExecute(r ApiTenancyContactGroupsListRequest) (*PaginatedContactGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedContactGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.parentN != nil { + t := *r.parentN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", t, "multi") + } + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + patchedWritableContactGroupRequest *PatchedWritableContactGroupRequest +} + +func (r ApiTenancyContactGroupsPartialUpdateRequest) PatchedWritableContactGroupRequest(patchedWritableContactGroupRequest PatchedWritableContactGroupRequest) ApiTenancyContactGroupsPartialUpdateRequest { + r.patchedWritableContactGroupRequest = &patchedWritableContactGroupRequest + return r +} + +func (r ApiTenancyContactGroupsPartialUpdateRequest) Execute() (*ContactGroup, *http.Response, error) { + return r.ApiService.TenancyContactGroupsPartialUpdateExecute(r) +} + +/* +TenancyContactGroupsPartialUpdate Method for TenancyContactGroupsPartialUpdate + +Patch a contact group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact group. + @return ApiTenancyContactGroupsPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsPartialUpdate(ctx context.Context, id int32) ApiTenancyContactGroupsPartialUpdateRequest { + return ApiTenancyContactGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactGroup +func (a *TenancyAPIService) TenancyContactGroupsPartialUpdateExecute(r ApiTenancyContactGroupsPartialUpdateRequest) (*ContactGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableContactGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsRetrieveRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactGroupsRetrieveRequest) Execute() (*ContactGroup, *http.Response, error) { + return r.ApiService.TenancyContactGroupsRetrieveExecute(r) +} + +/* +TenancyContactGroupsRetrieve Method for TenancyContactGroupsRetrieve + +Get a contact group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact group. + @return ApiTenancyContactGroupsRetrieveRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsRetrieve(ctx context.Context, id int32) ApiTenancyContactGroupsRetrieveRequest { + return ApiTenancyContactGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactGroup +func (a *TenancyAPIService) TenancyContactGroupsRetrieveExecute(r ApiTenancyContactGroupsRetrieveRequest) (*ContactGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactGroupsUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + writableContactGroupRequest *WritableContactGroupRequest +} + +func (r ApiTenancyContactGroupsUpdateRequest) WritableContactGroupRequest(writableContactGroupRequest WritableContactGroupRequest) ApiTenancyContactGroupsUpdateRequest { + r.writableContactGroupRequest = &writableContactGroupRequest + return r +} + +func (r ApiTenancyContactGroupsUpdateRequest) Execute() (*ContactGroup, *http.Response, error) { + return r.ApiService.TenancyContactGroupsUpdateExecute(r) +} + +/* +TenancyContactGroupsUpdate Method for TenancyContactGroupsUpdate + +Put a contact group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact group. + @return ApiTenancyContactGroupsUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactGroupsUpdate(ctx context.Context, id int32) ApiTenancyContactGroupsUpdateRequest { + return ApiTenancyContactGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactGroup +func (a *TenancyAPIService) TenancyContactGroupsUpdateExecute(r ApiTenancyContactGroupsUpdateRequest) (*ContactGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableContactGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableContactGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableContactGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesBulkDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactRoleRequest *[]ContactRoleRequest +} + +func (r ApiTenancyContactRolesBulkDestroyRequest) ContactRoleRequest(contactRoleRequest []ContactRoleRequest) ApiTenancyContactRolesBulkDestroyRequest { + r.contactRoleRequest = &contactRoleRequest + return r +} + +func (r ApiTenancyContactRolesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactRolesBulkDestroyExecute(r) +} + +/* +TenancyContactRolesBulkDestroy Method for TenancyContactRolesBulkDestroy + +Delete a list of contact role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactRolesBulkDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesBulkDestroy(ctx context.Context) ApiTenancyContactRolesBulkDestroyRequest { + return ApiTenancyContactRolesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactRolesBulkDestroyExecute(r ApiTenancyContactRolesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRoleRequest == nil { + return nil, reportError("contactRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactRoleRequest *[]ContactRoleRequest +} + +func (r ApiTenancyContactRolesBulkPartialUpdateRequest) ContactRoleRequest(contactRoleRequest []ContactRoleRequest) ApiTenancyContactRolesBulkPartialUpdateRequest { + r.contactRoleRequest = &contactRoleRequest + return r +} + +func (r ApiTenancyContactRolesBulkPartialUpdateRequest) Execute() ([]ContactRole, *http.Response, error) { + return r.ApiService.TenancyContactRolesBulkPartialUpdateExecute(r) +} + +/* +TenancyContactRolesBulkPartialUpdate Method for TenancyContactRolesBulkPartialUpdate + +Patch a list of contact role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactRolesBulkPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesBulkPartialUpdate(ctx context.Context) ApiTenancyContactRolesBulkPartialUpdateRequest { + return ApiTenancyContactRolesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ContactRole +func (a *TenancyAPIService) TenancyContactRolesBulkPartialUpdateExecute(r ApiTenancyContactRolesBulkPartialUpdateRequest) ([]ContactRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ContactRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRoleRequest == nil { + return localVarReturnValue, nil, reportError("contactRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesBulkUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactRoleRequest *[]ContactRoleRequest +} + +func (r ApiTenancyContactRolesBulkUpdateRequest) ContactRoleRequest(contactRoleRequest []ContactRoleRequest) ApiTenancyContactRolesBulkUpdateRequest { + r.contactRoleRequest = &contactRoleRequest + return r +} + +func (r ApiTenancyContactRolesBulkUpdateRequest) Execute() ([]ContactRole, *http.Response, error) { + return r.ApiService.TenancyContactRolesBulkUpdateExecute(r) +} + +/* +TenancyContactRolesBulkUpdate Method for TenancyContactRolesBulkUpdate + +Put a list of contact role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactRolesBulkUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesBulkUpdate(ctx context.Context) ApiTenancyContactRolesBulkUpdateRequest { + return ApiTenancyContactRolesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ContactRole +func (a *TenancyAPIService) TenancyContactRolesBulkUpdateExecute(r ApiTenancyContactRolesBulkUpdateRequest) ([]ContactRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ContactRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRoleRequest == nil { + return localVarReturnValue, nil, reportError("contactRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesCreateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactRoleRequest *ContactRoleRequest +} + +func (r ApiTenancyContactRolesCreateRequest) ContactRoleRequest(contactRoleRequest ContactRoleRequest) ApiTenancyContactRolesCreateRequest { + r.contactRoleRequest = &contactRoleRequest + return r +} + +func (r ApiTenancyContactRolesCreateRequest) Execute() (*ContactRole, *http.Response, error) { + return r.ApiService.TenancyContactRolesCreateExecute(r) +} + +/* +TenancyContactRolesCreate Method for TenancyContactRolesCreate + +Post a list of contact role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactRolesCreateRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesCreate(ctx context.Context) ApiTenancyContactRolesCreateRequest { + return ApiTenancyContactRolesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ContactRole +func (a *TenancyAPIService) TenancyContactRolesCreateExecute(r ApiTenancyContactRolesCreateRequest) (*ContactRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRoleRequest == nil { + return localVarReturnValue, nil, reportError("contactRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactRolesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactRolesDestroyExecute(r) +} + +/* +TenancyContactRolesDestroy Method for TenancyContactRolesDestroy + +Delete a contact role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact role. + @return ApiTenancyContactRolesDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesDestroy(ctx context.Context, id int32) ApiTenancyContactRolesDestroyRequest { + return ApiTenancyContactRolesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactRolesDestroyExecute(r ApiTenancyContactRolesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesListRequest struct { + ctx context.Context + ApiService *TenancyAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiTenancyContactRolesListRequest) Created(created []time.Time) ApiTenancyContactRolesListRequest { + r.created = &created + return r +} + +func (r ApiTenancyContactRolesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiTenancyContactRolesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiTenancyContactRolesListRequest) CreatedGt(createdGt []time.Time) ApiTenancyContactRolesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiTenancyContactRolesListRequest) CreatedGte(createdGte []time.Time) ApiTenancyContactRolesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiTenancyContactRolesListRequest) CreatedLt(createdLt []time.Time) ApiTenancyContactRolesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiTenancyContactRolesListRequest) CreatedLte(createdLte []time.Time) ApiTenancyContactRolesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiTenancyContactRolesListRequest) CreatedN(createdN []time.Time) ApiTenancyContactRolesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiTenancyContactRolesListRequest) CreatedByRequest(createdByRequest string) ApiTenancyContactRolesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiTenancyContactRolesListRequest) Description(description []string) ApiTenancyContactRolesListRequest { + r.description = &description + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiTenancyContactRolesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionIc(descriptionIc []string) ApiTenancyContactRolesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionIe(descriptionIe []string) ApiTenancyContactRolesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionIew(descriptionIew []string) ApiTenancyContactRolesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionIsw(descriptionIsw []string) ApiTenancyContactRolesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionN(descriptionN []string) ApiTenancyContactRolesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionNic(descriptionNic []string) ApiTenancyContactRolesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionNie(descriptionNie []string) ApiTenancyContactRolesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionNiew(descriptionNiew []string) ApiTenancyContactRolesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiTenancyContactRolesListRequest) DescriptionNisw(descriptionNisw []string) ApiTenancyContactRolesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiTenancyContactRolesListRequest) Id(id []int32) ApiTenancyContactRolesListRequest { + r.id = &id + return r +} + +func (r ApiTenancyContactRolesListRequest) IdEmpty(idEmpty bool) ApiTenancyContactRolesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiTenancyContactRolesListRequest) IdGt(idGt []int32) ApiTenancyContactRolesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiTenancyContactRolesListRequest) IdGte(idGte []int32) ApiTenancyContactRolesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiTenancyContactRolesListRequest) IdLt(idLt []int32) ApiTenancyContactRolesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiTenancyContactRolesListRequest) IdLte(idLte []int32) ApiTenancyContactRolesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiTenancyContactRolesListRequest) IdN(idN []int32) ApiTenancyContactRolesListRequest { + r.idN = &idN + return r +} + +func (r ApiTenancyContactRolesListRequest) LastUpdated(lastUpdated []time.Time) ApiTenancyContactRolesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiTenancyContactRolesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiTenancyContactRolesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiTenancyContactRolesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiTenancyContactRolesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiTenancyContactRolesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiTenancyContactRolesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiTenancyContactRolesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiTenancyContactRolesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiTenancyContactRolesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiTenancyContactRolesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiTenancyContactRolesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiTenancyContactRolesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiTenancyContactRolesListRequest) Limit(limit int32) ApiTenancyContactRolesListRequest { + r.limit = &limit + return r +} + +func (r ApiTenancyContactRolesListRequest) ModifiedByRequest(modifiedByRequest string) ApiTenancyContactRolesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiTenancyContactRolesListRequest) Name(name []string) ApiTenancyContactRolesListRequest { + r.name = &name + return r +} + +func (r ApiTenancyContactRolesListRequest) NameEmpty(nameEmpty bool) ApiTenancyContactRolesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiTenancyContactRolesListRequest) NameIc(nameIc []string) ApiTenancyContactRolesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiTenancyContactRolesListRequest) NameIe(nameIe []string) ApiTenancyContactRolesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiTenancyContactRolesListRequest) NameIew(nameIew []string) ApiTenancyContactRolesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiTenancyContactRolesListRequest) NameIsw(nameIsw []string) ApiTenancyContactRolesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiTenancyContactRolesListRequest) NameN(nameN []string) ApiTenancyContactRolesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiTenancyContactRolesListRequest) NameNic(nameNic []string) ApiTenancyContactRolesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiTenancyContactRolesListRequest) NameNie(nameNie []string) ApiTenancyContactRolesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiTenancyContactRolesListRequest) NameNiew(nameNiew []string) ApiTenancyContactRolesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiTenancyContactRolesListRequest) NameNisw(nameNisw []string) ApiTenancyContactRolesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiTenancyContactRolesListRequest) Offset(offset int32) ApiTenancyContactRolesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiTenancyContactRolesListRequest) Ordering(ordering string) ApiTenancyContactRolesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiTenancyContactRolesListRequest) Q(q string) ApiTenancyContactRolesListRequest { + r.q = &q + return r +} + +func (r ApiTenancyContactRolesListRequest) Slug(slug []string) ApiTenancyContactRolesListRequest { + r.slug = &slug + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugEmpty(slugEmpty bool) ApiTenancyContactRolesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugIc(slugIc []string) ApiTenancyContactRolesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugIe(slugIe []string) ApiTenancyContactRolesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugIew(slugIew []string) ApiTenancyContactRolesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugIsw(slugIsw []string) ApiTenancyContactRolesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugN(slugN []string) ApiTenancyContactRolesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugNic(slugNic []string) ApiTenancyContactRolesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugNie(slugNie []string) ApiTenancyContactRolesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugNiew(slugNiew []string) ApiTenancyContactRolesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiTenancyContactRolesListRequest) SlugNisw(slugNisw []string) ApiTenancyContactRolesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiTenancyContactRolesListRequest) Tag(tag []string) ApiTenancyContactRolesListRequest { + r.tag = &tag + return r +} + +func (r ApiTenancyContactRolesListRequest) TagN(tagN []string) ApiTenancyContactRolesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiTenancyContactRolesListRequest) UpdatedByRequest(updatedByRequest string) ApiTenancyContactRolesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiTenancyContactRolesListRequest) Execute() (*PaginatedContactRoleList, *http.Response, error) { + return r.ApiService.TenancyContactRolesListExecute(r) +} + +/* +TenancyContactRolesList Method for TenancyContactRolesList + +Get a list of contact role objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactRolesListRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesList(ctx context.Context) ApiTenancyContactRolesListRequest { + return ApiTenancyContactRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedContactRoleList +func (a *TenancyAPIService) TenancyContactRolesListExecute(r ApiTenancyContactRolesListRequest) (*PaginatedContactRoleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedContactRoleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + patchedContactRoleRequest *PatchedContactRoleRequest +} + +func (r ApiTenancyContactRolesPartialUpdateRequest) PatchedContactRoleRequest(patchedContactRoleRequest PatchedContactRoleRequest) ApiTenancyContactRolesPartialUpdateRequest { + r.patchedContactRoleRequest = &patchedContactRoleRequest + return r +} + +func (r ApiTenancyContactRolesPartialUpdateRequest) Execute() (*ContactRole, *http.Response, error) { + return r.ApiService.TenancyContactRolesPartialUpdateExecute(r) +} + +/* +TenancyContactRolesPartialUpdate Method for TenancyContactRolesPartialUpdate + +Patch a contact role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact role. + @return ApiTenancyContactRolesPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesPartialUpdate(ctx context.Context, id int32) ApiTenancyContactRolesPartialUpdateRequest { + return ApiTenancyContactRolesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactRole +func (a *TenancyAPIService) TenancyContactRolesPartialUpdateExecute(r ApiTenancyContactRolesPartialUpdateRequest) (*ContactRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedContactRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesRetrieveRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactRolesRetrieveRequest) Execute() (*ContactRole, *http.Response, error) { + return r.ApiService.TenancyContactRolesRetrieveExecute(r) +} + +/* +TenancyContactRolesRetrieve Method for TenancyContactRolesRetrieve + +Get a contact role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact role. + @return ApiTenancyContactRolesRetrieveRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesRetrieve(ctx context.Context, id int32) ApiTenancyContactRolesRetrieveRequest { + return ApiTenancyContactRolesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactRole +func (a *TenancyAPIService) TenancyContactRolesRetrieveExecute(r ApiTenancyContactRolesRetrieveRequest) (*ContactRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactRolesUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + contactRoleRequest *ContactRoleRequest +} + +func (r ApiTenancyContactRolesUpdateRequest) ContactRoleRequest(contactRoleRequest ContactRoleRequest) ApiTenancyContactRolesUpdateRequest { + r.contactRoleRequest = &contactRoleRequest + return r +} + +func (r ApiTenancyContactRolesUpdateRequest) Execute() (*ContactRole, *http.Response, error) { + return r.ApiService.TenancyContactRolesUpdateExecute(r) +} + +/* +TenancyContactRolesUpdate Method for TenancyContactRolesUpdate + +Put a contact role object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact role. + @return ApiTenancyContactRolesUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactRolesUpdate(ctx context.Context, id int32) ApiTenancyContactRolesUpdateRequest { + return ApiTenancyContactRolesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ContactRole +func (a *TenancyAPIService) TenancyContactRolesUpdateExecute(r ApiTenancyContactRolesUpdateRequest) (*ContactRole, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ContactRole + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactRolesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contact-roles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRoleRequest == nil { + return localVarReturnValue, nil, reportError("contactRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRoleRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactsBulkDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactRequest *[]ContactRequest +} + +func (r ApiTenancyContactsBulkDestroyRequest) ContactRequest(contactRequest []ContactRequest) ApiTenancyContactsBulkDestroyRequest { + r.contactRequest = &contactRequest + return r +} + +func (r ApiTenancyContactsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactsBulkDestroyExecute(r) +} + +/* +TenancyContactsBulkDestroy Method for TenancyContactsBulkDestroy + +Delete a list of contact objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactsBulkDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactsBulkDestroy(ctx context.Context) ApiTenancyContactsBulkDestroyRequest { + return ApiTenancyContactsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactsBulkDestroyExecute(r ApiTenancyContactsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRequest == nil { + return nil, reportError("contactRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactRequest *[]ContactRequest +} + +func (r ApiTenancyContactsBulkPartialUpdateRequest) ContactRequest(contactRequest []ContactRequest) ApiTenancyContactsBulkPartialUpdateRequest { + r.contactRequest = &contactRequest + return r +} + +func (r ApiTenancyContactsBulkPartialUpdateRequest) Execute() ([]Contact, *http.Response, error) { + return r.ApiService.TenancyContactsBulkPartialUpdateExecute(r) +} + +/* +TenancyContactsBulkPartialUpdate Method for TenancyContactsBulkPartialUpdate + +Patch a list of contact objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactsBulkPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactsBulkPartialUpdate(ctx context.Context) ApiTenancyContactsBulkPartialUpdateRequest { + return ApiTenancyContactsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Contact +func (a *TenancyAPIService) TenancyContactsBulkPartialUpdateExecute(r ApiTenancyContactsBulkPartialUpdateRequest) ([]Contact, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Contact + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRequest == nil { + return localVarReturnValue, nil, reportError("contactRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactsBulkUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contactRequest *[]ContactRequest +} + +func (r ApiTenancyContactsBulkUpdateRequest) ContactRequest(contactRequest []ContactRequest) ApiTenancyContactsBulkUpdateRequest { + r.contactRequest = &contactRequest + return r +} + +func (r ApiTenancyContactsBulkUpdateRequest) Execute() ([]Contact, *http.Response, error) { + return r.ApiService.TenancyContactsBulkUpdateExecute(r) +} + +/* +TenancyContactsBulkUpdate Method for TenancyContactsBulkUpdate + +Put a list of contact objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactsBulkUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactsBulkUpdate(ctx context.Context) ApiTenancyContactsBulkUpdateRequest { + return ApiTenancyContactsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Contact +func (a *TenancyAPIService) TenancyContactsBulkUpdateExecute(r ApiTenancyContactsBulkUpdateRequest) ([]Contact, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Contact + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contactRequest == nil { + return localVarReturnValue, nil, reportError("contactRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.contactRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactsCreateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + writableContactRequest *WritableContactRequest +} + +func (r ApiTenancyContactsCreateRequest) WritableContactRequest(writableContactRequest WritableContactRequest) ApiTenancyContactsCreateRequest { + r.writableContactRequest = &writableContactRequest + return r +} + +func (r ApiTenancyContactsCreateRequest) Execute() (*Contact, *http.Response, error) { + return r.ApiService.TenancyContactsCreateExecute(r) +} + +/* +TenancyContactsCreate Method for TenancyContactsCreate + +Post a list of contact objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactsCreateRequest +*/ +func (a *TenancyAPIService) TenancyContactsCreate(ctx context.Context) ApiTenancyContactsCreateRequest { + return ApiTenancyContactsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Contact +func (a *TenancyAPIService) TenancyContactsCreateExecute(r ApiTenancyContactsCreateRequest) (*Contact, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Contact + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableContactRequest == nil { + return localVarReturnValue, nil, reportError("writableContactRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableContactRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactsDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyContactsDestroyExecute(r) +} + +/* +TenancyContactsDestroy Method for TenancyContactsDestroy + +Delete a contact object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact. + @return ApiTenancyContactsDestroyRequest +*/ +func (a *TenancyAPIService) TenancyContactsDestroy(ctx context.Context, id int32) ApiTenancyContactsDestroyRequest { + return ApiTenancyContactsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyContactsDestroyExecute(r ApiTenancyContactsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyContactsListRequest struct { + ctx context.Context + ApiService *TenancyAPIService + address *[]string + addressEmpty *bool + addressIc *[]string + addressIe *[]string + addressIew *[]string + addressIsw *[]string + addressN *[]string + addressNic *[]string + addressNie *[]string + addressNiew *[]string + addressNisw *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + email *[]string + emailEmpty *bool + emailIc *[]string + emailIe *[]string + emailIew *[]string + emailIsw *[]string + emailN *[]string + emailNic *[]string + emailNie *[]string + emailNiew *[]string + emailNisw *[]string + group *[]int32 + groupN *[]int32 + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + link *[]string + linkEmpty *bool + linkIc *[]string + linkIe *[]string + linkIew *[]string + linkIsw *[]string + linkN *[]string + linkNic *[]string + linkNie *[]string + linkNiew *[]string + linkNisw *[]string + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + phone *[]string + phoneEmpty *bool + phoneIc *[]string + phoneIe *[]string + phoneIew *[]string + phoneIsw *[]string + phoneN *[]string + phoneNic *[]string + phoneNie *[]string + phoneNiew *[]string + phoneNisw *[]string + q *string + tag *[]string + tagN *[]string + title *[]string + titleEmpty *bool + titleIc *[]string + titleIe *[]string + titleIew *[]string + titleIsw *[]string + titleN *[]string + titleNic *[]string + titleNie *[]string + titleNiew *[]string + titleNisw *[]string + updatedByRequest *string +} + +func (r ApiTenancyContactsListRequest) Address(address []string) ApiTenancyContactsListRequest { + r.address = &address + return r +} + +func (r ApiTenancyContactsListRequest) AddressEmpty(addressEmpty bool) ApiTenancyContactsListRequest { + r.addressEmpty = &addressEmpty + return r +} + +func (r ApiTenancyContactsListRequest) AddressIc(addressIc []string) ApiTenancyContactsListRequest { + r.addressIc = &addressIc + return r +} + +func (r ApiTenancyContactsListRequest) AddressIe(addressIe []string) ApiTenancyContactsListRequest { + r.addressIe = &addressIe + return r +} + +func (r ApiTenancyContactsListRequest) AddressIew(addressIew []string) ApiTenancyContactsListRequest { + r.addressIew = &addressIew + return r +} + +func (r ApiTenancyContactsListRequest) AddressIsw(addressIsw []string) ApiTenancyContactsListRequest { + r.addressIsw = &addressIsw + return r +} + +func (r ApiTenancyContactsListRequest) AddressN(addressN []string) ApiTenancyContactsListRequest { + r.addressN = &addressN + return r +} + +func (r ApiTenancyContactsListRequest) AddressNic(addressNic []string) ApiTenancyContactsListRequest { + r.addressNic = &addressNic + return r +} + +func (r ApiTenancyContactsListRequest) AddressNie(addressNie []string) ApiTenancyContactsListRequest { + r.addressNie = &addressNie + return r +} + +func (r ApiTenancyContactsListRequest) AddressNiew(addressNiew []string) ApiTenancyContactsListRequest { + r.addressNiew = &addressNiew + return r +} + +func (r ApiTenancyContactsListRequest) AddressNisw(addressNisw []string) ApiTenancyContactsListRequest { + r.addressNisw = &addressNisw + return r +} + +func (r ApiTenancyContactsListRequest) Created(created []time.Time) ApiTenancyContactsListRequest { + r.created = &created + return r +} + +func (r ApiTenancyContactsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiTenancyContactsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiTenancyContactsListRequest) CreatedGt(createdGt []time.Time) ApiTenancyContactsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiTenancyContactsListRequest) CreatedGte(createdGte []time.Time) ApiTenancyContactsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiTenancyContactsListRequest) CreatedLt(createdLt []time.Time) ApiTenancyContactsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiTenancyContactsListRequest) CreatedLte(createdLte []time.Time) ApiTenancyContactsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiTenancyContactsListRequest) CreatedN(createdN []time.Time) ApiTenancyContactsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiTenancyContactsListRequest) CreatedByRequest(createdByRequest string) ApiTenancyContactsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiTenancyContactsListRequest) Description(description []string) ApiTenancyContactsListRequest { + r.description = &description + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiTenancyContactsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionIc(descriptionIc []string) ApiTenancyContactsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionIe(descriptionIe []string) ApiTenancyContactsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionIew(descriptionIew []string) ApiTenancyContactsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionIsw(descriptionIsw []string) ApiTenancyContactsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionN(descriptionN []string) ApiTenancyContactsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionNic(descriptionNic []string) ApiTenancyContactsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionNie(descriptionNie []string) ApiTenancyContactsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionNiew(descriptionNiew []string) ApiTenancyContactsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiTenancyContactsListRequest) DescriptionNisw(descriptionNisw []string) ApiTenancyContactsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiTenancyContactsListRequest) Email(email []string) ApiTenancyContactsListRequest { + r.email = &email + return r +} + +func (r ApiTenancyContactsListRequest) EmailEmpty(emailEmpty bool) ApiTenancyContactsListRequest { + r.emailEmpty = &emailEmpty + return r +} + +func (r ApiTenancyContactsListRequest) EmailIc(emailIc []string) ApiTenancyContactsListRequest { + r.emailIc = &emailIc + return r +} + +func (r ApiTenancyContactsListRequest) EmailIe(emailIe []string) ApiTenancyContactsListRequest { + r.emailIe = &emailIe + return r +} + +func (r ApiTenancyContactsListRequest) EmailIew(emailIew []string) ApiTenancyContactsListRequest { + r.emailIew = &emailIew + return r +} + +func (r ApiTenancyContactsListRequest) EmailIsw(emailIsw []string) ApiTenancyContactsListRequest { + r.emailIsw = &emailIsw + return r +} + +func (r ApiTenancyContactsListRequest) EmailN(emailN []string) ApiTenancyContactsListRequest { + r.emailN = &emailN + return r +} + +func (r ApiTenancyContactsListRequest) EmailNic(emailNic []string) ApiTenancyContactsListRequest { + r.emailNic = &emailNic + return r +} + +func (r ApiTenancyContactsListRequest) EmailNie(emailNie []string) ApiTenancyContactsListRequest { + r.emailNie = &emailNie + return r +} + +func (r ApiTenancyContactsListRequest) EmailNiew(emailNiew []string) ApiTenancyContactsListRequest { + r.emailNiew = &emailNiew + return r +} + +func (r ApiTenancyContactsListRequest) EmailNisw(emailNisw []string) ApiTenancyContactsListRequest { + r.emailNisw = &emailNisw + return r +} + +// Contact group (slug) +func (r ApiTenancyContactsListRequest) Group(group []int32) ApiTenancyContactsListRequest { + r.group = &group + return r +} + +// Contact group (slug) +func (r ApiTenancyContactsListRequest) GroupN(groupN []int32) ApiTenancyContactsListRequest { + r.groupN = &groupN + return r +} + +// Contact group (ID) +func (r ApiTenancyContactsListRequest) GroupId(groupId []int32) ApiTenancyContactsListRequest { + r.groupId = &groupId + return r +} + +// Contact group (ID) +func (r ApiTenancyContactsListRequest) GroupIdN(groupIdN []int32) ApiTenancyContactsListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiTenancyContactsListRequest) Id(id []int32) ApiTenancyContactsListRequest { + r.id = &id + return r +} + +func (r ApiTenancyContactsListRequest) IdEmpty(idEmpty bool) ApiTenancyContactsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiTenancyContactsListRequest) IdGt(idGt []int32) ApiTenancyContactsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiTenancyContactsListRequest) IdGte(idGte []int32) ApiTenancyContactsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiTenancyContactsListRequest) IdLt(idLt []int32) ApiTenancyContactsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiTenancyContactsListRequest) IdLte(idLte []int32) ApiTenancyContactsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiTenancyContactsListRequest) IdN(idN []int32) ApiTenancyContactsListRequest { + r.idN = &idN + return r +} + +func (r ApiTenancyContactsListRequest) LastUpdated(lastUpdated []time.Time) ApiTenancyContactsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiTenancyContactsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiTenancyContactsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiTenancyContactsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiTenancyContactsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiTenancyContactsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiTenancyContactsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiTenancyContactsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiTenancyContactsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiTenancyContactsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiTenancyContactsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiTenancyContactsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiTenancyContactsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiTenancyContactsListRequest) Limit(limit int32) ApiTenancyContactsListRequest { + r.limit = &limit + return r +} + +func (r ApiTenancyContactsListRequest) Link(link []string) ApiTenancyContactsListRequest { + r.link = &link + return r +} + +func (r ApiTenancyContactsListRequest) LinkEmpty(linkEmpty bool) ApiTenancyContactsListRequest { + r.linkEmpty = &linkEmpty + return r +} + +func (r ApiTenancyContactsListRequest) LinkIc(linkIc []string) ApiTenancyContactsListRequest { + r.linkIc = &linkIc + return r +} + +func (r ApiTenancyContactsListRequest) LinkIe(linkIe []string) ApiTenancyContactsListRequest { + r.linkIe = &linkIe + return r +} + +func (r ApiTenancyContactsListRequest) LinkIew(linkIew []string) ApiTenancyContactsListRequest { + r.linkIew = &linkIew + return r +} + +func (r ApiTenancyContactsListRequest) LinkIsw(linkIsw []string) ApiTenancyContactsListRequest { + r.linkIsw = &linkIsw + return r +} + +func (r ApiTenancyContactsListRequest) LinkN(linkN []string) ApiTenancyContactsListRequest { + r.linkN = &linkN + return r +} + +func (r ApiTenancyContactsListRequest) LinkNic(linkNic []string) ApiTenancyContactsListRequest { + r.linkNic = &linkNic + return r +} + +func (r ApiTenancyContactsListRequest) LinkNie(linkNie []string) ApiTenancyContactsListRequest { + r.linkNie = &linkNie + return r +} + +func (r ApiTenancyContactsListRequest) LinkNiew(linkNiew []string) ApiTenancyContactsListRequest { + r.linkNiew = &linkNiew + return r +} + +func (r ApiTenancyContactsListRequest) LinkNisw(linkNisw []string) ApiTenancyContactsListRequest { + r.linkNisw = &linkNisw + return r +} + +func (r ApiTenancyContactsListRequest) ModifiedByRequest(modifiedByRequest string) ApiTenancyContactsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiTenancyContactsListRequest) Name(name []string) ApiTenancyContactsListRequest { + r.name = &name + return r +} + +func (r ApiTenancyContactsListRequest) NameEmpty(nameEmpty bool) ApiTenancyContactsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiTenancyContactsListRequest) NameIc(nameIc []string) ApiTenancyContactsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiTenancyContactsListRequest) NameIe(nameIe []string) ApiTenancyContactsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiTenancyContactsListRequest) NameIew(nameIew []string) ApiTenancyContactsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiTenancyContactsListRequest) NameIsw(nameIsw []string) ApiTenancyContactsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiTenancyContactsListRequest) NameN(nameN []string) ApiTenancyContactsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiTenancyContactsListRequest) NameNic(nameNic []string) ApiTenancyContactsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiTenancyContactsListRequest) NameNie(nameNie []string) ApiTenancyContactsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiTenancyContactsListRequest) NameNiew(nameNiew []string) ApiTenancyContactsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiTenancyContactsListRequest) NameNisw(nameNisw []string) ApiTenancyContactsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiTenancyContactsListRequest) Offset(offset int32) ApiTenancyContactsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiTenancyContactsListRequest) Ordering(ordering string) ApiTenancyContactsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiTenancyContactsListRequest) Phone(phone []string) ApiTenancyContactsListRequest { + r.phone = &phone + return r +} + +func (r ApiTenancyContactsListRequest) PhoneEmpty(phoneEmpty bool) ApiTenancyContactsListRequest { + r.phoneEmpty = &phoneEmpty + return r +} + +func (r ApiTenancyContactsListRequest) PhoneIc(phoneIc []string) ApiTenancyContactsListRequest { + r.phoneIc = &phoneIc + return r +} + +func (r ApiTenancyContactsListRequest) PhoneIe(phoneIe []string) ApiTenancyContactsListRequest { + r.phoneIe = &phoneIe + return r +} + +func (r ApiTenancyContactsListRequest) PhoneIew(phoneIew []string) ApiTenancyContactsListRequest { + r.phoneIew = &phoneIew + return r +} + +func (r ApiTenancyContactsListRequest) PhoneIsw(phoneIsw []string) ApiTenancyContactsListRequest { + r.phoneIsw = &phoneIsw + return r +} + +func (r ApiTenancyContactsListRequest) PhoneN(phoneN []string) ApiTenancyContactsListRequest { + r.phoneN = &phoneN + return r +} + +func (r ApiTenancyContactsListRequest) PhoneNic(phoneNic []string) ApiTenancyContactsListRequest { + r.phoneNic = &phoneNic + return r +} + +func (r ApiTenancyContactsListRequest) PhoneNie(phoneNie []string) ApiTenancyContactsListRequest { + r.phoneNie = &phoneNie + return r +} + +func (r ApiTenancyContactsListRequest) PhoneNiew(phoneNiew []string) ApiTenancyContactsListRequest { + r.phoneNiew = &phoneNiew + return r +} + +func (r ApiTenancyContactsListRequest) PhoneNisw(phoneNisw []string) ApiTenancyContactsListRequest { + r.phoneNisw = &phoneNisw + return r +} + +// Search +func (r ApiTenancyContactsListRequest) Q(q string) ApiTenancyContactsListRequest { + r.q = &q + return r +} + +func (r ApiTenancyContactsListRequest) Tag(tag []string) ApiTenancyContactsListRequest { + r.tag = &tag + return r +} + +func (r ApiTenancyContactsListRequest) TagN(tagN []string) ApiTenancyContactsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiTenancyContactsListRequest) Title(title []string) ApiTenancyContactsListRequest { + r.title = &title + return r +} + +func (r ApiTenancyContactsListRequest) TitleEmpty(titleEmpty bool) ApiTenancyContactsListRequest { + r.titleEmpty = &titleEmpty + return r +} + +func (r ApiTenancyContactsListRequest) TitleIc(titleIc []string) ApiTenancyContactsListRequest { + r.titleIc = &titleIc + return r +} + +func (r ApiTenancyContactsListRequest) TitleIe(titleIe []string) ApiTenancyContactsListRequest { + r.titleIe = &titleIe + return r +} + +func (r ApiTenancyContactsListRequest) TitleIew(titleIew []string) ApiTenancyContactsListRequest { + r.titleIew = &titleIew + return r +} + +func (r ApiTenancyContactsListRequest) TitleIsw(titleIsw []string) ApiTenancyContactsListRequest { + r.titleIsw = &titleIsw + return r +} + +func (r ApiTenancyContactsListRequest) TitleN(titleN []string) ApiTenancyContactsListRequest { + r.titleN = &titleN + return r +} + +func (r ApiTenancyContactsListRequest) TitleNic(titleNic []string) ApiTenancyContactsListRequest { + r.titleNic = &titleNic + return r +} + +func (r ApiTenancyContactsListRequest) TitleNie(titleNie []string) ApiTenancyContactsListRequest { + r.titleNie = &titleNie + return r +} + +func (r ApiTenancyContactsListRequest) TitleNiew(titleNiew []string) ApiTenancyContactsListRequest { + r.titleNiew = &titleNiew + return r +} + +func (r ApiTenancyContactsListRequest) TitleNisw(titleNisw []string) ApiTenancyContactsListRequest { + r.titleNisw = &titleNisw + return r +} + +func (r ApiTenancyContactsListRequest) UpdatedByRequest(updatedByRequest string) ApiTenancyContactsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiTenancyContactsListRequest) Execute() (*PaginatedContactList, *http.Response, error) { + return r.ApiService.TenancyContactsListExecute(r) +} + +/* +TenancyContactsList Method for TenancyContactsList + +Get a list of contact objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyContactsListRequest +*/ +func (a *TenancyAPIService) TenancyContactsList(ctx context.Context) ApiTenancyContactsListRequest { + return ApiTenancyContactsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedContactList +func (a *TenancyAPIService) TenancyContactsListExecute(r ApiTenancyContactsListRequest) (*PaginatedContactList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedContactList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.address != nil { + t := *r.address + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address", t, "multi") + } + } + if r.addressEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__empty", r.addressEmpty, "") + } + if r.addressIc != nil { + t := *r.addressIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__ic", t, "multi") + } + } + if r.addressIe != nil { + t := *r.addressIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__ie", t, "multi") + } + } + if r.addressIew != nil { + t := *r.addressIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__iew", t, "multi") + } + } + if r.addressIsw != nil { + t := *r.addressIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__isw", t, "multi") + } + } + if r.addressN != nil { + t := *r.addressN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__n", t, "multi") + } + } + if r.addressNic != nil { + t := *r.addressNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__nic", t, "multi") + } + } + if r.addressNie != nil { + t := *r.addressNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__nie", t, "multi") + } + } + if r.addressNiew != nil { + t := *r.addressNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__niew", t, "multi") + } + } + if r.addressNisw != nil { + t := *r.addressNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "address__nisw", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.email != nil { + t := *r.email + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email", t, "multi") + } + } + if r.emailEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__empty", r.emailEmpty, "") + } + if r.emailIc != nil { + t := *r.emailIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ic", t, "multi") + } + } + if r.emailIe != nil { + t := *r.emailIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ie", t, "multi") + } + } + if r.emailIew != nil { + t := *r.emailIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__iew", t, "multi") + } + } + if r.emailIsw != nil { + t := *r.emailIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__isw", t, "multi") + } + } + if r.emailN != nil { + t := *r.emailN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__n", t, "multi") + } + } + if r.emailNic != nil { + t := *r.emailNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nic", t, "multi") + } + } + if r.emailNie != nil { + t := *r.emailNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nie", t, "multi") + } + } + if r.emailNiew != nil { + t := *r.emailNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__niew", t, "multi") + } + } + if r.emailNisw != nil { + t := *r.emailNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nisw", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.link != nil { + t := *r.link + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link", t, "multi") + } + } + if r.linkEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__empty", r.linkEmpty, "") + } + if r.linkIc != nil { + t := *r.linkIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__ic", t, "multi") + } + } + if r.linkIe != nil { + t := *r.linkIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__ie", t, "multi") + } + } + if r.linkIew != nil { + t := *r.linkIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__iew", t, "multi") + } + } + if r.linkIsw != nil { + t := *r.linkIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__isw", t, "multi") + } + } + if r.linkN != nil { + t := *r.linkN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__n", t, "multi") + } + } + if r.linkNic != nil { + t := *r.linkNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__nic", t, "multi") + } + } + if r.linkNie != nil { + t := *r.linkNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__nie", t, "multi") + } + } + if r.linkNiew != nil { + t := *r.linkNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__niew", t, "multi") + } + } + if r.linkNisw != nil { + t := *r.linkNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "link__nisw", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.phone != nil { + t := *r.phone + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone", t, "multi") + } + } + if r.phoneEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__empty", r.phoneEmpty, "") + } + if r.phoneIc != nil { + t := *r.phoneIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__ic", t, "multi") + } + } + if r.phoneIe != nil { + t := *r.phoneIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__ie", t, "multi") + } + } + if r.phoneIew != nil { + t := *r.phoneIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__iew", t, "multi") + } + } + if r.phoneIsw != nil { + t := *r.phoneIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__isw", t, "multi") + } + } + if r.phoneN != nil { + t := *r.phoneN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__n", t, "multi") + } + } + if r.phoneNic != nil { + t := *r.phoneNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__nic", t, "multi") + } + } + if r.phoneNie != nil { + t := *r.phoneNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__nie", t, "multi") + } + } + if r.phoneNiew != nil { + t := *r.phoneNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__niew", t, "multi") + } + } + if r.phoneNisw != nil { + t := *r.phoneNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "phone__nisw", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.title != nil { + t := *r.title + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title", t, "multi") + } + } + if r.titleEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__empty", r.titleEmpty, "") + } + if r.titleIc != nil { + t := *r.titleIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__ic", t, "multi") + } + } + if r.titleIe != nil { + t := *r.titleIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__ie", t, "multi") + } + } + if r.titleIew != nil { + t := *r.titleIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__iew", t, "multi") + } + } + if r.titleIsw != nil { + t := *r.titleIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__isw", t, "multi") + } + } + if r.titleN != nil { + t := *r.titleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__n", t, "multi") + } + } + if r.titleNic != nil { + t := *r.titleNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__nic", t, "multi") + } + } + if r.titleNie != nil { + t := *r.titleNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__nie", t, "multi") + } + } + if r.titleNiew != nil { + t := *r.titleNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__niew", t, "multi") + } + } + if r.titleNisw != nil { + t := *r.titleNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "title__nisw", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactsPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + patchedWritableContactRequest *PatchedWritableContactRequest +} + +func (r ApiTenancyContactsPartialUpdateRequest) PatchedWritableContactRequest(patchedWritableContactRequest PatchedWritableContactRequest) ApiTenancyContactsPartialUpdateRequest { + r.patchedWritableContactRequest = &patchedWritableContactRequest + return r +} + +func (r ApiTenancyContactsPartialUpdateRequest) Execute() (*Contact, *http.Response, error) { + return r.ApiService.TenancyContactsPartialUpdateExecute(r) +} + +/* +TenancyContactsPartialUpdate Method for TenancyContactsPartialUpdate + +Patch a contact object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact. + @return ApiTenancyContactsPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactsPartialUpdate(ctx context.Context, id int32) ApiTenancyContactsPartialUpdateRequest { + return ApiTenancyContactsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Contact +func (a *TenancyAPIService) TenancyContactsPartialUpdateExecute(r ApiTenancyContactsPartialUpdateRequest) (*Contact, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Contact + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableContactRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactsRetrieveRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyContactsRetrieveRequest) Execute() (*Contact, *http.Response, error) { + return r.ApiService.TenancyContactsRetrieveExecute(r) +} + +/* +TenancyContactsRetrieve Method for TenancyContactsRetrieve + +Get a contact object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact. + @return ApiTenancyContactsRetrieveRequest +*/ +func (a *TenancyAPIService) TenancyContactsRetrieve(ctx context.Context, id int32) ApiTenancyContactsRetrieveRequest { + return ApiTenancyContactsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Contact +func (a *TenancyAPIService) TenancyContactsRetrieveExecute(r ApiTenancyContactsRetrieveRequest) (*Contact, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Contact + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyContactsUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + writableContactRequest *WritableContactRequest +} + +func (r ApiTenancyContactsUpdateRequest) WritableContactRequest(writableContactRequest WritableContactRequest) ApiTenancyContactsUpdateRequest { + r.writableContactRequest = &writableContactRequest + return r +} + +func (r ApiTenancyContactsUpdateRequest) Execute() (*Contact, *http.Response, error) { + return r.ApiService.TenancyContactsUpdateExecute(r) +} + +/* +TenancyContactsUpdate Method for TenancyContactsUpdate + +Put a contact object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this contact. + @return ApiTenancyContactsUpdateRequest +*/ +func (a *TenancyAPIService) TenancyContactsUpdate(ctx context.Context, id int32) ApiTenancyContactsUpdateRequest { + return ApiTenancyContactsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Contact +func (a *TenancyAPIService) TenancyContactsUpdateExecute(r ApiTenancyContactsUpdateRequest) (*Contact, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Contact + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyContactsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/contacts/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableContactRequest == nil { + return localVarReturnValue, nil, reportError("writableContactRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableContactRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + tenantGroupRequest *[]TenantGroupRequest +} + +func (r ApiTenancyTenantGroupsBulkDestroyRequest) TenantGroupRequest(tenantGroupRequest []TenantGroupRequest) ApiTenancyTenantGroupsBulkDestroyRequest { + r.tenantGroupRequest = &tenantGroupRequest + return r +} + +func (r ApiTenancyTenantGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyTenantGroupsBulkDestroyExecute(r) +} + +/* +TenancyTenantGroupsBulkDestroy Method for TenancyTenantGroupsBulkDestroy + +Delete a list of tenant group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantGroupsBulkDestroyRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsBulkDestroy(ctx context.Context) ApiTenancyTenantGroupsBulkDestroyRequest { + return ApiTenancyTenantGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyTenantGroupsBulkDestroyExecute(r ApiTenancyTenantGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantGroupRequest == nil { + return nil, reportError("tenantGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + tenantGroupRequest *[]TenantGroupRequest +} + +func (r ApiTenancyTenantGroupsBulkPartialUpdateRequest) TenantGroupRequest(tenantGroupRequest []TenantGroupRequest) ApiTenancyTenantGroupsBulkPartialUpdateRequest { + r.tenantGroupRequest = &tenantGroupRequest + return r +} + +func (r ApiTenancyTenantGroupsBulkPartialUpdateRequest) Execute() ([]TenantGroup, *http.Response, error) { + return r.ApiService.TenancyTenantGroupsBulkPartialUpdateExecute(r) +} + +/* +TenancyTenantGroupsBulkPartialUpdate Method for TenancyTenantGroupsBulkPartialUpdate + +Patch a list of tenant group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantGroupsBulkPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsBulkPartialUpdate(ctx context.Context) ApiTenancyTenantGroupsBulkPartialUpdateRequest { + return ApiTenancyTenantGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TenantGroup +func (a *TenancyAPIService) TenancyTenantGroupsBulkPartialUpdateExecute(r ApiTenancyTenantGroupsBulkPartialUpdateRequest) ([]TenantGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TenantGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantGroupRequest == nil { + return localVarReturnValue, nil, reportError("tenantGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + tenantGroupRequest *[]TenantGroupRequest +} + +func (r ApiTenancyTenantGroupsBulkUpdateRequest) TenantGroupRequest(tenantGroupRequest []TenantGroupRequest) ApiTenancyTenantGroupsBulkUpdateRequest { + r.tenantGroupRequest = &tenantGroupRequest + return r +} + +func (r ApiTenancyTenantGroupsBulkUpdateRequest) Execute() ([]TenantGroup, *http.Response, error) { + return r.ApiService.TenancyTenantGroupsBulkUpdateExecute(r) +} + +/* +TenancyTenantGroupsBulkUpdate Method for TenancyTenantGroupsBulkUpdate + +Put a list of tenant group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantGroupsBulkUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsBulkUpdate(ctx context.Context) ApiTenancyTenantGroupsBulkUpdateRequest { + return ApiTenancyTenantGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TenantGroup +func (a *TenancyAPIService) TenancyTenantGroupsBulkUpdateExecute(r ApiTenancyTenantGroupsBulkUpdateRequest) ([]TenantGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TenantGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantGroupRequest == nil { + return localVarReturnValue, nil, reportError("tenantGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsCreateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + writableTenantGroupRequest *WritableTenantGroupRequest +} + +func (r ApiTenancyTenantGroupsCreateRequest) WritableTenantGroupRequest(writableTenantGroupRequest WritableTenantGroupRequest) ApiTenancyTenantGroupsCreateRequest { + r.writableTenantGroupRequest = &writableTenantGroupRequest + return r +} + +func (r ApiTenancyTenantGroupsCreateRequest) Execute() (*TenantGroup, *http.Response, error) { + return r.ApiService.TenancyTenantGroupsCreateExecute(r) +} + +/* +TenancyTenantGroupsCreate Method for TenancyTenantGroupsCreate + +Post a list of tenant group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantGroupsCreateRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsCreate(ctx context.Context) ApiTenancyTenantGroupsCreateRequest { + return ApiTenancyTenantGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TenantGroup +func (a *TenancyAPIService) TenancyTenantGroupsCreateExecute(r ApiTenancyTenantGroupsCreateRequest) (*TenantGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TenantGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTenantGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableTenantGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTenantGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyTenantGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyTenantGroupsDestroyExecute(r) +} + +/* +TenancyTenantGroupsDestroy Method for TenancyTenantGroupsDestroy + +Delete a tenant group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant group. + @return ApiTenancyTenantGroupsDestroyRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsDestroy(ctx context.Context, id int32) ApiTenancyTenantGroupsDestroyRequest { + return ApiTenancyTenantGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyTenantGroupsDestroyExecute(r ApiTenancyTenantGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsListRequest struct { + ctx context.Context + ApiService *TenancyAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parent *[]string + parentN *[]string + parentId *[]*int32 + parentIdN *[]*int32 + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiTenancyTenantGroupsListRequest) Created(created []time.Time) ApiTenancyTenantGroupsListRequest { + r.created = &created + return r +} + +func (r ApiTenancyTenantGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiTenancyTenantGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiTenancyTenantGroupsListRequest) CreatedGt(createdGt []time.Time) ApiTenancyTenantGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiTenancyTenantGroupsListRequest) CreatedGte(createdGte []time.Time) ApiTenancyTenantGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiTenancyTenantGroupsListRequest) CreatedLt(createdLt []time.Time) ApiTenancyTenantGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiTenancyTenantGroupsListRequest) CreatedLte(createdLte []time.Time) ApiTenancyTenantGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiTenancyTenantGroupsListRequest) CreatedN(createdN []time.Time) ApiTenancyTenantGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiTenancyTenantGroupsListRequest) CreatedByRequest(createdByRequest string) ApiTenancyTenantGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiTenancyTenantGroupsListRequest) Description(description []string) ApiTenancyTenantGroupsListRequest { + r.description = &description + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiTenancyTenantGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionIc(descriptionIc []string) ApiTenancyTenantGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionIe(descriptionIe []string) ApiTenancyTenantGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionIew(descriptionIew []string) ApiTenancyTenantGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiTenancyTenantGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionN(descriptionN []string) ApiTenancyTenantGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionNic(descriptionNic []string) ApiTenancyTenantGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionNie(descriptionNie []string) ApiTenancyTenantGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiTenancyTenantGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiTenancyTenantGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiTenancyTenantGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiTenancyTenantGroupsListRequest) Id(id []int32) ApiTenancyTenantGroupsListRequest { + r.id = &id + return r +} + +func (r ApiTenancyTenantGroupsListRequest) IdEmpty(idEmpty bool) ApiTenancyTenantGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiTenancyTenantGroupsListRequest) IdGt(idGt []int32) ApiTenancyTenantGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiTenancyTenantGroupsListRequest) IdGte(idGte []int32) ApiTenancyTenantGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiTenancyTenantGroupsListRequest) IdLt(idLt []int32) ApiTenancyTenantGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiTenancyTenantGroupsListRequest) IdLte(idLte []int32) ApiTenancyTenantGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiTenancyTenantGroupsListRequest) IdN(idN []int32) ApiTenancyTenantGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiTenancyTenantGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiTenancyTenantGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiTenancyTenantGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiTenancyTenantGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiTenancyTenantGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiTenancyTenantGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiTenancyTenantGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiTenancyTenantGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiTenancyTenantGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiTenancyTenantGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiTenancyTenantGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiTenancyTenantGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiTenancyTenantGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiTenancyTenantGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiTenancyTenantGroupsListRequest) Limit(limit int32) ApiTenancyTenantGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiTenancyTenantGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiTenancyTenantGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiTenancyTenantGroupsListRequest) Name(name []string) ApiTenancyTenantGroupsListRequest { + r.name = &name + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameEmpty(nameEmpty bool) ApiTenancyTenantGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameIc(nameIc []string) ApiTenancyTenantGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameIe(nameIe []string) ApiTenancyTenantGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameIew(nameIew []string) ApiTenancyTenantGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameIsw(nameIsw []string) ApiTenancyTenantGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameN(nameN []string) ApiTenancyTenantGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameNic(nameNic []string) ApiTenancyTenantGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameNie(nameNie []string) ApiTenancyTenantGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameNiew(nameNiew []string) ApiTenancyTenantGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiTenancyTenantGroupsListRequest) NameNisw(nameNisw []string) ApiTenancyTenantGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiTenancyTenantGroupsListRequest) Offset(offset int32) ApiTenancyTenantGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiTenancyTenantGroupsListRequest) Ordering(ordering string) ApiTenancyTenantGroupsListRequest { + r.ordering = &ordering + return r +} + +// Tenant group (slug) +func (r ApiTenancyTenantGroupsListRequest) Parent(parent []string) ApiTenancyTenantGroupsListRequest { + r.parent = &parent + return r +} + +// Tenant group (slug) +func (r ApiTenancyTenantGroupsListRequest) ParentN(parentN []string) ApiTenancyTenantGroupsListRequest { + r.parentN = &parentN + return r +} + +// Tenant group (ID) +func (r ApiTenancyTenantGroupsListRequest) ParentId(parentId []*int32) ApiTenancyTenantGroupsListRequest { + r.parentId = &parentId + return r +} + +// Tenant group (ID) +func (r ApiTenancyTenantGroupsListRequest) ParentIdN(parentIdN []*int32) ApiTenancyTenantGroupsListRequest { + r.parentIdN = &parentIdN + return r +} + +// Search +func (r ApiTenancyTenantGroupsListRequest) Q(q string) ApiTenancyTenantGroupsListRequest { + r.q = &q + return r +} + +func (r ApiTenancyTenantGroupsListRequest) Slug(slug []string) ApiTenancyTenantGroupsListRequest { + r.slug = &slug + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugEmpty(slugEmpty bool) ApiTenancyTenantGroupsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugIc(slugIc []string) ApiTenancyTenantGroupsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugIe(slugIe []string) ApiTenancyTenantGroupsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugIew(slugIew []string) ApiTenancyTenantGroupsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugIsw(slugIsw []string) ApiTenancyTenantGroupsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugN(slugN []string) ApiTenancyTenantGroupsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugNic(slugNic []string) ApiTenancyTenantGroupsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugNie(slugNie []string) ApiTenancyTenantGroupsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugNiew(slugNiew []string) ApiTenancyTenantGroupsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiTenancyTenantGroupsListRequest) SlugNisw(slugNisw []string) ApiTenancyTenantGroupsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiTenancyTenantGroupsListRequest) Tag(tag []string) ApiTenancyTenantGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiTenancyTenantGroupsListRequest) TagN(tagN []string) ApiTenancyTenantGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiTenancyTenantGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiTenancyTenantGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiTenancyTenantGroupsListRequest) Execute() (*PaginatedTenantGroupList, *http.Response, error) { + return r.ApiService.TenancyTenantGroupsListExecute(r) +} + +/* +TenancyTenantGroupsList Method for TenancyTenantGroupsList + +Get a list of tenant group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantGroupsListRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsList(ctx context.Context) ApiTenancyTenantGroupsListRequest { + return ApiTenancyTenantGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTenantGroupList +func (a *TenancyAPIService) TenancyTenantGroupsListExecute(r ApiTenancyTenantGroupsListRequest) (*PaginatedTenantGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTenantGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.parentN != nil { + t := *r.parentN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", t, "multi") + } + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + patchedWritableTenantGroupRequest *PatchedWritableTenantGroupRequest +} + +func (r ApiTenancyTenantGroupsPartialUpdateRequest) PatchedWritableTenantGroupRequest(patchedWritableTenantGroupRequest PatchedWritableTenantGroupRequest) ApiTenancyTenantGroupsPartialUpdateRequest { + r.patchedWritableTenantGroupRequest = &patchedWritableTenantGroupRequest + return r +} + +func (r ApiTenancyTenantGroupsPartialUpdateRequest) Execute() (*TenantGroup, *http.Response, error) { + return r.ApiService.TenancyTenantGroupsPartialUpdateExecute(r) +} + +/* +TenancyTenantGroupsPartialUpdate Method for TenancyTenantGroupsPartialUpdate + +Patch a tenant group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant group. + @return ApiTenancyTenantGroupsPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsPartialUpdate(ctx context.Context, id int32) ApiTenancyTenantGroupsPartialUpdateRequest { + return ApiTenancyTenantGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TenantGroup +func (a *TenancyAPIService) TenancyTenantGroupsPartialUpdateExecute(r ApiTenancyTenantGroupsPartialUpdateRequest) (*TenantGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TenantGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableTenantGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsRetrieveRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyTenantGroupsRetrieveRequest) Execute() (*TenantGroup, *http.Response, error) { + return r.ApiService.TenancyTenantGroupsRetrieveExecute(r) +} + +/* +TenancyTenantGroupsRetrieve Method for TenancyTenantGroupsRetrieve + +Get a tenant group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant group. + @return ApiTenancyTenantGroupsRetrieveRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsRetrieve(ctx context.Context, id int32) ApiTenancyTenantGroupsRetrieveRequest { + return ApiTenancyTenantGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TenantGroup +func (a *TenancyAPIService) TenancyTenantGroupsRetrieveExecute(r ApiTenancyTenantGroupsRetrieveRequest) (*TenantGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TenantGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantGroupsUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + writableTenantGroupRequest *WritableTenantGroupRequest +} + +func (r ApiTenancyTenantGroupsUpdateRequest) WritableTenantGroupRequest(writableTenantGroupRequest WritableTenantGroupRequest) ApiTenancyTenantGroupsUpdateRequest { + r.writableTenantGroupRequest = &writableTenantGroupRequest + return r +} + +func (r ApiTenancyTenantGroupsUpdateRequest) Execute() (*TenantGroup, *http.Response, error) { + return r.ApiService.TenancyTenantGroupsUpdateExecute(r) +} + +/* +TenancyTenantGroupsUpdate Method for TenancyTenantGroupsUpdate + +Put a tenant group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant group. + @return ApiTenancyTenantGroupsUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantGroupsUpdate(ctx context.Context, id int32) ApiTenancyTenantGroupsUpdateRequest { + return ApiTenancyTenantGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TenantGroup +func (a *TenancyAPIService) TenancyTenantGroupsUpdateExecute(r ApiTenancyTenantGroupsUpdateRequest) (*TenantGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TenantGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenant-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTenantGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableTenantGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTenantGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantsBulkDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + tenantRequest *[]TenantRequest +} + +func (r ApiTenancyTenantsBulkDestroyRequest) TenantRequest(tenantRequest []TenantRequest) ApiTenancyTenantsBulkDestroyRequest { + r.tenantRequest = &tenantRequest + return r +} + +func (r ApiTenancyTenantsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyTenantsBulkDestroyExecute(r) +} + +/* +TenancyTenantsBulkDestroy Method for TenancyTenantsBulkDestroy + +Delete a list of tenant objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantsBulkDestroyRequest +*/ +func (a *TenancyAPIService) TenancyTenantsBulkDestroy(ctx context.Context) ApiTenancyTenantsBulkDestroyRequest { + return ApiTenancyTenantsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyTenantsBulkDestroyExecute(r ApiTenancyTenantsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantRequest == nil { + return nil, reportError("tenantRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyTenantsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + tenantRequest *[]TenantRequest +} + +func (r ApiTenancyTenantsBulkPartialUpdateRequest) TenantRequest(tenantRequest []TenantRequest) ApiTenancyTenantsBulkPartialUpdateRequest { + r.tenantRequest = &tenantRequest + return r +} + +func (r ApiTenancyTenantsBulkPartialUpdateRequest) Execute() ([]Tenant, *http.Response, error) { + return r.ApiService.TenancyTenantsBulkPartialUpdateExecute(r) +} + +/* +TenancyTenantsBulkPartialUpdate Method for TenancyTenantsBulkPartialUpdate + +Patch a list of tenant objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantsBulkPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantsBulkPartialUpdate(ctx context.Context) ApiTenancyTenantsBulkPartialUpdateRequest { + return ApiTenancyTenantsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Tenant +func (a *TenancyAPIService) TenancyTenantsBulkPartialUpdateExecute(r ApiTenancyTenantsBulkPartialUpdateRequest) ([]Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantRequest == nil { + return localVarReturnValue, nil, reportError("tenantRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantsBulkUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + tenantRequest *[]TenantRequest +} + +func (r ApiTenancyTenantsBulkUpdateRequest) TenantRequest(tenantRequest []TenantRequest) ApiTenancyTenantsBulkUpdateRequest { + r.tenantRequest = &tenantRequest + return r +} + +func (r ApiTenancyTenantsBulkUpdateRequest) Execute() ([]Tenant, *http.Response, error) { + return r.ApiService.TenancyTenantsBulkUpdateExecute(r) +} + +/* +TenancyTenantsBulkUpdate Method for TenancyTenantsBulkUpdate + +Put a list of tenant objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantsBulkUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantsBulkUpdate(ctx context.Context) ApiTenancyTenantsBulkUpdateRequest { + return ApiTenancyTenantsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Tenant +func (a *TenancyAPIService) TenancyTenantsBulkUpdateExecute(r ApiTenancyTenantsBulkUpdateRequest) ([]Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantRequest == nil { + return localVarReturnValue, nil, reportError("tenantRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantsCreateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + writableTenantRequest *WritableTenantRequest +} + +func (r ApiTenancyTenantsCreateRequest) WritableTenantRequest(writableTenantRequest WritableTenantRequest) ApiTenancyTenantsCreateRequest { + r.writableTenantRequest = &writableTenantRequest + return r +} + +func (r ApiTenancyTenantsCreateRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenancyTenantsCreateExecute(r) +} + +/* +TenancyTenantsCreate Method for TenancyTenantsCreate + +Post a list of tenant objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantsCreateRequest +*/ +func (a *TenancyAPIService) TenancyTenantsCreate(ctx context.Context) ApiTenancyTenantsCreateRequest { + return ApiTenancyTenantsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenancyAPIService) TenancyTenantsCreateExecute(r ApiTenancyTenantsCreateRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTenantRequest == nil { + return localVarReturnValue, nil, reportError("writableTenantRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTenantRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantsDestroyRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyTenantsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenancyTenantsDestroyExecute(r) +} + +/* +TenancyTenantsDestroy Method for TenancyTenantsDestroy + +Delete a tenant object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant. + @return ApiTenancyTenantsDestroyRequest +*/ +func (a *TenancyAPIService) TenancyTenantsDestroy(ctx context.Context, id int32) ApiTenancyTenantsDestroyRequest { + return ApiTenancyTenantsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TenancyAPIService) TenancyTenantsDestroyExecute(r ApiTenancyTenantsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenancyTenantsListRequest struct { + ctx context.Context + ApiService *TenancyAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + group *[]int32 + groupN *[]int32 + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Contact +func (r ApiTenancyTenantsListRequest) Contact(contact []int32) ApiTenancyTenantsListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiTenancyTenantsListRequest) ContactN(contactN []int32) ApiTenancyTenantsListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiTenancyTenantsListRequest) ContactGroup(contactGroup []int32) ApiTenancyTenantsListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiTenancyTenantsListRequest) ContactGroupN(contactGroupN []int32) ApiTenancyTenantsListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiTenancyTenantsListRequest) ContactRole(contactRole []int32) ApiTenancyTenantsListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiTenancyTenantsListRequest) ContactRoleN(contactRoleN []int32) ApiTenancyTenantsListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiTenancyTenantsListRequest) Created(created []time.Time) ApiTenancyTenantsListRequest { + r.created = &created + return r +} + +func (r ApiTenancyTenantsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiTenancyTenantsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiTenancyTenantsListRequest) CreatedGt(createdGt []time.Time) ApiTenancyTenantsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiTenancyTenantsListRequest) CreatedGte(createdGte []time.Time) ApiTenancyTenantsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiTenancyTenantsListRequest) CreatedLt(createdLt []time.Time) ApiTenancyTenantsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiTenancyTenantsListRequest) CreatedLte(createdLte []time.Time) ApiTenancyTenantsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiTenancyTenantsListRequest) CreatedN(createdN []time.Time) ApiTenancyTenantsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiTenancyTenantsListRequest) CreatedByRequest(createdByRequest string) ApiTenancyTenantsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiTenancyTenantsListRequest) Description(description []string) ApiTenancyTenantsListRequest { + r.description = &description + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiTenancyTenantsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionIc(descriptionIc []string) ApiTenancyTenantsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionIe(descriptionIe []string) ApiTenancyTenantsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionIew(descriptionIew []string) ApiTenancyTenantsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionIsw(descriptionIsw []string) ApiTenancyTenantsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionN(descriptionN []string) ApiTenancyTenantsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionNic(descriptionNic []string) ApiTenancyTenantsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionNie(descriptionNie []string) ApiTenancyTenantsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionNiew(descriptionNiew []string) ApiTenancyTenantsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiTenancyTenantsListRequest) DescriptionNisw(descriptionNisw []string) ApiTenancyTenantsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Tenant group (slug) +func (r ApiTenancyTenantsListRequest) Group(group []int32) ApiTenancyTenantsListRequest { + r.group = &group + return r +} + +// Tenant group (slug) +func (r ApiTenancyTenantsListRequest) GroupN(groupN []int32) ApiTenancyTenantsListRequest { + r.groupN = &groupN + return r +} + +// Tenant group (ID) +func (r ApiTenancyTenantsListRequest) GroupId(groupId []int32) ApiTenancyTenantsListRequest { + r.groupId = &groupId + return r +} + +// Tenant group (ID) +func (r ApiTenancyTenantsListRequest) GroupIdN(groupIdN []int32) ApiTenancyTenantsListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiTenancyTenantsListRequest) Id(id []int32) ApiTenancyTenantsListRequest { + r.id = &id + return r +} + +func (r ApiTenancyTenantsListRequest) IdEmpty(idEmpty bool) ApiTenancyTenantsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiTenancyTenantsListRequest) IdGt(idGt []int32) ApiTenancyTenantsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiTenancyTenantsListRequest) IdGte(idGte []int32) ApiTenancyTenantsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiTenancyTenantsListRequest) IdLt(idLt []int32) ApiTenancyTenantsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiTenancyTenantsListRequest) IdLte(idLte []int32) ApiTenancyTenantsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiTenancyTenantsListRequest) IdN(idN []int32) ApiTenancyTenantsListRequest { + r.idN = &idN + return r +} + +func (r ApiTenancyTenantsListRequest) LastUpdated(lastUpdated []time.Time) ApiTenancyTenantsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiTenancyTenantsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiTenancyTenantsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiTenancyTenantsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiTenancyTenantsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiTenancyTenantsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiTenancyTenantsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiTenancyTenantsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiTenancyTenantsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiTenancyTenantsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiTenancyTenantsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiTenancyTenantsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiTenancyTenantsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiTenancyTenantsListRequest) Limit(limit int32) ApiTenancyTenantsListRequest { + r.limit = &limit + return r +} + +func (r ApiTenancyTenantsListRequest) ModifiedByRequest(modifiedByRequest string) ApiTenancyTenantsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiTenancyTenantsListRequest) Name(name []string) ApiTenancyTenantsListRequest { + r.name = &name + return r +} + +func (r ApiTenancyTenantsListRequest) NameEmpty(nameEmpty bool) ApiTenancyTenantsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiTenancyTenantsListRequest) NameIc(nameIc []string) ApiTenancyTenantsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiTenancyTenantsListRequest) NameIe(nameIe []string) ApiTenancyTenantsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiTenancyTenantsListRequest) NameIew(nameIew []string) ApiTenancyTenantsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiTenancyTenantsListRequest) NameIsw(nameIsw []string) ApiTenancyTenantsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiTenancyTenantsListRequest) NameN(nameN []string) ApiTenancyTenantsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiTenancyTenantsListRequest) NameNic(nameNic []string) ApiTenancyTenantsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiTenancyTenantsListRequest) NameNie(nameNie []string) ApiTenancyTenantsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiTenancyTenantsListRequest) NameNiew(nameNiew []string) ApiTenancyTenantsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiTenancyTenantsListRequest) NameNisw(nameNisw []string) ApiTenancyTenantsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiTenancyTenantsListRequest) Offset(offset int32) ApiTenancyTenantsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiTenancyTenantsListRequest) Ordering(ordering string) ApiTenancyTenantsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiTenancyTenantsListRequest) Q(q string) ApiTenancyTenantsListRequest { + r.q = &q + return r +} + +func (r ApiTenancyTenantsListRequest) Slug(slug []string) ApiTenancyTenantsListRequest { + r.slug = &slug + return r +} + +func (r ApiTenancyTenantsListRequest) SlugEmpty(slugEmpty bool) ApiTenancyTenantsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiTenancyTenantsListRequest) SlugIc(slugIc []string) ApiTenancyTenantsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiTenancyTenantsListRequest) SlugIe(slugIe []string) ApiTenancyTenantsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiTenancyTenantsListRequest) SlugIew(slugIew []string) ApiTenancyTenantsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiTenancyTenantsListRequest) SlugIsw(slugIsw []string) ApiTenancyTenantsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiTenancyTenantsListRequest) SlugN(slugN []string) ApiTenancyTenantsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiTenancyTenantsListRequest) SlugNic(slugNic []string) ApiTenancyTenantsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiTenancyTenantsListRequest) SlugNie(slugNie []string) ApiTenancyTenantsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiTenancyTenantsListRequest) SlugNiew(slugNiew []string) ApiTenancyTenantsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiTenancyTenantsListRequest) SlugNisw(slugNisw []string) ApiTenancyTenantsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiTenancyTenantsListRequest) Tag(tag []string) ApiTenancyTenantsListRequest { + r.tag = &tag + return r +} + +func (r ApiTenancyTenantsListRequest) TagN(tagN []string) ApiTenancyTenantsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiTenancyTenantsListRequest) UpdatedByRequest(updatedByRequest string) ApiTenancyTenantsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiTenancyTenantsListRequest) Execute() (*PaginatedTenantList, *http.Response, error) { + return r.ApiService.TenancyTenantsListExecute(r) +} + +/* +TenancyTenantsList Method for TenancyTenantsList + +Get a list of tenant objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenancyTenantsListRequest +*/ +func (a *TenancyAPIService) TenancyTenantsList(ctx context.Context) ApiTenancyTenantsListRequest { + return ApiTenancyTenantsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTenantList +func (a *TenancyAPIService) TenancyTenantsListExecute(r ApiTenancyTenantsListRequest) (*PaginatedTenantList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTenantList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantsPartialUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + patchedWritableTenantRequest *PatchedWritableTenantRequest +} + +func (r ApiTenancyTenantsPartialUpdateRequest) PatchedWritableTenantRequest(patchedWritableTenantRequest PatchedWritableTenantRequest) ApiTenancyTenantsPartialUpdateRequest { + r.patchedWritableTenantRequest = &patchedWritableTenantRequest + return r +} + +func (r ApiTenancyTenantsPartialUpdateRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenancyTenantsPartialUpdateExecute(r) +} + +/* +TenancyTenantsPartialUpdate Method for TenancyTenantsPartialUpdate + +Patch a tenant object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant. + @return ApiTenancyTenantsPartialUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantsPartialUpdate(ctx context.Context, id int32) ApiTenancyTenantsPartialUpdateRequest { + return ApiTenancyTenantsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenancyAPIService) TenancyTenantsPartialUpdateExecute(r ApiTenancyTenantsPartialUpdateRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableTenantRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantsRetrieveRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 +} + +func (r ApiTenancyTenantsRetrieveRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenancyTenantsRetrieveExecute(r) +} + +/* +TenancyTenantsRetrieve Method for TenancyTenantsRetrieve + +Get a tenant object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant. + @return ApiTenancyTenantsRetrieveRequest +*/ +func (a *TenancyAPIService) TenancyTenantsRetrieve(ctx context.Context, id int32) ApiTenancyTenantsRetrieveRequest { + return ApiTenancyTenantsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenancyAPIService) TenancyTenantsRetrieveExecute(r ApiTenancyTenantsRetrieveRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenancyTenantsUpdateRequest struct { + ctx context.Context + ApiService *TenancyAPIService + id int32 + writableTenantRequest *WritableTenantRequest +} + +func (r ApiTenancyTenantsUpdateRequest) WritableTenantRequest(writableTenantRequest WritableTenantRequest) ApiTenancyTenantsUpdateRequest { + r.writableTenantRequest = &writableTenantRequest + return r +} + +func (r ApiTenancyTenantsUpdateRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenancyTenantsUpdateExecute(r) +} + +/* +TenancyTenantsUpdate Method for TenancyTenantsUpdate + +Put a tenant object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tenant. + @return ApiTenancyTenantsUpdateRequest +*/ +func (a *TenancyAPIService) TenancyTenantsUpdate(ctx context.Context, id int32) ApiTenancyTenantsUpdateRequest { + return ApiTenancyTenantsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenancyAPIService) TenancyTenantsUpdateExecute(r ApiTenancyTenantsUpdateRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenancyAPIService.TenancyTenantsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/tenancy/tenants/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTenantRequest == nil { + return localVarReturnValue, nil, reportError("writableTenantRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTenantRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_users.go b/vendor/github.com/netbox-community/go-netbox/v3/api_users.go new file mode 100644 index 00000000..9c099267 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_users.go @@ -0,0 +1,7270 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// UsersAPIService UsersAPI service +type UsersAPIService service + +type ApiUsersConfigRetrieveRequest struct { + ctx context.Context + ApiService *UsersAPIService +} + +func (r ApiUsersConfigRetrieveRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.UsersConfigRetrieveExecute(r) +} + +/* +UsersConfigRetrieve Method for UsersConfigRetrieve + +An API endpoint via which a user can update his or her own UserConfig data (but no one else's). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersConfigRetrieveRequest +*/ +func (a *UsersAPIService) UsersConfigRetrieve(ctx context.Context) ApiUsersConfigRetrieveRequest { + return ApiUsersConfigRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *UsersAPIService) UsersConfigRetrieveExecute(r ApiUsersConfigRetrieveRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersConfigRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/config/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + groupRequest *[]GroupRequest +} + +func (r ApiUsersGroupsBulkDestroyRequest) GroupRequest(groupRequest []GroupRequest) ApiUsersGroupsBulkDestroyRequest { + r.groupRequest = &groupRequest + return r +} + +func (r ApiUsersGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersGroupsBulkDestroyExecute(r) +} + +/* +UsersGroupsBulkDestroy Method for UsersGroupsBulkDestroy + +Delete a list of group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersGroupsBulkDestroyRequest +*/ +func (a *UsersAPIService) UsersGroupsBulkDestroy(ctx context.Context) ApiUsersGroupsBulkDestroyRequest { + return ApiUsersGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersGroupsBulkDestroyExecute(r ApiUsersGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupRequest == nil { + return nil, reportError("groupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + groupRequest *[]GroupRequest +} + +func (r ApiUsersGroupsBulkPartialUpdateRequest) GroupRequest(groupRequest []GroupRequest) ApiUsersGroupsBulkPartialUpdateRequest { + r.groupRequest = &groupRequest + return r +} + +func (r ApiUsersGroupsBulkPartialUpdateRequest) Execute() ([]Group, *http.Response, error) { + return r.ApiService.UsersGroupsBulkPartialUpdateExecute(r) +} + +/* +UsersGroupsBulkPartialUpdate Method for UsersGroupsBulkPartialUpdate + +Patch a list of group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersGroupsBulkPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersGroupsBulkPartialUpdate(ctx context.Context) ApiUsersGroupsBulkPartialUpdateRequest { + return ApiUsersGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Group +func (a *UsersAPIService) UsersGroupsBulkPartialUpdateExecute(r ApiUsersGroupsBulkPartialUpdateRequest) ([]Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupRequest == nil { + return localVarReturnValue, nil, reportError("groupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + groupRequest *[]GroupRequest +} + +func (r ApiUsersGroupsBulkUpdateRequest) GroupRequest(groupRequest []GroupRequest) ApiUsersGroupsBulkUpdateRequest { + r.groupRequest = &groupRequest + return r +} + +func (r ApiUsersGroupsBulkUpdateRequest) Execute() ([]Group, *http.Response, error) { + return r.ApiService.UsersGroupsBulkUpdateExecute(r) +} + +/* +UsersGroupsBulkUpdate Method for UsersGroupsBulkUpdate + +Put a list of group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersGroupsBulkUpdateRequest +*/ +func (a *UsersAPIService) UsersGroupsBulkUpdate(ctx context.Context) ApiUsersGroupsBulkUpdateRequest { + return ApiUsersGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Group +func (a *UsersAPIService) UsersGroupsBulkUpdateExecute(r ApiUsersGroupsBulkUpdateRequest) ([]Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupRequest == nil { + return localVarReturnValue, nil, reportError("groupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersGroupsCreateRequest struct { + ctx context.Context + ApiService *UsersAPIService + groupRequest *GroupRequest +} + +func (r ApiUsersGroupsCreateRequest) GroupRequest(groupRequest GroupRequest) ApiUsersGroupsCreateRequest { + r.groupRequest = &groupRequest + return r +} + +func (r ApiUsersGroupsCreateRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.UsersGroupsCreateExecute(r) +} + +/* +UsersGroupsCreate Method for UsersGroupsCreate + +Post a list of group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersGroupsCreateRequest +*/ +func (a *UsersAPIService) UsersGroupsCreate(ctx context.Context) ApiUsersGroupsCreateRequest { + return ApiUsersGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Group +func (a *UsersAPIService) UsersGroupsCreateExecute(r ApiUsersGroupsCreateRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupRequest == nil { + return localVarReturnValue, nil, reportError("groupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersGroupsDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersGroupsDestroyExecute(r) +} + +/* +UsersGroupsDestroy Method for UsersGroupsDestroy + +Delete a group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group. + @return ApiUsersGroupsDestroyRequest +*/ +func (a *UsersAPIService) UsersGroupsDestroy(ctx context.Context, id int32) ApiUsersGroupsDestroyRequest { + return ApiUsersGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersGroupsDestroyExecute(r ApiUsersGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersGroupsListRequest struct { + ctx context.Context + ApiService *UsersAPIService + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string +} + +func (r ApiUsersGroupsListRequest) Id(id []int32) ApiUsersGroupsListRequest { + r.id = &id + return r +} + +func (r ApiUsersGroupsListRequest) IdEmpty(idEmpty bool) ApiUsersGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiUsersGroupsListRequest) IdGt(idGt []int32) ApiUsersGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiUsersGroupsListRequest) IdGte(idGte []int32) ApiUsersGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiUsersGroupsListRequest) IdLt(idLt []int32) ApiUsersGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiUsersGroupsListRequest) IdLte(idLte []int32) ApiUsersGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiUsersGroupsListRequest) IdN(idN []int32) ApiUsersGroupsListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiUsersGroupsListRequest) Limit(limit int32) ApiUsersGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiUsersGroupsListRequest) Name(name []string) ApiUsersGroupsListRequest { + r.name = &name + return r +} + +func (r ApiUsersGroupsListRequest) NameEmpty(nameEmpty bool) ApiUsersGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiUsersGroupsListRequest) NameIc(nameIc []string) ApiUsersGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiUsersGroupsListRequest) NameIe(nameIe []string) ApiUsersGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiUsersGroupsListRequest) NameIew(nameIew []string) ApiUsersGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiUsersGroupsListRequest) NameIsw(nameIsw []string) ApiUsersGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiUsersGroupsListRequest) NameN(nameN []string) ApiUsersGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiUsersGroupsListRequest) NameNic(nameNic []string) ApiUsersGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiUsersGroupsListRequest) NameNie(nameNie []string) ApiUsersGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiUsersGroupsListRequest) NameNiew(nameNiew []string) ApiUsersGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiUsersGroupsListRequest) NameNisw(nameNisw []string) ApiUsersGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiUsersGroupsListRequest) Offset(offset int32) ApiUsersGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiUsersGroupsListRequest) Ordering(ordering string) ApiUsersGroupsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiUsersGroupsListRequest) Q(q string) ApiUsersGroupsListRequest { + r.q = &q + return r +} + +func (r ApiUsersGroupsListRequest) Execute() (*PaginatedGroupList, *http.Response, error) { + return r.ApiService.UsersGroupsListExecute(r) +} + +/* +UsersGroupsList Method for UsersGroupsList + +Get a list of group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersGroupsListRequest +*/ +func (a *UsersAPIService) UsersGroupsList(ctx context.Context) ApiUsersGroupsListRequest { + return ApiUsersGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupList +func (a *UsersAPIService) UsersGroupsListExecute(r ApiUsersGroupsListRequest) (*PaginatedGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + patchedGroupRequest *PatchedGroupRequest +} + +func (r ApiUsersGroupsPartialUpdateRequest) PatchedGroupRequest(patchedGroupRequest PatchedGroupRequest) ApiUsersGroupsPartialUpdateRequest { + r.patchedGroupRequest = &patchedGroupRequest + return r +} + +func (r ApiUsersGroupsPartialUpdateRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.UsersGroupsPartialUpdateExecute(r) +} + +/* +UsersGroupsPartialUpdate Method for UsersGroupsPartialUpdate + +Patch a group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group. + @return ApiUsersGroupsPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersGroupsPartialUpdate(ctx context.Context, id int32) ApiUsersGroupsPartialUpdateRequest { + return ApiUsersGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Group +func (a *UsersAPIService) UsersGroupsPartialUpdateExecute(r ApiUsersGroupsPartialUpdateRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersGroupsRetrieveRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersGroupsRetrieveRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.UsersGroupsRetrieveExecute(r) +} + +/* +UsersGroupsRetrieve Method for UsersGroupsRetrieve + +Get a group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group. + @return ApiUsersGroupsRetrieveRequest +*/ +func (a *UsersAPIService) UsersGroupsRetrieve(ctx context.Context, id int32) ApiUsersGroupsRetrieveRequest { + return ApiUsersGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Group +func (a *UsersAPIService) UsersGroupsRetrieveExecute(r ApiUsersGroupsRetrieveRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersGroupsUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + groupRequest *GroupRequest +} + +func (r ApiUsersGroupsUpdateRequest) GroupRequest(groupRequest GroupRequest) ApiUsersGroupsUpdateRequest { + r.groupRequest = &groupRequest + return r +} + +func (r ApiUsersGroupsUpdateRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.UsersGroupsUpdateExecute(r) +} + +/* +UsersGroupsUpdate Method for UsersGroupsUpdate + +Put a group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group. + @return ApiUsersGroupsUpdateRequest +*/ +func (a *UsersAPIService) UsersGroupsUpdate(ctx context.Context, id int32) ApiUsersGroupsUpdateRequest { + return ApiUsersGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Group +func (a *UsersAPIService) UsersGroupsUpdateExecute(r ApiUsersGroupsUpdateRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupRequest == nil { + return localVarReturnValue, nil, reportError("groupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersPermissionsBulkDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + objectPermissionRequest *[]ObjectPermissionRequest +} + +func (r ApiUsersPermissionsBulkDestroyRequest) ObjectPermissionRequest(objectPermissionRequest []ObjectPermissionRequest) ApiUsersPermissionsBulkDestroyRequest { + r.objectPermissionRequest = &objectPermissionRequest + return r +} + +func (r ApiUsersPermissionsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersPermissionsBulkDestroyExecute(r) +} + +/* +UsersPermissionsBulkDestroy Method for UsersPermissionsBulkDestroy + +Delete a list of permission objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersPermissionsBulkDestroyRequest +*/ +func (a *UsersAPIService) UsersPermissionsBulkDestroy(ctx context.Context) ApiUsersPermissionsBulkDestroyRequest { + return ApiUsersPermissionsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersPermissionsBulkDestroyExecute(r ApiUsersPermissionsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.objectPermissionRequest == nil { + return nil, reportError("objectPermissionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.objectPermissionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersPermissionsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + objectPermissionRequest *[]ObjectPermissionRequest +} + +func (r ApiUsersPermissionsBulkPartialUpdateRequest) ObjectPermissionRequest(objectPermissionRequest []ObjectPermissionRequest) ApiUsersPermissionsBulkPartialUpdateRequest { + r.objectPermissionRequest = &objectPermissionRequest + return r +} + +func (r ApiUsersPermissionsBulkPartialUpdateRequest) Execute() ([]ObjectPermission, *http.Response, error) { + return r.ApiService.UsersPermissionsBulkPartialUpdateExecute(r) +} + +/* +UsersPermissionsBulkPartialUpdate Method for UsersPermissionsBulkPartialUpdate + +Patch a list of permission objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersPermissionsBulkPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersPermissionsBulkPartialUpdate(ctx context.Context) ApiUsersPermissionsBulkPartialUpdateRequest { + return ApiUsersPermissionsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ObjectPermission +func (a *UsersAPIService) UsersPermissionsBulkPartialUpdateExecute(r ApiUsersPermissionsBulkPartialUpdateRequest) ([]ObjectPermission, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ObjectPermission + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.objectPermissionRequest == nil { + return localVarReturnValue, nil, reportError("objectPermissionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.objectPermissionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersPermissionsBulkUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + objectPermissionRequest *[]ObjectPermissionRequest +} + +func (r ApiUsersPermissionsBulkUpdateRequest) ObjectPermissionRequest(objectPermissionRequest []ObjectPermissionRequest) ApiUsersPermissionsBulkUpdateRequest { + r.objectPermissionRequest = &objectPermissionRequest + return r +} + +func (r ApiUsersPermissionsBulkUpdateRequest) Execute() ([]ObjectPermission, *http.Response, error) { + return r.ApiService.UsersPermissionsBulkUpdateExecute(r) +} + +/* +UsersPermissionsBulkUpdate Method for UsersPermissionsBulkUpdate + +Put a list of permission objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersPermissionsBulkUpdateRequest +*/ +func (a *UsersAPIService) UsersPermissionsBulkUpdate(ctx context.Context) ApiUsersPermissionsBulkUpdateRequest { + return ApiUsersPermissionsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ObjectPermission +func (a *UsersAPIService) UsersPermissionsBulkUpdateExecute(r ApiUsersPermissionsBulkUpdateRequest) ([]ObjectPermission, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ObjectPermission + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.objectPermissionRequest == nil { + return localVarReturnValue, nil, reportError("objectPermissionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.objectPermissionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersPermissionsCreateRequest struct { + ctx context.Context + ApiService *UsersAPIService + writableObjectPermissionRequest *WritableObjectPermissionRequest +} + +func (r ApiUsersPermissionsCreateRequest) WritableObjectPermissionRequest(writableObjectPermissionRequest WritableObjectPermissionRequest) ApiUsersPermissionsCreateRequest { + r.writableObjectPermissionRequest = &writableObjectPermissionRequest + return r +} + +func (r ApiUsersPermissionsCreateRequest) Execute() (*ObjectPermission, *http.Response, error) { + return r.ApiService.UsersPermissionsCreateExecute(r) +} + +/* +UsersPermissionsCreate Method for UsersPermissionsCreate + +Post a list of permission objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersPermissionsCreateRequest +*/ +func (a *UsersAPIService) UsersPermissionsCreate(ctx context.Context) ApiUsersPermissionsCreateRequest { + return ApiUsersPermissionsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ObjectPermission +func (a *UsersAPIService) UsersPermissionsCreateExecute(r ApiUsersPermissionsCreateRequest) (*ObjectPermission, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ObjectPermission + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableObjectPermissionRequest == nil { + return localVarReturnValue, nil, reportError("writableObjectPermissionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableObjectPermissionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersPermissionsDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersPermissionsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersPermissionsDestroyExecute(r) +} + +/* +UsersPermissionsDestroy Method for UsersPermissionsDestroy + +Delete a permission object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this permission. + @return ApiUsersPermissionsDestroyRequest +*/ +func (a *UsersAPIService) UsersPermissionsDestroy(ctx context.Context, id int32) ApiUsersPermissionsDestroyRequest { + return ApiUsersPermissionsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersPermissionsDestroyExecute(r ApiUsersPermissionsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersPermissionsListRequest struct { + ctx context.Context + ApiService *UsersAPIService + canAdd *bool + canChange *bool + canDelete *bool + canView *bool + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + enabled *bool + group *[]string + groupN *[]string + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + limit *int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + objectTypes *[]int32 + objectTypesN *[]int32 + offset *int32 + ordering *string + q *string + user *[]string + userN *[]string + userId *[]int32 + userIdN *[]int32 +} + +func (r ApiUsersPermissionsListRequest) CanAdd(canAdd bool) ApiUsersPermissionsListRequest { + r.canAdd = &canAdd + return r +} + +func (r ApiUsersPermissionsListRequest) CanChange(canChange bool) ApiUsersPermissionsListRequest { + r.canChange = &canChange + return r +} + +func (r ApiUsersPermissionsListRequest) CanDelete(canDelete bool) ApiUsersPermissionsListRequest { + r.canDelete = &canDelete + return r +} + +func (r ApiUsersPermissionsListRequest) CanView(canView bool) ApiUsersPermissionsListRequest { + r.canView = &canView + return r +} + +func (r ApiUsersPermissionsListRequest) Description(description []string) ApiUsersPermissionsListRequest { + r.description = &description + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiUsersPermissionsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionIc(descriptionIc []string) ApiUsersPermissionsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionIe(descriptionIe []string) ApiUsersPermissionsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionIew(descriptionIew []string) ApiUsersPermissionsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionIsw(descriptionIsw []string) ApiUsersPermissionsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionN(descriptionN []string) ApiUsersPermissionsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionNic(descriptionNic []string) ApiUsersPermissionsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionNie(descriptionNie []string) ApiUsersPermissionsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionNiew(descriptionNiew []string) ApiUsersPermissionsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiUsersPermissionsListRequest) DescriptionNisw(descriptionNisw []string) ApiUsersPermissionsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiUsersPermissionsListRequest) Enabled(enabled bool) ApiUsersPermissionsListRequest { + r.enabled = &enabled + return r +} + +// Group (name) +func (r ApiUsersPermissionsListRequest) Group(group []string) ApiUsersPermissionsListRequest { + r.group = &group + return r +} + +// Group (name) +func (r ApiUsersPermissionsListRequest) GroupN(groupN []string) ApiUsersPermissionsListRequest { + r.groupN = &groupN + return r +} + +// Group +func (r ApiUsersPermissionsListRequest) GroupId(groupId []int32) ApiUsersPermissionsListRequest { + r.groupId = &groupId + return r +} + +// Group +func (r ApiUsersPermissionsListRequest) GroupIdN(groupIdN []int32) ApiUsersPermissionsListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiUsersPermissionsListRequest) Id(id []int32) ApiUsersPermissionsListRequest { + r.id = &id + return r +} + +func (r ApiUsersPermissionsListRequest) IdEmpty(idEmpty bool) ApiUsersPermissionsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiUsersPermissionsListRequest) IdGt(idGt []int32) ApiUsersPermissionsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiUsersPermissionsListRequest) IdGte(idGte []int32) ApiUsersPermissionsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiUsersPermissionsListRequest) IdLt(idLt []int32) ApiUsersPermissionsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiUsersPermissionsListRequest) IdLte(idLte []int32) ApiUsersPermissionsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiUsersPermissionsListRequest) IdN(idN []int32) ApiUsersPermissionsListRequest { + r.idN = &idN + return r +} + +// Number of results to return per page. +func (r ApiUsersPermissionsListRequest) Limit(limit int32) ApiUsersPermissionsListRequest { + r.limit = &limit + return r +} + +func (r ApiUsersPermissionsListRequest) Name(name []string) ApiUsersPermissionsListRequest { + r.name = &name + return r +} + +func (r ApiUsersPermissionsListRequest) NameEmpty(nameEmpty bool) ApiUsersPermissionsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiUsersPermissionsListRequest) NameIc(nameIc []string) ApiUsersPermissionsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiUsersPermissionsListRequest) NameIe(nameIe []string) ApiUsersPermissionsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiUsersPermissionsListRequest) NameIew(nameIew []string) ApiUsersPermissionsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiUsersPermissionsListRequest) NameIsw(nameIsw []string) ApiUsersPermissionsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiUsersPermissionsListRequest) NameN(nameN []string) ApiUsersPermissionsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiUsersPermissionsListRequest) NameNic(nameNic []string) ApiUsersPermissionsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiUsersPermissionsListRequest) NameNie(nameNie []string) ApiUsersPermissionsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiUsersPermissionsListRequest) NameNiew(nameNiew []string) ApiUsersPermissionsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiUsersPermissionsListRequest) NameNisw(nameNisw []string) ApiUsersPermissionsListRequest { + r.nameNisw = &nameNisw + return r +} + +func (r ApiUsersPermissionsListRequest) ObjectTypes(objectTypes []int32) ApiUsersPermissionsListRequest { + r.objectTypes = &objectTypes + return r +} + +func (r ApiUsersPermissionsListRequest) ObjectTypesN(objectTypesN []int32) ApiUsersPermissionsListRequest { + r.objectTypesN = &objectTypesN + return r +} + +// The initial index from which to return the results. +func (r ApiUsersPermissionsListRequest) Offset(offset int32) ApiUsersPermissionsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiUsersPermissionsListRequest) Ordering(ordering string) ApiUsersPermissionsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiUsersPermissionsListRequest) Q(q string) ApiUsersPermissionsListRequest { + r.q = &q + return r +} + +// User (name) +func (r ApiUsersPermissionsListRequest) User(user []string) ApiUsersPermissionsListRequest { + r.user = &user + return r +} + +// User (name) +func (r ApiUsersPermissionsListRequest) UserN(userN []string) ApiUsersPermissionsListRequest { + r.userN = &userN + return r +} + +// User +func (r ApiUsersPermissionsListRequest) UserId(userId []int32) ApiUsersPermissionsListRequest { + r.userId = &userId + return r +} + +// User +func (r ApiUsersPermissionsListRequest) UserIdN(userIdN []int32) ApiUsersPermissionsListRequest { + r.userIdN = &userIdN + return r +} + +func (r ApiUsersPermissionsListRequest) Execute() (*PaginatedObjectPermissionList, *http.Response, error) { + return r.ApiService.UsersPermissionsListExecute(r) +} + +/* +UsersPermissionsList Method for UsersPermissionsList + +Get a list of permission objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersPermissionsListRequest +*/ +func (a *UsersAPIService) UsersPermissionsList(ctx context.Context) ApiUsersPermissionsListRequest { + return ApiUsersPermissionsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedObjectPermissionList +func (a *UsersAPIService) UsersPermissionsListExecute(r ApiUsersPermissionsListRequest) (*PaginatedObjectPermissionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedObjectPermissionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.canAdd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "can_add", r.canAdd, "") + } + if r.canChange != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "can_change", r.canChange, "") + } + if r.canDelete != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "can_delete", r.canDelete, "") + } + if r.canView != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "can_view", r.canView, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.objectTypes != nil { + t := *r.objectTypes + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types", t, "multi") + } + } + if r.objectTypesN != nil { + t := *r.objectTypesN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_types__n", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.user != nil { + t := *r.user + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", t, "multi") + } + } + if r.userN != nil { + t := *r.userN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", t, "multi") + } + } + if r.userId != nil { + t := *r.userId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", t, "multi") + } + } + if r.userIdN != nil { + t := *r.userIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersPermissionsPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + patchedWritableObjectPermissionRequest *PatchedWritableObjectPermissionRequest +} + +func (r ApiUsersPermissionsPartialUpdateRequest) PatchedWritableObjectPermissionRequest(patchedWritableObjectPermissionRequest PatchedWritableObjectPermissionRequest) ApiUsersPermissionsPartialUpdateRequest { + r.patchedWritableObjectPermissionRequest = &patchedWritableObjectPermissionRequest + return r +} + +func (r ApiUsersPermissionsPartialUpdateRequest) Execute() (*ObjectPermission, *http.Response, error) { + return r.ApiService.UsersPermissionsPartialUpdateExecute(r) +} + +/* +UsersPermissionsPartialUpdate Method for UsersPermissionsPartialUpdate + +Patch a permission object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this permission. + @return ApiUsersPermissionsPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersPermissionsPartialUpdate(ctx context.Context, id int32) ApiUsersPermissionsPartialUpdateRequest { + return ApiUsersPermissionsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ObjectPermission +func (a *UsersAPIService) UsersPermissionsPartialUpdateExecute(r ApiUsersPermissionsPartialUpdateRequest) (*ObjectPermission, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ObjectPermission + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableObjectPermissionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersPermissionsRetrieveRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersPermissionsRetrieveRequest) Execute() (*ObjectPermission, *http.Response, error) { + return r.ApiService.UsersPermissionsRetrieveExecute(r) +} + +/* +UsersPermissionsRetrieve Method for UsersPermissionsRetrieve + +Get a permission object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this permission. + @return ApiUsersPermissionsRetrieveRequest +*/ +func (a *UsersAPIService) UsersPermissionsRetrieve(ctx context.Context, id int32) ApiUsersPermissionsRetrieveRequest { + return ApiUsersPermissionsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ObjectPermission +func (a *UsersAPIService) UsersPermissionsRetrieveExecute(r ApiUsersPermissionsRetrieveRequest) (*ObjectPermission, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ObjectPermission + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersPermissionsUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + writableObjectPermissionRequest *WritableObjectPermissionRequest +} + +func (r ApiUsersPermissionsUpdateRequest) WritableObjectPermissionRequest(writableObjectPermissionRequest WritableObjectPermissionRequest) ApiUsersPermissionsUpdateRequest { + r.writableObjectPermissionRequest = &writableObjectPermissionRequest + return r +} + +func (r ApiUsersPermissionsUpdateRequest) Execute() (*ObjectPermission, *http.Response, error) { + return r.ApiService.UsersPermissionsUpdateExecute(r) +} + +/* +UsersPermissionsUpdate Method for UsersPermissionsUpdate + +Put a permission object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this permission. + @return ApiUsersPermissionsUpdateRequest +*/ +func (a *UsersAPIService) UsersPermissionsUpdate(ctx context.Context, id int32) ApiUsersPermissionsUpdateRequest { + return ApiUsersPermissionsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ObjectPermission +func (a *UsersAPIService) UsersPermissionsUpdateExecute(r ApiUsersPermissionsUpdateRequest) (*ObjectPermission, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ObjectPermission + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersPermissionsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableObjectPermissionRequest == nil { + return localVarReturnValue, nil, reportError("writableObjectPermissionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableObjectPermissionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensBulkDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + tokenRequest *[]TokenRequest +} + +func (r ApiUsersTokensBulkDestroyRequest) TokenRequest(tokenRequest []TokenRequest) ApiUsersTokensBulkDestroyRequest { + r.tokenRequest = &tokenRequest + return r +} + +func (r ApiUsersTokensBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersTokensBulkDestroyExecute(r) +} + +/* +UsersTokensBulkDestroy Method for UsersTokensBulkDestroy + +Delete a list of token objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersTokensBulkDestroyRequest +*/ +func (a *UsersAPIService) UsersTokensBulkDestroy(ctx context.Context) ApiUsersTokensBulkDestroyRequest { + return ApiUsersTokensBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersTokensBulkDestroyExecute(r ApiUsersTokensBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tokenRequest == nil { + return nil, reportError("tokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tokenRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersTokensBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + tokenRequest *[]TokenRequest +} + +func (r ApiUsersTokensBulkPartialUpdateRequest) TokenRequest(tokenRequest []TokenRequest) ApiUsersTokensBulkPartialUpdateRequest { + r.tokenRequest = &tokenRequest + return r +} + +func (r ApiUsersTokensBulkPartialUpdateRequest) Execute() ([]Token, *http.Response, error) { + return r.ApiService.UsersTokensBulkPartialUpdateExecute(r) +} + +/* +UsersTokensBulkPartialUpdate Method for UsersTokensBulkPartialUpdate + +Patch a list of token objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersTokensBulkPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersTokensBulkPartialUpdate(ctx context.Context) ApiUsersTokensBulkPartialUpdateRequest { + return ApiUsersTokensBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Token +func (a *UsersAPIService) UsersTokensBulkPartialUpdateExecute(r ApiUsersTokensBulkPartialUpdateRequest) ([]Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tokenRequest == nil { + return localVarReturnValue, nil, reportError("tokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tokenRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensBulkUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + tokenRequest *[]TokenRequest +} + +func (r ApiUsersTokensBulkUpdateRequest) TokenRequest(tokenRequest []TokenRequest) ApiUsersTokensBulkUpdateRequest { + r.tokenRequest = &tokenRequest + return r +} + +func (r ApiUsersTokensBulkUpdateRequest) Execute() ([]Token, *http.Response, error) { + return r.ApiService.UsersTokensBulkUpdateExecute(r) +} + +/* +UsersTokensBulkUpdate Method for UsersTokensBulkUpdate + +Put a list of token objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersTokensBulkUpdateRequest +*/ +func (a *UsersAPIService) UsersTokensBulkUpdate(ctx context.Context) ApiUsersTokensBulkUpdateRequest { + return ApiUsersTokensBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Token +func (a *UsersAPIService) UsersTokensBulkUpdateExecute(r ApiUsersTokensBulkUpdateRequest) ([]Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tokenRequest == nil { + return localVarReturnValue, nil, reportError("tokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tokenRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensCreateRequest struct { + ctx context.Context + ApiService *UsersAPIService + writableTokenRequest *WritableTokenRequest +} + +func (r ApiUsersTokensCreateRequest) WritableTokenRequest(writableTokenRequest WritableTokenRequest) ApiUsersTokensCreateRequest { + r.writableTokenRequest = &writableTokenRequest + return r +} + +func (r ApiUsersTokensCreateRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.UsersTokensCreateExecute(r) +} + +/* +UsersTokensCreate Method for UsersTokensCreate + +Post a list of token objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersTokensCreateRequest +*/ +func (a *UsersAPIService) UsersTokensCreate(ctx context.Context) ApiUsersTokensCreateRequest { + return ApiUsersTokensCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Token +func (a *UsersAPIService) UsersTokensCreateExecute(r ApiUsersTokensCreateRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTokenRequest == nil { + return localVarReturnValue, nil, reportError("writableTokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTokenRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersTokensDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersTokensDestroyExecute(r) +} + +/* +UsersTokensDestroy Method for UsersTokensDestroy + +Delete a token object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this token. + @return ApiUsersTokensDestroyRequest +*/ +func (a *UsersAPIService) UsersTokensDestroy(ctx context.Context, id int32) ApiUsersTokensDestroyRequest { + return ApiUsersTokensDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersTokensDestroyExecute(r ApiUsersTokensDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersTokensListRequest struct { + ctx context.Context + ApiService *UsersAPIService + created *time.Time + createdGte *time.Time + createdLte *time.Time + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + expires *time.Time + expiresGte *time.Time + expiresLte *time.Time + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + key *[]string + keyEmpty *bool + keyIc *[]string + keyIe *[]string + keyIew *[]string + keyIsw *[]string + keyN *[]string + keyNic *[]string + keyNie *[]string + keyNiew *[]string + keyNisw *[]string + limit *int32 + offset *int32 + ordering *string + q *string + user *[]string + userN *[]string + userId *[]int32 + userIdN *[]int32 + writeEnabled *bool +} + +func (r ApiUsersTokensListRequest) Created(created time.Time) ApiUsersTokensListRequest { + r.created = &created + return r +} + +func (r ApiUsersTokensListRequest) CreatedGte(createdGte time.Time) ApiUsersTokensListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiUsersTokensListRequest) CreatedLte(createdLte time.Time) ApiUsersTokensListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiUsersTokensListRequest) Description(description []string) ApiUsersTokensListRequest { + r.description = &description + return r +} + +func (r ApiUsersTokensListRequest) DescriptionEmpty(descriptionEmpty bool) ApiUsersTokensListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiUsersTokensListRequest) DescriptionIc(descriptionIc []string) ApiUsersTokensListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiUsersTokensListRequest) DescriptionIe(descriptionIe []string) ApiUsersTokensListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiUsersTokensListRequest) DescriptionIew(descriptionIew []string) ApiUsersTokensListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiUsersTokensListRequest) DescriptionIsw(descriptionIsw []string) ApiUsersTokensListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiUsersTokensListRequest) DescriptionN(descriptionN []string) ApiUsersTokensListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiUsersTokensListRequest) DescriptionNic(descriptionNic []string) ApiUsersTokensListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiUsersTokensListRequest) DescriptionNie(descriptionNie []string) ApiUsersTokensListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiUsersTokensListRequest) DescriptionNiew(descriptionNiew []string) ApiUsersTokensListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiUsersTokensListRequest) DescriptionNisw(descriptionNisw []string) ApiUsersTokensListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiUsersTokensListRequest) Expires(expires time.Time) ApiUsersTokensListRequest { + r.expires = &expires + return r +} + +func (r ApiUsersTokensListRequest) ExpiresGte(expiresGte time.Time) ApiUsersTokensListRequest { + r.expiresGte = &expiresGte + return r +} + +func (r ApiUsersTokensListRequest) ExpiresLte(expiresLte time.Time) ApiUsersTokensListRequest { + r.expiresLte = &expiresLte + return r +} + +func (r ApiUsersTokensListRequest) Id(id []int32) ApiUsersTokensListRequest { + r.id = &id + return r +} + +func (r ApiUsersTokensListRequest) IdEmpty(idEmpty bool) ApiUsersTokensListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiUsersTokensListRequest) IdGt(idGt []int32) ApiUsersTokensListRequest { + r.idGt = &idGt + return r +} + +func (r ApiUsersTokensListRequest) IdGte(idGte []int32) ApiUsersTokensListRequest { + r.idGte = &idGte + return r +} + +func (r ApiUsersTokensListRequest) IdLt(idLt []int32) ApiUsersTokensListRequest { + r.idLt = &idLt + return r +} + +func (r ApiUsersTokensListRequest) IdLte(idLte []int32) ApiUsersTokensListRequest { + r.idLte = &idLte + return r +} + +func (r ApiUsersTokensListRequest) IdN(idN []int32) ApiUsersTokensListRequest { + r.idN = &idN + return r +} + +func (r ApiUsersTokensListRequest) Key(key []string) ApiUsersTokensListRequest { + r.key = &key + return r +} + +func (r ApiUsersTokensListRequest) KeyEmpty(keyEmpty bool) ApiUsersTokensListRequest { + r.keyEmpty = &keyEmpty + return r +} + +func (r ApiUsersTokensListRequest) KeyIc(keyIc []string) ApiUsersTokensListRequest { + r.keyIc = &keyIc + return r +} + +func (r ApiUsersTokensListRequest) KeyIe(keyIe []string) ApiUsersTokensListRequest { + r.keyIe = &keyIe + return r +} + +func (r ApiUsersTokensListRequest) KeyIew(keyIew []string) ApiUsersTokensListRequest { + r.keyIew = &keyIew + return r +} + +func (r ApiUsersTokensListRequest) KeyIsw(keyIsw []string) ApiUsersTokensListRequest { + r.keyIsw = &keyIsw + return r +} + +func (r ApiUsersTokensListRequest) KeyN(keyN []string) ApiUsersTokensListRequest { + r.keyN = &keyN + return r +} + +func (r ApiUsersTokensListRequest) KeyNic(keyNic []string) ApiUsersTokensListRequest { + r.keyNic = &keyNic + return r +} + +func (r ApiUsersTokensListRequest) KeyNie(keyNie []string) ApiUsersTokensListRequest { + r.keyNie = &keyNie + return r +} + +func (r ApiUsersTokensListRequest) KeyNiew(keyNiew []string) ApiUsersTokensListRequest { + r.keyNiew = &keyNiew + return r +} + +func (r ApiUsersTokensListRequest) KeyNisw(keyNisw []string) ApiUsersTokensListRequest { + r.keyNisw = &keyNisw + return r +} + +// Number of results to return per page. +func (r ApiUsersTokensListRequest) Limit(limit int32) ApiUsersTokensListRequest { + r.limit = &limit + return r +} + +// The initial index from which to return the results. +func (r ApiUsersTokensListRequest) Offset(offset int32) ApiUsersTokensListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiUsersTokensListRequest) Ordering(ordering string) ApiUsersTokensListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiUsersTokensListRequest) Q(q string) ApiUsersTokensListRequest { + r.q = &q + return r +} + +// User (name) +func (r ApiUsersTokensListRequest) User(user []string) ApiUsersTokensListRequest { + r.user = &user + return r +} + +// User (name) +func (r ApiUsersTokensListRequest) UserN(userN []string) ApiUsersTokensListRequest { + r.userN = &userN + return r +} + +// User +func (r ApiUsersTokensListRequest) UserId(userId []int32) ApiUsersTokensListRequest { + r.userId = &userId + return r +} + +// User +func (r ApiUsersTokensListRequest) UserIdN(userIdN []int32) ApiUsersTokensListRequest { + r.userIdN = &userIdN + return r +} + +func (r ApiUsersTokensListRequest) WriteEnabled(writeEnabled bool) ApiUsersTokensListRequest { + r.writeEnabled = &writeEnabled + return r +} + +func (r ApiUsersTokensListRequest) Execute() (*PaginatedTokenList, *http.Response, error) { + return r.ApiService.UsersTokensListExecute(r) +} + +/* +UsersTokensList Method for UsersTokensList + +Get a list of token objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersTokensListRequest +*/ +func (a *UsersAPIService) UsersTokensList(ctx context.Context) ApiUsersTokensListRequest { + return ApiUsersTokensListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTokenList +func (a *UsersAPIService) UsersTokensListExecute(r ApiUsersTokensListRequest) (*PaginatedTokenList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTokenList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "") + } + if r.createdGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", r.createdGte, "") + } + if r.createdLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", r.createdLte, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.expires != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expires", r.expires, "") + } + if r.expiresGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expires__gte", r.expiresGte, "") + } + if r.expiresLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expires__lte", r.expiresLte, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.key != nil { + t := *r.key + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key", t, "multi") + } + } + if r.keyEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__empty", r.keyEmpty, "") + } + if r.keyIc != nil { + t := *r.keyIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__ic", t, "multi") + } + } + if r.keyIe != nil { + t := *r.keyIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__ie", t, "multi") + } + } + if r.keyIew != nil { + t := *r.keyIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__iew", t, "multi") + } + } + if r.keyIsw != nil { + t := *r.keyIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__isw", t, "multi") + } + } + if r.keyN != nil { + t := *r.keyN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__n", t, "multi") + } + } + if r.keyNic != nil { + t := *r.keyNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__nic", t, "multi") + } + } + if r.keyNie != nil { + t := *r.keyNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__nie", t, "multi") + } + } + if r.keyNiew != nil { + t := *r.keyNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__niew", t, "multi") + } + } + if r.keyNisw != nil { + t := *r.keyNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key__nisw", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.user != nil { + t := *r.user + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", t, "multi") + } + } + if r.userN != nil { + t := *r.userN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__n", t, "multi") + } + } + if r.userId != nil { + t := *r.userId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id", t, "multi") + } + } + if r.userIdN != nil { + t := *r.userIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_id__n", t, "multi") + } + } + if r.writeEnabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "write_enabled", r.writeEnabled, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + patchedWritableTokenRequest *PatchedWritableTokenRequest +} + +func (r ApiUsersTokensPartialUpdateRequest) PatchedWritableTokenRequest(patchedWritableTokenRequest PatchedWritableTokenRequest) ApiUsersTokensPartialUpdateRequest { + r.patchedWritableTokenRequest = &patchedWritableTokenRequest + return r +} + +func (r ApiUsersTokensPartialUpdateRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.UsersTokensPartialUpdateExecute(r) +} + +/* +UsersTokensPartialUpdate Method for UsersTokensPartialUpdate + +Patch a token object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this token. + @return ApiUsersTokensPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersTokensPartialUpdate(ctx context.Context, id int32) ApiUsersTokensPartialUpdateRequest { + return ApiUsersTokensPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Token +func (a *UsersAPIService) UsersTokensPartialUpdateExecute(r ApiUsersTokensPartialUpdateRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableTokenRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensProvisionCreateRequest struct { + ctx context.Context + ApiService *UsersAPIService + tokenProvisionRequest *TokenProvisionRequest +} + +func (r ApiUsersTokensProvisionCreateRequest) TokenProvisionRequest(tokenProvisionRequest TokenProvisionRequest) ApiUsersTokensProvisionCreateRequest { + r.tokenProvisionRequest = &tokenProvisionRequest + return r +} + +func (r ApiUsersTokensProvisionCreateRequest) Execute() (*TokenProvision, *http.Response, error) { + return r.ApiService.UsersTokensProvisionCreateExecute(r) +} + +/* +UsersTokensProvisionCreate Method for UsersTokensProvisionCreate + +Non-authenticated REST API endpoint via which a user may create a Token. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersTokensProvisionCreateRequest +*/ +func (a *UsersAPIService) UsersTokensProvisionCreate(ctx context.Context) ApiUsersTokensProvisionCreateRequest { + return ApiUsersTokensProvisionCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TokenProvision +func (a *UsersAPIService) UsersTokensProvisionCreateExecute(r ApiUsersTokensProvisionCreateRequest) (*TokenProvision, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TokenProvision + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensProvisionCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/provision/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tokenProvisionRequest == nil { + return localVarReturnValue, nil, reportError("tokenProvisionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tokenProvisionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensRetrieveRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersTokensRetrieveRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.UsersTokensRetrieveExecute(r) +} + +/* +UsersTokensRetrieve Method for UsersTokensRetrieve + +Get a token object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this token. + @return ApiUsersTokensRetrieveRequest +*/ +func (a *UsersAPIService) UsersTokensRetrieve(ctx context.Context, id int32) ApiUsersTokensRetrieveRequest { + return ApiUsersTokensRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Token +func (a *UsersAPIService) UsersTokensRetrieveExecute(r ApiUsersTokensRetrieveRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersTokensUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + writableTokenRequest *WritableTokenRequest +} + +func (r ApiUsersTokensUpdateRequest) WritableTokenRequest(writableTokenRequest WritableTokenRequest) ApiUsersTokensUpdateRequest { + r.writableTokenRequest = &writableTokenRequest + return r +} + +func (r ApiUsersTokensUpdateRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.UsersTokensUpdateExecute(r) +} + +/* +UsersTokensUpdate Method for UsersTokensUpdate + +Put a token object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this token. + @return ApiUsersTokensUpdateRequest +*/ +func (a *UsersAPIService) UsersTokensUpdate(ctx context.Context, id int32) ApiUsersTokensUpdateRequest { + return ApiUsersTokensUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Token +func (a *UsersAPIService) UsersTokensUpdateExecute(r ApiUsersTokensUpdateRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersTokensUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTokenRequest == nil { + return localVarReturnValue, nil, reportError("writableTokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTokenRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersUsersBulkDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + userRequest *[]UserRequest +} + +func (r ApiUsersUsersBulkDestroyRequest) UserRequest(userRequest []UserRequest) ApiUsersUsersBulkDestroyRequest { + r.userRequest = &userRequest + return r +} + +func (r ApiUsersUsersBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersUsersBulkDestroyExecute(r) +} + +/* +UsersUsersBulkDestroy Method for UsersUsersBulkDestroy + +Delete a list of user objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersUsersBulkDestroyRequest +*/ +func (a *UsersAPIService) UsersUsersBulkDestroy(ctx context.Context) ApiUsersUsersBulkDestroyRequest { + return ApiUsersUsersBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersUsersBulkDestroyExecute(r ApiUsersUsersBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userRequest == nil { + return nil, reportError("userRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersUsersBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + userRequest *[]UserRequest +} + +func (r ApiUsersUsersBulkPartialUpdateRequest) UserRequest(userRequest []UserRequest) ApiUsersUsersBulkPartialUpdateRequest { + r.userRequest = &userRequest + return r +} + +func (r ApiUsersUsersBulkPartialUpdateRequest) Execute() ([]User, *http.Response, error) { + return r.ApiService.UsersUsersBulkPartialUpdateExecute(r) +} + +/* +UsersUsersBulkPartialUpdate Method for UsersUsersBulkPartialUpdate + +Patch a list of user objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersUsersBulkPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersUsersBulkPartialUpdate(ctx context.Context) ApiUsersUsersBulkPartialUpdateRequest { + return ApiUsersUsersBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []User +func (a *UsersAPIService) UsersUsersBulkPartialUpdateExecute(r ApiUsersUsersBulkPartialUpdateRequest) ([]User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userRequest == nil { + return localVarReturnValue, nil, reportError("userRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersUsersBulkUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + userRequest *[]UserRequest +} + +func (r ApiUsersUsersBulkUpdateRequest) UserRequest(userRequest []UserRequest) ApiUsersUsersBulkUpdateRequest { + r.userRequest = &userRequest + return r +} + +func (r ApiUsersUsersBulkUpdateRequest) Execute() ([]User, *http.Response, error) { + return r.ApiService.UsersUsersBulkUpdateExecute(r) +} + +/* +UsersUsersBulkUpdate Method for UsersUsersBulkUpdate + +Put a list of user objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersUsersBulkUpdateRequest +*/ +func (a *UsersAPIService) UsersUsersBulkUpdate(ctx context.Context) ApiUsersUsersBulkUpdateRequest { + return ApiUsersUsersBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []User +func (a *UsersAPIService) UsersUsersBulkUpdateExecute(r ApiUsersUsersBulkUpdateRequest) ([]User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userRequest == nil { + return localVarReturnValue, nil, reportError("userRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersUsersCreateRequest struct { + ctx context.Context + ApiService *UsersAPIService + writableUserRequest *WritableUserRequest +} + +func (r ApiUsersUsersCreateRequest) WritableUserRequest(writableUserRequest WritableUserRequest) ApiUsersUsersCreateRequest { + r.writableUserRequest = &writableUserRequest + return r +} + +func (r ApiUsersUsersCreateRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.UsersUsersCreateExecute(r) +} + +/* +UsersUsersCreate Method for UsersUsersCreate + +Post a list of user objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersUsersCreateRequest +*/ +func (a *UsersAPIService) UsersUsersCreate(ctx context.Context) ApiUsersUsersCreateRequest { + return ApiUsersUsersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersAPIService) UsersUsersCreateExecute(r ApiUsersUsersCreateRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableUserRequest == nil { + return localVarReturnValue, nil, reportError("writableUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableUserRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersUsersDestroyRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersUsersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.UsersUsersDestroyExecute(r) +} + +/* +UsersUsersDestroy Method for UsersUsersDestroy + +Delete a user object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user. + @return ApiUsersUsersDestroyRequest +*/ +func (a *UsersAPIService) UsersUsersDestroy(ctx context.Context, id int32) ApiUsersUsersDestroyRequest { + return ApiUsersUsersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *UsersAPIService) UsersUsersDestroyExecute(r ApiUsersUsersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUsersUsersListRequest struct { + ctx context.Context + ApiService *UsersAPIService + email *[]string + emailEmpty *bool + emailIc *[]string + emailIe *[]string + emailIew *[]string + emailIsw *[]string + emailN *[]string + emailNic *[]string + emailNie *[]string + emailNiew *[]string + emailNisw *[]string + firstName *[]string + firstNameEmpty *bool + firstNameIc *[]string + firstNameIe *[]string + firstNameIew *[]string + firstNameIsw *[]string + firstNameN *[]string + firstNameNic *[]string + firstNameNie *[]string + firstNameNiew *[]string + firstNameNisw *[]string + group *[]string + groupN *[]string + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + isActive *bool + isStaff *bool + isSuperuser *bool + lastName *[]string + lastNameEmpty *bool + lastNameIc *[]string + lastNameIe *[]string + lastNameIew *[]string + lastNameIsw *[]string + lastNameN *[]string + lastNameNic *[]string + lastNameNie *[]string + lastNameNiew *[]string + lastNameNisw *[]string + limit *int32 + offset *int32 + ordering *string + q *string + username *[]string + usernameEmpty *bool + usernameIc *[]string + usernameIe *[]string + usernameIew *[]string + usernameIsw *[]string + usernameN *[]string + usernameNic *[]string + usernameNie *[]string + usernameNiew *[]string + usernameNisw *[]string +} + +func (r ApiUsersUsersListRequest) Email(email []string) ApiUsersUsersListRequest { + r.email = &email + return r +} + +func (r ApiUsersUsersListRequest) EmailEmpty(emailEmpty bool) ApiUsersUsersListRequest { + r.emailEmpty = &emailEmpty + return r +} + +func (r ApiUsersUsersListRequest) EmailIc(emailIc []string) ApiUsersUsersListRequest { + r.emailIc = &emailIc + return r +} + +func (r ApiUsersUsersListRequest) EmailIe(emailIe []string) ApiUsersUsersListRequest { + r.emailIe = &emailIe + return r +} + +func (r ApiUsersUsersListRequest) EmailIew(emailIew []string) ApiUsersUsersListRequest { + r.emailIew = &emailIew + return r +} + +func (r ApiUsersUsersListRequest) EmailIsw(emailIsw []string) ApiUsersUsersListRequest { + r.emailIsw = &emailIsw + return r +} + +func (r ApiUsersUsersListRequest) EmailN(emailN []string) ApiUsersUsersListRequest { + r.emailN = &emailN + return r +} + +func (r ApiUsersUsersListRequest) EmailNic(emailNic []string) ApiUsersUsersListRequest { + r.emailNic = &emailNic + return r +} + +func (r ApiUsersUsersListRequest) EmailNie(emailNie []string) ApiUsersUsersListRequest { + r.emailNie = &emailNie + return r +} + +func (r ApiUsersUsersListRequest) EmailNiew(emailNiew []string) ApiUsersUsersListRequest { + r.emailNiew = &emailNiew + return r +} + +func (r ApiUsersUsersListRequest) EmailNisw(emailNisw []string) ApiUsersUsersListRequest { + r.emailNisw = &emailNisw + return r +} + +func (r ApiUsersUsersListRequest) FirstName(firstName []string) ApiUsersUsersListRequest { + r.firstName = &firstName + return r +} + +func (r ApiUsersUsersListRequest) FirstNameEmpty(firstNameEmpty bool) ApiUsersUsersListRequest { + r.firstNameEmpty = &firstNameEmpty + return r +} + +func (r ApiUsersUsersListRequest) FirstNameIc(firstNameIc []string) ApiUsersUsersListRequest { + r.firstNameIc = &firstNameIc + return r +} + +func (r ApiUsersUsersListRequest) FirstNameIe(firstNameIe []string) ApiUsersUsersListRequest { + r.firstNameIe = &firstNameIe + return r +} + +func (r ApiUsersUsersListRequest) FirstNameIew(firstNameIew []string) ApiUsersUsersListRequest { + r.firstNameIew = &firstNameIew + return r +} + +func (r ApiUsersUsersListRequest) FirstNameIsw(firstNameIsw []string) ApiUsersUsersListRequest { + r.firstNameIsw = &firstNameIsw + return r +} + +func (r ApiUsersUsersListRequest) FirstNameN(firstNameN []string) ApiUsersUsersListRequest { + r.firstNameN = &firstNameN + return r +} + +func (r ApiUsersUsersListRequest) FirstNameNic(firstNameNic []string) ApiUsersUsersListRequest { + r.firstNameNic = &firstNameNic + return r +} + +func (r ApiUsersUsersListRequest) FirstNameNie(firstNameNie []string) ApiUsersUsersListRequest { + r.firstNameNie = &firstNameNie + return r +} + +func (r ApiUsersUsersListRequest) FirstNameNiew(firstNameNiew []string) ApiUsersUsersListRequest { + r.firstNameNiew = &firstNameNiew + return r +} + +func (r ApiUsersUsersListRequest) FirstNameNisw(firstNameNisw []string) ApiUsersUsersListRequest { + r.firstNameNisw = &firstNameNisw + return r +} + +// Group (name) +func (r ApiUsersUsersListRequest) Group(group []string) ApiUsersUsersListRequest { + r.group = &group + return r +} + +// Group (name) +func (r ApiUsersUsersListRequest) GroupN(groupN []string) ApiUsersUsersListRequest { + r.groupN = &groupN + return r +} + +// Group +func (r ApiUsersUsersListRequest) GroupId(groupId []int32) ApiUsersUsersListRequest { + r.groupId = &groupId + return r +} + +// Group +func (r ApiUsersUsersListRequest) GroupIdN(groupIdN []int32) ApiUsersUsersListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiUsersUsersListRequest) Id(id []int32) ApiUsersUsersListRequest { + r.id = &id + return r +} + +func (r ApiUsersUsersListRequest) IdEmpty(idEmpty bool) ApiUsersUsersListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiUsersUsersListRequest) IdGt(idGt []int32) ApiUsersUsersListRequest { + r.idGt = &idGt + return r +} + +func (r ApiUsersUsersListRequest) IdGte(idGte []int32) ApiUsersUsersListRequest { + r.idGte = &idGte + return r +} + +func (r ApiUsersUsersListRequest) IdLt(idLt []int32) ApiUsersUsersListRequest { + r.idLt = &idLt + return r +} + +func (r ApiUsersUsersListRequest) IdLte(idLte []int32) ApiUsersUsersListRequest { + r.idLte = &idLte + return r +} + +func (r ApiUsersUsersListRequest) IdN(idN []int32) ApiUsersUsersListRequest { + r.idN = &idN + return r +} + +func (r ApiUsersUsersListRequest) IsActive(isActive bool) ApiUsersUsersListRequest { + r.isActive = &isActive + return r +} + +func (r ApiUsersUsersListRequest) IsStaff(isStaff bool) ApiUsersUsersListRequest { + r.isStaff = &isStaff + return r +} + +func (r ApiUsersUsersListRequest) IsSuperuser(isSuperuser bool) ApiUsersUsersListRequest { + r.isSuperuser = &isSuperuser + return r +} + +func (r ApiUsersUsersListRequest) LastName(lastName []string) ApiUsersUsersListRequest { + r.lastName = &lastName + return r +} + +func (r ApiUsersUsersListRequest) LastNameEmpty(lastNameEmpty bool) ApiUsersUsersListRequest { + r.lastNameEmpty = &lastNameEmpty + return r +} + +func (r ApiUsersUsersListRequest) LastNameIc(lastNameIc []string) ApiUsersUsersListRequest { + r.lastNameIc = &lastNameIc + return r +} + +func (r ApiUsersUsersListRequest) LastNameIe(lastNameIe []string) ApiUsersUsersListRequest { + r.lastNameIe = &lastNameIe + return r +} + +func (r ApiUsersUsersListRequest) LastNameIew(lastNameIew []string) ApiUsersUsersListRequest { + r.lastNameIew = &lastNameIew + return r +} + +func (r ApiUsersUsersListRequest) LastNameIsw(lastNameIsw []string) ApiUsersUsersListRequest { + r.lastNameIsw = &lastNameIsw + return r +} + +func (r ApiUsersUsersListRequest) LastNameN(lastNameN []string) ApiUsersUsersListRequest { + r.lastNameN = &lastNameN + return r +} + +func (r ApiUsersUsersListRequest) LastNameNic(lastNameNic []string) ApiUsersUsersListRequest { + r.lastNameNic = &lastNameNic + return r +} + +func (r ApiUsersUsersListRequest) LastNameNie(lastNameNie []string) ApiUsersUsersListRequest { + r.lastNameNie = &lastNameNie + return r +} + +func (r ApiUsersUsersListRequest) LastNameNiew(lastNameNiew []string) ApiUsersUsersListRequest { + r.lastNameNiew = &lastNameNiew + return r +} + +func (r ApiUsersUsersListRequest) LastNameNisw(lastNameNisw []string) ApiUsersUsersListRequest { + r.lastNameNisw = &lastNameNisw + return r +} + +// Number of results to return per page. +func (r ApiUsersUsersListRequest) Limit(limit int32) ApiUsersUsersListRequest { + r.limit = &limit + return r +} + +// The initial index from which to return the results. +func (r ApiUsersUsersListRequest) Offset(offset int32) ApiUsersUsersListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiUsersUsersListRequest) Ordering(ordering string) ApiUsersUsersListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiUsersUsersListRequest) Q(q string) ApiUsersUsersListRequest { + r.q = &q + return r +} + +func (r ApiUsersUsersListRequest) Username(username []string) ApiUsersUsersListRequest { + r.username = &username + return r +} + +func (r ApiUsersUsersListRequest) UsernameEmpty(usernameEmpty bool) ApiUsersUsersListRequest { + r.usernameEmpty = &usernameEmpty + return r +} + +func (r ApiUsersUsersListRequest) UsernameIc(usernameIc []string) ApiUsersUsersListRequest { + r.usernameIc = &usernameIc + return r +} + +func (r ApiUsersUsersListRequest) UsernameIe(usernameIe []string) ApiUsersUsersListRequest { + r.usernameIe = &usernameIe + return r +} + +func (r ApiUsersUsersListRequest) UsernameIew(usernameIew []string) ApiUsersUsersListRequest { + r.usernameIew = &usernameIew + return r +} + +func (r ApiUsersUsersListRequest) UsernameIsw(usernameIsw []string) ApiUsersUsersListRequest { + r.usernameIsw = &usernameIsw + return r +} + +func (r ApiUsersUsersListRequest) UsernameN(usernameN []string) ApiUsersUsersListRequest { + r.usernameN = &usernameN + return r +} + +func (r ApiUsersUsersListRequest) UsernameNic(usernameNic []string) ApiUsersUsersListRequest { + r.usernameNic = &usernameNic + return r +} + +func (r ApiUsersUsersListRequest) UsernameNie(usernameNie []string) ApiUsersUsersListRequest { + r.usernameNie = &usernameNie + return r +} + +func (r ApiUsersUsersListRequest) UsernameNiew(usernameNiew []string) ApiUsersUsersListRequest { + r.usernameNiew = &usernameNiew + return r +} + +func (r ApiUsersUsersListRequest) UsernameNisw(usernameNisw []string) ApiUsersUsersListRequest { + r.usernameNisw = &usernameNisw + return r +} + +func (r ApiUsersUsersListRequest) Execute() (*PaginatedUserList, *http.Response, error) { + return r.ApiService.UsersUsersListExecute(r) +} + +/* +UsersUsersList Method for UsersUsersList + +Get a list of user objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersUsersListRequest +*/ +func (a *UsersAPIService) UsersUsersList(ctx context.Context) ApiUsersUsersListRequest { + return ApiUsersUsersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserList +func (a *UsersAPIService) UsersUsersListExecute(r ApiUsersUsersListRequest) (*PaginatedUserList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.email != nil { + t := *r.email + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email", t, "multi") + } + } + if r.emailEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__empty", r.emailEmpty, "") + } + if r.emailIc != nil { + t := *r.emailIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ic", t, "multi") + } + } + if r.emailIe != nil { + t := *r.emailIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__ie", t, "multi") + } + } + if r.emailIew != nil { + t := *r.emailIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__iew", t, "multi") + } + } + if r.emailIsw != nil { + t := *r.emailIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__isw", t, "multi") + } + } + if r.emailN != nil { + t := *r.emailN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__n", t, "multi") + } + } + if r.emailNic != nil { + t := *r.emailNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nic", t, "multi") + } + } + if r.emailNie != nil { + t := *r.emailNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nie", t, "multi") + } + } + if r.emailNiew != nil { + t := *r.emailNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__niew", t, "multi") + } + } + if r.emailNisw != nil { + t := *r.emailNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "email__nisw", t, "multi") + } + } + if r.firstName != nil { + t := *r.firstName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name", t, "multi") + } + } + if r.firstNameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__empty", r.firstNameEmpty, "") + } + if r.firstNameIc != nil { + t := *r.firstNameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__ic", t, "multi") + } + } + if r.firstNameIe != nil { + t := *r.firstNameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__ie", t, "multi") + } + } + if r.firstNameIew != nil { + t := *r.firstNameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__iew", t, "multi") + } + } + if r.firstNameIsw != nil { + t := *r.firstNameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__isw", t, "multi") + } + } + if r.firstNameN != nil { + t := *r.firstNameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__n", t, "multi") + } + } + if r.firstNameNic != nil { + t := *r.firstNameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__nic", t, "multi") + } + } + if r.firstNameNie != nil { + t := *r.firstNameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__nie", t, "multi") + } + } + if r.firstNameNiew != nil { + t := *r.firstNameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__niew", t, "multi") + } + } + if r.firstNameNisw != nil { + t := *r.firstNameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "first_name__nisw", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.isActive != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_active", r.isActive, "") + } + if r.isStaff != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_staff", r.isStaff, "") + } + if r.isSuperuser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_superuser", r.isSuperuser, "") + } + if r.lastName != nil { + t := *r.lastName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name", t, "multi") + } + } + if r.lastNameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__empty", r.lastNameEmpty, "") + } + if r.lastNameIc != nil { + t := *r.lastNameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__ic", t, "multi") + } + } + if r.lastNameIe != nil { + t := *r.lastNameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__ie", t, "multi") + } + } + if r.lastNameIew != nil { + t := *r.lastNameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__iew", t, "multi") + } + } + if r.lastNameIsw != nil { + t := *r.lastNameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__isw", t, "multi") + } + } + if r.lastNameN != nil { + t := *r.lastNameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__n", t, "multi") + } + } + if r.lastNameNic != nil { + t := *r.lastNameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__nic", t, "multi") + } + } + if r.lastNameNie != nil { + t := *r.lastNameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__nie", t, "multi") + } + } + if r.lastNameNiew != nil { + t := *r.lastNameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__niew", t, "multi") + } + } + if r.lastNameNisw != nil { + t := *r.lastNameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_name__nisw", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.username != nil { + t := *r.username + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", t, "multi") + } + } + if r.usernameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__empty", r.usernameEmpty, "") + } + if r.usernameIc != nil { + t := *r.usernameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__ic", t, "multi") + } + } + if r.usernameIe != nil { + t := *r.usernameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__ie", t, "multi") + } + } + if r.usernameIew != nil { + t := *r.usernameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__iew", t, "multi") + } + } + if r.usernameIsw != nil { + t := *r.usernameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__isw", t, "multi") + } + } + if r.usernameN != nil { + t := *r.usernameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__n", t, "multi") + } + } + if r.usernameNic != nil { + t := *r.usernameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__nic", t, "multi") + } + } + if r.usernameNie != nil { + t := *r.usernameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__nie", t, "multi") + } + } + if r.usernameNiew != nil { + t := *r.usernameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__niew", t, "multi") + } + } + if r.usernameNisw != nil { + t := *r.usernameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "username__nisw", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersUsersPartialUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + patchedWritableUserRequest *PatchedWritableUserRequest +} + +func (r ApiUsersUsersPartialUpdateRequest) PatchedWritableUserRequest(patchedWritableUserRequest PatchedWritableUserRequest) ApiUsersUsersPartialUpdateRequest { + r.patchedWritableUserRequest = &patchedWritableUserRequest + return r +} + +func (r ApiUsersUsersPartialUpdateRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.UsersUsersPartialUpdateExecute(r) +} + +/* +UsersUsersPartialUpdate Method for UsersUsersPartialUpdate + +Patch a user object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user. + @return ApiUsersUsersPartialUpdateRequest +*/ +func (a *UsersAPIService) UsersUsersPartialUpdate(ctx context.Context, id int32) ApiUsersUsersPartialUpdateRequest { + return ApiUsersUsersPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersAPIService) UsersUsersPartialUpdateExecute(r ApiUsersUsersPartialUpdateRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableUserRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersUsersRetrieveRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 +} + +func (r ApiUsersUsersRetrieveRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.UsersUsersRetrieveExecute(r) +} + +/* +UsersUsersRetrieve Method for UsersUsersRetrieve + +Get a user object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user. + @return ApiUsersUsersRetrieveRequest +*/ +func (a *UsersAPIService) UsersUsersRetrieve(ctx context.Context, id int32) ApiUsersUsersRetrieveRequest { + return ApiUsersUsersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersAPIService) UsersUsersRetrieveExecute(r ApiUsersUsersRetrieveRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersUsersUpdateRequest struct { + ctx context.Context + ApiService *UsersAPIService + id int32 + writableUserRequest *WritableUserRequest +} + +func (r ApiUsersUsersUpdateRequest) WritableUserRequest(writableUserRequest WritableUserRequest) ApiUsersUsersUpdateRequest { + r.writableUserRequest = &writableUserRequest + return r +} + +func (r ApiUsersUsersUpdateRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.UsersUsersUpdateExecute(r) +} + +/* +UsersUsersUpdate Method for UsersUsersUpdate + +Put a user object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user. + @return ApiUsersUsersUpdateRequest +*/ +func (a *UsersAPIService) UsersUsersUpdate(ctx context.Context, id int32) ApiUsersUsersUpdateRequest { + return ApiUsersUsersUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersAPIService) UsersUsersUpdateExecute(r ApiUsersUsersUpdateRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersUsersUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/users/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableUserRequest == nil { + return localVarReturnValue, nil, reportError("writableUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableUserRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_virtualization.go b/vendor/github.com/netbox-community/go-netbox/v3/api_virtualization.go new file mode 100644 index 00000000..204f984d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_virtualization.go @@ -0,0 +1,15027 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// VirtualizationAPIService VirtualizationAPI service +type VirtualizationAPIService service + +type ApiVirtualizationClusterGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterGroupRequest *[]ClusterGroupRequest +} + +func (r ApiVirtualizationClusterGroupsBulkDestroyRequest) ClusterGroupRequest(clusterGroupRequest []ClusterGroupRequest) ApiVirtualizationClusterGroupsBulkDestroyRequest { + r.clusterGroupRequest = &clusterGroupRequest + return r +} + +func (r ApiVirtualizationClusterGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsBulkDestroyExecute(r) +} + +/* +VirtualizationClusterGroupsBulkDestroy Method for VirtualizationClusterGroupsBulkDestroy + +Delete a list of cluster group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterGroupsBulkDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsBulkDestroy(ctx context.Context) ApiVirtualizationClusterGroupsBulkDestroyRequest { + return ApiVirtualizationClusterGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationClusterGroupsBulkDestroyExecute(r ApiVirtualizationClusterGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterGroupRequest == nil { + return nil, reportError("clusterGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterGroupRequest *[]ClusterGroupRequest +} + +func (r ApiVirtualizationClusterGroupsBulkPartialUpdateRequest) ClusterGroupRequest(clusterGroupRequest []ClusterGroupRequest) ApiVirtualizationClusterGroupsBulkPartialUpdateRequest { + r.clusterGroupRequest = &clusterGroupRequest + return r +} + +func (r ApiVirtualizationClusterGroupsBulkPartialUpdateRequest) Execute() ([]ClusterGroup, *http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsBulkPartialUpdateExecute(r) +} + +/* +VirtualizationClusterGroupsBulkPartialUpdate Method for VirtualizationClusterGroupsBulkPartialUpdate + +Patch a list of cluster group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterGroupsBulkPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsBulkPartialUpdate(ctx context.Context) ApiVirtualizationClusterGroupsBulkPartialUpdateRequest { + return ApiVirtualizationClusterGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ClusterGroup +func (a *VirtualizationAPIService) VirtualizationClusterGroupsBulkPartialUpdateExecute(r ApiVirtualizationClusterGroupsBulkPartialUpdateRequest) ([]ClusterGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ClusterGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterGroupRequest == nil { + return localVarReturnValue, nil, reportError("clusterGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterGroupRequest *[]ClusterGroupRequest +} + +func (r ApiVirtualizationClusterGroupsBulkUpdateRequest) ClusterGroupRequest(clusterGroupRequest []ClusterGroupRequest) ApiVirtualizationClusterGroupsBulkUpdateRequest { + r.clusterGroupRequest = &clusterGroupRequest + return r +} + +func (r ApiVirtualizationClusterGroupsBulkUpdateRequest) Execute() ([]ClusterGroup, *http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsBulkUpdateExecute(r) +} + +/* +VirtualizationClusterGroupsBulkUpdate Method for VirtualizationClusterGroupsBulkUpdate + +Put a list of cluster group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterGroupsBulkUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsBulkUpdate(ctx context.Context) ApiVirtualizationClusterGroupsBulkUpdateRequest { + return ApiVirtualizationClusterGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ClusterGroup +func (a *VirtualizationAPIService) VirtualizationClusterGroupsBulkUpdateExecute(r ApiVirtualizationClusterGroupsBulkUpdateRequest) ([]ClusterGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ClusterGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterGroupRequest == nil { + return localVarReturnValue, nil, reportError("clusterGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsCreateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterGroupRequest *ClusterGroupRequest +} + +func (r ApiVirtualizationClusterGroupsCreateRequest) ClusterGroupRequest(clusterGroupRequest ClusterGroupRequest) ApiVirtualizationClusterGroupsCreateRequest { + r.clusterGroupRequest = &clusterGroupRequest + return r +} + +func (r ApiVirtualizationClusterGroupsCreateRequest) Execute() (*ClusterGroup, *http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsCreateExecute(r) +} + +/* +VirtualizationClusterGroupsCreate Method for VirtualizationClusterGroupsCreate + +Post a list of cluster group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterGroupsCreateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsCreate(ctx context.Context) ApiVirtualizationClusterGroupsCreateRequest { + return ApiVirtualizationClusterGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ClusterGroup +func (a *VirtualizationAPIService) VirtualizationClusterGroupsCreateExecute(r ApiVirtualizationClusterGroupsCreateRequest) (*ClusterGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterGroupRequest == nil { + return localVarReturnValue, nil, reportError("clusterGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationClusterGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsDestroyExecute(r) +} + +/* +VirtualizationClusterGroupsDestroy Method for VirtualizationClusterGroupsDestroy + +Delete a cluster group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster group. + @return ApiVirtualizationClusterGroupsDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsDestroy(ctx context.Context, id int32) ApiVirtualizationClusterGroupsDestroyRequest { + return ApiVirtualizationClusterGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationClusterGroupsDestroyExecute(r ApiVirtualizationClusterGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsListRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +// Contact +func (r ApiVirtualizationClusterGroupsListRequest) Contact(contact []int32) ApiVirtualizationClusterGroupsListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiVirtualizationClusterGroupsListRequest) ContactN(contactN []int32) ApiVirtualizationClusterGroupsListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiVirtualizationClusterGroupsListRequest) ContactGroup(contactGroup []int32) ApiVirtualizationClusterGroupsListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiVirtualizationClusterGroupsListRequest) ContactGroupN(contactGroupN []int32) ApiVirtualizationClusterGroupsListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiVirtualizationClusterGroupsListRequest) ContactRole(contactRole []int32) ApiVirtualizationClusterGroupsListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiVirtualizationClusterGroupsListRequest) ContactRoleN(contactRoleN []int32) ApiVirtualizationClusterGroupsListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) Created(created []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.created = &created + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) CreatedGt(createdGt []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) CreatedGte(createdGte []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) CreatedLt(createdLt []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) CreatedLte(createdLte []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) CreatedN(createdN []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) CreatedByRequest(createdByRequest string) ApiVirtualizationClusterGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) Description(description []string) ApiVirtualizationClusterGroupsListRequest { + r.description = &description + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVirtualizationClusterGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionIc(descriptionIc []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionIe(descriptionIe []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionIew(descriptionIew []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionN(descriptionN []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionNic(descriptionNic []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionNie(descriptionNie []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiVirtualizationClusterGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) Id(id []int32) ApiVirtualizationClusterGroupsListRequest { + r.id = &id + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) IdEmpty(idEmpty bool) ApiVirtualizationClusterGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) IdGt(idGt []int32) ApiVirtualizationClusterGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) IdGte(idGte []int32) ApiVirtualizationClusterGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) IdLt(idLt []int32) ApiVirtualizationClusterGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) IdLte(idLte []int32) ApiVirtualizationClusterGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) IdN(idN []int32) ApiVirtualizationClusterGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVirtualizationClusterGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVirtualizationClusterGroupsListRequest) Limit(limit int32) ApiVirtualizationClusterGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVirtualizationClusterGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) Name(name []string) ApiVirtualizationClusterGroupsListRequest { + r.name = &name + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameEmpty(nameEmpty bool) ApiVirtualizationClusterGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameIc(nameIc []string) ApiVirtualizationClusterGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameIe(nameIe []string) ApiVirtualizationClusterGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameIew(nameIew []string) ApiVirtualizationClusterGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameIsw(nameIsw []string) ApiVirtualizationClusterGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameN(nameN []string) ApiVirtualizationClusterGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameNic(nameNic []string) ApiVirtualizationClusterGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameNie(nameNie []string) ApiVirtualizationClusterGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameNiew(nameNiew []string) ApiVirtualizationClusterGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) NameNisw(nameNisw []string) ApiVirtualizationClusterGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVirtualizationClusterGroupsListRequest) Offset(offset int32) ApiVirtualizationClusterGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVirtualizationClusterGroupsListRequest) Ordering(ordering string) ApiVirtualizationClusterGroupsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVirtualizationClusterGroupsListRequest) Q(q string) ApiVirtualizationClusterGroupsListRequest { + r.q = &q + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) Slug(slug []string) ApiVirtualizationClusterGroupsListRequest { + r.slug = &slug + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugEmpty(slugEmpty bool) ApiVirtualizationClusterGroupsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugIc(slugIc []string) ApiVirtualizationClusterGroupsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugIe(slugIe []string) ApiVirtualizationClusterGroupsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugIew(slugIew []string) ApiVirtualizationClusterGroupsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugIsw(slugIsw []string) ApiVirtualizationClusterGroupsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugN(slugN []string) ApiVirtualizationClusterGroupsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugNic(slugNic []string) ApiVirtualizationClusterGroupsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugNie(slugNie []string) ApiVirtualizationClusterGroupsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugNiew(slugNiew []string) ApiVirtualizationClusterGroupsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) SlugNisw(slugNisw []string) ApiVirtualizationClusterGroupsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) Tag(tag []string) ApiVirtualizationClusterGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) TagN(tagN []string) ApiVirtualizationClusterGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiVirtualizationClusterGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVirtualizationClusterGroupsListRequest) Execute() (*PaginatedClusterGroupList, *http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsListExecute(r) +} + +/* +VirtualizationClusterGroupsList Method for VirtualizationClusterGroupsList + +Get a list of cluster group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterGroupsListRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsList(ctx context.Context) ApiVirtualizationClusterGroupsListRequest { + return ApiVirtualizationClusterGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedClusterGroupList +func (a *VirtualizationAPIService) VirtualizationClusterGroupsListExecute(r ApiVirtualizationClusterGroupsListRequest) (*PaginatedClusterGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedClusterGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + patchedClusterGroupRequest *PatchedClusterGroupRequest +} + +func (r ApiVirtualizationClusterGroupsPartialUpdateRequest) PatchedClusterGroupRequest(patchedClusterGroupRequest PatchedClusterGroupRequest) ApiVirtualizationClusterGroupsPartialUpdateRequest { + r.patchedClusterGroupRequest = &patchedClusterGroupRequest + return r +} + +func (r ApiVirtualizationClusterGroupsPartialUpdateRequest) Execute() (*ClusterGroup, *http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsPartialUpdateExecute(r) +} + +/* +VirtualizationClusterGroupsPartialUpdate Method for VirtualizationClusterGroupsPartialUpdate + +Patch a cluster group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster group. + @return ApiVirtualizationClusterGroupsPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsPartialUpdate(ctx context.Context, id int32) ApiVirtualizationClusterGroupsPartialUpdateRequest { + return ApiVirtualizationClusterGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ClusterGroup +func (a *VirtualizationAPIService) VirtualizationClusterGroupsPartialUpdateExecute(r ApiVirtualizationClusterGroupsPartialUpdateRequest) (*ClusterGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedClusterGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsRetrieveRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationClusterGroupsRetrieveRequest) Execute() (*ClusterGroup, *http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsRetrieveExecute(r) +} + +/* +VirtualizationClusterGroupsRetrieve Method for VirtualizationClusterGroupsRetrieve + +Get a cluster group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster group. + @return ApiVirtualizationClusterGroupsRetrieveRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsRetrieve(ctx context.Context, id int32) ApiVirtualizationClusterGroupsRetrieveRequest { + return ApiVirtualizationClusterGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ClusterGroup +func (a *VirtualizationAPIService) VirtualizationClusterGroupsRetrieveExecute(r ApiVirtualizationClusterGroupsRetrieveRequest) (*ClusterGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterGroupsUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + clusterGroupRequest *ClusterGroupRequest +} + +func (r ApiVirtualizationClusterGroupsUpdateRequest) ClusterGroupRequest(clusterGroupRequest ClusterGroupRequest) ApiVirtualizationClusterGroupsUpdateRequest { + r.clusterGroupRequest = &clusterGroupRequest + return r +} + +func (r ApiVirtualizationClusterGroupsUpdateRequest) Execute() (*ClusterGroup, *http.Response, error) { + return r.ApiService.VirtualizationClusterGroupsUpdateExecute(r) +} + +/* +VirtualizationClusterGroupsUpdate Method for VirtualizationClusterGroupsUpdate + +Put a cluster group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster group. + @return ApiVirtualizationClusterGroupsUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterGroupsUpdate(ctx context.Context, id int32) ApiVirtualizationClusterGroupsUpdateRequest { + return ApiVirtualizationClusterGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ClusterGroup +func (a *VirtualizationAPIService) VirtualizationClusterGroupsUpdateExecute(r ApiVirtualizationClusterGroupsUpdateRequest) (*ClusterGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterGroupRequest == nil { + return localVarReturnValue, nil, reportError("clusterGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesBulkDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterTypeRequest *[]ClusterTypeRequest +} + +func (r ApiVirtualizationClusterTypesBulkDestroyRequest) ClusterTypeRequest(clusterTypeRequest []ClusterTypeRequest) ApiVirtualizationClusterTypesBulkDestroyRequest { + r.clusterTypeRequest = &clusterTypeRequest + return r +} + +func (r ApiVirtualizationClusterTypesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationClusterTypesBulkDestroyExecute(r) +} + +/* +VirtualizationClusterTypesBulkDestroy Method for VirtualizationClusterTypesBulkDestroy + +Delete a list of cluster type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterTypesBulkDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesBulkDestroy(ctx context.Context) ApiVirtualizationClusterTypesBulkDestroyRequest { + return ApiVirtualizationClusterTypesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationClusterTypesBulkDestroyExecute(r ApiVirtualizationClusterTypesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterTypeRequest == nil { + return nil, reportError("clusterTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterTypeRequest *[]ClusterTypeRequest +} + +func (r ApiVirtualizationClusterTypesBulkPartialUpdateRequest) ClusterTypeRequest(clusterTypeRequest []ClusterTypeRequest) ApiVirtualizationClusterTypesBulkPartialUpdateRequest { + r.clusterTypeRequest = &clusterTypeRequest + return r +} + +func (r ApiVirtualizationClusterTypesBulkPartialUpdateRequest) Execute() ([]ClusterType, *http.Response, error) { + return r.ApiService.VirtualizationClusterTypesBulkPartialUpdateExecute(r) +} + +/* +VirtualizationClusterTypesBulkPartialUpdate Method for VirtualizationClusterTypesBulkPartialUpdate + +Patch a list of cluster type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterTypesBulkPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesBulkPartialUpdate(ctx context.Context) ApiVirtualizationClusterTypesBulkPartialUpdateRequest { + return ApiVirtualizationClusterTypesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ClusterType +func (a *VirtualizationAPIService) VirtualizationClusterTypesBulkPartialUpdateExecute(r ApiVirtualizationClusterTypesBulkPartialUpdateRequest) ([]ClusterType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ClusterType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterTypeRequest == nil { + return localVarReturnValue, nil, reportError("clusterTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesBulkUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterTypeRequest *[]ClusterTypeRequest +} + +func (r ApiVirtualizationClusterTypesBulkUpdateRequest) ClusterTypeRequest(clusterTypeRequest []ClusterTypeRequest) ApiVirtualizationClusterTypesBulkUpdateRequest { + r.clusterTypeRequest = &clusterTypeRequest + return r +} + +func (r ApiVirtualizationClusterTypesBulkUpdateRequest) Execute() ([]ClusterType, *http.Response, error) { + return r.ApiService.VirtualizationClusterTypesBulkUpdateExecute(r) +} + +/* +VirtualizationClusterTypesBulkUpdate Method for VirtualizationClusterTypesBulkUpdate + +Put a list of cluster type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterTypesBulkUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesBulkUpdate(ctx context.Context) ApiVirtualizationClusterTypesBulkUpdateRequest { + return ApiVirtualizationClusterTypesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []ClusterType +func (a *VirtualizationAPIService) VirtualizationClusterTypesBulkUpdateExecute(r ApiVirtualizationClusterTypesBulkUpdateRequest) ([]ClusterType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ClusterType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterTypeRequest == nil { + return localVarReturnValue, nil, reportError("clusterTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesCreateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterTypeRequest *ClusterTypeRequest +} + +func (r ApiVirtualizationClusterTypesCreateRequest) ClusterTypeRequest(clusterTypeRequest ClusterTypeRequest) ApiVirtualizationClusterTypesCreateRequest { + r.clusterTypeRequest = &clusterTypeRequest + return r +} + +func (r ApiVirtualizationClusterTypesCreateRequest) Execute() (*ClusterType, *http.Response, error) { + return r.ApiService.VirtualizationClusterTypesCreateExecute(r) +} + +/* +VirtualizationClusterTypesCreate Method for VirtualizationClusterTypesCreate + +Post a list of cluster type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterTypesCreateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesCreate(ctx context.Context) ApiVirtualizationClusterTypesCreateRequest { + return ApiVirtualizationClusterTypesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ClusterType +func (a *VirtualizationAPIService) VirtualizationClusterTypesCreateExecute(r ApiVirtualizationClusterTypesCreateRequest) (*ClusterType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterTypeRequest == nil { + return localVarReturnValue, nil, reportError("clusterTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationClusterTypesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationClusterTypesDestroyExecute(r) +} + +/* +VirtualizationClusterTypesDestroy Method for VirtualizationClusterTypesDestroy + +Delete a cluster type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster type. + @return ApiVirtualizationClusterTypesDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesDestroy(ctx context.Context, id int32) ApiVirtualizationClusterTypesDestroyRequest { + return ApiVirtualizationClusterTypesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationClusterTypesDestroyExecute(r ApiVirtualizationClusterTypesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesListRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiVirtualizationClusterTypesListRequest) Created(created []time.Time) ApiVirtualizationClusterTypesListRequest { + r.created = &created + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVirtualizationClusterTypesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) CreatedGt(createdGt []time.Time) ApiVirtualizationClusterTypesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) CreatedGte(createdGte []time.Time) ApiVirtualizationClusterTypesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) CreatedLt(createdLt []time.Time) ApiVirtualizationClusterTypesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) CreatedLte(createdLte []time.Time) ApiVirtualizationClusterTypesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) CreatedN(createdN []time.Time) ApiVirtualizationClusterTypesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) CreatedByRequest(createdByRequest string) ApiVirtualizationClusterTypesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) Description(description []string) ApiVirtualizationClusterTypesListRequest { + r.description = &description + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVirtualizationClusterTypesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionIc(descriptionIc []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionIe(descriptionIe []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionIew(descriptionIew []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionIsw(descriptionIsw []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionN(descriptionN []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionNic(descriptionNic []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionNie(descriptionNie []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionNiew(descriptionNiew []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) DescriptionNisw(descriptionNisw []string) ApiVirtualizationClusterTypesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) Id(id []int32) ApiVirtualizationClusterTypesListRequest { + r.id = &id + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) IdEmpty(idEmpty bool) ApiVirtualizationClusterTypesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) IdGt(idGt []int32) ApiVirtualizationClusterTypesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) IdGte(idGte []int32) ApiVirtualizationClusterTypesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) IdLt(idLt []int32) ApiVirtualizationClusterTypesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) IdLte(idLte []int32) ApiVirtualizationClusterTypesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) IdN(idN []int32) ApiVirtualizationClusterTypesListRequest { + r.idN = &idN + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) LastUpdated(lastUpdated []time.Time) ApiVirtualizationClusterTypesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVirtualizationClusterTypesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVirtualizationClusterTypesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVirtualizationClusterTypesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVirtualizationClusterTypesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVirtualizationClusterTypesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVirtualizationClusterTypesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVirtualizationClusterTypesListRequest) Limit(limit int32) ApiVirtualizationClusterTypesListRequest { + r.limit = &limit + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) ModifiedByRequest(modifiedByRequest string) ApiVirtualizationClusterTypesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) Name(name []string) ApiVirtualizationClusterTypesListRequest { + r.name = &name + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameEmpty(nameEmpty bool) ApiVirtualizationClusterTypesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameIc(nameIc []string) ApiVirtualizationClusterTypesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameIe(nameIe []string) ApiVirtualizationClusterTypesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameIew(nameIew []string) ApiVirtualizationClusterTypesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameIsw(nameIsw []string) ApiVirtualizationClusterTypesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameN(nameN []string) ApiVirtualizationClusterTypesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameNic(nameNic []string) ApiVirtualizationClusterTypesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameNie(nameNie []string) ApiVirtualizationClusterTypesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameNiew(nameNiew []string) ApiVirtualizationClusterTypesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) NameNisw(nameNisw []string) ApiVirtualizationClusterTypesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVirtualizationClusterTypesListRequest) Offset(offset int32) ApiVirtualizationClusterTypesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVirtualizationClusterTypesListRequest) Ordering(ordering string) ApiVirtualizationClusterTypesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVirtualizationClusterTypesListRequest) Q(q string) ApiVirtualizationClusterTypesListRequest { + r.q = &q + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) Slug(slug []string) ApiVirtualizationClusterTypesListRequest { + r.slug = &slug + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugEmpty(slugEmpty bool) ApiVirtualizationClusterTypesListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugIc(slugIc []string) ApiVirtualizationClusterTypesListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugIe(slugIe []string) ApiVirtualizationClusterTypesListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugIew(slugIew []string) ApiVirtualizationClusterTypesListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugIsw(slugIsw []string) ApiVirtualizationClusterTypesListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugN(slugN []string) ApiVirtualizationClusterTypesListRequest { + r.slugN = &slugN + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugNic(slugNic []string) ApiVirtualizationClusterTypesListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugNie(slugNie []string) ApiVirtualizationClusterTypesListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugNiew(slugNiew []string) ApiVirtualizationClusterTypesListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) SlugNisw(slugNisw []string) ApiVirtualizationClusterTypesListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) Tag(tag []string) ApiVirtualizationClusterTypesListRequest { + r.tag = &tag + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) TagN(tagN []string) ApiVirtualizationClusterTypesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) UpdatedByRequest(updatedByRequest string) ApiVirtualizationClusterTypesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVirtualizationClusterTypesListRequest) Execute() (*PaginatedClusterTypeList, *http.Response, error) { + return r.ApiService.VirtualizationClusterTypesListExecute(r) +} + +/* +VirtualizationClusterTypesList Method for VirtualizationClusterTypesList + +Get a list of cluster type objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClusterTypesListRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesList(ctx context.Context) ApiVirtualizationClusterTypesListRequest { + return ApiVirtualizationClusterTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedClusterTypeList +func (a *VirtualizationAPIService) VirtualizationClusterTypesListExecute(r ApiVirtualizationClusterTypesListRequest) (*PaginatedClusterTypeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedClusterTypeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + patchedClusterTypeRequest *PatchedClusterTypeRequest +} + +func (r ApiVirtualizationClusterTypesPartialUpdateRequest) PatchedClusterTypeRequest(patchedClusterTypeRequest PatchedClusterTypeRequest) ApiVirtualizationClusterTypesPartialUpdateRequest { + r.patchedClusterTypeRequest = &patchedClusterTypeRequest + return r +} + +func (r ApiVirtualizationClusterTypesPartialUpdateRequest) Execute() (*ClusterType, *http.Response, error) { + return r.ApiService.VirtualizationClusterTypesPartialUpdateExecute(r) +} + +/* +VirtualizationClusterTypesPartialUpdate Method for VirtualizationClusterTypesPartialUpdate + +Patch a cluster type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster type. + @return ApiVirtualizationClusterTypesPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesPartialUpdate(ctx context.Context, id int32) ApiVirtualizationClusterTypesPartialUpdateRequest { + return ApiVirtualizationClusterTypesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ClusterType +func (a *VirtualizationAPIService) VirtualizationClusterTypesPartialUpdateExecute(r ApiVirtualizationClusterTypesPartialUpdateRequest) (*ClusterType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedClusterTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesRetrieveRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationClusterTypesRetrieveRequest) Execute() (*ClusterType, *http.Response, error) { + return r.ApiService.VirtualizationClusterTypesRetrieveExecute(r) +} + +/* +VirtualizationClusterTypesRetrieve Method for VirtualizationClusterTypesRetrieve + +Get a cluster type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster type. + @return ApiVirtualizationClusterTypesRetrieveRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesRetrieve(ctx context.Context, id int32) ApiVirtualizationClusterTypesRetrieveRequest { + return ApiVirtualizationClusterTypesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ClusterType +func (a *VirtualizationAPIService) VirtualizationClusterTypesRetrieveExecute(r ApiVirtualizationClusterTypesRetrieveRequest) (*ClusterType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClusterTypesUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + clusterTypeRequest *ClusterTypeRequest +} + +func (r ApiVirtualizationClusterTypesUpdateRequest) ClusterTypeRequest(clusterTypeRequest ClusterTypeRequest) ApiVirtualizationClusterTypesUpdateRequest { + r.clusterTypeRequest = &clusterTypeRequest + return r +} + +func (r ApiVirtualizationClusterTypesUpdateRequest) Execute() (*ClusterType, *http.Response, error) { + return r.ApiService.VirtualizationClusterTypesUpdateExecute(r) +} + +/* +VirtualizationClusterTypesUpdate Method for VirtualizationClusterTypesUpdate + +Put a cluster type object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster type. + @return ApiVirtualizationClusterTypesUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClusterTypesUpdate(ctx context.Context, id int32) ApiVirtualizationClusterTypesUpdateRequest { + return ApiVirtualizationClusterTypesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ClusterType +func (a *VirtualizationAPIService) VirtualizationClusterTypesUpdateExecute(r ApiVirtualizationClusterTypesUpdateRequest) (*ClusterType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClusterTypesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/cluster-types/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterTypeRequest == nil { + return localVarReturnValue, nil, reportError("clusterTypeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterTypeRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersBulkDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterRequest *[]ClusterRequest +} + +func (r ApiVirtualizationClustersBulkDestroyRequest) ClusterRequest(clusterRequest []ClusterRequest) ApiVirtualizationClustersBulkDestroyRequest { + r.clusterRequest = &clusterRequest + return r +} + +func (r ApiVirtualizationClustersBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationClustersBulkDestroyExecute(r) +} + +/* +VirtualizationClustersBulkDestroy Method for VirtualizationClustersBulkDestroy + +Delete a list of cluster objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClustersBulkDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersBulkDestroy(ctx context.Context) ApiVirtualizationClustersBulkDestroyRequest { + return ApiVirtualizationClustersBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationClustersBulkDestroyExecute(r ApiVirtualizationClustersBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterRequest == nil { + return nil, reportError("clusterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterRequest *[]ClusterRequest +} + +func (r ApiVirtualizationClustersBulkPartialUpdateRequest) ClusterRequest(clusterRequest []ClusterRequest) ApiVirtualizationClustersBulkPartialUpdateRequest { + r.clusterRequest = &clusterRequest + return r +} + +func (r ApiVirtualizationClustersBulkPartialUpdateRequest) Execute() ([]Cluster, *http.Response, error) { + return r.ApiService.VirtualizationClustersBulkPartialUpdateExecute(r) +} + +/* +VirtualizationClustersBulkPartialUpdate Method for VirtualizationClustersBulkPartialUpdate + +Patch a list of cluster objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClustersBulkPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersBulkPartialUpdate(ctx context.Context) ApiVirtualizationClustersBulkPartialUpdateRequest { + return ApiVirtualizationClustersBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Cluster +func (a *VirtualizationAPIService) VirtualizationClustersBulkPartialUpdateExecute(r ApiVirtualizationClustersBulkPartialUpdateRequest) ([]Cluster, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Cluster + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterRequest == nil { + return localVarReturnValue, nil, reportError("clusterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersBulkUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + clusterRequest *[]ClusterRequest +} + +func (r ApiVirtualizationClustersBulkUpdateRequest) ClusterRequest(clusterRequest []ClusterRequest) ApiVirtualizationClustersBulkUpdateRequest { + r.clusterRequest = &clusterRequest + return r +} + +func (r ApiVirtualizationClustersBulkUpdateRequest) Execute() ([]Cluster, *http.Response, error) { + return r.ApiService.VirtualizationClustersBulkUpdateExecute(r) +} + +/* +VirtualizationClustersBulkUpdate Method for VirtualizationClustersBulkUpdate + +Put a list of cluster objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClustersBulkUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersBulkUpdate(ctx context.Context) ApiVirtualizationClustersBulkUpdateRequest { + return ApiVirtualizationClustersBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Cluster +func (a *VirtualizationAPIService) VirtualizationClustersBulkUpdateExecute(r ApiVirtualizationClustersBulkUpdateRequest) ([]Cluster, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Cluster + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.clusterRequest == nil { + return localVarReturnValue, nil, reportError("clusterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersCreateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + writableClusterRequest *WritableClusterRequest +} + +func (r ApiVirtualizationClustersCreateRequest) WritableClusterRequest(writableClusterRequest WritableClusterRequest) ApiVirtualizationClustersCreateRequest { + r.writableClusterRequest = &writableClusterRequest + return r +} + +func (r ApiVirtualizationClustersCreateRequest) Execute() (*Cluster, *http.Response, error) { + return r.ApiService.VirtualizationClustersCreateExecute(r) +} + +/* +VirtualizationClustersCreate Method for VirtualizationClustersCreate + +Post a list of cluster objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClustersCreateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersCreate(ctx context.Context) ApiVirtualizationClustersCreateRequest { + return ApiVirtualizationClustersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Cluster +func (a *VirtualizationAPIService) VirtualizationClustersCreateExecute(r ApiVirtualizationClustersCreateRequest) (*Cluster, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cluster + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableClusterRequest == nil { + return localVarReturnValue, nil, reportError("writableClusterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableClusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationClustersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationClustersDestroyExecute(r) +} + +/* +VirtualizationClustersDestroy Method for VirtualizationClustersDestroy + +Delete a cluster object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster. + @return ApiVirtualizationClustersDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersDestroy(ctx context.Context, id int32) ApiVirtualizationClustersDestroyRequest { + return ApiVirtualizationClustersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationClustersDestroyExecute(r ApiVirtualizationClustersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersListRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + group *[]string + groupN *[]string + groupId *[]*int32 + groupIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]*int32 + siteIdN *[]*int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + type_ *[]string + typeN *[]string + typeId *[]int32 + typeIdN *[]int32 + updatedByRequest *string +} + +// Contact +func (r ApiVirtualizationClustersListRequest) Contact(contact []int32) ApiVirtualizationClustersListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiVirtualizationClustersListRequest) ContactN(contactN []int32) ApiVirtualizationClustersListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiVirtualizationClustersListRequest) ContactGroup(contactGroup []int32) ApiVirtualizationClustersListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiVirtualizationClustersListRequest) ContactGroupN(contactGroupN []int32) ApiVirtualizationClustersListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiVirtualizationClustersListRequest) ContactRole(contactRole []int32) ApiVirtualizationClustersListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiVirtualizationClustersListRequest) ContactRoleN(contactRoleN []int32) ApiVirtualizationClustersListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiVirtualizationClustersListRequest) Created(created []time.Time) ApiVirtualizationClustersListRequest { + r.created = &created + return r +} + +func (r ApiVirtualizationClustersListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVirtualizationClustersListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVirtualizationClustersListRequest) CreatedGt(createdGt []time.Time) ApiVirtualizationClustersListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVirtualizationClustersListRequest) CreatedGte(createdGte []time.Time) ApiVirtualizationClustersListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVirtualizationClustersListRequest) CreatedLt(createdLt []time.Time) ApiVirtualizationClustersListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVirtualizationClustersListRequest) CreatedLte(createdLte []time.Time) ApiVirtualizationClustersListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVirtualizationClustersListRequest) CreatedN(createdN []time.Time) ApiVirtualizationClustersListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVirtualizationClustersListRequest) CreatedByRequest(createdByRequest string) ApiVirtualizationClustersListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVirtualizationClustersListRequest) Description(description []string) ApiVirtualizationClustersListRequest { + r.description = &description + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVirtualizationClustersListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionIc(descriptionIc []string) ApiVirtualizationClustersListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionIe(descriptionIe []string) ApiVirtualizationClustersListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionIew(descriptionIew []string) ApiVirtualizationClustersListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionIsw(descriptionIsw []string) ApiVirtualizationClustersListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionN(descriptionN []string) ApiVirtualizationClustersListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionNic(descriptionNic []string) ApiVirtualizationClustersListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionNie(descriptionNie []string) ApiVirtualizationClustersListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionNiew(descriptionNiew []string) ApiVirtualizationClustersListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVirtualizationClustersListRequest) DescriptionNisw(descriptionNisw []string) ApiVirtualizationClustersListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Parent group (slug) +func (r ApiVirtualizationClustersListRequest) Group(group []string) ApiVirtualizationClustersListRequest { + r.group = &group + return r +} + +// Parent group (slug) +func (r ApiVirtualizationClustersListRequest) GroupN(groupN []string) ApiVirtualizationClustersListRequest { + r.groupN = &groupN + return r +} + +// Parent group (ID) +func (r ApiVirtualizationClustersListRequest) GroupId(groupId []*int32) ApiVirtualizationClustersListRequest { + r.groupId = &groupId + return r +} + +// Parent group (ID) +func (r ApiVirtualizationClustersListRequest) GroupIdN(groupIdN []*int32) ApiVirtualizationClustersListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiVirtualizationClustersListRequest) Id(id []int32) ApiVirtualizationClustersListRequest { + r.id = &id + return r +} + +func (r ApiVirtualizationClustersListRequest) IdEmpty(idEmpty bool) ApiVirtualizationClustersListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVirtualizationClustersListRequest) IdGt(idGt []int32) ApiVirtualizationClustersListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVirtualizationClustersListRequest) IdGte(idGte []int32) ApiVirtualizationClustersListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVirtualizationClustersListRequest) IdLt(idLt []int32) ApiVirtualizationClustersListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVirtualizationClustersListRequest) IdLte(idLte []int32) ApiVirtualizationClustersListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVirtualizationClustersListRequest) IdN(idN []int32) ApiVirtualizationClustersListRequest { + r.idN = &idN + return r +} + +func (r ApiVirtualizationClustersListRequest) LastUpdated(lastUpdated []time.Time) ApiVirtualizationClustersListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVirtualizationClustersListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVirtualizationClustersListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVirtualizationClustersListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVirtualizationClustersListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVirtualizationClustersListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVirtualizationClustersListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVirtualizationClustersListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVirtualizationClustersListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVirtualizationClustersListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVirtualizationClustersListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVirtualizationClustersListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVirtualizationClustersListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVirtualizationClustersListRequest) Limit(limit int32) ApiVirtualizationClustersListRequest { + r.limit = &limit + return r +} + +func (r ApiVirtualizationClustersListRequest) ModifiedByRequest(modifiedByRequest string) ApiVirtualizationClustersListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVirtualizationClustersListRequest) Name(name []string) ApiVirtualizationClustersListRequest { + r.name = &name + return r +} + +func (r ApiVirtualizationClustersListRequest) NameEmpty(nameEmpty bool) ApiVirtualizationClustersListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVirtualizationClustersListRequest) NameIc(nameIc []string) ApiVirtualizationClustersListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVirtualizationClustersListRequest) NameIe(nameIe []string) ApiVirtualizationClustersListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVirtualizationClustersListRequest) NameIew(nameIew []string) ApiVirtualizationClustersListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVirtualizationClustersListRequest) NameIsw(nameIsw []string) ApiVirtualizationClustersListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVirtualizationClustersListRequest) NameN(nameN []string) ApiVirtualizationClustersListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVirtualizationClustersListRequest) NameNic(nameNic []string) ApiVirtualizationClustersListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVirtualizationClustersListRequest) NameNie(nameNie []string) ApiVirtualizationClustersListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVirtualizationClustersListRequest) NameNiew(nameNiew []string) ApiVirtualizationClustersListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVirtualizationClustersListRequest) NameNisw(nameNisw []string) ApiVirtualizationClustersListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVirtualizationClustersListRequest) Offset(offset int32) ApiVirtualizationClustersListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVirtualizationClustersListRequest) Ordering(ordering string) ApiVirtualizationClustersListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVirtualizationClustersListRequest) Q(q string) ApiVirtualizationClustersListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiVirtualizationClustersListRequest) Region(region []int32) ApiVirtualizationClustersListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiVirtualizationClustersListRequest) RegionN(regionN []int32) ApiVirtualizationClustersListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiVirtualizationClustersListRequest) RegionId(regionId []int32) ApiVirtualizationClustersListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiVirtualizationClustersListRequest) RegionIdN(regionIdN []int32) ApiVirtualizationClustersListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Site (slug) +func (r ApiVirtualizationClustersListRequest) Site(site []string) ApiVirtualizationClustersListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiVirtualizationClustersListRequest) SiteN(siteN []string) ApiVirtualizationClustersListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiVirtualizationClustersListRequest) SiteGroup(siteGroup []int32) ApiVirtualizationClustersListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiVirtualizationClustersListRequest) SiteGroupN(siteGroupN []int32) ApiVirtualizationClustersListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiVirtualizationClustersListRequest) SiteGroupId(siteGroupId []int32) ApiVirtualizationClustersListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiVirtualizationClustersListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiVirtualizationClustersListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiVirtualizationClustersListRequest) SiteId(siteId []*int32) ApiVirtualizationClustersListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiVirtualizationClustersListRequest) SiteIdN(siteIdN []*int32) ApiVirtualizationClustersListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiVirtualizationClustersListRequest) Status(status []string) ApiVirtualizationClustersListRequest { + r.status = &status + return r +} + +func (r ApiVirtualizationClustersListRequest) StatusN(statusN []string) ApiVirtualizationClustersListRequest { + r.statusN = &statusN + return r +} + +func (r ApiVirtualizationClustersListRequest) Tag(tag []string) ApiVirtualizationClustersListRequest { + r.tag = &tag + return r +} + +func (r ApiVirtualizationClustersListRequest) TagN(tagN []string) ApiVirtualizationClustersListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiVirtualizationClustersListRequest) Tenant(tenant []string) ApiVirtualizationClustersListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiVirtualizationClustersListRequest) TenantN(tenantN []string) ApiVirtualizationClustersListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiVirtualizationClustersListRequest) TenantGroup(tenantGroup []int32) ApiVirtualizationClustersListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiVirtualizationClustersListRequest) TenantGroupN(tenantGroupN []int32) ApiVirtualizationClustersListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiVirtualizationClustersListRequest) TenantGroupId(tenantGroupId []int32) ApiVirtualizationClustersListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiVirtualizationClustersListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiVirtualizationClustersListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiVirtualizationClustersListRequest) TenantId(tenantId []*int32) ApiVirtualizationClustersListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiVirtualizationClustersListRequest) TenantIdN(tenantIdN []*int32) ApiVirtualizationClustersListRequest { + r.tenantIdN = &tenantIdN + return r +} + +// Cluster type (slug) +func (r ApiVirtualizationClustersListRequest) Type_(type_ []string) ApiVirtualizationClustersListRequest { + r.type_ = &type_ + return r +} + +// Cluster type (slug) +func (r ApiVirtualizationClustersListRequest) TypeN(typeN []string) ApiVirtualizationClustersListRequest { + r.typeN = &typeN + return r +} + +// Cluster type (ID) +func (r ApiVirtualizationClustersListRequest) TypeId(typeId []int32) ApiVirtualizationClustersListRequest { + r.typeId = &typeId + return r +} + +// Cluster type (ID) +func (r ApiVirtualizationClustersListRequest) TypeIdN(typeIdN []int32) ApiVirtualizationClustersListRequest { + r.typeIdN = &typeIdN + return r +} + +func (r ApiVirtualizationClustersListRequest) UpdatedByRequest(updatedByRequest string) ApiVirtualizationClustersListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVirtualizationClustersListRequest) Execute() (*PaginatedClusterList, *http.Response, error) { + return r.ApiService.VirtualizationClustersListExecute(r) +} + +/* +VirtualizationClustersList Method for VirtualizationClustersList + +Get a list of cluster objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationClustersListRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersList(ctx context.Context) ApiVirtualizationClustersListRequest { + return ApiVirtualizationClustersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedClusterList +func (a *VirtualizationAPIService) VirtualizationClustersListExecute(r ApiVirtualizationClustersListRequest) (*PaginatedClusterList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedClusterList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.typeId != nil { + t := *r.typeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id", t, "multi") + } + } + if r.typeIdN != nil { + t := *r.typeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + patchedWritableClusterRequest *PatchedWritableClusterRequest +} + +func (r ApiVirtualizationClustersPartialUpdateRequest) PatchedWritableClusterRequest(patchedWritableClusterRequest PatchedWritableClusterRequest) ApiVirtualizationClustersPartialUpdateRequest { + r.patchedWritableClusterRequest = &patchedWritableClusterRequest + return r +} + +func (r ApiVirtualizationClustersPartialUpdateRequest) Execute() (*Cluster, *http.Response, error) { + return r.ApiService.VirtualizationClustersPartialUpdateExecute(r) +} + +/* +VirtualizationClustersPartialUpdate Method for VirtualizationClustersPartialUpdate + +Patch a cluster object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster. + @return ApiVirtualizationClustersPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersPartialUpdate(ctx context.Context, id int32) ApiVirtualizationClustersPartialUpdateRequest { + return ApiVirtualizationClustersPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Cluster +func (a *VirtualizationAPIService) VirtualizationClustersPartialUpdateExecute(r ApiVirtualizationClustersPartialUpdateRequest) (*Cluster, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cluster + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableClusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersRetrieveRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationClustersRetrieveRequest) Execute() (*Cluster, *http.Response, error) { + return r.ApiService.VirtualizationClustersRetrieveExecute(r) +} + +/* +VirtualizationClustersRetrieve Method for VirtualizationClustersRetrieve + +Get a cluster object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster. + @return ApiVirtualizationClustersRetrieveRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersRetrieve(ctx context.Context, id int32) ApiVirtualizationClustersRetrieveRequest { + return ApiVirtualizationClustersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Cluster +func (a *VirtualizationAPIService) VirtualizationClustersRetrieveExecute(r ApiVirtualizationClustersRetrieveRequest) (*Cluster, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cluster + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationClustersUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + writableClusterRequest *WritableClusterRequest +} + +func (r ApiVirtualizationClustersUpdateRequest) WritableClusterRequest(writableClusterRequest WritableClusterRequest) ApiVirtualizationClustersUpdateRequest { + r.writableClusterRequest = &writableClusterRequest + return r +} + +func (r ApiVirtualizationClustersUpdateRequest) Execute() (*Cluster, *http.Response, error) { + return r.ApiService.VirtualizationClustersUpdateExecute(r) +} + +/* +VirtualizationClustersUpdate Method for VirtualizationClustersUpdate + +Put a cluster object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this cluster. + @return ApiVirtualizationClustersUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationClustersUpdate(ctx context.Context, id int32) ApiVirtualizationClustersUpdateRequest { + return ApiVirtualizationClustersUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Cluster +func (a *VirtualizationAPIService) VirtualizationClustersUpdateExecute(r ApiVirtualizationClustersUpdateRequest) (*Cluster, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cluster + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationClustersUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/clusters/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableClusterRequest == nil { + return localVarReturnValue, nil, reportError("writableClusterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableClusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesBulkDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + vMInterfaceRequest *[]VMInterfaceRequest +} + +func (r ApiVirtualizationInterfacesBulkDestroyRequest) VMInterfaceRequest(vMInterfaceRequest []VMInterfaceRequest) ApiVirtualizationInterfacesBulkDestroyRequest { + r.vMInterfaceRequest = &vMInterfaceRequest + return r +} + +func (r ApiVirtualizationInterfacesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationInterfacesBulkDestroyExecute(r) +} + +/* +VirtualizationInterfacesBulkDestroy Method for VirtualizationInterfacesBulkDestroy + +Delete a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationInterfacesBulkDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesBulkDestroy(ctx context.Context) ApiVirtualizationInterfacesBulkDestroyRequest { + return ApiVirtualizationInterfacesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationInterfacesBulkDestroyExecute(r ApiVirtualizationInterfacesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vMInterfaceRequest == nil { + return nil, reportError("vMInterfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vMInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + vMInterfaceRequest *[]VMInterfaceRequest +} + +func (r ApiVirtualizationInterfacesBulkPartialUpdateRequest) VMInterfaceRequest(vMInterfaceRequest []VMInterfaceRequest) ApiVirtualizationInterfacesBulkPartialUpdateRequest { + r.vMInterfaceRequest = &vMInterfaceRequest + return r +} + +func (r ApiVirtualizationInterfacesBulkPartialUpdateRequest) Execute() ([]VMInterface, *http.Response, error) { + return r.ApiService.VirtualizationInterfacesBulkPartialUpdateExecute(r) +} + +/* +VirtualizationInterfacesBulkPartialUpdate Method for VirtualizationInterfacesBulkPartialUpdate + +Patch a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationInterfacesBulkPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesBulkPartialUpdate(ctx context.Context) ApiVirtualizationInterfacesBulkPartialUpdateRequest { + return ApiVirtualizationInterfacesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VMInterface +func (a *VirtualizationAPIService) VirtualizationInterfacesBulkPartialUpdateExecute(r ApiVirtualizationInterfacesBulkPartialUpdateRequest) ([]VMInterface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VMInterface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vMInterfaceRequest == nil { + return localVarReturnValue, nil, reportError("vMInterfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vMInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesBulkUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + vMInterfaceRequest *[]VMInterfaceRequest +} + +func (r ApiVirtualizationInterfacesBulkUpdateRequest) VMInterfaceRequest(vMInterfaceRequest []VMInterfaceRequest) ApiVirtualizationInterfacesBulkUpdateRequest { + r.vMInterfaceRequest = &vMInterfaceRequest + return r +} + +func (r ApiVirtualizationInterfacesBulkUpdateRequest) Execute() ([]VMInterface, *http.Response, error) { + return r.ApiService.VirtualizationInterfacesBulkUpdateExecute(r) +} + +/* +VirtualizationInterfacesBulkUpdate Method for VirtualizationInterfacesBulkUpdate + +Put a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationInterfacesBulkUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesBulkUpdate(ctx context.Context) ApiVirtualizationInterfacesBulkUpdateRequest { + return ApiVirtualizationInterfacesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VMInterface +func (a *VirtualizationAPIService) VirtualizationInterfacesBulkUpdateExecute(r ApiVirtualizationInterfacesBulkUpdateRequest) ([]VMInterface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VMInterface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vMInterfaceRequest == nil { + return localVarReturnValue, nil, reportError("vMInterfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vMInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesCreateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + writableVMInterfaceRequest *WritableVMInterfaceRequest +} + +func (r ApiVirtualizationInterfacesCreateRequest) WritableVMInterfaceRequest(writableVMInterfaceRequest WritableVMInterfaceRequest) ApiVirtualizationInterfacesCreateRequest { + r.writableVMInterfaceRequest = &writableVMInterfaceRequest + return r +} + +func (r ApiVirtualizationInterfacesCreateRequest) Execute() (*VMInterface, *http.Response, error) { + return r.ApiService.VirtualizationInterfacesCreateExecute(r) +} + +/* +VirtualizationInterfacesCreate Method for VirtualizationInterfacesCreate + +Post a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationInterfacesCreateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesCreate(ctx context.Context) ApiVirtualizationInterfacesCreateRequest { + return ApiVirtualizationInterfacesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VMInterface +func (a *VirtualizationAPIService) VirtualizationInterfacesCreateExecute(r ApiVirtualizationInterfacesCreateRequest) (*VMInterface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VMInterface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVMInterfaceRequest == nil { + return localVarReturnValue, nil, reportError("writableVMInterfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVMInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationInterfacesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationInterfacesDestroyExecute(r) +} + +/* +VirtualizationInterfacesDestroy Method for VirtualizationInterfacesDestroy + +Delete a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiVirtualizationInterfacesDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesDestroy(ctx context.Context, id int32) ApiVirtualizationInterfacesDestroyRequest { + return ApiVirtualizationInterfacesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationInterfacesDestroyExecute(r ApiVirtualizationInterfacesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesListRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + bridgeId *[]int32 + bridgeIdN *[]int32 + cluster *[]string + clusterN *[]string + clusterId *[]int32 + clusterIdN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + enabled *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + l2vpn *[]*int64 + l2vpnN *[]*int64 + l2vpnId *[]int32 + l2vpnIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + macAddress *[]string + macAddressIc *[]string + macAddressIe *[]string + macAddressIew *[]string + macAddressIsw *[]string + macAddressN *[]string + macAddressNic *[]string + macAddressNie *[]string + macAddressNiew *[]string + macAddressNisw *[]string + modifiedByRequest *string + mtu *[]int32 + mtuEmpty *bool + mtuGt *[]int32 + mtuGte *[]int32 + mtuLt *[]int32 + mtuLte *[]int32 + mtuN *[]int32 + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parentId *[]int32 + parentIdN *[]int32 + q *string + tag *[]string + tagN *[]string + updatedByRequest *string + virtualMachine *[]string + virtualMachineN *[]string + virtualMachineId *[]int32 + virtualMachineIdN *[]int32 + vlan *string + vlanId *string + vrf *[]*string + vrfN *[]*string + vrfId *[]int32 + vrfIdN *[]int32 +} + +// Bridged interface (ID) +func (r ApiVirtualizationInterfacesListRequest) BridgeId(bridgeId []int32) ApiVirtualizationInterfacesListRequest { + r.bridgeId = &bridgeId + return r +} + +// Bridged interface (ID) +func (r ApiVirtualizationInterfacesListRequest) BridgeIdN(bridgeIdN []int32) ApiVirtualizationInterfacesListRequest { + r.bridgeIdN = &bridgeIdN + return r +} + +// Cluster +func (r ApiVirtualizationInterfacesListRequest) Cluster(cluster []string) ApiVirtualizationInterfacesListRequest { + r.cluster = &cluster + return r +} + +// Cluster +func (r ApiVirtualizationInterfacesListRequest) ClusterN(clusterN []string) ApiVirtualizationInterfacesListRequest { + r.clusterN = &clusterN + return r +} + +// Cluster (ID) +func (r ApiVirtualizationInterfacesListRequest) ClusterId(clusterId []int32) ApiVirtualizationInterfacesListRequest { + r.clusterId = &clusterId + return r +} + +// Cluster (ID) +func (r ApiVirtualizationInterfacesListRequest) ClusterIdN(clusterIdN []int32) ApiVirtualizationInterfacesListRequest { + r.clusterIdN = &clusterIdN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Created(created []time.Time) ApiVirtualizationInterfacesListRequest { + r.created = &created + return r +} + +func (r ApiVirtualizationInterfacesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVirtualizationInterfacesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVirtualizationInterfacesListRequest) CreatedGt(createdGt []time.Time) ApiVirtualizationInterfacesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) CreatedGte(createdGte []time.Time) ApiVirtualizationInterfacesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) CreatedLt(createdLt []time.Time) ApiVirtualizationInterfacesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) CreatedLte(createdLte []time.Time) ApiVirtualizationInterfacesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) CreatedN(createdN []time.Time) ApiVirtualizationInterfacesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) CreatedByRequest(createdByRequest string) ApiVirtualizationInterfacesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Description(description []string) ApiVirtualizationInterfacesListRequest { + r.description = &description + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVirtualizationInterfacesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionIc(descriptionIc []string) ApiVirtualizationInterfacesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionIe(descriptionIe []string) ApiVirtualizationInterfacesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionIew(descriptionIew []string) ApiVirtualizationInterfacesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionIsw(descriptionIsw []string) ApiVirtualizationInterfacesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionN(descriptionN []string) ApiVirtualizationInterfacesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionNic(descriptionNic []string) ApiVirtualizationInterfacesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionNie(descriptionNie []string) ApiVirtualizationInterfacesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionNiew(descriptionNiew []string) ApiVirtualizationInterfacesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVirtualizationInterfacesListRequest) DescriptionNisw(descriptionNisw []string) ApiVirtualizationInterfacesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Enabled(enabled bool) ApiVirtualizationInterfacesListRequest { + r.enabled = &enabled + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Id(id []int32) ApiVirtualizationInterfacesListRequest { + r.id = &id + return r +} + +func (r ApiVirtualizationInterfacesListRequest) IdEmpty(idEmpty bool) ApiVirtualizationInterfacesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVirtualizationInterfacesListRequest) IdGt(idGt []int32) ApiVirtualizationInterfacesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) IdGte(idGte []int32) ApiVirtualizationInterfacesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) IdLt(idLt []int32) ApiVirtualizationInterfacesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) IdLte(idLte []int32) ApiVirtualizationInterfacesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) IdN(idN []int32) ApiVirtualizationInterfacesListRequest { + r.idN = &idN + return r +} + +// L2VPN +func (r ApiVirtualizationInterfacesListRequest) L2vpn(l2vpn []*int64) ApiVirtualizationInterfacesListRequest { + r.l2vpn = &l2vpn + return r +} + +// L2VPN +func (r ApiVirtualizationInterfacesListRequest) L2vpnN(l2vpnN []*int64) ApiVirtualizationInterfacesListRequest { + r.l2vpnN = &l2vpnN + return r +} + +// L2VPN (ID) +func (r ApiVirtualizationInterfacesListRequest) L2vpnId(l2vpnId []int32) ApiVirtualizationInterfacesListRequest { + r.l2vpnId = &l2vpnId + return r +} + +// L2VPN (ID) +func (r ApiVirtualizationInterfacesListRequest) L2vpnIdN(l2vpnIdN []int32) ApiVirtualizationInterfacesListRequest { + r.l2vpnIdN = &l2vpnIdN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) LastUpdated(lastUpdated []time.Time) ApiVirtualizationInterfacesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVirtualizationInterfacesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVirtualizationInterfacesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVirtualizationInterfacesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVirtualizationInterfacesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVirtualizationInterfacesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVirtualizationInterfacesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVirtualizationInterfacesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVirtualizationInterfacesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVirtualizationInterfacesListRequest) Limit(limit int32) ApiVirtualizationInterfacesListRequest { + r.limit = &limit + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddress(macAddress []string) ApiVirtualizationInterfacesListRequest { + r.macAddress = &macAddress + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressIc(macAddressIc []string) ApiVirtualizationInterfacesListRequest { + r.macAddressIc = &macAddressIc + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressIe(macAddressIe []string) ApiVirtualizationInterfacesListRequest { + r.macAddressIe = &macAddressIe + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressIew(macAddressIew []string) ApiVirtualizationInterfacesListRequest { + r.macAddressIew = &macAddressIew + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressIsw(macAddressIsw []string) ApiVirtualizationInterfacesListRequest { + r.macAddressIsw = &macAddressIsw + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressN(macAddressN []string) ApiVirtualizationInterfacesListRequest { + r.macAddressN = &macAddressN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressNic(macAddressNic []string) ApiVirtualizationInterfacesListRequest { + r.macAddressNic = &macAddressNic + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressNie(macAddressNie []string) ApiVirtualizationInterfacesListRequest { + r.macAddressNie = &macAddressNie + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressNiew(macAddressNiew []string) ApiVirtualizationInterfacesListRequest { + r.macAddressNiew = &macAddressNiew + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MacAddressNisw(macAddressNisw []string) ApiVirtualizationInterfacesListRequest { + r.macAddressNisw = &macAddressNisw + return r +} + +func (r ApiVirtualizationInterfacesListRequest) ModifiedByRequest(modifiedByRequest string) ApiVirtualizationInterfacesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Mtu(mtu []int32) ApiVirtualizationInterfacesListRequest { + r.mtu = &mtu + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MtuEmpty(mtuEmpty bool) ApiVirtualizationInterfacesListRequest { + r.mtuEmpty = &mtuEmpty + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MtuGt(mtuGt []int32) ApiVirtualizationInterfacesListRequest { + r.mtuGt = &mtuGt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MtuGte(mtuGte []int32) ApiVirtualizationInterfacesListRequest { + r.mtuGte = &mtuGte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MtuLt(mtuLt []int32) ApiVirtualizationInterfacesListRequest { + r.mtuLt = &mtuLt + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MtuLte(mtuLte []int32) ApiVirtualizationInterfacesListRequest { + r.mtuLte = &mtuLte + return r +} + +func (r ApiVirtualizationInterfacesListRequest) MtuN(mtuN []int32) ApiVirtualizationInterfacesListRequest { + r.mtuN = &mtuN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Name(name []string) ApiVirtualizationInterfacesListRequest { + r.name = &name + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameEmpty(nameEmpty bool) ApiVirtualizationInterfacesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameIc(nameIc []string) ApiVirtualizationInterfacesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameIe(nameIe []string) ApiVirtualizationInterfacesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameIew(nameIew []string) ApiVirtualizationInterfacesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameIsw(nameIsw []string) ApiVirtualizationInterfacesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameN(nameN []string) ApiVirtualizationInterfacesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameNic(nameNic []string) ApiVirtualizationInterfacesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameNie(nameNie []string) ApiVirtualizationInterfacesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameNiew(nameNiew []string) ApiVirtualizationInterfacesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVirtualizationInterfacesListRequest) NameNisw(nameNisw []string) ApiVirtualizationInterfacesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVirtualizationInterfacesListRequest) Offset(offset int32) ApiVirtualizationInterfacesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVirtualizationInterfacesListRequest) Ordering(ordering string) ApiVirtualizationInterfacesListRequest { + r.ordering = &ordering + return r +} + +// Parent interface (ID) +func (r ApiVirtualizationInterfacesListRequest) ParentId(parentId []int32) ApiVirtualizationInterfacesListRequest { + r.parentId = &parentId + return r +} + +// Parent interface (ID) +func (r ApiVirtualizationInterfacesListRequest) ParentIdN(parentIdN []int32) ApiVirtualizationInterfacesListRequest { + r.parentIdN = &parentIdN + return r +} + +// Search +func (r ApiVirtualizationInterfacesListRequest) Q(q string) ApiVirtualizationInterfacesListRequest { + r.q = &q + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Tag(tag []string) ApiVirtualizationInterfacesListRequest { + r.tag = &tag + return r +} + +func (r ApiVirtualizationInterfacesListRequest) TagN(tagN []string) ApiVirtualizationInterfacesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) UpdatedByRequest(updatedByRequest string) ApiVirtualizationInterfacesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual machine +func (r ApiVirtualizationInterfacesListRequest) VirtualMachine(virtualMachine []string) ApiVirtualizationInterfacesListRequest { + r.virtualMachine = &virtualMachine + return r +} + +// Virtual machine +func (r ApiVirtualizationInterfacesListRequest) VirtualMachineN(virtualMachineN []string) ApiVirtualizationInterfacesListRequest { + r.virtualMachineN = &virtualMachineN + return r +} + +// Virtual machine (ID) +func (r ApiVirtualizationInterfacesListRequest) VirtualMachineId(virtualMachineId []int32) ApiVirtualizationInterfacesListRequest { + r.virtualMachineId = &virtualMachineId + return r +} + +// Virtual machine (ID) +func (r ApiVirtualizationInterfacesListRequest) VirtualMachineIdN(virtualMachineIdN []int32) ApiVirtualizationInterfacesListRequest { + r.virtualMachineIdN = &virtualMachineIdN + return r +} + +// Assigned VID +func (r ApiVirtualizationInterfacesListRequest) Vlan(vlan string) ApiVirtualizationInterfacesListRequest { + r.vlan = &vlan + return r +} + +// Assigned VLAN +func (r ApiVirtualizationInterfacesListRequest) VlanId(vlanId string) ApiVirtualizationInterfacesListRequest { + r.vlanId = &vlanId + return r +} + +// VRF (RD) +func (r ApiVirtualizationInterfacesListRequest) Vrf(vrf []*string) ApiVirtualizationInterfacesListRequest { + r.vrf = &vrf + return r +} + +// VRF (RD) +func (r ApiVirtualizationInterfacesListRequest) VrfN(vrfN []*string) ApiVirtualizationInterfacesListRequest { + r.vrfN = &vrfN + return r +} + +// VRF +func (r ApiVirtualizationInterfacesListRequest) VrfId(vrfId []int32) ApiVirtualizationInterfacesListRequest { + r.vrfId = &vrfId + return r +} + +// VRF +func (r ApiVirtualizationInterfacesListRequest) VrfIdN(vrfIdN []int32) ApiVirtualizationInterfacesListRequest { + r.vrfIdN = &vrfIdN + return r +} + +func (r ApiVirtualizationInterfacesListRequest) Execute() (*PaginatedVMInterfaceList, *http.Response, error) { + return r.ApiService.VirtualizationInterfacesListExecute(r) +} + +/* +VirtualizationInterfacesList Method for VirtualizationInterfacesList + +Get a list of interface objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationInterfacesListRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesList(ctx context.Context) ApiVirtualizationInterfacesListRequest { + return ApiVirtualizationInterfacesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVMInterfaceList +func (a *VirtualizationAPIService) VirtualizationInterfacesListExecute(r ApiVirtualizationInterfacesListRequest) (*PaginatedVMInterfaceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVMInterfaceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.bridgeId != nil { + t := *r.bridgeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id", t, "multi") + } + } + if r.bridgeIdN != nil { + t := *r.bridgeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "bridge_id__n", t, "multi") + } + } + if r.cluster != nil { + t := *r.cluster + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster", t, "multi") + } + } + if r.clusterN != nil { + t := *r.clusterN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster__n", t, "multi") + } + } + if r.clusterId != nil { + t := *r.clusterId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", t, "multi") + } + } + if r.clusterIdN != nil { + t := *r.clusterIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.l2vpn != nil { + t := *r.l2vpn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", t, "multi") + } + } + if r.l2vpnN != nil { + t := *r.l2vpnN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", t, "multi") + } + } + if r.l2vpnId != nil { + t := *r.l2vpnId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", t, "multi") + } + } + if r.l2vpnIdN != nil { + t := *r.l2vpnIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.macAddress != nil { + t := *r.macAddress + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", t, "multi") + } + } + if r.macAddressIc != nil { + t := *r.macAddressIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", t, "multi") + } + } + if r.macAddressIe != nil { + t := *r.macAddressIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", t, "multi") + } + } + if r.macAddressIew != nil { + t := *r.macAddressIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", t, "multi") + } + } + if r.macAddressIsw != nil { + t := *r.macAddressIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", t, "multi") + } + } + if r.macAddressN != nil { + t := *r.macAddressN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", t, "multi") + } + } + if r.macAddressNic != nil { + t := *r.macAddressNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", t, "multi") + } + } + if r.macAddressNie != nil { + t := *r.macAddressNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", t, "multi") + } + } + if r.macAddressNiew != nil { + t := *r.macAddressNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", t, "multi") + } + } + if r.macAddressNisw != nil { + t := *r.macAddressNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.mtu != nil { + t := *r.mtu + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu", t, "multi") + } + } + if r.mtuEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__empty", r.mtuEmpty, "") + } + if r.mtuGt != nil { + t := *r.mtuGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gt", t, "multi") + } + } + if r.mtuGte != nil { + t := *r.mtuGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__gte", t, "multi") + } + } + if r.mtuLt != nil { + t := *r.mtuLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lt", t, "multi") + } + } + if r.mtuLte != nil { + t := *r.mtuLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__lte", t, "multi") + } + } + if r.mtuN != nil { + t := *r.mtuN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mtu__n", t, "multi") + } + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualMachine != nil { + t := *r.virtualMachine + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", t, "multi") + } + } + if r.virtualMachineN != nil { + t := *r.virtualMachineN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", t, "multi") + } + } + if r.virtualMachineId != nil { + t := *r.virtualMachineId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", t, "multi") + } + } + if r.virtualMachineIdN != nil { + t := *r.virtualMachineIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", t, "multi") + } + } + if r.vlan != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan", r.vlan, "") + } + if r.vlanId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", r.vlanId, "") + } + if r.vrf != nil { + t := *r.vrf + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf", t, "multi") + } + } + if r.vrfN != nil { + t := *r.vrfN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf__n", t, "multi") + } + } + if r.vrfId != nil { + t := *r.vrfId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id", t, "multi") + } + } + if r.vrfIdN != nil { + t := *r.vrfIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vrf_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + patchedWritableVMInterfaceRequest *PatchedWritableVMInterfaceRequest +} + +func (r ApiVirtualizationInterfacesPartialUpdateRequest) PatchedWritableVMInterfaceRequest(patchedWritableVMInterfaceRequest PatchedWritableVMInterfaceRequest) ApiVirtualizationInterfacesPartialUpdateRequest { + r.patchedWritableVMInterfaceRequest = &patchedWritableVMInterfaceRequest + return r +} + +func (r ApiVirtualizationInterfacesPartialUpdateRequest) Execute() (*VMInterface, *http.Response, error) { + return r.ApiService.VirtualizationInterfacesPartialUpdateExecute(r) +} + +/* +VirtualizationInterfacesPartialUpdate Method for VirtualizationInterfacesPartialUpdate + +Patch a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiVirtualizationInterfacesPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesPartialUpdate(ctx context.Context, id int32) ApiVirtualizationInterfacesPartialUpdateRequest { + return ApiVirtualizationInterfacesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VMInterface +func (a *VirtualizationAPIService) VirtualizationInterfacesPartialUpdateExecute(r ApiVirtualizationInterfacesPartialUpdateRequest) (*VMInterface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VMInterface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableVMInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesRetrieveRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationInterfacesRetrieveRequest) Execute() (*VMInterface, *http.Response, error) { + return r.ApiService.VirtualizationInterfacesRetrieveExecute(r) +} + +/* +VirtualizationInterfacesRetrieve Method for VirtualizationInterfacesRetrieve + +Get a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiVirtualizationInterfacesRetrieveRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesRetrieve(ctx context.Context, id int32) ApiVirtualizationInterfacesRetrieveRequest { + return ApiVirtualizationInterfacesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VMInterface +func (a *VirtualizationAPIService) VirtualizationInterfacesRetrieveExecute(r ApiVirtualizationInterfacesRetrieveRequest) (*VMInterface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VMInterface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationInterfacesUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + writableVMInterfaceRequest *WritableVMInterfaceRequest +} + +func (r ApiVirtualizationInterfacesUpdateRequest) WritableVMInterfaceRequest(writableVMInterfaceRequest WritableVMInterfaceRequest) ApiVirtualizationInterfacesUpdateRequest { + r.writableVMInterfaceRequest = &writableVMInterfaceRequest + return r +} + +func (r ApiVirtualizationInterfacesUpdateRequest) Execute() (*VMInterface, *http.Response, error) { + return r.ApiService.VirtualizationInterfacesUpdateExecute(r) +} + +/* +VirtualizationInterfacesUpdate Method for VirtualizationInterfacesUpdate + +Put a interface object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this interface. + @return ApiVirtualizationInterfacesUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationInterfacesUpdate(ctx context.Context, id int32) ApiVirtualizationInterfacesUpdateRequest { + return ApiVirtualizationInterfacesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VMInterface +func (a *VirtualizationAPIService) VirtualizationInterfacesUpdateExecute(r ApiVirtualizationInterfacesUpdateRequest) (*VMInterface, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VMInterface + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationInterfacesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/interfaces/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVMInterfaceRequest == nil { + return localVarReturnValue, nil, reportError("writableVMInterfaceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVMInterfaceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksBulkDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + virtualDiskRequest *[]VirtualDiskRequest +} + +func (r ApiVirtualizationVirtualDisksBulkDestroyRequest) VirtualDiskRequest(virtualDiskRequest []VirtualDiskRequest) ApiVirtualizationVirtualDisksBulkDestroyRequest { + r.virtualDiskRequest = &virtualDiskRequest + return r +} + +func (r ApiVirtualizationVirtualDisksBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksBulkDestroyExecute(r) +} + +/* +VirtualizationVirtualDisksBulkDestroy Method for VirtualizationVirtualDisksBulkDestroy + +Delete a list of virtual disk objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualDisksBulkDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksBulkDestroy(ctx context.Context) ApiVirtualizationVirtualDisksBulkDestroyRequest { + return ApiVirtualizationVirtualDisksBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationVirtualDisksBulkDestroyExecute(r ApiVirtualizationVirtualDisksBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualDiskRequest == nil { + return nil, reportError("virtualDiskRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualDiskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + virtualDiskRequest *[]VirtualDiskRequest +} + +func (r ApiVirtualizationVirtualDisksBulkPartialUpdateRequest) VirtualDiskRequest(virtualDiskRequest []VirtualDiskRequest) ApiVirtualizationVirtualDisksBulkPartialUpdateRequest { + r.virtualDiskRequest = &virtualDiskRequest + return r +} + +func (r ApiVirtualizationVirtualDisksBulkPartialUpdateRequest) Execute() ([]VirtualDisk, *http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksBulkPartialUpdateExecute(r) +} + +/* +VirtualizationVirtualDisksBulkPartialUpdate Method for VirtualizationVirtualDisksBulkPartialUpdate + +Patch a list of virtual disk objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualDisksBulkPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksBulkPartialUpdate(ctx context.Context) ApiVirtualizationVirtualDisksBulkPartialUpdateRequest { + return ApiVirtualizationVirtualDisksBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualDisk +func (a *VirtualizationAPIService) VirtualizationVirtualDisksBulkPartialUpdateExecute(r ApiVirtualizationVirtualDisksBulkPartialUpdateRequest) ([]VirtualDisk, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualDisk + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualDiskRequest == nil { + return localVarReturnValue, nil, reportError("virtualDiskRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualDiskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksBulkUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + virtualDiskRequest *[]VirtualDiskRequest +} + +func (r ApiVirtualizationVirtualDisksBulkUpdateRequest) VirtualDiskRequest(virtualDiskRequest []VirtualDiskRequest) ApiVirtualizationVirtualDisksBulkUpdateRequest { + r.virtualDiskRequest = &virtualDiskRequest + return r +} + +func (r ApiVirtualizationVirtualDisksBulkUpdateRequest) Execute() ([]VirtualDisk, *http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksBulkUpdateExecute(r) +} + +/* +VirtualizationVirtualDisksBulkUpdate Method for VirtualizationVirtualDisksBulkUpdate + +Put a list of virtual disk objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualDisksBulkUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksBulkUpdate(ctx context.Context) ApiVirtualizationVirtualDisksBulkUpdateRequest { + return ApiVirtualizationVirtualDisksBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualDisk +func (a *VirtualizationAPIService) VirtualizationVirtualDisksBulkUpdateExecute(r ApiVirtualizationVirtualDisksBulkUpdateRequest) ([]VirtualDisk, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualDisk + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualDiskRequest == nil { + return localVarReturnValue, nil, reportError("virtualDiskRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualDiskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksCreateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + writableVirtualDiskRequest *WritableVirtualDiskRequest +} + +func (r ApiVirtualizationVirtualDisksCreateRequest) WritableVirtualDiskRequest(writableVirtualDiskRequest WritableVirtualDiskRequest) ApiVirtualizationVirtualDisksCreateRequest { + r.writableVirtualDiskRequest = &writableVirtualDiskRequest + return r +} + +func (r ApiVirtualizationVirtualDisksCreateRequest) Execute() (*VirtualDisk, *http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksCreateExecute(r) +} + +/* +VirtualizationVirtualDisksCreate Method for VirtualizationVirtualDisksCreate + +Post a list of virtual disk objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualDisksCreateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksCreate(ctx context.Context) ApiVirtualizationVirtualDisksCreateRequest { + return ApiVirtualizationVirtualDisksCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VirtualDisk +func (a *VirtualizationAPIService) VirtualizationVirtualDisksCreateExecute(r ApiVirtualizationVirtualDisksCreateRequest) (*VirtualDisk, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDisk + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualDiskRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualDiskRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualDiskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationVirtualDisksDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksDestroyExecute(r) +} + +/* +VirtualizationVirtualDisksDestroy Method for VirtualizationVirtualDisksDestroy + +Delete a virtual disk object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual disk. + @return ApiVirtualizationVirtualDisksDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksDestroy(ctx context.Context, id int32) ApiVirtualizationVirtualDisksDestroyRequest { + return ApiVirtualizationVirtualDisksDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationVirtualDisksDestroyExecute(r ApiVirtualizationVirtualDisksDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksListRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + size *[]int32 + sizeEmpty *bool + sizeGt *[]int32 + sizeGte *[]int32 + sizeLt *[]int32 + sizeLte *[]int32 + sizeN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string + virtualMachine *[]string + virtualMachineN *[]string + virtualMachineId *[]int32 + virtualMachineIdN *[]int32 +} + +func (r ApiVirtualizationVirtualDisksListRequest) Created(created []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.created = &created + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) CreatedGt(createdGt []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) CreatedGte(createdGte []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) CreatedLt(createdLt []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) CreatedLte(createdLte []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) CreatedN(createdN []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) CreatedByRequest(createdByRequest string) ApiVirtualizationVirtualDisksListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) Description(description []string) ApiVirtualizationVirtualDisksListRequest { + r.description = &description + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVirtualizationVirtualDisksListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionIc(descriptionIc []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionIe(descriptionIe []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionIew(descriptionIew []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionIsw(descriptionIsw []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionN(descriptionN []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionNic(descriptionNic []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionNie(descriptionNie []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionNiew(descriptionNiew []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) DescriptionNisw(descriptionNisw []string) ApiVirtualizationVirtualDisksListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) Id(id []int32) ApiVirtualizationVirtualDisksListRequest { + r.id = &id + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) IdEmpty(idEmpty bool) ApiVirtualizationVirtualDisksListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) IdGt(idGt []int32) ApiVirtualizationVirtualDisksListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) IdGte(idGte []int32) ApiVirtualizationVirtualDisksListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) IdLt(idLt []int32) ApiVirtualizationVirtualDisksListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) IdLte(idLte []int32) ApiVirtualizationVirtualDisksListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) IdN(idN []int32) ApiVirtualizationVirtualDisksListRequest { + r.idN = &idN + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) LastUpdated(lastUpdated []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVirtualizationVirtualDisksListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVirtualizationVirtualDisksListRequest) Limit(limit int32) ApiVirtualizationVirtualDisksListRequest { + r.limit = &limit + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) ModifiedByRequest(modifiedByRequest string) ApiVirtualizationVirtualDisksListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) Name(name []string) ApiVirtualizationVirtualDisksListRequest { + r.name = &name + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameEmpty(nameEmpty bool) ApiVirtualizationVirtualDisksListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameIc(nameIc []string) ApiVirtualizationVirtualDisksListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameIe(nameIe []string) ApiVirtualizationVirtualDisksListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameIew(nameIew []string) ApiVirtualizationVirtualDisksListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameIsw(nameIsw []string) ApiVirtualizationVirtualDisksListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameN(nameN []string) ApiVirtualizationVirtualDisksListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameNic(nameNic []string) ApiVirtualizationVirtualDisksListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameNie(nameNie []string) ApiVirtualizationVirtualDisksListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameNiew(nameNiew []string) ApiVirtualizationVirtualDisksListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) NameNisw(nameNisw []string) ApiVirtualizationVirtualDisksListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVirtualizationVirtualDisksListRequest) Offset(offset int32) ApiVirtualizationVirtualDisksListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVirtualizationVirtualDisksListRequest) Ordering(ordering string) ApiVirtualizationVirtualDisksListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVirtualizationVirtualDisksListRequest) Q(q string) ApiVirtualizationVirtualDisksListRequest { + r.q = &q + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) Size(size []int32) ApiVirtualizationVirtualDisksListRequest { + r.size = &size + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) SizeEmpty(sizeEmpty bool) ApiVirtualizationVirtualDisksListRequest { + r.sizeEmpty = &sizeEmpty + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) SizeGt(sizeGt []int32) ApiVirtualizationVirtualDisksListRequest { + r.sizeGt = &sizeGt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) SizeGte(sizeGte []int32) ApiVirtualizationVirtualDisksListRequest { + r.sizeGte = &sizeGte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) SizeLt(sizeLt []int32) ApiVirtualizationVirtualDisksListRequest { + r.sizeLt = &sizeLt + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) SizeLte(sizeLte []int32) ApiVirtualizationVirtualDisksListRequest { + r.sizeLte = &sizeLte + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) SizeN(sizeN []int32) ApiVirtualizationVirtualDisksListRequest { + r.sizeN = &sizeN + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) Tag(tag []string) ApiVirtualizationVirtualDisksListRequest { + r.tag = &tag + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) TagN(tagN []string) ApiVirtualizationVirtualDisksListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) UpdatedByRequest(updatedByRequest string) ApiVirtualizationVirtualDisksListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual machine +func (r ApiVirtualizationVirtualDisksListRequest) VirtualMachine(virtualMachine []string) ApiVirtualizationVirtualDisksListRequest { + r.virtualMachine = &virtualMachine + return r +} + +// Virtual machine +func (r ApiVirtualizationVirtualDisksListRequest) VirtualMachineN(virtualMachineN []string) ApiVirtualizationVirtualDisksListRequest { + r.virtualMachineN = &virtualMachineN + return r +} + +// Virtual machine (ID) +func (r ApiVirtualizationVirtualDisksListRequest) VirtualMachineId(virtualMachineId []int32) ApiVirtualizationVirtualDisksListRequest { + r.virtualMachineId = &virtualMachineId + return r +} + +// Virtual machine (ID) +func (r ApiVirtualizationVirtualDisksListRequest) VirtualMachineIdN(virtualMachineIdN []int32) ApiVirtualizationVirtualDisksListRequest { + r.virtualMachineIdN = &virtualMachineIdN + return r +} + +func (r ApiVirtualizationVirtualDisksListRequest) Execute() (*PaginatedVirtualDiskList, *http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksListExecute(r) +} + +/* +VirtualizationVirtualDisksList Method for VirtualizationVirtualDisksList + +Get a list of virtual disk objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualDisksListRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksList(ctx context.Context) ApiVirtualizationVirtualDisksListRequest { + return ApiVirtualizationVirtualDisksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVirtualDiskList +func (a *VirtualizationAPIService) VirtualizationVirtualDisksListExecute(r ApiVirtualizationVirtualDisksListRequest) (*PaginatedVirtualDiskList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVirtualDiskList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.size != nil { + t := *r.size + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", t, "multi") + } + } + if r.sizeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__empty", r.sizeEmpty, "") + } + if r.sizeGt != nil { + t := *r.sizeGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gt", t, "multi") + } + } + if r.sizeGte != nil { + t := *r.sizeGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__gte", t, "multi") + } + } + if r.sizeLt != nil { + t := *r.sizeLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lt", t, "multi") + } + } + if r.sizeLte != nil { + t := *r.sizeLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__lte", t, "multi") + } + } + if r.sizeN != nil { + t := *r.sizeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "size__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualMachine != nil { + t := *r.virtualMachine + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", t, "multi") + } + } + if r.virtualMachineN != nil { + t := *r.virtualMachineN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", t, "multi") + } + } + if r.virtualMachineId != nil { + t := *r.virtualMachineId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", t, "multi") + } + } + if r.virtualMachineIdN != nil { + t := *r.virtualMachineIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + patchedWritableVirtualDiskRequest *PatchedWritableVirtualDiskRequest +} + +func (r ApiVirtualizationVirtualDisksPartialUpdateRequest) PatchedWritableVirtualDiskRequest(patchedWritableVirtualDiskRequest PatchedWritableVirtualDiskRequest) ApiVirtualizationVirtualDisksPartialUpdateRequest { + r.patchedWritableVirtualDiskRequest = &patchedWritableVirtualDiskRequest + return r +} + +func (r ApiVirtualizationVirtualDisksPartialUpdateRequest) Execute() (*VirtualDisk, *http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksPartialUpdateExecute(r) +} + +/* +VirtualizationVirtualDisksPartialUpdate Method for VirtualizationVirtualDisksPartialUpdate + +Patch a virtual disk object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual disk. + @return ApiVirtualizationVirtualDisksPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksPartialUpdate(ctx context.Context, id int32) ApiVirtualizationVirtualDisksPartialUpdateRequest { + return ApiVirtualizationVirtualDisksPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualDisk +func (a *VirtualizationAPIService) VirtualizationVirtualDisksPartialUpdateExecute(r ApiVirtualizationVirtualDisksPartialUpdateRequest) (*VirtualDisk, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDisk + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableVirtualDiskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksRetrieveRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationVirtualDisksRetrieveRequest) Execute() (*VirtualDisk, *http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksRetrieveExecute(r) +} + +/* +VirtualizationVirtualDisksRetrieve Method for VirtualizationVirtualDisksRetrieve + +Get a virtual disk object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual disk. + @return ApiVirtualizationVirtualDisksRetrieveRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksRetrieve(ctx context.Context, id int32) ApiVirtualizationVirtualDisksRetrieveRequest { + return ApiVirtualizationVirtualDisksRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualDisk +func (a *VirtualizationAPIService) VirtualizationVirtualDisksRetrieveExecute(r ApiVirtualizationVirtualDisksRetrieveRequest) (*VirtualDisk, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDisk + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualDisksUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + writableVirtualDiskRequest *WritableVirtualDiskRequest +} + +func (r ApiVirtualizationVirtualDisksUpdateRequest) WritableVirtualDiskRequest(writableVirtualDiskRequest WritableVirtualDiskRequest) ApiVirtualizationVirtualDisksUpdateRequest { + r.writableVirtualDiskRequest = &writableVirtualDiskRequest + return r +} + +func (r ApiVirtualizationVirtualDisksUpdateRequest) Execute() (*VirtualDisk, *http.Response, error) { + return r.ApiService.VirtualizationVirtualDisksUpdateExecute(r) +} + +/* +VirtualizationVirtualDisksUpdate Method for VirtualizationVirtualDisksUpdate + +Put a virtual disk object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual disk. + @return ApiVirtualizationVirtualDisksUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualDisksUpdate(ctx context.Context, id int32) ApiVirtualizationVirtualDisksUpdateRequest { + return ApiVirtualizationVirtualDisksUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualDisk +func (a *VirtualizationAPIService) VirtualizationVirtualDisksUpdateExecute(r ApiVirtualizationVirtualDisksUpdateRequest) (*VirtualDisk, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualDisk + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualDisksUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-disks/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualDiskRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualDiskRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualDiskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesBulkDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + virtualMachineWithConfigContextRequest *[]VirtualMachineWithConfigContextRequest +} + +func (r ApiVirtualizationVirtualMachinesBulkDestroyRequest) VirtualMachineWithConfigContextRequest(virtualMachineWithConfigContextRequest []VirtualMachineWithConfigContextRequest) ApiVirtualizationVirtualMachinesBulkDestroyRequest { + r.virtualMachineWithConfigContextRequest = &virtualMachineWithConfigContextRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesBulkDestroyExecute(r) +} + +/* +VirtualizationVirtualMachinesBulkDestroy Method for VirtualizationVirtualMachinesBulkDestroy + +Delete a list of virtual machine objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualMachinesBulkDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesBulkDestroy(ctx context.Context) ApiVirtualizationVirtualMachinesBulkDestroyRequest { + return ApiVirtualizationVirtualMachinesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesBulkDestroyExecute(r ApiVirtualizationVirtualMachinesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualMachineWithConfigContextRequest == nil { + return nil, reportError("virtualMachineWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualMachineWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + virtualMachineWithConfigContextRequest *[]VirtualMachineWithConfigContextRequest +} + +func (r ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest) VirtualMachineWithConfigContextRequest(virtualMachineWithConfigContextRequest []VirtualMachineWithConfigContextRequest) ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest { + r.virtualMachineWithConfigContextRequest = &virtualMachineWithConfigContextRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest) Execute() ([]VirtualMachineWithConfigContext, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesBulkPartialUpdateExecute(r) +} + +/* +VirtualizationVirtualMachinesBulkPartialUpdate Method for VirtualizationVirtualMachinesBulkPartialUpdate + +Patch a list of virtual machine objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesBulkPartialUpdate(ctx context.Context) ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest { + return ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualMachineWithConfigContext +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesBulkPartialUpdateExecute(r ApiVirtualizationVirtualMachinesBulkPartialUpdateRequest) ([]VirtualMachineWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualMachineWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualMachineWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("virtualMachineWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualMachineWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesBulkUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + virtualMachineWithConfigContextRequest *[]VirtualMachineWithConfigContextRequest +} + +func (r ApiVirtualizationVirtualMachinesBulkUpdateRequest) VirtualMachineWithConfigContextRequest(virtualMachineWithConfigContextRequest []VirtualMachineWithConfigContextRequest) ApiVirtualizationVirtualMachinesBulkUpdateRequest { + r.virtualMachineWithConfigContextRequest = &virtualMachineWithConfigContextRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesBulkUpdateRequest) Execute() ([]VirtualMachineWithConfigContext, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesBulkUpdateExecute(r) +} + +/* +VirtualizationVirtualMachinesBulkUpdate Method for VirtualizationVirtualMachinesBulkUpdate + +Put a list of virtual machine objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualMachinesBulkUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesBulkUpdate(ctx context.Context) ApiVirtualizationVirtualMachinesBulkUpdateRequest { + return ApiVirtualizationVirtualMachinesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VirtualMachineWithConfigContext +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesBulkUpdateExecute(r ApiVirtualizationVirtualMachinesBulkUpdateRequest) ([]VirtualMachineWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VirtualMachineWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualMachineWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("virtualMachineWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualMachineWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesCreateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + writableVirtualMachineWithConfigContextRequest *WritableVirtualMachineWithConfigContextRequest +} + +func (r ApiVirtualizationVirtualMachinesCreateRequest) WritableVirtualMachineWithConfigContextRequest(writableVirtualMachineWithConfigContextRequest WritableVirtualMachineWithConfigContextRequest) ApiVirtualizationVirtualMachinesCreateRequest { + r.writableVirtualMachineWithConfigContextRequest = &writableVirtualMachineWithConfigContextRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesCreateRequest) Execute() (*VirtualMachineWithConfigContext, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesCreateExecute(r) +} + +/* +VirtualizationVirtualMachinesCreate Method for VirtualizationVirtualMachinesCreate + +Post a list of virtual machine objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualMachinesCreateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesCreate(ctx context.Context) ApiVirtualizationVirtualMachinesCreateRequest { + return ApiVirtualizationVirtualMachinesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return VirtualMachineWithConfigContext +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesCreateExecute(r ApiVirtualizationVirtualMachinesCreateRequest) (*VirtualMachineWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualMachineWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualMachineWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualMachineWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualMachineWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesDestroyRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationVirtualMachinesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesDestroyExecute(r) +} + +/* +VirtualizationVirtualMachinesDestroy Method for VirtualizationVirtualMachinesDestroy + +Delete a virtual machine object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual machine. + @return ApiVirtualizationVirtualMachinesDestroyRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesDestroy(ctx context.Context, id int32) ApiVirtualizationVirtualMachinesDestroyRequest { + return ApiVirtualizationVirtualMachinesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesDestroyExecute(r ApiVirtualizationVirtualMachinesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesListRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + cluster *[]string + clusterN *[]string + clusterGroup *[]string + clusterGroupN *[]string + clusterGroupId *[]int32 + clusterGroupIdN *[]int32 + clusterId *[]*int32 + clusterIdN *[]*int32 + clusterType *[]string + clusterTypeN *[]string + clusterTypeId *[]int32 + clusterTypeIdN *[]int32 + configTemplateId *[]*int32 + configTemplateIdN *[]*int32 + contact *[]int32 + contactN *[]int32 + contactGroup *[]int32 + contactGroupN *[]int32 + contactRole *[]int32 + contactRoleN *[]int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + device *[]*string + deviceN *[]*string + deviceId *[]*int32 + deviceIdN *[]*int32 + disk *[]int32 + diskEmpty *bool + diskGt *[]int32 + diskGte *[]int32 + diskLt *[]int32 + diskLte *[]int32 + diskN *[]int32 + hasPrimaryIp *bool + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + localContextData *bool + macAddress *[]string + macAddressIc *[]string + macAddressIe *[]string + macAddressIew *[]string + macAddressIsw *[]string + macAddressN *[]string + macAddressNic *[]string + macAddressNie *[]string + macAddressNiew *[]string + macAddressNisw *[]string + memory *[]int32 + memoryEmpty *bool + memoryGt *[]int32 + memoryGte *[]int32 + memoryLt *[]int32 + memoryLte *[]int32 + memoryN *[]int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + platform *[]string + platformN *[]string + platformId *[]*int32 + platformIdN *[]*int32 + primaryIp4Id *[]int32 + primaryIp4IdN *[]int32 + primaryIp6Id *[]int32 + primaryIp6IdN *[]int32 + q *string + region *[]int32 + regionN *[]int32 + regionId *[]int32 + regionIdN *[]int32 + role *[]string + roleN *[]string + roleId *[]*int32 + roleIdN *[]*int32 + site *[]string + siteN *[]string + siteGroup *[]int32 + siteGroupN *[]int32 + siteGroupId *[]int32 + siteGroupIdN *[]int32 + siteId *[]*int32 + siteIdN *[]*int32 + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + vcpus *[]float64 + vcpusEmpty *bool + vcpusGt *[]float64 + vcpusGte *[]float64 + vcpusLt *[]float64 + vcpusLte *[]float64 + vcpusN *[]float64 +} + +// Cluster +func (r ApiVirtualizationVirtualMachinesListRequest) Cluster(cluster []string) ApiVirtualizationVirtualMachinesListRequest { + r.cluster = &cluster + return r +} + +// Cluster +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterN(clusterN []string) ApiVirtualizationVirtualMachinesListRequest { + r.clusterN = &clusterN + return r +} + +// Cluster group (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterGroup(clusterGroup []string) ApiVirtualizationVirtualMachinesListRequest { + r.clusterGroup = &clusterGroup + return r +} + +// Cluster group (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterGroupN(clusterGroupN []string) ApiVirtualizationVirtualMachinesListRequest { + r.clusterGroupN = &clusterGroupN + return r +} + +// Cluster group (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterGroupId(clusterGroupId []int32) ApiVirtualizationVirtualMachinesListRequest { + r.clusterGroupId = &clusterGroupId + return r +} + +// Cluster group (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterGroupIdN(clusterGroupIdN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.clusterGroupIdN = &clusterGroupIdN + return r +} + +// Cluster (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterId(clusterId []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.clusterId = &clusterId + return r +} + +// Cluster (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterIdN(clusterIdN []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.clusterIdN = &clusterIdN + return r +} + +// Cluster type (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterType(clusterType []string) ApiVirtualizationVirtualMachinesListRequest { + r.clusterType = &clusterType + return r +} + +// Cluster type (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterTypeN(clusterTypeN []string) ApiVirtualizationVirtualMachinesListRequest { + r.clusterTypeN = &clusterTypeN + return r +} + +// Cluster type (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterTypeId(clusterTypeId []int32) ApiVirtualizationVirtualMachinesListRequest { + r.clusterTypeId = &clusterTypeId + return r +} + +// Cluster type (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ClusterTypeIdN(clusterTypeIdN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.clusterTypeIdN = &clusterTypeIdN + return r +} + +// Config template (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ConfigTemplateId(configTemplateId []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.configTemplateId = &configTemplateId + return r +} + +// Config template (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) ConfigTemplateIdN(configTemplateIdN []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.configTemplateIdN = &configTemplateIdN + return r +} + +// Contact +func (r ApiVirtualizationVirtualMachinesListRequest) Contact(contact []int32) ApiVirtualizationVirtualMachinesListRequest { + r.contact = &contact + return r +} + +// Contact +func (r ApiVirtualizationVirtualMachinesListRequest) ContactN(contactN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.contactN = &contactN + return r +} + +// Contact group +func (r ApiVirtualizationVirtualMachinesListRequest) ContactGroup(contactGroup []int32) ApiVirtualizationVirtualMachinesListRequest { + r.contactGroup = &contactGroup + return r +} + +// Contact group +func (r ApiVirtualizationVirtualMachinesListRequest) ContactGroupN(contactGroupN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.contactGroupN = &contactGroupN + return r +} + +// Contact Role +func (r ApiVirtualizationVirtualMachinesListRequest) ContactRole(contactRole []int32) ApiVirtualizationVirtualMachinesListRequest { + r.contactRole = &contactRole + return r +} + +// Contact Role +func (r ApiVirtualizationVirtualMachinesListRequest) ContactRoleN(contactRoleN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.contactRoleN = &contactRoleN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Created(created []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.created = &created + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) CreatedGt(createdGt []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) CreatedGte(createdGte []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) CreatedLt(createdLt []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) CreatedLte(createdLte []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) CreatedN(createdN []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) CreatedByRequest(createdByRequest string) ApiVirtualizationVirtualMachinesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Description(description []string) ApiVirtualizationVirtualMachinesListRequest { + r.description = &description + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionIc(descriptionIc []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionIe(descriptionIe []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionIew(descriptionIew []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionIsw(descriptionIsw []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionN(descriptionN []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionNic(descriptionNic []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionNie(descriptionNie []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionNiew(descriptionNiew []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DescriptionNisw(descriptionNisw []string) ApiVirtualizationVirtualMachinesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Device +func (r ApiVirtualizationVirtualMachinesListRequest) Device(device []*string) ApiVirtualizationVirtualMachinesListRequest { + r.device = &device + return r +} + +// Device +func (r ApiVirtualizationVirtualMachinesListRequest) DeviceN(deviceN []*string) ApiVirtualizationVirtualMachinesListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) DeviceId(deviceId []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) DeviceIdN(deviceIdN []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.deviceIdN = &deviceIdN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Disk(disk []int32) ApiVirtualizationVirtualMachinesListRequest { + r.disk = &disk + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DiskEmpty(diskEmpty bool) ApiVirtualizationVirtualMachinesListRequest { + r.diskEmpty = &diskEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DiskGt(diskGt []int32) ApiVirtualizationVirtualMachinesListRequest { + r.diskGt = &diskGt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DiskGte(diskGte []int32) ApiVirtualizationVirtualMachinesListRequest { + r.diskGte = &diskGte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DiskLt(diskLt []int32) ApiVirtualizationVirtualMachinesListRequest { + r.diskLt = &diskLt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DiskLte(diskLte []int32) ApiVirtualizationVirtualMachinesListRequest { + r.diskLte = &diskLte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) DiskN(diskN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.diskN = &diskN + return r +} + +// Has a primary IP +func (r ApiVirtualizationVirtualMachinesListRequest) HasPrimaryIp(hasPrimaryIp bool) ApiVirtualizationVirtualMachinesListRequest { + r.hasPrimaryIp = &hasPrimaryIp + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Id(id []int32) ApiVirtualizationVirtualMachinesListRequest { + r.id = &id + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) IdEmpty(idEmpty bool) ApiVirtualizationVirtualMachinesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) IdGt(idGt []int32) ApiVirtualizationVirtualMachinesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) IdGte(idGte []int32) ApiVirtualizationVirtualMachinesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) IdLt(idLt []int32) ApiVirtualizationVirtualMachinesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) IdLte(idLte []int32) ApiVirtualizationVirtualMachinesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) IdN(idN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.idN = &idN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) LastUpdated(lastUpdated []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVirtualizationVirtualMachinesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVirtualizationVirtualMachinesListRequest) Limit(limit int32) ApiVirtualizationVirtualMachinesListRequest { + r.limit = &limit + return r +} + +// Has local config context data +func (r ApiVirtualizationVirtualMachinesListRequest) LocalContextData(localContextData bool) ApiVirtualizationVirtualMachinesListRequest { + r.localContextData = &localContextData + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddress(macAddress []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddress = &macAddress + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressIc(macAddressIc []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressIc = &macAddressIc + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressIe(macAddressIe []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressIe = &macAddressIe + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressIew(macAddressIew []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressIew = &macAddressIew + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressIsw(macAddressIsw []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressIsw = &macAddressIsw + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressN(macAddressN []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressN = &macAddressN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressNic(macAddressNic []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressNic = &macAddressNic + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressNie(macAddressNie []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressNie = &macAddressNie + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressNiew(macAddressNiew []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressNiew = &macAddressNiew + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MacAddressNisw(macAddressNisw []string) ApiVirtualizationVirtualMachinesListRequest { + r.macAddressNisw = &macAddressNisw + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Memory(memory []int32) ApiVirtualizationVirtualMachinesListRequest { + r.memory = &memory + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MemoryEmpty(memoryEmpty bool) ApiVirtualizationVirtualMachinesListRequest { + r.memoryEmpty = &memoryEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MemoryGt(memoryGt []int32) ApiVirtualizationVirtualMachinesListRequest { + r.memoryGt = &memoryGt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MemoryGte(memoryGte []int32) ApiVirtualizationVirtualMachinesListRequest { + r.memoryGte = &memoryGte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MemoryLt(memoryLt []int32) ApiVirtualizationVirtualMachinesListRequest { + r.memoryLt = &memoryLt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MemoryLte(memoryLte []int32) ApiVirtualizationVirtualMachinesListRequest { + r.memoryLte = &memoryLte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) MemoryN(memoryN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.memoryN = &memoryN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) ModifiedByRequest(modifiedByRequest string) ApiVirtualizationVirtualMachinesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Name(name []string) ApiVirtualizationVirtualMachinesListRequest { + r.name = &name + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameEmpty(nameEmpty bool) ApiVirtualizationVirtualMachinesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameIc(nameIc []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameIe(nameIe []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameIew(nameIew []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameIsw(nameIsw []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameN(nameN []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameNic(nameNic []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameNie(nameNie []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameNiew(nameNiew []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) NameNisw(nameNisw []string) ApiVirtualizationVirtualMachinesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVirtualizationVirtualMachinesListRequest) Offset(offset int32) ApiVirtualizationVirtualMachinesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVirtualizationVirtualMachinesListRequest) Ordering(ordering string) ApiVirtualizationVirtualMachinesListRequest { + r.ordering = &ordering + return r +} + +// Platform (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) Platform(platform []string) ApiVirtualizationVirtualMachinesListRequest { + r.platform = &platform + return r +} + +// Platform (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) PlatformN(platformN []string) ApiVirtualizationVirtualMachinesListRequest { + r.platformN = &platformN + return r +} + +// Platform (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) PlatformId(platformId []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.platformId = &platformId + return r +} + +// Platform (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) PlatformIdN(platformIdN []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.platformIdN = &platformIdN + return r +} + +// Primary IPv4 (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) PrimaryIp4Id(primaryIp4Id []int32) ApiVirtualizationVirtualMachinesListRequest { + r.primaryIp4Id = &primaryIp4Id + return r +} + +// Primary IPv4 (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) PrimaryIp4IdN(primaryIp4IdN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.primaryIp4IdN = &primaryIp4IdN + return r +} + +// Primary IPv6 (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) PrimaryIp6Id(primaryIp6Id []int32) ApiVirtualizationVirtualMachinesListRequest { + r.primaryIp6Id = &primaryIp6Id + return r +} + +// Primary IPv6 (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) PrimaryIp6IdN(primaryIp6IdN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.primaryIp6IdN = &primaryIp6IdN + return r +} + +// Search +func (r ApiVirtualizationVirtualMachinesListRequest) Q(q string) ApiVirtualizationVirtualMachinesListRequest { + r.q = &q + return r +} + +// Region (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) Region(region []int32) ApiVirtualizationVirtualMachinesListRequest { + r.region = ®ion + return r +} + +// Region (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) RegionN(regionN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.regionN = ®ionN + return r +} + +// Region (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) RegionId(regionId []int32) ApiVirtualizationVirtualMachinesListRequest { + r.regionId = ®ionId + return r +} + +// Region (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) RegionIdN(regionIdN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.regionIdN = ®ionIdN + return r +} + +// Role (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) Role(role []string) ApiVirtualizationVirtualMachinesListRequest { + r.role = &role + return r +} + +// Role (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) RoleN(roleN []string) ApiVirtualizationVirtualMachinesListRequest { + r.roleN = &roleN + return r +} + +// Role (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) RoleId(roleId []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.roleId = &roleId + return r +} + +// Role (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) RoleIdN(roleIdN []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.roleIdN = &roleIdN + return r +} + +// Site (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) Site(site []string) ApiVirtualizationVirtualMachinesListRequest { + r.site = &site + return r +} + +// Site (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) SiteN(siteN []string) ApiVirtualizationVirtualMachinesListRequest { + r.siteN = &siteN + return r +} + +// Site group (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) SiteGroup(siteGroup []int32) ApiVirtualizationVirtualMachinesListRequest { + r.siteGroup = &siteGroup + return r +} + +// Site group (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) SiteGroupN(siteGroupN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.siteGroupN = &siteGroupN + return r +} + +// Site group (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) SiteGroupId(siteGroupId []int32) ApiVirtualizationVirtualMachinesListRequest { + r.siteGroupId = &siteGroupId + return r +} + +// Site group (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) SiteGroupIdN(siteGroupIdN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.siteGroupIdN = &siteGroupIdN + return r +} + +// Site (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) SiteId(siteId []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.siteId = &siteId + return r +} + +// Site (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) SiteIdN(siteIdN []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.siteIdN = &siteIdN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Status(status []string) ApiVirtualizationVirtualMachinesListRequest { + r.status = &status + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) StatusN(statusN []string) ApiVirtualizationVirtualMachinesListRequest { + r.statusN = &statusN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Tag(tag []string) ApiVirtualizationVirtualMachinesListRequest { + r.tag = &tag + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) TagN(tagN []string) ApiVirtualizationVirtualMachinesListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) Tenant(tenant []string) ApiVirtualizationVirtualMachinesListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) TenantN(tenantN []string) ApiVirtualizationVirtualMachinesListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) TenantGroup(tenantGroup []int32) ApiVirtualizationVirtualMachinesListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiVirtualizationVirtualMachinesListRequest) TenantGroupN(tenantGroupN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) TenantGroupId(tenantGroupId []int32) ApiVirtualizationVirtualMachinesListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiVirtualizationVirtualMachinesListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) TenantId(tenantId []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiVirtualizationVirtualMachinesListRequest) TenantIdN(tenantIdN []*int32) ApiVirtualizationVirtualMachinesListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) UpdatedByRequest(updatedByRequest string) ApiVirtualizationVirtualMachinesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Vcpus(vcpus []float64) ApiVirtualizationVirtualMachinesListRequest { + r.vcpus = &vcpus + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) VcpusEmpty(vcpusEmpty bool) ApiVirtualizationVirtualMachinesListRequest { + r.vcpusEmpty = &vcpusEmpty + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) VcpusGt(vcpusGt []float64) ApiVirtualizationVirtualMachinesListRequest { + r.vcpusGt = &vcpusGt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) VcpusGte(vcpusGte []float64) ApiVirtualizationVirtualMachinesListRequest { + r.vcpusGte = &vcpusGte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) VcpusLt(vcpusLt []float64) ApiVirtualizationVirtualMachinesListRequest { + r.vcpusLt = &vcpusLt + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) VcpusLte(vcpusLte []float64) ApiVirtualizationVirtualMachinesListRequest { + r.vcpusLte = &vcpusLte + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) VcpusN(vcpusN []float64) ApiVirtualizationVirtualMachinesListRequest { + r.vcpusN = &vcpusN + return r +} + +func (r ApiVirtualizationVirtualMachinesListRequest) Execute() (*PaginatedVirtualMachineWithConfigContextList, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesListExecute(r) +} + +/* +VirtualizationVirtualMachinesList Method for VirtualizationVirtualMachinesList + +Get a list of virtual machine objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVirtualizationVirtualMachinesListRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesList(ctx context.Context) ApiVirtualizationVirtualMachinesListRequest { + return ApiVirtualizationVirtualMachinesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedVirtualMachineWithConfigContextList +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesListExecute(r ApiVirtualizationVirtualMachinesListRequest) (*PaginatedVirtualMachineWithConfigContextList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedVirtualMachineWithConfigContextList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cluster != nil { + t := *r.cluster + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster", t, "multi") + } + } + if r.clusterN != nil { + t := *r.clusterN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster__n", t, "multi") + } + } + if r.clusterGroup != nil { + t := *r.clusterGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group", t, "multi") + } + } + if r.clusterGroupN != nil { + t := *r.clusterGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group__n", t, "multi") + } + } + if r.clusterGroupId != nil { + t := *r.clusterGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id", t, "multi") + } + } + if r.clusterGroupIdN != nil { + t := *r.clusterGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_group_id__n", t, "multi") + } + } + if r.clusterId != nil { + t := *r.clusterId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id", t, "multi") + } + } + if r.clusterIdN != nil { + t := *r.clusterIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_id__n", t, "multi") + } + } + if r.clusterType != nil { + t := *r.clusterType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type", t, "multi") + } + } + if r.clusterTypeN != nil { + t := *r.clusterTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type__n", t, "multi") + } + } + if r.clusterTypeId != nil { + t := *r.clusterTypeId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id", t, "multi") + } + } + if r.clusterTypeIdN != nil { + t := *r.clusterTypeIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "cluster_type_id__n", t, "multi") + } + } + if r.configTemplateId != nil { + t := *r.configTemplateId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id", t, "multi") + } + } + if r.configTemplateIdN != nil { + t := *r.configTemplateIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "config_template_id__n", t, "multi") + } + } + if r.contact != nil { + t := *r.contact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact", t, "multi") + } + } + if r.contactN != nil { + t := *r.contactN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact__n", t, "multi") + } + } + if r.contactGroup != nil { + t := *r.contactGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group", t, "multi") + } + } + if r.contactGroupN != nil { + t := *r.contactGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_group__n", t, "multi") + } + } + if r.contactRole != nil { + t := *r.contactRole + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role", t, "multi") + } + } + if r.contactRoleN != nil { + t := *r.contactRoleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "contact_role__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.disk != nil { + t := *r.disk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk", t, "multi") + } + } + if r.diskEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__empty", r.diskEmpty, "") + } + if r.diskGt != nil { + t := *r.diskGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__gt", t, "multi") + } + } + if r.diskGte != nil { + t := *r.diskGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__gte", t, "multi") + } + } + if r.diskLt != nil { + t := *r.diskLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__lt", t, "multi") + } + } + if r.diskLte != nil { + t := *r.diskLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__lte", t, "multi") + } + } + if r.diskN != nil { + t := *r.diskN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "disk__n", t, "multi") + } + } + if r.hasPrimaryIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_primary_ip", r.hasPrimaryIp, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.localContextData != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "local_context_data", r.localContextData, "") + } + if r.macAddress != nil { + t := *r.macAddress + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address", t, "multi") + } + } + if r.macAddressIc != nil { + t := *r.macAddressIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ic", t, "multi") + } + } + if r.macAddressIe != nil { + t := *r.macAddressIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__ie", t, "multi") + } + } + if r.macAddressIew != nil { + t := *r.macAddressIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__iew", t, "multi") + } + } + if r.macAddressIsw != nil { + t := *r.macAddressIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__isw", t, "multi") + } + } + if r.macAddressN != nil { + t := *r.macAddressN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__n", t, "multi") + } + } + if r.macAddressNic != nil { + t := *r.macAddressNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nic", t, "multi") + } + } + if r.macAddressNie != nil { + t := *r.macAddressNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nie", t, "multi") + } + } + if r.macAddressNiew != nil { + t := *r.macAddressNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__niew", t, "multi") + } + } + if r.macAddressNisw != nil { + t := *r.macAddressNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mac_address__nisw", t, "multi") + } + } + if r.memory != nil { + t := *r.memory + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", t, "multi") + } + } + if r.memoryEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__empty", r.memoryEmpty, "") + } + if r.memoryGt != nil { + t := *r.memoryGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__gt", t, "multi") + } + } + if r.memoryGte != nil { + t := *r.memoryGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__gte", t, "multi") + } + } + if r.memoryLt != nil { + t := *r.memoryLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__lt", t, "multi") + } + } + if r.memoryLte != nil { + t := *r.memoryLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__lte", t, "multi") + } + } + if r.memoryN != nil { + t := *r.memoryN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.platform != nil { + t := *r.platform + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform", t, "multi") + } + } + if r.platformN != nil { + t := *r.platformN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform__n", t, "multi") + } + } + if r.platformId != nil { + t := *r.platformId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id", t, "multi") + } + } + if r.platformIdN != nil { + t := *r.platformIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "platform_id__n", t, "multi") + } + } + if r.primaryIp4Id != nil { + t := *r.primaryIp4Id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id", t, "multi") + } + } + if r.primaryIp4IdN != nil { + t := *r.primaryIp4IdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip4_id__n", t, "multi") + } + } + if r.primaryIp6Id != nil { + t := *r.primaryIp6Id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id", t, "multi") + } + } + if r.primaryIp6IdN != nil { + t := *r.primaryIp6IdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "primary_ip6_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionN != nil { + t := *r.regionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region__n", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.regionIdN != nil { + t := *r.regionIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id__n", t, "multi") + } + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.roleId != nil { + t := *r.roleId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id", t, "multi") + } + } + if r.roleIdN != nil { + t := *r.roleIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role_id__n", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteN != nil { + t := *r.siteN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site__n", t, "multi") + } + } + if r.siteGroup != nil { + t := *r.siteGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group", t, "multi") + } + } + if r.siteGroupN != nil { + t := *r.siteGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group__n", t, "multi") + } + } + if r.siteGroupId != nil { + t := *r.siteGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id", t, "multi") + } + } + if r.siteGroupIdN != nil { + t := *r.siteGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_group_id__n", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.siteIdN != nil { + t := *r.siteIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id__n", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vcpus != nil { + t := *r.vcpus + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus", t, "multi") + } + } + if r.vcpusEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__empty", r.vcpusEmpty, "") + } + if r.vcpusGt != nil { + t := *r.vcpusGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__gt", t, "multi") + } + } + if r.vcpusGte != nil { + t := *r.vcpusGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__gte", t, "multi") + } + } + if r.vcpusLt != nil { + t := *r.vcpusLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__lt", t, "multi") + } + } + if r.vcpusLte != nil { + t := *r.vcpusLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__lte", t, "multi") + } + } + if r.vcpusN != nil { + t := *r.vcpusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vcpus__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesPartialUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + patchedWritableVirtualMachineWithConfigContextRequest *PatchedWritableVirtualMachineWithConfigContextRequest +} + +func (r ApiVirtualizationVirtualMachinesPartialUpdateRequest) PatchedWritableVirtualMachineWithConfigContextRequest(patchedWritableVirtualMachineWithConfigContextRequest PatchedWritableVirtualMachineWithConfigContextRequest) ApiVirtualizationVirtualMachinesPartialUpdateRequest { + r.patchedWritableVirtualMachineWithConfigContextRequest = &patchedWritableVirtualMachineWithConfigContextRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesPartialUpdateRequest) Execute() (*VirtualMachineWithConfigContext, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesPartialUpdateExecute(r) +} + +/* +VirtualizationVirtualMachinesPartialUpdate Method for VirtualizationVirtualMachinesPartialUpdate + +Patch a virtual machine object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual machine. + @return ApiVirtualizationVirtualMachinesPartialUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesPartialUpdate(ctx context.Context, id int32) ApiVirtualizationVirtualMachinesPartialUpdateRequest { + return ApiVirtualizationVirtualMachinesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualMachineWithConfigContext +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesPartialUpdateExecute(r ApiVirtualizationVirtualMachinesPartialUpdateRequest) (*VirtualMachineWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualMachineWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableVirtualMachineWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesRenderConfigCreateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + writableVirtualMachineWithConfigContextRequest *WritableVirtualMachineWithConfigContextRequest + format *DcimDevicesRenderConfigCreateFormatParameter +} + +func (r ApiVirtualizationVirtualMachinesRenderConfigCreateRequest) WritableVirtualMachineWithConfigContextRequest(writableVirtualMachineWithConfigContextRequest WritableVirtualMachineWithConfigContextRequest) ApiVirtualizationVirtualMachinesRenderConfigCreateRequest { + r.writableVirtualMachineWithConfigContextRequest = &writableVirtualMachineWithConfigContextRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesRenderConfigCreateRequest) Format(format DcimDevicesRenderConfigCreateFormatParameter) ApiVirtualizationVirtualMachinesRenderConfigCreateRequest { + r.format = &format + return r +} + +func (r ApiVirtualizationVirtualMachinesRenderConfigCreateRequest) Execute() (*VirtualMachineWithConfigContext, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesRenderConfigCreateExecute(r) +} + +/* +VirtualizationVirtualMachinesRenderConfigCreate Method for VirtualizationVirtualMachinesRenderConfigCreate + +Resolve and render the preferred ConfigTemplate for this Device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual machine. + @return ApiVirtualizationVirtualMachinesRenderConfigCreateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesRenderConfigCreate(ctx context.Context, id int32) ApiVirtualizationVirtualMachinesRenderConfigCreateRequest { + return ApiVirtualizationVirtualMachinesRenderConfigCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualMachineWithConfigContext +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesRenderConfigCreateExecute(r ApiVirtualizationVirtualMachinesRenderConfigCreateRequest) (*VirtualMachineWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualMachineWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesRenderConfigCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/{id}/render-config/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualMachineWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualMachineWithConfigContextRequest is required and must be specified") + } + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualMachineWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesRetrieveRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 +} + +func (r ApiVirtualizationVirtualMachinesRetrieveRequest) Execute() (*VirtualMachineWithConfigContext, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesRetrieveExecute(r) +} + +/* +VirtualizationVirtualMachinesRetrieve Method for VirtualizationVirtualMachinesRetrieve + +Get a virtual machine object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual machine. + @return ApiVirtualizationVirtualMachinesRetrieveRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesRetrieve(ctx context.Context, id int32) ApiVirtualizationVirtualMachinesRetrieveRequest { + return ApiVirtualizationVirtualMachinesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualMachineWithConfigContext +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesRetrieveExecute(r ApiVirtualizationVirtualMachinesRetrieveRequest) (*VirtualMachineWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualMachineWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVirtualizationVirtualMachinesUpdateRequest struct { + ctx context.Context + ApiService *VirtualizationAPIService + id int32 + writableVirtualMachineWithConfigContextRequest *WritableVirtualMachineWithConfigContextRequest +} + +func (r ApiVirtualizationVirtualMachinesUpdateRequest) WritableVirtualMachineWithConfigContextRequest(writableVirtualMachineWithConfigContextRequest WritableVirtualMachineWithConfigContextRequest) ApiVirtualizationVirtualMachinesUpdateRequest { + r.writableVirtualMachineWithConfigContextRequest = &writableVirtualMachineWithConfigContextRequest + return r +} + +func (r ApiVirtualizationVirtualMachinesUpdateRequest) Execute() (*VirtualMachineWithConfigContext, *http.Response, error) { + return r.ApiService.VirtualizationVirtualMachinesUpdateExecute(r) +} + +/* +VirtualizationVirtualMachinesUpdate Method for VirtualizationVirtualMachinesUpdate + +Put a virtual machine object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this virtual machine. + @return ApiVirtualizationVirtualMachinesUpdateRequest +*/ +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesUpdate(ctx context.Context, id int32) ApiVirtualizationVirtualMachinesUpdateRequest { + return ApiVirtualizationVirtualMachinesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualMachineWithConfigContext +func (a *VirtualizationAPIService) VirtualizationVirtualMachinesUpdateExecute(r ApiVirtualizationVirtualMachinesUpdateRequest) (*VirtualMachineWithConfigContext, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualMachineWithConfigContext + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VirtualizationAPIService.VirtualizationVirtualMachinesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/virtualization/virtual-machines/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableVirtualMachineWithConfigContextRequest == nil { + return localVarReturnValue, nil, reportError("writableVirtualMachineWithConfigContextRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableVirtualMachineWithConfigContextRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_vpn.go b/vendor/github.com/netbox-community/go-netbox/v3/api_vpn.go new file mode 100644 index 00000000..9e7295c6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_vpn.go @@ -0,0 +1,21874 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// VpnAPIService VpnAPI service +type VpnAPIService service + +type ApiVpnIkePoliciesBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + iKEPolicyRequest *[]IKEPolicyRequest +} + +func (r ApiVpnIkePoliciesBulkDestroyRequest) IKEPolicyRequest(iKEPolicyRequest []IKEPolicyRequest) ApiVpnIkePoliciesBulkDestroyRequest { + r.iKEPolicyRequest = &iKEPolicyRequest + return r +} + +func (r ApiVpnIkePoliciesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIkePoliciesBulkDestroyExecute(r) +} + +/* +VpnIkePoliciesBulkDestroy Method for VpnIkePoliciesBulkDestroy + +Delete a list of IKE policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkePoliciesBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesBulkDestroy(ctx context.Context) ApiVpnIkePoliciesBulkDestroyRequest { + return ApiVpnIkePoliciesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIkePoliciesBulkDestroyExecute(r ApiVpnIkePoliciesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iKEPolicyRequest == nil { + return nil, reportError("iKEPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iKEPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iKEPolicyRequest *[]IKEPolicyRequest +} + +func (r ApiVpnIkePoliciesBulkPartialUpdateRequest) IKEPolicyRequest(iKEPolicyRequest []IKEPolicyRequest) ApiVpnIkePoliciesBulkPartialUpdateRequest { + r.iKEPolicyRequest = &iKEPolicyRequest + return r +} + +func (r ApiVpnIkePoliciesBulkPartialUpdateRequest) Execute() ([]IKEPolicy, *http.Response, error) { + return r.ApiService.VpnIkePoliciesBulkPartialUpdateExecute(r) +} + +/* +VpnIkePoliciesBulkPartialUpdate Method for VpnIkePoliciesBulkPartialUpdate + +Patch a list of IKE policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkePoliciesBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesBulkPartialUpdate(ctx context.Context) ApiVpnIkePoliciesBulkPartialUpdateRequest { + return ApiVpnIkePoliciesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IKEPolicy +func (a *VpnAPIService) VpnIkePoliciesBulkPartialUpdateExecute(r ApiVpnIkePoliciesBulkPartialUpdateRequest) ([]IKEPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IKEPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iKEPolicyRequest == nil { + return localVarReturnValue, nil, reportError("iKEPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iKEPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iKEPolicyRequest *[]IKEPolicyRequest +} + +func (r ApiVpnIkePoliciesBulkUpdateRequest) IKEPolicyRequest(iKEPolicyRequest []IKEPolicyRequest) ApiVpnIkePoliciesBulkUpdateRequest { + r.iKEPolicyRequest = &iKEPolicyRequest + return r +} + +func (r ApiVpnIkePoliciesBulkUpdateRequest) Execute() ([]IKEPolicy, *http.Response, error) { + return r.ApiService.VpnIkePoliciesBulkUpdateExecute(r) +} + +/* +VpnIkePoliciesBulkUpdate Method for VpnIkePoliciesBulkUpdate + +Put a list of IKE policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkePoliciesBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesBulkUpdate(ctx context.Context) ApiVpnIkePoliciesBulkUpdateRequest { + return ApiVpnIkePoliciesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IKEPolicy +func (a *VpnAPIService) VpnIkePoliciesBulkUpdateExecute(r ApiVpnIkePoliciesBulkUpdateRequest) ([]IKEPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IKEPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iKEPolicyRequest == nil { + return localVarReturnValue, nil, reportError("iKEPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iKEPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableIKEPolicyRequest *WritableIKEPolicyRequest +} + +func (r ApiVpnIkePoliciesCreateRequest) WritableIKEPolicyRequest(writableIKEPolicyRequest WritableIKEPolicyRequest) ApiVpnIkePoliciesCreateRequest { + r.writableIKEPolicyRequest = &writableIKEPolicyRequest + return r +} + +func (r ApiVpnIkePoliciesCreateRequest) Execute() (*IKEPolicy, *http.Response, error) { + return r.ApiService.VpnIkePoliciesCreateExecute(r) +} + +/* +VpnIkePoliciesCreate Method for VpnIkePoliciesCreate + +Post a list of IKE policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkePoliciesCreateRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesCreate(ctx context.Context) ApiVpnIkePoliciesCreateRequest { + return ApiVpnIkePoliciesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IKEPolicy +func (a *VpnAPIService) VpnIkePoliciesCreateExecute(r ApiVpnIkePoliciesCreateRequest) (*IKEPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIKEPolicyRequest == nil { + return localVarReturnValue, nil, reportError("writableIKEPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIKEPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIkePoliciesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIkePoliciesDestroyExecute(r) +} + +/* +VpnIkePoliciesDestroy Method for VpnIkePoliciesDestroy + +Delete a IKE policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE policy. + @return ApiVpnIkePoliciesDestroyRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesDestroy(ctx context.Context, id int32) ApiVpnIkePoliciesDestroyRequest { + return ApiVpnIkePoliciesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIkePoliciesDestroyExecute(r ApiVpnIkePoliciesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesListRequest struct { + ctx context.Context + ApiService *VpnAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + mode *[]string + modeN *[]string + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + presharedKey *string + presharedKeyIc *string + presharedKeyIe *string + presharedKeyIew *string + presharedKeyIsw *string + presharedKeyN *string + presharedKeyNic *string + presharedKeyNie *string + presharedKeyNiew *string + presharedKeyNisw *string + proposal *[]string + proposalEmpty *bool + proposalIc *[]string + proposalIe *[]string + proposalIew *[]string + proposalIsw *[]string + proposalN *[]string + proposalNic *[]string + proposalNie *[]string + proposalNiew *[]string + proposalNisw *[]string + proposalId *[]int32 + proposalIdEmpty *[]int32 + proposalIdGt *[]int32 + proposalIdGte *[]int32 + proposalIdLt *[]int32 + proposalIdLte *[]int32 + proposalIdN *[]int32 + q *string + tag *[]string + tagN *[]string + updatedByRequest *string + version *[]int32 + versionN *[]int32 +} + +func (r ApiVpnIkePoliciesListRequest) Created(created []time.Time) ApiVpnIkePoliciesListRequest { + r.created = &created + return r +} + +func (r ApiVpnIkePoliciesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnIkePoliciesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnIkePoliciesListRequest) CreatedGt(createdGt []time.Time) ApiVpnIkePoliciesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnIkePoliciesListRequest) CreatedGte(createdGte []time.Time) ApiVpnIkePoliciesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnIkePoliciesListRequest) CreatedLt(createdLt []time.Time) ApiVpnIkePoliciesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnIkePoliciesListRequest) CreatedLte(createdLte []time.Time) ApiVpnIkePoliciesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnIkePoliciesListRequest) CreatedN(createdN []time.Time) ApiVpnIkePoliciesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnIkePoliciesListRequest) CreatedByRequest(createdByRequest string) ApiVpnIkePoliciesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnIkePoliciesListRequest) Description(description []string) ApiVpnIkePoliciesListRequest { + r.description = &description + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnIkePoliciesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionIc(descriptionIc []string) ApiVpnIkePoliciesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionIe(descriptionIe []string) ApiVpnIkePoliciesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionIew(descriptionIew []string) ApiVpnIkePoliciesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnIkePoliciesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionN(descriptionN []string) ApiVpnIkePoliciesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionNic(descriptionNic []string) ApiVpnIkePoliciesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionNie(descriptionNie []string) ApiVpnIkePoliciesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnIkePoliciesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnIkePoliciesListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnIkePoliciesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVpnIkePoliciesListRequest) Id(id []int32) ApiVpnIkePoliciesListRequest { + r.id = &id + return r +} + +func (r ApiVpnIkePoliciesListRequest) IdEmpty(idEmpty bool) ApiVpnIkePoliciesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnIkePoliciesListRequest) IdGt(idGt []int32) ApiVpnIkePoliciesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnIkePoliciesListRequest) IdGte(idGte []int32) ApiVpnIkePoliciesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnIkePoliciesListRequest) IdLt(idLt []int32) ApiVpnIkePoliciesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnIkePoliciesListRequest) IdLte(idLte []int32) ApiVpnIkePoliciesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnIkePoliciesListRequest) IdN(idN []int32) ApiVpnIkePoliciesListRequest { + r.idN = &idN + return r +} + +func (r ApiVpnIkePoliciesListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnIkePoliciesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnIkePoliciesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnIkePoliciesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnIkePoliciesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnIkePoliciesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnIkePoliciesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnIkePoliciesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnIkePoliciesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnIkePoliciesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnIkePoliciesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnIkePoliciesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnIkePoliciesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnIkePoliciesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnIkePoliciesListRequest) Limit(limit int32) ApiVpnIkePoliciesListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnIkePoliciesListRequest) Mode(mode []string) ApiVpnIkePoliciesListRequest { + r.mode = &mode + return r +} + +func (r ApiVpnIkePoliciesListRequest) ModeN(modeN []string) ApiVpnIkePoliciesListRequest { + r.modeN = &modeN + return r +} + +func (r ApiVpnIkePoliciesListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnIkePoliciesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnIkePoliciesListRequest) Name(name []string) ApiVpnIkePoliciesListRequest { + r.name = &name + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameEmpty(nameEmpty bool) ApiVpnIkePoliciesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameIc(nameIc []string) ApiVpnIkePoliciesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameIe(nameIe []string) ApiVpnIkePoliciesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameIew(nameIew []string) ApiVpnIkePoliciesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameIsw(nameIsw []string) ApiVpnIkePoliciesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameN(nameN []string) ApiVpnIkePoliciesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameNic(nameNic []string) ApiVpnIkePoliciesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameNie(nameNie []string) ApiVpnIkePoliciesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameNiew(nameNiew []string) ApiVpnIkePoliciesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnIkePoliciesListRequest) NameNisw(nameNisw []string) ApiVpnIkePoliciesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnIkePoliciesListRequest) Offset(offset int32) ApiVpnIkePoliciesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnIkePoliciesListRequest) Ordering(ordering string) ApiVpnIkePoliciesListRequest { + r.ordering = &ordering + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKey(presharedKey string) ApiVpnIkePoliciesListRequest { + r.presharedKey = &presharedKey + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyIc(presharedKeyIc string) ApiVpnIkePoliciesListRequest { + r.presharedKeyIc = &presharedKeyIc + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyIe(presharedKeyIe string) ApiVpnIkePoliciesListRequest { + r.presharedKeyIe = &presharedKeyIe + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyIew(presharedKeyIew string) ApiVpnIkePoliciesListRequest { + r.presharedKeyIew = &presharedKeyIew + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyIsw(presharedKeyIsw string) ApiVpnIkePoliciesListRequest { + r.presharedKeyIsw = &presharedKeyIsw + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyN(presharedKeyN string) ApiVpnIkePoliciesListRequest { + r.presharedKeyN = &presharedKeyN + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyNic(presharedKeyNic string) ApiVpnIkePoliciesListRequest { + r.presharedKeyNic = &presharedKeyNic + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyNie(presharedKeyNie string) ApiVpnIkePoliciesListRequest { + r.presharedKeyNie = &presharedKeyNie + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyNiew(presharedKeyNiew string) ApiVpnIkePoliciesListRequest { + r.presharedKeyNiew = &presharedKeyNiew + return r +} + +func (r ApiVpnIkePoliciesListRequest) PresharedKeyNisw(presharedKeyNisw string) ApiVpnIkePoliciesListRequest { + r.presharedKeyNisw = &presharedKeyNisw + return r +} + +func (r ApiVpnIkePoliciesListRequest) Proposal(proposal []string) ApiVpnIkePoliciesListRequest { + r.proposal = &proposal + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalEmpty(proposalEmpty bool) ApiVpnIkePoliciesListRequest { + r.proposalEmpty = &proposalEmpty + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIc(proposalIc []string) ApiVpnIkePoliciesListRequest { + r.proposalIc = &proposalIc + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIe(proposalIe []string) ApiVpnIkePoliciesListRequest { + r.proposalIe = &proposalIe + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIew(proposalIew []string) ApiVpnIkePoliciesListRequest { + r.proposalIew = &proposalIew + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIsw(proposalIsw []string) ApiVpnIkePoliciesListRequest { + r.proposalIsw = &proposalIsw + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalN(proposalN []string) ApiVpnIkePoliciesListRequest { + r.proposalN = &proposalN + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalNic(proposalNic []string) ApiVpnIkePoliciesListRequest { + r.proposalNic = &proposalNic + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalNie(proposalNie []string) ApiVpnIkePoliciesListRequest { + r.proposalNie = &proposalNie + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalNiew(proposalNiew []string) ApiVpnIkePoliciesListRequest { + r.proposalNiew = &proposalNiew + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalNisw(proposalNisw []string) ApiVpnIkePoliciesListRequest { + r.proposalNisw = &proposalNisw + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalId(proposalId []int32) ApiVpnIkePoliciesListRequest { + r.proposalId = &proposalId + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIdEmpty(proposalIdEmpty []int32) ApiVpnIkePoliciesListRequest { + r.proposalIdEmpty = &proposalIdEmpty + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIdGt(proposalIdGt []int32) ApiVpnIkePoliciesListRequest { + r.proposalIdGt = &proposalIdGt + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIdGte(proposalIdGte []int32) ApiVpnIkePoliciesListRequest { + r.proposalIdGte = &proposalIdGte + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIdLt(proposalIdLt []int32) ApiVpnIkePoliciesListRequest { + r.proposalIdLt = &proposalIdLt + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIdLte(proposalIdLte []int32) ApiVpnIkePoliciesListRequest { + r.proposalIdLte = &proposalIdLte + return r +} + +func (r ApiVpnIkePoliciesListRequest) ProposalIdN(proposalIdN []int32) ApiVpnIkePoliciesListRequest { + r.proposalIdN = &proposalIdN + return r +} + +// Search +func (r ApiVpnIkePoliciesListRequest) Q(q string) ApiVpnIkePoliciesListRequest { + r.q = &q + return r +} + +func (r ApiVpnIkePoliciesListRequest) Tag(tag []string) ApiVpnIkePoliciesListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnIkePoliciesListRequest) TagN(tagN []string) ApiVpnIkePoliciesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnIkePoliciesListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnIkePoliciesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnIkePoliciesListRequest) Version(version []int32) ApiVpnIkePoliciesListRequest { + r.version = &version + return r +} + +func (r ApiVpnIkePoliciesListRequest) VersionN(versionN []int32) ApiVpnIkePoliciesListRequest { + r.versionN = &versionN + return r +} + +func (r ApiVpnIkePoliciesListRequest) Execute() (*PaginatedIKEPolicyList, *http.Response, error) { + return r.ApiService.VpnIkePoliciesListExecute(r) +} + +/* +VpnIkePoliciesList Method for VpnIkePoliciesList + +Get a list of IKE policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkePoliciesListRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesList(ctx context.Context) ApiVpnIkePoliciesListRequest { + return ApiVpnIkePoliciesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIKEPolicyList +func (a *VpnAPIService) VpnIkePoliciesListExecute(r ApiVpnIkePoliciesListRequest) (*PaginatedIKEPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIKEPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.mode != nil { + t := *r.mode + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", t, "multi") + } + } + if r.modeN != nil { + t := *r.modeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.presharedKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key", r.presharedKey, "") + } + if r.presharedKeyIc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__ic", r.presharedKeyIc, "") + } + if r.presharedKeyIe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__ie", r.presharedKeyIe, "") + } + if r.presharedKeyIew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__iew", r.presharedKeyIew, "") + } + if r.presharedKeyIsw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__isw", r.presharedKeyIsw, "") + } + if r.presharedKeyN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__n", r.presharedKeyN, "") + } + if r.presharedKeyNic != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__nic", r.presharedKeyNic, "") + } + if r.presharedKeyNie != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__nie", r.presharedKeyNie, "") + } + if r.presharedKeyNiew != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__niew", r.presharedKeyNiew, "") + } + if r.presharedKeyNisw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "preshared_key__nisw", r.presharedKeyNisw, "") + } + if r.proposal != nil { + t := *r.proposal + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal", t, "multi") + } + } + if r.proposalEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__empty", r.proposalEmpty, "") + } + if r.proposalIc != nil { + t := *r.proposalIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ic", t, "multi") + } + } + if r.proposalIe != nil { + t := *r.proposalIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ie", t, "multi") + } + } + if r.proposalIew != nil { + t := *r.proposalIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__iew", t, "multi") + } + } + if r.proposalIsw != nil { + t := *r.proposalIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__isw", t, "multi") + } + } + if r.proposalN != nil { + t := *r.proposalN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__n", t, "multi") + } + } + if r.proposalNic != nil { + t := *r.proposalNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nic", t, "multi") + } + } + if r.proposalNie != nil { + t := *r.proposalNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nie", t, "multi") + } + } + if r.proposalNiew != nil { + t := *r.proposalNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__niew", t, "multi") + } + } + if r.proposalNisw != nil { + t := *r.proposalNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nisw", t, "multi") + } + } + if r.proposalId != nil { + t := *r.proposalId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id", t, "multi") + } + } + if r.proposalIdEmpty != nil { + t := *r.proposalIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__empty", t, "multi") + } + } + if r.proposalIdGt != nil { + t := *r.proposalIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gt", t, "multi") + } + } + if r.proposalIdGte != nil { + t := *r.proposalIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gte", t, "multi") + } + } + if r.proposalIdLt != nil { + t := *r.proposalIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lt", t, "multi") + } + } + if r.proposalIdLte != nil { + t := *r.proposalIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lte", t, "multi") + } + } + if r.proposalIdN != nil { + t := *r.proposalIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.version != nil { + t := *r.version + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "version", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "version", t, "multi") + } + } + if r.versionN != nil { + t := *r.versionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "version__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "version__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableIKEPolicyRequest *PatchedWritableIKEPolicyRequest +} + +func (r ApiVpnIkePoliciesPartialUpdateRequest) PatchedWritableIKEPolicyRequest(patchedWritableIKEPolicyRequest PatchedWritableIKEPolicyRequest) ApiVpnIkePoliciesPartialUpdateRequest { + r.patchedWritableIKEPolicyRequest = &patchedWritableIKEPolicyRequest + return r +} + +func (r ApiVpnIkePoliciesPartialUpdateRequest) Execute() (*IKEPolicy, *http.Response, error) { + return r.ApiService.VpnIkePoliciesPartialUpdateExecute(r) +} + +/* +VpnIkePoliciesPartialUpdate Method for VpnIkePoliciesPartialUpdate + +Patch a IKE policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE policy. + @return ApiVpnIkePoliciesPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesPartialUpdate(ctx context.Context, id int32) ApiVpnIkePoliciesPartialUpdateRequest { + return ApiVpnIkePoliciesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IKEPolicy +func (a *VpnAPIService) VpnIkePoliciesPartialUpdateExecute(r ApiVpnIkePoliciesPartialUpdateRequest) (*IKEPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableIKEPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIkePoliciesRetrieveRequest) Execute() (*IKEPolicy, *http.Response, error) { + return r.ApiService.VpnIkePoliciesRetrieveExecute(r) +} + +/* +VpnIkePoliciesRetrieve Method for VpnIkePoliciesRetrieve + +Get a IKE policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE policy. + @return ApiVpnIkePoliciesRetrieveRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesRetrieve(ctx context.Context, id int32) ApiVpnIkePoliciesRetrieveRequest { + return ApiVpnIkePoliciesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IKEPolicy +func (a *VpnAPIService) VpnIkePoliciesRetrieveExecute(r ApiVpnIkePoliciesRetrieveRequest) (*IKEPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkePoliciesUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableIKEPolicyRequest *WritableIKEPolicyRequest +} + +func (r ApiVpnIkePoliciesUpdateRequest) WritableIKEPolicyRequest(writableIKEPolicyRequest WritableIKEPolicyRequest) ApiVpnIkePoliciesUpdateRequest { + r.writableIKEPolicyRequest = &writableIKEPolicyRequest + return r +} + +func (r ApiVpnIkePoliciesUpdateRequest) Execute() (*IKEPolicy, *http.Response, error) { + return r.ApiService.VpnIkePoliciesUpdateExecute(r) +} + +/* +VpnIkePoliciesUpdate Method for VpnIkePoliciesUpdate + +Put a IKE policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE policy. + @return ApiVpnIkePoliciesUpdateRequest +*/ +func (a *VpnAPIService) VpnIkePoliciesUpdate(ctx context.Context, id int32) ApiVpnIkePoliciesUpdateRequest { + return ApiVpnIkePoliciesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IKEPolicy +func (a *VpnAPIService) VpnIkePoliciesUpdateExecute(r ApiVpnIkePoliciesUpdateRequest) (*IKEPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkePoliciesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIKEPolicyRequest == nil { + return localVarReturnValue, nil, reportError("writableIKEPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIKEPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + iKEProposalRequest *[]IKEProposalRequest +} + +func (r ApiVpnIkeProposalsBulkDestroyRequest) IKEProposalRequest(iKEProposalRequest []IKEProposalRequest) ApiVpnIkeProposalsBulkDestroyRequest { + r.iKEProposalRequest = &iKEProposalRequest + return r +} + +func (r ApiVpnIkeProposalsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIkeProposalsBulkDestroyExecute(r) +} + +/* +VpnIkeProposalsBulkDestroy Method for VpnIkeProposalsBulkDestroy + +Delete a list of IKE proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkeProposalsBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsBulkDestroy(ctx context.Context) ApiVpnIkeProposalsBulkDestroyRequest { + return ApiVpnIkeProposalsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIkeProposalsBulkDestroyExecute(r ApiVpnIkeProposalsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iKEProposalRequest == nil { + return nil, reportError("iKEProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iKEProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iKEProposalRequest *[]IKEProposalRequest +} + +func (r ApiVpnIkeProposalsBulkPartialUpdateRequest) IKEProposalRequest(iKEProposalRequest []IKEProposalRequest) ApiVpnIkeProposalsBulkPartialUpdateRequest { + r.iKEProposalRequest = &iKEProposalRequest + return r +} + +func (r ApiVpnIkeProposalsBulkPartialUpdateRequest) Execute() ([]IKEProposal, *http.Response, error) { + return r.ApiService.VpnIkeProposalsBulkPartialUpdateExecute(r) +} + +/* +VpnIkeProposalsBulkPartialUpdate Method for VpnIkeProposalsBulkPartialUpdate + +Patch a list of IKE proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkeProposalsBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsBulkPartialUpdate(ctx context.Context) ApiVpnIkeProposalsBulkPartialUpdateRequest { + return ApiVpnIkeProposalsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IKEProposal +func (a *VpnAPIService) VpnIkeProposalsBulkPartialUpdateExecute(r ApiVpnIkeProposalsBulkPartialUpdateRequest) ([]IKEProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IKEProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iKEProposalRequest == nil { + return localVarReturnValue, nil, reportError("iKEProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iKEProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iKEProposalRequest *[]IKEProposalRequest +} + +func (r ApiVpnIkeProposalsBulkUpdateRequest) IKEProposalRequest(iKEProposalRequest []IKEProposalRequest) ApiVpnIkeProposalsBulkUpdateRequest { + r.iKEProposalRequest = &iKEProposalRequest + return r +} + +func (r ApiVpnIkeProposalsBulkUpdateRequest) Execute() ([]IKEProposal, *http.Response, error) { + return r.ApiService.VpnIkeProposalsBulkUpdateExecute(r) +} + +/* +VpnIkeProposalsBulkUpdate Method for VpnIkeProposalsBulkUpdate + +Put a list of IKE proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkeProposalsBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsBulkUpdate(ctx context.Context) ApiVpnIkeProposalsBulkUpdateRequest { + return ApiVpnIkeProposalsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IKEProposal +func (a *VpnAPIService) VpnIkeProposalsBulkUpdateExecute(r ApiVpnIkeProposalsBulkUpdateRequest) ([]IKEProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IKEProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iKEProposalRequest == nil { + return localVarReturnValue, nil, reportError("iKEProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iKEProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableIKEProposalRequest *WritableIKEProposalRequest +} + +func (r ApiVpnIkeProposalsCreateRequest) WritableIKEProposalRequest(writableIKEProposalRequest WritableIKEProposalRequest) ApiVpnIkeProposalsCreateRequest { + r.writableIKEProposalRequest = &writableIKEProposalRequest + return r +} + +func (r ApiVpnIkeProposalsCreateRequest) Execute() (*IKEProposal, *http.Response, error) { + return r.ApiService.VpnIkeProposalsCreateExecute(r) +} + +/* +VpnIkeProposalsCreate Method for VpnIkeProposalsCreate + +Post a list of IKE proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkeProposalsCreateRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsCreate(ctx context.Context) ApiVpnIkeProposalsCreateRequest { + return ApiVpnIkeProposalsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IKEProposal +func (a *VpnAPIService) VpnIkeProposalsCreateExecute(r ApiVpnIkeProposalsCreateRequest) (*IKEProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIKEProposalRequest == nil { + return localVarReturnValue, nil, reportError("writableIKEProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIKEProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIkeProposalsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIkeProposalsDestroyExecute(r) +} + +/* +VpnIkeProposalsDestroy Method for VpnIkeProposalsDestroy + +Delete a IKE proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE proposal. + @return ApiVpnIkeProposalsDestroyRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsDestroy(ctx context.Context, id int32) ApiVpnIkeProposalsDestroyRequest { + return ApiVpnIkeProposalsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIkeProposalsDestroyExecute(r ApiVpnIkeProposalsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsListRequest struct { + ctx context.Context + ApiService *VpnAPIService + authenticationAlgorithm *[]string + authenticationAlgorithmN *[]string + authenticationMethod *[]string + authenticationMethodN *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + encryptionAlgorithm *[]string + encryptionAlgorithmN *[]string + group *[]int32 + groupN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + saLifetime *[]int32 + saLifetimeEmpty *bool + saLifetimeGt *[]int32 + saLifetimeGte *[]int32 + saLifetimeLt *[]int32 + saLifetimeLte *[]int32 + saLifetimeN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiVpnIkeProposalsListRequest) AuthenticationAlgorithm(authenticationAlgorithm []string) ApiVpnIkeProposalsListRequest { + r.authenticationAlgorithm = &authenticationAlgorithm + return r +} + +func (r ApiVpnIkeProposalsListRequest) AuthenticationAlgorithmN(authenticationAlgorithmN []string) ApiVpnIkeProposalsListRequest { + r.authenticationAlgorithmN = &authenticationAlgorithmN + return r +} + +func (r ApiVpnIkeProposalsListRequest) AuthenticationMethod(authenticationMethod []string) ApiVpnIkeProposalsListRequest { + r.authenticationMethod = &authenticationMethod + return r +} + +func (r ApiVpnIkeProposalsListRequest) AuthenticationMethodN(authenticationMethodN []string) ApiVpnIkeProposalsListRequest { + r.authenticationMethodN = &authenticationMethodN + return r +} + +func (r ApiVpnIkeProposalsListRequest) Created(created []time.Time) ApiVpnIkeProposalsListRequest { + r.created = &created + return r +} + +func (r ApiVpnIkeProposalsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnIkeProposalsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnIkeProposalsListRequest) CreatedGt(createdGt []time.Time) ApiVpnIkeProposalsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnIkeProposalsListRequest) CreatedGte(createdGte []time.Time) ApiVpnIkeProposalsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnIkeProposalsListRequest) CreatedLt(createdLt []time.Time) ApiVpnIkeProposalsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnIkeProposalsListRequest) CreatedLte(createdLte []time.Time) ApiVpnIkeProposalsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnIkeProposalsListRequest) CreatedN(createdN []time.Time) ApiVpnIkeProposalsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnIkeProposalsListRequest) CreatedByRequest(createdByRequest string) ApiVpnIkeProposalsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnIkeProposalsListRequest) Description(description []string) ApiVpnIkeProposalsListRequest { + r.description = &description + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnIkeProposalsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionIc(descriptionIc []string) ApiVpnIkeProposalsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionIe(descriptionIe []string) ApiVpnIkeProposalsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionIew(descriptionIew []string) ApiVpnIkeProposalsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnIkeProposalsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionN(descriptionN []string) ApiVpnIkeProposalsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionNic(descriptionNic []string) ApiVpnIkeProposalsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionNie(descriptionNie []string) ApiVpnIkeProposalsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnIkeProposalsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnIkeProposalsListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnIkeProposalsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVpnIkeProposalsListRequest) EncryptionAlgorithm(encryptionAlgorithm []string) ApiVpnIkeProposalsListRequest { + r.encryptionAlgorithm = &encryptionAlgorithm + return r +} + +func (r ApiVpnIkeProposalsListRequest) EncryptionAlgorithmN(encryptionAlgorithmN []string) ApiVpnIkeProposalsListRequest { + r.encryptionAlgorithmN = &encryptionAlgorithmN + return r +} + +// Diffie-Hellman group ID +func (r ApiVpnIkeProposalsListRequest) Group(group []int32) ApiVpnIkeProposalsListRequest { + r.group = &group + return r +} + +// Diffie-Hellman group ID +func (r ApiVpnIkeProposalsListRequest) GroupN(groupN []int32) ApiVpnIkeProposalsListRequest { + r.groupN = &groupN + return r +} + +func (r ApiVpnIkeProposalsListRequest) Id(id []int32) ApiVpnIkeProposalsListRequest { + r.id = &id + return r +} + +func (r ApiVpnIkeProposalsListRequest) IdEmpty(idEmpty bool) ApiVpnIkeProposalsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnIkeProposalsListRequest) IdGt(idGt []int32) ApiVpnIkeProposalsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnIkeProposalsListRequest) IdGte(idGte []int32) ApiVpnIkeProposalsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnIkeProposalsListRequest) IdLt(idLt []int32) ApiVpnIkeProposalsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnIkeProposalsListRequest) IdLte(idLte []int32) ApiVpnIkeProposalsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnIkeProposalsListRequest) IdN(idN []int32) ApiVpnIkeProposalsListRequest { + r.idN = &idN + return r +} + +func (r ApiVpnIkeProposalsListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnIkeProposalsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnIkeProposalsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnIkeProposalsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnIkeProposalsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnIkeProposalsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnIkeProposalsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnIkeProposalsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnIkeProposalsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnIkeProposalsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnIkeProposalsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnIkeProposalsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnIkeProposalsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnIkeProposalsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnIkeProposalsListRequest) Limit(limit int32) ApiVpnIkeProposalsListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnIkeProposalsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnIkeProposalsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnIkeProposalsListRequest) Name(name []string) ApiVpnIkeProposalsListRequest { + r.name = &name + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameEmpty(nameEmpty bool) ApiVpnIkeProposalsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameIc(nameIc []string) ApiVpnIkeProposalsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameIe(nameIe []string) ApiVpnIkeProposalsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameIew(nameIew []string) ApiVpnIkeProposalsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameIsw(nameIsw []string) ApiVpnIkeProposalsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameN(nameN []string) ApiVpnIkeProposalsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameNic(nameNic []string) ApiVpnIkeProposalsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameNie(nameNie []string) ApiVpnIkeProposalsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameNiew(nameNiew []string) ApiVpnIkeProposalsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnIkeProposalsListRequest) NameNisw(nameNisw []string) ApiVpnIkeProposalsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnIkeProposalsListRequest) Offset(offset int32) ApiVpnIkeProposalsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnIkeProposalsListRequest) Ordering(ordering string) ApiVpnIkeProposalsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVpnIkeProposalsListRequest) Q(q string) ApiVpnIkeProposalsListRequest { + r.q = &q + return r +} + +func (r ApiVpnIkeProposalsListRequest) SaLifetime(saLifetime []int32) ApiVpnIkeProposalsListRequest { + r.saLifetime = &saLifetime + return r +} + +func (r ApiVpnIkeProposalsListRequest) SaLifetimeEmpty(saLifetimeEmpty bool) ApiVpnIkeProposalsListRequest { + r.saLifetimeEmpty = &saLifetimeEmpty + return r +} + +func (r ApiVpnIkeProposalsListRequest) SaLifetimeGt(saLifetimeGt []int32) ApiVpnIkeProposalsListRequest { + r.saLifetimeGt = &saLifetimeGt + return r +} + +func (r ApiVpnIkeProposalsListRequest) SaLifetimeGte(saLifetimeGte []int32) ApiVpnIkeProposalsListRequest { + r.saLifetimeGte = &saLifetimeGte + return r +} + +func (r ApiVpnIkeProposalsListRequest) SaLifetimeLt(saLifetimeLt []int32) ApiVpnIkeProposalsListRequest { + r.saLifetimeLt = &saLifetimeLt + return r +} + +func (r ApiVpnIkeProposalsListRequest) SaLifetimeLte(saLifetimeLte []int32) ApiVpnIkeProposalsListRequest { + r.saLifetimeLte = &saLifetimeLte + return r +} + +func (r ApiVpnIkeProposalsListRequest) SaLifetimeN(saLifetimeN []int32) ApiVpnIkeProposalsListRequest { + r.saLifetimeN = &saLifetimeN + return r +} + +func (r ApiVpnIkeProposalsListRequest) Tag(tag []string) ApiVpnIkeProposalsListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnIkeProposalsListRequest) TagN(tagN []string) ApiVpnIkeProposalsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnIkeProposalsListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnIkeProposalsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnIkeProposalsListRequest) Execute() (*PaginatedIKEProposalList, *http.Response, error) { + return r.ApiService.VpnIkeProposalsListExecute(r) +} + +/* +VpnIkeProposalsList Method for VpnIkeProposalsList + +Get a list of IKE proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIkeProposalsListRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsList(ctx context.Context) ApiVpnIkeProposalsListRequest { + return ApiVpnIkeProposalsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIKEProposalList +func (a *VpnAPIService) VpnIkeProposalsListExecute(r ApiVpnIkeProposalsListRequest) (*PaginatedIKEProposalList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIKEProposalList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.authenticationAlgorithm != nil { + t := *r.authenticationAlgorithm + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm", t, "multi") + } + } + if r.authenticationAlgorithmN != nil { + t := *r.authenticationAlgorithmN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm__n", t, "multi") + } + } + if r.authenticationMethod != nil { + t := *r.authenticationMethod + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_method", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_method", t, "multi") + } + } + if r.authenticationMethodN != nil { + t := *r.authenticationMethodN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_method__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_method__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.encryptionAlgorithm != nil { + t := *r.encryptionAlgorithm + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm", t, "multi") + } + } + if r.encryptionAlgorithmN != nil { + t := *r.encryptionAlgorithmN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm__n", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.saLifetime != nil { + t := *r.saLifetime + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime", t, "multi") + } + } + if r.saLifetimeEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__empty", r.saLifetimeEmpty, "") + } + if r.saLifetimeGt != nil { + t := *r.saLifetimeGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__gt", t, "multi") + } + } + if r.saLifetimeGte != nil { + t := *r.saLifetimeGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__gte", t, "multi") + } + } + if r.saLifetimeLt != nil { + t := *r.saLifetimeLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__lt", t, "multi") + } + } + if r.saLifetimeLte != nil { + t := *r.saLifetimeLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__lte", t, "multi") + } + } + if r.saLifetimeN != nil { + t := *r.saLifetimeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableIKEProposalRequest *PatchedWritableIKEProposalRequest +} + +func (r ApiVpnIkeProposalsPartialUpdateRequest) PatchedWritableIKEProposalRequest(patchedWritableIKEProposalRequest PatchedWritableIKEProposalRequest) ApiVpnIkeProposalsPartialUpdateRequest { + r.patchedWritableIKEProposalRequest = &patchedWritableIKEProposalRequest + return r +} + +func (r ApiVpnIkeProposalsPartialUpdateRequest) Execute() (*IKEProposal, *http.Response, error) { + return r.ApiService.VpnIkeProposalsPartialUpdateExecute(r) +} + +/* +VpnIkeProposalsPartialUpdate Method for VpnIkeProposalsPartialUpdate + +Patch a IKE proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE proposal. + @return ApiVpnIkeProposalsPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsPartialUpdate(ctx context.Context, id int32) ApiVpnIkeProposalsPartialUpdateRequest { + return ApiVpnIkeProposalsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IKEProposal +func (a *VpnAPIService) VpnIkeProposalsPartialUpdateExecute(r ApiVpnIkeProposalsPartialUpdateRequest) (*IKEProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableIKEProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIkeProposalsRetrieveRequest) Execute() (*IKEProposal, *http.Response, error) { + return r.ApiService.VpnIkeProposalsRetrieveExecute(r) +} + +/* +VpnIkeProposalsRetrieve Method for VpnIkeProposalsRetrieve + +Get a IKE proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE proposal. + @return ApiVpnIkeProposalsRetrieveRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsRetrieve(ctx context.Context, id int32) ApiVpnIkeProposalsRetrieveRequest { + return ApiVpnIkeProposalsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IKEProposal +func (a *VpnAPIService) VpnIkeProposalsRetrieveExecute(r ApiVpnIkeProposalsRetrieveRequest) (*IKEProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIkeProposalsUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableIKEProposalRequest *WritableIKEProposalRequest +} + +func (r ApiVpnIkeProposalsUpdateRequest) WritableIKEProposalRequest(writableIKEProposalRequest WritableIKEProposalRequest) ApiVpnIkeProposalsUpdateRequest { + r.writableIKEProposalRequest = &writableIKEProposalRequest + return r +} + +func (r ApiVpnIkeProposalsUpdateRequest) Execute() (*IKEProposal, *http.Response, error) { + return r.ApiService.VpnIkeProposalsUpdateExecute(r) +} + +/* +VpnIkeProposalsUpdate Method for VpnIkeProposalsUpdate + +Put a IKE proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IKE proposal. + @return ApiVpnIkeProposalsUpdateRequest +*/ +func (a *VpnAPIService) VpnIkeProposalsUpdate(ctx context.Context, id int32) ApiVpnIkeProposalsUpdateRequest { + return ApiVpnIkeProposalsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IKEProposal +func (a *VpnAPIService) VpnIkeProposalsUpdateExecute(r ApiVpnIkeProposalsUpdateRequest) (*IKEProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IKEProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIkeProposalsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ike-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIKEProposalRequest == nil { + return localVarReturnValue, nil, reportError("writableIKEProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIKEProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecPolicyRequest *[]IPSecPolicyRequest +} + +func (r ApiVpnIpsecPoliciesBulkDestroyRequest) IPSecPolicyRequest(iPSecPolicyRequest []IPSecPolicyRequest) ApiVpnIpsecPoliciesBulkDestroyRequest { + r.iPSecPolicyRequest = &iPSecPolicyRequest + return r +} + +func (r ApiVpnIpsecPoliciesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIpsecPoliciesBulkDestroyExecute(r) +} + +/* +VpnIpsecPoliciesBulkDestroy Method for VpnIpsecPoliciesBulkDestroy + +Delete a list of IPSec policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecPoliciesBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesBulkDestroy(ctx context.Context) ApiVpnIpsecPoliciesBulkDestroyRequest { + return ApiVpnIpsecPoliciesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIpsecPoliciesBulkDestroyExecute(r ApiVpnIpsecPoliciesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecPolicyRequest == nil { + return nil, reportError("iPSecPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecPolicyRequest *[]IPSecPolicyRequest +} + +func (r ApiVpnIpsecPoliciesBulkPartialUpdateRequest) IPSecPolicyRequest(iPSecPolicyRequest []IPSecPolicyRequest) ApiVpnIpsecPoliciesBulkPartialUpdateRequest { + r.iPSecPolicyRequest = &iPSecPolicyRequest + return r +} + +func (r ApiVpnIpsecPoliciesBulkPartialUpdateRequest) Execute() ([]IPSecPolicy, *http.Response, error) { + return r.ApiService.VpnIpsecPoliciesBulkPartialUpdateExecute(r) +} + +/* +VpnIpsecPoliciesBulkPartialUpdate Method for VpnIpsecPoliciesBulkPartialUpdate + +Patch a list of IPSec policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecPoliciesBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesBulkPartialUpdate(ctx context.Context) ApiVpnIpsecPoliciesBulkPartialUpdateRequest { + return ApiVpnIpsecPoliciesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPSecPolicy +func (a *VpnAPIService) VpnIpsecPoliciesBulkPartialUpdateExecute(r ApiVpnIpsecPoliciesBulkPartialUpdateRequest) ([]IPSecPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPSecPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecPolicyRequest == nil { + return localVarReturnValue, nil, reportError("iPSecPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecPolicyRequest *[]IPSecPolicyRequest +} + +func (r ApiVpnIpsecPoliciesBulkUpdateRequest) IPSecPolicyRequest(iPSecPolicyRequest []IPSecPolicyRequest) ApiVpnIpsecPoliciesBulkUpdateRequest { + r.iPSecPolicyRequest = &iPSecPolicyRequest + return r +} + +func (r ApiVpnIpsecPoliciesBulkUpdateRequest) Execute() ([]IPSecPolicy, *http.Response, error) { + return r.ApiService.VpnIpsecPoliciesBulkUpdateExecute(r) +} + +/* +VpnIpsecPoliciesBulkUpdate Method for VpnIpsecPoliciesBulkUpdate + +Put a list of IPSec policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecPoliciesBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesBulkUpdate(ctx context.Context) ApiVpnIpsecPoliciesBulkUpdateRequest { + return ApiVpnIpsecPoliciesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPSecPolicy +func (a *VpnAPIService) VpnIpsecPoliciesBulkUpdateExecute(r ApiVpnIpsecPoliciesBulkUpdateRequest) ([]IPSecPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPSecPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecPolicyRequest == nil { + return localVarReturnValue, nil, reportError("iPSecPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableIPSecPolicyRequest *WritableIPSecPolicyRequest +} + +func (r ApiVpnIpsecPoliciesCreateRequest) WritableIPSecPolicyRequest(writableIPSecPolicyRequest WritableIPSecPolicyRequest) ApiVpnIpsecPoliciesCreateRequest { + r.writableIPSecPolicyRequest = &writableIPSecPolicyRequest + return r +} + +func (r ApiVpnIpsecPoliciesCreateRequest) Execute() (*IPSecPolicy, *http.Response, error) { + return r.ApiService.VpnIpsecPoliciesCreateExecute(r) +} + +/* +VpnIpsecPoliciesCreate Method for VpnIpsecPoliciesCreate + +Post a list of IPSec policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecPoliciesCreateRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesCreate(ctx context.Context) ApiVpnIpsecPoliciesCreateRequest { + return ApiVpnIpsecPoliciesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IPSecPolicy +func (a *VpnAPIService) VpnIpsecPoliciesCreateExecute(r ApiVpnIpsecPoliciesCreateRequest) (*IPSecPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPSecPolicyRequest == nil { + return localVarReturnValue, nil, reportError("writableIPSecPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPSecPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIpsecPoliciesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIpsecPoliciesDestroyExecute(r) +} + +/* +VpnIpsecPoliciesDestroy Method for VpnIpsecPoliciesDestroy + +Delete a IPSec policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec policy. + @return ApiVpnIpsecPoliciesDestroyRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesDestroy(ctx context.Context, id int32) ApiVpnIpsecPoliciesDestroyRequest { + return ApiVpnIpsecPoliciesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIpsecPoliciesDestroyExecute(r ApiVpnIpsecPoliciesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesListRequest struct { + ctx context.Context + ApiService *VpnAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + pfsGroup *[]*int32 + pfsGroupN *[]*int32 + proposal *[]string + proposalEmpty *bool + proposalIc *[]string + proposalIe *[]string + proposalIew *[]string + proposalIsw *[]string + proposalN *[]string + proposalNic *[]string + proposalNie *[]string + proposalNiew *[]string + proposalNisw *[]string + proposalId *[]int32 + proposalIdEmpty *[]int32 + proposalIdGt *[]int32 + proposalIdGte *[]int32 + proposalIdLt *[]int32 + proposalIdLte *[]int32 + proposalIdN *[]int32 + q *string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiVpnIpsecPoliciesListRequest) Created(created []time.Time) ApiVpnIpsecPoliciesListRequest { + r.created = &created + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnIpsecPoliciesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) CreatedGt(createdGt []time.Time) ApiVpnIpsecPoliciesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) CreatedGte(createdGte []time.Time) ApiVpnIpsecPoliciesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) CreatedLt(createdLt []time.Time) ApiVpnIpsecPoliciesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) CreatedLte(createdLte []time.Time) ApiVpnIpsecPoliciesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) CreatedN(createdN []time.Time) ApiVpnIpsecPoliciesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) CreatedByRequest(createdByRequest string) ApiVpnIpsecPoliciesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) Description(description []string) ApiVpnIpsecPoliciesListRequest { + r.description = &description + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnIpsecPoliciesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionIc(descriptionIc []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionIe(descriptionIe []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionIew(descriptionIew []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionN(descriptionN []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionNic(descriptionNic []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionNie(descriptionNie []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnIpsecPoliciesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) Id(id []int32) ApiVpnIpsecPoliciesListRequest { + r.id = &id + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) IdEmpty(idEmpty bool) ApiVpnIpsecPoliciesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) IdGt(idGt []int32) ApiVpnIpsecPoliciesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) IdGte(idGte []int32) ApiVpnIpsecPoliciesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) IdLt(idLt []int32) ApiVpnIpsecPoliciesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) IdLte(idLte []int32) ApiVpnIpsecPoliciesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) IdN(idN []int32) ApiVpnIpsecPoliciesListRequest { + r.idN = &idN + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnIpsecPoliciesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnIpsecPoliciesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnIpsecPoliciesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnIpsecPoliciesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnIpsecPoliciesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnIpsecPoliciesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnIpsecPoliciesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnIpsecPoliciesListRequest) Limit(limit int32) ApiVpnIpsecPoliciesListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnIpsecPoliciesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) Name(name []string) ApiVpnIpsecPoliciesListRequest { + r.name = &name + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameEmpty(nameEmpty bool) ApiVpnIpsecPoliciesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameIc(nameIc []string) ApiVpnIpsecPoliciesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameIe(nameIe []string) ApiVpnIpsecPoliciesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameIew(nameIew []string) ApiVpnIpsecPoliciesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameIsw(nameIsw []string) ApiVpnIpsecPoliciesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameN(nameN []string) ApiVpnIpsecPoliciesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameNic(nameNic []string) ApiVpnIpsecPoliciesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameNie(nameNie []string) ApiVpnIpsecPoliciesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameNiew(nameNiew []string) ApiVpnIpsecPoliciesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) NameNisw(nameNisw []string) ApiVpnIpsecPoliciesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnIpsecPoliciesListRequest) Offset(offset int32) ApiVpnIpsecPoliciesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnIpsecPoliciesListRequest) Ordering(ordering string) ApiVpnIpsecPoliciesListRequest { + r.ordering = &ordering + return r +} + +// Diffie-Hellman group for Perfect Forward Secrecy +func (r ApiVpnIpsecPoliciesListRequest) PfsGroup(pfsGroup []*int32) ApiVpnIpsecPoliciesListRequest { + r.pfsGroup = &pfsGroup + return r +} + +// Diffie-Hellman group for Perfect Forward Secrecy +func (r ApiVpnIpsecPoliciesListRequest) PfsGroupN(pfsGroupN []*int32) ApiVpnIpsecPoliciesListRequest { + r.pfsGroupN = &pfsGroupN + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) Proposal(proposal []string) ApiVpnIpsecPoliciesListRequest { + r.proposal = &proposal + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalEmpty(proposalEmpty bool) ApiVpnIpsecPoliciesListRequest { + r.proposalEmpty = &proposalEmpty + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIc(proposalIc []string) ApiVpnIpsecPoliciesListRequest { + r.proposalIc = &proposalIc + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIe(proposalIe []string) ApiVpnIpsecPoliciesListRequest { + r.proposalIe = &proposalIe + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIew(proposalIew []string) ApiVpnIpsecPoliciesListRequest { + r.proposalIew = &proposalIew + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIsw(proposalIsw []string) ApiVpnIpsecPoliciesListRequest { + r.proposalIsw = &proposalIsw + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalN(proposalN []string) ApiVpnIpsecPoliciesListRequest { + r.proposalN = &proposalN + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalNic(proposalNic []string) ApiVpnIpsecPoliciesListRequest { + r.proposalNic = &proposalNic + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalNie(proposalNie []string) ApiVpnIpsecPoliciesListRequest { + r.proposalNie = &proposalNie + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalNiew(proposalNiew []string) ApiVpnIpsecPoliciesListRequest { + r.proposalNiew = &proposalNiew + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalNisw(proposalNisw []string) ApiVpnIpsecPoliciesListRequest { + r.proposalNisw = &proposalNisw + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalId(proposalId []int32) ApiVpnIpsecPoliciesListRequest { + r.proposalId = &proposalId + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIdEmpty(proposalIdEmpty []int32) ApiVpnIpsecPoliciesListRequest { + r.proposalIdEmpty = &proposalIdEmpty + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIdGt(proposalIdGt []int32) ApiVpnIpsecPoliciesListRequest { + r.proposalIdGt = &proposalIdGt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIdGte(proposalIdGte []int32) ApiVpnIpsecPoliciesListRequest { + r.proposalIdGte = &proposalIdGte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIdLt(proposalIdLt []int32) ApiVpnIpsecPoliciesListRequest { + r.proposalIdLt = &proposalIdLt + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIdLte(proposalIdLte []int32) ApiVpnIpsecPoliciesListRequest { + r.proposalIdLte = &proposalIdLte + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) ProposalIdN(proposalIdN []int32) ApiVpnIpsecPoliciesListRequest { + r.proposalIdN = &proposalIdN + return r +} + +// Search +func (r ApiVpnIpsecPoliciesListRequest) Q(q string) ApiVpnIpsecPoliciesListRequest { + r.q = &q + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) Tag(tag []string) ApiVpnIpsecPoliciesListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) TagN(tagN []string) ApiVpnIpsecPoliciesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnIpsecPoliciesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnIpsecPoliciesListRequest) Execute() (*PaginatedIPSecPolicyList, *http.Response, error) { + return r.ApiService.VpnIpsecPoliciesListExecute(r) +} + +/* +VpnIpsecPoliciesList Method for VpnIpsecPoliciesList + +Get a list of IPSec policy objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecPoliciesListRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesList(ctx context.Context) ApiVpnIpsecPoliciesListRequest { + return ApiVpnIpsecPoliciesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIPSecPolicyList +func (a *VpnAPIService) VpnIpsecPoliciesListExecute(r ApiVpnIpsecPoliciesListRequest) (*PaginatedIPSecPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIPSecPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.pfsGroup != nil { + t := *r.pfsGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "pfs_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "pfs_group", t, "multi") + } + } + if r.pfsGroupN != nil { + t := *r.pfsGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "pfs_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "pfs_group__n", t, "multi") + } + } + if r.proposal != nil { + t := *r.proposal + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal", t, "multi") + } + } + if r.proposalEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__empty", r.proposalEmpty, "") + } + if r.proposalIc != nil { + t := *r.proposalIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ic", t, "multi") + } + } + if r.proposalIe != nil { + t := *r.proposalIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__ie", t, "multi") + } + } + if r.proposalIew != nil { + t := *r.proposalIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__iew", t, "multi") + } + } + if r.proposalIsw != nil { + t := *r.proposalIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__isw", t, "multi") + } + } + if r.proposalN != nil { + t := *r.proposalN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__n", t, "multi") + } + } + if r.proposalNic != nil { + t := *r.proposalNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nic", t, "multi") + } + } + if r.proposalNie != nil { + t := *r.proposalNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nie", t, "multi") + } + } + if r.proposalNiew != nil { + t := *r.proposalNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__niew", t, "multi") + } + } + if r.proposalNisw != nil { + t := *r.proposalNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal__nisw", t, "multi") + } + } + if r.proposalId != nil { + t := *r.proposalId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id", t, "multi") + } + } + if r.proposalIdEmpty != nil { + t := *r.proposalIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__empty", t, "multi") + } + } + if r.proposalIdGt != nil { + t := *r.proposalIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gt", t, "multi") + } + } + if r.proposalIdGte != nil { + t := *r.proposalIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__gte", t, "multi") + } + } + if r.proposalIdLt != nil { + t := *r.proposalIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lt", t, "multi") + } + } + if r.proposalIdLte != nil { + t := *r.proposalIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__lte", t, "multi") + } + } + if r.proposalIdN != nil { + t := *r.proposalIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "proposal_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableIPSecPolicyRequest *PatchedWritableIPSecPolicyRequest +} + +func (r ApiVpnIpsecPoliciesPartialUpdateRequest) PatchedWritableIPSecPolicyRequest(patchedWritableIPSecPolicyRequest PatchedWritableIPSecPolicyRequest) ApiVpnIpsecPoliciesPartialUpdateRequest { + r.patchedWritableIPSecPolicyRequest = &patchedWritableIPSecPolicyRequest + return r +} + +func (r ApiVpnIpsecPoliciesPartialUpdateRequest) Execute() (*IPSecPolicy, *http.Response, error) { + return r.ApiService.VpnIpsecPoliciesPartialUpdateExecute(r) +} + +/* +VpnIpsecPoliciesPartialUpdate Method for VpnIpsecPoliciesPartialUpdate + +Patch a IPSec policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec policy. + @return ApiVpnIpsecPoliciesPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesPartialUpdate(ctx context.Context, id int32) ApiVpnIpsecPoliciesPartialUpdateRequest { + return ApiVpnIpsecPoliciesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecPolicy +func (a *VpnAPIService) VpnIpsecPoliciesPartialUpdateExecute(r ApiVpnIpsecPoliciesPartialUpdateRequest) (*IPSecPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableIPSecPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIpsecPoliciesRetrieveRequest) Execute() (*IPSecPolicy, *http.Response, error) { + return r.ApiService.VpnIpsecPoliciesRetrieveExecute(r) +} + +/* +VpnIpsecPoliciesRetrieve Method for VpnIpsecPoliciesRetrieve + +Get a IPSec policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec policy. + @return ApiVpnIpsecPoliciesRetrieveRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesRetrieve(ctx context.Context, id int32) ApiVpnIpsecPoliciesRetrieveRequest { + return ApiVpnIpsecPoliciesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecPolicy +func (a *VpnAPIService) VpnIpsecPoliciesRetrieveExecute(r ApiVpnIpsecPoliciesRetrieveRequest) (*IPSecPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecPoliciesUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableIPSecPolicyRequest *WritableIPSecPolicyRequest +} + +func (r ApiVpnIpsecPoliciesUpdateRequest) WritableIPSecPolicyRequest(writableIPSecPolicyRequest WritableIPSecPolicyRequest) ApiVpnIpsecPoliciesUpdateRequest { + r.writableIPSecPolicyRequest = &writableIPSecPolicyRequest + return r +} + +func (r ApiVpnIpsecPoliciesUpdateRequest) Execute() (*IPSecPolicy, *http.Response, error) { + return r.ApiService.VpnIpsecPoliciesUpdateExecute(r) +} + +/* +VpnIpsecPoliciesUpdate Method for VpnIpsecPoliciesUpdate + +Put a IPSec policy object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec policy. + @return ApiVpnIpsecPoliciesUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecPoliciesUpdate(ctx context.Context, id int32) ApiVpnIpsecPoliciesUpdateRequest { + return ApiVpnIpsecPoliciesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecPolicy +func (a *VpnAPIService) VpnIpsecPoliciesUpdateExecute(r ApiVpnIpsecPoliciesUpdateRequest) (*IPSecPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecPoliciesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-policies/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPSecPolicyRequest == nil { + return localVarReturnValue, nil, reportError("writableIPSecPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPSecPolicyRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecProfileRequest *[]IPSecProfileRequest +} + +func (r ApiVpnIpsecProfilesBulkDestroyRequest) IPSecProfileRequest(iPSecProfileRequest []IPSecProfileRequest) ApiVpnIpsecProfilesBulkDestroyRequest { + r.iPSecProfileRequest = &iPSecProfileRequest + return r +} + +func (r ApiVpnIpsecProfilesBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIpsecProfilesBulkDestroyExecute(r) +} + +/* +VpnIpsecProfilesBulkDestroy Method for VpnIpsecProfilesBulkDestroy + +Delete a list of IPSec profile objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProfilesBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesBulkDestroy(ctx context.Context) ApiVpnIpsecProfilesBulkDestroyRequest { + return ApiVpnIpsecProfilesBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIpsecProfilesBulkDestroyExecute(r ApiVpnIpsecProfilesBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecProfileRequest == nil { + return nil, reportError("iPSecProfileRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecProfileRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecProfileRequest *[]IPSecProfileRequest +} + +func (r ApiVpnIpsecProfilesBulkPartialUpdateRequest) IPSecProfileRequest(iPSecProfileRequest []IPSecProfileRequest) ApiVpnIpsecProfilesBulkPartialUpdateRequest { + r.iPSecProfileRequest = &iPSecProfileRequest + return r +} + +func (r ApiVpnIpsecProfilesBulkPartialUpdateRequest) Execute() ([]IPSecProfile, *http.Response, error) { + return r.ApiService.VpnIpsecProfilesBulkPartialUpdateExecute(r) +} + +/* +VpnIpsecProfilesBulkPartialUpdate Method for VpnIpsecProfilesBulkPartialUpdate + +Patch a list of IPSec profile objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProfilesBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesBulkPartialUpdate(ctx context.Context) ApiVpnIpsecProfilesBulkPartialUpdateRequest { + return ApiVpnIpsecProfilesBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPSecProfile +func (a *VpnAPIService) VpnIpsecProfilesBulkPartialUpdateExecute(r ApiVpnIpsecProfilesBulkPartialUpdateRequest) ([]IPSecProfile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPSecProfile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecProfileRequest == nil { + return localVarReturnValue, nil, reportError("iPSecProfileRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecProfileRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecProfileRequest *[]IPSecProfileRequest +} + +func (r ApiVpnIpsecProfilesBulkUpdateRequest) IPSecProfileRequest(iPSecProfileRequest []IPSecProfileRequest) ApiVpnIpsecProfilesBulkUpdateRequest { + r.iPSecProfileRequest = &iPSecProfileRequest + return r +} + +func (r ApiVpnIpsecProfilesBulkUpdateRequest) Execute() ([]IPSecProfile, *http.Response, error) { + return r.ApiService.VpnIpsecProfilesBulkUpdateExecute(r) +} + +/* +VpnIpsecProfilesBulkUpdate Method for VpnIpsecProfilesBulkUpdate + +Put a list of IPSec profile objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProfilesBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesBulkUpdate(ctx context.Context) ApiVpnIpsecProfilesBulkUpdateRequest { + return ApiVpnIpsecProfilesBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPSecProfile +func (a *VpnAPIService) VpnIpsecProfilesBulkUpdateExecute(r ApiVpnIpsecProfilesBulkUpdateRequest) ([]IPSecProfile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPSecProfile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecProfileRequest == nil { + return localVarReturnValue, nil, reportError("iPSecProfileRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecProfileRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableIPSecProfileRequest *WritableIPSecProfileRequest +} + +func (r ApiVpnIpsecProfilesCreateRequest) WritableIPSecProfileRequest(writableIPSecProfileRequest WritableIPSecProfileRequest) ApiVpnIpsecProfilesCreateRequest { + r.writableIPSecProfileRequest = &writableIPSecProfileRequest + return r +} + +func (r ApiVpnIpsecProfilesCreateRequest) Execute() (*IPSecProfile, *http.Response, error) { + return r.ApiService.VpnIpsecProfilesCreateExecute(r) +} + +/* +VpnIpsecProfilesCreate Method for VpnIpsecProfilesCreate + +Post a list of IPSec profile objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProfilesCreateRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesCreate(ctx context.Context) ApiVpnIpsecProfilesCreateRequest { + return ApiVpnIpsecProfilesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IPSecProfile +func (a *VpnAPIService) VpnIpsecProfilesCreateExecute(r ApiVpnIpsecProfilesCreateRequest) (*IPSecProfile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProfile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPSecProfileRequest == nil { + return localVarReturnValue, nil, reportError("writableIPSecProfileRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPSecProfileRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIpsecProfilesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIpsecProfilesDestroyExecute(r) +} + +/* +VpnIpsecProfilesDestroy Method for VpnIpsecProfilesDestroy + +Delete a IPSec profile object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec profile. + @return ApiVpnIpsecProfilesDestroyRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesDestroy(ctx context.Context, id int32) ApiVpnIpsecProfilesDestroyRequest { + return ApiVpnIpsecProfilesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIpsecProfilesDestroyExecute(r ApiVpnIpsecProfilesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesListRequest struct { + ctx context.Context + ApiService *VpnAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + ikePolicy *[]string + ikePolicyN *[]string + ikePolicyId *[]int32 + ikePolicyIdN *[]int32 + ipsecPolicy *[]string + ipsecPolicyN *[]string + ipsecPolicyId *[]int32 + ipsecPolicyIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + mode *[]string + modeN *[]string + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiVpnIpsecProfilesListRequest) Created(created []time.Time) ApiVpnIpsecProfilesListRequest { + r.created = &created + return r +} + +func (r ApiVpnIpsecProfilesListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnIpsecProfilesListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnIpsecProfilesListRequest) CreatedGt(createdGt []time.Time) ApiVpnIpsecProfilesListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnIpsecProfilesListRequest) CreatedGte(createdGte []time.Time) ApiVpnIpsecProfilesListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnIpsecProfilesListRequest) CreatedLt(createdLt []time.Time) ApiVpnIpsecProfilesListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnIpsecProfilesListRequest) CreatedLte(createdLte []time.Time) ApiVpnIpsecProfilesListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnIpsecProfilesListRequest) CreatedN(createdN []time.Time) ApiVpnIpsecProfilesListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnIpsecProfilesListRequest) CreatedByRequest(createdByRequest string) ApiVpnIpsecProfilesListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnIpsecProfilesListRequest) Description(description []string) ApiVpnIpsecProfilesListRequest { + r.description = &description + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnIpsecProfilesListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionIc(descriptionIc []string) ApiVpnIpsecProfilesListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionIe(descriptionIe []string) ApiVpnIpsecProfilesListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionIew(descriptionIew []string) ApiVpnIpsecProfilesListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnIpsecProfilesListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionN(descriptionN []string) ApiVpnIpsecProfilesListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionNic(descriptionNic []string) ApiVpnIpsecProfilesListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionNie(descriptionNie []string) ApiVpnIpsecProfilesListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnIpsecProfilesListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnIpsecProfilesListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnIpsecProfilesListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVpnIpsecProfilesListRequest) Id(id []int32) ApiVpnIpsecProfilesListRequest { + r.id = &id + return r +} + +func (r ApiVpnIpsecProfilesListRequest) IdEmpty(idEmpty bool) ApiVpnIpsecProfilesListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnIpsecProfilesListRequest) IdGt(idGt []int32) ApiVpnIpsecProfilesListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnIpsecProfilesListRequest) IdGte(idGte []int32) ApiVpnIpsecProfilesListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnIpsecProfilesListRequest) IdLt(idLt []int32) ApiVpnIpsecProfilesListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnIpsecProfilesListRequest) IdLte(idLte []int32) ApiVpnIpsecProfilesListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnIpsecProfilesListRequest) IdN(idN []int32) ApiVpnIpsecProfilesListRequest { + r.idN = &idN + return r +} + +// IKE policy (name) +func (r ApiVpnIpsecProfilesListRequest) IkePolicy(ikePolicy []string) ApiVpnIpsecProfilesListRequest { + r.ikePolicy = &ikePolicy + return r +} + +// IKE policy (name) +func (r ApiVpnIpsecProfilesListRequest) IkePolicyN(ikePolicyN []string) ApiVpnIpsecProfilesListRequest { + r.ikePolicyN = &ikePolicyN + return r +} + +// IKE policy (ID) +func (r ApiVpnIpsecProfilesListRequest) IkePolicyId(ikePolicyId []int32) ApiVpnIpsecProfilesListRequest { + r.ikePolicyId = &ikePolicyId + return r +} + +// IKE policy (ID) +func (r ApiVpnIpsecProfilesListRequest) IkePolicyIdN(ikePolicyIdN []int32) ApiVpnIpsecProfilesListRequest { + r.ikePolicyIdN = &ikePolicyIdN + return r +} + +// IPSec policy (name) +func (r ApiVpnIpsecProfilesListRequest) IpsecPolicy(ipsecPolicy []string) ApiVpnIpsecProfilesListRequest { + r.ipsecPolicy = &ipsecPolicy + return r +} + +// IPSec policy (name) +func (r ApiVpnIpsecProfilesListRequest) IpsecPolicyN(ipsecPolicyN []string) ApiVpnIpsecProfilesListRequest { + r.ipsecPolicyN = &ipsecPolicyN + return r +} + +// IPSec policy (ID) +func (r ApiVpnIpsecProfilesListRequest) IpsecPolicyId(ipsecPolicyId []int32) ApiVpnIpsecProfilesListRequest { + r.ipsecPolicyId = &ipsecPolicyId + return r +} + +// IPSec policy (ID) +func (r ApiVpnIpsecProfilesListRequest) IpsecPolicyIdN(ipsecPolicyIdN []int32) ApiVpnIpsecProfilesListRequest { + r.ipsecPolicyIdN = &ipsecPolicyIdN + return r +} + +func (r ApiVpnIpsecProfilesListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnIpsecProfilesListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnIpsecProfilesListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnIpsecProfilesListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnIpsecProfilesListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnIpsecProfilesListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnIpsecProfilesListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnIpsecProfilesListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnIpsecProfilesListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnIpsecProfilesListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnIpsecProfilesListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnIpsecProfilesListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnIpsecProfilesListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnIpsecProfilesListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnIpsecProfilesListRequest) Limit(limit int32) ApiVpnIpsecProfilesListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnIpsecProfilesListRequest) Mode(mode []string) ApiVpnIpsecProfilesListRequest { + r.mode = &mode + return r +} + +func (r ApiVpnIpsecProfilesListRequest) ModeN(modeN []string) ApiVpnIpsecProfilesListRequest { + r.modeN = &modeN + return r +} + +func (r ApiVpnIpsecProfilesListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnIpsecProfilesListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnIpsecProfilesListRequest) Name(name []string) ApiVpnIpsecProfilesListRequest { + r.name = &name + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameEmpty(nameEmpty bool) ApiVpnIpsecProfilesListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameIc(nameIc []string) ApiVpnIpsecProfilesListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameIe(nameIe []string) ApiVpnIpsecProfilesListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameIew(nameIew []string) ApiVpnIpsecProfilesListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameIsw(nameIsw []string) ApiVpnIpsecProfilesListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameN(nameN []string) ApiVpnIpsecProfilesListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameNic(nameNic []string) ApiVpnIpsecProfilesListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameNie(nameNie []string) ApiVpnIpsecProfilesListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameNiew(nameNiew []string) ApiVpnIpsecProfilesListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnIpsecProfilesListRequest) NameNisw(nameNisw []string) ApiVpnIpsecProfilesListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnIpsecProfilesListRequest) Offset(offset int32) ApiVpnIpsecProfilesListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnIpsecProfilesListRequest) Ordering(ordering string) ApiVpnIpsecProfilesListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVpnIpsecProfilesListRequest) Q(q string) ApiVpnIpsecProfilesListRequest { + r.q = &q + return r +} + +func (r ApiVpnIpsecProfilesListRequest) Tag(tag []string) ApiVpnIpsecProfilesListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnIpsecProfilesListRequest) TagN(tagN []string) ApiVpnIpsecProfilesListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnIpsecProfilesListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnIpsecProfilesListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnIpsecProfilesListRequest) Execute() (*PaginatedIPSecProfileList, *http.Response, error) { + return r.ApiService.VpnIpsecProfilesListExecute(r) +} + +/* +VpnIpsecProfilesList Method for VpnIpsecProfilesList + +Get a list of IPSec profile objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProfilesListRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesList(ctx context.Context) ApiVpnIpsecProfilesListRequest { + return ApiVpnIpsecProfilesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIPSecProfileList +func (a *VpnAPIService) VpnIpsecProfilesListExecute(r ApiVpnIpsecProfilesListRequest) (*PaginatedIPSecProfileList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIPSecProfileList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.ikePolicy != nil { + t := *r.ikePolicy + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy", t, "multi") + } + } + if r.ikePolicyN != nil { + t := *r.ikePolicyN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy__n", t, "multi") + } + } + if r.ikePolicyId != nil { + t := *r.ikePolicyId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy_id", t, "multi") + } + } + if r.ikePolicyIdN != nil { + t := *r.ikePolicyIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ike_policy_id__n", t, "multi") + } + } + if r.ipsecPolicy != nil { + t := *r.ipsecPolicy + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy", t, "multi") + } + } + if r.ipsecPolicyN != nil { + t := *r.ipsecPolicyN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy__n", t, "multi") + } + } + if r.ipsecPolicyId != nil { + t := *r.ipsecPolicyId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy_id", t, "multi") + } + } + if r.ipsecPolicyIdN != nil { + t := *r.ipsecPolicyIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_policy_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.mode != nil { + t := *r.mode + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", t, "multi") + } + } + if r.modeN != nil { + t := *r.modeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode__n", t, "multi") + } + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableIPSecProfileRequest *PatchedWritableIPSecProfileRequest +} + +func (r ApiVpnIpsecProfilesPartialUpdateRequest) PatchedWritableIPSecProfileRequest(patchedWritableIPSecProfileRequest PatchedWritableIPSecProfileRequest) ApiVpnIpsecProfilesPartialUpdateRequest { + r.patchedWritableIPSecProfileRequest = &patchedWritableIPSecProfileRequest + return r +} + +func (r ApiVpnIpsecProfilesPartialUpdateRequest) Execute() (*IPSecProfile, *http.Response, error) { + return r.ApiService.VpnIpsecProfilesPartialUpdateExecute(r) +} + +/* +VpnIpsecProfilesPartialUpdate Method for VpnIpsecProfilesPartialUpdate + +Patch a IPSec profile object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec profile. + @return ApiVpnIpsecProfilesPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesPartialUpdate(ctx context.Context, id int32) ApiVpnIpsecProfilesPartialUpdateRequest { + return ApiVpnIpsecProfilesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecProfile +func (a *VpnAPIService) VpnIpsecProfilesPartialUpdateExecute(r ApiVpnIpsecProfilesPartialUpdateRequest) (*IPSecProfile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProfile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableIPSecProfileRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIpsecProfilesRetrieveRequest) Execute() (*IPSecProfile, *http.Response, error) { + return r.ApiService.VpnIpsecProfilesRetrieveExecute(r) +} + +/* +VpnIpsecProfilesRetrieve Method for VpnIpsecProfilesRetrieve + +Get a IPSec profile object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec profile. + @return ApiVpnIpsecProfilesRetrieveRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesRetrieve(ctx context.Context, id int32) ApiVpnIpsecProfilesRetrieveRequest { + return ApiVpnIpsecProfilesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecProfile +func (a *VpnAPIService) VpnIpsecProfilesRetrieveExecute(r ApiVpnIpsecProfilesRetrieveRequest) (*IPSecProfile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProfile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProfilesUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableIPSecProfileRequest *WritableIPSecProfileRequest +} + +func (r ApiVpnIpsecProfilesUpdateRequest) WritableIPSecProfileRequest(writableIPSecProfileRequest WritableIPSecProfileRequest) ApiVpnIpsecProfilesUpdateRequest { + r.writableIPSecProfileRequest = &writableIPSecProfileRequest + return r +} + +func (r ApiVpnIpsecProfilesUpdateRequest) Execute() (*IPSecProfile, *http.Response, error) { + return r.ApiService.VpnIpsecProfilesUpdateExecute(r) +} + +/* +VpnIpsecProfilesUpdate Method for VpnIpsecProfilesUpdate + +Put a IPSec profile object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec profile. + @return ApiVpnIpsecProfilesUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProfilesUpdate(ctx context.Context, id int32) ApiVpnIpsecProfilesUpdateRequest { + return ApiVpnIpsecProfilesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecProfile +func (a *VpnAPIService) VpnIpsecProfilesUpdateExecute(r ApiVpnIpsecProfilesUpdateRequest) (*IPSecProfile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProfile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProfilesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-profiles/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPSecProfileRequest == nil { + return localVarReturnValue, nil, reportError("writableIPSecProfileRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPSecProfileRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecProposalRequest *[]IPSecProposalRequest +} + +func (r ApiVpnIpsecProposalsBulkDestroyRequest) IPSecProposalRequest(iPSecProposalRequest []IPSecProposalRequest) ApiVpnIpsecProposalsBulkDestroyRequest { + r.iPSecProposalRequest = &iPSecProposalRequest + return r +} + +func (r ApiVpnIpsecProposalsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIpsecProposalsBulkDestroyExecute(r) +} + +/* +VpnIpsecProposalsBulkDestroy Method for VpnIpsecProposalsBulkDestroy + +Delete a list of IPSec proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProposalsBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsBulkDestroy(ctx context.Context) ApiVpnIpsecProposalsBulkDestroyRequest { + return ApiVpnIpsecProposalsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIpsecProposalsBulkDestroyExecute(r ApiVpnIpsecProposalsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecProposalRequest == nil { + return nil, reportError("iPSecProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecProposalRequest *[]IPSecProposalRequest +} + +func (r ApiVpnIpsecProposalsBulkPartialUpdateRequest) IPSecProposalRequest(iPSecProposalRequest []IPSecProposalRequest) ApiVpnIpsecProposalsBulkPartialUpdateRequest { + r.iPSecProposalRequest = &iPSecProposalRequest + return r +} + +func (r ApiVpnIpsecProposalsBulkPartialUpdateRequest) Execute() ([]IPSecProposal, *http.Response, error) { + return r.ApiService.VpnIpsecProposalsBulkPartialUpdateExecute(r) +} + +/* +VpnIpsecProposalsBulkPartialUpdate Method for VpnIpsecProposalsBulkPartialUpdate + +Patch a list of IPSec proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProposalsBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsBulkPartialUpdate(ctx context.Context) ApiVpnIpsecProposalsBulkPartialUpdateRequest { + return ApiVpnIpsecProposalsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPSecProposal +func (a *VpnAPIService) VpnIpsecProposalsBulkPartialUpdateExecute(r ApiVpnIpsecProposalsBulkPartialUpdateRequest) ([]IPSecProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPSecProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecProposalRequest == nil { + return localVarReturnValue, nil, reportError("iPSecProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + iPSecProposalRequest *[]IPSecProposalRequest +} + +func (r ApiVpnIpsecProposalsBulkUpdateRequest) IPSecProposalRequest(iPSecProposalRequest []IPSecProposalRequest) ApiVpnIpsecProposalsBulkUpdateRequest { + r.iPSecProposalRequest = &iPSecProposalRequest + return r +} + +func (r ApiVpnIpsecProposalsBulkUpdateRequest) Execute() ([]IPSecProposal, *http.Response, error) { + return r.ApiService.VpnIpsecProposalsBulkUpdateExecute(r) +} + +/* +VpnIpsecProposalsBulkUpdate Method for VpnIpsecProposalsBulkUpdate + +Put a list of IPSec proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProposalsBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsBulkUpdate(ctx context.Context) ApiVpnIpsecProposalsBulkUpdateRequest { + return ApiVpnIpsecProposalsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []IPSecProposal +func (a *VpnAPIService) VpnIpsecProposalsBulkUpdateExecute(r ApiVpnIpsecProposalsBulkUpdateRequest) ([]IPSecProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []IPSecProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPSecProposalRequest == nil { + return localVarReturnValue, nil, reportError("iPSecProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPSecProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableIPSecProposalRequest *WritableIPSecProposalRequest +} + +func (r ApiVpnIpsecProposalsCreateRequest) WritableIPSecProposalRequest(writableIPSecProposalRequest WritableIPSecProposalRequest) ApiVpnIpsecProposalsCreateRequest { + r.writableIPSecProposalRequest = &writableIPSecProposalRequest + return r +} + +func (r ApiVpnIpsecProposalsCreateRequest) Execute() (*IPSecProposal, *http.Response, error) { + return r.ApiService.VpnIpsecProposalsCreateExecute(r) +} + +/* +VpnIpsecProposalsCreate Method for VpnIpsecProposalsCreate + +Post a list of IPSec proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProposalsCreateRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsCreate(ctx context.Context) ApiVpnIpsecProposalsCreateRequest { + return ApiVpnIpsecProposalsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IPSecProposal +func (a *VpnAPIService) VpnIpsecProposalsCreateExecute(r ApiVpnIpsecProposalsCreateRequest) (*IPSecProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPSecProposalRequest == nil { + return localVarReturnValue, nil, reportError("writableIPSecProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPSecProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIpsecProposalsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnIpsecProposalsDestroyExecute(r) +} + +/* +VpnIpsecProposalsDestroy Method for VpnIpsecProposalsDestroy + +Delete a IPSec proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec proposal. + @return ApiVpnIpsecProposalsDestroyRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsDestroy(ctx context.Context, id int32) ApiVpnIpsecProposalsDestroyRequest { + return ApiVpnIpsecProposalsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnIpsecProposalsDestroyExecute(r ApiVpnIpsecProposalsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsListRequest struct { + ctx context.Context + ApiService *VpnAPIService + authenticationAlgorithm *[]string + authenticationAlgorithmN *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + encryptionAlgorithm *[]string + encryptionAlgorithmN *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + saLifetimeData *[]int32 + saLifetimeDataEmpty *bool + saLifetimeDataGt *[]int32 + saLifetimeDataGte *[]int32 + saLifetimeDataLt *[]int32 + saLifetimeDataLte *[]int32 + saLifetimeDataN *[]int32 + saLifetimeSeconds *[]int32 + saLifetimeSecondsEmpty *bool + saLifetimeSecondsGt *[]int32 + saLifetimeSecondsGte *[]int32 + saLifetimeSecondsLt *[]int32 + saLifetimeSecondsLte *[]int32 + saLifetimeSecondsN *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiVpnIpsecProposalsListRequest) AuthenticationAlgorithm(authenticationAlgorithm []string) ApiVpnIpsecProposalsListRequest { + r.authenticationAlgorithm = &authenticationAlgorithm + return r +} + +func (r ApiVpnIpsecProposalsListRequest) AuthenticationAlgorithmN(authenticationAlgorithmN []string) ApiVpnIpsecProposalsListRequest { + r.authenticationAlgorithmN = &authenticationAlgorithmN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) Created(created []time.Time) ApiVpnIpsecProposalsListRequest { + r.created = &created + return r +} + +func (r ApiVpnIpsecProposalsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnIpsecProposalsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnIpsecProposalsListRequest) CreatedGt(createdGt []time.Time) ApiVpnIpsecProposalsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) CreatedGte(createdGte []time.Time) ApiVpnIpsecProposalsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) CreatedLt(createdLt []time.Time) ApiVpnIpsecProposalsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) CreatedLte(createdLte []time.Time) ApiVpnIpsecProposalsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) CreatedN(createdN []time.Time) ApiVpnIpsecProposalsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) CreatedByRequest(createdByRequest string) ApiVpnIpsecProposalsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnIpsecProposalsListRequest) Description(description []string) ApiVpnIpsecProposalsListRequest { + r.description = &description + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnIpsecProposalsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionIc(descriptionIc []string) ApiVpnIpsecProposalsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionIe(descriptionIe []string) ApiVpnIpsecProposalsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionIew(descriptionIew []string) ApiVpnIpsecProposalsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnIpsecProposalsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionN(descriptionN []string) ApiVpnIpsecProposalsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionNic(descriptionNic []string) ApiVpnIpsecProposalsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionNie(descriptionNie []string) ApiVpnIpsecProposalsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnIpsecProposalsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnIpsecProposalsListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnIpsecProposalsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVpnIpsecProposalsListRequest) EncryptionAlgorithm(encryptionAlgorithm []string) ApiVpnIpsecProposalsListRequest { + r.encryptionAlgorithm = &encryptionAlgorithm + return r +} + +func (r ApiVpnIpsecProposalsListRequest) EncryptionAlgorithmN(encryptionAlgorithmN []string) ApiVpnIpsecProposalsListRequest { + r.encryptionAlgorithmN = &encryptionAlgorithmN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) Id(id []int32) ApiVpnIpsecProposalsListRequest { + r.id = &id + return r +} + +func (r ApiVpnIpsecProposalsListRequest) IdEmpty(idEmpty bool) ApiVpnIpsecProposalsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnIpsecProposalsListRequest) IdGt(idGt []int32) ApiVpnIpsecProposalsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) IdGte(idGte []int32) ApiVpnIpsecProposalsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) IdLt(idLt []int32) ApiVpnIpsecProposalsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) IdLte(idLte []int32) ApiVpnIpsecProposalsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) IdN(idN []int32) ApiVpnIpsecProposalsListRequest { + r.idN = &idN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnIpsecProposalsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnIpsecProposalsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnIpsecProposalsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnIpsecProposalsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnIpsecProposalsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnIpsecProposalsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnIpsecProposalsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnIpsecProposalsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnIpsecProposalsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnIpsecProposalsListRequest) Limit(limit int32) ApiVpnIpsecProposalsListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnIpsecProposalsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnIpsecProposalsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnIpsecProposalsListRequest) Name(name []string) ApiVpnIpsecProposalsListRequest { + r.name = &name + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameEmpty(nameEmpty bool) ApiVpnIpsecProposalsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameIc(nameIc []string) ApiVpnIpsecProposalsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameIe(nameIe []string) ApiVpnIpsecProposalsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameIew(nameIew []string) ApiVpnIpsecProposalsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameIsw(nameIsw []string) ApiVpnIpsecProposalsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameN(nameN []string) ApiVpnIpsecProposalsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameNic(nameNic []string) ApiVpnIpsecProposalsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameNie(nameNie []string) ApiVpnIpsecProposalsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameNiew(nameNiew []string) ApiVpnIpsecProposalsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnIpsecProposalsListRequest) NameNisw(nameNisw []string) ApiVpnIpsecProposalsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnIpsecProposalsListRequest) Offset(offset int32) ApiVpnIpsecProposalsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnIpsecProposalsListRequest) Ordering(ordering string) ApiVpnIpsecProposalsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVpnIpsecProposalsListRequest) Q(q string) ApiVpnIpsecProposalsListRequest { + r.q = &q + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeData(saLifetimeData []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeData = &saLifetimeData + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeDataEmpty(saLifetimeDataEmpty bool) ApiVpnIpsecProposalsListRequest { + r.saLifetimeDataEmpty = &saLifetimeDataEmpty + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeDataGt(saLifetimeDataGt []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeDataGt = &saLifetimeDataGt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeDataGte(saLifetimeDataGte []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeDataGte = &saLifetimeDataGte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeDataLt(saLifetimeDataLt []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeDataLt = &saLifetimeDataLt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeDataLte(saLifetimeDataLte []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeDataLte = &saLifetimeDataLte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeDataN(saLifetimeDataN []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeDataN = &saLifetimeDataN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeSeconds(saLifetimeSeconds []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeSeconds = &saLifetimeSeconds + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeSecondsEmpty(saLifetimeSecondsEmpty bool) ApiVpnIpsecProposalsListRequest { + r.saLifetimeSecondsEmpty = &saLifetimeSecondsEmpty + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeSecondsGt(saLifetimeSecondsGt []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeSecondsGt = &saLifetimeSecondsGt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeSecondsGte(saLifetimeSecondsGte []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeSecondsGte = &saLifetimeSecondsGte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeSecondsLt(saLifetimeSecondsLt []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeSecondsLt = &saLifetimeSecondsLt + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeSecondsLte(saLifetimeSecondsLte []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeSecondsLte = &saLifetimeSecondsLte + return r +} + +func (r ApiVpnIpsecProposalsListRequest) SaLifetimeSecondsN(saLifetimeSecondsN []int32) ApiVpnIpsecProposalsListRequest { + r.saLifetimeSecondsN = &saLifetimeSecondsN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) Tag(tag []string) ApiVpnIpsecProposalsListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnIpsecProposalsListRequest) TagN(tagN []string) ApiVpnIpsecProposalsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnIpsecProposalsListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnIpsecProposalsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnIpsecProposalsListRequest) Execute() (*PaginatedIPSecProposalList, *http.Response, error) { + return r.ApiService.VpnIpsecProposalsListExecute(r) +} + +/* +VpnIpsecProposalsList Method for VpnIpsecProposalsList + +Get a list of IPSec proposal objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnIpsecProposalsListRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsList(ctx context.Context) ApiVpnIpsecProposalsListRequest { + return ApiVpnIpsecProposalsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIPSecProposalList +func (a *VpnAPIService) VpnIpsecProposalsListExecute(r ApiVpnIpsecProposalsListRequest) (*PaginatedIPSecProposalList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIPSecProposalList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.authenticationAlgorithm != nil { + t := *r.authenticationAlgorithm + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm", t, "multi") + } + } + if r.authenticationAlgorithmN != nil { + t := *r.authenticationAlgorithmN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_algorithm__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.encryptionAlgorithm != nil { + t := *r.encryptionAlgorithm + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm", t, "multi") + } + } + if r.encryptionAlgorithmN != nil { + t := *r.encryptionAlgorithmN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_algorithm__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.saLifetimeData != nil { + t := *r.saLifetimeData + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data", t, "multi") + } + } + if r.saLifetimeDataEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__empty", r.saLifetimeDataEmpty, "") + } + if r.saLifetimeDataGt != nil { + t := *r.saLifetimeDataGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__gt", t, "multi") + } + } + if r.saLifetimeDataGte != nil { + t := *r.saLifetimeDataGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__gte", t, "multi") + } + } + if r.saLifetimeDataLt != nil { + t := *r.saLifetimeDataLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__lt", t, "multi") + } + } + if r.saLifetimeDataLte != nil { + t := *r.saLifetimeDataLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__lte", t, "multi") + } + } + if r.saLifetimeDataN != nil { + t := *r.saLifetimeDataN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_data__n", t, "multi") + } + } + if r.saLifetimeSeconds != nil { + t := *r.saLifetimeSeconds + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds", t, "multi") + } + } + if r.saLifetimeSecondsEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__empty", r.saLifetimeSecondsEmpty, "") + } + if r.saLifetimeSecondsGt != nil { + t := *r.saLifetimeSecondsGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__gt", t, "multi") + } + } + if r.saLifetimeSecondsGte != nil { + t := *r.saLifetimeSecondsGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__gte", t, "multi") + } + } + if r.saLifetimeSecondsLt != nil { + t := *r.saLifetimeSecondsLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__lt", t, "multi") + } + } + if r.saLifetimeSecondsLte != nil { + t := *r.saLifetimeSecondsLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__lte", t, "multi") + } + } + if r.saLifetimeSecondsN != nil { + t := *r.saLifetimeSecondsN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "sa_lifetime_seconds__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableIPSecProposalRequest *PatchedWritableIPSecProposalRequest +} + +func (r ApiVpnIpsecProposalsPartialUpdateRequest) PatchedWritableIPSecProposalRequest(patchedWritableIPSecProposalRequest PatchedWritableIPSecProposalRequest) ApiVpnIpsecProposalsPartialUpdateRequest { + r.patchedWritableIPSecProposalRequest = &patchedWritableIPSecProposalRequest + return r +} + +func (r ApiVpnIpsecProposalsPartialUpdateRequest) Execute() (*IPSecProposal, *http.Response, error) { + return r.ApiService.VpnIpsecProposalsPartialUpdateExecute(r) +} + +/* +VpnIpsecProposalsPartialUpdate Method for VpnIpsecProposalsPartialUpdate + +Patch a IPSec proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec proposal. + @return ApiVpnIpsecProposalsPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsPartialUpdate(ctx context.Context, id int32) ApiVpnIpsecProposalsPartialUpdateRequest { + return ApiVpnIpsecProposalsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecProposal +func (a *VpnAPIService) VpnIpsecProposalsPartialUpdateExecute(r ApiVpnIpsecProposalsPartialUpdateRequest) (*IPSecProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableIPSecProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnIpsecProposalsRetrieveRequest) Execute() (*IPSecProposal, *http.Response, error) { + return r.ApiService.VpnIpsecProposalsRetrieveExecute(r) +} + +/* +VpnIpsecProposalsRetrieve Method for VpnIpsecProposalsRetrieve + +Get a IPSec proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec proposal. + @return ApiVpnIpsecProposalsRetrieveRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsRetrieve(ctx context.Context, id int32) ApiVpnIpsecProposalsRetrieveRequest { + return ApiVpnIpsecProposalsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecProposal +func (a *VpnAPIService) VpnIpsecProposalsRetrieveExecute(r ApiVpnIpsecProposalsRetrieveRequest) (*IPSecProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnIpsecProposalsUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableIPSecProposalRequest *WritableIPSecProposalRequest +} + +func (r ApiVpnIpsecProposalsUpdateRequest) WritableIPSecProposalRequest(writableIPSecProposalRequest WritableIPSecProposalRequest) ApiVpnIpsecProposalsUpdateRequest { + r.writableIPSecProposalRequest = &writableIPSecProposalRequest + return r +} + +func (r ApiVpnIpsecProposalsUpdateRequest) Execute() (*IPSecProposal, *http.Response, error) { + return r.ApiService.VpnIpsecProposalsUpdateExecute(r) +} + +/* +VpnIpsecProposalsUpdate Method for VpnIpsecProposalsUpdate + +Put a IPSec proposal object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this IPSec proposal. + @return ApiVpnIpsecProposalsUpdateRequest +*/ +func (a *VpnAPIService) VpnIpsecProposalsUpdate(ctx context.Context, id int32) ApiVpnIpsecProposalsUpdateRequest { + return ApiVpnIpsecProposalsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPSecProposal +func (a *VpnAPIService) VpnIpsecProposalsUpdateExecute(r ApiVpnIpsecProposalsUpdateRequest) (*IPSecProposal, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPSecProposal + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnIpsecProposalsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/ipsec-proposals/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableIPSecProposalRequest == nil { + return localVarReturnValue, nil, reportError("writableIPSecProposalRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableIPSecProposalRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + l2VPNTerminationRequest *[]L2VPNTerminationRequest +} + +func (r ApiVpnL2vpnTerminationsBulkDestroyRequest) L2VPNTerminationRequest(l2VPNTerminationRequest []L2VPNTerminationRequest) ApiVpnL2vpnTerminationsBulkDestroyRequest { + r.l2VPNTerminationRequest = &l2VPNTerminationRequest + return r +} + +func (r ApiVpnL2vpnTerminationsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsBulkDestroyExecute(r) +} + +/* +VpnL2vpnTerminationsBulkDestroy Method for VpnL2vpnTerminationsBulkDestroy + +Delete a list of L2VPN termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnTerminationsBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsBulkDestroy(ctx context.Context) ApiVpnL2vpnTerminationsBulkDestroyRequest { + return ApiVpnL2vpnTerminationsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnL2vpnTerminationsBulkDestroyExecute(r ApiVpnL2vpnTerminationsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.l2VPNTerminationRequest == nil { + return nil, reportError("l2VPNTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.l2VPNTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + l2VPNTerminationRequest *[]L2VPNTerminationRequest +} + +func (r ApiVpnL2vpnTerminationsBulkPartialUpdateRequest) L2VPNTerminationRequest(l2VPNTerminationRequest []L2VPNTerminationRequest) ApiVpnL2vpnTerminationsBulkPartialUpdateRequest { + r.l2VPNTerminationRequest = &l2VPNTerminationRequest + return r +} + +func (r ApiVpnL2vpnTerminationsBulkPartialUpdateRequest) Execute() ([]L2VPNTermination, *http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsBulkPartialUpdateExecute(r) +} + +/* +VpnL2vpnTerminationsBulkPartialUpdate Method for VpnL2vpnTerminationsBulkPartialUpdate + +Patch a list of L2VPN termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnTerminationsBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsBulkPartialUpdate(ctx context.Context) ApiVpnL2vpnTerminationsBulkPartialUpdateRequest { + return ApiVpnL2vpnTerminationsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []L2VPNTermination +func (a *VpnAPIService) VpnL2vpnTerminationsBulkPartialUpdateExecute(r ApiVpnL2vpnTerminationsBulkPartialUpdateRequest) ([]L2VPNTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []L2VPNTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.l2VPNTerminationRequest == nil { + return localVarReturnValue, nil, reportError("l2VPNTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.l2VPNTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + l2VPNTerminationRequest *[]L2VPNTerminationRequest +} + +func (r ApiVpnL2vpnTerminationsBulkUpdateRequest) L2VPNTerminationRequest(l2VPNTerminationRequest []L2VPNTerminationRequest) ApiVpnL2vpnTerminationsBulkUpdateRequest { + r.l2VPNTerminationRequest = &l2VPNTerminationRequest + return r +} + +func (r ApiVpnL2vpnTerminationsBulkUpdateRequest) Execute() ([]L2VPNTermination, *http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsBulkUpdateExecute(r) +} + +/* +VpnL2vpnTerminationsBulkUpdate Method for VpnL2vpnTerminationsBulkUpdate + +Put a list of L2VPN termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnTerminationsBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsBulkUpdate(ctx context.Context) ApiVpnL2vpnTerminationsBulkUpdateRequest { + return ApiVpnL2vpnTerminationsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []L2VPNTermination +func (a *VpnAPIService) VpnL2vpnTerminationsBulkUpdateExecute(r ApiVpnL2vpnTerminationsBulkUpdateRequest) ([]L2VPNTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []L2VPNTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.l2VPNTerminationRequest == nil { + return localVarReturnValue, nil, reportError("l2VPNTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.l2VPNTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableL2VPNTerminationRequest *WritableL2VPNTerminationRequest +} + +func (r ApiVpnL2vpnTerminationsCreateRequest) WritableL2VPNTerminationRequest(writableL2VPNTerminationRequest WritableL2VPNTerminationRequest) ApiVpnL2vpnTerminationsCreateRequest { + r.writableL2VPNTerminationRequest = &writableL2VPNTerminationRequest + return r +} + +func (r ApiVpnL2vpnTerminationsCreateRequest) Execute() (*L2VPNTermination, *http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsCreateExecute(r) +} + +/* +VpnL2vpnTerminationsCreate Method for VpnL2vpnTerminationsCreate + +Post a list of L2VPN termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnTerminationsCreateRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsCreate(ctx context.Context) ApiVpnL2vpnTerminationsCreateRequest { + return ApiVpnL2vpnTerminationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return L2VPNTermination +func (a *VpnAPIService) VpnL2vpnTerminationsCreateExecute(r ApiVpnL2vpnTerminationsCreateRequest) (*L2VPNTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPNTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableL2VPNTerminationRequest == nil { + return localVarReturnValue, nil, reportError("writableL2VPNTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableL2VPNTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnL2vpnTerminationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsDestroyExecute(r) +} + +/* +VpnL2vpnTerminationsDestroy Method for VpnL2vpnTerminationsDestroy + +Delete a L2VPN termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN termination. + @return ApiVpnL2vpnTerminationsDestroyRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsDestroy(ctx context.Context, id int32) ApiVpnL2vpnTerminationsDestroyRequest { + return ApiVpnL2vpnTerminationsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnL2vpnTerminationsDestroyExecute(r ApiVpnL2vpnTerminationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsListRequest struct { + ctx context.Context + ApiService *VpnAPIService + assignedObjectType *string + assignedObjectTypeN *string + assignedObjectTypeId *int32 + assignedObjectTypeIdN *int32 + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + device *[]*string + deviceN *[]*string + deviceId *[]int32 + deviceIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interface_ *[]string + interfaceN *[]string + interfaceId *[]int32 + interfaceIdN *[]int32 + l2vpn *[]string + l2vpnN *[]string + l2vpnId *[]int32 + l2vpnIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + q *string + region *[]string + regionId *[]int32 + site *[]string + siteId *[]int32 + tag *[]string + tagN *[]string + updatedByRequest *string + virtualMachine *[]string + virtualMachineN *[]string + virtualMachineId *[]int32 + virtualMachineIdN *[]int32 + vlan *[]string + vlanN *[]string + vlanId *[]int32 + vlanIdN *[]int32 + vlanVid *int32 + vlanVidEmpty *int32 + vlanVidGt *int32 + vlanVidGte *int32 + vlanVidLt *int32 + vlanVidLte *int32 + vlanVidN *int32 + vminterface *[]string + vminterfaceN *[]string + vminterfaceId *[]int32 + vminterfaceIdN *[]int32 +} + +func (r ApiVpnL2vpnTerminationsListRequest) AssignedObjectType(assignedObjectType string) ApiVpnL2vpnTerminationsListRequest { + r.assignedObjectType = &assignedObjectType + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) AssignedObjectTypeN(assignedObjectTypeN string) ApiVpnL2vpnTerminationsListRequest { + r.assignedObjectTypeN = &assignedObjectTypeN + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) AssignedObjectTypeId(assignedObjectTypeId int32) ApiVpnL2vpnTerminationsListRequest { + r.assignedObjectTypeId = &assignedObjectTypeId + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) AssignedObjectTypeIdN(assignedObjectTypeIdN int32) ApiVpnL2vpnTerminationsListRequest { + r.assignedObjectTypeIdN = &assignedObjectTypeIdN + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) Created(created []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.created = &created + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) CreatedGt(createdGt []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) CreatedGte(createdGte []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) CreatedLt(createdLt []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) CreatedLte(createdLte []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) CreatedN(createdN []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) CreatedByRequest(createdByRequest string) ApiVpnL2vpnTerminationsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +// Device (name) +func (r ApiVpnL2vpnTerminationsListRequest) Device(device []*string) ApiVpnL2vpnTerminationsListRequest { + r.device = &device + return r +} + +// Device (name) +func (r ApiVpnL2vpnTerminationsListRequest) DeviceN(deviceN []*string) ApiVpnL2vpnTerminationsListRequest { + r.deviceN = &deviceN + return r +} + +// Device (ID) +func (r ApiVpnL2vpnTerminationsListRequest) DeviceId(deviceId []int32) ApiVpnL2vpnTerminationsListRequest { + r.deviceId = &deviceId + return r +} + +// Device (ID) +func (r ApiVpnL2vpnTerminationsListRequest) DeviceIdN(deviceIdN []int32) ApiVpnL2vpnTerminationsListRequest { + r.deviceIdN = &deviceIdN + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) Id(id []int32) ApiVpnL2vpnTerminationsListRequest { + r.id = &id + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) IdEmpty(idEmpty bool) ApiVpnL2vpnTerminationsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) IdGt(idGt []int32) ApiVpnL2vpnTerminationsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) IdGte(idGte []int32) ApiVpnL2vpnTerminationsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) IdLt(idLt []int32) ApiVpnL2vpnTerminationsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) IdLte(idLte []int32) ApiVpnL2vpnTerminationsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) IdN(idN []int32) ApiVpnL2vpnTerminationsListRequest { + r.idN = &idN + return r +} + +// Interface (name) +func (r ApiVpnL2vpnTerminationsListRequest) Interface_(interface_ []string) ApiVpnL2vpnTerminationsListRequest { + r.interface_ = &interface_ + return r +} + +// Interface (name) +func (r ApiVpnL2vpnTerminationsListRequest) InterfaceN(interfaceN []string) ApiVpnL2vpnTerminationsListRequest { + r.interfaceN = &interfaceN + return r +} + +// Interface (ID) +func (r ApiVpnL2vpnTerminationsListRequest) InterfaceId(interfaceId []int32) ApiVpnL2vpnTerminationsListRequest { + r.interfaceId = &interfaceId + return r +} + +// Interface (ID) +func (r ApiVpnL2vpnTerminationsListRequest) InterfaceIdN(interfaceIdN []int32) ApiVpnL2vpnTerminationsListRequest { + r.interfaceIdN = &interfaceIdN + return r +} + +// L2VPN (slug) +func (r ApiVpnL2vpnTerminationsListRequest) L2vpn(l2vpn []string) ApiVpnL2vpnTerminationsListRequest { + r.l2vpn = &l2vpn + return r +} + +// L2VPN (slug) +func (r ApiVpnL2vpnTerminationsListRequest) L2vpnN(l2vpnN []string) ApiVpnL2vpnTerminationsListRequest { + r.l2vpnN = &l2vpnN + return r +} + +// L2VPN (ID) +func (r ApiVpnL2vpnTerminationsListRequest) L2vpnId(l2vpnId []int32) ApiVpnL2vpnTerminationsListRequest { + r.l2vpnId = &l2vpnId + return r +} + +// L2VPN (ID) +func (r ApiVpnL2vpnTerminationsListRequest) L2vpnIdN(l2vpnIdN []int32) ApiVpnL2vpnTerminationsListRequest { + r.l2vpnIdN = &l2vpnIdN + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnL2vpnTerminationsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnL2vpnTerminationsListRequest) Limit(limit int32) ApiVpnL2vpnTerminationsListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnL2vpnTerminationsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiVpnL2vpnTerminationsListRequest) Offset(offset int32) ApiVpnL2vpnTerminationsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnL2vpnTerminationsListRequest) Ordering(ordering string) ApiVpnL2vpnTerminationsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVpnL2vpnTerminationsListRequest) Q(q string) ApiVpnL2vpnTerminationsListRequest { + r.q = &q + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) Region(region []string) ApiVpnL2vpnTerminationsListRequest { + r.region = ®ion + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) RegionId(regionId []int32) ApiVpnL2vpnTerminationsListRequest { + r.regionId = ®ionId + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) Site(site []string) ApiVpnL2vpnTerminationsListRequest { + r.site = &site + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) SiteId(siteId []int32) ApiVpnL2vpnTerminationsListRequest { + r.siteId = &siteId + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) Tag(tag []string) ApiVpnL2vpnTerminationsListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) TagN(tagN []string) ApiVpnL2vpnTerminationsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnL2vpnTerminationsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// Virtual machine (name) +func (r ApiVpnL2vpnTerminationsListRequest) VirtualMachine(virtualMachine []string) ApiVpnL2vpnTerminationsListRequest { + r.virtualMachine = &virtualMachine + return r +} + +// Virtual machine (name) +func (r ApiVpnL2vpnTerminationsListRequest) VirtualMachineN(virtualMachineN []string) ApiVpnL2vpnTerminationsListRequest { + r.virtualMachineN = &virtualMachineN + return r +} + +// Virtual machine (ID) +func (r ApiVpnL2vpnTerminationsListRequest) VirtualMachineId(virtualMachineId []int32) ApiVpnL2vpnTerminationsListRequest { + r.virtualMachineId = &virtualMachineId + return r +} + +// Virtual machine (ID) +func (r ApiVpnL2vpnTerminationsListRequest) VirtualMachineIdN(virtualMachineIdN []int32) ApiVpnL2vpnTerminationsListRequest { + r.virtualMachineIdN = &virtualMachineIdN + return r +} + +// VLAN (name) +func (r ApiVpnL2vpnTerminationsListRequest) Vlan(vlan []string) ApiVpnL2vpnTerminationsListRequest { + r.vlan = &vlan + return r +} + +// VLAN (name) +func (r ApiVpnL2vpnTerminationsListRequest) VlanN(vlanN []string) ApiVpnL2vpnTerminationsListRequest { + r.vlanN = &vlanN + return r +} + +// VLAN (ID) +func (r ApiVpnL2vpnTerminationsListRequest) VlanId(vlanId []int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanId = &vlanId + return r +} + +// VLAN (ID) +func (r ApiVpnL2vpnTerminationsListRequest) VlanIdN(vlanIdN []int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanIdN = &vlanIdN + return r +} + +// VLAN number (1-4094) +func (r ApiVpnL2vpnTerminationsListRequest) VlanVid(vlanVid int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanVid = &vlanVid + return r +} + +// VLAN number (1-4094) +func (r ApiVpnL2vpnTerminationsListRequest) VlanVidEmpty(vlanVidEmpty int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanVidEmpty = &vlanVidEmpty + return r +} + +// VLAN number (1-4094) +func (r ApiVpnL2vpnTerminationsListRequest) VlanVidGt(vlanVidGt int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanVidGt = &vlanVidGt + return r +} + +// VLAN number (1-4094) +func (r ApiVpnL2vpnTerminationsListRequest) VlanVidGte(vlanVidGte int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanVidGte = &vlanVidGte + return r +} + +// VLAN number (1-4094) +func (r ApiVpnL2vpnTerminationsListRequest) VlanVidLt(vlanVidLt int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanVidLt = &vlanVidLt + return r +} + +// VLAN number (1-4094) +func (r ApiVpnL2vpnTerminationsListRequest) VlanVidLte(vlanVidLte int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanVidLte = &vlanVidLte + return r +} + +// VLAN number (1-4094) +func (r ApiVpnL2vpnTerminationsListRequest) VlanVidN(vlanVidN int32) ApiVpnL2vpnTerminationsListRequest { + r.vlanVidN = &vlanVidN + return r +} + +// VM interface (name) +func (r ApiVpnL2vpnTerminationsListRequest) Vminterface(vminterface []string) ApiVpnL2vpnTerminationsListRequest { + r.vminterface = &vminterface + return r +} + +// VM interface (name) +func (r ApiVpnL2vpnTerminationsListRequest) VminterfaceN(vminterfaceN []string) ApiVpnL2vpnTerminationsListRequest { + r.vminterfaceN = &vminterfaceN + return r +} + +// VM Interface (ID) +func (r ApiVpnL2vpnTerminationsListRequest) VminterfaceId(vminterfaceId []int32) ApiVpnL2vpnTerminationsListRequest { + r.vminterfaceId = &vminterfaceId + return r +} + +// VM Interface (ID) +func (r ApiVpnL2vpnTerminationsListRequest) VminterfaceIdN(vminterfaceIdN []int32) ApiVpnL2vpnTerminationsListRequest { + r.vminterfaceIdN = &vminterfaceIdN + return r +} + +func (r ApiVpnL2vpnTerminationsListRequest) Execute() (*PaginatedL2VPNTerminationList, *http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsListExecute(r) +} + +/* +VpnL2vpnTerminationsList Method for VpnL2vpnTerminationsList + +Get a list of L2VPN termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnTerminationsListRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsList(ctx context.Context) ApiVpnL2vpnTerminationsListRequest { + return ApiVpnL2vpnTerminationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedL2VPNTerminationList +func (a *VpnAPIService) VpnL2vpnTerminationsListExecute(r ApiVpnL2vpnTerminationsListRequest) (*PaginatedL2VPNTerminationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedL2VPNTerminationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.assignedObjectType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type", r.assignedObjectType, "") + } + if r.assignedObjectTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type__n", r.assignedObjectTypeN, "") + } + if r.assignedObjectTypeId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type_id", r.assignedObjectTypeId, "") + } + if r.assignedObjectTypeIdN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assigned_object_type_id__n", r.assignedObjectTypeIdN, "") + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.device != nil { + t := *r.device + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device", t, "multi") + } + } + if r.deviceN != nil { + t := *r.deviceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device__n", t, "multi") + } + } + if r.deviceId != nil { + t := *r.deviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id", t, "multi") + } + } + if r.deviceIdN != nil { + t := *r.deviceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interface_ != nil { + t := *r.interface_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface", t, "multi") + } + } + if r.interfaceN != nil { + t := *r.interfaceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface__n", t, "multi") + } + } + if r.interfaceId != nil { + t := *r.interfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", t, "multi") + } + } + if r.interfaceIdN != nil { + t := *r.interfaceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", t, "multi") + } + } + if r.l2vpn != nil { + t := *r.l2vpn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn", t, "multi") + } + } + if r.l2vpnN != nil { + t := *r.l2vpnN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn__n", t, "multi") + } + } + if r.l2vpnId != nil { + t := *r.l2vpnId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id", t, "multi") + } + } + if r.l2vpnIdN != nil { + t := *r.l2vpnIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "l2vpn_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.region != nil { + t := *r.region + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", t, "multi") + } + } + if r.regionId != nil { + t := *r.regionId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "region_id", t, "multi") + } + } + if r.site != nil { + t := *r.site + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site", t, "multi") + } + } + if r.siteId != nil { + t := *r.siteId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "site_id", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.virtualMachine != nil { + t := *r.virtualMachine + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine", t, "multi") + } + } + if r.virtualMachineN != nil { + t := *r.virtualMachineN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine__n", t, "multi") + } + } + if r.virtualMachineId != nil { + t := *r.virtualMachineId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id", t, "multi") + } + } + if r.virtualMachineIdN != nil { + t := *r.virtualMachineIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "virtual_machine_id__n", t, "multi") + } + } + if r.vlan != nil { + t := *r.vlan + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan", t, "multi") + } + } + if r.vlanN != nil { + t := *r.vlanN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan__n", t, "multi") + } + } + if r.vlanId != nil { + t := *r.vlanId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", t, "multi") + } + } + if r.vlanIdN != nil { + t := *r.vlanIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id__n", t, "multi") + } + } + if r.vlanVid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid", r.vlanVid, "") + } + if r.vlanVidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__empty", r.vlanVidEmpty, "") + } + if r.vlanVidGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__gt", r.vlanVidGt, "") + } + if r.vlanVidGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__gte", r.vlanVidGte, "") + } + if r.vlanVidLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__lt", r.vlanVidLt, "") + } + if r.vlanVidLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__lte", r.vlanVidLte, "") + } + if r.vlanVidN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_vid__n", r.vlanVidN, "") + } + if r.vminterface != nil { + t := *r.vminterface + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface", t, "multi") + } + } + if r.vminterfaceN != nil { + t := *r.vminterfaceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface__n", t, "multi") + } + } + if r.vminterfaceId != nil { + t := *r.vminterfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id", t, "multi") + } + } + if r.vminterfaceIdN != nil { + t := *r.vminterfaceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableL2VPNTerminationRequest *PatchedWritableL2VPNTerminationRequest +} + +func (r ApiVpnL2vpnTerminationsPartialUpdateRequest) PatchedWritableL2VPNTerminationRequest(patchedWritableL2VPNTerminationRequest PatchedWritableL2VPNTerminationRequest) ApiVpnL2vpnTerminationsPartialUpdateRequest { + r.patchedWritableL2VPNTerminationRequest = &patchedWritableL2VPNTerminationRequest + return r +} + +func (r ApiVpnL2vpnTerminationsPartialUpdateRequest) Execute() (*L2VPNTermination, *http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsPartialUpdateExecute(r) +} + +/* +VpnL2vpnTerminationsPartialUpdate Method for VpnL2vpnTerminationsPartialUpdate + +Patch a L2VPN termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN termination. + @return ApiVpnL2vpnTerminationsPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsPartialUpdate(ctx context.Context, id int32) ApiVpnL2vpnTerminationsPartialUpdateRequest { + return ApiVpnL2vpnTerminationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return L2VPNTermination +func (a *VpnAPIService) VpnL2vpnTerminationsPartialUpdateExecute(r ApiVpnL2vpnTerminationsPartialUpdateRequest) (*L2VPNTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPNTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableL2VPNTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnL2vpnTerminationsRetrieveRequest) Execute() (*L2VPNTermination, *http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsRetrieveExecute(r) +} + +/* +VpnL2vpnTerminationsRetrieve Method for VpnL2vpnTerminationsRetrieve + +Get a L2VPN termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN termination. + @return ApiVpnL2vpnTerminationsRetrieveRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsRetrieve(ctx context.Context, id int32) ApiVpnL2vpnTerminationsRetrieveRequest { + return ApiVpnL2vpnTerminationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return L2VPNTermination +func (a *VpnAPIService) VpnL2vpnTerminationsRetrieveExecute(r ApiVpnL2vpnTerminationsRetrieveRequest) (*L2VPNTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPNTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnTerminationsUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableL2VPNTerminationRequest *WritableL2VPNTerminationRequest +} + +func (r ApiVpnL2vpnTerminationsUpdateRequest) WritableL2VPNTerminationRequest(writableL2VPNTerminationRequest WritableL2VPNTerminationRequest) ApiVpnL2vpnTerminationsUpdateRequest { + r.writableL2VPNTerminationRequest = &writableL2VPNTerminationRequest + return r +} + +func (r ApiVpnL2vpnTerminationsUpdateRequest) Execute() (*L2VPNTermination, *http.Response, error) { + return r.ApiService.VpnL2vpnTerminationsUpdateExecute(r) +} + +/* +VpnL2vpnTerminationsUpdate Method for VpnL2vpnTerminationsUpdate + +Put a L2VPN termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN termination. + @return ApiVpnL2vpnTerminationsUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnTerminationsUpdate(ctx context.Context, id int32) ApiVpnL2vpnTerminationsUpdateRequest { + return ApiVpnL2vpnTerminationsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return L2VPNTermination +func (a *VpnAPIService) VpnL2vpnTerminationsUpdateExecute(r ApiVpnL2vpnTerminationsUpdateRequest) (*L2VPNTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPNTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnTerminationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpn-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableL2VPNTerminationRequest == nil { + return localVarReturnValue, nil, reportError("writableL2VPNTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableL2VPNTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + l2VPNRequest *[]L2VPNRequest +} + +func (r ApiVpnL2vpnsBulkDestroyRequest) L2VPNRequest(l2VPNRequest []L2VPNRequest) ApiVpnL2vpnsBulkDestroyRequest { + r.l2VPNRequest = &l2VPNRequest + return r +} + +func (r ApiVpnL2vpnsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnL2vpnsBulkDestroyExecute(r) +} + +/* +VpnL2vpnsBulkDestroy Method for VpnL2vpnsBulkDestroy + +Delete a list of L2VPN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnsBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnL2vpnsBulkDestroy(ctx context.Context) ApiVpnL2vpnsBulkDestroyRequest { + return ApiVpnL2vpnsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnL2vpnsBulkDestroyExecute(r ApiVpnL2vpnsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.l2VPNRequest == nil { + return nil, reportError("l2VPNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.l2VPNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + l2VPNRequest *[]L2VPNRequest +} + +func (r ApiVpnL2vpnsBulkPartialUpdateRequest) L2VPNRequest(l2VPNRequest []L2VPNRequest) ApiVpnL2vpnsBulkPartialUpdateRequest { + r.l2VPNRequest = &l2VPNRequest + return r +} + +func (r ApiVpnL2vpnsBulkPartialUpdateRequest) Execute() ([]L2VPN, *http.Response, error) { + return r.ApiService.VpnL2vpnsBulkPartialUpdateExecute(r) +} + +/* +VpnL2vpnsBulkPartialUpdate Method for VpnL2vpnsBulkPartialUpdate + +Patch a list of L2VPN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnsBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnsBulkPartialUpdate(ctx context.Context) ApiVpnL2vpnsBulkPartialUpdateRequest { + return ApiVpnL2vpnsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []L2VPN +func (a *VpnAPIService) VpnL2vpnsBulkPartialUpdateExecute(r ApiVpnL2vpnsBulkPartialUpdateRequest) ([]L2VPN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []L2VPN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.l2VPNRequest == nil { + return localVarReturnValue, nil, reportError("l2VPNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.l2VPNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + l2VPNRequest *[]L2VPNRequest +} + +func (r ApiVpnL2vpnsBulkUpdateRequest) L2VPNRequest(l2VPNRequest []L2VPNRequest) ApiVpnL2vpnsBulkUpdateRequest { + r.l2VPNRequest = &l2VPNRequest + return r +} + +func (r ApiVpnL2vpnsBulkUpdateRequest) Execute() ([]L2VPN, *http.Response, error) { + return r.ApiService.VpnL2vpnsBulkUpdateExecute(r) +} + +/* +VpnL2vpnsBulkUpdate Method for VpnL2vpnsBulkUpdate + +Put a list of L2VPN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnsBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnsBulkUpdate(ctx context.Context) ApiVpnL2vpnsBulkUpdateRequest { + return ApiVpnL2vpnsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []L2VPN +func (a *VpnAPIService) VpnL2vpnsBulkUpdateExecute(r ApiVpnL2vpnsBulkUpdateRequest) ([]L2VPN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []L2VPN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.l2VPNRequest == nil { + return localVarReturnValue, nil, reportError("l2VPNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.l2VPNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableL2VPNRequest *WritableL2VPNRequest +} + +func (r ApiVpnL2vpnsCreateRequest) WritableL2VPNRequest(writableL2VPNRequest WritableL2VPNRequest) ApiVpnL2vpnsCreateRequest { + r.writableL2VPNRequest = &writableL2VPNRequest + return r +} + +func (r ApiVpnL2vpnsCreateRequest) Execute() (*L2VPN, *http.Response, error) { + return r.ApiService.VpnL2vpnsCreateExecute(r) +} + +/* +VpnL2vpnsCreate Method for VpnL2vpnsCreate + +Post a list of L2VPN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnsCreateRequest +*/ +func (a *VpnAPIService) VpnL2vpnsCreate(ctx context.Context) ApiVpnL2vpnsCreateRequest { + return ApiVpnL2vpnsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return L2VPN +func (a *VpnAPIService) VpnL2vpnsCreateExecute(r ApiVpnL2vpnsCreateRequest) (*L2VPN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableL2VPNRequest == nil { + return localVarReturnValue, nil, reportError("writableL2VPNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableL2VPNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnL2vpnsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnL2vpnsDestroyExecute(r) +} + +/* +VpnL2vpnsDestroy Method for VpnL2vpnsDestroy + +Delete a L2VPN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN. + @return ApiVpnL2vpnsDestroyRequest +*/ +func (a *VpnAPIService) VpnL2vpnsDestroy(ctx context.Context, id int32) ApiVpnL2vpnsDestroyRequest { + return ApiVpnL2vpnsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnL2vpnsDestroyExecute(r ApiVpnL2vpnsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsListRequest struct { + ctx context.Context + ApiService *VpnAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + exportTarget *[]string + exportTargetN *[]string + exportTargetId *[]int32 + exportTargetIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + identifier *[]int32 + identifierEmpty *bool + identifierGt *[]int32 + identifierGte *[]int32 + identifierLt *[]int32 + identifierLte *[]int32 + identifierN *[]int32 + importTarget *[]string + importTargetN *[]string + importTargetId *[]int32 + importTargetIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + type_ *[]string + typeN *[]string + updatedByRequest *string +} + +func (r ApiVpnL2vpnsListRequest) Created(created []time.Time) ApiVpnL2vpnsListRequest { + r.created = &created + return r +} + +func (r ApiVpnL2vpnsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnL2vpnsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnL2vpnsListRequest) CreatedGt(createdGt []time.Time) ApiVpnL2vpnsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnL2vpnsListRequest) CreatedGte(createdGte []time.Time) ApiVpnL2vpnsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnL2vpnsListRequest) CreatedLt(createdLt []time.Time) ApiVpnL2vpnsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnL2vpnsListRequest) CreatedLte(createdLte []time.Time) ApiVpnL2vpnsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnL2vpnsListRequest) CreatedN(createdN []time.Time) ApiVpnL2vpnsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnL2vpnsListRequest) CreatedByRequest(createdByRequest string) ApiVpnL2vpnsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnL2vpnsListRequest) Description(description []string) ApiVpnL2vpnsListRequest { + r.description = &description + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnL2vpnsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionIc(descriptionIc []string) ApiVpnL2vpnsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionIe(descriptionIe []string) ApiVpnL2vpnsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionIew(descriptionIew []string) ApiVpnL2vpnsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnL2vpnsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionN(descriptionN []string) ApiVpnL2vpnsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionNic(descriptionNic []string) ApiVpnL2vpnsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionNie(descriptionNie []string) ApiVpnL2vpnsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnL2vpnsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnL2vpnsListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnL2vpnsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +// Export target (name) +func (r ApiVpnL2vpnsListRequest) ExportTarget(exportTarget []string) ApiVpnL2vpnsListRequest { + r.exportTarget = &exportTarget + return r +} + +// Export target (name) +func (r ApiVpnL2vpnsListRequest) ExportTargetN(exportTargetN []string) ApiVpnL2vpnsListRequest { + r.exportTargetN = &exportTargetN + return r +} + +// Export target +func (r ApiVpnL2vpnsListRequest) ExportTargetId(exportTargetId []int32) ApiVpnL2vpnsListRequest { + r.exportTargetId = &exportTargetId + return r +} + +// Export target +func (r ApiVpnL2vpnsListRequest) ExportTargetIdN(exportTargetIdN []int32) ApiVpnL2vpnsListRequest { + r.exportTargetIdN = &exportTargetIdN + return r +} + +func (r ApiVpnL2vpnsListRequest) Id(id []int32) ApiVpnL2vpnsListRequest { + r.id = &id + return r +} + +func (r ApiVpnL2vpnsListRequest) IdEmpty(idEmpty bool) ApiVpnL2vpnsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnL2vpnsListRequest) IdGt(idGt []int32) ApiVpnL2vpnsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnL2vpnsListRequest) IdGte(idGte []int32) ApiVpnL2vpnsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnL2vpnsListRequest) IdLt(idLt []int32) ApiVpnL2vpnsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnL2vpnsListRequest) IdLte(idLte []int32) ApiVpnL2vpnsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnL2vpnsListRequest) IdN(idN []int32) ApiVpnL2vpnsListRequest { + r.idN = &idN + return r +} + +func (r ApiVpnL2vpnsListRequest) Identifier(identifier []int32) ApiVpnL2vpnsListRequest { + r.identifier = &identifier + return r +} + +func (r ApiVpnL2vpnsListRequest) IdentifierEmpty(identifierEmpty bool) ApiVpnL2vpnsListRequest { + r.identifierEmpty = &identifierEmpty + return r +} + +func (r ApiVpnL2vpnsListRequest) IdentifierGt(identifierGt []int32) ApiVpnL2vpnsListRequest { + r.identifierGt = &identifierGt + return r +} + +func (r ApiVpnL2vpnsListRequest) IdentifierGte(identifierGte []int32) ApiVpnL2vpnsListRequest { + r.identifierGte = &identifierGte + return r +} + +func (r ApiVpnL2vpnsListRequest) IdentifierLt(identifierLt []int32) ApiVpnL2vpnsListRequest { + r.identifierLt = &identifierLt + return r +} + +func (r ApiVpnL2vpnsListRequest) IdentifierLte(identifierLte []int32) ApiVpnL2vpnsListRequest { + r.identifierLte = &identifierLte + return r +} + +func (r ApiVpnL2vpnsListRequest) IdentifierN(identifierN []int32) ApiVpnL2vpnsListRequest { + r.identifierN = &identifierN + return r +} + +// Import target (name) +func (r ApiVpnL2vpnsListRequest) ImportTarget(importTarget []string) ApiVpnL2vpnsListRequest { + r.importTarget = &importTarget + return r +} + +// Import target (name) +func (r ApiVpnL2vpnsListRequest) ImportTargetN(importTargetN []string) ApiVpnL2vpnsListRequest { + r.importTargetN = &importTargetN + return r +} + +// Import target +func (r ApiVpnL2vpnsListRequest) ImportTargetId(importTargetId []int32) ApiVpnL2vpnsListRequest { + r.importTargetId = &importTargetId + return r +} + +// Import target +func (r ApiVpnL2vpnsListRequest) ImportTargetIdN(importTargetIdN []int32) ApiVpnL2vpnsListRequest { + r.importTargetIdN = &importTargetIdN + return r +} + +func (r ApiVpnL2vpnsListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnL2vpnsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnL2vpnsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnL2vpnsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnL2vpnsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnL2vpnsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnL2vpnsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnL2vpnsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnL2vpnsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnL2vpnsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnL2vpnsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnL2vpnsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnL2vpnsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnL2vpnsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnL2vpnsListRequest) Limit(limit int32) ApiVpnL2vpnsListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnL2vpnsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnL2vpnsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnL2vpnsListRequest) Name(name []string) ApiVpnL2vpnsListRequest { + r.name = &name + return r +} + +func (r ApiVpnL2vpnsListRequest) NameEmpty(nameEmpty bool) ApiVpnL2vpnsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnL2vpnsListRequest) NameIc(nameIc []string) ApiVpnL2vpnsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnL2vpnsListRequest) NameIe(nameIe []string) ApiVpnL2vpnsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnL2vpnsListRequest) NameIew(nameIew []string) ApiVpnL2vpnsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnL2vpnsListRequest) NameIsw(nameIsw []string) ApiVpnL2vpnsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnL2vpnsListRequest) NameN(nameN []string) ApiVpnL2vpnsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnL2vpnsListRequest) NameNic(nameNic []string) ApiVpnL2vpnsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnL2vpnsListRequest) NameNie(nameNie []string) ApiVpnL2vpnsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnL2vpnsListRequest) NameNiew(nameNiew []string) ApiVpnL2vpnsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnL2vpnsListRequest) NameNisw(nameNisw []string) ApiVpnL2vpnsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnL2vpnsListRequest) Offset(offset int32) ApiVpnL2vpnsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnL2vpnsListRequest) Ordering(ordering string) ApiVpnL2vpnsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVpnL2vpnsListRequest) Q(q string) ApiVpnL2vpnsListRequest { + r.q = &q + return r +} + +func (r ApiVpnL2vpnsListRequest) Slug(slug []string) ApiVpnL2vpnsListRequest { + r.slug = &slug + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugEmpty(slugEmpty bool) ApiVpnL2vpnsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugIc(slugIc []string) ApiVpnL2vpnsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugIe(slugIe []string) ApiVpnL2vpnsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugIew(slugIew []string) ApiVpnL2vpnsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugIsw(slugIsw []string) ApiVpnL2vpnsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugN(slugN []string) ApiVpnL2vpnsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugNic(slugNic []string) ApiVpnL2vpnsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugNie(slugNie []string) ApiVpnL2vpnsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugNiew(slugNiew []string) ApiVpnL2vpnsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiVpnL2vpnsListRequest) SlugNisw(slugNisw []string) ApiVpnL2vpnsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiVpnL2vpnsListRequest) Tag(tag []string) ApiVpnL2vpnsListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnL2vpnsListRequest) TagN(tagN []string) ApiVpnL2vpnsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiVpnL2vpnsListRequest) Tenant(tenant []string) ApiVpnL2vpnsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiVpnL2vpnsListRequest) TenantN(tenantN []string) ApiVpnL2vpnsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiVpnL2vpnsListRequest) TenantGroup(tenantGroup []int32) ApiVpnL2vpnsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiVpnL2vpnsListRequest) TenantGroupN(tenantGroupN []int32) ApiVpnL2vpnsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiVpnL2vpnsListRequest) TenantGroupId(tenantGroupId []int32) ApiVpnL2vpnsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiVpnL2vpnsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiVpnL2vpnsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiVpnL2vpnsListRequest) TenantId(tenantId []*int32) ApiVpnL2vpnsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiVpnL2vpnsListRequest) TenantIdN(tenantIdN []*int32) ApiVpnL2vpnsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiVpnL2vpnsListRequest) Type_(type_ []string) ApiVpnL2vpnsListRequest { + r.type_ = &type_ + return r +} + +func (r ApiVpnL2vpnsListRequest) TypeN(typeN []string) ApiVpnL2vpnsListRequest { + r.typeN = &typeN + return r +} + +func (r ApiVpnL2vpnsListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnL2vpnsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnL2vpnsListRequest) Execute() (*PaginatedL2VPNList, *http.Response, error) { + return r.ApiService.VpnL2vpnsListExecute(r) +} + +/* +VpnL2vpnsList Method for VpnL2vpnsList + +Get a list of L2VPN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnL2vpnsListRequest +*/ +func (a *VpnAPIService) VpnL2vpnsList(ctx context.Context) ApiVpnL2vpnsListRequest { + return ApiVpnL2vpnsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedL2VPNList +func (a *VpnAPIService) VpnL2vpnsListExecute(r ApiVpnL2vpnsListRequest) (*PaginatedL2VPNList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedL2VPNList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.exportTarget != nil { + t := *r.exportTarget + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target", t, "multi") + } + } + if r.exportTargetN != nil { + t := *r.exportTargetN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target__n", t, "multi") + } + } + if r.exportTargetId != nil { + t := *r.exportTargetId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id", t, "multi") + } + } + if r.exportTargetIdN != nil { + t := *r.exportTargetIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "export_target_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.identifier != nil { + t := *r.identifier + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier", t, "multi") + } + } + if r.identifierEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__empty", r.identifierEmpty, "") + } + if r.identifierGt != nil { + t := *r.identifierGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__gt", t, "multi") + } + } + if r.identifierGte != nil { + t := *r.identifierGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__gte", t, "multi") + } + } + if r.identifierLt != nil { + t := *r.identifierLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__lt", t, "multi") + } + } + if r.identifierLte != nil { + t := *r.identifierLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__lte", t, "multi") + } + } + if r.identifierN != nil { + t := *r.identifierN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier__n", t, "multi") + } + } + if r.importTarget != nil { + t := *r.importTarget + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target", t, "multi") + } + } + if r.importTargetN != nil { + t := *r.importTargetN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target__n", t, "multi") + } + } + if r.importTargetId != nil { + t := *r.importTargetId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id", t, "multi") + } + } + if r.importTargetIdN != nil { + t := *r.importTargetIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "import_target_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.typeN != nil { + t := *r.typeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableL2VPNRequest *PatchedWritableL2VPNRequest +} + +func (r ApiVpnL2vpnsPartialUpdateRequest) PatchedWritableL2VPNRequest(patchedWritableL2VPNRequest PatchedWritableL2VPNRequest) ApiVpnL2vpnsPartialUpdateRequest { + r.patchedWritableL2VPNRequest = &patchedWritableL2VPNRequest + return r +} + +func (r ApiVpnL2vpnsPartialUpdateRequest) Execute() (*L2VPN, *http.Response, error) { + return r.ApiService.VpnL2vpnsPartialUpdateExecute(r) +} + +/* +VpnL2vpnsPartialUpdate Method for VpnL2vpnsPartialUpdate + +Patch a L2VPN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN. + @return ApiVpnL2vpnsPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnsPartialUpdate(ctx context.Context, id int32) ApiVpnL2vpnsPartialUpdateRequest { + return ApiVpnL2vpnsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return L2VPN +func (a *VpnAPIService) VpnL2vpnsPartialUpdateExecute(r ApiVpnL2vpnsPartialUpdateRequest) (*L2VPN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableL2VPNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnL2vpnsRetrieveRequest) Execute() (*L2VPN, *http.Response, error) { + return r.ApiService.VpnL2vpnsRetrieveExecute(r) +} + +/* +VpnL2vpnsRetrieve Method for VpnL2vpnsRetrieve + +Get a L2VPN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN. + @return ApiVpnL2vpnsRetrieveRequest +*/ +func (a *VpnAPIService) VpnL2vpnsRetrieve(ctx context.Context, id int32) ApiVpnL2vpnsRetrieveRequest { + return ApiVpnL2vpnsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return L2VPN +func (a *VpnAPIService) VpnL2vpnsRetrieveExecute(r ApiVpnL2vpnsRetrieveRequest) (*L2VPN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnL2vpnsUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableL2VPNRequest *WritableL2VPNRequest +} + +func (r ApiVpnL2vpnsUpdateRequest) WritableL2VPNRequest(writableL2VPNRequest WritableL2VPNRequest) ApiVpnL2vpnsUpdateRequest { + r.writableL2VPNRequest = &writableL2VPNRequest + return r +} + +func (r ApiVpnL2vpnsUpdateRequest) Execute() (*L2VPN, *http.Response, error) { + return r.ApiService.VpnL2vpnsUpdateExecute(r) +} + +/* +VpnL2vpnsUpdate Method for VpnL2vpnsUpdate + +Put a L2VPN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this L2VPN. + @return ApiVpnL2vpnsUpdateRequest +*/ +func (a *VpnAPIService) VpnL2vpnsUpdate(ctx context.Context, id int32) ApiVpnL2vpnsUpdateRequest { + return ApiVpnL2vpnsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return L2VPN +func (a *VpnAPIService) VpnL2vpnsUpdateExecute(r ApiVpnL2vpnsUpdateRequest) (*L2VPN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *L2VPN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnL2vpnsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/l2vpns/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableL2VPNRequest == nil { + return localVarReturnValue, nil, reportError("writableL2VPNRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableL2VPNRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelGroupRequest *[]TunnelGroupRequest +} + +func (r ApiVpnTunnelGroupsBulkDestroyRequest) TunnelGroupRequest(tunnelGroupRequest []TunnelGroupRequest) ApiVpnTunnelGroupsBulkDestroyRequest { + r.tunnelGroupRequest = &tunnelGroupRequest + return r +} + +func (r ApiVpnTunnelGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnTunnelGroupsBulkDestroyExecute(r) +} + +/* +VpnTunnelGroupsBulkDestroy Method for VpnTunnelGroupsBulkDestroy + +Delete a list of tunnel group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelGroupsBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsBulkDestroy(ctx context.Context) ApiVpnTunnelGroupsBulkDestroyRequest { + return ApiVpnTunnelGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnTunnelGroupsBulkDestroyExecute(r ApiVpnTunnelGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelGroupRequest == nil { + return nil, reportError("tunnelGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelGroupRequest *[]TunnelGroupRequest +} + +func (r ApiVpnTunnelGroupsBulkPartialUpdateRequest) TunnelGroupRequest(tunnelGroupRequest []TunnelGroupRequest) ApiVpnTunnelGroupsBulkPartialUpdateRequest { + r.tunnelGroupRequest = &tunnelGroupRequest + return r +} + +func (r ApiVpnTunnelGroupsBulkPartialUpdateRequest) Execute() ([]TunnelGroup, *http.Response, error) { + return r.ApiService.VpnTunnelGroupsBulkPartialUpdateExecute(r) +} + +/* +VpnTunnelGroupsBulkPartialUpdate Method for VpnTunnelGroupsBulkPartialUpdate + +Patch a list of tunnel group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelGroupsBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsBulkPartialUpdate(ctx context.Context) ApiVpnTunnelGroupsBulkPartialUpdateRequest { + return ApiVpnTunnelGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TunnelGroup +func (a *VpnAPIService) VpnTunnelGroupsBulkPartialUpdateExecute(r ApiVpnTunnelGroupsBulkPartialUpdateRequest) ([]TunnelGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TunnelGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelGroupRequest == nil { + return localVarReturnValue, nil, reportError("tunnelGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelGroupRequest *[]TunnelGroupRequest +} + +func (r ApiVpnTunnelGroupsBulkUpdateRequest) TunnelGroupRequest(tunnelGroupRequest []TunnelGroupRequest) ApiVpnTunnelGroupsBulkUpdateRequest { + r.tunnelGroupRequest = &tunnelGroupRequest + return r +} + +func (r ApiVpnTunnelGroupsBulkUpdateRequest) Execute() ([]TunnelGroup, *http.Response, error) { + return r.ApiService.VpnTunnelGroupsBulkUpdateExecute(r) +} + +/* +VpnTunnelGroupsBulkUpdate Method for VpnTunnelGroupsBulkUpdate + +Put a list of tunnel group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelGroupsBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsBulkUpdate(ctx context.Context) ApiVpnTunnelGroupsBulkUpdateRequest { + return ApiVpnTunnelGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TunnelGroup +func (a *VpnAPIService) VpnTunnelGroupsBulkUpdateExecute(r ApiVpnTunnelGroupsBulkUpdateRequest) ([]TunnelGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TunnelGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelGroupRequest == nil { + return localVarReturnValue, nil, reportError("tunnelGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelGroupRequest *TunnelGroupRequest +} + +func (r ApiVpnTunnelGroupsCreateRequest) TunnelGroupRequest(tunnelGroupRequest TunnelGroupRequest) ApiVpnTunnelGroupsCreateRequest { + r.tunnelGroupRequest = &tunnelGroupRequest + return r +} + +func (r ApiVpnTunnelGroupsCreateRequest) Execute() (*TunnelGroup, *http.Response, error) { + return r.ApiService.VpnTunnelGroupsCreateExecute(r) +} + +/* +VpnTunnelGroupsCreate Method for VpnTunnelGroupsCreate + +Post a list of tunnel group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelGroupsCreateRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsCreate(ctx context.Context) ApiVpnTunnelGroupsCreateRequest { + return ApiVpnTunnelGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TunnelGroup +func (a *VpnAPIService) VpnTunnelGroupsCreateExecute(r ApiVpnTunnelGroupsCreateRequest) (*TunnelGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelGroupRequest == nil { + return localVarReturnValue, nil, reportError("tunnelGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnTunnelGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnTunnelGroupsDestroyExecute(r) +} + +/* +VpnTunnelGroupsDestroy Method for VpnTunnelGroupsDestroy + +Delete a tunnel group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel group. + @return ApiVpnTunnelGroupsDestroyRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsDestroy(ctx context.Context, id int32) ApiVpnTunnelGroupsDestroyRequest { + return ApiVpnTunnelGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnTunnelGroupsDestroyExecute(r ApiVpnTunnelGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsListRequest struct { + ctx context.Context + ApiService *VpnAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiVpnTunnelGroupsListRequest) Created(created []time.Time) ApiVpnTunnelGroupsListRequest { + r.created = &created + return r +} + +func (r ApiVpnTunnelGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnTunnelGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnTunnelGroupsListRequest) CreatedGt(createdGt []time.Time) ApiVpnTunnelGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnTunnelGroupsListRequest) CreatedGte(createdGte []time.Time) ApiVpnTunnelGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnTunnelGroupsListRequest) CreatedLt(createdLt []time.Time) ApiVpnTunnelGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnTunnelGroupsListRequest) CreatedLte(createdLte []time.Time) ApiVpnTunnelGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnTunnelGroupsListRequest) CreatedN(createdN []time.Time) ApiVpnTunnelGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnTunnelGroupsListRequest) CreatedByRequest(createdByRequest string) ApiVpnTunnelGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnTunnelGroupsListRequest) Description(description []string) ApiVpnTunnelGroupsListRequest { + r.description = &description + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnTunnelGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionIc(descriptionIc []string) ApiVpnTunnelGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionIe(descriptionIe []string) ApiVpnTunnelGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionIew(descriptionIew []string) ApiVpnTunnelGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnTunnelGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionN(descriptionN []string) ApiVpnTunnelGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionNic(descriptionNic []string) ApiVpnTunnelGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionNie(descriptionNie []string) ApiVpnTunnelGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnTunnelGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnTunnelGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnTunnelGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVpnTunnelGroupsListRequest) Id(id []int32) ApiVpnTunnelGroupsListRequest { + r.id = &id + return r +} + +func (r ApiVpnTunnelGroupsListRequest) IdEmpty(idEmpty bool) ApiVpnTunnelGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnTunnelGroupsListRequest) IdGt(idGt []int32) ApiVpnTunnelGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnTunnelGroupsListRequest) IdGte(idGte []int32) ApiVpnTunnelGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnTunnelGroupsListRequest) IdLt(idLt []int32) ApiVpnTunnelGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnTunnelGroupsListRequest) IdLte(idLte []int32) ApiVpnTunnelGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnTunnelGroupsListRequest) IdN(idN []int32) ApiVpnTunnelGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiVpnTunnelGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnTunnelGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnTunnelGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnTunnelGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnTunnelGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnTunnelGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnTunnelGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnTunnelGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnTunnelGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnTunnelGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnTunnelGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnTunnelGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnTunnelGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnTunnelGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnTunnelGroupsListRequest) Limit(limit int32) ApiVpnTunnelGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnTunnelGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnTunnelGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnTunnelGroupsListRequest) Name(name []string) ApiVpnTunnelGroupsListRequest { + r.name = &name + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameEmpty(nameEmpty bool) ApiVpnTunnelGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameIc(nameIc []string) ApiVpnTunnelGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameIe(nameIe []string) ApiVpnTunnelGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameIew(nameIew []string) ApiVpnTunnelGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameIsw(nameIsw []string) ApiVpnTunnelGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameN(nameN []string) ApiVpnTunnelGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameNic(nameNic []string) ApiVpnTunnelGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameNie(nameNie []string) ApiVpnTunnelGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameNiew(nameNiew []string) ApiVpnTunnelGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnTunnelGroupsListRequest) NameNisw(nameNisw []string) ApiVpnTunnelGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnTunnelGroupsListRequest) Offset(offset int32) ApiVpnTunnelGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnTunnelGroupsListRequest) Ordering(ordering string) ApiVpnTunnelGroupsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVpnTunnelGroupsListRequest) Q(q string) ApiVpnTunnelGroupsListRequest { + r.q = &q + return r +} + +func (r ApiVpnTunnelGroupsListRequest) Slug(slug []string) ApiVpnTunnelGroupsListRequest { + r.slug = &slug + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugEmpty(slugEmpty bool) ApiVpnTunnelGroupsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugIc(slugIc []string) ApiVpnTunnelGroupsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugIe(slugIe []string) ApiVpnTunnelGroupsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugIew(slugIew []string) ApiVpnTunnelGroupsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugIsw(slugIsw []string) ApiVpnTunnelGroupsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugN(slugN []string) ApiVpnTunnelGroupsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugNic(slugNic []string) ApiVpnTunnelGroupsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugNie(slugNie []string) ApiVpnTunnelGroupsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugNiew(slugNiew []string) ApiVpnTunnelGroupsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiVpnTunnelGroupsListRequest) SlugNisw(slugNisw []string) ApiVpnTunnelGroupsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiVpnTunnelGroupsListRequest) Tag(tag []string) ApiVpnTunnelGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnTunnelGroupsListRequest) TagN(tagN []string) ApiVpnTunnelGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnTunnelGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnTunnelGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnTunnelGroupsListRequest) Execute() (*PaginatedTunnelGroupList, *http.Response, error) { + return r.ApiService.VpnTunnelGroupsListExecute(r) +} + +/* +VpnTunnelGroupsList Method for VpnTunnelGroupsList + +Get a list of tunnel group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelGroupsListRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsList(ctx context.Context) ApiVpnTunnelGroupsListRequest { + return ApiVpnTunnelGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTunnelGroupList +func (a *VpnAPIService) VpnTunnelGroupsListExecute(r ApiVpnTunnelGroupsListRequest) (*PaginatedTunnelGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTunnelGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedTunnelGroupRequest *PatchedTunnelGroupRequest +} + +func (r ApiVpnTunnelGroupsPartialUpdateRequest) PatchedTunnelGroupRequest(patchedTunnelGroupRequest PatchedTunnelGroupRequest) ApiVpnTunnelGroupsPartialUpdateRequest { + r.patchedTunnelGroupRequest = &patchedTunnelGroupRequest + return r +} + +func (r ApiVpnTunnelGroupsPartialUpdateRequest) Execute() (*TunnelGroup, *http.Response, error) { + return r.ApiService.VpnTunnelGroupsPartialUpdateExecute(r) +} + +/* +VpnTunnelGroupsPartialUpdate Method for VpnTunnelGroupsPartialUpdate + +Patch a tunnel group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel group. + @return ApiVpnTunnelGroupsPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsPartialUpdate(ctx context.Context, id int32) ApiVpnTunnelGroupsPartialUpdateRequest { + return ApiVpnTunnelGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TunnelGroup +func (a *VpnAPIService) VpnTunnelGroupsPartialUpdateExecute(r ApiVpnTunnelGroupsPartialUpdateRequest) (*TunnelGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTunnelGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnTunnelGroupsRetrieveRequest) Execute() (*TunnelGroup, *http.Response, error) { + return r.ApiService.VpnTunnelGroupsRetrieveExecute(r) +} + +/* +VpnTunnelGroupsRetrieve Method for VpnTunnelGroupsRetrieve + +Get a tunnel group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel group. + @return ApiVpnTunnelGroupsRetrieveRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsRetrieve(ctx context.Context, id int32) ApiVpnTunnelGroupsRetrieveRequest { + return ApiVpnTunnelGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TunnelGroup +func (a *VpnAPIService) VpnTunnelGroupsRetrieveExecute(r ApiVpnTunnelGroupsRetrieveRequest) (*TunnelGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelGroupsUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + tunnelGroupRequest *TunnelGroupRequest +} + +func (r ApiVpnTunnelGroupsUpdateRequest) TunnelGroupRequest(tunnelGroupRequest TunnelGroupRequest) ApiVpnTunnelGroupsUpdateRequest { + r.tunnelGroupRequest = &tunnelGroupRequest + return r +} + +func (r ApiVpnTunnelGroupsUpdateRequest) Execute() (*TunnelGroup, *http.Response, error) { + return r.ApiService.VpnTunnelGroupsUpdateExecute(r) +} + +/* +VpnTunnelGroupsUpdate Method for VpnTunnelGroupsUpdate + +Put a tunnel group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel group. + @return ApiVpnTunnelGroupsUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelGroupsUpdate(ctx context.Context, id int32) ApiVpnTunnelGroupsUpdateRequest { + return ApiVpnTunnelGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TunnelGroup +func (a *VpnAPIService) VpnTunnelGroupsUpdateExecute(r ApiVpnTunnelGroupsUpdateRequest) (*TunnelGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelGroupRequest == nil { + return localVarReturnValue, nil, reportError("tunnelGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelTerminationRequest *[]TunnelTerminationRequest +} + +func (r ApiVpnTunnelTerminationsBulkDestroyRequest) TunnelTerminationRequest(tunnelTerminationRequest []TunnelTerminationRequest) ApiVpnTunnelTerminationsBulkDestroyRequest { + r.tunnelTerminationRequest = &tunnelTerminationRequest + return r +} + +func (r ApiVpnTunnelTerminationsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnTunnelTerminationsBulkDestroyExecute(r) +} + +/* +VpnTunnelTerminationsBulkDestroy Method for VpnTunnelTerminationsBulkDestroy + +Delete a list of tunnel termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelTerminationsBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsBulkDestroy(ctx context.Context) ApiVpnTunnelTerminationsBulkDestroyRequest { + return ApiVpnTunnelTerminationsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnTunnelTerminationsBulkDestroyExecute(r ApiVpnTunnelTerminationsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelTerminationRequest == nil { + return nil, reportError("tunnelTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelTerminationRequest *[]TunnelTerminationRequest +} + +func (r ApiVpnTunnelTerminationsBulkPartialUpdateRequest) TunnelTerminationRequest(tunnelTerminationRequest []TunnelTerminationRequest) ApiVpnTunnelTerminationsBulkPartialUpdateRequest { + r.tunnelTerminationRequest = &tunnelTerminationRequest + return r +} + +func (r ApiVpnTunnelTerminationsBulkPartialUpdateRequest) Execute() ([]TunnelTermination, *http.Response, error) { + return r.ApiService.VpnTunnelTerminationsBulkPartialUpdateExecute(r) +} + +/* +VpnTunnelTerminationsBulkPartialUpdate Method for VpnTunnelTerminationsBulkPartialUpdate + +Patch a list of tunnel termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelTerminationsBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsBulkPartialUpdate(ctx context.Context) ApiVpnTunnelTerminationsBulkPartialUpdateRequest { + return ApiVpnTunnelTerminationsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TunnelTermination +func (a *VpnAPIService) VpnTunnelTerminationsBulkPartialUpdateExecute(r ApiVpnTunnelTerminationsBulkPartialUpdateRequest) ([]TunnelTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TunnelTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelTerminationRequest == nil { + return localVarReturnValue, nil, reportError("tunnelTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelTerminationRequest *[]TunnelTerminationRequest +} + +func (r ApiVpnTunnelTerminationsBulkUpdateRequest) TunnelTerminationRequest(tunnelTerminationRequest []TunnelTerminationRequest) ApiVpnTunnelTerminationsBulkUpdateRequest { + r.tunnelTerminationRequest = &tunnelTerminationRequest + return r +} + +func (r ApiVpnTunnelTerminationsBulkUpdateRequest) Execute() ([]TunnelTermination, *http.Response, error) { + return r.ApiService.VpnTunnelTerminationsBulkUpdateExecute(r) +} + +/* +VpnTunnelTerminationsBulkUpdate Method for VpnTunnelTerminationsBulkUpdate + +Put a list of tunnel termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelTerminationsBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsBulkUpdate(ctx context.Context) ApiVpnTunnelTerminationsBulkUpdateRequest { + return ApiVpnTunnelTerminationsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TunnelTermination +func (a *VpnAPIService) VpnTunnelTerminationsBulkUpdateExecute(r ApiVpnTunnelTerminationsBulkUpdateRequest) ([]TunnelTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TunnelTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelTerminationRequest == nil { + return localVarReturnValue, nil, reportError("tunnelTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableTunnelTerminationRequest *WritableTunnelTerminationRequest +} + +func (r ApiVpnTunnelTerminationsCreateRequest) WritableTunnelTerminationRequest(writableTunnelTerminationRequest WritableTunnelTerminationRequest) ApiVpnTunnelTerminationsCreateRequest { + r.writableTunnelTerminationRequest = &writableTunnelTerminationRequest + return r +} + +func (r ApiVpnTunnelTerminationsCreateRequest) Execute() (*TunnelTermination, *http.Response, error) { + return r.ApiService.VpnTunnelTerminationsCreateExecute(r) +} + +/* +VpnTunnelTerminationsCreate Method for VpnTunnelTerminationsCreate + +Post a list of tunnel termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelTerminationsCreateRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsCreate(ctx context.Context) ApiVpnTunnelTerminationsCreateRequest { + return ApiVpnTunnelTerminationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TunnelTermination +func (a *VpnAPIService) VpnTunnelTerminationsCreateExecute(r ApiVpnTunnelTerminationsCreateRequest) (*TunnelTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTunnelTerminationRequest == nil { + return localVarReturnValue, nil, reportError("writableTunnelTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTunnelTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnTunnelTerminationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnTunnelTerminationsDestroyExecute(r) +} + +/* +VpnTunnelTerminationsDestroy Method for VpnTunnelTerminationsDestroy + +Delete a tunnel termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel termination. + @return ApiVpnTunnelTerminationsDestroyRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsDestroy(ctx context.Context, id int32) ApiVpnTunnelTerminationsDestroyRequest { + return ApiVpnTunnelTerminationsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnTunnelTerminationsDestroyExecute(r ApiVpnTunnelTerminationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsListRequest struct { + ctx context.Context + ApiService *VpnAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interface_ *[]string + interfaceN *[]string + interfaceId *[]int32 + interfaceIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + outsideIpId *[]int32 + outsideIpIdN *[]int32 + q *string + role *[]string + roleN *[]string + tag *[]string + tagN *[]string + terminationType *string + terminationTypeN *string + tunnel *[]string + tunnelN *[]string + tunnelId *[]int32 + tunnelIdN *[]int32 + updatedByRequest *string + vminterface *[]string + vminterfaceN *[]string + vminterfaceId *[]int32 + vminterfaceIdN *[]int32 +} + +func (r ApiVpnTunnelTerminationsListRequest) Created(created []time.Time) ApiVpnTunnelTerminationsListRequest { + r.created = &created + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnTunnelTerminationsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) CreatedGt(createdGt []time.Time) ApiVpnTunnelTerminationsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) CreatedGte(createdGte []time.Time) ApiVpnTunnelTerminationsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) CreatedLt(createdLt []time.Time) ApiVpnTunnelTerminationsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) CreatedLte(createdLte []time.Time) ApiVpnTunnelTerminationsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) CreatedN(createdN []time.Time) ApiVpnTunnelTerminationsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) CreatedByRequest(createdByRequest string) ApiVpnTunnelTerminationsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) Id(id []int32) ApiVpnTunnelTerminationsListRequest { + r.id = &id + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) IdEmpty(idEmpty bool) ApiVpnTunnelTerminationsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) IdGt(idGt []int32) ApiVpnTunnelTerminationsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) IdGte(idGte []int32) ApiVpnTunnelTerminationsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) IdLt(idLt []int32) ApiVpnTunnelTerminationsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) IdLte(idLte []int32) ApiVpnTunnelTerminationsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) IdN(idN []int32) ApiVpnTunnelTerminationsListRequest { + r.idN = &idN + return r +} + +// Interface (name) +func (r ApiVpnTunnelTerminationsListRequest) Interface_(interface_ []string) ApiVpnTunnelTerminationsListRequest { + r.interface_ = &interface_ + return r +} + +// Interface (name) +func (r ApiVpnTunnelTerminationsListRequest) InterfaceN(interfaceN []string) ApiVpnTunnelTerminationsListRequest { + r.interfaceN = &interfaceN + return r +} + +// Interface (ID) +func (r ApiVpnTunnelTerminationsListRequest) InterfaceId(interfaceId []int32) ApiVpnTunnelTerminationsListRequest { + r.interfaceId = &interfaceId + return r +} + +// Interface (ID) +func (r ApiVpnTunnelTerminationsListRequest) InterfaceIdN(interfaceIdN []int32) ApiVpnTunnelTerminationsListRequest { + r.interfaceIdN = &interfaceIdN + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnTunnelTerminationsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnTunnelTerminationsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnTunnelTerminationsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnTunnelTerminationsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnTunnelTerminationsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnTunnelTerminationsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnTunnelTerminationsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnTunnelTerminationsListRequest) Limit(limit int32) ApiVpnTunnelTerminationsListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnTunnelTerminationsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiVpnTunnelTerminationsListRequest) Offset(offset int32) ApiVpnTunnelTerminationsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnTunnelTerminationsListRequest) Ordering(ordering string) ApiVpnTunnelTerminationsListRequest { + r.ordering = &ordering + return r +} + +// Outside IP (ID) +func (r ApiVpnTunnelTerminationsListRequest) OutsideIpId(outsideIpId []int32) ApiVpnTunnelTerminationsListRequest { + r.outsideIpId = &outsideIpId + return r +} + +// Outside IP (ID) +func (r ApiVpnTunnelTerminationsListRequest) OutsideIpIdN(outsideIpIdN []int32) ApiVpnTunnelTerminationsListRequest { + r.outsideIpIdN = &outsideIpIdN + return r +} + +// Search +func (r ApiVpnTunnelTerminationsListRequest) Q(q string) ApiVpnTunnelTerminationsListRequest { + r.q = &q + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) Role(role []string) ApiVpnTunnelTerminationsListRequest { + r.role = &role + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) RoleN(roleN []string) ApiVpnTunnelTerminationsListRequest { + r.roleN = &roleN + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) Tag(tag []string) ApiVpnTunnelTerminationsListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) TagN(tagN []string) ApiVpnTunnelTerminationsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) TerminationType(terminationType string) ApiVpnTunnelTerminationsListRequest { + r.terminationType = &terminationType + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) TerminationTypeN(terminationTypeN string) ApiVpnTunnelTerminationsListRequest { + r.terminationTypeN = &terminationTypeN + return r +} + +// Tunnel (name) +func (r ApiVpnTunnelTerminationsListRequest) Tunnel(tunnel []string) ApiVpnTunnelTerminationsListRequest { + r.tunnel = &tunnel + return r +} + +// Tunnel (name) +func (r ApiVpnTunnelTerminationsListRequest) TunnelN(tunnelN []string) ApiVpnTunnelTerminationsListRequest { + r.tunnelN = &tunnelN + return r +} + +// Tunnel (ID) +func (r ApiVpnTunnelTerminationsListRequest) TunnelId(tunnelId []int32) ApiVpnTunnelTerminationsListRequest { + r.tunnelId = &tunnelId + return r +} + +// Tunnel (ID) +func (r ApiVpnTunnelTerminationsListRequest) TunnelIdN(tunnelIdN []int32) ApiVpnTunnelTerminationsListRequest { + r.tunnelIdN = &tunnelIdN + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnTunnelTerminationsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +// VM interface (name) +func (r ApiVpnTunnelTerminationsListRequest) Vminterface(vminterface []string) ApiVpnTunnelTerminationsListRequest { + r.vminterface = &vminterface + return r +} + +// VM interface (name) +func (r ApiVpnTunnelTerminationsListRequest) VminterfaceN(vminterfaceN []string) ApiVpnTunnelTerminationsListRequest { + r.vminterfaceN = &vminterfaceN + return r +} + +// VM interface (ID) +func (r ApiVpnTunnelTerminationsListRequest) VminterfaceId(vminterfaceId []int32) ApiVpnTunnelTerminationsListRequest { + r.vminterfaceId = &vminterfaceId + return r +} + +// VM interface (ID) +func (r ApiVpnTunnelTerminationsListRequest) VminterfaceIdN(vminterfaceIdN []int32) ApiVpnTunnelTerminationsListRequest { + r.vminterfaceIdN = &vminterfaceIdN + return r +} + +func (r ApiVpnTunnelTerminationsListRequest) Execute() (*PaginatedTunnelTerminationList, *http.Response, error) { + return r.ApiService.VpnTunnelTerminationsListExecute(r) +} + +/* +VpnTunnelTerminationsList Method for VpnTunnelTerminationsList + +Get a list of tunnel termination objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelTerminationsListRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsList(ctx context.Context) ApiVpnTunnelTerminationsListRequest { + return ApiVpnTunnelTerminationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTunnelTerminationList +func (a *VpnAPIService) VpnTunnelTerminationsListExecute(r ApiVpnTunnelTerminationsListRequest) (*PaginatedTunnelTerminationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTunnelTerminationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interface_ != nil { + t := *r.interface_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface", t, "multi") + } + } + if r.interfaceN != nil { + t := *r.interfaceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface__n", t, "multi") + } + } + if r.interfaceId != nil { + t := *r.interfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id", t, "multi") + } + } + if r.interfaceIdN != nil { + t := *r.interfaceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.outsideIpId != nil { + t := *r.outsideIpId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outside_ip_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outside_ip_id", t, "multi") + } + } + if r.outsideIpIdN != nil { + t := *r.outsideIpIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "outside_ip_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "outside_ip_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.role != nil { + t := *r.role + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", t, "multi") + } + } + if r.roleN != nil { + t := *r.roleN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "role__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.terminationType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_type", r.terminationType, "") + } + if r.terminationTypeN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "termination_type__n", r.terminationTypeN, "") + } + if r.tunnel != nil { + t := *r.tunnel + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel", t, "multi") + } + } + if r.tunnelN != nil { + t := *r.tunnelN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel__n", t, "multi") + } + } + if r.tunnelId != nil { + t := *r.tunnelId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id", t, "multi") + } + } + if r.tunnelIdN != nil { + t := *r.tunnelIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vminterface != nil { + t := *r.vminterface + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface", t, "multi") + } + } + if r.vminterfaceN != nil { + t := *r.vminterfaceN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface__n", t, "multi") + } + } + if r.vminterfaceId != nil { + t := *r.vminterfaceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id", t, "multi") + } + } + if r.vminterfaceIdN != nil { + t := *r.vminterfaceIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vminterface_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableTunnelTerminationRequest *PatchedWritableTunnelTerminationRequest +} + +func (r ApiVpnTunnelTerminationsPartialUpdateRequest) PatchedWritableTunnelTerminationRequest(patchedWritableTunnelTerminationRequest PatchedWritableTunnelTerminationRequest) ApiVpnTunnelTerminationsPartialUpdateRequest { + r.patchedWritableTunnelTerminationRequest = &patchedWritableTunnelTerminationRequest + return r +} + +func (r ApiVpnTunnelTerminationsPartialUpdateRequest) Execute() (*TunnelTermination, *http.Response, error) { + return r.ApiService.VpnTunnelTerminationsPartialUpdateExecute(r) +} + +/* +VpnTunnelTerminationsPartialUpdate Method for VpnTunnelTerminationsPartialUpdate + +Patch a tunnel termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel termination. + @return ApiVpnTunnelTerminationsPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsPartialUpdate(ctx context.Context, id int32) ApiVpnTunnelTerminationsPartialUpdateRequest { + return ApiVpnTunnelTerminationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TunnelTermination +func (a *VpnAPIService) VpnTunnelTerminationsPartialUpdateExecute(r ApiVpnTunnelTerminationsPartialUpdateRequest) (*TunnelTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableTunnelTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnTunnelTerminationsRetrieveRequest) Execute() (*TunnelTermination, *http.Response, error) { + return r.ApiService.VpnTunnelTerminationsRetrieveExecute(r) +} + +/* +VpnTunnelTerminationsRetrieve Method for VpnTunnelTerminationsRetrieve + +Get a tunnel termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel termination. + @return ApiVpnTunnelTerminationsRetrieveRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsRetrieve(ctx context.Context, id int32) ApiVpnTunnelTerminationsRetrieveRequest { + return ApiVpnTunnelTerminationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TunnelTermination +func (a *VpnAPIService) VpnTunnelTerminationsRetrieveExecute(r ApiVpnTunnelTerminationsRetrieveRequest) (*TunnelTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelTerminationsUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableTunnelTerminationRequest *WritableTunnelTerminationRequest +} + +func (r ApiVpnTunnelTerminationsUpdateRequest) WritableTunnelTerminationRequest(writableTunnelTerminationRequest WritableTunnelTerminationRequest) ApiVpnTunnelTerminationsUpdateRequest { + r.writableTunnelTerminationRequest = &writableTunnelTerminationRequest + return r +} + +func (r ApiVpnTunnelTerminationsUpdateRequest) Execute() (*TunnelTermination, *http.Response, error) { + return r.ApiService.VpnTunnelTerminationsUpdateExecute(r) +} + +/* +VpnTunnelTerminationsUpdate Method for VpnTunnelTerminationsUpdate + +Put a tunnel termination object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel termination. + @return ApiVpnTunnelTerminationsUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelTerminationsUpdate(ctx context.Context, id int32) ApiVpnTunnelTerminationsUpdateRequest { + return ApiVpnTunnelTerminationsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TunnelTermination +func (a *VpnAPIService) VpnTunnelTerminationsUpdateExecute(r ApiVpnTunnelTerminationsUpdateRequest) (*TunnelTermination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TunnelTermination + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelTerminationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnel-terminations/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTunnelTerminationRequest == nil { + return localVarReturnValue, nil, reportError("writableTunnelTerminationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTunnelTerminationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelsBulkDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelRequest *[]TunnelRequest +} + +func (r ApiVpnTunnelsBulkDestroyRequest) TunnelRequest(tunnelRequest []TunnelRequest) ApiVpnTunnelsBulkDestroyRequest { + r.tunnelRequest = &tunnelRequest + return r +} + +func (r ApiVpnTunnelsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnTunnelsBulkDestroyExecute(r) +} + +/* +VpnTunnelsBulkDestroy Method for VpnTunnelsBulkDestroy + +Delete a list of tunnel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelsBulkDestroyRequest +*/ +func (a *VpnAPIService) VpnTunnelsBulkDestroy(ctx context.Context) ApiVpnTunnelsBulkDestroyRequest { + return ApiVpnTunnelsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnTunnelsBulkDestroyExecute(r ApiVpnTunnelsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelRequest == nil { + return nil, reportError("tunnelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnTunnelsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelRequest *[]TunnelRequest +} + +func (r ApiVpnTunnelsBulkPartialUpdateRequest) TunnelRequest(tunnelRequest []TunnelRequest) ApiVpnTunnelsBulkPartialUpdateRequest { + r.tunnelRequest = &tunnelRequest + return r +} + +func (r ApiVpnTunnelsBulkPartialUpdateRequest) Execute() ([]Tunnel, *http.Response, error) { + return r.ApiService.VpnTunnelsBulkPartialUpdateExecute(r) +} + +/* +VpnTunnelsBulkPartialUpdate Method for VpnTunnelsBulkPartialUpdate + +Patch a list of tunnel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelsBulkPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelsBulkPartialUpdate(ctx context.Context) ApiVpnTunnelsBulkPartialUpdateRequest { + return ApiVpnTunnelsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Tunnel +func (a *VpnAPIService) VpnTunnelsBulkPartialUpdateExecute(r ApiVpnTunnelsBulkPartialUpdateRequest) ([]Tunnel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Tunnel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelRequest == nil { + return localVarReturnValue, nil, reportError("tunnelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelsBulkUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + tunnelRequest *[]TunnelRequest +} + +func (r ApiVpnTunnelsBulkUpdateRequest) TunnelRequest(tunnelRequest []TunnelRequest) ApiVpnTunnelsBulkUpdateRequest { + r.tunnelRequest = &tunnelRequest + return r +} + +func (r ApiVpnTunnelsBulkUpdateRequest) Execute() ([]Tunnel, *http.Response, error) { + return r.ApiService.VpnTunnelsBulkUpdateExecute(r) +} + +/* +VpnTunnelsBulkUpdate Method for VpnTunnelsBulkUpdate + +Put a list of tunnel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelsBulkUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelsBulkUpdate(ctx context.Context) ApiVpnTunnelsBulkUpdateRequest { + return ApiVpnTunnelsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Tunnel +func (a *VpnAPIService) VpnTunnelsBulkUpdateExecute(r ApiVpnTunnelsBulkUpdateRequest) ([]Tunnel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Tunnel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tunnelRequest == nil { + return localVarReturnValue, nil, reportError("tunnelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tunnelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelsCreateRequest struct { + ctx context.Context + ApiService *VpnAPIService + writableTunnelRequest *WritableTunnelRequest +} + +func (r ApiVpnTunnelsCreateRequest) WritableTunnelRequest(writableTunnelRequest WritableTunnelRequest) ApiVpnTunnelsCreateRequest { + r.writableTunnelRequest = &writableTunnelRequest + return r +} + +func (r ApiVpnTunnelsCreateRequest) Execute() (*Tunnel, *http.Response, error) { + return r.ApiService.VpnTunnelsCreateExecute(r) +} + +/* +VpnTunnelsCreate Method for VpnTunnelsCreate + +Post a list of tunnel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelsCreateRequest +*/ +func (a *VpnAPIService) VpnTunnelsCreate(ctx context.Context) ApiVpnTunnelsCreateRequest { + return ApiVpnTunnelsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Tunnel +func (a *VpnAPIService) VpnTunnelsCreateExecute(r ApiVpnTunnelsCreateRequest) (*Tunnel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tunnel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTunnelRequest == nil { + return localVarReturnValue, nil, reportError("writableTunnelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTunnelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelsDestroyRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnTunnelsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.VpnTunnelsDestroyExecute(r) +} + +/* +VpnTunnelsDestroy Method for VpnTunnelsDestroy + +Delete a tunnel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel. + @return ApiVpnTunnelsDestroyRequest +*/ +func (a *VpnAPIService) VpnTunnelsDestroy(ctx context.Context, id int32) ApiVpnTunnelsDestroyRequest { + return ApiVpnTunnelsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VpnAPIService) VpnTunnelsDestroyExecute(r ApiVpnTunnelsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiVpnTunnelsListRequest struct { + ctx context.Context + ApiService *VpnAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + encapsulation *[]string + encapsulationN *[]string + group *[]string + groupN *[]string + groupId *[]*int32 + groupIdN *[]*int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + ipsecProfile *[]string + ipsecProfileN *[]string + ipsecProfileId *[]*int32 + ipsecProfileIdN *[]*int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + q *string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + tunnelId *[]int32 + tunnelIdEmpty *bool + tunnelIdGt *[]int32 + tunnelIdGte *[]int32 + tunnelIdLt *[]int32 + tunnelIdLte *[]int32 + tunnelIdN *[]int32 + updatedByRequest *string +} + +func (r ApiVpnTunnelsListRequest) Created(created []time.Time) ApiVpnTunnelsListRequest { + r.created = &created + return r +} + +func (r ApiVpnTunnelsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiVpnTunnelsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiVpnTunnelsListRequest) CreatedGt(createdGt []time.Time) ApiVpnTunnelsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiVpnTunnelsListRequest) CreatedGte(createdGte []time.Time) ApiVpnTunnelsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiVpnTunnelsListRequest) CreatedLt(createdLt []time.Time) ApiVpnTunnelsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiVpnTunnelsListRequest) CreatedLte(createdLte []time.Time) ApiVpnTunnelsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiVpnTunnelsListRequest) CreatedN(createdN []time.Time) ApiVpnTunnelsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiVpnTunnelsListRequest) CreatedByRequest(createdByRequest string) ApiVpnTunnelsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiVpnTunnelsListRequest) Description(description []string) ApiVpnTunnelsListRequest { + r.description = &description + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiVpnTunnelsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionIc(descriptionIc []string) ApiVpnTunnelsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionIe(descriptionIe []string) ApiVpnTunnelsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionIew(descriptionIew []string) ApiVpnTunnelsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionIsw(descriptionIsw []string) ApiVpnTunnelsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionN(descriptionN []string) ApiVpnTunnelsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionNic(descriptionNic []string) ApiVpnTunnelsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionNie(descriptionNie []string) ApiVpnTunnelsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionNiew(descriptionNiew []string) ApiVpnTunnelsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiVpnTunnelsListRequest) DescriptionNisw(descriptionNisw []string) ApiVpnTunnelsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiVpnTunnelsListRequest) Encapsulation(encapsulation []string) ApiVpnTunnelsListRequest { + r.encapsulation = &encapsulation + return r +} + +func (r ApiVpnTunnelsListRequest) EncapsulationN(encapsulationN []string) ApiVpnTunnelsListRequest { + r.encapsulationN = &encapsulationN + return r +} + +// Tunnel group (slug) +func (r ApiVpnTunnelsListRequest) Group(group []string) ApiVpnTunnelsListRequest { + r.group = &group + return r +} + +// Tunnel group (slug) +func (r ApiVpnTunnelsListRequest) GroupN(groupN []string) ApiVpnTunnelsListRequest { + r.groupN = &groupN + return r +} + +// Tunnel group (ID) +func (r ApiVpnTunnelsListRequest) GroupId(groupId []*int32) ApiVpnTunnelsListRequest { + r.groupId = &groupId + return r +} + +// Tunnel group (ID) +func (r ApiVpnTunnelsListRequest) GroupIdN(groupIdN []*int32) ApiVpnTunnelsListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiVpnTunnelsListRequest) Id(id []int32) ApiVpnTunnelsListRequest { + r.id = &id + return r +} + +func (r ApiVpnTunnelsListRequest) IdEmpty(idEmpty bool) ApiVpnTunnelsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiVpnTunnelsListRequest) IdGt(idGt []int32) ApiVpnTunnelsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiVpnTunnelsListRequest) IdGte(idGte []int32) ApiVpnTunnelsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiVpnTunnelsListRequest) IdLt(idLt []int32) ApiVpnTunnelsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiVpnTunnelsListRequest) IdLte(idLte []int32) ApiVpnTunnelsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiVpnTunnelsListRequest) IdN(idN []int32) ApiVpnTunnelsListRequest { + r.idN = &idN + return r +} + +// IPSec profile (name) +func (r ApiVpnTunnelsListRequest) IpsecProfile(ipsecProfile []string) ApiVpnTunnelsListRequest { + r.ipsecProfile = &ipsecProfile + return r +} + +// IPSec profile (name) +func (r ApiVpnTunnelsListRequest) IpsecProfileN(ipsecProfileN []string) ApiVpnTunnelsListRequest { + r.ipsecProfileN = &ipsecProfileN + return r +} + +// IPSec profile (ID) +func (r ApiVpnTunnelsListRequest) IpsecProfileId(ipsecProfileId []*int32) ApiVpnTunnelsListRequest { + r.ipsecProfileId = &ipsecProfileId + return r +} + +// IPSec profile (ID) +func (r ApiVpnTunnelsListRequest) IpsecProfileIdN(ipsecProfileIdN []*int32) ApiVpnTunnelsListRequest { + r.ipsecProfileIdN = &ipsecProfileIdN + return r +} + +func (r ApiVpnTunnelsListRequest) LastUpdated(lastUpdated []time.Time) ApiVpnTunnelsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiVpnTunnelsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiVpnTunnelsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiVpnTunnelsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiVpnTunnelsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiVpnTunnelsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiVpnTunnelsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiVpnTunnelsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiVpnTunnelsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiVpnTunnelsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiVpnTunnelsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiVpnTunnelsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiVpnTunnelsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiVpnTunnelsListRequest) Limit(limit int32) ApiVpnTunnelsListRequest { + r.limit = &limit + return r +} + +func (r ApiVpnTunnelsListRequest) ModifiedByRequest(modifiedByRequest string) ApiVpnTunnelsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiVpnTunnelsListRequest) Name(name []string) ApiVpnTunnelsListRequest { + r.name = &name + return r +} + +func (r ApiVpnTunnelsListRequest) NameEmpty(nameEmpty bool) ApiVpnTunnelsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiVpnTunnelsListRequest) NameIc(nameIc []string) ApiVpnTunnelsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiVpnTunnelsListRequest) NameIe(nameIe []string) ApiVpnTunnelsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiVpnTunnelsListRequest) NameIew(nameIew []string) ApiVpnTunnelsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiVpnTunnelsListRequest) NameIsw(nameIsw []string) ApiVpnTunnelsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiVpnTunnelsListRequest) NameN(nameN []string) ApiVpnTunnelsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiVpnTunnelsListRequest) NameNic(nameNic []string) ApiVpnTunnelsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiVpnTunnelsListRequest) NameNie(nameNie []string) ApiVpnTunnelsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiVpnTunnelsListRequest) NameNiew(nameNiew []string) ApiVpnTunnelsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiVpnTunnelsListRequest) NameNisw(nameNisw []string) ApiVpnTunnelsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiVpnTunnelsListRequest) Offset(offset int32) ApiVpnTunnelsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiVpnTunnelsListRequest) Ordering(ordering string) ApiVpnTunnelsListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiVpnTunnelsListRequest) Q(q string) ApiVpnTunnelsListRequest { + r.q = &q + return r +} + +func (r ApiVpnTunnelsListRequest) Status(status []string) ApiVpnTunnelsListRequest { + r.status = &status + return r +} + +func (r ApiVpnTunnelsListRequest) StatusN(statusN []string) ApiVpnTunnelsListRequest { + r.statusN = &statusN + return r +} + +func (r ApiVpnTunnelsListRequest) Tag(tag []string) ApiVpnTunnelsListRequest { + r.tag = &tag + return r +} + +func (r ApiVpnTunnelsListRequest) TagN(tagN []string) ApiVpnTunnelsListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiVpnTunnelsListRequest) Tenant(tenant []string) ApiVpnTunnelsListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiVpnTunnelsListRequest) TenantN(tenantN []string) ApiVpnTunnelsListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiVpnTunnelsListRequest) TenantGroup(tenantGroup []int32) ApiVpnTunnelsListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiVpnTunnelsListRequest) TenantGroupN(tenantGroupN []int32) ApiVpnTunnelsListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiVpnTunnelsListRequest) TenantGroupId(tenantGroupId []int32) ApiVpnTunnelsListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiVpnTunnelsListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiVpnTunnelsListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiVpnTunnelsListRequest) TenantId(tenantId []*int32) ApiVpnTunnelsListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiVpnTunnelsListRequest) TenantIdN(tenantIdN []*int32) ApiVpnTunnelsListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiVpnTunnelsListRequest) TunnelId(tunnelId []int32) ApiVpnTunnelsListRequest { + r.tunnelId = &tunnelId + return r +} + +func (r ApiVpnTunnelsListRequest) TunnelIdEmpty(tunnelIdEmpty bool) ApiVpnTunnelsListRequest { + r.tunnelIdEmpty = &tunnelIdEmpty + return r +} + +func (r ApiVpnTunnelsListRequest) TunnelIdGt(tunnelIdGt []int32) ApiVpnTunnelsListRequest { + r.tunnelIdGt = &tunnelIdGt + return r +} + +func (r ApiVpnTunnelsListRequest) TunnelIdGte(tunnelIdGte []int32) ApiVpnTunnelsListRequest { + r.tunnelIdGte = &tunnelIdGte + return r +} + +func (r ApiVpnTunnelsListRequest) TunnelIdLt(tunnelIdLt []int32) ApiVpnTunnelsListRequest { + r.tunnelIdLt = &tunnelIdLt + return r +} + +func (r ApiVpnTunnelsListRequest) TunnelIdLte(tunnelIdLte []int32) ApiVpnTunnelsListRequest { + r.tunnelIdLte = &tunnelIdLte + return r +} + +func (r ApiVpnTunnelsListRequest) TunnelIdN(tunnelIdN []int32) ApiVpnTunnelsListRequest { + r.tunnelIdN = &tunnelIdN + return r +} + +func (r ApiVpnTunnelsListRequest) UpdatedByRequest(updatedByRequest string) ApiVpnTunnelsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiVpnTunnelsListRequest) Execute() (*PaginatedTunnelList, *http.Response, error) { + return r.ApiService.VpnTunnelsListExecute(r) +} + +/* +VpnTunnelsList Method for VpnTunnelsList + +Get a list of tunnel objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVpnTunnelsListRequest +*/ +func (a *VpnAPIService) VpnTunnelsList(ctx context.Context) ApiVpnTunnelsListRequest { + return ApiVpnTunnelsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTunnelList +func (a *VpnAPIService) VpnTunnelsListExecute(r ApiVpnTunnelsListRequest) (*PaginatedTunnelList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTunnelList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.encapsulation != nil { + t := *r.encapsulation + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "encapsulation", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "encapsulation", t, "multi") + } + } + if r.encapsulationN != nil { + t := *r.encapsulationN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "encapsulation__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "encapsulation__n", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.ipsecProfile != nil { + t := *r.ipsecProfile + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile", t, "multi") + } + } + if r.ipsecProfileN != nil { + t := *r.ipsecProfileN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile__n", t, "multi") + } + } + if r.ipsecProfileId != nil { + t := *r.ipsecProfileId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile_id", t, "multi") + } + } + if r.ipsecProfileIdN != nil { + t := *r.ipsecProfileIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ipsec_profile_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.tunnelId != nil { + t := *r.tunnelId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id", t, "multi") + } + } + if r.tunnelIdEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__empty", r.tunnelIdEmpty, "") + } + if r.tunnelIdGt != nil { + t := *r.tunnelIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__gt", t, "multi") + } + } + if r.tunnelIdGte != nil { + t := *r.tunnelIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__gte", t, "multi") + } + } + if r.tunnelIdLt != nil { + t := *r.tunnelIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__lt", t, "multi") + } + } + if r.tunnelIdLte != nil { + t := *r.tunnelIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__lte", t, "multi") + } + } + if r.tunnelIdN != nil { + t := *r.tunnelIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tunnel_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelsPartialUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + patchedWritableTunnelRequest *PatchedWritableTunnelRequest +} + +func (r ApiVpnTunnelsPartialUpdateRequest) PatchedWritableTunnelRequest(patchedWritableTunnelRequest PatchedWritableTunnelRequest) ApiVpnTunnelsPartialUpdateRequest { + r.patchedWritableTunnelRequest = &patchedWritableTunnelRequest + return r +} + +func (r ApiVpnTunnelsPartialUpdateRequest) Execute() (*Tunnel, *http.Response, error) { + return r.ApiService.VpnTunnelsPartialUpdateExecute(r) +} + +/* +VpnTunnelsPartialUpdate Method for VpnTunnelsPartialUpdate + +Patch a tunnel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel. + @return ApiVpnTunnelsPartialUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelsPartialUpdate(ctx context.Context, id int32) ApiVpnTunnelsPartialUpdateRequest { + return ApiVpnTunnelsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tunnel +func (a *VpnAPIService) VpnTunnelsPartialUpdateExecute(r ApiVpnTunnelsPartialUpdateRequest) (*Tunnel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tunnel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableTunnelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelsRetrieveRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 +} + +func (r ApiVpnTunnelsRetrieveRequest) Execute() (*Tunnel, *http.Response, error) { + return r.ApiService.VpnTunnelsRetrieveExecute(r) +} + +/* +VpnTunnelsRetrieve Method for VpnTunnelsRetrieve + +Get a tunnel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel. + @return ApiVpnTunnelsRetrieveRequest +*/ +func (a *VpnAPIService) VpnTunnelsRetrieve(ctx context.Context, id int32) ApiVpnTunnelsRetrieveRequest { + return ApiVpnTunnelsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tunnel +func (a *VpnAPIService) VpnTunnelsRetrieveExecute(r ApiVpnTunnelsRetrieveRequest) (*Tunnel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tunnel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiVpnTunnelsUpdateRequest struct { + ctx context.Context + ApiService *VpnAPIService + id int32 + writableTunnelRequest *WritableTunnelRequest +} + +func (r ApiVpnTunnelsUpdateRequest) WritableTunnelRequest(writableTunnelRequest WritableTunnelRequest) ApiVpnTunnelsUpdateRequest { + r.writableTunnelRequest = &writableTunnelRequest + return r +} + +func (r ApiVpnTunnelsUpdateRequest) Execute() (*Tunnel, *http.Response, error) { + return r.ApiService.VpnTunnelsUpdateExecute(r) +} + +/* +VpnTunnelsUpdate Method for VpnTunnelsUpdate + +Put a tunnel object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this tunnel. + @return ApiVpnTunnelsUpdateRequest +*/ +func (a *VpnAPIService) VpnTunnelsUpdate(ctx context.Context, id int32) ApiVpnTunnelsUpdateRequest { + return ApiVpnTunnelsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Tunnel +func (a *VpnAPIService) VpnTunnelsUpdateExecute(r ApiVpnTunnelsUpdateRequest) (*Tunnel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tunnel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VpnAPIService.VpnTunnelsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/vpn/tunnels/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableTunnelRequest == nil { + return localVarReturnValue, nil, reportError("writableTunnelRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableTunnelRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/api_wireless.go b/vendor/github.com/netbox-community/go-netbox/v3/api_wireless.go new file mode 100644 index 00000000..c422c43f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/api_wireless.go @@ -0,0 +1,7129 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// WirelessAPIService WirelessAPI service +type WirelessAPIService service + +type ApiWirelessWirelessLanGroupsBulkDestroyRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLANGroupRequest *[]WirelessLANGroupRequest +} + +func (r ApiWirelessWirelessLanGroupsBulkDestroyRequest) WirelessLANGroupRequest(wirelessLANGroupRequest []WirelessLANGroupRequest) ApiWirelessWirelessLanGroupsBulkDestroyRequest { + r.wirelessLANGroupRequest = &wirelessLANGroupRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsBulkDestroyExecute(r) +} + +/* +WirelessWirelessLanGroupsBulkDestroy Method for WirelessWirelessLanGroupsBulkDestroy + +Delete a list of wireless LAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLanGroupsBulkDestroyRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsBulkDestroy(ctx context.Context) ApiWirelessWirelessLanGroupsBulkDestroyRequest { + return ApiWirelessWirelessLanGroupsBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *WirelessAPIService) WirelessWirelessLanGroupsBulkDestroyExecute(r ApiWirelessWirelessLanGroupsBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLANGroupRequest == nil { + return nil, reportError("wirelessLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLANGroupRequest *[]WirelessLANGroupRequest +} + +func (r ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest) WirelessLANGroupRequest(wirelessLANGroupRequest []WirelessLANGroupRequest) ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest { + r.wirelessLANGroupRequest = &wirelessLANGroupRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest) Execute() ([]WirelessLANGroup, *http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsBulkPartialUpdateExecute(r) +} + +/* +WirelessWirelessLanGroupsBulkPartialUpdate Method for WirelessWirelessLanGroupsBulkPartialUpdate + +Patch a list of wireless LAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsBulkPartialUpdate(ctx context.Context) ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest { + return ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []WirelessLANGroup +func (a *WirelessAPIService) WirelessWirelessLanGroupsBulkPartialUpdateExecute(r ApiWirelessWirelessLanGroupsBulkPartialUpdateRequest) ([]WirelessLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []WirelessLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("wirelessLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsBulkUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLANGroupRequest *[]WirelessLANGroupRequest +} + +func (r ApiWirelessWirelessLanGroupsBulkUpdateRequest) WirelessLANGroupRequest(wirelessLANGroupRequest []WirelessLANGroupRequest) ApiWirelessWirelessLanGroupsBulkUpdateRequest { + r.wirelessLANGroupRequest = &wirelessLANGroupRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsBulkUpdateRequest) Execute() ([]WirelessLANGroup, *http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsBulkUpdateExecute(r) +} + +/* +WirelessWirelessLanGroupsBulkUpdate Method for WirelessWirelessLanGroupsBulkUpdate + +Put a list of wireless LAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLanGroupsBulkUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsBulkUpdate(ctx context.Context) ApiWirelessWirelessLanGroupsBulkUpdateRequest { + return ApiWirelessWirelessLanGroupsBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []WirelessLANGroup +func (a *WirelessAPIService) WirelessWirelessLanGroupsBulkUpdateExecute(r ApiWirelessWirelessLanGroupsBulkUpdateRequest) ([]WirelessLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []WirelessLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("wirelessLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsCreateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + writableWirelessLANGroupRequest *WritableWirelessLANGroupRequest +} + +func (r ApiWirelessWirelessLanGroupsCreateRequest) WritableWirelessLANGroupRequest(writableWirelessLANGroupRequest WritableWirelessLANGroupRequest) ApiWirelessWirelessLanGroupsCreateRequest { + r.writableWirelessLANGroupRequest = &writableWirelessLANGroupRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsCreateRequest) Execute() (*WirelessLANGroup, *http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsCreateExecute(r) +} + +/* +WirelessWirelessLanGroupsCreate Method for WirelessWirelessLanGroupsCreate + +Post a list of wireless LAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLanGroupsCreateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsCreate(ctx context.Context) ApiWirelessWirelessLanGroupsCreateRequest { + return ApiWirelessWirelessLanGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return WirelessLANGroup +func (a *WirelessAPIService) WirelessWirelessLanGroupsCreateExecute(r ApiWirelessWirelessLanGroupsCreateRequest) (*WirelessLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableWirelessLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableWirelessLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableWirelessLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsDestroyRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 +} + +func (r ApiWirelessWirelessLanGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsDestroyExecute(r) +} + +/* +WirelessWirelessLanGroupsDestroy Method for WirelessWirelessLanGroupsDestroy + +Delete a wireless LAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN group. + @return ApiWirelessWirelessLanGroupsDestroyRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsDestroy(ctx context.Context, id int32) ApiWirelessWirelessLanGroupsDestroyRequest { + return ApiWirelessWirelessLanGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *WirelessAPIService) WirelessWirelessLanGroupsDestroyExecute(r ApiWirelessWirelessLanGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsListRequest struct { + ctx context.Context + ApiService *WirelessAPIService + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + name *[]string + nameEmpty *bool + nameIc *[]string + nameIe *[]string + nameIew *[]string + nameIsw *[]string + nameN *[]string + nameNic *[]string + nameNie *[]string + nameNiew *[]string + nameNisw *[]string + offset *int32 + ordering *string + parent *[]string + parentN *[]string + parentId *[]*int32 + parentIdN *[]*int32 + q *string + slug *[]string + slugEmpty *bool + slugIc *[]string + slugIe *[]string + slugIew *[]string + slugIsw *[]string + slugN *[]string + slugNic *[]string + slugNie *[]string + slugNiew *[]string + slugNisw *[]string + tag *[]string + tagN *[]string + updatedByRequest *string +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Created(created []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.created = &created + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) CreatedEmpty(createdEmpty []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) CreatedGt(createdGt []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) CreatedGte(createdGte []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) CreatedLt(createdLt []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) CreatedLte(createdLte []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) CreatedN(createdN []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.createdN = &createdN + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) CreatedByRequest(createdByRequest string) ApiWirelessWirelessLanGroupsListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Description(description []string) ApiWirelessWirelessLanGroupsListRequest { + r.description = &description + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionEmpty(descriptionEmpty bool) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionIc(descriptionIc []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionIe(descriptionIe []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionIew(descriptionIew []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionIsw(descriptionIsw []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionN(descriptionN []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionNic(descriptionNic []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionNie(descriptionNie []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionNiew(descriptionNiew []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) DescriptionNisw(descriptionNisw []string) ApiWirelessWirelessLanGroupsListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Id(id []int32) ApiWirelessWirelessLanGroupsListRequest { + r.id = &id + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) IdEmpty(idEmpty bool) ApiWirelessWirelessLanGroupsListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) IdGt(idGt []int32) ApiWirelessWirelessLanGroupsListRequest { + r.idGt = &idGt + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) IdGte(idGte []int32) ApiWirelessWirelessLanGroupsListRequest { + r.idGte = &idGte + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) IdLt(idLt []int32) ApiWirelessWirelessLanGroupsListRequest { + r.idLt = &idLt + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) IdLte(idLte []int32) ApiWirelessWirelessLanGroupsListRequest { + r.idLte = &idLte + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) IdN(idN []int32) ApiWirelessWirelessLanGroupsListRequest { + r.idN = &idN + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) LastUpdated(lastUpdated []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiWirelessWirelessLanGroupsListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiWirelessWirelessLanGroupsListRequest) Limit(limit int32) ApiWirelessWirelessLanGroupsListRequest { + r.limit = &limit + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) ModifiedByRequest(modifiedByRequest string) ApiWirelessWirelessLanGroupsListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Name(name []string) ApiWirelessWirelessLanGroupsListRequest { + r.name = &name + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameEmpty(nameEmpty bool) ApiWirelessWirelessLanGroupsListRequest { + r.nameEmpty = &nameEmpty + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameIc(nameIc []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameIc = &nameIc + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameIe(nameIe []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameIe = &nameIe + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameIew(nameIew []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameIew = &nameIew + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameIsw(nameIsw []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameIsw = &nameIsw + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameN(nameN []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameN = &nameN + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameNic(nameNic []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameNic = &nameNic + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameNie(nameNie []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameNie = &nameNie + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameNiew(nameNiew []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameNiew = &nameNiew + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) NameNisw(nameNisw []string) ApiWirelessWirelessLanGroupsListRequest { + r.nameNisw = &nameNisw + return r +} + +// The initial index from which to return the results. +func (r ApiWirelessWirelessLanGroupsListRequest) Offset(offset int32) ApiWirelessWirelessLanGroupsListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiWirelessWirelessLanGroupsListRequest) Ordering(ordering string) ApiWirelessWirelessLanGroupsListRequest { + r.ordering = &ordering + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Parent(parent []string) ApiWirelessWirelessLanGroupsListRequest { + r.parent = &parent + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) ParentN(parentN []string) ApiWirelessWirelessLanGroupsListRequest { + r.parentN = &parentN + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) ParentId(parentId []*int32) ApiWirelessWirelessLanGroupsListRequest { + r.parentId = &parentId + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) ParentIdN(parentIdN []*int32) ApiWirelessWirelessLanGroupsListRequest { + r.parentIdN = &parentIdN + return r +} + +// Search +func (r ApiWirelessWirelessLanGroupsListRequest) Q(q string) ApiWirelessWirelessLanGroupsListRequest { + r.q = &q + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Slug(slug []string) ApiWirelessWirelessLanGroupsListRequest { + r.slug = &slug + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugEmpty(slugEmpty bool) ApiWirelessWirelessLanGroupsListRequest { + r.slugEmpty = &slugEmpty + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugIc(slugIc []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugIc = &slugIc + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugIe(slugIe []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugIe = &slugIe + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugIew(slugIew []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugIew = &slugIew + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugIsw(slugIsw []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugIsw = &slugIsw + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugN(slugN []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugN = &slugN + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugNic(slugNic []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugNic = &slugNic + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugNie(slugNie []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugNie = &slugNie + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugNiew(slugNiew []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugNiew = &slugNiew + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) SlugNisw(slugNisw []string) ApiWirelessWirelessLanGroupsListRequest { + r.slugNisw = &slugNisw + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Tag(tag []string) ApiWirelessWirelessLanGroupsListRequest { + r.tag = &tag + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) TagN(tagN []string) ApiWirelessWirelessLanGroupsListRequest { + r.tagN = &tagN + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) UpdatedByRequest(updatedByRequest string) ApiWirelessWirelessLanGroupsListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsListRequest) Execute() (*PaginatedWirelessLANGroupList, *http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsListExecute(r) +} + +/* +WirelessWirelessLanGroupsList Method for WirelessWirelessLanGroupsList + +Get a list of wireless LAN group objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLanGroupsListRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsList(ctx context.Context) ApiWirelessWirelessLanGroupsListRequest { + return ApiWirelessWirelessLanGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWirelessLANGroupList +func (a *WirelessAPIService) WirelessWirelessLanGroupsListExecute(r ApiWirelessWirelessLanGroupsListRequest) (*PaginatedWirelessLANGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWirelessLANGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.name != nil { + t := *r.name + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", t, "multi") + } + } + if r.nameEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__empty", r.nameEmpty, "") + } + if r.nameIc != nil { + t := *r.nameIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ic", t, "multi") + } + } + if r.nameIe != nil { + t := *r.nameIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__ie", t, "multi") + } + } + if r.nameIew != nil { + t := *r.nameIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iew", t, "multi") + } + } + if r.nameIsw != nil { + t := *r.nameIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__isw", t, "multi") + } + } + if r.nameN != nil { + t := *r.nameN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__n", t, "multi") + } + } + if r.nameNic != nil { + t := *r.nameNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nic", t, "multi") + } + } + if r.nameNie != nil { + t := *r.nameNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nie", t, "multi") + } + } + if r.nameNiew != nil { + t := *r.nameNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__niew", t, "multi") + } + } + if r.nameNisw != nil { + t := *r.nameNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__nisw", t, "multi") + } + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.parent != nil { + t := *r.parent + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent", t, "multi") + } + } + if r.parentN != nil { + t := *r.parentN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent__n", t, "multi") + } + } + if r.parentId != nil { + t := *r.parentId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id", t, "multi") + } + } + if r.parentIdN != nil { + t := *r.parentIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "parent_id__n", t, "multi") + } + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.slug != nil { + t := *r.slug + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", t, "multi") + } + } + if r.slugEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__empty", r.slugEmpty, "") + } + if r.slugIc != nil { + t := *r.slugIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ic", t, "multi") + } + } + if r.slugIe != nil { + t := *r.slugIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__ie", t, "multi") + } + } + if r.slugIew != nil { + t := *r.slugIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__iew", t, "multi") + } + } + if r.slugIsw != nil { + t := *r.slugIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__isw", t, "multi") + } + } + if r.slugN != nil { + t := *r.slugN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__n", t, "multi") + } + } + if r.slugNic != nil { + t := *r.slugNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nic", t, "multi") + } + } + if r.slugNie != nil { + t := *r.slugNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nie", t, "multi") + } + } + if r.slugNiew != nil { + t := *r.slugNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__niew", t, "multi") + } + } + if r.slugNisw != nil { + t := *r.slugNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug__nisw", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 + patchedWritableWirelessLANGroupRequest *PatchedWritableWirelessLANGroupRequest +} + +func (r ApiWirelessWirelessLanGroupsPartialUpdateRequest) PatchedWritableWirelessLANGroupRequest(patchedWritableWirelessLANGroupRequest PatchedWritableWirelessLANGroupRequest) ApiWirelessWirelessLanGroupsPartialUpdateRequest { + r.patchedWritableWirelessLANGroupRequest = &patchedWritableWirelessLANGroupRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsPartialUpdateRequest) Execute() (*WirelessLANGroup, *http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsPartialUpdateExecute(r) +} + +/* +WirelessWirelessLanGroupsPartialUpdate Method for WirelessWirelessLanGroupsPartialUpdate + +Patch a wireless LAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN group. + @return ApiWirelessWirelessLanGroupsPartialUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsPartialUpdate(ctx context.Context, id int32) ApiWirelessWirelessLanGroupsPartialUpdateRequest { + return ApiWirelessWirelessLanGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLANGroup +func (a *WirelessAPIService) WirelessWirelessLanGroupsPartialUpdateExecute(r ApiWirelessWirelessLanGroupsPartialUpdateRequest) (*WirelessLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableWirelessLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsRetrieveRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 +} + +func (r ApiWirelessWirelessLanGroupsRetrieveRequest) Execute() (*WirelessLANGroup, *http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsRetrieveExecute(r) +} + +/* +WirelessWirelessLanGroupsRetrieve Method for WirelessWirelessLanGroupsRetrieve + +Get a wireless LAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN group. + @return ApiWirelessWirelessLanGroupsRetrieveRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsRetrieve(ctx context.Context, id int32) ApiWirelessWirelessLanGroupsRetrieveRequest { + return ApiWirelessWirelessLanGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLANGroup +func (a *WirelessAPIService) WirelessWirelessLanGroupsRetrieveExecute(r ApiWirelessWirelessLanGroupsRetrieveRequest) (*WirelessLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLanGroupsUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 + writableWirelessLANGroupRequest *WritableWirelessLANGroupRequest +} + +func (r ApiWirelessWirelessLanGroupsUpdateRequest) WritableWirelessLANGroupRequest(writableWirelessLANGroupRequest WritableWirelessLANGroupRequest) ApiWirelessWirelessLanGroupsUpdateRequest { + r.writableWirelessLANGroupRequest = &writableWirelessLANGroupRequest + return r +} + +func (r ApiWirelessWirelessLanGroupsUpdateRequest) Execute() (*WirelessLANGroup, *http.Response, error) { + return r.ApiService.WirelessWirelessLanGroupsUpdateExecute(r) +} + +/* +WirelessWirelessLanGroupsUpdate Method for WirelessWirelessLanGroupsUpdate + +Put a wireless LAN group object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN group. + @return ApiWirelessWirelessLanGroupsUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLanGroupsUpdate(ctx context.Context, id int32) ApiWirelessWirelessLanGroupsUpdateRequest { + return ApiWirelessWirelessLanGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLANGroup +func (a *WirelessAPIService) WirelessWirelessLanGroupsUpdateExecute(r ApiWirelessWirelessLanGroupsUpdateRequest) (*WirelessLANGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLANGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLanGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lan-groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableWirelessLANGroupRequest == nil { + return localVarReturnValue, nil, reportError("writableWirelessLANGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableWirelessLANGroupRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansBulkDestroyRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLANRequest *[]WirelessLANRequest +} + +func (r ApiWirelessWirelessLansBulkDestroyRequest) WirelessLANRequest(wirelessLANRequest []WirelessLANRequest) ApiWirelessWirelessLansBulkDestroyRequest { + r.wirelessLANRequest = &wirelessLANRequest + return r +} + +func (r ApiWirelessWirelessLansBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.WirelessWirelessLansBulkDestroyExecute(r) +} + +/* +WirelessWirelessLansBulkDestroy Method for WirelessWirelessLansBulkDestroy + +Delete a list of wireless LAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLansBulkDestroyRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansBulkDestroy(ctx context.Context) ApiWirelessWirelessLansBulkDestroyRequest { + return ApiWirelessWirelessLansBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *WirelessAPIService) WirelessWirelessLansBulkDestroyExecute(r ApiWirelessWirelessLansBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLANRequest == nil { + return nil, reportError("wirelessLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLANRequest *[]WirelessLANRequest +} + +func (r ApiWirelessWirelessLansBulkPartialUpdateRequest) WirelessLANRequest(wirelessLANRequest []WirelessLANRequest) ApiWirelessWirelessLansBulkPartialUpdateRequest { + r.wirelessLANRequest = &wirelessLANRequest + return r +} + +func (r ApiWirelessWirelessLansBulkPartialUpdateRequest) Execute() ([]WirelessLAN, *http.Response, error) { + return r.ApiService.WirelessWirelessLansBulkPartialUpdateExecute(r) +} + +/* +WirelessWirelessLansBulkPartialUpdate Method for WirelessWirelessLansBulkPartialUpdate + +Patch a list of wireless LAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLansBulkPartialUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansBulkPartialUpdate(ctx context.Context) ApiWirelessWirelessLansBulkPartialUpdateRequest { + return ApiWirelessWirelessLansBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []WirelessLAN +func (a *WirelessAPIService) WirelessWirelessLansBulkPartialUpdateExecute(r ApiWirelessWirelessLansBulkPartialUpdateRequest) ([]WirelessLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []WirelessLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLANRequest == nil { + return localVarReturnValue, nil, reportError("wirelessLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansBulkUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLANRequest *[]WirelessLANRequest +} + +func (r ApiWirelessWirelessLansBulkUpdateRequest) WirelessLANRequest(wirelessLANRequest []WirelessLANRequest) ApiWirelessWirelessLansBulkUpdateRequest { + r.wirelessLANRequest = &wirelessLANRequest + return r +} + +func (r ApiWirelessWirelessLansBulkUpdateRequest) Execute() ([]WirelessLAN, *http.Response, error) { + return r.ApiService.WirelessWirelessLansBulkUpdateExecute(r) +} + +/* +WirelessWirelessLansBulkUpdate Method for WirelessWirelessLansBulkUpdate + +Put a list of wireless LAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLansBulkUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansBulkUpdate(ctx context.Context) ApiWirelessWirelessLansBulkUpdateRequest { + return ApiWirelessWirelessLansBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []WirelessLAN +func (a *WirelessAPIService) WirelessWirelessLansBulkUpdateExecute(r ApiWirelessWirelessLansBulkUpdateRequest) ([]WirelessLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []WirelessLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLANRequest == nil { + return localVarReturnValue, nil, reportError("wirelessLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansCreateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + writableWirelessLANRequest *WritableWirelessLANRequest +} + +func (r ApiWirelessWirelessLansCreateRequest) WritableWirelessLANRequest(writableWirelessLANRequest WritableWirelessLANRequest) ApiWirelessWirelessLansCreateRequest { + r.writableWirelessLANRequest = &writableWirelessLANRequest + return r +} + +func (r ApiWirelessWirelessLansCreateRequest) Execute() (*WirelessLAN, *http.Response, error) { + return r.ApiService.WirelessWirelessLansCreateExecute(r) +} + +/* +WirelessWirelessLansCreate Method for WirelessWirelessLansCreate + +Post a list of wireless LAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLansCreateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansCreate(ctx context.Context) ApiWirelessWirelessLansCreateRequest { + return ApiWirelessWirelessLansCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return WirelessLAN +func (a *WirelessAPIService) WirelessWirelessLansCreateExecute(r ApiWirelessWirelessLansCreateRequest) (*WirelessLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableWirelessLANRequest == nil { + return localVarReturnValue, nil, reportError("writableWirelessLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableWirelessLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansDestroyRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 +} + +func (r ApiWirelessWirelessLansDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.WirelessWirelessLansDestroyExecute(r) +} + +/* +WirelessWirelessLansDestroy Method for WirelessWirelessLansDestroy + +Delete a wireless LAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN. + @return ApiWirelessWirelessLansDestroyRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansDestroy(ctx context.Context, id int32) ApiWirelessWirelessLansDestroyRequest { + return ApiWirelessWirelessLansDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *WirelessAPIService) WirelessWirelessLansDestroyExecute(r ApiWirelessWirelessLansDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansListRequest struct { + ctx context.Context + ApiService *WirelessAPIService + authCipher *[]string + authCipherN *[]string + authPsk *[]string + authPskEmpty *bool + authPskIc *[]string + authPskIe *[]string + authPskIew *[]string + authPskIsw *[]string + authPskN *[]string + authPskNic *[]string + authPskNie *[]string + authPskNiew *[]string + authPskNisw *[]string + authType *[]string + authTypeN *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + group *[]int32 + groupN *[]int32 + groupId *[]int32 + groupIdN *[]int32 + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + q *string + ssid *[]string + ssidEmpty *bool + ssidIc *[]string + ssidIe *[]string + ssidIew *[]string + ssidIsw *[]string + ssidN *[]string + ssidNic *[]string + ssidNie *[]string + ssidNiew *[]string + ssidNisw *[]string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string + vlanId *[]*int32 + vlanIdN *[]*int32 +} + +func (r ApiWirelessWirelessLansListRequest) AuthCipher(authCipher []string) ApiWirelessWirelessLansListRequest { + r.authCipher = &authCipher + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthCipherN(authCipherN []string) ApiWirelessWirelessLansListRequest { + r.authCipherN = &authCipherN + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPsk(authPsk []string) ApiWirelessWirelessLansListRequest { + r.authPsk = &authPsk + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskEmpty(authPskEmpty bool) ApiWirelessWirelessLansListRequest { + r.authPskEmpty = &authPskEmpty + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskIc(authPskIc []string) ApiWirelessWirelessLansListRequest { + r.authPskIc = &authPskIc + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskIe(authPskIe []string) ApiWirelessWirelessLansListRequest { + r.authPskIe = &authPskIe + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskIew(authPskIew []string) ApiWirelessWirelessLansListRequest { + r.authPskIew = &authPskIew + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskIsw(authPskIsw []string) ApiWirelessWirelessLansListRequest { + r.authPskIsw = &authPskIsw + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskN(authPskN []string) ApiWirelessWirelessLansListRequest { + r.authPskN = &authPskN + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskNic(authPskNic []string) ApiWirelessWirelessLansListRequest { + r.authPskNic = &authPskNic + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskNie(authPskNie []string) ApiWirelessWirelessLansListRequest { + r.authPskNie = &authPskNie + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskNiew(authPskNiew []string) ApiWirelessWirelessLansListRequest { + r.authPskNiew = &authPskNiew + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthPskNisw(authPskNisw []string) ApiWirelessWirelessLansListRequest { + r.authPskNisw = &authPskNisw + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthType(authType []string) ApiWirelessWirelessLansListRequest { + r.authType = &authType + return r +} + +func (r ApiWirelessWirelessLansListRequest) AuthTypeN(authTypeN []string) ApiWirelessWirelessLansListRequest { + r.authTypeN = &authTypeN + return r +} + +func (r ApiWirelessWirelessLansListRequest) Created(created []time.Time) ApiWirelessWirelessLansListRequest { + r.created = &created + return r +} + +func (r ApiWirelessWirelessLansListRequest) CreatedEmpty(createdEmpty []time.Time) ApiWirelessWirelessLansListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiWirelessWirelessLansListRequest) CreatedGt(createdGt []time.Time) ApiWirelessWirelessLansListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiWirelessWirelessLansListRequest) CreatedGte(createdGte []time.Time) ApiWirelessWirelessLansListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiWirelessWirelessLansListRequest) CreatedLt(createdLt []time.Time) ApiWirelessWirelessLansListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiWirelessWirelessLansListRequest) CreatedLte(createdLte []time.Time) ApiWirelessWirelessLansListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiWirelessWirelessLansListRequest) CreatedN(createdN []time.Time) ApiWirelessWirelessLansListRequest { + r.createdN = &createdN + return r +} + +func (r ApiWirelessWirelessLansListRequest) CreatedByRequest(createdByRequest string) ApiWirelessWirelessLansListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiWirelessWirelessLansListRequest) Description(description []string) ApiWirelessWirelessLansListRequest { + r.description = &description + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionEmpty(descriptionEmpty bool) ApiWirelessWirelessLansListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionIc(descriptionIc []string) ApiWirelessWirelessLansListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionIe(descriptionIe []string) ApiWirelessWirelessLansListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionIew(descriptionIew []string) ApiWirelessWirelessLansListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionIsw(descriptionIsw []string) ApiWirelessWirelessLansListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionN(descriptionN []string) ApiWirelessWirelessLansListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionNic(descriptionNic []string) ApiWirelessWirelessLansListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionNie(descriptionNie []string) ApiWirelessWirelessLansListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionNiew(descriptionNiew []string) ApiWirelessWirelessLansListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiWirelessWirelessLansListRequest) DescriptionNisw(descriptionNisw []string) ApiWirelessWirelessLansListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiWirelessWirelessLansListRequest) Group(group []int32) ApiWirelessWirelessLansListRequest { + r.group = &group + return r +} + +func (r ApiWirelessWirelessLansListRequest) GroupN(groupN []int32) ApiWirelessWirelessLansListRequest { + r.groupN = &groupN + return r +} + +func (r ApiWirelessWirelessLansListRequest) GroupId(groupId []int32) ApiWirelessWirelessLansListRequest { + r.groupId = &groupId + return r +} + +func (r ApiWirelessWirelessLansListRequest) GroupIdN(groupIdN []int32) ApiWirelessWirelessLansListRequest { + r.groupIdN = &groupIdN + return r +} + +func (r ApiWirelessWirelessLansListRequest) Id(id []int32) ApiWirelessWirelessLansListRequest { + r.id = &id + return r +} + +func (r ApiWirelessWirelessLansListRequest) IdEmpty(idEmpty bool) ApiWirelessWirelessLansListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiWirelessWirelessLansListRequest) IdGt(idGt []int32) ApiWirelessWirelessLansListRequest { + r.idGt = &idGt + return r +} + +func (r ApiWirelessWirelessLansListRequest) IdGte(idGte []int32) ApiWirelessWirelessLansListRequest { + r.idGte = &idGte + return r +} + +func (r ApiWirelessWirelessLansListRequest) IdLt(idLt []int32) ApiWirelessWirelessLansListRequest { + r.idLt = &idLt + return r +} + +func (r ApiWirelessWirelessLansListRequest) IdLte(idLte []int32) ApiWirelessWirelessLansListRequest { + r.idLte = &idLte + return r +} + +func (r ApiWirelessWirelessLansListRequest) IdN(idN []int32) ApiWirelessWirelessLansListRequest { + r.idN = &idN + return r +} + +func (r ApiWirelessWirelessLansListRequest) LastUpdated(lastUpdated []time.Time) ApiWirelessWirelessLansListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiWirelessWirelessLansListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiWirelessWirelessLansListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiWirelessWirelessLansListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiWirelessWirelessLansListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiWirelessWirelessLansListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiWirelessWirelessLansListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiWirelessWirelessLansListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiWirelessWirelessLansListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiWirelessWirelessLansListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiWirelessWirelessLansListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiWirelessWirelessLansListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiWirelessWirelessLansListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiWirelessWirelessLansListRequest) Limit(limit int32) ApiWirelessWirelessLansListRequest { + r.limit = &limit + return r +} + +func (r ApiWirelessWirelessLansListRequest) ModifiedByRequest(modifiedByRequest string) ApiWirelessWirelessLansListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiWirelessWirelessLansListRequest) Offset(offset int32) ApiWirelessWirelessLansListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiWirelessWirelessLansListRequest) Ordering(ordering string) ApiWirelessWirelessLansListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiWirelessWirelessLansListRequest) Q(q string) ApiWirelessWirelessLansListRequest { + r.q = &q + return r +} + +func (r ApiWirelessWirelessLansListRequest) Ssid(ssid []string) ApiWirelessWirelessLansListRequest { + r.ssid = &ssid + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidEmpty(ssidEmpty bool) ApiWirelessWirelessLansListRequest { + r.ssidEmpty = &ssidEmpty + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidIc(ssidIc []string) ApiWirelessWirelessLansListRequest { + r.ssidIc = &ssidIc + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidIe(ssidIe []string) ApiWirelessWirelessLansListRequest { + r.ssidIe = &ssidIe + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidIew(ssidIew []string) ApiWirelessWirelessLansListRequest { + r.ssidIew = &ssidIew + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidIsw(ssidIsw []string) ApiWirelessWirelessLansListRequest { + r.ssidIsw = &ssidIsw + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidN(ssidN []string) ApiWirelessWirelessLansListRequest { + r.ssidN = &ssidN + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidNic(ssidNic []string) ApiWirelessWirelessLansListRequest { + r.ssidNic = &ssidNic + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidNie(ssidNie []string) ApiWirelessWirelessLansListRequest { + r.ssidNie = &ssidNie + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidNiew(ssidNiew []string) ApiWirelessWirelessLansListRequest { + r.ssidNiew = &ssidNiew + return r +} + +func (r ApiWirelessWirelessLansListRequest) SsidNisw(ssidNisw []string) ApiWirelessWirelessLansListRequest { + r.ssidNisw = &ssidNisw + return r +} + +func (r ApiWirelessWirelessLansListRequest) Status(status []string) ApiWirelessWirelessLansListRequest { + r.status = &status + return r +} + +func (r ApiWirelessWirelessLansListRequest) StatusN(statusN []string) ApiWirelessWirelessLansListRequest { + r.statusN = &statusN + return r +} + +func (r ApiWirelessWirelessLansListRequest) Tag(tag []string) ApiWirelessWirelessLansListRequest { + r.tag = &tag + return r +} + +func (r ApiWirelessWirelessLansListRequest) TagN(tagN []string) ApiWirelessWirelessLansListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiWirelessWirelessLansListRequest) Tenant(tenant []string) ApiWirelessWirelessLansListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiWirelessWirelessLansListRequest) TenantN(tenantN []string) ApiWirelessWirelessLansListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiWirelessWirelessLansListRequest) TenantGroup(tenantGroup []int32) ApiWirelessWirelessLansListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiWirelessWirelessLansListRequest) TenantGroupN(tenantGroupN []int32) ApiWirelessWirelessLansListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiWirelessWirelessLansListRequest) TenantGroupId(tenantGroupId []int32) ApiWirelessWirelessLansListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiWirelessWirelessLansListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiWirelessWirelessLansListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiWirelessWirelessLansListRequest) TenantId(tenantId []*int32) ApiWirelessWirelessLansListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiWirelessWirelessLansListRequest) TenantIdN(tenantIdN []*int32) ApiWirelessWirelessLansListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiWirelessWirelessLansListRequest) UpdatedByRequest(updatedByRequest string) ApiWirelessWirelessLansListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiWirelessWirelessLansListRequest) VlanId(vlanId []*int32) ApiWirelessWirelessLansListRequest { + r.vlanId = &vlanId + return r +} + +func (r ApiWirelessWirelessLansListRequest) VlanIdN(vlanIdN []*int32) ApiWirelessWirelessLansListRequest { + r.vlanIdN = &vlanIdN + return r +} + +func (r ApiWirelessWirelessLansListRequest) Execute() (*PaginatedWirelessLANList, *http.Response, error) { + return r.ApiService.WirelessWirelessLansListExecute(r) +} + +/* +WirelessWirelessLansList Method for WirelessWirelessLansList + +Get a list of wireless LAN objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLansListRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansList(ctx context.Context) ApiWirelessWirelessLansListRequest { + return ApiWirelessWirelessLansListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWirelessLANList +func (a *WirelessAPIService) WirelessWirelessLansListExecute(r ApiWirelessWirelessLansListRequest) (*PaginatedWirelessLANList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWirelessLANList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.authCipher != nil { + t := *r.authCipher + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher", t, "multi") + } + } + if r.authCipherN != nil { + t := *r.authCipherN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher__n", t, "multi") + } + } + if r.authPsk != nil { + t := *r.authPsk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk", t, "multi") + } + } + if r.authPskEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__empty", r.authPskEmpty, "") + } + if r.authPskIc != nil { + t := *r.authPskIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ic", t, "multi") + } + } + if r.authPskIe != nil { + t := *r.authPskIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ie", t, "multi") + } + } + if r.authPskIew != nil { + t := *r.authPskIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__iew", t, "multi") + } + } + if r.authPskIsw != nil { + t := *r.authPskIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__isw", t, "multi") + } + } + if r.authPskN != nil { + t := *r.authPskN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__n", t, "multi") + } + } + if r.authPskNic != nil { + t := *r.authPskNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nic", t, "multi") + } + } + if r.authPskNie != nil { + t := *r.authPskNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nie", t, "multi") + } + } + if r.authPskNiew != nil { + t := *r.authPskNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__niew", t, "multi") + } + } + if r.authPskNisw != nil { + t := *r.authPskNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nisw", t, "multi") + } + } + if r.authType != nil { + t := *r.authType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type", t, "multi") + } + } + if r.authTypeN != nil { + t := *r.authTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.group != nil { + t := *r.group + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", t, "multi") + } + } + if r.groupN != nil { + t := *r.groupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__n", t, "multi") + } + } + if r.groupId != nil { + t := *r.groupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id", t, "multi") + } + } + if r.groupIdN != nil { + t := *r.groupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_id__n", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.ssid != nil { + t := *r.ssid + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid", t, "multi") + } + } + if r.ssidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__empty", r.ssidEmpty, "") + } + if r.ssidIc != nil { + t := *r.ssidIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ic", t, "multi") + } + } + if r.ssidIe != nil { + t := *r.ssidIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ie", t, "multi") + } + } + if r.ssidIew != nil { + t := *r.ssidIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__iew", t, "multi") + } + } + if r.ssidIsw != nil { + t := *r.ssidIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__isw", t, "multi") + } + } + if r.ssidN != nil { + t := *r.ssidN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__n", t, "multi") + } + } + if r.ssidNic != nil { + t := *r.ssidNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nic", t, "multi") + } + } + if r.ssidNie != nil { + t := *r.ssidNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nie", t, "multi") + } + } + if r.ssidNiew != nil { + t := *r.ssidNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__niew", t, "multi") + } + } + if r.ssidNisw != nil { + t := *r.ssidNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nisw", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + if r.vlanId != nil { + t := *r.vlanId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id", t, "multi") + } + } + if r.vlanIdN != nil { + t := *r.vlanIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "vlan_id__n", t, "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansPartialUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 + patchedWritableWirelessLANRequest *PatchedWritableWirelessLANRequest +} + +func (r ApiWirelessWirelessLansPartialUpdateRequest) PatchedWritableWirelessLANRequest(patchedWritableWirelessLANRequest PatchedWritableWirelessLANRequest) ApiWirelessWirelessLansPartialUpdateRequest { + r.patchedWritableWirelessLANRequest = &patchedWritableWirelessLANRequest + return r +} + +func (r ApiWirelessWirelessLansPartialUpdateRequest) Execute() (*WirelessLAN, *http.Response, error) { + return r.ApiService.WirelessWirelessLansPartialUpdateExecute(r) +} + +/* +WirelessWirelessLansPartialUpdate Method for WirelessWirelessLansPartialUpdate + +Patch a wireless LAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN. + @return ApiWirelessWirelessLansPartialUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansPartialUpdate(ctx context.Context, id int32) ApiWirelessWirelessLansPartialUpdateRequest { + return ApiWirelessWirelessLansPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLAN +func (a *WirelessAPIService) WirelessWirelessLansPartialUpdateExecute(r ApiWirelessWirelessLansPartialUpdateRequest) (*WirelessLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableWirelessLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansRetrieveRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 +} + +func (r ApiWirelessWirelessLansRetrieveRequest) Execute() (*WirelessLAN, *http.Response, error) { + return r.ApiService.WirelessWirelessLansRetrieveExecute(r) +} + +/* +WirelessWirelessLansRetrieve Method for WirelessWirelessLansRetrieve + +Get a wireless LAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN. + @return ApiWirelessWirelessLansRetrieveRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansRetrieve(ctx context.Context, id int32) ApiWirelessWirelessLansRetrieveRequest { + return ApiWirelessWirelessLansRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLAN +func (a *WirelessAPIService) WirelessWirelessLansRetrieveExecute(r ApiWirelessWirelessLansRetrieveRequest) (*WirelessLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLansUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 + writableWirelessLANRequest *WritableWirelessLANRequest +} + +func (r ApiWirelessWirelessLansUpdateRequest) WritableWirelessLANRequest(writableWirelessLANRequest WritableWirelessLANRequest) ApiWirelessWirelessLansUpdateRequest { + r.writableWirelessLANRequest = &writableWirelessLANRequest + return r +} + +func (r ApiWirelessWirelessLansUpdateRequest) Execute() (*WirelessLAN, *http.Response, error) { + return r.ApiService.WirelessWirelessLansUpdateExecute(r) +} + +/* +WirelessWirelessLansUpdate Method for WirelessWirelessLansUpdate + +Put a wireless LAN object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless LAN. + @return ApiWirelessWirelessLansUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLansUpdate(ctx context.Context, id int32) ApiWirelessWirelessLansUpdateRequest { + return ApiWirelessWirelessLansUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLAN +func (a *WirelessAPIService) WirelessWirelessLansUpdateExecute(r ApiWirelessWirelessLansUpdateRequest) (*WirelessLAN, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLAN + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLansUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-lans/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableWirelessLANRequest == nil { + return localVarReturnValue, nil, reportError("writableWirelessLANRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableWirelessLANRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksBulkDestroyRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLinkRequest *[]WirelessLinkRequest +} + +func (r ApiWirelessWirelessLinksBulkDestroyRequest) WirelessLinkRequest(wirelessLinkRequest []WirelessLinkRequest) ApiWirelessWirelessLinksBulkDestroyRequest { + r.wirelessLinkRequest = &wirelessLinkRequest + return r +} + +func (r ApiWirelessWirelessLinksBulkDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.WirelessWirelessLinksBulkDestroyExecute(r) +} + +/* +WirelessWirelessLinksBulkDestroy Method for WirelessWirelessLinksBulkDestroy + +Delete a list of wireless link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLinksBulkDestroyRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksBulkDestroy(ctx context.Context) ApiWirelessWirelessLinksBulkDestroyRequest { + return ApiWirelessWirelessLinksBulkDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *WirelessAPIService) WirelessWirelessLinksBulkDestroyExecute(r ApiWirelessWirelessLinksBulkDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksBulkDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLinkRequest == nil { + return nil, reportError("wirelessLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksBulkPartialUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLinkRequest *[]WirelessLinkRequest +} + +func (r ApiWirelessWirelessLinksBulkPartialUpdateRequest) WirelessLinkRequest(wirelessLinkRequest []WirelessLinkRequest) ApiWirelessWirelessLinksBulkPartialUpdateRequest { + r.wirelessLinkRequest = &wirelessLinkRequest + return r +} + +func (r ApiWirelessWirelessLinksBulkPartialUpdateRequest) Execute() ([]WirelessLink, *http.Response, error) { + return r.ApiService.WirelessWirelessLinksBulkPartialUpdateExecute(r) +} + +/* +WirelessWirelessLinksBulkPartialUpdate Method for WirelessWirelessLinksBulkPartialUpdate + +Patch a list of wireless link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLinksBulkPartialUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksBulkPartialUpdate(ctx context.Context) ApiWirelessWirelessLinksBulkPartialUpdateRequest { + return ApiWirelessWirelessLinksBulkPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []WirelessLink +func (a *WirelessAPIService) WirelessWirelessLinksBulkPartialUpdateExecute(r ApiWirelessWirelessLinksBulkPartialUpdateRequest) ([]WirelessLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []WirelessLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksBulkPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLinkRequest == nil { + return localVarReturnValue, nil, reportError("wirelessLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksBulkUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + wirelessLinkRequest *[]WirelessLinkRequest +} + +func (r ApiWirelessWirelessLinksBulkUpdateRequest) WirelessLinkRequest(wirelessLinkRequest []WirelessLinkRequest) ApiWirelessWirelessLinksBulkUpdateRequest { + r.wirelessLinkRequest = &wirelessLinkRequest + return r +} + +func (r ApiWirelessWirelessLinksBulkUpdateRequest) Execute() ([]WirelessLink, *http.Response, error) { + return r.ApiService.WirelessWirelessLinksBulkUpdateExecute(r) +} + +/* +WirelessWirelessLinksBulkUpdate Method for WirelessWirelessLinksBulkUpdate + +Put a list of wireless link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLinksBulkUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksBulkUpdate(ctx context.Context) ApiWirelessWirelessLinksBulkUpdateRequest { + return ApiWirelessWirelessLinksBulkUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []WirelessLink +func (a *WirelessAPIService) WirelessWirelessLinksBulkUpdateExecute(r ApiWirelessWirelessLinksBulkUpdateRequest) ([]WirelessLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []WirelessLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksBulkUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wirelessLinkRequest == nil { + return localVarReturnValue, nil, reportError("wirelessLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wirelessLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksCreateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + writableWirelessLinkRequest *WritableWirelessLinkRequest +} + +func (r ApiWirelessWirelessLinksCreateRequest) WritableWirelessLinkRequest(writableWirelessLinkRequest WritableWirelessLinkRequest) ApiWirelessWirelessLinksCreateRequest { + r.writableWirelessLinkRequest = &writableWirelessLinkRequest + return r +} + +func (r ApiWirelessWirelessLinksCreateRequest) Execute() (*WirelessLink, *http.Response, error) { + return r.ApiService.WirelessWirelessLinksCreateExecute(r) +} + +/* +WirelessWirelessLinksCreate Method for WirelessWirelessLinksCreate + +Post a list of wireless link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLinksCreateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksCreate(ctx context.Context) ApiWirelessWirelessLinksCreateRequest { + return ApiWirelessWirelessLinksCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return WirelessLink +func (a *WirelessAPIService) WirelessWirelessLinksCreateExecute(r ApiWirelessWirelessLinksCreateRequest) (*WirelessLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableWirelessLinkRequest == nil { + return localVarReturnValue, nil, reportError("writableWirelessLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableWirelessLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksDestroyRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 +} + +func (r ApiWirelessWirelessLinksDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.WirelessWirelessLinksDestroyExecute(r) +} + +/* +WirelessWirelessLinksDestroy Method for WirelessWirelessLinksDestroy + +Delete a wireless link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless link. + @return ApiWirelessWirelessLinksDestroyRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksDestroy(ctx context.Context, id int32) ApiWirelessWirelessLinksDestroyRequest { + return ApiWirelessWirelessLinksDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *WirelessAPIService) WirelessWirelessLinksDestroyExecute(r ApiWirelessWirelessLinksDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksListRequest struct { + ctx context.Context + ApiService *WirelessAPIService + authCipher *[]string + authCipherN *[]string + authPsk *[]string + authPskEmpty *bool + authPskIc *[]string + authPskIe *[]string + authPskIew *[]string + authPskIsw *[]string + authPskN *[]string + authPskNic *[]string + authPskNie *[]string + authPskNiew *[]string + authPskNisw *[]string + authType *[]string + authTypeN *[]string + created *[]time.Time + createdEmpty *[]time.Time + createdGt *[]time.Time + createdGte *[]time.Time + createdLt *[]time.Time + createdLte *[]time.Time + createdN *[]time.Time + createdByRequest *string + description *[]string + descriptionEmpty *bool + descriptionIc *[]string + descriptionIe *[]string + descriptionIew *[]string + descriptionIsw *[]string + descriptionN *[]string + descriptionNic *[]string + descriptionNie *[]string + descriptionNiew *[]string + descriptionNisw *[]string + id *[]int32 + idEmpty *bool + idGt *[]int32 + idGte *[]int32 + idLt *[]int32 + idLte *[]int32 + idN *[]int32 + interfaceAId *[]int32 + interfaceAIdEmpty *[]int32 + interfaceAIdGt *[]int32 + interfaceAIdGte *[]int32 + interfaceAIdLt *[]int32 + interfaceAIdLte *[]int32 + interfaceAIdN *[]int32 + interfaceBId *[]int32 + interfaceBIdEmpty *[]int32 + interfaceBIdGt *[]int32 + interfaceBIdGte *[]int32 + interfaceBIdLt *[]int32 + interfaceBIdLte *[]int32 + interfaceBIdN *[]int32 + lastUpdated *[]time.Time + lastUpdatedEmpty *[]time.Time + lastUpdatedGt *[]time.Time + lastUpdatedGte *[]time.Time + lastUpdatedLt *[]time.Time + lastUpdatedLte *[]time.Time + lastUpdatedN *[]time.Time + limit *int32 + modifiedByRequest *string + offset *int32 + ordering *string + q *string + ssid *[]string + ssidEmpty *bool + ssidIc *[]string + ssidIe *[]string + ssidIew *[]string + ssidIsw *[]string + ssidN *[]string + ssidNic *[]string + ssidNie *[]string + ssidNiew *[]string + ssidNisw *[]string + status *[]string + statusN *[]string + tag *[]string + tagN *[]string + tenant *[]string + tenantN *[]string + tenantGroup *[]int32 + tenantGroupN *[]int32 + tenantGroupId *[]int32 + tenantGroupIdN *[]int32 + tenantId *[]*int32 + tenantIdN *[]*int32 + updatedByRequest *string +} + +func (r ApiWirelessWirelessLinksListRequest) AuthCipher(authCipher []string) ApiWirelessWirelessLinksListRequest { + r.authCipher = &authCipher + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthCipherN(authCipherN []string) ApiWirelessWirelessLinksListRequest { + r.authCipherN = &authCipherN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPsk(authPsk []string) ApiWirelessWirelessLinksListRequest { + r.authPsk = &authPsk + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskEmpty(authPskEmpty bool) ApiWirelessWirelessLinksListRequest { + r.authPskEmpty = &authPskEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskIc(authPskIc []string) ApiWirelessWirelessLinksListRequest { + r.authPskIc = &authPskIc + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskIe(authPskIe []string) ApiWirelessWirelessLinksListRequest { + r.authPskIe = &authPskIe + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskIew(authPskIew []string) ApiWirelessWirelessLinksListRequest { + r.authPskIew = &authPskIew + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskIsw(authPskIsw []string) ApiWirelessWirelessLinksListRequest { + r.authPskIsw = &authPskIsw + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskN(authPskN []string) ApiWirelessWirelessLinksListRequest { + r.authPskN = &authPskN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskNic(authPskNic []string) ApiWirelessWirelessLinksListRequest { + r.authPskNic = &authPskNic + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskNie(authPskNie []string) ApiWirelessWirelessLinksListRequest { + r.authPskNie = &authPskNie + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskNiew(authPskNiew []string) ApiWirelessWirelessLinksListRequest { + r.authPskNiew = &authPskNiew + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthPskNisw(authPskNisw []string) ApiWirelessWirelessLinksListRequest { + r.authPskNisw = &authPskNisw + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthType(authType []string) ApiWirelessWirelessLinksListRequest { + r.authType = &authType + return r +} + +func (r ApiWirelessWirelessLinksListRequest) AuthTypeN(authTypeN []string) ApiWirelessWirelessLinksListRequest { + r.authTypeN = &authTypeN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) Created(created []time.Time) ApiWirelessWirelessLinksListRequest { + r.created = &created + return r +} + +func (r ApiWirelessWirelessLinksListRequest) CreatedEmpty(createdEmpty []time.Time) ApiWirelessWirelessLinksListRequest { + r.createdEmpty = &createdEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) CreatedGt(createdGt []time.Time) ApiWirelessWirelessLinksListRequest { + r.createdGt = &createdGt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) CreatedGte(createdGte []time.Time) ApiWirelessWirelessLinksListRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) CreatedLt(createdLt []time.Time) ApiWirelessWirelessLinksListRequest { + r.createdLt = &createdLt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) CreatedLte(createdLte []time.Time) ApiWirelessWirelessLinksListRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) CreatedN(createdN []time.Time) ApiWirelessWirelessLinksListRequest { + r.createdN = &createdN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) CreatedByRequest(createdByRequest string) ApiWirelessWirelessLinksListRequest { + r.createdByRequest = &createdByRequest + return r +} + +func (r ApiWirelessWirelessLinksListRequest) Description(description []string) ApiWirelessWirelessLinksListRequest { + r.description = &description + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionEmpty(descriptionEmpty bool) ApiWirelessWirelessLinksListRequest { + r.descriptionEmpty = &descriptionEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionIc(descriptionIc []string) ApiWirelessWirelessLinksListRequest { + r.descriptionIc = &descriptionIc + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionIe(descriptionIe []string) ApiWirelessWirelessLinksListRequest { + r.descriptionIe = &descriptionIe + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionIew(descriptionIew []string) ApiWirelessWirelessLinksListRequest { + r.descriptionIew = &descriptionIew + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionIsw(descriptionIsw []string) ApiWirelessWirelessLinksListRequest { + r.descriptionIsw = &descriptionIsw + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionN(descriptionN []string) ApiWirelessWirelessLinksListRequest { + r.descriptionN = &descriptionN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionNic(descriptionNic []string) ApiWirelessWirelessLinksListRequest { + r.descriptionNic = &descriptionNic + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionNie(descriptionNie []string) ApiWirelessWirelessLinksListRequest { + r.descriptionNie = &descriptionNie + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionNiew(descriptionNiew []string) ApiWirelessWirelessLinksListRequest { + r.descriptionNiew = &descriptionNiew + return r +} + +func (r ApiWirelessWirelessLinksListRequest) DescriptionNisw(descriptionNisw []string) ApiWirelessWirelessLinksListRequest { + r.descriptionNisw = &descriptionNisw + return r +} + +func (r ApiWirelessWirelessLinksListRequest) Id(id []int32) ApiWirelessWirelessLinksListRequest { + r.id = &id + return r +} + +func (r ApiWirelessWirelessLinksListRequest) IdEmpty(idEmpty bool) ApiWirelessWirelessLinksListRequest { + r.idEmpty = &idEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) IdGt(idGt []int32) ApiWirelessWirelessLinksListRequest { + r.idGt = &idGt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) IdGte(idGte []int32) ApiWirelessWirelessLinksListRequest { + r.idGte = &idGte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) IdLt(idLt []int32) ApiWirelessWirelessLinksListRequest { + r.idLt = &idLt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) IdLte(idLte []int32) ApiWirelessWirelessLinksListRequest { + r.idLte = &idLte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) IdN(idN []int32) ApiWirelessWirelessLinksListRequest { + r.idN = &idN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceAId(interfaceAId []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceAId = &interfaceAId + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceAIdEmpty(interfaceAIdEmpty []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceAIdEmpty = &interfaceAIdEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceAIdGt(interfaceAIdGt []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceAIdGt = &interfaceAIdGt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceAIdGte(interfaceAIdGte []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceAIdGte = &interfaceAIdGte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceAIdLt(interfaceAIdLt []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceAIdLt = &interfaceAIdLt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceAIdLte(interfaceAIdLte []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceAIdLte = &interfaceAIdLte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceAIdN(interfaceAIdN []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceAIdN = &interfaceAIdN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceBId(interfaceBId []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceBId = &interfaceBId + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceBIdEmpty(interfaceBIdEmpty []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceBIdEmpty = &interfaceBIdEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceBIdGt(interfaceBIdGt []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceBIdGt = &interfaceBIdGt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceBIdGte(interfaceBIdGte []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceBIdGte = &interfaceBIdGte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceBIdLt(interfaceBIdLt []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceBIdLt = &interfaceBIdLt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceBIdLte(interfaceBIdLte []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceBIdLte = &interfaceBIdLte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) InterfaceBIdN(interfaceBIdN []int32) ApiWirelessWirelessLinksListRequest { + r.interfaceBIdN = &interfaceBIdN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) LastUpdated(lastUpdated []time.Time) ApiWirelessWirelessLinksListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiWirelessWirelessLinksListRequest) LastUpdatedEmpty(lastUpdatedEmpty []time.Time) ApiWirelessWirelessLinksListRequest { + r.lastUpdatedEmpty = &lastUpdatedEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) LastUpdatedGt(lastUpdatedGt []time.Time) ApiWirelessWirelessLinksListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) LastUpdatedGte(lastUpdatedGte []time.Time) ApiWirelessWirelessLinksListRequest { + r.lastUpdatedGte = &lastUpdatedGte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) LastUpdatedLt(lastUpdatedLt []time.Time) ApiWirelessWirelessLinksListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiWirelessWirelessLinksListRequest) LastUpdatedLte(lastUpdatedLte []time.Time) ApiWirelessWirelessLinksListRequest { + r.lastUpdatedLte = &lastUpdatedLte + return r +} + +func (r ApiWirelessWirelessLinksListRequest) LastUpdatedN(lastUpdatedN []time.Time) ApiWirelessWirelessLinksListRequest { + r.lastUpdatedN = &lastUpdatedN + return r +} + +// Number of results to return per page. +func (r ApiWirelessWirelessLinksListRequest) Limit(limit int32) ApiWirelessWirelessLinksListRequest { + r.limit = &limit + return r +} + +func (r ApiWirelessWirelessLinksListRequest) ModifiedByRequest(modifiedByRequest string) ApiWirelessWirelessLinksListRequest { + r.modifiedByRequest = &modifiedByRequest + return r +} + +// The initial index from which to return the results. +func (r ApiWirelessWirelessLinksListRequest) Offset(offset int32) ApiWirelessWirelessLinksListRequest { + r.offset = &offset + return r +} + +// Which field to use when ordering the results. +func (r ApiWirelessWirelessLinksListRequest) Ordering(ordering string) ApiWirelessWirelessLinksListRequest { + r.ordering = &ordering + return r +} + +// Search +func (r ApiWirelessWirelessLinksListRequest) Q(q string) ApiWirelessWirelessLinksListRequest { + r.q = &q + return r +} + +func (r ApiWirelessWirelessLinksListRequest) Ssid(ssid []string) ApiWirelessWirelessLinksListRequest { + r.ssid = &ssid + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidEmpty(ssidEmpty bool) ApiWirelessWirelessLinksListRequest { + r.ssidEmpty = &ssidEmpty + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidIc(ssidIc []string) ApiWirelessWirelessLinksListRequest { + r.ssidIc = &ssidIc + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidIe(ssidIe []string) ApiWirelessWirelessLinksListRequest { + r.ssidIe = &ssidIe + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidIew(ssidIew []string) ApiWirelessWirelessLinksListRequest { + r.ssidIew = &ssidIew + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidIsw(ssidIsw []string) ApiWirelessWirelessLinksListRequest { + r.ssidIsw = &ssidIsw + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidN(ssidN []string) ApiWirelessWirelessLinksListRequest { + r.ssidN = &ssidN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidNic(ssidNic []string) ApiWirelessWirelessLinksListRequest { + r.ssidNic = &ssidNic + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidNie(ssidNie []string) ApiWirelessWirelessLinksListRequest { + r.ssidNie = &ssidNie + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidNiew(ssidNiew []string) ApiWirelessWirelessLinksListRequest { + r.ssidNiew = &ssidNiew + return r +} + +func (r ApiWirelessWirelessLinksListRequest) SsidNisw(ssidNisw []string) ApiWirelessWirelessLinksListRequest { + r.ssidNisw = &ssidNisw + return r +} + +func (r ApiWirelessWirelessLinksListRequest) Status(status []string) ApiWirelessWirelessLinksListRequest { + r.status = &status + return r +} + +func (r ApiWirelessWirelessLinksListRequest) StatusN(statusN []string) ApiWirelessWirelessLinksListRequest { + r.statusN = &statusN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) Tag(tag []string) ApiWirelessWirelessLinksListRequest { + r.tag = &tag + return r +} + +func (r ApiWirelessWirelessLinksListRequest) TagN(tagN []string) ApiWirelessWirelessLinksListRequest { + r.tagN = &tagN + return r +} + +// Tenant (slug) +func (r ApiWirelessWirelessLinksListRequest) Tenant(tenant []string) ApiWirelessWirelessLinksListRequest { + r.tenant = &tenant + return r +} + +// Tenant (slug) +func (r ApiWirelessWirelessLinksListRequest) TenantN(tenantN []string) ApiWirelessWirelessLinksListRequest { + r.tenantN = &tenantN + return r +} + +// Tenant Group (slug) +func (r ApiWirelessWirelessLinksListRequest) TenantGroup(tenantGroup []int32) ApiWirelessWirelessLinksListRequest { + r.tenantGroup = &tenantGroup + return r +} + +// Tenant Group (slug) +func (r ApiWirelessWirelessLinksListRequest) TenantGroupN(tenantGroupN []int32) ApiWirelessWirelessLinksListRequest { + r.tenantGroupN = &tenantGroupN + return r +} + +// Tenant Group (ID) +func (r ApiWirelessWirelessLinksListRequest) TenantGroupId(tenantGroupId []int32) ApiWirelessWirelessLinksListRequest { + r.tenantGroupId = &tenantGroupId + return r +} + +// Tenant Group (ID) +func (r ApiWirelessWirelessLinksListRequest) TenantGroupIdN(tenantGroupIdN []int32) ApiWirelessWirelessLinksListRequest { + r.tenantGroupIdN = &tenantGroupIdN + return r +} + +// Tenant (ID) +func (r ApiWirelessWirelessLinksListRequest) TenantId(tenantId []*int32) ApiWirelessWirelessLinksListRequest { + r.tenantId = &tenantId + return r +} + +// Tenant (ID) +func (r ApiWirelessWirelessLinksListRequest) TenantIdN(tenantIdN []*int32) ApiWirelessWirelessLinksListRequest { + r.tenantIdN = &tenantIdN + return r +} + +func (r ApiWirelessWirelessLinksListRequest) UpdatedByRequest(updatedByRequest string) ApiWirelessWirelessLinksListRequest { + r.updatedByRequest = &updatedByRequest + return r +} + +func (r ApiWirelessWirelessLinksListRequest) Execute() (*PaginatedWirelessLinkList, *http.Response, error) { + return r.ApiService.WirelessWirelessLinksListExecute(r) +} + +/* +WirelessWirelessLinksList Method for WirelessWirelessLinksList + +Get a list of wireless link objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWirelessWirelessLinksListRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksList(ctx context.Context) ApiWirelessWirelessLinksListRequest { + return ApiWirelessWirelessLinksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWirelessLinkList +func (a *WirelessAPIService) WirelessWirelessLinksListExecute(r ApiWirelessWirelessLinksListRequest) (*PaginatedWirelessLinkList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWirelessLinkList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.authCipher != nil { + t := *r.authCipher + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher", t, "multi") + } + } + if r.authCipherN != nil { + t := *r.authCipherN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_cipher__n", t, "multi") + } + } + if r.authPsk != nil { + t := *r.authPsk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk", t, "multi") + } + } + if r.authPskEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__empty", r.authPskEmpty, "") + } + if r.authPskIc != nil { + t := *r.authPskIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ic", t, "multi") + } + } + if r.authPskIe != nil { + t := *r.authPskIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__ie", t, "multi") + } + } + if r.authPskIew != nil { + t := *r.authPskIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__iew", t, "multi") + } + } + if r.authPskIsw != nil { + t := *r.authPskIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__isw", t, "multi") + } + } + if r.authPskN != nil { + t := *r.authPskN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__n", t, "multi") + } + } + if r.authPskNic != nil { + t := *r.authPskNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nic", t, "multi") + } + } + if r.authPskNie != nil { + t := *r.authPskNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nie", t, "multi") + } + } + if r.authPskNiew != nil { + t := *r.authPskNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__niew", t, "multi") + } + } + if r.authPskNisw != nil { + t := *r.authPskNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_psk__nisw", t, "multi") + } + } + if r.authType != nil { + t := *r.authType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type", t, "multi") + } + } + if r.authTypeN != nil { + t := *r.authTypeN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type__n", t, "multi") + } + } + if r.created != nil { + t := *r.created + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", t, "multi") + } + } + if r.createdEmpty != nil { + t := *r.createdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__empty", t, "multi") + } + } + if r.createdGt != nil { + t := *r.createdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gt", t, "multi") + } + } + if r.createdGte != nil { + t := *r.createdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__gte", t, "multi") + } + } + if r.createdLt != nil { + t := *r.createdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lt", t, "multi") + } + } + if r.createdLte != nil { + t := *r.createdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__lte", t, "multi") + } + } + if r.createdN != nil { + t := *r.createdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "created__n", t, "multi") + } + } + if r.createdByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by_request", r.createdByRequest, "") + } + if r.description != nil { + t := *r.description + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", t, "multi") + } + } + if r.descriptionEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__empty", r.descriptionEmpty, "") + } + if r.descriptionIc != nil { + t := *r.descriptionIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ic", t, "multi") + } + } + if r.descriptionIe != nil { + t := *r.descriptionIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__ie", t, "multi") + } + } + if r.descriptionIew != nil { + t := *r.descriptionIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__iew", t, "multi") + } + } + if r.descriptionIsw != nil { + t := *r.descriptionIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__isw", t, "multi") + } + } + if r.descriptionN != nil { + t := *r.descriptionN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__n", t, "multi") + } + } + if r.descriptionNic != nil { + t := *r.descriptionNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nic", t, "multi") + } + } + if r.descriptionNie != nil { + t := *r.descriptionNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nie", t, "multi") + } + } + if r.descriptionNiew != nil { + t := *r.descriptionNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__niew", t, "multi") + } + } + if r.descriptionNisw != nil { + t := *r.descriptionNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "description__nisw", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.idEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__empty", r.idEmpty, "") + } + if r.idGt != nil { + t := *r.idGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gt", t, "multi") + } + } + if r.idGte != nil { + t := *r.idGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__gte", t, "multi") + } + } + if r.idLt != nil { + t := *r.idLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lt", t, "multi") + } + } + if r.idLte != nil { + t := *r.idLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__lte", t, "multi") + } + } + if r.idN != nil { + t := *r.idN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "id__n", t, "multi") + } + } + if r.interfaceAId != nil { + t := *r.interfaceAId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id", t, "multi") + } + } + if r.interfaceAIdEmpty != nil { + t := *r.interfaceAIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__empty", t, "multi") + } + } + if r.interfaceAIdGt != nil { + t := *r.interfaceAIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__gt", t, "multi") + } + } + if r.interfaceAIdGte != nil { + t := *r.interfaceAIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__gte", t, "multi") + } + } + if r.interfaceAIdLt != nil { + t := *r.interfaceAIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__lt", t, "multi") + } + } + if r.interfaceAIdLte != nil { + t := *r.interfaceAIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__lte", t, "multi") + } + } + if r.interfaceAIdN != nil { + t := *r.interfaceAIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_a_id__n", t, "multi") + } + } + if r.interfaceBId != nil { + t := *r.interfaceBId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id", t, "multi") + } + } + if r.interfaceBIdEmpty != nil { + t := *r.interfaceBIdEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__empty", t, "multi") + } + } + if r.interfaceBIdGt != nil { + t := *r.interfaceBIdGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__gt", t, "multi") + } + } + if r.interfaceBIdGte != nil { + t := *r.interfaceBIdGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__gte", t, "multi") + } + } + if r.interfaceBIdLt != nil { + t := *r.interfaceBIdLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__lt", t, "multi") + } + } + if r.interfaceBIdLte != nil { + t := *r.interfaceBIdLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__lte", t, "multi") + } + } + if r.interfaceBIdN != nil { + t := *r.interfaceBIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "interface_b_id__n", t, "multi") + } + } + if r.lastUpdated != nil { + t := *r.lastUpdated + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", t, "multi") + } + } + if r.lastUpdatedEmpty != nil { + t := *r.lastUpdatedEmpty + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__empty", t, "multi") + } + } + if r.lastUpdatedGt != nil { + t := *r.lastUpdatedGt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", t, "multi") + } + } + if r.lastUpdatedGte != nil { + t := *r.lastUpdatedGte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gte", t, "multi") + } + } + if r.lastUpdatedLt != nil { + t := *r.lastUpdatedLt + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", t, "multi") + } + } + if r.lastUpdatedLte != nil { + t := *r.lastUpdatedLte + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lte", t, "multi") + } + } + if r.lastUpdatedN != nil { + t := *r.lastUpdatedN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__n", t, "multi") + } + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.modifiedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "modified_by_request", r.modifiedByRequest, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "") + } + if r.ssid != nil { + t := *r.ssid + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid", t, "multi") + } + } + if r.ssidEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__empty", r.ssidEmpty, "") + } + if r.ssidIc != nil { + t := *r.ssidIc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ic", t, "multi") + } + } + if r.ssidIe != nil { + t := *r.ssidIe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__ie", t, "multi") + } + } + if r.ssidIew != nil { + t := *r.ssidIew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__iew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__iew", t, "multi") + } + } + if r.ssidIsw != nil { + t := *r.ssidIsw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__isw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__isw", t, "multi") + } + } + if r.ssidN != nil { + t := *r.ssidN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__n", t, "multi") + } + } + if r.ssidNic != nil { + t := *r.ssidNic + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nic", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nic", t, "multi") + } + } + if r.ssidNie != nil { + t := *r.ssidNie + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nie", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nie", t, "multi") + } + } + if r.ssidNiew != nil { + t := *r.ssidNiew + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__niew", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__niew", t, "multi") + } + } + if r.ssidNisw != nil { + t := *r.ssidNisw + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nisw", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "ssid__nisw", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.statusN != nil { + t := *r.statusN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "status__n", t, "multi") + } + } + if r.tag != nil { + t := *r.tag + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", t, "multi") + } + } + if r.tagN != nil { + t := *r.tagN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag__n", t, "multi") + } + } + if r.tenant != nil { + t := *r.tenant + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant", t, "multi") + } + } + if r.tenantN != nil { + t := *r.tenantN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant__n", t, "multi") + } + } + if r.tenantGroup != nil { + t := *r.tenantGroup + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group", t, "multi") + } + } + if r.tenantGroupN != nil { + t := *r.tenantGroupN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group__n", t, "multi") + } + } + if r.tenantGroupId != nil { + t := *r.tenantGroupId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id", t, "multi") + } + } + if r.tenantGroupIdN != nil { + t := *r.tenantGroupIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_group_id__n", t, "multi") + } + } + if r.tenantId != nil { + t := *r.tenantId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id", t, "multi") + } + } + if r.tenantIdN != nil { + t := *r.tenantIdN + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenant_id__n", t, "multi") + } + } + if r.updatedByRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_by_request", r.updatedByRequest, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksPartialUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 + patchedWritableWirelessLinkRequest *PatchedWritableWirelessLinkRequest +} + +func (r ApiWirelessWirelessLinksPartialUpdateRequest) PatchedWritableWirelessLinkRequest(patchedWritableWirelessLinkRequest PatchedWritableWirelessLinkRequest) ApiWirelessWirelessLinksPartialUpdateRequest { + r.patchedWritableWirelessLinkRequest = &patchedWritableWirelessLinkRequest + return r +} + +func (r ApiWirelessWirelessLinksPartialUpdateRequest) Execute() (*WirelessLink, *http.Response, error) { + return r.ApiService.WirelessWirelessLinksPartialUpdateExecute(r) +} + +/* +WirelessWirelessLinksPartialUpdate Method for WirelessWirelessLinksPartialUpdate + +Patch a wireless link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless link. + @return ApiWirelessWirelessLinksPartialUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksPartialUpdate(ctx context.Context, id int32) ApiWirelessWirelessLinksPartialUpdateRequest { + return ApiWirelessWirelessLinksPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLink +func (a *WirelessAPIService) WirelessWirelessLinksPartialUpdateExecute(r ApiWirelessWirelessLinksPartialUpdateRequest) (*WirelessLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWritableWirelessLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksRetrieveRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 +} + +func (r ApiWirelessWirelessLinksRetrieveRequest) Execute() (*WirelessLink, *http.Response, error) { + return r.ApiService.WirelessWirelessLinksRetrieveExecute(r) +} + +/* +WirelessWirelessLinksRetrieve Method for WirelessWirelessLinksRetrieve + +Get a wireless link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless link. + @return ApiWirelessWirelessLinksRetrieveRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksRetrieve(ctx context.Context, id int32) ApiWirelessWirelessLinksRetrieveRequest { + return ApiWirelessWirelessLinksRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLink +func (a *WirelessAPIService) WirelessWirelessLinksRetrieveExecute(r ApiWirelessWirelessLinksRetrieveRequest) (*WirelessLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWirelessWirelessLinksUpdateRequest struct { + ctx context.Context + ApiService *WirelessAPIService + id int32 + writableWirelessLinkRequest *WritableWirelessLinkRequest +} + +func (r ApiWirelessWirelessLinksUpdateRequest) WritableWirelessLinkRequest(writableWirelessLinkRequest WritableWirelessLinkRequest) ApiWirelessWirelessLinksUpdateRequest { + r.writableWirelessLinkRequest = &writableWirelessLinkRequest + return r +} + +func (r ApiWirelessWirelessLinksUpdateRequest) Execute() (*WirelessLink, *http.Response, error) { + return r.ApiService.WirelessWirelessLinksUpdateExecute(r) +} + +/* +WirelessWirelessLinksUpdate Method for WirelessWirelessLinksUpdate + +Put a wireless link object. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this wireless link. + @return ApiWirelessWirelessLinksUpdateRequest +*/ +func (a *WirelessAPIService) WirelessWirelessLinksUpdate(ctx context.Context, id int32) ApiWirelessWirelessLinksUpdateRequest { + return ApiWirelessWirelessLinksUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WirelessLink +func (a *WirelessAPIService) WirelessWirelessLinksUpdateExecute(r ApiWirelessWirelessLinksUpdateRequest) (*WirelessLink, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WirelessLink + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WirelessAPIService.WirelessWirelessLinksUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/wireless/wireless-links/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.writableWirelessLinkRequest == nil { + return localVarReturnValue, nil, reportError("writableWirelessLinkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.writableWirelessLinkRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/client.go b/vendor/github.com/netbox-community/go-netbox/v3/client.go new file mode 100644 index 00000000..c3e10e98 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/client.go @@ -0,0 +1,692 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the NetBox REST API API v3.7.1 (3.7) +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + CircuitsAPI *CircuitsAPIService + + CoreAPI *CoreAPIService + + DcimAPI *DcimAPIService + + ExtrasAPI *ExtrasAPIService + + IpamAPI *IpamAPIService + + SchemaAPI *SchemaAPIService + + StatusAPI *StatusAPIService + + TenancyAPI *TenancyAPIService + + UsersAPI *UsersAPIService + + VirtualizationAPI *VirtualizationAPIService + + VpnAPI *VpnAPIService + + WirelessAPI *WirelessAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.CircuitsAPI = (*CircuitsAPIService)(&c.common) + c.CoreAPI = (*CoreAPIService)(&c.common) + c.DcimAPI = (*DcimAPIService)(&c.common) + c.ExtrasAPI = (*ExtrasAPIService)(&c.common) + c.IpamAPI = (*IpamAPIService)(&c.common) + c.SchemaAPI = (*SchemaAPIService)(&c.common) + c.StatusAPI = (*StatusAPIService)(&c.common) + c.TenancyAPI = (*TenancyAPIService)(&c.common) + c.UsersAPI = (*UsersAPIService)(&c.common) + c.VirtualizationAPI = (*VirtualizationAPIService)(&c.common) + c.VpnAPI = (*VpnAPIService)(&c.common) + c.WirelessAPI = (*WirelessAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/configuration.go b/vendor/github.com/netbox-community/go-netbox/v3/configuration.go new file mode 100644 index 00000000..45a24614 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/configuration.go @@ -0,0 +1,217 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "go-netbox/3.7.1", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "NetBox", + }, + }, + OperationServers: map[string]ServerConfigurations{}, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/contributing.md b/vendor/github.com/netbox-community/go-netbox/v3/contributing.md new file mode 100644 index 00000000..f76192a7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/contributing.md @@ -0,0 +1,27 @@ +Contributing +============ + +The `go-netbox` project makes use of the [GitHub Flow](https://docs.github.com/get-started/quickstart/github-flow) +for contributions. + +If you'd like to contribute to the project, please +[open an issue](https://github.com/netbox-community/go-netbox/issues/new) or find an +[existing issue](https://github.com/netbox-community/go-netbox/issues) that you'd like +to take on. This ensures that efforts are not duplicated, and that a new feature +aligns with the focus of the rest of the repository. + +Once your suggestion has been submitted and discussed, please be sure that your +code meets the following criteria: + - code is completely `gofmt`'d + - new features or codepaths have appropriate test coverage + - `go test ./...` passes + - `go vet ./...` passes + - `golint ./...` returns no warnings, including documentation comment warnings + +In addition, if this is your first time contributing to the `go-netbox` project, +add your name and email address to the +[AUTHORS](https://github.com/netbox-community/go-netbox/blob/master/AUTHORS) file +under the "Contributors" section using the format: +`First Last `. + +Finally, submit a pull request for review! diff --git a/vendor/github.com/netbox-community/go-netbox/v3/docker-compose.yml b/vendor/github.com/netbox-community/go-netbox/v3/docker-compose.yml new file mode 100644 index 00000000..a1768263 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/docker-compose.yml @@ -0,0 +1,14 @@ +services: + main: + build: + context: . + target: development + args: + USER_ID: ${USER_ID:-1000} + volumes: + - .:/go/src/app + - cache:/go/pkg + tty: true + +volumes: + cache: diff --git a/vendor/github.com/netbox-community/go-netbox/v3/license.md b/vendor/github.com/netbox-community/go-netbox/v3/license.md new file mode 100644 index 00000000..441ba58d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/license.md @@ -0,0 +1,13 @@ +Copyright DigitalOcean, LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/github.com/netbox-community/go-netbox/v3/main.go b/vendor/github.com/netbox-community/go-netbox/v3/main.go new file mode 100644 index 00000000..52d78bdc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/main.go @@ -0,0 +1,21 @@ +package netbox + +import ( + "fmt" +) + +const authHeaderName = "Authorization" +const authHeaderFormat = "Token %v" + +func NewAPIClientFor(host string, token string) *APIClient { + cfg := NewConfiguration() + + cfg.Servers[0].URL = host + + cfg.AddDefaultHeader( + authHeaderName, + fmt.Sprintf(authHeaderFormat, token), + ) + + return NewAPIClient(cfg) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate.go b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate.go new file mode 100644 index 00000000..840a76b4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate.go @@ -0,0 +1,618 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Aggregate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Aggregate{} + +// Aggregate Adds support for custom fields and tags. +type Aggregate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Family AggregateFamily `json:"family"` + Prefix string `json:"prefix"` + Rir NestedRIR `json:"rir"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + DateAdded NullableString `json:"date_added,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Aggregate Aggregate + +// NewAggregate instantiates a new Aggregate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAggregate(id int32, url string, display string, family AggregateFamily, prefix string, rir NestedRIR, created NullableTime, lastUpdated NullableTime) *Aggregate { + this := Aggregate{} + this.Id = id + this.Url = url + this.Display = display + this.Family = family + this.Prefix = prefix + this.Rir = rir + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewAggregateWithDefaults instantiates a new Aggregate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAggregateWithDefaults() *Aggregate { + this := Aggregate{} + return &this +} + +// GetId returns the Id field value +func (o *Aggregate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Aggregate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Aggregate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Aggregate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Aggregate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Aggregate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Aggregate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Aggregate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Aggregate) SetDisplay(v string) { + o.Display = v +} + +// GetFamily returns the Family field value +func (o *Aggregate) GetFamily() AggregateFamily { + if o == nil { + var ret AggregateFamily + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *Aggregate) GetFamilyOk() (*AggregateFamily, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *Aggregate) SetFamily(v AggregateFamily) { + o.Family = v +} + +// GetPrefix returns the Prefix field value +func (o *Aggregate) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *Aggregate) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *Aggregate) SetPrefix(v string) { + o.Prefix = v +} + +// GetRir returns the Rir field value +func (o *Aggregate) GetRir() NestedRIR { + if o == nil { + var ret NestedRIR + return ret + } + + return o.Rir +} + +// GetRirOk returns a tuple with the Rir field value +// and a boolean to check if the value has been set. +func (o *Aggregate) GetRirOk() (*NestedRIR, bool) { + if o == nil { + return nil, false + } + return &o.Rir, true +} + +// SetRir sets field value +func (o *Aggregate) SetRir(v NestedRIR) { + o.Rir = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Aggregate) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Aggregate) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Aggregate) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Aggregate) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Aggregate) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Aggregate) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDateAdded returns the DateAdded field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Aggregate) GetDateAdded() string { + if o == nil || IsNil(o.DateAdded.Get()) { + var ret string + return ret + } + return *o.DateAdded.Get() +} + +// GetDateAddedOk returns a tuple with the DateAdded field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Aggregate) GetDateAddedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DateAdded.Get(), o.DateAdded.IsSet() +} + +// HasDateAdded returns a boolean if a field has been set. +func (o *Aggregate) HasDateAdded() bool { + if o != nil && o.DateAdded.IsSet() { + return true + } + + return false +} + +// SetDateAdded gets a reference to the given NullableString and assigns it to the DateAdded field. +func (o *Aggregate) SetDateAdded(v string) { + o.DateAdded.Set(&v) +} + +// SetDateAddedNil sets the value for DateAdded to be an explicit nil +func (o *Aggregate) SetDateAddedNil() { + o.DateAdded.Set(nil) +} + +// UnsetDateAdded ensures that no value is present for DateAdded, not even an explicit nil +func (o *Aggregate) UnsetDateAdded() { + o.DateAdded.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Aggregate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Aggregate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Aggregate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Aggregate) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Aggregate) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Aggregate) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Aggregate) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Aggregate) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Aggregate) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Aggregate) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Aggregate) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Aggregate) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Aggregate) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Aggregate) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Aggregate) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Aggregate) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Aggregate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Aggregate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Aggregate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Aggregate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Aggregate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Aggregate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Aggregate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Aggregate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["family"] = o.Family + toSerialize["prefix"] = o.Prefix + toSerialize["rir"] = o.Rir + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.DateAdded.IsSet() { + toSerialize["date_added"] = o.DateAdded.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Aggregate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "family", + "prefix", + "rir", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAggregate := _Aggregate{} + + err = json.Unmarshal(data, &varAggregate) + + if err != nil { + return err + } + + *o = Aggregate(varAggregate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "family") + delete(additionalProperties, "prefix") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "date_added") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAggregate struct { + value *Aggregate + isSet bool +} + +func (v NullableAggregate) Get() *Aggregate { + return v.value +} + +func (v *NullableAggregate) Set(val *Aggregate) { + v.value = val + v.isSet = true +} + +func (v NullableAggregate) IsSet() bool { + return v.isSet +} + +func (v *NullableAggregate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAggregate(val *Aggregate) *NullableAggregate { + return &NullableAggregate{value: val, isSet: true} +} + +func (v NullableAggregate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAggregate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family.go b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family.go new file mode 100644 index 00000000..8c33f32e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the AggregateFamily type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AggregateFamily{} + +// AggregateFamily struct for AggregateFamily +type AggregateFamily struct { + Value *AggregateFamilyValue `json:"value,omitempty"` + Label *AggregateFamilyLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AggregateFamily AggregateFamily + +// NewAggregateFamily instantiates a new AggregateFamily object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAggregateFamily() *AggregateFamily { + this := AggregateFamily{} + return &this +} + +// NewAggregateFamilyWithDefaults instantiates a new AggregateFamily object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAggregateFamilyWithDefaults() *AggregateFamily { + this := AggregateFamily{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *AggregateFamily) GetValue() AggregateFamilyValue { + if o == nil || IsNil(o.Value) { + var ret AggregateFamilyValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregateFamily) GetValueOk() (*AggregateFamilyValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *AggregateFamily) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given AggregateFamilyValue and assigns it to the Value field. +func (o *AggregateFamily) SetValue(v AggregateFamilyValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *AggregateFamily) GetLabel() AggregateFamilyLabel { + if o == nil || IsNil(o.Label) { + var ret AggregateFamilyLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregateFamily) GetLabelOk() (*AggregateFamilyLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *AggregateFamily) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given AggregateFamilyLabel and assigns it to the Label field. +func (o *AggregateFamily) SetLabel(v AggregateFamilyLabel) { + o.Label = &v +} + +func (o AggregateFamily) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AggregateFamily) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AggregateFamily) UnmarshalJSON(data []byte) (err error) { + varAggregateFamily := _AggregateFamily{} + + err = json.Unmarshal(data, &varAggregateFamily) + + if err != nil { + return err + } + + *o = AggregateFamily(varAggregateFamily) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAggregateFamily struct { + value *AggregateFamily + isSet bool +} + +func (v NullableAggregateFamily) Get() *AggregateFamily { + return v.value +} + +func (v *NullableAggregateFamily) Set(val *AggregateFamily) { + v.value = val + v.isSet = true +} + +func (v NullableAggregateFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableAggregateFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAggregateFamily(val *AggregateFamily) *NullableAggregateFamily { + return &NullableAggregateFamily{value: val, isSet: true} +} + +func (v NullableAggregateFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAggregateFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family_label.go new file mode 100644 index 00000000..69e7ff1a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// AggregateFamilyLabel the model 'AggregateFamilyLabel' +type AggregateFamilyLabel string + +// List of Aggregate_family_label +const ( + AGGREGATEFAMILYLABEL_IPV4 AggregateFamilyLabel = "IPv4" + AGGREGATEFAMILYLABEL_IPV6 AggregateFamilyLabel = "IPv6" +) + +// All allowed values of AggregateFamilyLabel enum +var AllowedAggregateFamilyLabelEnumValues = []AggregateFamilyLabel{ + "IPv4", + "IPv6", +} + +func (v *AggregateFamilyLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AggregateFamilyLabel(value) + for _, existing := range AllowedAggregateFamilyLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AggregateFamilyLabel", value) +} + +// NewAggregateFamilyLabelFromValue returns a pointer to a valid AggregateFamilyLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAggregateFamilyLabelFromValue(v string) (*AggregateFamilyLabel, error) { + ev := AggregateFamilyLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AggregateFamilyLabel: valid values are %v", v, AllowedAggregateFamilyLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AggregateFamilyLabel) IsValid() bool { + for _, existing := range AllowedAggregateFamilyLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Aggregate_family_label value +func (v AggregateFamilyLabel) Ptr() *AggregateFamilyLabel { + return &v +} + +type NullableAggregateFamilyLabel struct { + value *AggregateFamilyLabel + isSet bool +} + +func (v NullableAggregateFamilyLabel) Get() *AggregateFamilyLabel { + return v.value +} + +func (v *NullableAggregateFamilyLabel) Set(val *AggregateFamilyLabel) { + v.value = val + v.isSet = true +} + +func (v NullableAggregateFamilyLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableAggregateFamilyLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAggregateFamilyLabel(val *AggregateFamilyLabel) *NullableAggregateFamilyLabel { + return &NullableAggregateFamilyLabel{value: val, isSet: true} +} + +func (v NullableAggregateFamilyLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAggregateFamilyLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family_value.go new file mode 100644 index 00000000..dd1c40ac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_family_value.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// AggregateFamilyValue * `4` - IPv4 * `6` - IPv6 +type AggregateFamilyValue int32 + +// List of Aggregate_family_value +const ( + AGGREGATEFAMILYVALUE__4 AggregateFamilyValue = 4 + AGGREGATEFAMILYVALUE__6 AggregateFamilyValue = 6 +) + +// All allowed values of AggregateFamilyValue enum +var AllowedAggregateFamilyValueEnumValues = []AggregateFamilyValue{ + 4, + 6, +} + +func (v *AggregateFamilyValue) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AggregateFamilyValue(value) + for _, existing := range AllowedAggregateFamilyValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AggregateFamilyValue", value) +} + +// NewAggregateFamilyValueFromValue returns a pointer to a valid AggregateFamilyValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAggregateFamilyValueFromValue(v int32) (*AggregateFamilyValue, error) { + ev := AggregateFamilyValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AggregateFamilyValue: valid values are %v", v, AllowedAggregateFamilyValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AggregateFamilyValue) IsValid() bool { + for _, existing := range AllowedAggregateFamilyValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Aggregate_family_value value +func (v AggregateFamilyValue) Ptr() *AggregateFamilyValue { + return &v +} + +type NullableAggregateFamilyValue struct { + value *AggregateFamilyValue + isSet bool +} + +func (v NullableAggregateFamilyValue) Get() *AggregateFamilyValue { + return v.value +} + +func (v *NullableAggregateFamilyValue) Set(val *AggregateFamilyValue) { + v.value = val + v.isSet = true +} + +func (v NullableAggregateFamilyValue) IsSet() bool { + return v.isSet +} + +func (v *NullableAggregateFamilyValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAggregateFamilyValue(val *AggregateFamilyValue) *NullableAggregateFamilyValue { + return &NullableAggregateFamilyValue{value: val, isSet: true} +} + +func (v NullableAggregateFamilyValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAggregateFamilyValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_request.go new file mode 100644 index 00000000..6b357550 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_aggregate_request.go @@ -0,0 +1,439 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the AggregateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AggregateRequest{} + +// AggregateRequest Adds support for custom fields and tags. +type AggregateRequest struct { + Prefix string `json:"prefix"` + Rir NestedRIRRequest `json:"rir"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + DateAdded NullableString `json:"date_added,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AggregateRequest AggregateRequest + +// NewAggregateRequest instantiates a new AggregateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAggregateRequest(prefix string, rir NestedRIRRequest) *AggregateRequest { + this := AggregateRequest{} + this.Prefix = prefix + this.Rir = rir + return &this +} + +// NewAggregateRequestWithDefaults instantiates a new AggregateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAggregateRequestWithDefaults() *AggregateRequest { + this := AggregateRequest{} + return &this +} + +// GetPrefix returns the Prefix field value +func (o *AggregateRequest) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *AggregateRequest) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *AggregateRequest) SetPrefix(v string) { + o.Prefix = v +} + +// GetRir returns the Rir field value +func (o *AggregateRequest) GetRir() NestedRIRRequest { + if o == nil { + var ret NestedRIRRequest + return ret + } + + return o.Rir +} + +// GetRirOk returns a tuple with the Rir field value +// and a boolean to check if the value has been set. +func (o *AggregateRequest) GetRirOk() (*NestedRIRRequest, bool) { + if o == nil { + return nil, false + } + return &o.Rir, true +} + +// SetRir sets field value +func (o *AggregateRequest) SetRir(v NestedRIRRequest) { + o.Rir = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AggregateRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AggregateRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *AggregateRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *AggregateRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *AggregateRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *AggregateRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDateAdded returns the DateAdded field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AggregateRequest) GetDateAdded() string { + if o == nil || IsNil(o.DateAdded.Get()) { + var ret string + return ret + } + return *o.DateAdded.Get() +} + +// GetDateAddedOk returns a tuple with the DateAdded field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AggregateRequest) GetDateAddedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DateAdded.Get(), o.DateAdded.IsSet() +} + +// HasDateAdded returns a boolean if a field has been set. +func (o *AggregateRequest) HasDateAdded() bool { + if o != nil && o.DateAdded.IsSet() { + return true + } + + return false +} + +// SetDateAdded gets a reference to the given NullableString and assigns it to the DateAdded field. +func (o *AggregateRequest) SetDateAdded(v string) { + o.DateAdded.Set(&v) +} + +// SetDateAddedNil sets the value for DateAdded to be an explicit nil +func (o *AggregateRequest) SetDateAddedNil() { + o.DateAdded.Set(nil) +} + +// UnsetDateAdded ensures that no value is present for DateAdded, not even an explicit nil +func (o *AggregateRequest) UnsetDateAdded() { + o.DateAdded.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AggregateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AggregateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AggregateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *AggregateRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregateRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *AggregateRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *AggregateRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *AggregateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *AggregateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *AggregateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *AggregateRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregateRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *AggregateRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *AggregateRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o AggregateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AggregateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prefix"] = o.Prefix + toSerialize["rir"] = o.Rir + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.DateAdded.IsSet() { + toSerialize["date_added"] = o.DateAdded.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AggregateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + "rir", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAggregateRequest := _AggregateRequest{} + + err = json.Unmarshal(data, &varAggregateRequest) + + if err != nil { + return err + } + + *o = AggregateRequest(varAggregateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "date_added") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAggregateRequest struct { + value *AggregateRequest + isSet bool +} + +func (v NullableAggregateRequest) Get() *AggregateRequest { + return v.value +} + +func (v *NullableAggregateRequest) Set(val *AggregateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAggregateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAggregateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAggregateRequest(val *AggregateRequest) *NullableAggregateRequest { + return &NullableAggregateRequest{value: val, isSet: true} +} + +func (v NullableAggregateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAggregateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_asn.go b/vendor/github.com/netbox-community/go-netbox/v3/model_asn.go new file mode 100644 index 00000000..f89e92aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_asn.go @@ -0,0 +1,619 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ASN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ASN{} + +// ASN Adds support for custom fields and tags. +type ASN struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // 16- or 32-bit autonomous system number + Asn int64 `json:"asn"` + Rir NullableNestedRIR `json:"rir,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + SiteCount int32 `json:"site_count"` + ProviderCount int32 `json:"provider_count"` + AdditionalProperties map[string]interface{} +} + +type _ASN ASN + +// NewASN instantiates a new ASN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewASN(id int32, url string, display string, asn int64, created NullableTime, lastUpdated NullableTime, siteCount int32, providerCount int32) *ASN { + this := ASN{} + this.Id = id + this.Url = url + this.Display = display + this.Asn = asn + this.Created = created + this.LastUpdated = lastUpdated + this.SiteCount = siteCount + this.ProviderCount = providerCount + return &this +} + +// NewASNWithDefaults instantiates a new ASN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewASNWithDefaults() *ASN { + this := ASN{} + return &this +} + +// GetId returns the Id field value +func (o *ASN) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ASN) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ASN) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ASN) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ASN) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ASN) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ASN) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ASN) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ASN) SetDisplay(v string) { + o.Display = v +} + +// GetAsn returns the Asn field value +func (o *ASN) GetAsn() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *ASN) GetAsnOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *ASN) SetAsn(v int64) { + o.Asn = v +} + +// GetRir returns the Rir field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ASN) GetRir() NestedRIR { + if o == nil || IsNil(o.Rir.Get()) { + var ret NestedRIR + return ret + } + return *o.Rir.Get() +} + +// GetRirOk returns a tuple with the Rir field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASN) GetRirOk() (*NestedRIR, bool) { + if o == nil { + return nil, false + } + return o.Rir.Get(), o.Rir.IsSet() +} + +// HasRir returns a boolean if a field has been set. +func (o *ASN) HasRir() bool { + if o != nil && o.Rir.IsSet() { + return true + } + + return false +} + +// SetRir gets a reference to the given NullableNestedRIR and assigns it to the Rir field. +func (o *ASN) SetRir(v NestedRIR) { + o.Rir.Set(&v) +} + +// SetRirNil sets the value for Rir to be an explicit nil +func (o *ASN) SetRirNil() { + o.Rir.Set(nil) +} + +// UnsetRir ensures that no value is present for Rir, not even an explicit nil +func (o *ASN) UnsetRir() { + o.Rir.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ASN) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASN) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *ASN) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *ASN) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *ASN) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *ASN) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ASN) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASN) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ASN) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ASN) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ASN) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASN) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ASN) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ASN) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ASN) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASN) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ASN) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ASN) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ASN) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASN) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ASN) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ASN) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ASN) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASN) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ASN) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ASN) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASN) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ASN) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetSiteCount returns the SiteCount field value +func (o *ASN) GetSiteCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SiteCount +} + +// GetSiteCountOk returns a tuple with the SiteCount field value +// and a boolean to check if the value has been set. +func (o *ASN) GetSiteCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SiteCount, true +} + +// SetSiteCount sets field value +func (o *ASN) SetSiteCount(v int32) { + o.SiteCount = v +} + +// GetProviderCount returns the ProviderCount field value +func (o *ASN) GetProviderCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ProviderCount +} + +// GetProviderCountOk returns a tuple with the ProviderCount field value +// and a boolean to check if the value has been set. +func (o *ASN) GetProviderCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ProviderCount, true +} + +// SetProviderCount sets field value +func (o *ASN) SetProviderCount(v int32) { + o.ProviderCount = v +} + +func (o ASN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ASN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["asn"] = o.Asn + if o.Rir.IsSet() { + toSerialize["rir"] = o.Rir.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["site_count"] = o.SiteCount + toSerialize["provider_count"] = o.ProviderCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ASN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "asn", + "created", + "last_updated", + "site_count", + "provider_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varASN := _ASN{} + + err = json.Unmarshal(data, &varASN) + + if err != nil { + return err + } + + *o = ASN(varASN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "asn") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "site_count") + delete(additionalProperties, "provider_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableASN struct { + value *ASN + isSet bool +} + +func (v NullableASN) Get() *ASN { + return v.value +} + +func (v *NullableASN) Set(val *ASN) { + v.value = val + v.isSet = true +} + +func (v NullableASN) IsSet() bool { + return v.isSet +} + +func (v *NullableASN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableASN(val *ASN) *NullableASN { + return &NullableASN{value: val, isSet: true} +} + +func (v NullableASN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableASN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_asn_range.go b/vendor/github.com/netbox-community/go-netbox/v3/model_asn_range.go new file mode 100644 index 00000000..46bc49a5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_asn_range.go @@ -0,0 +1,620 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ASNRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ASNRange{} + +// ASNRange Adds support for custom fields and tags. +type ASNRange struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Rir NestedRIR `json:"rir"` + Start int64 `json:"start"` + End int64 `json:"end"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AsnCount int32 `json:"asn_count"` + AdditionalProperties map[string]interface{} +} + +type _ASNRange ASNRange + +// NewASNRange instantiates a new ASNRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewASNRange(id int32, url string, display string, name string, slug string, rir NestedRIR, start int64, end int64, created NullableTime, lastUpdated NullableTime, asnCount int32) *ASNRange { + this := ASNRange{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Rir = rir + this.Start = start + this.End = end + this.Created = created + this.LastUpdated = lastUpdated + this.AsnCount = asnCount + return &this +} + +// NewASNRangeWithDefaults instantiates a new ASNRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewASNRangeWithDefaults() *ASNRange { + this := ASNRange{} + return &this +} + +// GetId returns the Id field value +func (o *ASNRange) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ASNRange) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ASNRange) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ASNRange) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ASNRange) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ASNRange) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ASNRange) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ASNRange) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ASNRange) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ASNRange) SetSlug(v string) { + o.Slug = v +} + +// GetRir returns the Rir field value +func (o *ASNRange) GetRir() NestedRIR { + if o == nil { + var ret NestedRIR + return ret + } + + return o.Rir +} + +// GetRirOk returns a tuple with the Rir field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetRirOk() (*NestedRIR, bool) { + if o == nil { + return nil, false + } + return &o.Rir, true +} + +// SetRir sets field value +func (o *ASNRange) SetRir(v NestedRIR) { + o.Rir = v +} + +// GetStart returns the Start field value +func (o *ASNRange) GetStart() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetStartOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *ASNRange) SetStart(v int64) { + o.Start = v +} + +// GetEnd returns the End field value +func (o *ASNRange) GetEnd() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetEndOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *ASNRange) SetEnd(v int64) { + o.End = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ASNRange) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASNRange) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *ASNRange) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *ASNRange) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *ASNRange) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *ASNRange) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ASNRange) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRange) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ASNRange) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ASNRange) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ASNRange) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRange) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ASNRange) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ASNRange) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ASNRange) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRange) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ASNRange) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ASNRange) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ASNRange) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASNRange) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ASNRange) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ASNRange) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASNRange) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ASNRange) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetAsnCount returns the AsnCount field value +func (o *ASNRange) GetAsnCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.AsnCount +} + +// GetAsnCountOk returns a tuple with the AsnCount field value +// and a boolean to check if the value has been set. +func (o *ASNRange) GetAsnCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.AsnCount, true +} + +// SetAsnCount sets field value +func (o *ASNRange) SetAsnCount(v int32) { + o.AsnCount = v +} + +func (o ASNRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ASNRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["rir"] = o.Rir + toSerialize["start"] = o.Start + toSerialize["end"] = o.End + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["asn_count"] = o.AsnCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ASNRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "rir", + "start", + "end", + "created", + "last_updated", + "asn_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varASNRange := _ASNRange{} + + err = json.Unmarshal(data, &varASNRange) + + if err != nil { + return err + } + + *o = ASNRange(varASNRange) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "rir") + delete(additionalProperties, "start") + delete(additionalProperties, "end") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "asn_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableASNRange struct { + value *ASNRange + isSet bool +} + +func (v NullableASNRange) Get() *ASNRange { + return v.value +} + +func (v *NullableASNRange) Set(val *ASNRange) { + v.value = val + v.isSet = true +} + +func (v NullableASNRange) IsSet() bool { + return v.isSet +} + +func (v *NullableASNRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableASNRange(val *ASNRange) *NullableASNRange { + return &NullableASNRange{value: val, isSet: true} +} + +func (v NullableASNRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableASNRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_asn_range_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_asn_range_request.go new file mode 100644 index 00000000..7052397d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_asn_range_request.go @@ -0,0 +1,441 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ASNRangeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ASNRangeRequest{} + +// ASNRangeRequest Adds support for custom fields and tags. +type ASNRangeRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Rir NestedRIRRequest `json:"rir"` + Start int64 `json:"start"` + End int64 `json:"end"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ASNRangeRequest ASNRangeRequest + +// NewASNRangeRequest instantiates a new ASNRangeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewASNRangeRequest(name string, slug string, rir NestedRIRRequest, start int64, end int64) *ASNRangeRequest { + this := ASNRangeRequest{} + this.Name = name + this.Slug = slug + this.Rir = rir + this.Start = start + this.End = end + return &this +} + +// NewASNRangeRequestWithDefaults instantiates a new ASNRangeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewASNRangeRequestWithDefaults() *ASNRangeRequest { + this := ASNRangeRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ASNRangeRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ASNRangeRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ASNRangeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ASNRangeRequest) SetSlug(v string) { + o.Slug = v +} + +// GetRir returns the Rir field value +func (o *ASNRangeRequest) GetRir() NestedRIRRequest { + if o == nil { + var ret NestedRIRRequest + return ret + } + + return o.Rir +} + +// GetRirOk returns a tuple with the Rir field value +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetRirOk() (*NestedRIRRequest, bool) { + if o == nil { + return nil, false + } + return &o.Rir, true +} + +// SetRir sets field value +func (o *ASNRangeRequest) SetRir(v NestedRIRRequest) { + o.Rir = v +} + +// GetStart returns the Start field value +func (o *ASNRangeRequest) GetStart() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetStartOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *ASNRangeRequest) SetStart(v int64) { + o.Start = v +} + +// GetEnd returns the End field value +func (o *ASNRangeRequest) GetEnd() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetEndOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *ASNRangeRequest) SetEnd(v int64) { + o.End = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ASNRangeRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASNRangeRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *ASNRangeRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *ASNRangeRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *ASNRangeRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *ASNRangeRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ASNRangeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ASNRangeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ASNRangeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ASNRangeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ASNRangeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ASNRangeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ASNRangeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRangeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ASNRangeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ASNRangeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ASNRangeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ASNRangeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["rir"] = o.Rir + toSerialize["start"] = o.Start + toSerialize["end"] = o.End + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ASNRangeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "rir", + "start", + "end", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varASNRangeRequest := _ASNRangeRequest{} + + err = json.Unmarshal(data, &varASNRangeRequest) + + if err != nil { + return err + } + + *o = ASNRangeRequest(varASNRangeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "rir") + delete(additionalProperties, "start") + delete(additionalProperties, "end") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableASNRangeRequest struct { + value *ASNRangeRequest + isSet bool +} + +func (v NullableASNRangeRequest) Get() *ASNRangeRequest { + return v.value +} + +func (v *NullableASNRangeRequest) Set(val *ASNRangeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableASNRangeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableASNRangeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableASNRangeRequest(val *ASNRangeRequest) *NullableASNRangeRequest { + return &NullableASNRangeRequest{value: val, isSet: true} +} + +func (v NullableASNRangeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableASNRangeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_asn_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_asn_request.go new file mode 100644 index 00000000..6dadf27e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_asn_request.go @@ -0,0 +1,411 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ASNRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ASNRequest{} + +// ASNRequest Adds support for custom fields and tags. +type ASNRequest struct { + // 16- or 32-bit autonomous system number + Asn int64 `json:"asn"` + Rir NullableNestedRIRRequest `json:"rir,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ASNRequest ASNRequest + +// NewASNRequest instantiates a new ASNRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewASNRequest(asn int64) *ASNRequest { + this := ASNRequest{} + this.Asn = asn + return &this +} + +// NewASNRequestWithDefaults instantiates a new ASNRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewASNRequestWithDefaults() *ASNRequest { + this := ASNRequest{} + return &this +} + +// GetAsn returns the Asn field value +func (o *ASNRequest) GetAsn() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *ASNRequest) GetAsnOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *ASNRequest) SetAsn(v int64) { + o.Asn = v +} + +// GetRir returns the Rir field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ASNRequest) GetRir() NestedRIRRequest { + if o == nil || IsNil(o.Rir.Get()) { + var ret NestedRIRRequest + return ret + } + return *o.Rir.Get() +} + +// GetRirOk returns a tuple with the Rir field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASNRequest) GetRirOk() (*NestedRIRRequest, bool) { + if o == nil { + return nil, false + } + return o.Rir.Get(), o.Rir.IsSet() +} + +// HasRir returns a boolean if a field has been set. +func (o *ASNRequest) HasRir() bool { + if o != nil && o.Rir.IsSet() { + return true + } + + return false +} + +// SetRir gets a reference to the given NullableNestedRIRRequest and assigns it to the Rir field. +func (o *ASNRequest) SetRir(v NestedRIRRequest) { + o.Rir.Set(&v) +} + +// SetRirNil sets the value for Rir to be an explicit nil +func (o *ASNRequest) SetRirNil() { + o.Rir.Set(nil) +} + +// UnsetRir ensures that no value is present for Rir, not even an explicit nil +func (o *ASNRequest) UnsetRir() { + o.Rir.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ASNRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ASNRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *ASNRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *ASNRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *ASNRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *ASNRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ASNRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ASNRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ASNRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ASNRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ASNRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ASNRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ASNRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ASNRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ASNRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ASNRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ASNRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ASNRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ASNRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ASNRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ASNRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["asn"] = o.Asn + if o.Rir.IsSet() { + toSerialize["rir"] = o.Rir.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ASNRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "asn", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varASNRequest := _ASNRequest{} + + err = json.Unmarshal(data, &varASNRequest) + + if err != nil { + return err + } + + *o = ASNRequest(varASNRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "asn") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableASNRequest struct { + value *ASNRequest + isSet bool +} + +func (v NullableASNRequest) Get() *ASNRequest { + return v.value +} + +func (v *NullableASNRequest) Set(val *ASNRequest) { + v.value = val + v.isSet = true +} + +func (v NullableASNRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableASNRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableASNRequest(val *ASNRequest) *NullableASNRequest { + return &NullableASNRequest{value: val, isSet: true} +} + +func (v NullableASNRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableASNRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_authentication.go b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication.go new file mode 100644 index 00000000..5bdf72b0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// Authentication * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC +type Authentication string + +// List of Authentication +const ( + AUTHENTICATION_HMAC_SHA1 Authentication = "hmac-sha1" + AUTHENTICATION_HMAC_SHA256 Authentication = "hmac-sha256" + AUTHENTICATION_HMAC_SHA384 Authentication = "hmac-sha384" + AUTHENTICATION_HMAC_SHA512 Authentication = "hmac-sha512" + AUTHENTICATION_HMAC_MD5 Authentication = "hmac-md5" + AUTHENTICATION_EMPTY Authentication = "" +) + +// All allowed values of Authentication enum +var AllowedAuthenticationEnumValues = []Authentication{ + "hmac-sha1", + "hmac-sha256", + "hmac-sha384", + "hmac-sha512", + "hmac-md5", + "", +} + +func (v *Authentication) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Authentication(value) + for _, existing := range AllowedAuthenticationEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Authentication", value) +} + +// NewAuthenticationFromValue returns a pointer to a valid Authentication +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticationFromValue(v string) (*Authentication, error) { + ev := Authentication(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Authentication: valid values are %v", v, AllowedAuthenticationEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Authentication) IsValid() bool { + for _, existing := range AllowedAuthenticationEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Authentication value +func (v Authentication) Ptr() *Authentication { + return &v +} + +type NullableAuthentication struct { + value *Authentication + isSet bool +} + +func (v NullableAuthentication) Get() *Authentication { + return v.value +} + +func (v *NullableAuthentication) Set(val *Authentication) { + v.value = val + v.isSet = true +} + +func (v NullableAuthentication) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthentication) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthentication(val *Authentication) *NullableAuthentication { + return &NullableAuthentication{value: val, isSet: true} +} + +func (v NullableAuthentication) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthentication) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_cipher.go b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_cipher.go new file mode 100644 index 00000000..39a943a6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_cipher.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// AuthenticationCipher * `auto` - Auto * `tkip` - TKIP * `aes` - AES +type AuthenticationCipher string + +// List of Authentication_cipher +const ( + AUTHENTICATIONCIPHER_AUTO AuthenticationCipher = "auto" + AUTHENTICATIONCIPHER_TKIP AuthenticationCipher = "tkip" + AUTHENTICATIONCIPHER_AES AuthenticationCipher = "aes" + AUTHENTICATIONCIPHER_EMPTY AuthenticationCipher = "" +) + +// All allowed values of AuthenticationCipher enum +var AllowedAuthenticationCipherEnumValues = []AuthenticationCipher{ + "auto", + "tkip", + "aes", + "", +} + +func (v *AuthenticationCipher) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthenticationCipher(value) + for _, existing := range AllowedAuthenticationCipherEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AuthenticationCipher", value) +} + +// NewAuthenticationCipherFromValue returns a pointer to a valid AuthenticationCipher +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticationCipherFromValue(v string) (*AuthenticationCipher, error) { + ev := AuthenticationCipher(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticationCipher: valid values are %v", v, AllowedAuthenticationCipherEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthenticationCipher) IsValid() bool { + for _, existing := range AllowedAuthenticationCipherEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Authentication_cipher value +func (v AuthenticationCipher) Ptr() *AuthenticationCipher { + return &v +} + +type NullableAuthenticationCipher struct { + value *AuthenticationCipher + isSet bool +} + +func (v NullableAuthenticationCipher) Get() *AuthenticationCipher { + return v.value +} + +func (v *NullableAuthenticationCipher) Set(val *AuthenticationCipher) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticationCipher) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticationCipher) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticationCipher(val *AuthenticationCipher) *NullableAuthenticationCipher { + return &NullableAuthenticationCipher{value: val, isSet: true} +} + +func (v NullableAuthenticationCipher) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticationCipher) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_type.go new file mode 100644 index 00000000..78d082a6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_type.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// AuthenticationType * `plaintext` - Plaintext * `md5` - MD5 +type AuthenticationType string + +// List of Authentication_type +const ( + AUTHENTICATIONTYPE_PLAINTEXT AuthenticationType = "plaintext" + AUTHENTICATIONTYPE_MD5 AuthenticationType = "md5" + AUTHENTICATIONTYPE_EMPTY AuthenticationType = "" +) + +// All allowed values of AuthenticationType enum +var AllowedAuthenticationTypeEnumValues = []AuthenticationType{ + "plaintext", + "md5", + "", +} + +func (v *AuthenticationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthenticationType(value) + for _, existing := range AllowedAuthenticationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AuthenticationType", value) +} + +// NewAuthenticationTypeFromValue returns a pointer to a valid AuthenticationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticationTypeFromValue(v string) (*AuthenticationType, error) { + ev := AuthenticationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticationType: valid values are %v", v, AllowedAuthenticationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthenticationType) IsValid() bool { + for _, existing := range AllowedAuthenticationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Authentication_type value +func (v AuthenticationType) Ptr() *AuthenticationType { + return &v +} + +type NullableAuthenticationType struct { + value *AuthenticationType + isSet bool +} + +func (v NullableAuthenticationType) Get() *AuthenticationType { + return v.value +} + +func (v *NullableAuthenticationType) Set(val *AuthenticationType) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticationType) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticationType(val *AuthenticationType) *NullableAuthenticationType { + return &NullableAuthenticationType{value: val, isSet: true} +} + +func (v NullableAuthenticationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_type_1.go b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_type_1.go new file mode 100644 index 00000000..ed33b85b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_authentication_type_1.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// AuthenticationType1 * `open` - Open * `wep` - WEP * `wpa-personal` - WPA Personal (PSK) * `wpa-enterprise` - WPA Enterprise +type AuthenticationType1 string + +// List of Authentication_type_1 +const ( + AUTHENTICATIONTYPE1_OPEN AuthenticationType1 = "open" + AUTHENTICATIONTYPE1_WEP AuthenticationType1 = "wep" + AUTHENTICATIONTYPE1_WPA_PERSONAL AuthenticationType1 = "wpa-personal" + AUTHENTICATIONTYPE1_WPA_ENTERPRISE AuthenticationType1 = "wpa-enterprise" + AUTHENTICATIONTYPE1_EMPTY AuthenticationType1 = "" +) + +// All allowed values of AuthenticationType1 enum +var AllowedAuthenticationType1EnumValues = []AuthenticationType1{ + "open", + "wep", + "wpa-personal", + "wpa-enterprise", + "", +} + +func (v *AuthenticationType1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthenticationType1(value) + for _, existing := range AllowedAuthenticationType1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AuthenticationType1", value) +} + +// NewAuthenticationType1FromValue returns a pointer to a valid AuthenticationType1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticationType1FromValue(v string) (*AuthenticationType1, error) { + ev := AuthenticationType1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticationType1: valid values are %v", v, AllowedAuthenticationType1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthenticationType1) IsValid() bool { + for _, existing := range AllowedAuthenticationType1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Authentication_type_1 value +func (v AuthenticationType1) Ptr() *AuthenticationType1 { + return &v +} + +type NullableAuthenticationType1 struct { + value *AuthenticationType1 + isSet bool +} + +func (v NullableAuthenticationType1) Get() *AuthenticationType1 { + return v.value +} + +func (v *NullableAuthenticationType1) Set(val *AuthenticationType1) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticationType1) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticationType1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticationType1(val *AuthenticationType1) *NullableAuthenticationType1 { + return &NullableAuthenticationType1{value: val, isSet: true} +} + +func (v NullableAuthenticationType1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticationType1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_available_asn.go b/vendor/github.com/netbox-community/go-netbox/v3/model_available_asn.go new file mode 100644 index 00000000..939ff05a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_available_asn.go @@ -0,0 +1,203 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the AvailableASN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailableASN{} + +// AvailableASN Representation of an ASN which does not exist in the database. +type AvailableASN struct { + Asn int32 `json:"asn"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AvailableASN AvailableASN + +// NewAvailableASN instantiates a new AvailableASN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAvailableASN(asn int32) *AvailableASN { + this := AvailableASN{} + this.Asn = asn + return &this +} + +// NewAvailableASNWithDefaults instantiates a new AvailableASN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAvailableASNWithDefaults() *AvailableASN { + this := AvailableASN{} + return &this +} + +// GetAsn returns the Asn field value +func (o *AvailableASN) GetAsn() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *AvailableASN) GetAsnOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *AvailableASN) SetAsn(v int32) { + o.Asn = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AvailableASN) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AvailableASN) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AvailableASN) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AvailableASN) SetDescription(v string) { + o.Description = &v +} + +func (o AvailableASN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AvailableASN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["asn"] = o.Asn + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AvailableASN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "asn", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAvailableASN := _AvailableASN{} + + err = json.Unmarshal(data, &varAvailableASN) + + if err != nil { + return err + } + + *o = AvailableASN(varAvailableASN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "asn") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAvailableASN struct { + value *AvailableASN + isSet bool +} + +func (v NullableAvailableASN) Get() *AvailableASN { + return v.value +} + +func (v *NullableAvailableASN) Set(val *AvailableASN) { + v.value = val + v.isSet = true +} + +func (v NullableAvailableASN) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailableASN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailableASN(val *AvailableASN) *NullableAvailableASN { + return &NullableAvailableASN{value: val, isSet: true} +} + +func (v NullableAvailableASN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailableASN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_available_ip.go b/vendor/github.com/netbox-community/go-netbox/v3/model_available_ip.go new file mode 100644 index 00000000..ee005d4a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_available_ip.go @@ -0,0 +1,261 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the AvailableIP type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailableIP{} + +// AvailableIP Representation of an IP address which does not exist in the database. +type AvailableIP struct { + Family int32 `json:"family"` + Address string `json:"address"` + Vrf NestedVRF `json:"vrf"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AvailableIP AvailableIP + +// NewAvailableIP instantiates a new AvailableIP object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAvailableIP(family int32, address string, vrf NestedVRF) *AvailableIP { + this := AvailableIP{} + this.Family = family + this.Address = address + this.Vrf = vrf + return &this +} + +// NewAvailableIPWithDefaults instantiates a new AvailableIP object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAvailableIPWithDefaults() *AvailableIP { + this := AvailableIP{} + return &this +} + +// GetFamily returns the Family field value +func (o *AvailableIP) GetFamily() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *AvailableIP) GetFamilyOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *AvailableIP) SetFamily(v int32) { + o.Family = v +} + +// GetAddress returns the Address field value +func (o *AvailableIP) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *AvailableIP) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *AvailableIP) SetAddress(v string) { + o.Address = v +} + +// GetVrf returns the Vrf field value +func (o *AvailableIP) GetVrf() NestedVRF { + if o == nil { + var ret NestedVRF + return ret + } + + return o.Vrf +} + +// GetVrfOk returns a tuple with the Vrf field value +// and a boolean to check if the value has been set. +func (o *AvailableIP) GetVrfOk() (*NestedVRF, bool) { + if o == nil { + return nil, false + } + return &o.Vrf, true +} + +// SetVrf sets field value +func (o *AvailableIP) SetVrf(v NestedVRF) { + o.Vrf = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AvailableIP) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AvailableIP) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AvailableIP) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AvailableIP) SetDescription(v string) { + o.Description = &v +} + +func (o AvailableIP) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AvailableIP) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["family"] = o.Family + toSerialize["address"] = o.Address + toSerialize["vrf"] = o.Vrf + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AvailableIP) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "family", + "address", + "vrf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAvailableIP := _AvailableIP{} + + err = json.Unmarshal(data, &varAvailableIP) + + if err != nil { + return err + } + + *o = AvailableIP(varAvailableIP) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "family") + delete(additionalProperties, "address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAvailableIP struct { + value *AvailableIP + isSet bool +} + +func (v NullableAvailableIP) Get() *AvailableIP { + return v.value +} + +func (v *NullableAvailableIP) Set(val *AvailableIP) { + v.value = val + v.isSet = true +} + +func (v NullableAvailableIP) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailableIP) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailableIP(val *AvailableIP) *NullableAvailableIP { + return &NullableAvailableIP{value: val, isSet: true} +} + +func (v NullableAvailableIP) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailableIP) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_available_prefix.go b/vendor/github.com/netbox-community/go-netbox/v3/model_available_prefix.go new file mode 100644 index 00000000..7a6ae7a9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_available_prefix.go @@ -0,0 +1,224 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the AvailablePrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailablePrefix{} + +// AvailablePrefix Representation of a prefix which does not exist in the database. +type AvailablePrefix struct { + Family int32 `json:"family"` + Prefix string `json:"prefix"` + Vrf NestedVRF `json:"vrf"` + AdditionalProperties map[string]interface{} +} + +type _AvailablePrefix AvailablePrefix + +// NewAvailablePrefix instantiates a new AvailablePrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAvailablePrefix(family int32, prefix string, vrf NestedVRF) *AvailablePrefix { + this := AvailablePrefix{} + this.Family = family + this.Prefix = prefix + this.Vrf = vrf + return &this +} + +// NewAvailablePrefixWithDefaults instantiates a new AvailablePrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAvailablePrefixWithDefaults() *AvailablePrefix { + this := AvailablePrefix{} + return &this +} + +// GetFamily returns the Family field value +func (o *AvailablePrefix) GetFamily() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *AvailablePrefix) GetFamilyOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *AvailablePrefix) SetFamily(v int32) { + o.Family = v +} + +// GetPrefix returns the Prefix field value +func (o *AvailablePrefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *AvailablePrefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *AvailablePrefix) SetPrefix(v string) { + o.Prefix = v +} + +// GetVrf returns the Vrf field value +func (o *AvailablePrefix) GetVrf() NestedVRF { + if o == nil { + var ret NestedVRF + return ret + } + + return o.Vrf +} + +// GetVrfOk returns a tuple with the Vrf field value +// and a boolean to check if the value has been set. +func (o *AvailablePrefix) GetVrfOk() (*NestedVRF, bool) { + if o == nil { + return nil, false + } + return &o.Vrf, true +} + +// SetVrf sets field value +func (o *AvailablePrefix) SetVrf(v NestedVRF) { + o.Vrf = v +} + +func (o AvailablePrefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AvailablePrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["family"] = o.Family + toSerialize["prefix"] = o.Prefix + toSerialize["vrf"] = o.Vrf + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AvailablePrefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "family", + "prefix", + "vrf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAvailablePrefix := _AvailablePrefix{} + + err = json.Unmarshal(data, &varAvailablePrefix) + + if err != nil { + return err + } + + *o = AvailablePrefix(varAvailablePrefix) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "family") + delete(additionalProperties, "prefix") + delete(additionalProperties, "vrf") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAvailablePrefix struct { + value *AvailablePrefix + isSet bool +} + +func (v NullableAvailablePrefix) Get() *AvailablePrefix { + return v.value +} + +func (v *NullableAvailablePrefix) Set(val *AvailablePrefix) { + v.value = val + v.isSet = true +} + +func (v NullableAvailablePrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailablePrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailablePrefix(val *AvailablePrefix) *NullableAvailablePrefix { + return &NullableAvailablePrefix{value: val, isSet: true} +} + +func (v NullableAvailablePrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailablePrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_available_vlan.go b/vendor/github.com/netbox-community/go-netbox/v3/model_available_vlan.go new file mode 100644 index 00000000..412c598f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_available_vlan.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the AvailableVLAN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailableVLAN{} + +// AvailableVLAN Representation of a VLAN which does not exist in the database. +type AvailableVLAN struct { + Vid int32 `json:"vid"` + Group NestedVLANGroup `json:"group"` + AdditionalProperties map[string]interface{} +} + +type _AvailableVLAN AvailableVLAN + +// NewAvailableVLAN instantiates a new AvailableVLAN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAvailableVLAN(vid int32, group NestedVLANGroup) *AvailableVLAN { + this := AvailableVLAN{} + this.Vid = vid + this.Group = group + return &this +} + +// NewAvailableVLANWithDefaults instantiates a new AvailableVLAN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAvailableVLANWithDefaults() *AvailableVLAN { + this := AvailableVLAN{} + return &this +} + +// GetVid returns the Vid field value +func (o *AvailableVLAN) GetVid() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Vid +} + +// GetVidOk returns a tuple with the Vid field value +// and a boolean to check if the value has been set. +func (o *AvailableVLAN) GetVidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Vid, true +} + +// SetVid sets field value +func (o *AvailableVLAN) SetVid(v int32) { + o.Vid = v +} + +// GetGroup returns the Group field value +func (o *AvailableVLAN) GetGroup() NestedVLANGroup { + if o == nil { + var ret NestedVLANGroup + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *AvailableVLAN) GetGroupOk() (*NestedVLANGroup, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *AvailableVLAN) SetGroup(v NestedVLANGroup) { + o.Group = v +} + +func (o AvailableVLAN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AvailableVLAN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["vid"] = o.Vid + toSerialize["group"] = o.Group + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AvailableVLAN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "vid", + "group", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAvailableVLAN := _AvailableVLAN{} + + err = json.Unmarshal(data, &varAvailableVLAN) + + if err != nil { + return err + } + + *o = AvailableVLAN(varAvailableVLAN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "vid") + delete(additionalProperties, "group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAvailableVLAN struct { + value *AvailableVLAN + isSet bool +} + +func (v NullableAvailableVLAN) Get() *AvailableVLAN { + return v.value +} + +func (v *NullableAvailableVLAN) Set(val *AvailableVLAN) { + v.value = val + v.isSet = true +} + +func (v NullableAvailableVLAN) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailableVLAN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailableVLAN(val *AvailableVLAN) *NullableAvailableVLAN { + return &NullableAvailableVLAN{value: val, isSet: true} +} + +func (v NullableAvailableVLAN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailableVLAN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_bookmark.go b/vendor/github.com/netbox-community/go-netbox/v3/model_bookmark.go new file mode 100644 index 00000000..9a85a6d5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_bookmark.go @@ -0,0 +1,374 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Bookmark type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Bookmark{} + +// Bookmark Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type Bookmark struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ObjectType string `json:"object_type"` + ObjectId int64 `json:"object_id"` + Object interface{} `json:"object"` + User NestedUser `json:"user"` + Created time.Time `json:"created"` + AdditionalProperties map[string]interface{} +} + +type _Bookmark Bookmark + +// NewBookmark instantiates a new Bookmark object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBookmark(id int32, url string, display string, objectType string, objectId int64, object interface{}, user NestedUser, created time.Time) *Bookmark { + this := Bookmark{} + this.Id = id + this.Url = url + this.Display = display + this.ObjectType = objectType + this.ObjectId = objectId + this.Object = object + this.User = user + this.Created = created + return &this +} + +// NewBookmarkWithDefaults instantiates a new Bookmark object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBookmarkWithDefaults() *Bookmark { + this := Bookmark{} + return &this +} + +// GetId returns the Id field value +func (o *Bookmark) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Bookmark) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Bookmark) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Bookmark) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Bookmark) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Bookmark) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Bookmark) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Bookmark) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Bookmark) SetDisplay(v string) { + o.Display = v +} + +// GetObjectType returns the ObjectType field value +func (o *Bookmark) GetObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectType +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value +// and a boolean to check if the value has been set. +func (o *Bookmark) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectType, true +} + +// SetObjectType sets field value +func (o *Bookmark) SetObjectType(v string) { + o.ObjectType = v +} + +// GetObjectId returns the ObjectId field value +func (o *Bookmark) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *Bookmark) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *Bookmark) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetObject returns the Object field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *Bookmark) GetObject() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Bookmark) GetObjectOk() (*interface{}, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return &o.Object, true +} + +// SetObject sets field value +func (o *Bookmark) SetObject(v interface{}) { + o.Object = v +} + +// GetUser returns the User field value +func (o *Bookmark) GetUser() NestedUser { + if o == nil { + var ret NestedUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *Bookmark) GetUserOk() (*NestedUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *Bookmark) SetUser(v NestedUser) { + o.User = v +} + +// GetCreated returns the Created field value +func (o *Bookmark) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Bookmark) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Bookmark) SetCreated(v time.Time) { + o.Created = v +} + +func (o Bookmark) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Bookmark) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["object_type"] = o.ObjectType + toSerialize["object_id"] = o.ObjectId + if o.Object != nil { + toSerialize["object"] = o.Object + } + toSerialize["user"] = o.User + toSerialize["created"] = o.Created + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Bookmark) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "object_type", + "object_id", + "object", + "user", + "created", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBookmark := _Bookmark{} + + err = json.Unmarshal(data, &varBookmark) + + if err != nil { + return err + } + + *o = Bookmark(varBookmark) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "object_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "object") + delete(additionalProperties, "user") + delete(additionalProperties, "created") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBookmark struct { + value *Bookmark + isSet bool +} + +func (v NullableBookmark) Get() *Bookmark { + return v.value +} + +func (v *NullableBookmark) Set(val *Bookmark) { + v.value = val + v.isSet = true +} + +func (v NullableBookmark) IsSet() bool { + return v.isSet +} + +func (v *NullableBookmark) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBookmark(val *Bookmark) *NullableBookmark { + return &NullableBookmark{value: val, isSet: true} +} + +func (v NullableBookmark) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBookmark) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_bookmark_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_bookmark_request.go new file mode 100644 index 00000000..ae52829f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_bookmark_request.go @@ -0,0 +1,224 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the BookmarkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BookmarkRequest{} + +// BookmarkRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type BookmarkRequest struct { + ObjectType string `json:"object_type"` + ObjectId int64 `json:"object_id"` + User NestedUserRequest `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _BookmarkRequest BookmarkRequest + +// NewBookmarkRequest instantiates a new BookmarkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBookmarkRequest(objectType string, objectId int64, user NestedUserRequest) *BookmarkRequest { + this := BookmarkRequest{} + this.ObjectType = objectType + this.ObjectId = objectId + this.User = user + return &this +} + +// NewBookmarkRequestWithDefaults instantiates a new BookmarkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBookmarkRequestWithDefaults() *BookmarkRequest { + this := BookmarkRequest{} + return &this +} + +// GetObjectType returns the ObjectType field value +func (o *BookmarkRequest) GetObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectType +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value +// and a boolean to check if the value has been set. +func (o *BookmarkRequest) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectType, true +} + +// SetObjectType sets field value +func (o *BookmarkRequest) SetObjectType(v string) { + o.ObjectType = v +} + +// GetObjectId returns the ObjectId field value +func (o *BookmarkRequest) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *BookmarkRequest) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *BookmarkRequest) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetUser returns the User field value +func (o *BookmarkRequest) GetUser() NestedUserRequest { + if o == nil { + var ret NestedUserRequest + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *BookmarkRequest) GetUserOk() (*NestedUserRequest, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *BookmarkRequest) SetUser(v NestedUserRequest) { + o.User = v +} + +func (o BookmarkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BookmarkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["object_type"] = o.ObjectType + toSerialize["object_id"] = o.ObjectId + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BookmarkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "object_type", + "object_id", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBookmarkRequest := _BookmarkRequest{} + + err = json.Unmarshal(data, &varBookmarkRequest) + + if err != nil { + return err + } + + *o = BookmarkRequest(varBookmarkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBookmarkRequest struct { + value *BookmarkRequest + isSet bool +} + +func (v NullableBookmarkRequest) Get() *BookmarkRequest { + return v.value +} + +func (v *NullableBookmarkRequest) Set(val *BookmarkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableBookmarkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableBookmarkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBookmarkRequest(val *BookmarkRequest) *NullableBookmarkRequest { + return &NullableBookmarkRequest{value: val, isSet: true} +} + +func (v NullableBookmarkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBookmarkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable.go new file mode 100644 index 00000000..c36633b4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable.go @@ -0,0 +1,801 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Cable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Cable{} + +// Cable Adds support for custom fields and tags. +type Cable struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Type *CableType `json:"type,omitempty"` + ATerminations []GenericObject `json:"a_terminations,omitempty"` + BTerminations []GenericObject `json:"b_terminations,omitempty"` + Status *CableStatus `json:"status,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Label *string `json:"label,omitempty"` + Color *string `json:"color,omitempty"` + Length NullableFloat64 `json:"length,omitempty"` + LengthUnit NullableCableLengthUnit `json:"length_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Cable Cable + +// NewCable instantiates a new Cable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCable(id int32, url string, display string, created NullableTime, lastUpdated NullableTime) *Cable { + this := Cable{} + this.Id = id + this.Url = url + this.Display = display + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewCableWithDefaults instantiates a new Cable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCableWithDefaults() *Cable { + this := Cable{} + return &this +} + +// GetId returns the Id field value +func (o *Cable) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Cable) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Cable) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Cable) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Cable) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Cable) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Cable) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Cable) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Cable) SetDisplay(v string) { + o.Display = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Cable) GetType() CableType { + if o == nil || IsNil(o.Type) { + var ret CableType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetTypeOk() (*CableType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Cable) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given CableType and assigns it to the Type field. +func (o *Cable) SetType(v CableType) { + o.Type = &v +} + +// GetATerminations returns the ATerminations field value if set, zero value otherwise. +func (o *Cable) GetATerminations() []GenericObject { + if o == nil || IsNil(o.ATerminations) { + var ret []GenericObject + return ret + } + return o.ATerminations +} + +// GetATerminationsOk returns a tuple with the ATerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetATerminationsOk() ([]GenericObject, bool) { + if o == nil || IsNil(o.ATerminations) { + return nil, false + } + return o.ATerminations, true +} + +// HasATerminations returns a boolean if a field has been set. +func (o *Cable) HasATerminations() bool { + if o != nil && !IsNil(o.ATerminations) { + return true + } + + return false +} + +// SetATerminations gets a reference to the given []GenericObject and assigns it to the ATerminations field. +func (o *Cable) SetATerminations(v []GenericObject) { + o.ATerminations = v +} + +// GetBTerminations returns the BTerminations field value if set, zero value otherwise. +func (o *Cable) GetBTerminations() []GenericObject { + if o == nil || IsNil(o.BTerminations) { + var ret []GenericObject + return ret + } + return o.BTerminations +} + +// GetBTerminationsOk returns a tuple with the BTerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetBTerminationsOk() ([]GenericObject, bool) { + if o == nil || IsNil(o.BTerminations) { + return nil, false + } + return o.BTerminations, true +} + +// HasBTerminations returns a boolean if a field has been set. +func (o *Cable) HasBTerminations() bool { + if o != nil && !IsNil(o.BTerminations) { + return true + } + + return false +} + +// SetBTerminations gets a reference to the given []GenericObject and assigns it to the BTerminations field. +func (o *Cable) SetBTerminations(v []GenericObject) { + o.BTerminations = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Cable) GetStatus() CableStatus { + if o == nil || IsNil(o.Status) { + var ret CableStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetStatusOk() (*CableStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Cable) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatus and assigns it to the Status field. +func (o *Cable) SetStatus(v CableStatus) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cable) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cable) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Cable) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Cable) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Cable) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Cable) UnsetTenant() { + o.Tenant.Unset() +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *Cable) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *Cable) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *Cable) SetLabel(v string) { + o.Label = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *Cable) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Cable) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Cable) SetColor(v string) { + o.Color = &v +} + +// GetLength returns the Length field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cable) GetLength() float64 { + if o == nil || IsNil(o.Length.Get()) { + var ret float64 + return ret + } + return *o.Length.Get() +} + +// GetLengthOk returns a tuple with the Length field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cable) GetLengthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Length.Get(), o.Length.IsSet() +} + +// HasLength returns a boolean if a field has been set. +func (o *Cable) HasLength() bool { + if o != nil && o.Length.IsSet() { + return true + } + + return false +} + +// SetLength gets a reference to the given NullableFloat64 and assigns it to the Length field. +func (o *Cable) SetLength(v float64) { + o.Length.Set(&v) +} + +// SetLengthNil sets the value for Length to be an explicit nil +func (o *Cable) SetLengthNil() { + o.Length.Set(nil) +} + +// UnsetLength ensures that no value is present for Length, not even an explicit nil +func (o *Cable) UnsetLength() { + o.Length.Unset() +} + +// GetLengthUnit returns the LengthUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cable) GetLengthUnit() CableLengthUnit { + if o == nil || IsNil(o.LengthUnit.Get()) { + var ret CableLengthUnit + return ret + } + return *o.LengthUnit.Get() +} + +// GetLengthUnitOk returns a tuple with the LengthUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cable) GetLengthUnitOk() (*CableLengthUnit, bool) { + if o == nil { + return nil, false + } + return o.LengthUnit.Get(), o.LengthUnit.IsSet() +} + +// HasLengthUnit returns a boolean if a field has been set. +func (o *Cable) HasLengthUnit() bool { + if o != nil && o.LengthUnit.IsSet() { + return true + } + + return false +} + +// SetLengthUnit gets a reference to the given NullableCableLengthUnit and assigns it to the LengthUnit field. +func (o *Cable) SetLengthUnit(v CableLengthUnit) { + o.LengthUnit.Set(&v) +} + +// SetLengthUnitNil sets the value for LengthUnit to be an explicit nil +func (o *Cable) SetLengthUnitNil() { + o.LengthUnit.Set(nil) +} + +// UnsetLengthUnit ensures that no value is present for LengthUnit, not even an explicit nil +func (o *Cable) UnsetLengthUnit() { + o.LengthUnit.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Cable) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Cable) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Cable) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Cable) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Cable) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Cable) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Cable) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Cable) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Cable) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Cable) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cable) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Cable) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Cable) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Cable) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cable) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Cable) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Cable) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cable) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Cable) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Cable) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Cable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ATerminations) { + toSerialize["a_terminations"] = o.ATerminations + } + if !IsNil(o.BTerminations) { + toSerialize["b_terminations"] = o.BTerminations + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if o.Length.IsSet() { + toSerialize["length"] = o.Length.Get() + } + if o.LengthUnit.IsSet() { + toSerialize["length_unit"] = o.LengthUnit.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Cable) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCable := _Cable{} + + err = json.Unmarshal(data, &varCable) + + if err != nil { + return err + } + + *o = Cable(varCable) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "type") + delete(additionalProperties, "a_terminations") + delete(additionalProperties, "b_terminations") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "label") + delete(additionalProperties, "color") + delete(additionalProperties, "length") + delete(additionalProperties, "length_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCable struct { + value *Cable + isSet bool +} + +func (v NullableCable) Get() *Cable { + return v.value +} + +func (v *NullableCable) Set(val *Cable) { + v.value = val + v.isSet = true +} + +func (v NullableCable) IsSet() bool { + return v.isSet +} + +func (v *NullableCable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCable(val *Cable) *NullableCable { + return &NullableCable{value: val, isSet: true} +} + +func (v NullableCable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit.go new file mode 100644 index 00000000..f4fb90a1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CableLengthUnit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CableLengthUnit{} + +// CableLengthUnit struct for CableLengthUnit +type CableLengthUnit struct { + Value *CableLengthUnitValue `json:"value,omitempty"` + Label *CableLengthUnitLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CableLengthUnit CableLengthUnit + +// NewCableLengthUnit instantiates a new CableLengthUnit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCableLengthUnit() *CableLengthUnit { + this := CableLengthUnit{} + return &this +} + +// NewCableLengthUnitWithDefaults instantiates a new CableLengthUnit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCableLengthUnitWithDefaults() *CableLengthUnit { + this := CableLengthUnit{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CableLengthUnit) GetValue() CableLengthUnitValue { + if o == nil || IsNil(o.Value) { + var ret CableLengthUnitValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableLengthUnit) GetValueOk() (*CableLengthUnitValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CableLengthUnit) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CableLengthUnitValue and assigns it to the Value field. +func (o *CableLengthUnit) SetValue(v CableLengthUnitValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CableLengthUnit) GetLabel() CableLengthUnitLabel { + if o == nil || IsNil(o.Label) { + var ret CableLengthUnitLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableLengthUnit) GetLabelOk() (*CableLengthUnitLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CableLengthUnit) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CableLengthUnitLabel and assigns it to the Label field. +func (o *CableLengthUnit) SetLabel(v CableLengthUnitLabel) { + o.Label = &v +} + +func (o CableLengthUnit) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CableLengthUnit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CableLengthUnit) UnmarshalJSON(data []byte) (err error) { + varCableLengthUnit := _CableLengthUnit{} + + err = json.Unmarshal(data, &varCableLengthUnit) + + if err != nil { + return err + } + + *o = CableLengthUnit(varCableLengthUnit) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCableLengthUnit struct { + value *CableLengthUnit + isSet bool +} + +func (v NullableCableLengthUnit) Get() *CableLengthUnit { + return v.value +} + +func (v *NullableCableLengthUnit) Set(val *CableLengthUnit) { + v.value = val + v.isSet = true +} + +func (v NullableCableLengthUnit) IsSet() bool { + return v.isSet +} + +func (v *NullableCableLengthUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableLengthUnit(val *CableLengthUnit) *NullableCableLengthUnit { + return &NullableCableLengthUnit{value: val, isSet: true} +} + +func (v NullableCableLengthUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableLengthUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit_label.go new file mode 100644 index 00000000..fe52d74f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit_label.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CableLengthUnitLabel the model 'CableLengthUnitLabel' +type CableLengthUnitLabel string + +// List of Cable_length_unit_label +const ( + CABLELENGTHUNITLABEL_KILOMETERS CableLengthUnitLabel = "Kilometers" + CABLELENGTHUNITLABEL_METERS CableLengthUnitLabel = "Meters" + CABLELENGTHUNITLABEL_CENTIMETERS CableLengthUnitLabel = "Centimeters" + CABLELENGTHUNITLABEL_MILES CableLengthUnitLabel = "Miles" + CABLELENGTHUNITLABEL_FEET CableLengthUnitLabel = "Feet" + CABLELENGTHUNITLABEL_INCHES CableLengthUnitLabel = "Inches" +) + +// All allowed values of CableLengthUnitLabel enum +var AllowedCableLengthUnitLabelEnumValues = []CableLengthUnitLabel{ + "Kilometers", + "Meters", + "Centimeters", + "Miles", + "Feet", + "Inches", +} + +func (v *CableLengthUnitLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CableLengthUnitLabel(value) + for _, existing := range AllowedCableLengthUnitLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CableLengthUnitLabel", value) +} + +// NewCableLengthUnitLabelFromValue returns a pointer to a valid CableLengthUnitLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCableLengthUnitLabelFromValue(v string) (*CableLengthUnitLabel, error) { + ev := CableLengthUnitLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CableLengthUnitLabel: valid values are %v", v, AllowedCableLengthUnitLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CableLengthUnitLabel) IsValid() bool { + for _, existing := range AllowedCableLengthUnitLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Cable_length_unit_label value +func (v CableLengthUnitLabel) Ptr() *CableLengthUnitLabel { + return &v +} + +type NullableCableLengthUnitLabel struct { + value *CableLengthUnitLabel + isSet bool +} + +func (v NullableCableLengthUnitLabel) Get() *CableLengthUnitLabel { + return v.value +} + +func (v *NullableCableLengthUnitLabel) Set(val *CableLengthUnitLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCableLengthUnitLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCableLengthUnitLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableLengthUnitLabel(val *CableLengthUnitLabel) *NullableCableLengthUnitLabel { + return &NullableCableLengthUnitLabel{value: val, isSet: true} +} + +func (v NullableCableLengthUnitLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableLengthUnitLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit_value.go new file mode 100644 index 00000000..be21d9a6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_length_unit_value.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CableLengthUnitValue * `km` - Kilometers * `m` - Meters * `cm` - Centimeters * `mi` - Miles * `ft` - Feet * `in` - Inches +type CableLengthUnitValue string + +// List of Cable_length_unit_value +const ( + CABLELENGTHUNITVALUE_KM CableLengthUnitValue = "km" + CABLELENGTHUNITVALUE_M CableLengthUnitValue = "m" + CABLELENGTHUNITVALUE_CM CableLengthUnitValue = "cm" + CABLELENGTHUNITVALUE_MI CableLengthUnitValue = "mi" + CABLELENGTHUNITVALUE_FT CableLengthUnitValue = "ft" + CABLELENGTHUNITVALUE_IN CableLengthUnitValue = "in" + CABLELENGTHUNITVALUE_EMPTY CableLengthUnitValue = "" +) + +// All allowed values of CableLengthUnitValue enum +var AllowedCableLengthUnitValueEnumValues = []CableLengthUnitValue{ + "km", + "m", + "cm", + "mi", + "ft", + "in", + "", +} + +func (v *CableLengthUnitValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CableLengthUnitValue(value) + for _, existing := range AllowedCableLengthUnitValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CableLengthUnitValue", value) +} + +// NewCableLengthUnitValueFromValue returns a pointer to a valid CableLengthUnitValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCableLengthUnitValueFromValue(v string) (*CableLengthUnitValue, error) { + ev := CableLengthUnitValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CableLengthUnitValue: valid values are %v", v, AllowedCableLengthUnitValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CableLengthUnitValue) IsValid() bool { + for _, existing := range AllowedCableLengthUnitValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Cable_length_unit_value value +func (v CableLengthUnitValue) Ptr() *CableLengthUnitValue { + return &v +} + +type NullableCableLengthUnitValue struct { + value *CableLengthUnitValue + isSet bool +} + +func (v NullableCableLengthUnitValue) Get() *CableLengthUnitValue { + return v.value +} + +func (v *NullableCableLengthUnitValue) Set(val *CableLengthUnitValue) { + v.value = val + v.isSet = true +} + +func (v NullableCableLengthUnitValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCableLengthUnitValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableLengthUnitValue(val *CableLengthUnitValue) *NullableCableLengthUnitValue { + return &NullableCableLengthUnitValue{value: val, isSet: true} +} + +func (v NullableCableLengthUnitValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableLengthUnitValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_request.go new file mode 100644 index 00000000..3d8e3cc7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_request.go @@ -0,0 +1,630 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CableRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CableRequest{} + +// CableRequest Adds support for custom fields and tags. +type CableRequest struct { + Type *CableType `json:"type,omitempty"` + ATerminations []GenericObjectRequest `json:"a_terminations,omitempty"` + BTerminations []GenericObjectRequest `json:"b_terminations,omitempty"` + Status *CableStatusValue `json:"status,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Label *string `json:"label,omitempty"` + Color *string `json:"color,omitempty"` + Length NullableFloat64 `json:"length,omitempty"` + LengthUnit NullableCableRequestLengthUnit `json:"length_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CableRequest CableRequest + +// NewCableRequest instantiates a new CableRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCableRequest() *CableRequest { + this := CableRequest{} + return &this +} + +// NewCableRequestWithDefaults instantiates a new CableRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCableRequestWithDefaults() *CableRequest { + this := CableRequest{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CableRequest) GetType() CableType { + if o == nil || IsNil(o.Type) { + var ret CableType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetTypeOk() (*CableType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CableRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given CableType and assigns it to the Type field. +func (o *CableRequest) SetType(v CableType) { + o.Type = &v +} + +// GetATerminations returns the ATerminations field value if set, zero value otherwise. +func (o *CableRequest) GetATerminations() []GenericObjectRequest { + if o == nil || IsNil(o.ATerminations) { + var ret []GenericObjectRequest + return ret + } + return o.ATerminations +} + +// GetATerminationsOk returns a tuple with the ATerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetATerminationsOk() ([]GenericObjectRequest, bool) { + if o == nil || IsNil(o.ATerminations) { + return nil, false + } + return o.ATerminations, true +} + +// HasATerminations returns a boolean if a field has been set. +func (o *CableRequest) HasATerminations() bool { + if o != nil && !IsNil(o.ATerminations) { + return true + } + + return false +} + +// SetATerminations gets a reference to the given []GenericObjectRequest and assigns it to the ATerminations field. +func (o *CableRequest) SetATerminations(v []GenericObjectRequest) { + o.ATerminations = v +} + +// GetBTerminations returns the BTerminations field value if set, zero value otherwise. +func (o *CableRequest) GetBTerminations() []GenericObjectRequest { + if o == nil || IsNil(o.BTerminations) { + var ret []GenericObjectRequest + return ret + } + return o.BTerminations +} + +// GetBTerminationsOk returns a tuple with the BTerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetBTerminationsOk() ([]GenericObjectRequest, bool) { + if o == nil || IsNil(o.BTerminations) { + return nil, false + } + return o.BTerminations, true +} + +// HasBTerminations returns a boolean if a field has been set. +func (o *CableRequest) HasBTerminations() bool { + if o != nil && !IsNil(o.BTerminations) { + return true + } + + return false +} + +// SetBTerminations gets a reference to the given []GenericObjectRequest and assigns it to the BTerminations field. +func (o *CableRequest) SetBTerminations(v []GenericObjectRequest) { + o.BTerminations = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CableRequest) GetStatus() CableStatusValue { + if o == nil || IsNil(o.Status) { + var ret CableStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetStatusOk() (*CableStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CableRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatusValue and assigns it to the Status field. +func (o *CableRequest) SetStatus(v CableStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CableRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CableRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *CableRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *CableRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *CableRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *CableRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CableRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CableRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *CableRequest) SetLabel(v string) { + o.Label = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *CableRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *CableRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *CableRequest) SetColor(v string) { + o.Color = &v +} + +// GetLength returns the Length field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CableRequest) GetLength() float64 { + if o == nil || IsNil(o.Length.Get()) { + var ret float64 + return ret + } + return *o.Length.Get() +} + +// GetLengthOk returns a tuple with the Length field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CableRequest) GetLengthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Length.Get(), o.Length.IsSet() +} + +// HasLength returns a boolean if a field has been set. +func (o *CableRequest) HasLength() bool { + if o != nil && o.Length.IsSet() { + return true + } + + return false +} + +// SetLength gets a reference to the given NullableFloat64 and assigns it to the Length field. +func (o *CableRequest) SetLength(v float64) { + o.Length.Set(&v) +} + +// SetLengthNil sets the value for Length to be an explicit nil +func (o *CableRequest) SetLengthNil() { + o.Length.Set(nil) +} + +// UnsetLength ensures that no value is present for Length, not even an explicit nil +func (o *CableRequest) UnsetLength() { + o.Length.Unset() +} + +// GetLengthUnit returns the LengthUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CableRequest) GetLengthUnit() CableRequestLengthUnit { + if o == nil || IsNil(o.LengthUnit.Get()) { + var ret CableRequestLengthUnit + return ret + } + return *o.LengthUnit.Get() +} + +// GetLengthUnitOk returns a tuple with the LengthUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CableRequest) GetLengthUnitOk() (*CableRequestLengthUnit, bool) { + if o == nil { + return nil, false + } + return o.LengthUnit.Get(), o.LengthUnit.IsSet() +} + +// HasLengthUnit returns a boolean if a field has been set. +func (o *CableRequest) HasLengthUnit() bool { + if o != nil && o.LengthUnit.IsSet() { + return true + } + + return false +} + +// SetLengthUnit gets a reference to the given NullableCableRequestLengthUnit and assigns it to the LengthUnit field. +func (o *CableRequest) SetLengthUnit(v CableRequestLengthUnit) { + o.LengthUnit.Set(&v) +} + +// SetLengthUnitNil sets the value for LengthUnit to be an explicit nil +func (o *CableRequest) SetLengthUnitNil() { + o.LengthUnit.Set(nil) +} + +// UnsetLengthUnit ensures that no value is present for LengthUnit, not even an explicit nil +func (o *CableRequest) UnsetLengthUnit() { + o.LengthUnit.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CableRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CableRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CableRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *CableRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *CableRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *CableRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CableRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CableRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *CableRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *CableRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *CableRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *CableRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o CableRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CableRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ATerminations) { + toSerialize["a_terminations"] = o.ATerminations + } + if !IsNil(o.BTerminations) { + toSerialize["b_terminations"] = o.BTerminations + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if o.Length.IsSet() { + toSerialize["length"] = o.Length.Get() + } + if o.LengthUnit.IsSet() { + toSerialize["length_unit"] = o.LengthUnit.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CableRequest) UnmarshalJSON(data []byte) (err error) { + varCableRequest := _CableRequest{} + + err = json.Unmarshal(data, &varCableRequest) + + if err != nil { + return err + } + + *o = CableRequest(varCableRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "a_terminations") + delete(additionalProperties, "b_terminations") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "label") + delete(additionalProperties, "color") + delete(additionalProperties, "length") + delete(additionalProperties, "length_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCableRequest struct { + value *CableRequest + isSet bool +} + +func (v NullableCableRequest) Get() *CableRequest { + return v.value +} + +func (v *NullableCableRequest) Set(val *CableRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableRequest(val *CableRequest) *NullableCableRequest { + return &NullableCableRequest{value: val, isSet: true} +} + +func (v NullableCableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_request_length_unit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_request_length_unit.go new file mode 100644 index 00000000..6aafb756 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_request_length_unit.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CableRequestLengthUnit * `km` - Kilometers * `m` - Meters * `cm` - Centimeters * `mi` - Miles * `ft` - Feet * `in` - Inches +type CableRequestLengthUnit string + +// List of CableRequest_length_unit +const ( + CABLEREQUESTLENGTHUNIT_KM CableRequestLengthUnit = "km" + CABLEREQUESTLENGTHUNIT_M CableRequestLengthUnit = "m" + CABLEREQUESTLENGTHUNIT_CM CableRequestLengthUnit = "cm" + CABLEREQUESTLENGTHUNIT_MI CableRequestLengthUnit = "mi" + CABLEREQUESTLENGTHUNIT_FT CableRequestLengthUnit = "ft" + CABLEREQUESTLENGTHUNIT_IN CableRequestLengthUnit = "in" + CABLEREQUESTLENGTHUNIT_EMPTY CableRequestLengthUnit = "" +) + +// All allowed values of CableRequestLengthUnit enum +var AllowedCableRequestLengthUnitEnumValues = []CableRequestLengthUnit{ + "km", + "m", + "cm", + "mi", + "ft", + "in", + "", +} + +func (v *CableRequestLengthUnit) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CableRequestLengthUnit(value) + for _, existing := range AllowedCableRequestLengthUnitEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CableRequestLengthUnit", value) +} + +// NewCableRequestLengthUnitFromValue returns a pointer to a valid CableRequestLengthUnit +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCableRequestLengthUnitFromValue(v string) (*CableRequestLengthUnit, error) { + ev := CableRequestLengthUnit(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CableRequestLengthUnit: valid values are %v", v, AllowedCableRequestLengthUnitEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CableRequestLengthUnit) IsValid() bool { + for _, existing := range AllowedCableRequestLengthUnitEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CableRequest_length_unit value +func (v CableRequestLengthUnit) Ptr() *CableRequestLengthUnit { + return &v +} + +type NullableCableRequestLengthUnit struct { + value *CableRequestLengthUnit + isSet bool +} + +func (v NullableCableRequestLengthUnit) Get() *CableRequestLengthUnit { + return v.value +} + +func (v *NullableCableRequestLengthUnit) Set(val *CableRequestLengthUnit) { + v.value = val + v.isSet = true +} + +func (v NullableCableRequestLengthUnit) IsSet() bool { + return v.isSet +} + +func (v *NullableCableRequestLengthUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableRequestLengthUnit(val *CableRequestLengthUnit) *NullableCableRequestLengthUnit { + return &NullableCableRequestLengthUnit{value: val, isSet: true} +} + +func (v NullableCableRequestLengthUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableRequestLengthUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status.go new file mode 100644 index 00000000..81ef0900 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CableStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CableStatus{} + +// CableStatus struct for CableStatus +type CableStatus struct { + Value *CableStatusValue `json:"value,omitempty"` + Label *CableStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CableStatus CableStatus + +// NewCableStatus instantiates a new CableStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCableStatus() *CableStatus { + this := CableStatus{} + return &this +} + +// NewCableStatusWithDefaults instantiates a new CableStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCableStatusWithDefaults() *CableStatus { + this := CableStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CableStatus) GetValue() CableStatusValue { + if o == nil || IsNil(o.Value) { + var ret CableStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableStatus) GetValueOk() (*CableStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CableStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CableStatusValue and assigns it to the Value field. +func (o *CableStatus) SetValue(v CableStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CableStatus) GetLabel() CableStatusLabel { + if o == nil || IsNil(o.Label) { + var ret CableStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CableStatus) GetLabelOk() (*CableStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CableStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CableStatusLabel and assigns it to the Label field. +func (o *CableStatus) SetLabel(v CableStatusLabel) { + o.Label = &v +} + +func (o CableStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CableStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CableStatus) UnmarshalJSON(data []byte) (err error) { + varCableStatus := _CableStatus{} + + err = json.Unmarshal(data, &varCableStatus) + + if err != nil { + return err + } + + *o = CableStatus(varCableStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCableStatus struct { + value *CableStatus + isSet bool +} + +func (v NullableCableStatus) Get() *CableStatus { + return v.value +} + +func (v *NullableCableStatus) Set(val *CableStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCableStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCableStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableStatus(val *CableStatus) *NullableCableStatus { + return &NullableCableStatus{value: val, isSet: true} +} + +func (v NullableCableStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status_label.go new file mode 100644 index 00000000..0f460f12 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CableStatusLabel the model 'CableStatusLabel' +type CableStatusLabel string + +// List of Cable_status_label +const ( + CABLESTATUSLABEL_CONNECTED CableStatusLabel = "Connected" + CABLESTATUSLABEL_PLANNED CableStatusLabel = "Planned" + CABLESTATUSLABEL_DECOMMISSIONING CableStatusLabel = "Decommissioning" +) + +// All allowed values of CableStatusLabel enum +var AllowedCableStatusLabelEnumValues = []CableStatusLabel{ + "Connected", + "Planned", + "Decommissioning", +} + +func (v *CableStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CableStatusLabel(value) + for _, existing := range AllowedCableStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CableStatusLabel", value) +} + +// NewCableStatusLabelFromValue returns a pointer to a valid CableStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCableStatusLabelFromValue(v string) (*CableStatusLabel, error) { + ev := CableStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CableStatusLabel: valid values are %v", v, AllowedCableStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CableStatusLabel) IsValid() bool { + for _, existing := range AllowedCableStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Cable_status_label value +func (v CableStatusLabel) Ptr() *CableStatusLabel { + return &v +} + +type NullableCableStatusLabel struct { + value *CableStatusLabel + isSet bool +} + +func (v NullableCableStatusLabel) Get() *CableStatusLabel { + return v.value +} + +func (v *NullableCableStatusLabel) Set(val *CableStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCableStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCableStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableStatusLabel(val *CableStatusLabel) *NullableCableStatusLabel { + return &NullableCableStatusLabel{value: val, isSet: true} +} + +func (v NullableCableStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status_value.go new file mode 100644 index 00000000..6b1b6cd2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_status_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CableStatusValue * `connected` - Connected * `planned` - Planned * `decommissioning` - Decommissioning +type CableStatusValue string + +// List of Cable_status_value +const ( + CABLESTATUSVALUE_CONNECTED CableStatusValue = "connected" + CABLESTATUSVALUE_PLANNED CableStatusValue = "planned" + CABLESTATUSVALUE_DECOMMISSIONING CableStatusValue = "decommissioning" +) + +// All allowed values of CableStatusValue enum +var AllowedCableStatusValueEnumValues = []CableStatusValue{ + "connected", + "planned", + "decommissioning", +} + +func (v *CableStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CableStatusValue(value) + for _, existing := range AllowedCableStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CableStatusValue", value) +} + +// NewCableStatusValueFromValue returns a pointer to a valid CableStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCableStatusValueFromValue(v string) (*CableStatusValue, error) { + ev := CableStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CableStatusValue: valid values are %v", v, AllowedCableStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CableStatusValue) IsValid() bool { + for _, existing := range AllowedCableStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Cable_status_value value +func (v CableStatusValue) Ptr() *CableStatusValue { + return &v +} + +type NullableCableStatusValue struct { + value *CableStatusValue + isSet bool +} + +func (v NullableCableStatusValue) Get() *CableStatusValue { + return v.value +} + +func (v *NullableCableStatusValue) Set(val *CableStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableCableStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCableStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableStatusValue(val *CableStatusValue) *NullableCableStatusValue { + return &NullableCableStatusValue{value: val, isSet: true} +} + +func (v NullableCableStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_termination.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_termination.go new file mode 100644 index 00000000..e752b559 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_termination.go @@ -0,0 +1,436 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CableTermination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CableTermination{} + +// CableTermination Adds support for custom fields and tags. +type CableTermination struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Cable int32 `json:"cable"` + CableEnd End `json:"cable_end"` + TerminationType string `json:"termination_type"` + TerminationId int64 `json:"termination_id"` + Termination interface{} `json:"termination"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _CableTermination CableTermination + +// NewCableTermination instantiates a new CableTermination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCableTermination(id int32, url string, display string, cable int32, cableEnd End, terminationType string, terminationId int64, termination interface{}, created NullableTime, lastUpdated NullableTime) *CableTermination { + this := CableTermination{} + this.Id = id + this.Url = url + this.Display = display + this.Cable = cable + this.CableEnd = cableEnd + this.TerminationType = terminationType + this.TerminationId = terminationId + this.Termination = termination + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewCableTerminationWithDefaults instantiates a new CableTermination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCableTerminationWithDefaults() *CableTermination { + this := CableTermination{} + return &this +} + +// GetId returns the Id field value +func (o *CableTermination) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CableTermination) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CableTermination) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *CableTermination) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CableTermination) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *CableTermination) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *CableTermination) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *CableTermination) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *CableTermination) SetDisplay(v string) { + o.Display = v +} + +// GetCable returns the Cable field value +func (o *CableTermination) GetCable() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Cable +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +func (o *CableTermination) GetCableOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Cable, true +} + +// SetCable sets field value +func (o *CableTermination) SetCable(v int32) { + o.Cable = v +} + +// GetCableEnd returns the CableEnd field value +func (o *CableTermination) GetCableEnd() End { + if o == nil { + var ret End + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *CableTermination) GetCableEndOk() (*End, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *CableTermination) SetCableEnd(v End) { + o.CableEnd = v +} + +// GetTerminationType returns the TerminationType field value +func (o *CableTermination) GetTerminationType() string { + if o == nil { + var ret string + return ret + } + + return o.TerminationType +} + +// GetTerminationTypeOk returns a tuple with the TerminationType field value +// and a boolean to check if the value has been set. +func (o *CableTermination) GetTerminationTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TerminationType, true +} + +// SetTerminationType sets field value +func (o *CableTermination) SetTerminationType(v string) { + o.TerminationType = v +} + +// GetTerminationId returns the TerminationId field value +func (o *CableTermination) GetTerminationId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TerminationId +} + +// GetTerminationIdOk returns a tuple with the TerminationId field value +// and a boolean to check if the value has been set. +func (o *CableTermination) GetTerminationIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TerminationId, true +} + +// SetTerminationId sets field value +func (o *CableTermination) SetTerminationId(v int64) { + o.TerminationId = v +} + +// GetTermination returns the Termination field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *CableTermination) GetTermination() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Termination +} + +// GetTerminationOk returns a tuple with the Termination field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CableTermination) GetTerminationOk() (*interface{}, bool) { + if o == nil || IsNil(o.Termination) { + return nil, false + } + return &o.Termination, true +} + +// SetTermination sets field value +func (o *CableTermination) SetTermination(v interface{}) { + o.Termination = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CableTermination) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CableTermination) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *CableTermination) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CableTermination) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CableTermination) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *CableTermination) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o CableTermination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CableTermination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["cable"] = o.Cable + toSerialize["cable_end"] = o.CableEnd + toSerialize["termination_type"] = o.TerminationType + toSerialize["termination_id"] = o.TerminationId + if o.Termination != nil { + toSerialize["termination"] = o.Termination + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CableTermination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "cable", + "cable_end", + "termination_type", + "termination_id", + "termination", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCableTermination := _CableTermination{} + + err = json.Unmarshal(data, &varCableTermination) + + if err != nil { + return err + } + + *o = CableTermination(varCableTermination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "termination_type") + delete(additionalProperties, "termination_id") + delete(additionalProperties, "termination") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCableTermination struct { + value *CableTermination + isSet bool +} + +func (v NullableCableTermination) Get() *CableTermination { + return v.value +} + +func (v *NullableCableTermination) Set(val *CableTermination) { + v.value = val + v.isSet = true +} + +func (v NullableCableTermination) IsSet() bool { + return v.isSet +} + +func (v *NullableCableTermination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableTermination(val *CableTermination) *NullableCableTermination { + return &NullableCableTermination{value: val, isSet: true} +} + +func (v NullableCableTermination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableTermination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_termination_request.go new file mode 100644 index 00000000..afa723da --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_termination_request.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CableTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CableTerminationRequest{} + +// CableTerminationRequest Adds support for custom fields and tags. +type CableTerminationRequest struct { + Cable int32 `json:"cable"` + CableEnd End `json:"cable_end"` + TerminationType string `json:"termination_type"` + TerminationId int64 `json:"termination_id"` + AdditionalProperties map[string]interface{} +} + +type _CableTerminationRequest CableTerminationRequest + +// NewCableTerminationRequest instantiates a new CableTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCableTerminationRequest(cable int32, cableEnd End, terminationType string, terminationId int64) *CableTerminationRequest { + this := CableTerminationRequest{} + this.Cable = cable + this.CableEnd = cableEnd + this.TerminationType = terminationType + this.TerminationId = terminationId + return &this +} + +// NewCableTerminationRequestWithDefaults instantiates a new CableTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCableTerminationRequestWithDefaults() *CableTerminationRequest { + this := CableTerminationRequest{} + return &this +} + +// GetCable returns the Cable field value +func (o *CableTerminationRequest) GetCable() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Cable +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +func (o *CableTerminationRequest) GetCableOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Cable, true +} + +// SetCable sets field value +func (o *CableTerminationRequest) SetCable(v int32) { + o.Cable = v +} + +// GetCableEnd returns the CableEnd field value +func (o *CableTerminationRequest) GetCableEnd() End { + if o == nil { + var ret End + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *CableTerminationRequest) GetCableEndOk() (*End, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *CableTerminationRequest) SetCableEnd(v End) { + o.CableEnd = v +} + +// GetTerminationType returns the TerminationType field value +func (o *CableTerminationRequest) GetTerminationType() string { + if o == nil { + var ret string + return ret + } + + return o.TerminationType +} + +// GetTerminationTypeOk returns a tuple with the TerminationType field value +// and a boolean to check if the value has been set. +func (o *CableTerminationRequest) GetTerminationTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TerminationType, true +} + +// SetTerminationType sets field value +func (o *CableTerminationRequest) SetTerminationType(v string) { + o.TerminationType = v +} + +// GetTerminationId returns the TerminationId field value +func (o *CableTerminationRequest) GetTerminationId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TerminationId +} + +// GetTerminationIdOk returns a tuple with the TerminationId field value +// and a boolean to check if the value has been set. +func (o *CableTerminationRequest) GetTerminationIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TerminationId, true +} + +// SetTerminationId sets field value +func (o *CableTerminationRequest) SetTerminationId(v int64) { + o.TerminationId = v +} + +func (o CableTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CableTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cable"] = o.Cable + toSerialize["cable_end"] = o.CableEnd + toSerialize["termination_type"] = o.TerminationType + toSerialize["termination_id"] = o.TerminationId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CableTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cable", + "cable_end", + "termination_type", + "termination_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCableTerminationRequest := _CableTerminationRequest{} + + err = json.Unmarshal(data, &varCableTerminationRequest) + + if err != nil { + return err + } + + *o = CableTerminationRequest(varCableTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "termination_type") + delete(additionalProperties, "termination_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCableTerminationRequest struct { + value *CableTerminationRequest + isSet bool +} + +func (v NullableCableTerminationRequest) Get() *CableTerminationRequest { + return v.value +} + +func (v *NullableCableTerminationRequest) Set(val *CableTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCableTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCableTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableTerminationRequest(val *CableTerminationRequest) *NullableCableTerminationRequest { + return &NullableCableTerminationRequest{value: val, isSet: true} +} + +func (v NullableCableTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cable_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_type.go new file mode 100644 index 00000000..c7c53d26 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cable_type.go @@ -0,0 +1,154 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CableType * `cat3` - CAT3 * `cat5` - CAT5 * `cat5e` - CAT5e * `cat6` - CAT6 * `cat6a` - CAT6a * `cat7` - CAT7 * `cat7a` - CAT7a * `cat8` - CAT8 * `dac-active` - Direct Attach Copper (Active) * `dac-passive` - Direct Attach Copper (Passive) * `mrj21-trunk` - MRJ21 Trunk * `coaxial` - Coaxial * `mmf` - Multimode Fiber * `mmf-om1` - Multimode Fiber (OM1) * `mmf-om2` - Multimode Fiber (OM2) * `mmf-om3` - Multimode Fiber (OM3) * `mmf-om4` - Multimode Fiber (OM4) * `mmf-om5` - Multimode Fiber (OM5) * `smf` - Singlemode Fiber * `smf-os1` - Singlemode Fiber (OS1) * `smf-os2` - Singlemode Fiber (OS2) * `aoc` - Active Optical Cabling (AOC) * `power` - Power +type CableType string + +// List of Cable_type +const ( + CABLETYPE_CAT3 CableType = "cat3" + CABLETYPE_CAT5 CableType = "cat5" + CABLETYPE_CAT5E CableType = "cat5e" + CABLETYPE_CAT6 CableType = "cat6" + CABLETYPE_CAT6A CableType = "cat6a" + CABLETYPE_CAT7 CableType = "cat7" + CABLETYPE_CAT7A CableType = "cat7a" + CABLETYPE_CAT8 CableType = "cat8" + CABLETYPE_DAC_ACTIVE CableType = "dac-active" + CABLETYPE_DAC_PASSIVE CableType = "dac-passive" + CABLETYPE_MRJ21_TRUNK CableType = "mrj21-trunk" + CABLETYPE_COAXIAL CableType = "coaxial" + CABLETYPE_MMF CableType = "mmf" + CABLETYPE_MMF_OM1 CableType = "mmf-om1" + CABLETYPE_MMF_OM2 CableType = "mmf-om2" + CABLETYPE_MMF_OM3 CableType = "mmf-om3" + CABLETYPE_MMF_OM4 CableType = "mmf-om4" + CABLETYPE_MMF_OM5 CableType = "mmf-om5" + CABLETYPE_SMF CableType = "smf" + CABLETYPE_SMF_OS1 CableType = "smf-os1" + CABLETYPE_SMF_OS2 CableType = "smf-os2" + CABLETYPE_AOC CableType = "aoc" + CABLETYPE_POWER CableType = "power" + CABLETYPE_EMPTY CableType = "" +) + +// All allowed values of CableType enum +var AllowedCableTypeEnumValues = []CableType{ + "cat3", + "cat5", + "cat5e", + "cat6", + "cat6a", + "cat7", + "cat7a", + "cat8", + "dac-active", + "dac-passive", + "mrj21-trunk", + "coaxial", + "mmf", + "mmf-om1", + "mmf-om2", + "mmf-om3", + "mmf-om4", + "mmf-om5", + "smf", + "smf-os1", + "smf-os2", + "aoc", + "power", + "", +} + +func (v *CableType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CableType(value) + for _, existing := range AllowedCableTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CableType", value) +} + +// NewCableTypeFromValue returns a pointer to a valid CableType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCableTypeFromValue(v string) (*CableType, error) { + ev := CableType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CableType: valid values are %v", v, AllowedCableTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CableType) IsValid() bool { + for _, existing := range AllowedCableTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Cable_type value +func (v CableType) Ptr() *CableType { + return &v +} + +type NullableCableType struct { + value *CableType + isSet bool +} + +func (v NullableCableType) Get() *CableType { + return v.value +} + +func (v *NullableCableType) Set(val *CableType) { + v.value = val + v.isSet = true +} + +func (v NullableCableType) IsSet() bool { + return v.isSet +} + +func (v *NullableCableType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCableType(val *CableType) *NullableCableType { + return &NullableCableType{value: val, isSet: true} +} + +func (v NullableCableType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCableType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit.go new file mode 100644 index 00000000..429441e5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit.go @@ -0,0 +1,863 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Circuit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Circuit{} + +// Circuit Adds support for custom fields and tags. +type Circuit struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Unique circuit ID + Cid string `json:"cid"` + Provider NestedProvider `json:"provider"` + ProviderAccount NullableNestedProviderAccount `json:"provider_account,omitempty"` + Type NestedCircuitType `json:"type"` + Status *CircuitStatus `json:"status,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + InstallDate NullableString `json:"install_date,omitempty"` + TerminationDate NullableString `json:"termination_date,omitempty"` + // Committed rate + CommitRate NullableInt32 `json:"commit_rate,omitempty"` + Description *string `json:"description,omitempty"` + TerminationA NullableCircuitCircuitTermination `json:"termination_a"` + TerminationZ NullableCircuitCircuitTermination `json:"termination_z"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Circuit Circuit + +// NewCircuit instantiates a new Circuit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuit(id int32, url string, display string, cid string, provider NestedProvider, type_ NestedCircuitType, terminationA NullableCircuitCircuitTermination, terminationZ NullableCircuitCircuitTermination, created NullableTime, lastUpdated NullableTime) *Circuit { + this := Circuit{} + this.Id = id + this.Url = url + this.Display = display + this.Cid = cid + this.Provider = provider + this.Type = type_ + this.TerminationA = terminationA + this.TerminationZ = terminationZ + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewCircuitWithDefaults instantiates a new Circuit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitWithDefaults() *Circuit { + this := Circuit{} + return &this +} + +// GetId returns the Id field value +func (o *Circuit) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Circuit) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Circuit) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Circuit) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Circuit) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Circuit) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Circuit) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Circuit) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Circuit) SetDisplay(v string) { + o.Display = v +} + +// GetCid returns the Cid field value +func (o *Circuit) GetCid() string { + if o == nil { + var ret string + return ret + } + + return o.Cid +} + +// GetCidOk returns a tuple with the Cid field value +// and a boolean to check if the value has been set. +func (o *Circuit) GetCidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cid, true +} + +// SetCid sets field value +func (o *Circuit) SetCid(v string) { + o.Cid = v +} + +// GetProvider returns the Provider field value +func (o *Circuit) GetProvider() NestedProvider { + if o == nil { + var ret NestedProvider + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *Circuit) GetProviderOk() (*NestedProvider, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *Circuit) SetProvider(v NestedProvider) { + o.Provider = v +} + +// GetProviderAccount returns the ProviderAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Circuit) GetProviderAccount() NestedProviderAccount { + if o == nil || IsNil(o.ProviderAccount.Get()) { + var ret NestedProviderAccount + return ret + } + return *o.ProviderAccount.Get() +} + +// GetProviderAccountOk returns a tuple with the ProviderAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetProviderAccountOk() (*NestedProviderAccount, bool) { + if o == nil { + return nil, false + } + return o.ProviderAccount.Get(), o.ProviderAccount.IsSet() +} + +// HasProviderAccount returns a boolean if a field has been set. +func (o *Circuit) HasProviderAccount() bool { + if o != nil && o.ProviderAccount.IsSet() { + return true + } + + return false +} + +// SetProviderAccount gets a reference to the given NullableNestedProviderAccount and assigns it to the ProviderAccount field. +func (o *Circuit) SetProviderAccount(v NestedProviderAccount) { + o.ProviderAccount.Set(&v) +} + +// SetProviderAccountNil sets the value for ProviderAccount to be an explicit nil +func (o *Circuit) SetProviderAccountNil() { + o.ProviderAccount.Set(nil) +} + +// UnsetProviderAccount ensures that no value is present for ProviderAccount, not even an explicit nil +func (o *Circuit) UnsetProviderAccount() { + o.ProviderAccount.Unset() +} + +// GetType returns the Type field value +func (o *Circuit) GetType() NestedCircuitType { + if o == nil { + var ret NestedCircuitType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Circuit) GetTypeOk() (*NestedCircuitType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Circuit) SetType(v NestedCircuitType) { + o.Type = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Circuit) GetStatus() CircuitStatus { + if o == nil || IsNil(o.Status) { + var ret CircuitStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Circuit) GetStatusOk() (*CircuitStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Circuit) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CircuitStatus and assigns it to the Status field. +func (o *Circuit) SetStatus(v CircuitStatus) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Circuit) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Circuit) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Circuit) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Circuit) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Circuit) UnsetTenant() { + o.Tenant.Unset() +} + +// GetInstallDate returns the InstallDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Circuit) GetInstallDate() string { + if o == nil || IsNil(o.InstallDate.Get()) { + var ret string + return ret + } + return *o.InstallDate.Get() +} + +// GetInstallDateOk returns a tuple with the InstallDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetInstallDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.InstallDate.Get(), o.InstallDate.IsSet() +} + +// HasInstallDate returns a boolean if a field has been set. +func (o *Circuit) HasInstallDate() bool { + if o != nil && o.InstallDate.IsSet() { + return true + } + + return false +} + +// SetInstallDate gets a reference to the given NullableString and assigns it to the InstallDate field. +func (o *Circuit) SetInstallDate(v string) { + o.InstallDate.Set(&v) +} + +// SetInstallDateNil sets the value for InstallDate to be an explicit nil +func (o *Circuit) SetInstallDateNil() { + o.InstallDate.Set(nil) +} + +// UnsetInstallDate ensures that no value is present for InstallDate, not even an explicit nil +func (o *Circuit) UnsetInstallDate() { + o.InstallDate.Unset() +} + +// GetTerminationDate returns the TerminationDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Circuit) GetTerminationDate() string { + if o == nil || IsNil(o.TerminationDate.Get()) { + var ret string + return ret + } + return *o.TerminationDate.Get() +} + +// GetTerminationDateOk returns a tuple with the TerminationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetTerminationDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TerminationDate.Get(), o.TerminationDate.IsSet() +} + +// HasTerminationDate returns a boolean if a field has been set. +func (o *Circuit) HasTerminationDate() bool { + if o != nil && o.TerminationDate.IsSet() { + return true + } + + return false +} + +// SetTerminationDate gets a reference to the given NullableString and assigns it to the TerminationDate field. +func (o *Circuit) SetTerminationDate(v string) { + o.TerminationDate.Set(&v) +} + +// SetTerminationDateNil sets the value for TerminationDate to be an explicit nil +func (o *Circuit) SetTerminationDateNil() { + o.TerminationDate.Set(nil) +} + +// UnsetTerminationDate ensures that no value is present for TerminationDate, not even an explicit nil +func (o *Circuit) UnsetTerminationDate() { + o.TerminationDate.Unset() +} + +// GetCommitRate returns the CommitRate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Circuit) GetCommitRate() int32 { + if o == nil || IsNil(o.CommitRate.Get()) { + var ret int32 + return ret + } + return *o.CommitRate.Get() +} + +// GetCommitRateOk returns a tuple with the CommitRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetCommitRateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CommitRate.Get(), o.CommitRate.IsSet() +} + +// HasCommitRate returns a boolean if a field has been set. +func (o *Circuit) HasCommitRate() bool { + if o != nil && o.CommitRate.IsSet() { + return true + } + + return false +} + +// SetCommitRate gets a reference to the given NullableInt32 and assigns it to the CommitRate field. +func (o *Circuit) SetCommitRate(v int32) { + o.CommitRate.Set(&v) +} + +// SetCommitRateNil sets the value for CommitRate to be an explicit nil +func (o *Circuit) SetCommitRateNil() { + o.CommitRate.Set(nil) +} + +// UnsetCommitRate ensures that no value is present for CommitRate, not even an explicit nil +func (o *Circuit) UnsetCommitRate() { + o.CommitRate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Circuit) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Circuit) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Circuit) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Circuit) SetDescription(v string) { + o.Description = &v +} + +// GetTerminationA returns the TerminationA field value +// If the value is explicit nil, the zero value for CircuitCircuitTermination will be returned +func (o *Circuit) GetTerminationA() CircuitCircuitTermination { + if o == nil || o.TerminationA.Get() == nil { + var ret CircuitCircuitTermination + return ret + } + + return *o.TerminationA.Get() +} + +// GetTerminationAOk returns a tuple with the TerminationA field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetTerminationAOk() (*CircuitCircuitTermination, bool) { + if o == nil { + return nil, false + } + return o.TerminationA.Get(), o.TerminationA.IsSet() +} + +// SetTerminationA sets field value +func (o *Circuit) SetTerminationA(v CircuitCircuitTermination) { + o.TerminationA.Set(&v) +} + +// GetTerminationZ returns the TerminationZ field value +// If the value is explicit nil, the zero value for CircuitCircuitTermination will be returned +func (o *Circuit) GetTerminationZ() CircuitCircuitTermination { + if o == nil || o.TerminationZ.Get() == nil { + var ret CircuitCircuitTermination + return ret + } + + return *o.TerminationZ.Get() +} + +// GetTerminationZOk returns a tuple with the TerminationZ field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetTerminationZOk() (*CircuitCircuitTermination, bool) { + if o == nil { + return nil, false + } + return o.TerminationZ.Get(), o.TerminationZ.IsSet() +} + +// SetTerminationZ sets field value +func (o *Circuit) SetTerminationZ(v CircuitCircuitTermination) { + o.TerminationZ.Set(&v) +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Circuit) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Circuit) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Circuit) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Circuit) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Circuit) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Circuit) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Circuit) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Circuit) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Circuit) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Circuit) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Circuit) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Circuit) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Circuit) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Circuit) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Circuit) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Circuit) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Circuit) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Circuit) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Circuit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["cid"] = o.Cid + toSerialize["provider"] = o.Provider + if o.ProviderAccount.IsSet() { + toSerialize["provider_account"] = o.ProviderAccount.Get() + } + toSerialize["type"] = o.Type + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.InstallDate.IsSet() { + toSerialize["install_date"] = o.InstallDate.Get() + } + if o.TerminationDate.IsSet() { + toSerialize["termination_date"] = o.TerminationDate.Get() + } + if o.CommitRate.IsSet() { + toSerialize["commit_rate"] = o.CommitRate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["termination_a"] = o.TerminationA.Get() + toSerialize["termination_z"] = o.TerminationZ.Get() + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Circuit) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "cid", + "provider", + "type", + "termination_a", + "termination_z", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuit := _Circuit{} + + err = json.Unmarshal(data, &varCircuit) + + if err != nil { + return err + } + + *o = Circuit(varCircuit) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "cid") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_account") + delete(additionalProperties, "type") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "install_date") + delete(additionalProperties, "termination_date") + delete(additionalProperties, "commit_rate") + delete(additionalProperties, "description") + delete(additionalProperties, "termination_a") + delete(additionalProperties, "termination_z") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuit struct { + value *Circuit + isSet bool +} + +func (v NullableCircuit) Get() *Circuit { + return v.value +} + +func (v *NullableCircuit) Set(val *Circuit) { + v.value = val + v.isSet = true +} + +func (v NullableCircuit) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuit(val *Circuit) *NullableCircuit { + return &NullableCircuit{value: val, isSet: true} +} + +func (v NullableCircuit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_circuit_termination.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_circuit_termination.go new file mode 100644 index 00000000..476362f7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_circuit_termination.go @@ -0,0 +1,459 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CircuitCircuitTermination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitCircuitTermination{} + +// CircuitCircuitTermination Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type CircuitCircuitTermination struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Site NullableNestedSite `json:"site"` + ProviderNetwork NullableNestedProviderNetwork `json:"provider_network"` + // Physical circuit speed + PortSpeed NullableInt32 `json:"port_speed,omitempty"` + // Upstream speed, if different from port speed + UpstreamSpeed NullableInt32 `json:"upstream_speed,omitempty"` + // ID of the local cross-connect + XconnectId *string `json:"xconnect_id,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CircuitCircuitTermination CircuitCircuitTermination + +// NewCircuitCircuitTermination instantiates a new CircuitCircuitTermination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitCircuitTermination(id int32, url string, display string, site NullableNestedSite, providerNetwork NullableNestedProviderNetwork) *CircuitCircuitTermination { + this := CircuitCircuitTermination{} + this.Id = id + this.Url = url + this.Display = display + this.Site = site + this.ProviderNetwork = providerNetwork + return &this +} + +// NewCircuitCircuitTerminationWithDefaults instantiates a new CircuitCircuitTermination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitCircuitTerminationWithDefaults() *CircuitCircuitTermination { + this := CircuitCircuitTermination{} + return &this +} + +// GetId returns the Id field value +func (o *CircuitCircuitTermination) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CircuitCircuitTermination) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CircuitCircuitTermination) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *CircuitCircuitTermination) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CircuitCircuitTermination) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *CircuitCircuitTermination) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *CircuitCircuitTermination) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *CircuitCircuitTermination) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *CircuitCircuitTermination) SetDisplay(v string) { + o.Display = v +} + +// GetSite returns the Site field value +// If the value is explicit nil, the zero value for NestedSite will be returned +func (o *CircuitCircuitTermination) GetSite() NestedSite { + if o == nil || o.Site.Get() == nil { + var ret NestedSite + return ret + } + + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTermination) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// SetSite sets field value +func (o *CircuitCircuitTermination) SetSite(v NestedSite) { + o.Site.Set(&v) +} + +// GetProviderNetwork returns the ProviderNetwork field value +// If the value is explicit nil, the zero value for NestedProviderNetwork will be returned +func (o *CircuitCircuitTermination) GetProviderNetwork() NestedProviderNetwork { + if o == nil || o.ProviderNetwork.Get() == nil { + var ret NestedProviderNetwork + return ret + } + + return *o.ProviderNetwork.Get() +} + +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTermination) GetProviderNetworkOk() (*NestedProviderNetwork, bool) { + if o == nil { + return nil, false + } + return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() +} + +// SetProviderNetwork sets field value +func (o *CircuitCircuitTermination) SetProviderNetwork(v NestedProviderNetwork) { + o.ProviderNetwork.Set(&v) +} + +// GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitCircuitTermination) GetPortSpeed() int32 { + if o == nil || IsNil(o.PortSpeed.Get()) { + var ret int32 + return ret + } + return *o.PortSpeed.Get() +} + +// GetPortSpeedOk returns a tuple with the PortSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTermination) GetPortSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PortSpeed.Get(), o.PortSpeed.IsSet() +} + +// HasPortSpeed returns a boolean if a field has been set. +func (o *CircuitCircuitTermination) HasPortSpeed() bool { + if o != nil && o.PortSpeed.IsSet() { + return true + } + + return false +} + +// SetPortSpeed gets a reference to the given NullableInt32 and assigns it to the PortSpeed field. +func (o *CircuitCircuitTermination) SetPortSpeed(v int32) { + o.PortSpeed.Set(&v) +} + +// SetPortSpeedNil sets the value for PortSpeed to be an explicit nil +func (o *CircuitCircuitTermination) SetPortSpeedNil() { + o.PortSpeed.Set(nil) +} + +// UnsetPortSpeed ensures that no value is present for PortSpeed, not even an explicit nil +func (o *CircuitCircuitTermination) UnsetPortSpeed() { + o.PortSpeed.Unset() +} + +// GetUpstreamSpeed returns the UpstreamSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitCircuitTermination) GetUpstreamSpeed() int32 { + if o == nil || IsNil(o.UpstreamSpeed.Get()) { + var ret int32 + return ret + } + return *o.UpstreamSpeed.Get() +} + +// GetUpstreamSpeedOk returns a tuple with the UpstreamSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTermination) GetUpstreamSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UpstreamSpeed.Get(), o.UpstreamSpeed.IsSet() +} + +// HasUpstreamSpeed returns a boolean if a field has been set. +func (o *CircuitCircuitTermination) HasUpstreamSpeed() bool { + if o != nil && o.UpstreamSpeed.IsSet() { + return true + } + + return false +} + +// SetUpstreamSpeed gets a reference to the given NullableInt32 and assigns it to the UpstreamSpeed field. +func (o *CircuitCircuitTermination) SetUpstreamSpeed(v int32) { + o.UpstreamSpeed.Set(&v) +} + +// SetUpstreamSpeedNil sets the value for UpstreamSpeed to be an explicit nil +func (o *CircuitCircuitTermination) SetUpstreamSpeedNil() { + o.UpstreamSpeed.Set(nil) +} + +// UnsetUpstreamSpeed ensures that no value is present for UpstreamSpeed, not even an explicit nil +func (o *CircuitCircuitTermination) UnsetUpstreamSpeed() { + o.UpstreamSpeed.Unset() +} + +// GetXconnectId returns the XconnectId field value if set, zero value otherwise. +func (o *CircuitCircuitTermination) GetXconnectId() string { + if o == nil || IsNil(o.XconnectId) { + var ret string + return ret + } + return *o.XconnectId +} + +// GetXconnectIdOk returns a tuple with the XconnectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitCircuitTermination) GetXconnectIdOk() (*string, bool) { + if o == nil || IsNil(o.XconnectId) { + return nil, false + } + return o.XconnectId, true +} + +// HasXconnectId returns a boolean if a field has been set. +func (o *CircuitCircuitTermination) HasXconnectId() bool { + if o != nil && !IsNil(o.XconnectId) { + return true + } + + return false +} + +// SetXconnectId gets a reference to the given string and assigns it to the XconnectId field. +func (o *CircuitCircuitTermination) SetXconnectId(v string) { + o.XconnectId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CircuitCircuitTermination) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitCircuitTermination) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CircuitCircuitTermination) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CircuitCircuitTermination) SetDescription(v string) { + o.Description = &v +} + +func (o CircuitCircuitTermination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitCircuitTermination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["site"] = o.Site.Get() + toSerialize["provider_network"] = o.ProviderNetwork.Get() + if o.PortSpeed.IsSet() { + toSerialize["port_speed"] = o.PortSpeed.Get() + } + if o.UpstreamSpeed.IsSet() { + toSerialize["upstream_speed"] = o.UpstreamSpeed.Get() + } + if !IsNil(o.XconnectId) { + toSerialize["xconnect_id"] = o.XconnectId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitCircuitTermination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "site", + "provider_network", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuitCircuitTermination := _CircuitCircuitTermination{} + + err = json.Unmarshal(data, &varCircuitCircuitTermination) + + if err != nil { + return err + } + + *o = CircuitCircuitTermination(varCircuitCircuitTermination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "site") + delete(additionalProperties, "provider_network") + delete(additionalProperties, "port_speed") + delete(additionalProperties, "upstream_speed") + delete(additionalProperties, "xconnect_id") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitCircuitTermination struct { + value *CircuitCircuitTermination + isSet bool +} + +func (v NullableCircuitCircuitTermination) Get() *CircuitCircuitTermination { + return v.value +} + +func (v *NullableCircuitCircuitTermination) Set(val *CircuitCircuitTermination) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitCircuitTermination) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitCircuitTermination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitCircuitTermination(val *CircuitCircuitTermination) *NullableCircuitCircuitTermination { + return &NullableCircuitCircuitTermination{value: val, isSet: true} +} + +func (v NullableCircuitCircuitTermination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitCircuitTermination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_circuit_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_circuit_termination_request.go new file mode 100644 index 00000000..a6595d1d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_circuit_termination_request.go @@ -0,0 +1,372 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CircuitCircuitTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitCircuitTerminationRequest{} + +// CircuitCircuitTerminationRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type CircuitCircuitTerminationRequest struct { + Site NullableNestedSiteRequest `json:"site"` + ProviderNetwork NullableNestedProviderNetworkRequest `json:"provider_network"` + // Physical circuit speed + PortSpeed NullableInt32 `json:"port_speed,omitempty"` + // Upstream speed, if different from port speed + UpstreamSpeed NullableInt32 `json:"upstream_speed,omitempty"` + // ID of the local cross-connect + XconnectId *string `json:"xconnect_id,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CircuitCircuitTerminationRequest CircuitCircuitTerminationRequest + +// NewCircuitCircuitTerminationRequest instantiates a new CircuitCircuitTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitCircuitTerminationRequest(site NullableNestedSiteRequest, providerNetwork NullableNestedProviderNetworkRequest) *CircuitCircuitTerminationRequest { + this := CircuitCircuitTerminationRequest{} + this.Site = site + this.ProviderNetwork = providerNetwork + return &this +} + +// NewCircuitCircuitTerminationRequestWithDefaults instantiates a new CircuitCircuitTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitCircuitTerminationRequestWithDefaults() *CircuitCircuitTerminationRequest { + this := CircuitCircuitTerminationRequest{} + return &this +} + +// GetSite returns the Site field value +// If the value is explicit nil, the zero value for NestedSiteRequest will be returned +func (o *CircuitCircuitTerminationRequest) GetSite() NestedSiteRequest { + if o == nil || o.Site.Get() == nil { + var ret NestedSiteRequest + return ret + } + + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTerminationRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// SetSite sets field value +func (o *CircuitCircuitTerminationRequest) SetSite(v NestedSiteRequest) { + o.Site.Set(&v) +} + +// GetProviderNetwork returns the ProviderNetwork field value +// If the value is explicit nil, the zero value for NestedProviderNetworkRequest will be returned +func (o *CircuitCircuitTerminationRequest) GetProviderNetwork() NestedProviderNetworkRequest { + if o == nil || o.ProviderNetwork.Get() == nil { + var ret NestedProviderNetworkRequest + return ret + } + + return *o.ProviderNetwork.Get() +} + +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTerminationRequest) GetProviderNetworkOk() (*NestedProviderNetworkRequest, bool) { + if o == nil { + return nil, false + } + return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() +} + +// SetProviderNetwork sets field value +func (o *CircuitCircuitTerminationRequest) SetProviderNetwork(v NestedProviderNetworkRequest) { + o.ProviderNetwork.Set(&v) +} + +// GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitCircuitTerminationRequest) GetPortSpeed() int32 { + if o == nil || IsNil(o.PortSpeed.Get()) { + var ret int32 + return ret + } + return *o.PortSpeed.Get() +} + +// GetPortSpeedOk returns a tuple with the PortSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTerminationRequest) GetPortSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PortSpeed.Get(), o.PortSpeed.IsSet() +} + +// HasPortSpeed returns a boolean if a field has been set. +func (o *CircuitCircuitTerminationRequest) HasPortSpeed() bool { + if o != nil && o.PortSpeed.IsSet() { + return true + } + + return false +} + +// SetPortSpeed gets a reference to the given NullableInt32 and assigns it to the PortSpeed field. +func (o *CircuitCircuitTerminationRequest) SetPortSpeed(v int32) { + o.PortSpeed.Set(&v) +} + +// SetPortSpeedNil sets the value for PortSpeed to be an explicit nil +func (o *CircuitCircuitTerminationRequest) SetPortSpeedNil() { + o.PortSpeed.Set(nil) +} + +// UnsetPortSpeed ensures that no value is present for PortSpeed, not even an explicit nil +func (o *CircuitCircuitTerminationRequest) UnsetPortSpeed() { + o.PortSpeed.Unset() +} + +// GetUpstreamSpeed returns the UpstreamSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitCircuitTerminationRequest) GetUpstreamSpeed() int32 { + if o == nil || IsNil(o.UpstreamSpeed.Get()) { + var ret int32 + return ret + } + return *o.UpstreamSpeed.Get() +} + +// GetUpstreamSpeedOk returns a tuple with the UpstreamSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitCircuitTerminationRequest) GetUpstreamSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UpstreamSpeed.Get(), o.UpstreamSpeed.IsSet() +} + +// HasUpstreamSpeed returns a boolean if a field has been set. +func (o *CircuitCircuitTerminationRequest) HasUpstreamSpeed() bool { + if o != nil && o.UpstreamSpeed.IsSet() { + return true + } + + return false +} + +// SetUpstreamSpeed gets a reference to the given NullableInt32 and assigns it to the UpstreamSpeed field. +func (o *CircuitCircuitTerminationRequest) SetUpstreamSpeed(v int32) { + o.UpstreamSpeed.Set(&v) +} + +// SetUpstreamSpeedNil sets the value for UpstreamSpeed to be an explicit nil +func (o *CircuitCircuitTerminationRequest) SetUpstreamSpeedNil() { + o.UpstreamSpeed.Set(nil) +} + +// UnsetUpstreamSpeed ensures that no value is present for UpstreamSpeed, not even an explicit nil +func (o *CircuitCircuitTerminationRequest) UnsetUpstreamSpeed() { + o.UpstreamSpeed.Unset() +} + +// GetXconnectId returns the XconnectId field value if set, zero value otherwise. +func (o *CircuitCircuitTerminationRequest) GetXconnectId() string { + if o == nil || IsNil(o.XconnectId) { + var ret string + return ret + } + return *o.XconnectId +} + +// GetXconnectIdOk returns a tuple with the XconnectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitCircuitTerminationRequest) GetXconnectIdOk() (*string, bool) { + if o == nil || IsNil(o.XconnectId) { + return nil, false + } + return o.XconnectId, true +} + +// HasXconnectId returns a boolean if a field has been set. +func (o *CircuitCircuitTerminationRequest) HasXconnectId() bool { + if o != nil && !IsNil(o.XconnectId) { + return true + } + + return false +} + +// SetXconnectId gets a reference to the given string and assigns it to the XconnectId field. +func (o *CircuitCircuitTerminationRequest) SetXconnectId(v string) { + o.XconnectId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CircuitCircuitTerminationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitCircuitTerminationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CircuitCircuitTerminationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CircuitCircuitTerminationRequest) SetDescription(v string) { + o.Description = &v +} + +func (o CircuitCircuitTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitCircuitTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["site"] = o.Site.Get() + toSerialize["provider_network"] = o.ProviderNetwork.Get() + if o.PortSpeed.IsSet() { + toSerialize["port_speed"] = o.PortSpeed.Get() + } + if o.UpstreamSpeed.IsSet() { + toSerialize["upstream_speed"] = o.UpstreamSpeed.Get() + } + if !IsNil(o.XconnectId) { + toSerialize["xconnect_id"] = o.XconnectId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitCircuitTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "site", + "provider_network", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuitCircuitTerminationRequest := _CircuitCircuitTerminationRequest{} + + err = json.Unmarshal(data, &varCircuitCircuitTerminationRequest) + + if err != nil { + return err + } + + *o = CircuitCircuitTerminationRequest(varCircuitCircuitTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "site") + delete(additionalProperties, "provider_network") + delete(additionalProperties, "port_speed") + delete(additionalProperties, "upstream_speed") + delete(additionalProperties, "xconnect_id") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitCircuitTerminationRequest struct { + value *CircuitCircuitTerminationRequest + isSet bool +} + +func (v NullableCircuitCircuitTerminationRequest) Get() *CircuitCircuitTerminationRequest { + return v.value +} + +func (v *NullableCircuitCircuitTerminationRequest) Set(val *CircuitCircuitTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitCircuitTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitCircuitTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitCircuitTerminationRequest(val *CircuitCircuitTerminationRequest) *NullableCircuitCircuitTerminationRequest { + return &NullableCircuitCircuitTerminationRequest{value: val, isSet: true} +} + +func (v NullableCircuitCircuitTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitCircuitTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_request.go new file mode 100644 index 00000000..3b1a3260 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_request.go @@ -0,0 +1,651 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CircuitRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitRequest{} + +// CircuitRequest Adds support for custom fields and tags. +type CircuitRequest struct { + // Unique circuit ID + Cid string `json:"cid"` + Provider NestedProviderRequest `json:"provider"` + ProviderAccount NullableNestedProviderAccountRequest `json:"provider_account,omitempty"` + Type NestedCircuitTypeRequest `json:"type"` + Status *CircuitStatusValue `json:"status,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + InstallDate NullableString `json:"install_date,omitempty"` + TerminationDate NullableString `json:"termination_date,omitempty"` + // Committed rate + CommitRate NullableInt32 `json:"commit_rate,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CircuitRequest CircuitRequest + +// NewCircuitRequest instantiates a new CircuitRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitRequest(cid string, provider NestedProviderRequest, type_ NestedCircuitTypeRequest) *CircuitRequest { + this := CircuitRequest{} + this.Cid = cid + this.Provider = provider + this.Type = type_ + return &this +} + +// NewCircuitRequestWithDefaults instantiates a new CircuitRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitRequestWithDefaults() *CircuitRequest { + this := CircuitRequest{} + return &this +} + +// GetCid returns the Cid field value +func (o *CircuitRequest) GetCid() string { + if o == nil { + var ret string + return ret + } + + return o.Cid +} + +// GetCidOk returns a tuple with the Cid field value +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetCidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cid, true +} + +// SetCid sets field value +func (o *CircuitRequest) SetCid(v string) { + o.Cid = v +} + +// GetProvider returns the Provider field value +func (o *CircuitRequest) GetProvider() NestedProviderRequest { + if o == nil { + var ret NestedProviderRequest + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetProviderOk() (*NestedProviderRequest, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *CircuitRequest) SetProvider(v NestedProviderRequest) { + o.Provider = v +} + +// GetProviderAccount returns the ProviderAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitRequest) GetProviderAccount() NestedProviderAccountRequest { + if o == nil || IsNil(o.ProviderAccount.Get()) { + var ret NestedProviderAccountRequest + return ret + } + return *o.ProviderAccount.Get() +} + +// GetProviderAccountOk returns a tuple with the ProviderAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitRequest) GetProviderAccountOk() (*NestedProviderAccountRequest, bool) { + if o == nil { + return nil, false + } + return o.ProviderAccount.Get(), o.ProviderAccount.IsSet() +} + +// HasProviderAccount returns a boolean if a field has been set. +func (o *CircuitRequest) HasProviderAccount() bool { + if o != nil && o.ProviderAccount.IsSet() { + return true + } + + return false +} + +// SetProviderAccount gets a reference to the given NullableNestedProviderAccountRequest and assigns it to the ProviderAccount field. +func (o *CircuitRequest) SetProviderAccount(v NestedProviderAccountRequest) { + o.ProviderAccount.Set(&v) +} + +// SetProviderAccountNil sets the value for ProviderAccount to be an explicit nil +func (o *CircuitRequest) SetProviderAccountNil() { + o.ProviderAccount.Set(nil) +} + +// UnsetProviderAccount ensures that no value is present for ProviderAccount, not even an explicit nil +func (o *CircuitRequest) UnsetProviderAccount() { + o.ProviderAccount.Unset() +} + +// GetType returns the Type field value +func (o *CircuitRequest) GetType() NestedCircuitTypeRequest { + if o == nil { + var ret NestedCircuitTypeRequest + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetTypeOk() (*NestedCircuitTypeRequest, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CircuitRequest) SetType(v NestedCircuitTypeRequest) { + o.Type = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CircuitRequest) GetStatus() CircuitStatusValue { + if o == nil || IsNil(o.Status) { + var ret CircuitStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetStatusOk() (*CircuitStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CircuitRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CircuitStatusValue and assigns it to the Status field. +func (o *CircuitRequest) SetStatus(v CircuitStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *CircuitRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *CircuitRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *CircuitRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *CircuitRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetInstallDate returns the InstallDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitRequest) GetInstallDate() string { + if o == nil || IsNil(o.InstallDate.Get()) { + var ret string + return ret + } + return *o.InstallDate.Get() +} + +// GetInstallDateOk returns a tuple with the InstallDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitRequest) GetInstallDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.InstallDate.Get(), o.InstallDate.IsSet() +} + +// HasInstallDate returns a boolean if a field has been set. +func (o *CircuitRequest) HasInstallDate() bool { + if o != nil && o.InstallDate.IsSet() { + return true + } + + return false +} + +// SetInstallDate gets a reference to the given NullableString and assigns it to the InstallDate field. +func (o *CircuitRequest) SetInstallDate(v string) { + o.InstallDate.Set(&v) +} + +// SetInstallDateNil sets the value for InstallDate to be an explicit nil +func (o *CircuitRequest) SetInstallDateNil() { + o.InstallDate.Set(nil) +} + +// UnsetInstallDate ensures that no value is present for InstallDate, not even an explicit nil +func (o *CircuitRequest) UnsetInstallDate() { + o.InstallDate.Unset() +} + +// GetTerminationDate returns the TerminationDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitRequest) GetTerminationDate() string { + if o == nil || IsNil(o.TerminationDate.Get()) { + var ret string + return ret + } + return *o.TerminationDate.Get() +} + +// GetTerminationDateOk returns a tuple with the TerminationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitRequest) GetTerminationDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TerminationDate.Get(), o.TerminationDate.IsSet() +} + +// HasTerminationDate returns a boolean if a field has been set. +func (o *CircuitRequest) HasTerminationDate() bool { + if o != nil && o.TerminationDate.IsSet() { + return true + } + + return false +} + +// SetTerminationDate gets a reference to the given NullableString and assigns it to the TerminationDate field. +func (o *CircuitRequest) SetTerminationDate(v string) { + o.TerminationDate.Set(&v) +} + +// SetTerminationDateNil sets the value for TerminationDate to be an explicit nil +func (o *CircuitRequest) SetTerminationDateNil() { + o.TerminationDate.Set(nil) +} + +// UnsetTerminationDate ensures that no value is present for TerminationDate, not even an explicit nil +func (o *CircuitRequest) UnsetTerminationDate() { + o.TerminationDate.Unset() +} + +// GetCommitRate returns the CommitRate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitRequest) GetCommitRate() int32 { + if o == nil || IsNil(o.CommitRate.Get()) { + var ret int32 + return ret + } + return *o.CommitRate.Get() +} + +// GetCommitRateOk returns a tuple with the CommitRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitRequest) GetCommitRateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CommitRate.Get(), o.CommitRate.IsSet() +} + +// HasCommitRate returns a boolean if a field has been set. +func (o *CircuitRequest) HasCommitRate() bool { + if o != nil && o.CommitRate.IsSet() { + return true + } + + return false +} + +// SetCommitRate gets a reference to the given NullableInt32 and assigns it to the CommitRate field. +func (o *CircuitRequest) SetCommitRate(v int32) { + o.CommitRate.Set(&v) +} + +// SetCommitRateNil sets the value for CommitRate to be an explicit nil +func (o *CircuitRequest) SetCommitRateNil() { + o.CommitRate.Set(nil) +} + +// UnsetCommitRate ensures that no value is present for CommitRate, not even an explicit nil +func (o *CircuitRequest) UnsetCommitRate() { + o.CommitRate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CircuitRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CircuitRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CircuitRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *CircuitRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *CircuitRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *CircuitRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CircuitRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CircuitRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *CircuitRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *CircuitRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *CircuitRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *CircuitRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o CircuitRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cid"] = o.Cid + toSerialize["provider"] = o.Provider + if o.ProviderAccount.IsSet() { + toSerialize["provider_account"] = o.ProviderAccount.Get() + } + toSerialize["type"] = o.Type + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.InstallDate.IsSet() { + toSerialize["install_date"] = o.InstallDate.Get() + } + if o.TerminationDate.IsSet() { + toSerialize["termination_date"] = o.TerminationDate.Get() + } + if o.CommitRate.IsSet() { + toSerialize["commit_rate"] = o.CommitRate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cid", + "provider", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuitRequest := _CircuitRequest{} + + err = json.Unmarshal(data, &varCircuitRequest) + + if err != nil { + return err + } + + *o = CircuitRequest(varCircuitRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cid") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_account") + delete(additionalProperties, "type") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "install_date") + delete(additionalProperties, "termination_date") + delete(additionalProperties, "commit_rate") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitRequest struct { + value *CircuitRequest + isSet bool +} + +func (v NullableCircuitRequest) Get() *CircuitRequest { + return v.value +} + +func (v *NullableCircuitRequest) Set(val *CircuitRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitRequest(val *CircuitRequest) *NullableCircuitRequest { + return &NullableCircuitRequest{value: val, isSet: true} +} + +func (v NullableCircuitRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status.go new file mode 100644 index 00000000..d8150cdd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CircuitStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitStatus{} + +// CircuitStatus struct for CircuitStatus +type CircuitStatus struct { + Value *CircuitStatusValue `json:"value,omitempty"` + Label *CircuitStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CircuitStatus CircuitStatus + +// NewCircuitStatus instantiates a new CircuitStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitStatus() *CircuitStatus { + this := CircuitStatus{} + return &this +} + +// NewCircuitStatusWithDefaults instantiates a new CircuitStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitStatusWithDefaults() *CircuitStatus { + this := CircuitStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CircuitStatus) GetValue() CircuitStatusValue { + if o == nil || IsNil(o.Value) { + var ret CircuitStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitStatus) GetValueOk() (*CircuitStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CircuitStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CircuitStatusValue and assigns it to the Value field. +func (o *CircuitStatus) SetValue(v CircuitStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CircuitStatus) GetLabel() CircuitStatusLabel { + if o == nil || IsNil(o.Label) { + var ret CircuitStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitStatus) GetLabelOk() (*CircuitStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CircuitStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CircuitStatusLabel and assigns it to the Label field. +func (o *CircuitStatus) SetLabel(v CircuitStatusLabel) { + o.Label = &v +} + +func (o CircuitStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitStatus) UnmarshalJSON(data []byte) (err error) { + varCircuitStatus := _CircuitStatus{} + + err = json.Unmarshal(data, &varCircuitStatus) + + if err != nil { + return err + } + + *o = CircuitStatus(varCircuitStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitStatus struct { + value *CircuitStatus + isSet bool +} + +func (v NullableCircuitStatus) Get() *CircuitStatus { + return v.value +} + +func (v *NullableCircuitStatus) Set(val *CircuitStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitStatus(val *CircuitStatus) *NullableCircuitStatus { + return &NullableCircuitStatus{value: val, isSet: true} +} + +func (v NullableCircuitStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status_label.go new file mode 100644 index 00000000..6cf409a7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status_label.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CircuitStatusLabel the model 'CircuitStatusLabel' +type CircuitStatusLabel string + +// List of Circuit_status_label +const ( + CIRCUITSTATUSLABEL_PLANNED CircuitStatusLabel = "Planned" + CIRCUITSTATUSLABEL_PROVISIONING CircuitStatusLabel = "Provisioning" + CIRCUITSTATUSLABEL_ACTIVE CircuitStatusLabel = "Active" + CIRCUITSTATUSLABEL_OFFLINE CircuitStatusLabel = "Offline" + CIRCUITSTATUSLABEL_DEPROVISIONING CircuitStatusLabel = "Deprovisioning" + CIRCUITSTATUSLABEL_DECOMMISSIONED CircuitStatusLabel = "Decommissioned" +) + +// All allowed values of CircuitStatusLabel enum +var AllowedCircuitStatusLabelEnumValues = []CircuitStatusLabel{ + "Planned", + "Provisioning", + "Active", + "Offline", + "Deprovisioning", + "Decommissioned", +} + +func (v *CircuitStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CircuitStatusLabel(value) + for _, existing := range AllowedCircuitStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CircuitStatusLabel", value) +} + +// NewCircuitStatusLabelFromValue returns a pointer to a valid CircuitStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCircuitStatusLabelFromValue(v string) (*CircuitStatusLabel, error) { + ev := CircuitStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CircuitStatusLabel: valid values are %v", v, AllowedCircuitStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CircuitStatusLabel) IsValid() bool { + for _, existing := range AllowedCircuitStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Circuit_status_label value +func (v CircuitStatusLabel) Ptr() *CircuitStatusLabel { + return &v +} + +type NullableCircuitStatusLabel struct { + value *CircuitStatusLabel + isSet bool +} + +func (v NullableCircuitStatusLabel) Get() *CircuitStatusLabel { + return v.value +} + +func (v *NullableCircuitStatusLabel) Set(val *CircuitStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitStatusLabel(val *CircuitStatusLabel) *NullableCircuitStatusLabel { + return &NullableCircuitStatusLabel{value: val, isSet: true} +} + +func (v NullableCircuitStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status_value.go new file mode 100644 index 00000000..18de7138 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_status_value.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CircuitStatusValue * `planned` - Planned * `provisioning` - Provisioning * `active` - Active * `offline` - Offline * `deprovisioning` - Deprovisioning * `decommissioned` - Decommissioned +type CircuitStatusValue string + +// List of Circuit_status_value +const ( + CIRCUITSTATUSVALUE_PLANNED CircuitStatusValue = "planned" + CIRCUITSTATUSVALUE_PROVISIONING CircuitStatusValue = "provisioning" + CIRCUITSTATUSVALUE_ACTIVE CircuitStatusValue = "active" + CIRCUITSTATUSVALUE_OFFLINE CircuitStatusValue = "offline" + CIRCUITSTATUSVALUE_DEPROVISIONING CircuitStatusValue = "deprovisioning" + CIRCUITSTATUSVALUE_DECOMMISSIONED CircuitStatusValue = "decommissioned" +) + +// All allowed values of CircuitStatusValue enum +var AllowedCircuitStatusValueEnumValues = []CircuitStatusValue{ + "planned", + "provisioning", + "active", + "offline", + "deprovisioning", + "decommissioned", +} + +func (v *CircuitStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CircuitStatusValue(value) + for _, existing := range AllowedCircuitStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CircuitStatusValue", value) +} + +// NewCircuitStatusValueFromValue returns a pointer to a valid CircuitStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCircuitStatusValueFromValue(v string) (*CircuitStatusValue, error) { + ev := CircuitStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CircuitStatusValue: valid values are %v", v, AllowedCircuitStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CircuitStatusValue) IsValid() bool { + for _, existing := range AllowedCircuitStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Circuit_status_value value +func (v CircuitStatusValue) Ptr() *CircuitStatusValue { + return &v +} + +type NullableCircuitStatusValue struct { + value *CircuitStatusValue + isSet bool +} + +func (v NullableCircuitStatusValue) Get() *CircuitStatusValue { + return v.value +} + +func (v *NullableCircuitStatusValue) Set(val *CircuitStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitStatusValue(val *CircuitStatusValue) *NullableCircuitStatusValue { + return &NullableCircuitStatusValue{value: val, isSet: true} +} + +func (v NullableCircuitStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_termination.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_termination.go new file mode 100644 index 00000000..0b8de473 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_termination.go @@ -0,0 +1,912 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CircuitTermination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitTermination{} + +// CircuitTermination Adds support for custom fields and tags. +type CircuitTermination struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Circuit NestedCircuit `json:"circuit"` + TermSide Termination `json:"term_side"` + Site NullableNestedSite `json:"site,omitempty"` + ProviderNetwork NullableNestedProviderNetwork `json:"provider_network,omitempty"` + // Physical circuit speed + PortSpeed NullableInt32 `json:"port_speed,omitempty"` + // Upstream speed, if different from port speed + UpstreamSpeed NullableInt32 `json:"upstream_speed,omitempty"` + // ID of the local cross-connect + XconnectId *string `json:"xconnect_id,omitempty"` + // Patch panel ID and port number(s) + PpInfo *string `json:"pp_info,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _CircuitTermination CircuitTermination + +// NewCircuitTermination instantiates a new CircuitTermination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitTermination(id int32, url string, display string, circuit NestedCircuit, termSide Termination, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, created NullableTime, lastUpdated NullableTime, occupied bool) *CircuitTermination { + this := CircuitTermination{} + this.Id = id + this.Url = url + this.Display = display + this.Circuit = circuit + this.TermSide = termSide + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewCircuitTerminationWithDefaults instantiates a new CircuitTermination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitTerminationWithDefaults() *CircuitTermination { + this := CircuitTermination{} + return &this +} + +// GetId returns the Id field value +func (o *CircuitTermination) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CircuitTermination) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *CircuitTermination) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *CircuitTermination) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *CircuitTermination) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *CircuitTermination) SetDisplay(v string) { + o.Display = v +} + +// GetCircuit returns the Circuit field value +func (o *CircuitTermination) GetCircuit() NestedCircuit { + if o == nil { + var ret NestedCircuit + return ret + } + + return o.Circuit +} + +// GetCircuitOk returns a tuple with the Circuit field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetCircuitOk() (*NestedCircuit, bool) { + if o == nil { + return nil, false + } + return &o.Circuit, true +} + +// SetCircuit sets field value +func (o *CircuitTermination) SetCircuit(v NestedCircuit) { + o.Circuit = v +} + +// GetTermSide returns the TermSide field value +func (o *CircuitTermination) GetTermSide() Termination { + if o == nil { + var ret Termination + return ret + } + + return o.TermSide +} + +// GetTermSideOk returns a tuple with the TermSide field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetTermSideOk() (*Termination, bool) { + if o == nil { + return nil, false + } + return &o.TermSide, true +} + +// SetTermSide sets field value +func (o *CircuitTermination) SetTermSide(v Termination) { + o.TermSide = v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTermination) GetSite() NestedSite { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSite + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTermination) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *CircuitTermination) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSite and assigns it to the Site field. +func (o *CircuitTermination) SetSite(v NestedSite) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *CircuitTermination) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *CircuitTermination) UnsetSite() { + o.Site.Unset() +} + +// GetProviderNetwork returns the ProviderNetwork field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTermination) GetProviderNetwork() NestedProviderNetwork { + if o == nil || IsNil(o.ProviderNetwork.Get()) { + var ret NestedProviderNetwork + return ret + } + return *o.ProviderNetwork.Get() +} + +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTermination) GetProviderNetworkOk() (*NestedProviderNetwork, bool) { + if o == nil { + return nil, false + } + return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() +} + +// HasProviderNetwork returns a boolean if a field has been set. +func (o *CircuitTermination) HasProviderNetwork() bool { + if o != nil && o.ProviderNetwork.IsSet() { + return true + } + + return false +} + +// SetProviderNetwork gets a reference to the given NullableNestedProviderNetwork and assigns it to the ProviderNetwork field. +func (o *CircuitTermination) SetProviderNetwork(v NestedProviderNetwork) { + o.ProviderNetwork.Set(&v) +} + +// SetProviderNetworkNil sets the value for ProviderNetwork to be an explicit nil +func (o *CircuitTermination) SetProviderNetworkNil() { + o.ProviderNetwork.Set(nil) +} + +// UnsetProviderNetwork ensures that no value is present for ProviderNetwork, not even an explicit nil +func (o *CircuitTermination) UnsetProviderNetwork() { + o.ProviderNetwork.Unset() +} + +// GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTermination) GetPortSpeed() int32 { + if o == nil || IsNil(o.PortSpeed.Get()) { + var ret int32 + return ret + } + return *o.PortSpeed.Get() +} + +// GetPortSpeedOk returns a tuple with the PortSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTermination) GetPortSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PortSpeed.Get(), o.PortSpeed.IsSet() +} + +// HasPortSpeed returns a boolean if a field has been set. +func (o *CircuitTermination) HasPortSpeed() bool { + if o != nil && o.PortSpeed.IsSet() { + return true + } + + return false +} + +// SetPortSpeed gets a reference to the given NullableInt32 and assigns it to the PortSpeed field. +func (o *CircuitTermination) SetPortSpeed(v int32) { + o.PortSpeed.Set(&v) +} + +// SetPortSpeedNil sets the value for PortSpeed to be an explicit nil +func (o *CircuitTermination) SetPortSpeedNil() { + o.PortSpeed.Set(nil) +} + +// UnsetPortSpeed ensures that no value is present for PortSpeed, not even an explicit nil +func (o *CircuitTermination) UnsetPortSpeed() { + o.PortSpeed.Unset() +} + +// GetUpstreamSpeed returns the UpstreamSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTermination) GetUpstreamSpeed() int32 { + if o == nil || IsNil(o.UpstreamSpeed.Get()) { + var ret int32 + return ret + } + return *o.UpstreamSpeed.Get() +} + +// GetUpstreamSpeedOk returns a tuple with the UpstreamSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTermination) GetUpstreamSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UpstreamSpeed.Get(), o.UpstreamSpeed.IsSet() +} + +// HasUpstreamSpeed returns a boolean if a field has been set. +func (o *CircuitTermination) HasUpstreamSpeed() bool { + if o != nil && o.UpstreamSpeed.IsSet() { + return true + } + + return false +} + +// SetUpstreamSpeed gets a reference to the given NullableInt32 and assigns it to the UpstreamSpeed field. +func (o *CircuitTermination) SetUpstreamSpeed(v int32) { + o.UpstreamSpeed.Set(&v) +} + +// SetUpstreamSpeedNil sets the value for UpstreamSpeed to be an explicit nil +func (o *CircuitTermination) SetUpstreamSpeedNil() { + o.UpstreamSpeed.Set(nil) +} + +// UnsetUpstreamSpeed ensures that no value is present for UpstreamSpeed, not even an explicit nil +func (o *CircuitTermination) UnsetUpstreamSpeed() { + o.UpstreamSpeed.Unset() +} + +// GetXconnectId returns the XconnectId field value if set, zero value otherwise. +func (o *CircuitTermination) GetXconnectId() string { + if o == nil || IsNil(o.XconnectId) { + var ret string + return ret + } + return *o.XconnectId +} + +// GetXconnectIdOk returns a tuple with the XconnectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetXconnectIdOk() (*string, bool) { + if o == nil || IsNil(o.XconnectId) { + return nil, false + } + return o.XconnectId, true +} + +// HasXconnectId returns a boolean if a field has been set. +func (o *CircuitTermination) HasXconnectId() bool { + if o != nil && !IsNil(o.XconnectId) { + return true + } + + return false +} + +// SetXconnectId gets a reference to the given string and assigns it to the XconnectId field. +func (o *CircuitTermination) SetXconnectId(v string) { + o.XconnectId = &v +} + +// GetPpInfo returns the PpInfo field value if set, zero value otherwise. +func (o *CircuitTermination) GetPpInfo() string { + if o == nil || IsNil(o.PpInfo) { + var ret string + return ret + } + return *o.PpInfo +} + +// GetPpInfoOk returns a tuple with the PpInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetPpInfoOk() (*string, bool) { + if o == nil || IsNil(o.PpInfo) { + return nil, false + } + return o.PpInfo, true +} + +// HasPpInfo returns a boolean if a field has been set. +func (o *CircuitTermination) HasPpInfo() bool { + if o != nil && !IsNil(o.PpInfo) { + return true + } + + return false +} + +// SetPpInfo gets a reference to the given string and assigns it to the PpInfo field. +func (o *CircuitTermination) SetPpInfo(v string) { + o.PpInfo = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CircuitTermination) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CircuitTermination) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CircuitTermination) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *CircuitTermination) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *CircuitTermination) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *CircuitTermination) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *CircuitTermination) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTermination) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *CircuitTermination) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *CircuitTermination) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *CircuitTermination) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *CircuitTermination) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *CircuitTermination) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *CircuitTermination) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *CircuitTermination) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CircuitTermination) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CircuitTermination) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *CircuitTermination) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *CircuitTermination) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *CircuitTermination) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *CircuitTermination) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CircuitTermination) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTermination) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *CircuitTermination) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CircuitTermination) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTermination) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *CircuitTermination) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *CircuitTermination) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *CircuitTermination) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *CircuitTermination) SetOccupied(v bool) { + o.Occupied = v +} + +func (o CircuitTermination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitTermination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["circuit"] = o.Circuit + toSerialize["term_side"] = o.TermSide + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.ProviderNetwork.IsSet() { + toSerialize["provider_network"] = o.ProviderNetwork.Get() + } + if o.PortSpeed.IsSet() { + toSerialize["port_speed"] = o.PortSpeed.Get() + } + if o.UpstreamSpeed.IsSet() { + toSerialize["upstream_speed"] = o.UpstreamSpeed.Get() + } + if !IsNil(o.XconnectId) { + toSerialize["xconnect_id"] = o.XconnectId + } + if !IsNil(o.PpInfo) { + toSerialize["pp_info"] = o.PpInfo + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitTermination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "circuit", + "term_side", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuitTermination := _CircuitTermination{} + + err = json.Unmarshal(data, &varCircuitTermination) + + if err != nil { + return err + } + + *o = CircuitTermination(varCircuitTermination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "circuit") + delete(additionalProperties, "term_side") + delete(additionalProperties, "site") + delete(additionalProperties, "provider_network") + delete(additionalProperties, "port_speed") + delete(additionalProperties, "upstream_speed") + delete(additionalProperties, "xconnect_id") + delete(additionalProperties, "pp_info") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitTermination struct { + value *CircuitTermination + isSet bool +} + +func (v NullableCircuitTermination) Get() *CircuitTermination { + return v.value +} + +func (v *NullableCircuitTermination) Set(val *CircuitTermination) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitTermination) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitTermination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitTermination(val *CircuitTermination) *NullableCircuitTermination { + return &NullableCircuitTermination{value: val, isSet: true} +} + +func (v NullableCircuitTermination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitTermination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_termination_request.go new file mode 100644 index 00000000..e03e1e45 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_termination_request.go @@ -0,0 +1,614 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CircuitTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitTerminationRequest{} + +// CircuitTerminationRequest Adds support for custom fields and tags. +type CircuitTerminationRequest struct { + Circuit NestedCircuitRequest `json:"circuit"` + TermSide Termination `json:"term_side"` + Site NullableNestedSiteRequest `json:"site,omitempty"` + ProviderNetwork NullableNestedProviderNetworkRequest `json:"provider_network,omitempty"` + // Physical circuit speed + PortSpeed NullableInt32 `json:"port_speed,omitempty"` + // Upstream speed, if different from port speed + UpstreamSpeed NullableInt32 `json:"upstream_speed,omitempty"` + // ID of the local cross-connect + XconnectId *string `json:"xconnect_id,omitempty"` + // Patch panel ID and port number(s) + PpInfo *string `json:"pp_info,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CircuitTerminationRequest CircuitTerminationRequest + +// NewCircuitTerminationRequest instantiates a new CircuitTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitTerminationRequest(circuit NestedCircuitRequest, termSide Termination) *CircuitTerminationRequest { + this := CircuitTerminationRequest{} + this.Circuit = circuit + this.TermSide = termSide + return &this +} + +// NewCircuitTerminationRequestWithDefaults instantiates a new CircuitTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitTerminationRequestWithDefaults() *CircuitTerminationRequest { + this := CircuitTerminationRequest{} + return &this +} + +// GetCircuit returns the Circuit field value +func (o *CircuitTerminationRequest) GetCircuit() NestedCircuitRequest { + if o == nil { + var ret NestedCircuitRequest + return ret + } + + return o.Circuit +} + +// GetCircuitOk returns a tuple with the Circuit field value +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetCircuitOk() (*NestedCircuitRequest, bool) { + if o == nil { + return nil, false + } + return &o.Circuit, true +} + +// SetCircuit sets field value +func (o *CircuitTerminationRequest) SetCircuit(v NestedCircuitRequest) { + o.Circuit = v +} + +// GetTermSide returns the TermSide field value +func (o *CircuitTerminationRequest) GetTermSide() Termination { + if o == nil { + var ret Termination + return ret + } + + return o.TermSide +} + +// GetTermSideOk returns a tuple with the TermSide field value +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetTermSideOk() (*Termination, bool) { + if o == nil { + return nil, false + } + return &o.TermSide, true +} + +// SetTermSide sets field value +func (o *CircuitTerminationRequest) SetTermSide(v Termination) { + o.TermSide = v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTerminationRequest) GetSite() NestedSiteRequest { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSiteRequest + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTerminationRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSiteRequest and assigns it to the Site field. +func (o *CircuitTerminationRequest) SetSite(v NestedSiteRequest) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *CircuitTerminationRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *CircuitTerminationRequest) UnsetSite() { + o.Site.Unset() +} + +// GetProviderNetwork returns the ProviderNetwork field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTerminationRequest) GetProviderNetwork() NestedProviderNetworkRequest { + if o == nil || IsNil(o.ProviderNetwork.Get()) { + var ret NestedProviderNetworkRequest + return ret + } + return *o.ProviderNetwork.Get() +} + +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTerminationRequest) GetProviderNetworkOk() (*NestedProviderNetworkRequest, bool) { + if o == nil { + return nil, false + } + return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() +} + +// HasProviderNetwork returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasProviderNetwork() bool { + if o != nil && o.ProviderNetwork.IsSet() { + return true + } + + return false +} + +// SetProviderNetwork gets a reference to the given NullableNestedProviderNetworkRequest and assigns it to the ProviderNetwork field. +func (o *CircuitTerminationRequest) SetProviderNetwork(v NestedProviderNetworkRequest) { + o.ProviderNetwork.Set(&v) +} + +// SetProviderNetworkNil sets the value for ProviderNetwork to be an explicit nil +func (o *CircuitTerminationRequest) SetProviderNetworkNil() { + o.ProviderNetwork.Set(nil) +} + +// UnsetProviderNetwork ensures that no value is present for ProviderNetwork, not even an explicit nil +func (o *CircuitTerminationRequest) UnsetProviderNetwork() { + o.ProviderNetwork.Unset() +} + +// GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTerminationRequest) GetPortSpeed() int32 { + if o == nil || IsNil(o.PortSpeed.Get()) { + var ret int32 + return ret + } + return *o.PortSpeed.Get() +} + +// GetPortSpeedOk returns a tuple with the PortSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTerminationRequest) GetPortSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PortSpeed.Get(), o.PortSpeed.IsSet() +} + +// HasPortSpeed returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasPortSpeed() bool { + if o != nil && o.PortSpeed.IsSet() { + return true + } + + return false +} + +// SetPortSpeed gets a reference to the given NullableInt32 and assigns it to the PortSpeed field. +func (o *CircuitTerminationRequest) SetPortSpeed(v int32) { + o.PortSpeed.Set(&v) +} + +// SetPortSpeedNil sets the value for PortSpeed to be an explicit nil +func (o *CircuitTerminationRequest) SetPortSpeedNil() { + o.PortSpeed.Set(nil) +} + +// UnsetPortSpeed ensures that no value is present for PortSpeed, not even an explicit nil +func (o *CircuitTerminationRequest) UnsetPortSpeed() { + o.PortSpeed.Unset() +} + +// GetUpstreamSpeed returns the UpstreamSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CircuitTerminationRequest) GetUpstreamSpeed() int32 { + if o == nil || IsNil(o.UpstreamSpeed.Get()) { + var ret int32 + return ret + } + return *o.UpstreamSpeed.Get() +} + +// GetUpstreamSpeedOk returns a tuple with the UpstreamSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitTerminationRequest) GetUpstreamSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UpstreamSpeed.Get(), o.UpstreamSpeed.IsSet() +} + +// HasUpstreamSpeed returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasUpstreamSpeed() bool { + if o != nil && o.UpstreamSpeed.IsSet() { + return true + } + + return false +} + +// SetUpstreamSpeed gets a reference to the given NullableInt32 and assigns it to the UpstreamSpeed field. +func (o *CircuitTerminationRequest) SetUpstreamSpeed(v int32) { + o.UpstreamSpeed.Set(&v) +} + +// SetUpstreamSpeedNil sets the value for UpstreamSpeed to be an explicit nil +func (o *CircuitTerminationRequest) SetUpstreamSpeedNil() { + o.UpstreamSpeed.Set(nil) +} + +// UnsetUpstreamSpeed ensures that no value is present for UpstreamSpeed, not even an explicit nil +func (o *CircuitTerminationRequest) UnsetUpstreamSpeed() { + o.UpstreamSpeed.Unset() +} + +// GetXconnectId returns the XconnectId field value if set, zero value otherwise. +func (o *CircuitTerminationRequest) GetXconnectId() string { + if o == nil || IsNil(o.XconnectId) { + var ret string + return ret + } + return *o.XconnectId +} + +// GetXconnectIdOk returns a tuple with the XconnectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetXconnectIdOk() (*string, bool) { + if o == nil || IsNil(o.XconnectId) { + return nil, false + } + return o.XconnectId, true +} + +// HasXconnectId returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasXconnectId() bool { + if o != nil && !IsNil(o.XconnectId) { + return true + } + + return false +} + +// SetXconnectId gets a reference to the given string and assigns it to the XconnectId field. +func (o *CircuitTerminationRequest) SetXconnectId(v string) { + o.XconnectId = &v +} + +// GetPpInfo returns the PpInfo field value if set, zero value otherwise. +func (o *CircuitTerminationRequest) GetPpInfo() string { + if o == nil || IsNil(o.PpInfo) { + var ret string + return ret + } + return *o.PpInfo +} + +// GetPpInfoOk returns a tuple with the PpInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetPpInfoOk() (*string, bool) { + if o == nil || IsNil(o.PpInfo) { + return nil, false + } + return o.PpInfo, true +} + +// HasPpInfo returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasPpInfo() bool { + if o != nil && !IsNil(o.PpInfo) { + return true + } + + return false +} + +// SetPpInfo gets a reference to the given string and assigns it to the PpInfo field. +func (o *CircuitTerminationRequest) SetPpInfo(v string) { + o.PpInfo = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CircuitTerminationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CircuitTerminationRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *CircuitTerminationRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *CircuitTerminationRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CircuitTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *CircuitTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *CircuitTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *CircuitTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *CircuitTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o CircuitTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["circuit"] = o.Circuit + toSerialize["term_side"] = o.TermSide + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.ProviderNetwork.IsSet() { + toSerialize["provider_network"] = o.ProviderNetwork.Get() + } + if o.PortSpeed.IsSet() { + toSerialize["port_speed"] = o.PortSpeed.Get() + } + if o.UpstreamSpeed.IsSet() { + toSerialize["upstream_speed"] = o.UpstreamSpeed.Get() + } + if !IsNil(o.XconnectId) { + toSerialize["xconnect_id"] = o.XconnectId + } + if !IsNil(o.PpInfo) { + toSerialize["pp_info"] = o.PpInfo + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "circuit", + "term_side", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuitTerminationRequest := _CircuitTerminationRequest{} + + err = json.Unmarshal(data, &varCircuitTerminationRequest) + + if err != nil { + return err + } + + *o = CircuitTerminationRequest(varCircuitTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "circuit") + delete(additionalProperties, "term_side") + delete(additionalProperties, "site") + delete(additionalProperties, "provider_network") + delete(additionalProperties, "port_speed") + delete(additionalProperties, "upstream_speed") + delete(additionalProperties, "xconnect_id") + delete(additionalProperties, "pp_info") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitTerminationRequest struct { + value *CircuitTerminationRequest + isSet bool +} + +func (v NullableCircuitTerminationRequest) Get() *CircuitTerminationRequest { + return v.value +} + +func (v *NullableCircuitTerminationRequest) Set(val *CircuitTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitTerminationRequest(val *CircuitTerminationRequest) *NullableCircuitTerminationRequest { + return &NullableCircuitTerminationRequest{value: val, isSet: true} +} + +func (v NullableCircuitTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_type.go new file mode 100644 index 00000000..a84188f9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_type.go @@ -0,0 +1,522 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CircuitType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitType{} + +// CircuitType Adds support for custom fields and tags. +type CircuitType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + CircuitCount int32 `json:"circuit_count"` + AdditionalProperties map[string]interface{} +} + +type _CircuitType CircuitType + +// NewCircuitType instantiates a new CircuitType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitType(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int32) *CircuitType { + this := CircuitType{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.CircuitCount = circuitCount + return &this +} + +// NewCircuitTypeWithDefaults instantiates a new CircuitType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitTypeWithDefaults() *CircuitType { + this := CircuitType{} + return &this +} + +// GetId returns the Id field value +func (o *CircuitType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CircuitType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CircuitType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *CircuitType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CircuitType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *CircuitType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *CircuitType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *CircuitType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *CircuitType) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *CircuitType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CircuitType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CircuitType) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *CircuitType) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *CircuitType) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *CircuitType) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *CircuitType) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitType) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *CircuitType) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *CircuitType) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CircuitType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CircuitType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CircuitType) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CircuitType) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitType) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CircuitType) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *CircuitType) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *CircuitType) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitType) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *CircuitType) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *CircuitType) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CircuitType) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitType) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *CircuitType) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CircuitType) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CircuitType) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *CircuitType) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetCircuitCount returns the CircuitCount field value +func (o *CircuitType) GetCircuitCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CircuitCount +} + +// GetCircuitCountOk returns a tuple with the CircuitCount field value +// and a boolean to check if the value has been set. +func (o *CircuitType) GetCircuitCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CircuitCount, true +} + +// SetCircuitCount sets field value +func (o *CircuitType) SetCircuitCount(v int32) { + o.CircuitCount = v +} + +func (o CircuitType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["circuit_count"] = o.CircuitCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "circuit_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuitType := _CircuitType{} + + err = json.Unmarshal(data, &varCircuitType) + + if err != nil { + return err + } + + *o = CircuitType(varCircuitType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "circuit_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitType struct { + value *CircuitType + isSet bool +} + +func (v NullableCircuitType) Get() *CircuitType { + return v.value +} + +func (v *NullableCircuitType) Set(val *CircuitType) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitType) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitType(val *CircuitType) *NullableCircuitType { + return &NullableCircuitType{value: val, isSet: true} +} + +func (v NullableCircuitType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_type_request.go new file mode 100644 index 00000000..0519abe5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_circuit_type_request.go @@ -0,0 +1,343 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CircuitTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CircuitTypeRequest{} + +// CircuitTypeRequest Adds support for custom fields and tags. +type CircuitTypeRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CircuitTypeRequest CircuitTypeRequest + +// NewCircuitTypeRequest instantiates a new CircuitTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCircuitTypeRequest(name string, slug string) *CircuitTypeRequest { + this := CircuitTypeRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewCircuitTypeRequestWithDefaults instantiates a new CircuitTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCircuitTypeRequestWithDefaults() *CircuitTypeRequest { + this := CircuitTypeRequest{} + return &this +} + +// GetName returns the Name field value +func (o *CircuitTypeRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CircuitTypeRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CircuitTypeRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *CircuitTypeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *CircuitTypeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *CircuitTypeRequest) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *CircuitTypeRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTypeRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *CircuitTypeRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *CircuitTypeRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CircuitTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CircuitTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CircuitTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CircuitTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CircuitTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *CircuitTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *CircuitTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CircuitTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *CircuitTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *CircuitTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o CircuitTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CircuitTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CircuitTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCircuitTypeRequest := _CircuitTypeRequest{} + + err = json.Unmarshal(data, &varCircuitTypeRequest) + + if err != nil { + return err + } + + *o = CircuitTypeRequest(varCircuitTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCircuitTypeRequest struct { + value *CircuitTypeRequest + isSet bool +} + +func (v NullableCircuitTypeRequest) Get() *CircuitTypeRequest { + return v.value +} + +func (v *NullableCircuitTypeRequest) Set(val *CircuitTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCircuitTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCircuitTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCircuitTypeRequest(val *CircuitTypeRequest) *NullableCircuitTypeRequest { + return &NullableCircuitTypeRequest{value: val, isSet: true} +} + +func (v NullableCircuitTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCircuitTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster.go new file mode 100644 index 00000000..36a51099 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster.go @@ -0,0 +1,732 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Cluster type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Cluster{} + +// Cluster Adds support for custom fields and tags. +type Cluster struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Type NestedClusterType `json:"type"` + Group NullableNestedClusterGroup `json:"group,omitempty"` + Status *ClusterStatus `json:"status,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Site NullableNestedSite `json:"site,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + DeviceCount int32 `json:"device_count"` + VirtualmachineCount int32 `json:"virtualmachine_count"` + AdditionalProperties map[string]interface{} +} + +type _Cluster Cluster + +// NewCluster instantiates a new Cluster object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCluster(id int32, url string, display string, name string, type_ NestedClusterType, created NullableTime, lastUpdated NullableTime, deviceCount int32, virtualmachineCount int32) *Cluster { + this := Cluster{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Type = type_ + this.Created = created + this.LastUpdated = lastUpdated + this.DeviceCount = deviceCount + this.VirtualmachineCount = virtualmachineCount + return &this +} + +// NewClusterWithDefaults instantiates a new Cluster object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterWithDefaults() *Cluster { + this := Cluster{} + return &this +} + +// GetId returns the Id field value +func (o *Cluster) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Cluster) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Cluster) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Cluster) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Cluster) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Cluster) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Cluster) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Cluster) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *Cluster) GetType() NestedClusterType { + if o == nil { + var ret NestedClusterType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetTypeOk() (*NestedClusterType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Cluster) SetType(v NestedClusterType) { + o.Type = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cluster) GetGroup() NestedClusterGroup { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedClusterGroup + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetGroupOk() (*NestedClusterGroup, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *Cluster) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedClusterGroup and assigns it to the Group field. +func (o *Cluster) SetGroup(v NestedClusterGroup) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *Cluster) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *Cluster) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Cluster) GetStatus() ClusterStatus { + if o == nil || IsNil(o.Status) { + var ret ClusterStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cluster) GetStatusOk() (*ClusterStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Cluster) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ClusterStatus and assigns it to the Status field. +func (o *Cluster) SetStatus(v ClusterStatus) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cluster) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Cluster) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Cluster) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Cluster) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Cluster) UnsetTenant() { + o.Tenant.Unset() +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cluster) GetSite() NestedSite { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSite + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *Cluster) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSite and assigns it to the Site field. +func (o *Cluster) SetSite(v NestedSite) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *Cluster) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *Cluster) UnsetSite() { + o.Site.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Cluster) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cluster) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Cluster) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Cluster) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Cluster) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cluster) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Cluster) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Cluster) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Cluster) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cluster) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Cluster) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Cluster) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Cluster) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cluster) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Cluster) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Cluster) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Cluster) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Cluster) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Cluster) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Cluster) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDeviceCount returns the DeviceCount field value +func (o *Cluster) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *Cluster) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetVirtualmachineCount returns the VirtualmachineCount field value +func (o *Cluster) GetVirtualmachineCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualmachineCount +} + +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetVirtualmachineCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualmachineCount, true +} + +// SetVirtualmachineCount sets field value +func (o *Cluster) SetVirtualmachineCount(v int32) { + o.VirtualmachineCount = v +} + +func (o Cluster) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Cluster) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["device_count"] = o.DeviceCount + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Cluster) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "type", + "created", + "last_updated", + "device_count", + "virtualmachine_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCluster := _Cluster{} + + err = json.Unmarshal(data, &varCluster) + + if err != nil { + return err + } + + *o = Cluster(varCluster) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "site") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "device_count") + delete(additionalProperties, "virtualmachine_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCluster struct { + value *Cluster + isSet bool +} + +func (v NullableCluster) Get() *Cluster { + return v.value +} + +func (v *NullableCluster) Set(val *Cluster) { + v.value = val + v.isSet = true +} + +func (v NullableCluster) IsSet() bool { + return v.isSet +} + +func (v *NullableCluster) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCluster(val *Cluster) *NullableCluster { + return &NullableCluster{value: val, isSet: true} +} + +func (v NullableCluster) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCluster) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_group.go new file mode 100644 index 00000000..833c65fa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_group.go @@ -0,0 +1,485 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ClusterGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterGroup{} + +// ClusterGroup Adds support for custom fields and tags. +type ClusterGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + ClusterCount int32 `json:"cluster_count"` + AdditionalProperties map[string]interface{} +} + +type _ClusterGroup ClusterGroup + +// NewClusterGroup instantiates a new ClusterGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, clusterCount int32) *ClusterGroup { + this := ClusterGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.ClusterCount = clusterCount + return &this +} + +// NewClusterGroupWithDefaults instantiates a new ClusterGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterGroupWithDefaults() *ClusterGroup { + this := ClusterGroup{} + return &this +} + +// GetId returns the Id field value +func (o *ClusterGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ClusterGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ClusterGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ClusterGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ClusterGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ClusterGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ClusterGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ClusterGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ClusterGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ClusterGroup) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ClusterGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ClusterGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ClusterGroup) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ClusterGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ClusterGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ClusterGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ClusterGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ClusterGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ClusterGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ClusterGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ClusterGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ClusterGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ClusterGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetClusterCount returns the ClusterCount field value +func (o *ClusterGroup) GetClusterCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ClusterCount +} + +// GetClusterCountOk returns a tuple with the ClusterCount field value +// and a boolean to check if the value has been set. +func (o *ClusterGroup) GetClusterCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ClusterCount, true +} + +// SetClusterCount sets field value +func (o *ClusterGroup) SetClusterCount(v int32) { + o.ClusterCount = v +} + +func (o ClusterGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["cluster_count"] = o.ClusterCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "cluster_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterGroup := _ClusterGroup{} + + err = json.Unmarshal(data, &varClusterGroup) + + if err != nil { + return err + } + + *o = ClusterGroup(varClusterGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "cluster_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterGroup struct { + value *ClusterGroup + isSet bool +} + +func (v NullableClusterGroup) Get() *ClusterGroup { + return v.value +} + +func (v *NullableClusterGroup) Set(val *ClusterGroup) { + v.value = val + v.isSet = true +} + +func (v NullableClusterGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterGroup(val *ClusterGroup) *NullableClusterGroup { + return &NullableClusterGroup{value: val, isSet: true} +} + +func (v NullableClusterGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_group_request.go new file mode 100644 index 00000000..19d274ba --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_group_request.go @@ -0,0 +1,306 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClusterGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterGroupRequest{} + +// ClusterGroupRequest Adds support for custom fields and tags. +type ClusterGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ClusterGroupRequest ClusterGroupRequest + +// NewClusterGroupRequest instantiates a new ClusterGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterGroupRequest(name string, slug string) *ClusterGroupRequest { + this := ClusterGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewClusterGroupRequestWithDefaults instantiates a new ClusterGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterGroupRequestWithDefaults() *ClusterGroupRequest { + this := ClusterGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ClusterGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ClusterGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ClusterGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ClusterGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ClusterGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ClusterGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ClusterGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ClusterGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ClusterGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ClusterGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ClusterGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ClusterGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ClusterGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ClusterGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ClusterGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ClusterGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterGroupRequest := _ClusterGroupRequest{} + + err = json.Unmarshal(data, &varClusterGroupRequest) + + if err != nil { + return err + } + + *o = ClusterGroupRequest(varClusterGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterGroupRequest struct { + value *ClusterGroupRequest + isSet bool +} + +func (v NullableClusterGroupRequest) Get() *ClusterGroupRequest { + return v.value +} + +func (v *NullableClusterGroupRequest) Set(val *ClusterGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableClusterGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterGroupRequest(val *ClusterGroupRequest) *NullableClusterGroupRequest { + return &NullableClusterGroupRequest{value: val, isSet: true} +} + +func (v NullableClusterGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_request.go new file mode 100644 index 00000000..d6b8043d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_request.go @@ -0,0 +1,524 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClusterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterRequest{} + +// ClusterRequest Adds support for custom fields and tags. +type ClusterRequest struct { + Name string `json:"name"` + Type NestedClusterTypeRequest `json:"type"` + Group NullableNestedClusterGroupRequest `json:"group,omitempty"` + Status *ClusterStatusValue `json:"status,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Site NullableNestedSiteRequest `json:"site,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ClusterRequest ClusterRequest + +// NewClusterRequest instantiates a new ClusterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterRequest(name string, type_ NestedClusterTypeRequest) *ClusterRequest { + this := ClusterRequest{} + this.Name = name + this.Type = type_ + return &this +} + +// NewClusterRequestWithDefaults instantiates a new ClusterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterRequestWithDefaults() *ClusterRequest { + this := ClusterRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ClusterRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ClusterRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ClusterRequest) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *ClusterRequest) GetType() NestedClusterTypeRequest { + if o == nil { + var ret NestedClusterTypeRequest + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ClusterRequest) GetTypeOk() (*NestedClusterTypeRequest, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ClusterRequest) SetType(v NestedClusterTypeRequest) { + o.Type = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClusterRequest) GetGroup() NestedClusterGroupRequest { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedClusterGroupRequest + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterRequest) GetGroupOk() (*NestedClusterGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *ClusterRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedClusterGroupRequest and assigns it to the Group field. +func (o *ClusterRequest) SetGroup(v NestedClusterGroupRequest) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *ClusterRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *ClusterRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ClusterRequest) GetStatus() ClusterStatusValue { + if o == nil || IsNil(o.Status) { + var ret ClusterStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterRequest) GetStatusOk() (*ClusterStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ClusterRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ClusterStatusValue and assigns it to the Status field. +func (o *ClusterRequest) SetStatus(v ClusterStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClusterRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *ClusterRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *ClusterRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *ClusterRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *ClusterRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClusterRequest) GetSite() NestedSiteRequest { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSiteRequest + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *ClusterRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSiteRequest and assigns it to the Site field. +func (o *ClusterRequest) SetSite(v NestedSiteRequest) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *ClusterRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *ClusterRequest) UnsetSite() { + o.Site.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ClusterRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ClusterRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ClusterRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ClusterRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ClusterRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ClusterRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ClusterRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ClusterRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ClusterRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ClusterRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ClusterRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ClusterRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ClusterRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterRequest := _ClusterRequest{} + + err = json.Unmarshal(data, &varClusterRequest) + + if err != nil { + return err + } + + *o = ClusterRequest(varClusterRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "site") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterRequest struct { + value *ClusterRequest + isSet bool +} + +func (v NullableClusterRequest) Get() *ClusterRequest { + return v.value +} + +func (v *NullableClusterRequest) Set(val *ClusterRequest) { + v.value = val + v.isSet = true +} + +func (v NullableClusterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterRequest(val *ClusterRequest) *NullableClusterRequest { + return &NullableClusterRequest{value: val, isSet: true} +} + +func (v NullableClusterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status.go new file mode 100644 index 00000000..07bf21ab --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ClusterStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterStatus{} + +// ClusterStatus struct for ClusterStatus +type ClusterStatus struct { + Value *ClusterStatusValue `json:"value,omitempty"` + Label *ClusterStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ClusterStatus ClusterStatus + +// NewClusterStatus instantiates a new ClusterStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterStatus() *ClusterStatus { + this := ClusterStatus{} + return &this +} + +// NewClusterStatusWithDefaults instantiates a new ClusterStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterStatusWithDefaults() *ClusterStatus { + this := ClusterStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ClusterStatus) GetValue() ClusterStatusValue { + if o == nil || IsNil(o.Value) { + var ret ClusterStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterStatus) GetValueOk() (*ClusterStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ClusterStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given ClusterStatusValue and assigns it to the Value field. +func (o *ClusterStatus) SetValue(v ClusterStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ClusterStatus) GetLabel() ClusterStatusLabel { + if o == nil || IsNil(o.Label) { + var ret ClusterStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterStatus) GetLabelOk() (*ClusterStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ClusterStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given ClusterStatusLabel and assigns it to the Label field. +func (o *ClusterStatus) SetLabel(v ClusterStatusLabel) { + o.Label = &v +} + +func (o ClusterStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterStatus) UnmarshalJSON(data []byte) (err error) { + varClusterStatus := _ClusterStatus{} + + err = json.Unmarshal(data, &varClusterStatus) + + if err != nil { + return err + } + + *o = ClusterStatus(varClusterStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterStatus struct { + value *ClusterStatus + isSet bool +} + +func (v NullableClusterStatus) Get() *ClusterStatus { + return v.value +} + +func (v *NullableClusterStatus) Set(val *ClusterStatus) { + v.value = val + v.isSet = true +} + +func (v NullableClusterStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterStatus(val *ClusterStatus) *NullableClusterStatus { + return &NullableClusterStatus{value: val, isSet: true} +} + +func (v NullableClusterStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status_label.go new file mode 100644 index 00000000..a405ba05 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status_label.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ClusterStatusLabel the model 'ClusterStatusLabel' +type ClusterStatusLabel string + +// List of Cluster_status_label +const ( + CLUSTERSTATUSLABEL_PLANNED ClusterStatusLabel = "Planned" + CLUSTERSTATUSLABEL_STAGING ClusterStatusLabel = "Staging" + CLUSTERSTATUSLABEL_ACTIVE ClusterStatusLabel = "Active" + CLUSTERSTATUSLABEL_DECOMMISSIONING ClusterStatusLabel = "Decommissioning" + CLUSTERSTATUSLABEL_OFFLINE ClusterStatusLabel = "Offline" +) + +// All allowed values of ClusterStatusLabel enum +var AllowedClusterStatusLabelEnumValues = []ClusterStatusLabel{ + "Planned", + "Staging", + "Active", + "Decommissioning", + "Offline", +} + +func (v *ClusterStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ClusterStatusLabel(value) + for _, existing := range AllowedClusterStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ClusterStatusLabel", value) +} + +// NewClusterStatusLabelFromValue returns a pointer to a valid ClusterStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewClusterStatusLabelFromValue(v string) (*ClusterStatusLabel, error) { + ev := ClusterStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ClusterStatusLabel: valid values are %v", v, AllowedClusterStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ClusterStatusLabel) IsValid() bool { + for _, existing := range AllowedClusterStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Cluster_status_label value +func (v ClusterStatusLabel) Ptr() *ClusterStatusLabel { + return &v +} + +type NullableClusterStatusLabel struct { + value *ClusterStatusLabel + isSet bool +} + +func (v NullableClusterStatusLabel) Get() *ClusterStatusLabel { + return v.value +} + +func (v *NullableClusterStatusLabel) Set(val *ClusterStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableClusterStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterStatusLabel(val *ClusterStatusLabel) *NullableClusterStatusLabel { + return &NullableClusterStatusLabel{value: val, isSet: true} +} + +func (v NullableClusterStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status_value.go new file mode 100644 index 00000000..9d4c1f88 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_status_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ClusterStatusValue * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `offline` - Offline +type ClusterStatusValue string + +// List of Cluster_status_value +const ( + CLUSTERSTATUSVALUE_PLANNED ClusterStatusValue = "planned" + CLUSTERSTATUSVALUE_STAGING ClusterStatusValue = "staging" + CLUSTERSTATUSVALUE_ACTIVE ClusterStatusValue = "active" + CLUSTERSTATUSVALUE_DECOMMISSIONING ClusterStatusValue = "decommissioning" + CLUSTERSTATUSVALUE_OFFLINE ClusterStatusValue = "offline" +) + +// All allowed values of ClusterStatusValue enum +var AllowedClusterStatusValueEnumValues = []ClusterStatusValue{ + "planned", + "staging", + "active", + "decommissioning", + "offline", +} + +func (v *ClusterStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ClusterStatusValue(value) + for _, existing := range AllowedClusterStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ClusterStatusValue", value) +} + +// NewClusterStatusValueFromValue returns a pointer to a valid ClusterStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewClusterStatusValueFromValue(v string) (*ClusterStatusValue, error) { + ev := ClusterStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ClusterStatusValue: valid values are %v", v, AllowedClusterStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ClusterStatusValue) IsValid() bool { + for _, existing := range AllowedClusterStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Cluster_status_value value +func (v ClusterStatusValue) Ptr() *ClusterStatusValue { + return &v +} + +type NullableClusterStatusValue struct { + value *ClusterStatusValue + isSet bool +} + +func (v NullableClusterStatusValue) Get() *ClusterStatusValue { + return v.value +} + +func (v *NullableClusterStatusValue) Set(val *ClusterStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableClusterStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterStatusValue(val *ClusterStatusValue) *NullableClusterStatusValue { + return &NullableClusterStatusValue{value: val, isSet: true} +} + +func (v NullableClusterStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_type.go new file mode 100644 index 00000000..632fe275 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_type.go @@ -0,0 +1,485 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ClusterType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterType{} + +// ClusterType Adds support for custom fields and tags. +type ClusterType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + ClusterCount int32 `json:"cluster_count"` + AdditionalProperties map[string]interface{} +} + +type _ClusterType ClusterType + +// NewClusterType instantiates a new ClusterType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterType(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, clusterCount int32) *ClusterType { + this := ClusterType{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.ClusterCount = clusterCount + return &this +} + +// NewClusterTypeWithDefaults instantiates a new ClusterType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterTypeWithDefaults() *ClusterType { + this := ClusterType{} + return &this +} + +// GetId returns the Id field value +func (o *ClusterType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ClusterType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ClusterType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ClusterType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ClusterType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ClusterType) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ClusterType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ClusterType) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ClusterType) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ClusterType) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ClusterType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ClusterType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ClusterType) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ClusterType) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterType) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ClusterType) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ClusterType) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ClusterType) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterType) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ClusterType) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ClusterType) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ClusterType) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterType) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ClusterType) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ClusterType) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterType) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ClusterType) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetClusterCount returns the ClusterCount field value +func (o *ClusterType) GetClusterCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ClusterCount +} + +// GetClusterCountOk returns a tuple with the ClusterCount field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetClusterCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ClusterCount, true +} + +// SetClusterCount sets field value +func (o *ClusterType) SetClusterCount(v int32) { + o.ClusterCount = v +} + +func (o ClusterType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["cluster_count"] = o.ClusterCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "cluster_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterType := _ClusterType{} + + err = json.Unmarshal(data, &varClusterType) + + if err != nil { + return err + } + + *o = ClusterType(varClusterType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "cluster_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterType struct { + value *ClusterType + isSet bool +} + +func (v NullableClusterType) Get() *ClusterType { + return v.value +} + +func (v *NullableClusterType) Set(val *ClusterType) { + v.value = val + v.isSet = true +} + +func (v NullableClusterType) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterType(val *ClusterType) *NullableClusterType { + return &NullableClusterType{value: val, isSet: true} +} + +func (v NullableClusterType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_type_request.go new file mode 100644 index 00000000..986c07f0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_cluster_type_request.go @@ -0,0 +1,306 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClusterTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterTypeRequest{} + +// ClusterTypeRequest Adds support for custom fields and tags. +type ClusterTypeRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ClusterTypeRequest ClusterTypeRequest + +// NewClusterTypeRequest instantiates a new ClusterTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterTypeRequest(name string, slug string) *ClusterTypeRequest { + this := ClusterTypeRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewClusterTypeRequestWithDefaults instantiates a new ClusterTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterTypeRequestWithDefaults() *ClusterTypeRequest { + this := ClusterTypeRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ClusterTypeRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ClusterTypeRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ClusterTypeRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ClusterTypeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ClusterTypeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ClusterTypeRequest) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ClusterTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ClusterTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ClusterTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ClusterTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ClusterTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ClusterTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ClusterTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClusterTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ClusterTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ClusterTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ClusterTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterTypeRequest := _ClusterTypeRequest{} + + err = json.Unmarshal(data, &varClusterTypeRequest) + + if err != nil { + return err + } + + *o = ClusterTypeRequest(varClusterTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterTypeRequest struct { + value *ClusterTypeRequest + isSet bool +} + +func (v NullableClusterTypeRequest) Get() *ClusterTypeRequest { + return v.value +} + +func (v *NullableClusterTypeRequest) Set(val *ClusterTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableClusterTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterTypeRequest(val *ClusterTypeRequest) *NullableClusterTypeRequest { + return &NullableClusterTypeRequest{value: val, isSet: true} +} + +func (v NullableClusterTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_component_nested_module.go b/vendor/github.com/netbox-community/go-netbox/v3/model_component_nested_module.go new file mode 100644 index 00000000..aec2bd23 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_component_nested_module.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ComponentNestedModule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ComponentNestedModule{} + +// ComponentNestedModule Used by device component serializers. +type ComponentNestedModule struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device int32 `json:"device"` + ModuleBay ModuleNestedModuleBay `json:"module_bay"` + AdditionalProperties map[string]interface{} +} + +type _ComponentNestedModule ComponentNestedModule + +// NewComponentNestedModule instantiates a new ComponentNestedModule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComponentNestedModule(id int32, url string, display string, device int32, moduleBay ModuleNestedModuleBay) *ComponentNestedModule { + this := ComponentNestedModule{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.ModuleBay = moduleBay + return &this +} + +// NewComponentNestedModuleWithDefaults instantiates a new ComponentNestedModule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComponentNestedModuleWithDefaults() *ComponentNestedModule { + this := ComponentNestedModule{} + return &this +} + +// GetId returns the Id field value +func (o *ComponentNestedModule) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ComponentNestedModule) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ComponentNestedModule) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ComponentNestedModule) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ComponentNestedModule) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ComponentNestedModule) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ComponentNestedModule) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ComponentNestedModule) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ComponentNestedModule) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *ComponentNestedModule) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ComponentNestedModule) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ComponentNestedModule) SetDevice(v int32) { + o.Device = v +} + +// GetModuleBay returns the ModuleBay field value +func (o *ComponentNestedModule) GetModuleBay() ModuleNestedModuleBay { + if o == nil { + var ret ModuleNestedModuleBay + return ret + } + + return o.ModuleBay +} + +// GetModuleBayOk returns a tuple with the ModuleBay field value +// and a boolean to check if the value has been set. +func (o *ComponentNestedModule) GetModuleBayOk() (*ModuleNestedModuleBay, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBay, true +} + +// SetModuleBay sets field value +func (o *ComponentNestedModule) SetModuleBay(v ModuleNestedModuleBay) { + o.ModuleBay = v +} + +func (o ComponentNestedModule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ComponentNestedModule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + toSerialize["module_bay"] = o.ModuleBay + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ComponentNestedModule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "module_bay", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varComponentNestedModule := _ComponentNestedModule{} + + err = json.Unmarshal(data, &varComponentNestedModule) + + if err != nil { + return err + } + + *o = ComponentNestedModule(varComponentNestedModule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module_bay") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableComponentNestedModule struct { + value *ComponentNestedModule + isSet bool +} + +func (v NullableComponentNestedModule) Get() *ComponentNestedModule { + return v.value +} + +func (v *NullableComponentNestedModule) Set(val *ComponentNestedModule) { + v.value = val + v.isSet = true +} + +func (v NullableComponentNestedModule) IsSet() bool { + return v.isSet +} + +func (v *NullableComponentNestedModule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableComponentNestedModule(val *ComponentNestedModule) *NullableComponentNestedModule { + return &NullableComponentNestedModule{value: val, isSet: true} +} + +func (v NullableComponentNestedModule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableComponentNestedModule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_component_nested_module_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_component_nested_module_request.go new file mode 100644 index 00000000..5f366f8b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_component_nested_module_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ComponentNestedModuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ComponentNestedModuleRequest{} + +// ComponentNestedModuleRequest Used by device component serializers. +type ComponentNestedModuleRequest struct { + Device int32 `json:"device"` + AdditionalProperties map[string]interface{} +} + +type _ComponentNestedModuleRequest ComponentNestedModuleRequest + +// NewComponentNestedModuleRequest instantiates a new ComponentNestedModuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComponentNestedModuleRequest(device int32) *ComponentNestedModuleRequest { + this := ComponentNestedModuleRequest{} + this.Device = device + return &this +} + +// NewComponentNestedModuleRequestWithDefaults instantiates a new ComponentNestedModuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComponentNestedModuleRequestWithDefaults() *ComponentNestedModuleRequest { + this := ComponentNestedModuleRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *ComponentNestedModuleRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ComponentNestedModuleRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ComponentNestedModuleRequest) SetDevice(v int32) { + o.Device = v +} + +func (o ComponentNestedModuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ComponentNestedModuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ComponentNestedModuleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varComponentNestedModuleRequest := _ComponentNestedModuleRequest{} + + err = json.Unmarshal(data, &varComponentNestedModuleRequest) + + if err != nil { + return err + } + + *o = ComponentNestedModuleRequest(varComponentNestedModuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableComponentNestedModuleRequest struct { + value *ComponentNestedModuleRequest + isSet bool +} + +func (v NullableComponentNestedModuleRequest) Get() *ComponentNestedModuleRequest { + return v.value +} + +func (v *NullableComponentNestedModuleRequest) Set(val *ComponentNestedModuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableComponentNestedModuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableComponentNestedModuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableComponentNestedModuleRequest(val *ComponentNestedModuleRequest) *NullableComponentNestedModuleRequest { + return &NullableComponentNestedModuleRequest{value: val, isSet: true} +} + +func (v NullableComponentNestedModuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableComponentNestedModuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_config_context.go b/vendor/github.com/netbox-community/go-netbox/v3/model_config_context.go new file mode 100644 index 00000000..a5f7b36e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_config_context.go @@ -0,0 +1,1068 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ConfigContext type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigContext{} + +// ConfigContext Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ConfigContext struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Weight *int32 `json:"weight,omitempty"` + Description *string `json:"description,omitempty"` + IsActive *bool `json:"is_active,omitempty"` + Regions []int32 `json:"regions,omitempty"` + SiteGroups []int32 `json:"site_groups,omitempty"` + Sites []int32 `json:"sites,omitempty"` + Locations []int32 `json:"locations,omitempty"` + DeviceTypes []int32 `json:"device_types,omitempty"` + Roles []int32 `json:"roles,omitempty"` + Platforms []int32 `json:"platforms,omitempty"` + ClusterTypes []int32 `json:"cluster_types,omitempty"` + ClusterGroups []int32 `json:"cluster_groups,omitempty"` + Clusters []int32 `json:"clusters,omitempty"` + TenantGroups []int32 `json:"tenant_groups,omitempty"` + Tenants []int32 `json:"tenants,omitempty"` + Tags []string `json:"tags,omitempty"` + DataSource *NestedDataSource `json:"data_source,omitempty"` + // Path to remote file (relative to data source root) + DataPath string `json:"data_path"` + DataFile NestedDataFile `json:"data_file"` + DataSynced NullableTime `json:"data_synced"` + Data interface{} `json:"data"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ConfigContext ConfigContext + +// NewConfigContext instantiates a new ConfigContext object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfigContext(id int32, url string, display string, name string, dataPath string, dataFile NestedDataFile, dataSynced NullableTime, data interface{}, created NullableTime, lastUpdated NullableTime) *ConfigContext { + this := ConfigContext{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.DataPath = dataPath + this.DataFile = dataFile + this.DataSynced = dataSynced + this.Data = data + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewConfigContextWithDefaults instantiates a new ConfigContext object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfigContextWithDefaults() *ConfigContext { + this := ConfigContext{} + return &this +} + +// GetId returns the Id field value +func (o *ConfigContext) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConfigContext) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ConfigContext) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ConfigContext) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ConfigContext) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ConfigContext) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ConfigContext) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConfigContext) SetName(v string) { + o.Name = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *ConfigContext) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *ConfigContext) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *ConfigContext) SetWeight(v int32) { + o.Weight = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConfigContext) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConfigContext) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConfigContext) SetDescription(v string) { + o.Description = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *ConfigContext) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *ConfigContext) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *ConfigContext) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *ConfigContext) GetRegions() []int32 { + if o == nil || IsNil(o.Regions) { + var ret []int32 + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetRegionsOk() ([]int32, bool) { + if o == nil || IsNil(o.Regions) { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *ConfigContext) HasRegions() bool { + if o != nil && !IsNil(o.Regions) { + return true + } + + return false +} + +// SetRegions gets a reference to the given []int32 and assigns it to the Regions field. +func (o *ConfigContext) SetRegions(v []int32) { + o.Regions = v +} + +// GetSiteGroups returns the SiteGroups field value if set, zero value otherwise. +func (o *ConfigContext) GetSiteGroups() []int32 { + if o == nil || IsNil(o.SiteGroups) { + var ret []int32 + return ret + } + return o.SiteGroups +} + +// GetSiteGroupsOk returns a tuple with the SiteGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetSiteGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.SiteGroups) { + return nil, false + } + return o.SiteGroups, true +} + +// HasSiteGroups returns a boolean if a field has been set. +func (o *ConfigContext) HasSiteGroups() bool { + if o != nil && !IsNil(o.SiteGroups) { + return true + } + + return false +} + +// SetSiteGroups gets a reference to the given []int32 and assigns it to the SiteGroups field. +func (o *ConfigContext) SetSiteGroups(v []int32) { + o.SiteGroups = v +} + +// GetSites returns the Sites field value if set, zero value otherwise. +func (o *ConfigContext) GetSites() []int32 { + if o == nil || IsNil(o.Sites) { + var ret []int32 + return ret + } + return o.Sites +} + +// GetSitesOk returns a tuple with the Sites field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetSitesOk() ([]int32, bool) { + if o == nil || IsNil(o.Sites) { + return nil, false + } + return o.Sites, true +} + +// HasSites returns a boolean if a field has been set. +func (o *ConfigContext) HasSites() bool { + if o != nil && !IsNil(o.Sites) { + return true + } + + return false +} + +// SetSites gets a reference to the given []int32 and assigns it to the Sites field. +func (o *ConfigContext) SetSites(v []int32) { + o.Sites = v +} + +// GetLocations returns the Locations field value if set, zero value otherwise. +func (o *ConfigContext) GetLocations() []int32 { + if o == nil || IsNil(o.Locations) { + var ret []int32 + return ret + } + return o.Locations +} + +// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetLocationsOk() ([]int32, bool) { + if o == nil || IsNil(o.Locations) { + return nil, false + } + return o.Locations, true +} + +// HasLocations returns a boolean if a field has been set. +func (o *ConfigContext) HasLocations() bool { + if o != nil && !IsNil(o.Locations) { + return true + } + + return false +} + +// SetLocations gets a reference to the given []int32 and assigns it to the Locations field. +func (o *ConfigContext) SetLocations(v []int32) { + o.Locations = v +} + +// GetDeviceTypes returns the DeviceTypes field value if set, zero value otherwise. +func (o *ConfigContext) GetDeviceTypes() []int32 { + if o == nil || IsNil(o.DeviceTypes) { + var ret []int32 + return ret + } + return o.DeviceTypes +} + +// GetDeviceTypesOk returns a tuple with the DeviceTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetDeviceTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.DeviceTypes) { + return nil, false + } + return o.DeviceTypes, true +} + +// HasDeviceTypes returns a boolean if a field has been set. +func (o *ConfigContext) HasDeviceTypes() bool { + if o != nil && !IsNil(o.DeviceTypes) { + return true + } + + return false +} + +// SetDeviceTypes gets a reference to the given []int32 and assigns it to the DeviceTypes field. +func (o *ConfigContext) SetDeviceTypes(v []int32) { + o.DeviceTypes = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *ConfigContext) GetRoles() []int32 { + if o == nil || IsNil(o.Roles) { + var ret []int32 + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetRolesOk() ([]int32, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *ConfigContext) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []int32 and assigns it to the Roles field. +func (o *ConfigContext) SetRoles(v []int32) { + o.Roles = v +} + +// GetPlatforms returns the Platforms field value if set, zero value otherwise. +func (o *ConfigContext) GetPlatforms() []int32 { + if o == nil || IsNil(o.Platforms) { + var ret []int32 + return ret + } + return o.Platforms +} + +// GetPlatformsOk returns a tuple with the Platforms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetPlatformsOk() ([]int32, bool) { + if o == nil || IsNil(o.Platforms) { + return nil, false + } + return o.Platforms, true +} + +// HasPlatforms returns a boolean if a field has been set. +func (o *ConfigContext) HasPlatforms() bool { + if o != nil && !IsNil(o.Platforms) { + return true + } + + return false +} + +// SetPlatforms gets a reference to the given []int32 and assigns it to the Platforms field. +func (o *ConfigContext) SetPlatforms(v []int32) { + o.Platforms = v +} + +// GetClusterTypes returns the ClusterTypes field value if set, zero value otherwise. +func (o *ConfigContext) GetClusterTypes() []int32 { + if o == nil || IsNil(o.ClusterTypes) { + var ret []int32 + return ret + } + return o.ClusterTypes +} + +// GetClusterTypesOk returns a tuple with the ClusterTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetClusterTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterTypes) { + return nil, false + } + return o.ClusterTypes, true +} + +// HasClusterTypes returns a boolean if a field has been set. +func (o *ConfigContext) HasClusterTypes() bool { + if o != nil && !IsNil(o.ClusterTypes) { + return true + } + + return false +} + +// SetClusterTypes gets a reference to the given []int32 and assigns it to the ClusterTypes field. +func (o *ConfigContext) SetClusterTypes(v []int32) { + o.ClusterTypes = v +} + +// GetClusterGroups returns the ClusterGroups field value if set, zero value otherwise. +func (o *ConfigContext) GetClusterGroups() []int32 { + if o == nil || IsNil(o.ClusterGroups) { + var ret []int32 + return ret + } + return o.ClusterGroups +} + +// GetClusterGroupsOk returns a tuple with the ClusterGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetClusterGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterGroups) { + return nil, false + } + return o.ClusterGroups, true +} + +// HasClusterGroups returns a boolean if a field has been set. +func (o *ConfigContext) HasClusterGroups() bool { + if o != nil && !IsNil(o.ClusterGroups) { + return true + } + + return false +} + +// SetClusterGroups gets a reference to the given []int32 and assigns it to the ClusterGroups field. +func (o *ConfigContext) SetClusterGroups(v []int32) { + o.ClusterGroups = v +} + +// GetClusters returns the Clusters field value if set, zero value otherwise. +func (o *ConfigContext) GetClusters() []int32 { + if o == nil || IsNil(o.Clusters) { + var ret []int32 + return ret + } + return o.Clusters +} + +// GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetClustersOk() ([]int32, bool) { + if o == nil || IsNil(o.Clusters) { + return nil, false + } + return o.Clusters, true +} + +// HasClusters returns a boolean if a field has been set. +func (o *ConfigContext) HasClusters() bool { + if o != nil && !IsNil(o.Clusters) { + return true + } + + return false +} + +// SetClusters gets a reference to the given []int32 and assigns it to the Clusters field. +func (o *ConfigContext) SetClusters(v []int32) { + o.Clusters = v +} + +// GetTenantGroups returns the TenantGroups field value if set, zero value otherwise. +func (o *ConfigContext) GetTenantGroups() []int32 { + if o == nil || IsNil(o.TenantGroups) { + var ret []int32 + return ret + } + return o.TenantGroups +} + +// GetTenantGroupsOk returns a tuple with the TenantGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetTenantGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.TenantGroups) { + return nil, false + } + return o.TenantGroups, true +} + +// HasTenantGroups returns a boolean if a field has been set. +func (o *ConfigContext) HasTenantGroups() bool { + if o != nil && !IsNil(o.TenantGroups) { + return true + } + + return false +} + +// SetTenantGroups gets a reference to the given []int32 and assigns it to the TenantGroups field. +func (o *ConfigContext) SetTenantGroups(v []int32) { + o.TenantGroups = v +} + +// GetTenants returns the Tenants field value if set, zero value otherwise. +func (o *ConfigContext) GetTenants() []int32 { + if o == nil || IsNil(o.Tenants) { + var ret []int32 + return ret + } + return o.Tenants +} + +// GetTenantsOk returns a tuple with the Tenants field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetTenantsOk() ([]int32, bool) { + if o == nil || IsNil(o.Tenants) { + return nil, false + } + return o.Tenants, true +} + +// HasTenants returns a boolean if a field has been set. +func (o *ConfigContext) HasTenants() bool { + if o != nil && !IsNil(o.Tenants) { + return true + } + + return false +} + +// SetTenants gets a reference to the given []int32 and assigns it to the Tenants field. +func (o *ConfigContext) SetTenants(v []int32) { + o.Tenants = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConfigContext) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConfigContext) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ConfigContext) SetTags(v []string) { + o.Tags = v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise. +func (o *ConfigContext) GetDataSource() NestedDataSource { + if o == nil || IsNil(o.DataSource) { + var ret NestedDataSource + return ret + } + return *o.DataSource +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetDataSourceOk() (*NestedDataSource, bool) { + if o == nil || IsNil(o.DataSource) { + return nil, false + } + return o.DataSource, true +} + +// HasDataSource returns a boolean if a field has been set. +func (o *ConfigContext) HasDataSource() bool { + if o != nil && !IsNil(o.DataSource) { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NestedDataSource and assigns it to the DataSource field. +func (o *ConfigContext) SetDataSource(v NestedDataSource) { + o.DataSource = &v +} + +// GetDataPath returns the DataPath field value +func (o *ConfigContext) GetDataPath() string { + if o == nil { + var ret string + return ret + } + + return o.DataPath +} + +// GetDataPathOk returns a tuple with the DataPath field value +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetDataPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DataPath, true +} + +// SetDataPath sets field value +func (o *ConfigContext) SetDataPath(v string) { + o.DataPath = v +} + +// GetDataFile returns the DataFile field value +func (o *ConfigContext) GetDataFile() NestedDataFile { + if o == nil { + var ret NestedDataFile + return ret + } + + return o.DataFile +} + +// GetDataFileOk returns a tuple with the DataFile field value +// and a boolean to check if the value has been set. +func (o *ConfigContext) GetDataFileOk() (*NestedDataFile, bool) { + if o == nil { + return nil, false + } + return &o.DataFile, true +} + +// SetDataFile sets field value +func (o *ConfigContext) SetDataFile(v NestedDataFile) { + o.DataFile = v +} + +// GetDataSynced returns the DataSynced field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConfigContext) GetDataSynced() time.Time { + if o == nil || o.DataSynced.Get() == nil { + var ret time.Time + return ret + } + + return *o.DataSynced.Get() +} + +// GetDataSyncedOk returns a tuple with the DataSynced field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigContext) GetDataSyncedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DataSynced.Get(), o.DataSynced.IsSet() +} + +// SetDataSynced sets field value +func (o *ConfigContext) SetDataSynced(v time.Time) { + o.DataSynced.Set(&v) +} + +// GetData returns the Data field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ConfigContext) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigContext) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ConfigContext) SetData(v interface{}) { + o.Data = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConfigContext) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigContext) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ConfigContext) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConfigContext) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigContext) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ConfigContext) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ConfigContext) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigContext) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.Regions) { + toSerialize["regions"] = o.Regions + } + if !IsNil(o.SiteGroups) { + toSerialize["site_groups"] = o.SiteGroups + } + if !IsNil(o.Sites) { + toSerialize["sites"] = o.Sites + } + if !IsNil(o.Locations) { + toSerialize["locations"] = o.Locations + } + if !IsNil(o.DeviceTypes) { + toSerialize["device_types"] = o.DeviceTypes + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Platforms) { + toSerialize["platforms"] = o.Platforms + } + if !IsNil(o.ClusterTypes) { + toSerialize["cluster_types"] = o.ClusterTypes + } + if !IsNil(o.ClusterGroups) { + toSerialize["cluster_groups"] = o.ClusterGroups + } + if !IsNil(o.Clusters) { + toSerialize["clusters"] = o.Clusters + } + if !IsNil(o.TenantGroups) { + toSerialize["tenant_groups"] = o.TenantGroups + } + if !IsNil(o.Tenants) { + toSerialize["tenants"] = o.Tenants + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.DataSource) { + toSerialize["data_source"] = o.DataSource + } + toSerialize["data_path"] = o.DataPath + toSerialize["data_file"] = o.DataFile + toSerialize["data_synced"] = o.DataSynced.Get() + if o.Data != nil { + toSerialize["data"] = o.Data + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConfigContext) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "data_path", + "data_file", + "data_synced", + "data", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfigContext := _ConfigContext{} + + err = json.Unmarshal(data, &varConfigContext) + + if err != nil { + return err + } + + *o = ConfigContext(varConfigContext) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "weight") + delete(additionalProperties, "description") + delete(additionalProperties, "is_active") + delete(additionalProperties, "regions") + delete(additionalProperties, "site_groups") + delete(additionalProperties, "sites") + delete(additionalProperties, "locations") + delete(additionalProperties, "device_types") + delete(additionalProperties, "roles") + delete(additionalProperties, "platforms") + delete(additionalProperties, "cluster_types") + delete(additionalProperties, "cluster_groups") + delete(additionalProperties, "clusters") + delete(additionalProperties, "tenant_groups") + delete(additionalProperties, "tenants") + delete(additionalProperties, "tags") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data_path") + delete(additionalProperties, "data_file") + delete(additionalProperties, "data_synced") + delete(additionalProperties, "data") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConfigContext struct { + value *ConfigContext + isSet bool +} + +func (v NullableConfigContext) Get() *ConfigContext { + return v.value +} + +func (v *NullableConfigContext) Set(val *ConfigContext) { + v.value = val + v.isSet = true +} + +func (v NullableConfigContext) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigContext) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigContext(val *ConfigContext) *NullableConfigContext { + return &NullableConfigContext{value: val, isSet: true} +} + +func (v NullableConfigContext) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigContext) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_config_context_request.go new file mode 100644 index 00000000..deabbc47 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_config_context_request.go @@ -0,0 +1,828 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigContextRequest{} + +// ConfigContextRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ConfigContextRequest struct { + Name string `json:"name"` + Weight *int32 `json:"weight,omitempty"` + Description *string `json:"description,omitempty"` + IsActive *bool `json:"is_active,omitempty"` + Regions []int32 `json:"regions,omitempty"` + SiteGroups []int32 `json:"site_groups,omitempty"` + Sites []int32 `json:"sites,omitempty"` + Locations []int32 `json:"locations,omitempty"` + DeviceTypes []int32 `json:"device_types,omitempty"` + Roles []int32 `json:"roles,omitempty"` + Platforms []int32 `json:"platforms,omitempty"` + ClusterTypes []int32 `json:"cluster_types,omitempty"` + ClusterGroups []int32 `json:"cluster_groups,omitempty"` + Clusters []int32 `json:"clusters,omitempty"` + TenantGroups []int32 `json:"tenant_groups,omitempty"` + Tenants []int32 `json:"tenants,omitempty"` + Tags []string `json:"tags,omitempty"` + DataSource *NestedDataSourceRequest `json:"data_source,omitempty"` + Data interface{} `json:"data"` + AdditionalProperties map[string]interface{} +} + +type _ConfigContextRequest ConfigContextRequest + +// NewConfigContextRequest instantiates a new ConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfigContextRequest(name string, data interface{}) *ConfigContextRequest { + this := ConfigContextRequest{} + this.Name = name + this.Data = data + return &this +} + +// NewConfigContextRequestWithDefaults instantiates a new ConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfigContextRequestWithDefaults() *ConfigContextRequest { + this := ConfigContextRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ConfigContextRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConfigContextRequest) SetName(v string) { + o.Name = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *ConfigContextRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *ConfigContextRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetRegions() []int32 { + if o == nil || IsNil(o.Regions) { + var ret []int32 + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetRegionsOk() ([]int32, bool) { + if o == nil || IsNil(o.Regions) { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasRegions() bool { + if o != nil && !IsNil(o.Regions) { + return true + } + + return false +} + +// SetRegions gets a reference to the given []int32 and assigns it to the Regions field. +func (o *ConfigContextRequest) SetRegions(v []int32) { + o.Regions = v +} + +// GetSiteGroups returns the SiteGroups field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetSiteGroups() []int32 { + if o == nil || IsNil(o.SiteGroups) { + var ret []int32 + return ret + } + return o.SiteGroups +} + +// GetSiteGroupsOk returns a tuple with the SiteGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetSiteGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.SiteGroups) { + return nil, false + } + return o.SiteGroups, true +} + +// HasSiteGroups returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasSiteGroups() bool { + if o != nil && !IsNil(o.SiteGroups) { + return true + } + + return false +} + +// SetSiteGroups gets a reference to the given []int32 and assigns it to the SiteGroups field. +func (o *ConfigContextRequest) SetSiteGroups(v []int32) { + o.SiteGroups = v +} + +// GetSites returns the Sites field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetSites() []int32 { + if o == nil || IsNil(o.Sites) { + var ret []int32 + return ret + } + return o.Sites +} + +// GetSitesOk returns a tuple with the Sites field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetSitesOk() ([]int32, bool) { + if o == nil || IsNil(o.Sites) { + return nil, false + } + return o.Sites, true +} + +// HasSites returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasSites() bool { + if o != nil && !IsNil(o.Sites) { + return true + } + + return false +} + +// SetSites gets a reference to the given []int32 and assigns it to the Sites field. +func (o *ConfigContextRequest) SetSites(v []int32) { + o.Sites = v +} + +// GetLocations returns the Locations field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetLocations() []int32 { + if o == nil || IsNil(o.Locations) { + var ret []int32 + return ret + } + return o.Locations +} + +// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetLocationsOk() ([]int32, bool) { + if o == nil || IsNil(o.Locations) { + return nil, false + } + return o.Locations, true +} + +// HasLocations returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasLocations() bool { + if o != nil && !IsNil(o.Locations) { + return true + } + + return false +} + +// SetLocations gets a reference to the given []int32 and assigns it to the Locations field. +func (o *ConfigContextRequest) SetLocations(v []int32) { + o.Locations = v +} + +// GetDeviceTypes returns the DeviceTypes field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetDeviceTypes() []int32 { + if o == nil || IsNil(o.DeviceTypes) { + var ret []int32 + return ret + } + return o.DeviceTypes +} + +// GetDeviceTypesOk returns a tuple with the DeviceTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetDeviceTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.DeviceTypes) { + return nil, false + } + return o.DeviceTypes, true +} + +// HasDeviceTypes returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasDeviceTypes() bool { + if o != nil && !IsNil(o.DeviceTypes) { + return true + } + + return false +} + +// SetDeviceTypes gets a reference to the given []int32 and assigns it to the DeviceTypes field. +func (o *ConfigContextRequest) SetDeviceTypes(v []int32) { + o.DeviceTypes = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetRoles() []int32 { + if o == nil || IsNil(o.Roles) { + var ret []int32 + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetRolesOk() ([]int32, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []int32 and assigns it to the Roles field. +func (o *ConfigContextRequest) SetRoles(v []int32) { + o.Roles = v +} + +// GetPlatforms returns the Platforms field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetPlatforms() []int32 { + if o == nil || IsNil(o.Platforms) { + var ret []int32 + return ret + } + return o.Platforms +} + +// GetPlatformsOk returns a tuple with the Platforms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetPlatformsOk() ([]int32, bool) { + if o == nil || IsNil(o.Platforms) { + return nil, false + } + return o.Platforms, true +} + +// HasPlatforms returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasPlatforms() bool { + if o != nil && !IsNil(o.Platforms) { + return true + } + + return false +} + +// SetPlatforms gets a reference to the given []int32 and assigns it to the Platforms field. +func (o *ConfigContextRequest) SetPlatforms(v []int32) { + o.Platforms = v +} + +// GetClusterTypes returns the ClusterTypes field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetClusterTypes() []int32 { + if o == nil || IsNil(o.ClusterTypes) { + var ret []int32 + return ret + } + return o.ClusterTypes +} + +// GetClusterTypesOk returns a tuple with the ClusterTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetClusterTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterTypes) { + return nil, false + } + return o.ClusterTypes, true +} + +// HasClusterTypes returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasClusterTypes() bool { + if o != nil && !IsNil(o.ClusterTypes) { + return true + } + + return false +} + +// SetClusterTypes gets a reference to the given []int32 and assigns it to the ClusterTypes field. +func (o *ConfigContextRequest) SetClusterTypes(v []int32) { + o.ClusterTypes = v +} + +// GetClusterGroups returns the ClusterGroups field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetClusterGroups() []int32 { + if o == nil || IsNil(o.ClusterGroups) { + var ret []int32 + return ret + } + return o.ClusterGroups +} + +// GetClusterGroupsOk returns a tuple with the ClusterGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetClusterGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterGroups) { + return nil, false + } + return o.ClusterGroups, true +} + +// HasClusterGroups returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasClusterGroups() bool { + if o != nil && !IsNil(o.ClusterGroups) { + return true + } + + return false +} + +// SetClusterGroups gets a reference to the given []int32 and assigns it to the ClusterGroups field. +func (o *ConfigContextRequest) SetClusterGroups(v []int32) { + o.ClusterGroups = v +} + +// GetClusters returns the Clusters field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetClusters() []int32 { + if o == nil || IsNil(o.Clusters) { + var ret []int32 + return ret + } + return o.Clusters +} + +// GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetClustersOk() ([]int32, bool) { + if o == nil || IsNil(o.Clusters) { + return nil, false + } + return o.Clusters, true +} + +// HasClusters returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasClusters() bool { + if o != nil && !IsNil(o.Clusters) { + return true + } + + return false +} + +// SetClusters gets a reference to the given []int32 and assigns it to the Clusters field. +func (o *ConfigContextRequest) SetClusters(v []int32) { + o.Clusters = v +} + +// GetTenantGroups returns the TenantGroups field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetTenantGroups() []int32 { + if o == nil || IsNil(o.TenantGroups) { + var ret []int32 + return ret + } + return o.TenantGroups +} + +// GetTenantGroupsOk returns a tuple with the TenantGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetTenantGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.TenantGroups) { + return nil, false + } + return o.TenantGroups, true +} + +// HasTenantGroups returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasTenantGroups() bool { + if o != nil && !IsNil(o.TenantGroups) { + return true + } + + return false +} + +// SetTenantGroups gets a reference to the given []int32 and assigns it to the TenantGroups field. +func (o *ConfigContextRequest) SetTenantGroups(v []int32) { + o.TenantGroups = v +} + +// GetTenants returns the Tenants field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetTenants() []int32 { + if o == nil || IsNil(o.Tenants) { + var ret []int32 + return ret + } + return o.Tenants +} + +// GetTenantsOk returns a tuple with the Tenants field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetTenantsOk() ([]int32, bool) { + if o == nil || IsNil(o.Tenants) { + return nil, false + } + return o.Tenants, true +} + +// HasTenants returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasTenants() bool { + if o != nil && !IsNil(o.Tenants) { + return true + } + + return false +} + +// SetTenants gets a reference to the given []int32 and assigns it to the Tenants field. +func (o *ConfigContextRequest) SetTenants(v []int32) { + o.Tenants = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ConfigContextRequest) SetTags(v []string) { + o.Tags = v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise. +func (o *ConfigContextRequest) GetDataSource() NestedDataSourceRequest { + if o == nil || IsNil(o.DataSource) { + var ret NestedDataSourceRequest + return ret + } + return *o.DataSource +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigContextRequest) GetDataSourceOk() (*NestedDataSourceRequest, bool) { + if o == nil || IsNil(o.DataSource) { + return nil, false + } + return o.DataSource, true +} + +// HasDataSource returns a boolean if a field has been set. +func (o *ConfigContextRequest) HasDataSource() bool { + if o != nil && !IsNil(o.DataSource) { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NestedDataSourceRequest and assigns it to the DataSource field. +func (o *ConfigContextRequest) SetDataSource(v NestedDataSourceRequest) { + o.DataSource = &v +} + +// GetData returns the Data field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ConfigContextRequest) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigContextRequest) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ConfigContextRequest) SetData(v interface{}) { + o.Data = v +} + +func (o ConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.Regions) { + toSerialize["regions"] = o.Regions + } + if !IsNil(o.SiteGroups) { + toSerialize["site_groups"] = o.SiteGroups + } + if !IsNil(o.Sites) { + toSerialize["sites"] = o.Sites + } + if !IsNil(o.Locations) { + toSerialize["locations"] = o.Locations + } + if !IsNil(o.DeviceTypes) { + toSerialize["device_types"] = o.DeviceTypes + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Platforms) { + toSerialize["platforms"] = o.Platforms + } + if !IsNil(o.ClusterTypes) { + toSerialize["cluster_types"] = o.ClusterTypes + } + if !IsNil(o.ClusterGroups) { + toSerialize["cluster_groups"] = o.ClusterGroups + } + if !IsNil(o.Clusters) { + toSerialize["clusters"] = o.Clusters + } + if !IsNil(o.TenantGroups) { + toSerialize["tenant_groups"] = o.TenantGroups + } + if !IsNil(o.Tenants) { + toSerialize["tenants"] = o.Tenants + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.DataSource) { + toSerialize["data_source"] = o.DataSource + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfigContextRequest := _ConfigContextRequest{} + + err = json.Unmarshal(data, &varConfigContextRequest) + + if err != nil { + return err + } + + *o = ConfigContextRequest(varConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "weight") + delete(additionalProperties, "description") + delete(additionalProperties, "is_active") + delete(additionalProperties, "regions") + delete(additionalProperties, "site_groups") + delete(additionalProperties, "sites") + delete(additionalProperties, "locations") + delete(additionalProperties, "device_types") + delete(additionalProperties, "roles") + delete(additionalProperties, "platforms") + delete(additionalProperties, "cluster_types") + delete(additionalProperties, "cluster_groups") + delete(additionalProperties, "clusters") + delete(additionalProperties, "tenant_groups") + delete(additionalProperties, "tenants") + delete(additionalProperties, "tags") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConfigContextRequest struct { + value *ConfigContextRequest + isSet bool +} + +func (v NullableConfigContextRequest) Get() *ConfigContextRequest { + return v.value +} + +func (v *NullableConfigContextRequest) Set(val *ConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigContextRequest(val *ConfigContextRequest) *NullableConfigContextRequest { + return &NullableConfigContextRequest{value: val, isSet: true} +} + +func (v NullableConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_config_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_config_template.go new file mode 100644 index 00000000..60dd5f6f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_config_template.go @@ -0,0 +1,594 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ConfigTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigTemplate{} + +// ConfigTemplate Introduces support for Tag assignment. Adds `tags` serialization, and handles tag assignment on create() and update(). +type ConfigTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // Any additional parameters to pass when constructing the Jinja2 environment. + EnvironmentParams interface{} `json:"environment_params,omitempty"` + // Jinja2 template code. + TemplateCode string `json:"template_code"` + DataSource *NestedDataSource `json:"data_source,omitempty"` + // Path to remote file (relative to data source root) + DataPath string `json:"data_path"` + DataFile *NestedDataFile `json:"data_file,omitempty"` + DataSynced NullableTime `json:"data_synced"` + Tags []NestedTag `json:"tags,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ConfigTemplate ConfigTemplate + +// NewConfigTemplate instantiates a new ConfigTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfigTemplate(id int32, url string, display string, name string, templateCode string, dataPath string, dataSynced NullableTime, created NullableTime, lastUpdated NullableTime) *ConfigTemplate { + this := ConfigTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.TemplateCode = templateCode + this.DataPath = dataPath + this.DataSynced = dataSynced + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewConfigTemplateWithDefaults instantiates a new ConfigTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfigTemplateWithDefaults() *ConfigTemplate { + this := ConfigTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *ConfigTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConfigTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ConfigTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ConfigTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ConfigTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ConfigTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ConfigTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConfigTemplate) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConfigTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConfigTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConfigTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetEnvironmentParams returns the EnvironmentParams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigTemplate) GetEnvironmentParams() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.EnvironmentParams +} + +// GetEnvironmentParamsOk returns a tuple with the EnvironmentParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigTemplate) GetEnvironmentParamsOk() (*interface{}, bool) { + if o == nil || IsNil(o.EnvironmentParams) { + return nil, false + } + return &o.EnvironmentParams, true +} + +// HasEnvironmentParams returns a boolean if a field has been set. +func (o *ConfigTemplate) HasEnvironmentParams() bool { + if o != nil && IsNil(o.EnvironmentParams) { + return true + } + + return false +} + +// SetEnvironmentParams gets a reference to the given interface{} and assigns it to the EnvironmentParams field. +func (o *ConfigTemplate) SetEnvironmentParams(v interface{}) { + o.EnvironmentParams = v +} + +// GetTemplateCode returns the TemplateCode field value +func (o *ConfigTemplate) GetTemplateCode() string { + if o == nil { + var ret string + return ret + } + + return o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetTemplateCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TemplateCode, true +} + +// SetTemplateCode sets field value +func (o *ConfigTemplate) SetTemplateCode(v string) { + o.TemplateCode = v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise. +func (o *ConfigTemplate) GetDataSource() NestedDataSource { + if o == nil || IsNil(o.DataSource) { + var ret NestedDataSource + return ret + } + return *o.DataSource +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetDataSourceOk() (*NestedDataSource, bool) { + if o == nil || IsNil(o.DataSource) { + return nil, false + } + return o.DataSource, true +} + +// HasDataSource returns a boolean if a field has been set. +func (o *ConfigTemplate) HasDataSource() bool { + if o != nil && !IsNil(o.DataSource) { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NestedDataSource and assigns it to the DataSource field. +func (o *ConfigTemplate) SetDataSource(v NestedDataSource) { + o.DataSource = &v +} + +// GetDataPath returns the DataPath field value +func (o *ConfigTemplate) GetDataPath() string { + if o == nil { + var ret string + return ret + } + + return o.DataPath +} + +// GetDataPathOk returns a tuple with the DataPath field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetDataPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DataPath, true +} + +// SetDataPath sets field value +func (o *ConfigTemplate) SetDataPath(v string) { + o.DataPath = v +} + +// GetDataFile returns the DataFile field value if set, zero value otherwise. +func (o *ConfigTemplate) GetDataFile() NestedDataFile { + if o == nil || IsNil(o.DataFile) { + var ret NestedDataFile + return ret + } + return *o.DataFile +} + +// GetDataFileOk returns a tuple with the DataFile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetDataFileOk() (*NestedDataFile, bool) { + if o == nil || IsNil(o.DataFile) { + return nil, false + } + return o.DataFile, true +} + +// HasDataFile returns a boolean if a field has been set. +func (o *ConfigTemplate) HasDataFile() bool { + if o != nil && !IsNil(o.DataFile) { + return true + } + + return false +} + +// SetDataFile gets a reference to the given NestedDataFile and assigns it to the DataFile field. +func (o *ConfigTemplate) SetDataFile(v NestedDataFile) { + o.DataFile = &v +} + +// GetDataSynced returns the DataSynced field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConfigTemplate) GetDataSynced() time.Time { + if o == nil || o.DataSynced.Get() == nil { + var ret time.Time + return ret + } + + return *o.DataSynced.Get() +} + +// GetDataSyncedOk returns a tuple with the DataSynced field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigTemplate) GetDataSyncedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DataSynced.Get(), o.DataSynced.IsSet() +} + +// SetDataSynced sets field value +func (o *ConfigTemplate) SetDataSynced(v time.Time) { + o.DataSynced.Set(&v) +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConfigTemplate) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigTemplate) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConfigTemplate) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ConfigTemplate) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConfigTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ConfigTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConfigTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ConfigTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ConfigTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.EnvironmentParams != nil { + toSerialize["environment_params"] = o.EnvironmentParams + } + toSerialize["template_code"] = o.TemplateCode + if !IsNil(o.DataSource) { + toSerialize["data_source"] = o.DataSource + } + toSerialize["data_path"] = o.DataPath + if !IsNil(o.DataFile) { + toSerialize["data_file"] = o.DataFile + } + toSerialize["data_synced"] = o.DataSynced.Get() + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConfigTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "template_code", + "data_path", + "data_synced", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfigTemplate := _ConfigTemplate{} + + err = json.Unmarshal(data, &varConfigTemplate) + + if err != nil { + return err + } + + *o = ConfigTemplate(varConfigTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "environment_params") + delete(additionalProperties, "template_code") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data_path") + delete(additionalProperties, "data_file") + delete(additionalProperties, "data_synced") + delete(additionalProperties, "tags") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConfigTemplate struct { + value *ConfigTemplate + isSet bool +} + +func (v NullableConfigTemplate) Get() *ConfigTemplate { + return v.value +} + +func (v *NullableConfigTemplate) Set(val *ConfigTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableConfigTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigTemplate(val *ConfigTemplate) *NullableConfigTemplate { + return &NullableConfigTemplate{value: val, isSet: true} +} + +func (v NullableConfigTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_config_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_config_template_request.go new file mode 100644 index 00000000..ab13784f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_config_template_request.go @@ -0,0 +1,346 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConfigTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigTemplateRequest{} + +// ConfigTemplateRequest Introduces support for Tag assignment. Adds `tags` serialization, and handles tag assignment on create() and update(). +type ConfigTemplateRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // Any additional parameters to pass when constructing the Jinja2 environment. + EnvironmentParams interface{} `json:"environment_params,omitempty"` + // Jinja2 template code. + TemplateCode string `json:"template_code"` + DataSource *NestedDataSourceRequest `json:"data_source,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConfigTemplateRequest ConfigTemplateRequest + +// NewConfigTemplateRequest instantiates a new ConfigTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfigTemplateRequest(name string, templateCode string) *ConfigTemplateRequest { + this := ConfigTemplateRequest{} + this.Name = name + this.TemplateCode = templateCode + return &this +} + +// NewConfigTemplateRequestWithDefaults instantiates a new ConfigTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfigTemplateRequestWithDefaults() *ConfigTemplateRequest { + this := ConfigTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ConfigTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConfigTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConfigTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConfigTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConfigTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEnvironmentParams returns the EnvironmentParams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigTemplateRequest) GetEnvironmentParams() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.EnvironmentParams +} + +// GetEnvironmentParamsOk returns a tuple with the EnvironmentParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConfigTemplateRequest) GetEnvironmentParamsOk() (*interface{}, bool) { + if o == nil || IsNil(o.EnvironmentParams) { + return nil, false + } + return &o.EnvironmentParams, true +} + +// HasEnvironmentParams returns a boolean if a field has been set. +func (o *ConfigTemplateRequest) HasEnvironmentParams() bool { + if o != nil && IsNil(o.EnvironmentParams) { + return true + } + + return false +} + +// SetEnvironmentParams gets a reference to the given interface{} and assigns it to the EnvironmentParams field. +func (o *ConfigTemplateRequest) SetEnvironmentParams(v interface{}) { + o.EnvironmentParams = v +} + +// GetTemplateCode returns the TemplateCode field value +func (o *ConfigTemplateRequest) GetTemplateCode() string { + if o == nil { + var ret string + return ret + } + + return o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value +// and a boolean to check if the value has been set. +func (o *ConfigTemplateRequest) GetTemplateCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TemplateCode, true +} + +// SetTemplateCode sets field value +func (o *ConfigTemplateRequest) SetTemplateCode(v string) { + o.TemplateCode = v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise. +func (o *ConfigTemplateRequest) GetDataSource() NestedDataSourceRequest { + if o == nil || IsNil(o.DataSource) { + var ret NestedDataSourceRequest + return ret + } + return *o.DataSource +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigTemplateRequest) GetDataSourceOk() (*NestedDataSourceRequest, bool) { + if o == nil || IsNil(o.DataSource) { + return nil, false + } + return o.DataSource, true +} + +// HasDataSource returns a boolean if a field has been set. +func (o *ConfigTemplateRequest) HasDataSource() bool { + if o != nil && !IsNil(o.DataSource) { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NestedDataSourceRequest and assigns it to the DataSource field. +func (o *ConfigTemplateRequest) SetDataSource(v NestedDataSourceRequest) { + o.DataSource = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConfigTemplateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigTemplateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConfigTemplateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ConfigTemplateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o ConfigTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.EnvironmentParams != nil { + toSerialize["environment_params"] = o.EnvironmentParams + } + toSerialize["template_code"] = o.TemplateCode + if !IsNil(o.DataSource) { + toSerialize["data_source"] = o.DataSource + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConfigTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "template_code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfigTemplateRequest := _ConfigTemplateRequest{} + + err = json.Unmarshal(data, &varConfigTemplateRequest) + + if err != nil { + return err + } + + *o = ConfigTemplateRequest(varConfigTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "environment_params") + delete(additionalProperties, "template_code") + delete(additionalProperties, "data_source") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConfigTemplateRequest struct { + value *ConfigTemplateRequest + isSet bool +} + +func (v NullableConfigTemplateRequest) Get() *ConfigTemplateRequest { + return v.value +} + +func (v *NullableConfigTemplateRequest) Set(val *ConfigTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConfigTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigTemplateRequest(val *ConfigTemplateRequest) *NullableConfigTemplateRequest { + return &NullableConfigTemplateRequest{value: val, isSet: true} +} + +func (v NullableConfigTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port.go new file mode 100644 index 00000000..fc9f5ff4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port.go @@ -0,0 +1,900 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ConsolePort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsolePort{} + +// ConsolePort Adds support for custom fields and tags. +type ConsolePort struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Module NullableComponentNestedModule `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortType `json:"type,omitempty"` + Speed NullableConsolePortSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` + ConnectedEndpointsType string `json:"connected_endpoints_type"` + ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _ConsolePort ConsolePort + +// NewConsolePort instantiates a new ConsolePort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsolePort(id int32, url string, display string, device NestedDevice, name string, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, connectedEndpoints []interface{}, connectedEndpointsType string, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *ConsolePort { + this := ConsolePort{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.ConnectedEndpoints = connectedEndpoints + this.ConnectedEndpointsType = connectedEndpointsType + this.ConnectedEndpointsReachable = connectedEndpointsReachable + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewConsolePortWithDefaults instantiates a new ConsolePort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsolePortWithDefaults() *ConsolePort { + this := ConsolePort{} + return &this +} + +// GetId returns the Id field value +func (o *ConsolePort) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConsolePort) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ConsolePort) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ConsolePort) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ConsolePort) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ConsolePort) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *ConsolePort) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ConsolePort) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePort) GetModule() ComponentNestedModule { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModule + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePort) GetModuleOk() (*ComponentNestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *ConsolePort) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModule and assigns it to the Module field. +func (o *ConsolePort) SetModule(v ComponentNestedModule) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *ConsolePort) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *ConsolePort) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *ConsolePort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsolePort) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsolePort) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsolePort) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsolePort) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsolePort) GetType() ConsolePortType { + if o == nil || IsNil(o.Type) { + var ret ConsolePortType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetTypeOk() (*ConsolePortType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsolePort) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortType and assigns it to the Type field. +func (o *ConsolePort) SetType(v ConsolePortType) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePort) GetSpeed() ConsolePortSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret ConsolePortSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePort) GetSpeedOk() (*ConsolePortSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *ConsolePort) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableConsolePortSpeed and assigns it to the Speed field. +func (o *ConsolePort) SetSpeed(v ConsolePortSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *ConsolePort) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *ConsolePort) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsolePort) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsolePort) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsolePort) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *ConsolePort) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *ConsolePort) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *ConsolePort) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *ConsolePort) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePort) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *ConsolePort) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *ConsolePort) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *ConsolePort) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *ConsolePort) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *ConsolePort) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *ConsolePort) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *ConsolePort) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetConnectedEndpoints returns the ConnectedEndpoints field value +func (o *ConsolePort) GetConnectedEndpoints() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConnectedEndpoints +} + +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetConnectedEndpointsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConnectedEndpoints, true +} + +// SetConnectedEndpoints sets field value +func (o *ConsolePort) SetConnectedEndpoints(v []interface{}) { + o.ConnectedEndpoints = v +} + +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value +func (o *ConsolePort) GetConnectedEndpointsType() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectedEndpointsType +} + +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetConnectedEndpointsTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsType, true +} + +// SetConnectedEndpointsType sets field value +func (o *ConsolePort) SetConnectedEndpointsType(v string) { + o.ConnectedEndpointsType = v +} + +// GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value +func (o *ConsolePort) GetConnectedEndpointsReachable() bool { + if o == nil { + var ret bool + return ret + } + + return o.ConnectedEndpointsReachable +} + +// GetConnectedEndpointsReachableOk returns a tuple with the ConnectedEndpointsReachable field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetConnectedEndpointsReachableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsReachable, true +} + +// SetConnectedEndpointsReachable sets field value +func (o *ConsolePort) SetConnectedEndpointsReachable(v bool) { + o.ConnectedEndpointsReachable = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConsolePort) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConsolePort) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ConsolePort) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ConsolePort) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ConsolePort) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ConsolePort) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsolePort) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePort) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ConsolePort) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsolePort) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePort) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ConsolePort) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *ConsolePort) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *ConsolePort) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *ConsolePort) SetOccupied(v bool) { + o.Occupied = v +} + +func (o ConsolePort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsolePort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + toSerialize["connected_endpoints"] = o.ConnectedEndpoints + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType + toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsolePort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "connected_endpoints", + "connected_endpoints_type", + "connected_endpoints_reachable", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsolePort := _ConsolePort{} + + err = json.Unmarshal(data, &varConsolePort) + + if err != nil { + return err + } + + *o = ConsolePort(varConsolePort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "connected_endpoints") + delete(additionalProperties, "connected_endpoints_type") + delete(additionalProperties, "connected_endpoints_reachable") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsolePort struct { + value *ConsolePort + isSet bool +} + +func (v NullableConsolePort) Get() *ConsolePort { + return v.value +} + +func (v *NullableConsolePort) Set(val *ConsolePort) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePort) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePort(val *ConsolePort) *NullableConsolePort { + return &NullableConsolePort{value: val, isSet: true} +} + +func (v NullableConsolePort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_request.go new file mode 100644 index 00000000..5c9ba29f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_request.go @@ -0,0 +1,515 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsolePortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsolePortRequest{} + +// ConsolePortRequest Adds support for custom fields and tags. +type ConsolePortRequest struct { + Device NestedDeviceRequest `json:"device"` + Module NullableComponentNestedModuleRequest `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Speed NullableConsolePortRequestSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsolePortRequest ConsolePortRequest + +// NewConsolePortRequest instantiates a new ConsolePortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsolePortRequest(device NestedDeviceRequest, name string) *ConsolePortRequest { + this := ConsolePortRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewConsolePortRequestWithDefaults instantiates a new ConsolePortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsolePortRequestWithDefaults() *ConsolePortRequest { + this := ConsolePortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *ConsolePortRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ConsolePortRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePortRequest) GetModule() ComponentNestedModuleRequest { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModuleRequest + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortRequest) GetModuleOk() (*ComponentNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModuleRequest and assigns it to the Module field. +func (o *ConsolePortRequest) SetModule(v ComponentNestedModuleRequest) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *ConsolePortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *ConsolePortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *ConsolePortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsolePortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsolePortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsolePortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsolePortRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *ConsolePortRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePortRequest) GetSpeed() ConsolePortRequestSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret ConsolePortRequestSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortRequest) GetSpeedOk() (*ConsolePortRequestSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableConsolePortRequestSpeed and assigns it to the Speed field. +func (o *ConsolePortRequest) SetSpeed(v ConsolePortRequestSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *ConsolePortRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *ConsolePortRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsolePortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsolePortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *ConsolePortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *ConsolePortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConsolePortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ConsolePortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ConsolePortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ConsolePortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ConsolePortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ConsolePortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsolePortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsolePortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsolePortRequest := _ConsolePortRequest{} + + err = json.Unmarshal(data, &varConsolePortRequest) + + if err != nil { + return err + } + + *o = ConsolePortRequest(varConsolePortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsolePortRequest struct { + value *ConsolePortRequest + isSet bool +} + +func (v NullableConsolePortRequest) Get() *ConsolePortRequest { + return v.value +} + +func (v *NullableConsolePortRequest) Set(val *ConsolePortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortRequest(val *ConsolePortRequest) *NullableConsolePortRequest { + return &NullableConsolePortRequest{value: val, isSet: true} +} + +func (v NullableConsolePortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_request_speed.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_request_speed.go new file mode 100644 index 00000000..f633f943 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_request_speed.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ConsolePortRequestSpeed * `1200` - 1200 bps * `2400` - 2400 bps * `4800` - 4800 bps * `9600` - 9600 bps * `19200` - 19.2 kbps * `38400` - 38.4 kbps * `57600` - 57.6 kbps * `115200` - 115.2 kbps +type ConsolePortRequestSpeed int32 + +// List of ConsolePortRequest_speed +const ( + CONSOLEPORTREQUESTSPEED__1200 ConsolePortRequestSpeed = 1200 + CONSOLEPORTREQUESTSPEED__2400 ConsolePortRequestSpeed = 2400 + CONSOLEPORTREQUESTSPEED__4800 ConsolePortRequestSpeed = 4800 + CONSOLEPORTREQUESTSPEED__9600 ConsolePortRequestSpeed = 9600 + CONSOLEPORTREQUESTSPEED__19200 ConsolePortRequestSpeed = 19200 + CONSOLEPORTREQUESTSPEED__38400 ConsolePortRequestSpeed = 38400 + CONSOLEPORTREQUESTSPEED__57600 ConsolePortRequestSpeed = 57600 + CONSOLEPORTREQUESTSPEED__115200 ConsolePortRequestSpeed = 115200 +) + +// All allowed values of ConsolePortRequestSpeed enum +var AllowedConsolePortRequestSpeedEnumValues = []ConsolePortRequestSpeed{ + 1200, + 2400, + 4800, + 9600, + 19200, + 38400, + 57600, + 115200, +} + +func (v *ConsolePortRequestSpeed) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsolePortRequestSpeed(value) + for _, existing := range AllowedConsolePortRequestSpeedEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsolePortRequestSpeed", value) +} + +// NewConsolePortRequestSpeedFromValue returns a pointer to a valid ConsolePortRequestSpeed +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsolePortRequestSpeedFromValue(v int32) (*ConsolePortRequestSpeed, error) { + ev := ConsolePortRequestSpeed(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsolePortRequestSpeed: valid values are %v", v, AllowedConsolePortRequestSpeedEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsolePortRequestSpeed) IsValid() bool { + for _, existing := range AllowedConsolePortRequestSpeedEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsolePortRequest_speed value +func (v ConsolePortRequestSpeed) Ptr() *ConsolePortRequestSpeed { + return &v +} + +type NullableConsolePortRequestSpeed struct { + value *ConsolePortRequestSpeed + isSet bool +} + +func (v NullableConsolePortRequestSpeed) Get() *ConsolePortRequestSpeed { + return v.value +} + +func (v *NullableConsolePortRequestSpeed) Set(val *ConsolePortRequestSpeed) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortRequestSpeed) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortRequestSpeed) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortRequestSpeed(val *ConsolePortRequestSpeed) *NullableConsolePortRequestSpeed { + return &NullableConsolePortRequestSpeed{value: val, isSet: true} +} + +func (v NullableConsolePortRequestSpeed) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortRequestSpeed) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed.go new file mode 100644 index 00000000..004a03a3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ConsolePortSpeed type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsolePortSpeed{} + +// ConsolePortSpeed struct for ConsolePortSpeed +type ConsolePortSpeed struct { + Value *ConsolePortSpeedValue `json:"value,omitempty"` + Label *ConsolePortSpeedLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsolePortSpeed ConsolePortSpeed + +// NewConsolePortSpeed instantiates a new ConsolePortSpeed object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsolePortSpeed() *ConsolePortSpeed { + this := ConsolePortSpeed{} + return &this +} + +// NewConsolePortSpeedWithDefaults instantiates a new ConsolePortSpeed object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsolePortSpeedWithDefaults() *ConsolePortSpeed { + this := ConsolePortSpeed{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ConsolePortSpeed) GetValue() ConsolePortSpeedValue { + if o == nil || IsNil(o.Value) { + var ret ConsolePortSpeedValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortSpeed) GetValueOk() (*ConsolePortSpeedValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ConsolePortSpeed) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given ConsolePortSpeedValue and assigns it to the Value field. +func (o *ConsolePortSpeed) SetValue(v ConsolePortSpeedValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsolePortSpeed) GetLabel() ConsolePortSpeedLabel { + if o == nil || IsNil(o.Label) { + var ret ConsolePortSpeedLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortSpeed) GetLabelOk() (*ConsolePortSpeedLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsolePortSpeed) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given ConsolePortSpeedLabel and assigns it to the Label field. +func (o *ConsolePortSpeed) SetLabel(v ConsolePortSpeedLabel) { + o.Label = &v +} + +func (o ConsolePortSpeed) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsolePortSpeed) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsolePortSpeed) UnmarshalJSON(data []byte) (err error) { + varConsolePortSpeed := _ConsolePortSpeed{} + + err = json.Unmarshal(data, &varConsolePortSpeed) + + if err != nil { + return err + } + + *o = ConsolePortSpeed(varConsolePortSpeed) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsolePortSpeed struct { + value *ConsolePortSpeed + isSet bool +} + +func (v NullableConsolePortSpeed) Get() *ConsolePortSpeed { + return v.value +} + +func (v *NullableConsolePortSpeed) Set(val *ConsolePortSpeed) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortSpeed) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortSpeed) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortSpeed(val *ConsolePortSpeed) *NullableConsolePortSpeed { + return &NullableConsolePortSpeed{value: val, isSet: true} +} + +func (v NullableConsolePortSpeed) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortSpeed) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed_label.go new file mode 100644 index 00000000..1e98f86e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed_label.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ConsolePortSpeedLabel the model 'ConsolePortSpeedLabel' +type ConsolePortSpeedLabel string + +// List of ConsolePort_speed_label +const ( + CONSOLEPORTSPEEDLABEL__1200_BPS ConsolePortSpeedLabel = "1200 bps" + CONSOLEPORTSPEEDLABEL__2400_BPS ConsolePortSpeedLabel = "2400 bps" + CONSOLEPORTSPEEDLABEL__4800_BPS ConsolePortSpeedLabel = "4800 bps" + CONSOLEPORTSPEEDLABEL__9600_BPS ConsolePortSpeedLabel = "9600 bps" + CONSOLEPORTSPEEDLABEL__19_2_KBPS ConsolePortSpeedLabel = "19.2 kbps" + CONSOLEPORTSPEEDLABEL__38_4_KBPS ConsolePortSpeedLabel = "38.4 kbps" + CONSOLEPORTSPEEDLABEL__57_6_KBPS ConsolePortSpeedLabel = "57.6 kbps" + CONSOLEPORTSPEEDLABEL__115_2_KBPS ConsolePortSpeedLabel = "115.2 kbps" +) + +// All allowed values of ConsolePortSpeedLabel enum +var AllowedConsolePortSpeedLabelEnumValues = []ConsolePortSpeedLabel{ + "1200 bps", + "2400 bps", + "4800 bps", + "9600 bps", + "19.2 kbps", + "38.4 kbps", + "57.6 kbps", + "115.2 kbps", +} + +func (v *ConsolePortSpeedLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsolePortSpeedLabel(value) + for _, existing := range AllowedConsolePortSpeedLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsolePortSpeedLabel", value) +} + +// NewConsolePortSpeedLabelFromValue returns a pointer to a valid ConsolePortSpeedLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsolePortSpeedLabelFromValue(v string) (*ConsolePortSpeedLabel, error) { + ev := ConsolePortSpeedLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsolePortSpeedLabel: valid values are %v", v, AllowedConsolePortSpeedLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsolePortSpeedLabel) IsValid() bool { + for _, existing := range AllowedConsolePortSpeedLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsolePort_speed_label value +func (v ConsolePortSpeedLabel) Ptr() *ConsolePortSpeedLabel { + return &v +} + +type NullableConsolePortSpeedLabel struct { + value *ConsolePortSpeedLabel + isSet bool +} + +func (v NullableConsolePortSpeedLabel) Get() *ConsolePortSpeedLabel { + return v.value +} + +func (v *NullableConsolePortSpeedLabel) Set(val *ConsolePortSpeedLabel) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortSpeedLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortSpeedLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortSpeedLabel(val *ConsolePortSpeedLabel) *NullableConsolePortSpeedLabel { + return &NullableConsolePortSpeedLabel{value: val, isSet: true} +} + +func (v NullableConsolePortSpeedLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortSpeedLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed_value.go new file mode 100644 index 00000000..04e89451 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_speed_value.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ConsolePortSpeedValue * `1200` - 1200 bps * `2400` - 2400 bps * `4800` - 4800 bps * `9600` - 9600 bps * `19200` - 19.2 kbps * `38400` - 38.4 kbps * `57600` - 57.6 kbps * `115200` - 115.2 kbps +type ConsolePortSpeedValue int32 + +// List of ConsolePort_speed_value +const ( + CONSOLEPORTSPEEDVALUE__1200 ConsolePortSpeedValue = 1200 + CONSOLEPORTSPEEDVALUE__2400 ConsolePortSpeedValue = 2400 + CONSOLEPORTSPEEDVALUE__4800 ConsolePortSpeedValue = 4800 + CONSOLEPORTSPEEDVALUE__9600 ConsolePortSpeedValue = 9600 + CONSOLEPORTSPEEDVALUE__19200 ConsolePortSpeedValue = 19200 + CONSOLEPORTSPEEDVALUE__38400 ConsolePortSpeedValue = 38400 + CONSOLEPORTSPEEDVALUE__57600 ConsolePortSpeedValue = 57600 + CONSOLEPORTSPEEDVALUE__115200 ConsolePortSpeedValue = 115200 +) + +// All allowed values of ConsolePortSpeedValue enum +var AllowedConsolePortSpeedValueEnumValues = []ConsolePortSpeedValue{ + 1200, + 2400, + 4800, + 9600, + 19200, + 38400, + 57600, + 115200, +} + +func (v *ConsolePortSpeedValue) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsolePortSpeedValue(value) + for _, existing := range AllowedConsolePortSpeedValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsolePortSpeedValue", value) +} + +// NewConsolePortSpeedValueFromValue returns a pointer to a valid ConsolePortSpeedValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsolePortSpeedValueFromValue(v int32) (*ConsolePortSpeedValue, error) { + ev := ConsolePortSpeedValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsolePortSpeedValue: valid values are %v", v, AllowedConsolePortSpeedValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsolePortSpeedValue) IsValid() bool { + for _, existing := range AllowedConsolePortSpeedValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsolePort_speed_value value +func (v ConsolePortSpeedValue) Ptr() *ConsolePortSpeedValue { + return &v +} + +type NullableConsolePortSpeedValue struct { + value *ConsolePortSpeedValue + isSet bool +} + +func (v NullableConsolePortSpeedValue) Get() *ConsolePortSpeedValue { + return v.value +} + +func (v *NullableConsolePortSpeedValue) Set(val *ConsolePortSpeedValue) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortSpeedValue) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortSpeedValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortSpeedValue(val *ConsolePortSpeedValue) *NullableConsolePortSpeedValue { + return &NullableConsolePortSpeedValue{value: val, isSet: true} +} + +func (v NullableConsolePortSpeedValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortSpeedValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_template.go new file mode 100644 index 00000000..c4b94022 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_template.go @@ -0,0 +1,525 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ConsolePortTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsolePortTemplate{} + +// ConsolePortTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ConsolePortTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NullableNestedDeviceType `json:"device_type,omitempty"` + ModuleType NullableNestedModuleType `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortType `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ConsolePortTemplate ConsolePortTemplate + +// NewConsolePortTemplate instantiates a new ConsolePortTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsolePortTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *ConsolePortTemplate { + this := ConsolePortTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewConsolePortTemplateWithDefaults instantiates a new ConsolePortTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsolePortTemplateWithDefaults() *ConsolePortTemplate { + this := ConsolePortTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *ConsolePortTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConsolePortTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ConsolePortTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ConsolePortTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ConsolePortTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ConsolePortTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePortTemplate) GetDeviceType() NestedDeviceType { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceType + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *ConsolePortTemplate) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceType and assigns it to the DeviceType field. +func (o *ConsolePortTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *ConsolePortTemplate) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *ConsolePortTemplate) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePortTemplate) GetModuleType() NestedModuleType { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleType + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortTemplate) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *ConsolePortTemplate) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleType and assigns it to the ModuleType field. +func (o *ConsolePortTemplate) SetModuleType(v NestedModuleType) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *ConsolePortTemplate) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *ConsolePortTemplate) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *ConsolePortTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsolePortTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsolePortTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsolePortTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsolePortTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsolePortTemplate) GetType() ConsolePortType { + if o == nil || IsNil(o.Type) { + var ret ConsolePortType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplate) GetTypeOk() (*ConsolePortType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsolePortTemplate) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortType and assigns it to the Type field. +func (o *ConsolePortTemplate) SetType(v ConsolePortType) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsolePortTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsolePortTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsolePortTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsolePortTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ConsolePortTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsolePortTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ConsolePortTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ConsolePortTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsolePortTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsolePortTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsolePortTemplate := _ConsolePortTemplate{} + + err = json.Unmarshal(data, &varConsolePortTemplate) + + if err != nil { + return err + } + + *o = ConsolePortTemplate(varConsolePortTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsolePortTemplate struct { + value *ConsolePortTemplate + isSet bool +} + +func (v NullableConsolePortTemplate) Get() *ConsolePortTemplate { + return v.value +} + +func (v *NullableConsolePortTemplate) Set(val *ConsolePortTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortTemplate(val *ConsolePortTemplate) *NullableConsolePortTemplate { + return &NullableConsolePortTemplate{value: val, isSet: true} +} + +func (v NullableConsolePortTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_template_request.go new file mode 100644 index 00000000..641bc194 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_template_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsolePortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsolePortTemplateRequest{} + +// ConsolePortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ConsolePortTemplateRequest struct { + DeviceType NullableNestedDeviceTypeRequest `json:"device_type,omitempty"` + ModuleType NullableNestedModuleTypeRequest `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsolePortTemplateRequest ConsolePortTemplateRequest + +// NewConsolePortTemplateRequest instantiates a new ConsolePortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsolePortTemplateRequest(name string) *ConsolePortTemplateRequest { + this := ConsolePortTemplateRequest{} + this.Name = name + return &this +} + +// NewConsolePortTemplateRequestWithDefaults instantiates a new ConsolePortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsolePortTemplateRequestWithDefaults() *ConsolePortTemplateRequest { + this := ConsolePortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePortTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceTypeRequest + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *ConsolePortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceTypeRequest and assigns it to the DeviceType field. +func (o *ConsolePortTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *ConsolePortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *ConsolePortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsolePortTemplateRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleTypeRequest + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsolePortTemplateRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *ConsolePortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleTypeRequest and assigns it to the ModuleType field. +func (o *ConsolePortTemplateRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *ConsolePortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *ConsolePortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *ConsolePortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsolePortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsolePortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsolePortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsolePortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsolePortTemplateRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplateRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsolePortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *ConsolePortTemplateRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsolePortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsolePortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsolePortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o ConsolePortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsolePortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsolePortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsolePortTemplateRequest := _ConsolePortTemplateRequest{} + + err = json.Unmarshal(data, &varConsolePortTemplateRequest) + + if err != nil { + return err + } + + *o = ConsolePortTemplateRequest(varConsolePortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsolePortTemplateRequest struct { + value *ConsolePortTemplateRequest + isSet bool +} + +func (v NullableConsolePortTemplateRequest) Get() *ConsolePortTemplateRequest { + return v.value +} + +func (v *NullableConsolePortTemplateRequest) Set(val *ConsolePortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortTemplateRequest(val *ConsolePortTemplateRequest) *NullableConsolePortTemplateRequest { + return &NullableConsolePortTemplateRequest{value: val, isSet: true} +} + +func (v NullableConsolePortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type.go new file mode 100644 index 00000000..0a9c99f1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ConsolePortType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsolePortType{} + +// ConsolePortType struct for ConsolePortType +type ConsolePortType struct { + Value *ConsolePortTypeValue `json:"value,omitempty"` + Label *ConsolePortTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsolePortType ConsolePortType + +// NewConsolePortType instantiates a new ConsolePortType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsolePortType() *ConsolePortType { + this := ConsolePortType{} + return &this +} + +// NewConsolePortTypeWithDefaults instantiates a new ConsolePortType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsolePortTypeWithDefaults() *ConsolePortType { + this := ConsolePortType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ConsolePortType) GetValue() ConsolePortTypeValue { + if o == nil || IsNil(o.Value) { + var ret ConsolePortTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortType) GetValueOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ConsolePortType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given ConsolePortTypeValue and assigns it to the Value field. +func (o *ConsolePortType) SetValue(v ConsolePortTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsolePortType) GetLabel() ConsolePortTypeLabel { + if o == nil || IsNil(o.Label) { + var ret ConsolePortTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsolePortType) GetLabelOk() (*ConsolePortTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsolePortType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given ConsolePortTypeLabel and assigns it to the Label field. +func (o *ConsolePortType) SetLabel(v ConsolePortTypeLabel) { + o.Label = &v +} + +func (o ConsolePortType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsolePortType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsolePortType) UnmarshalJSON(data []byte) (err error) { + varConsolePortType := _ConsolePortType{} + + err = json.Unmarshal(data, &varConsolePortType) + + if err != nil { + return err + } + + *o = ConsolePortType(varConsolePortType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsolePortType struct { + value *ConsolePortType + isSet bool +} + +func (v NullableConsolePortType) Get() *ConsolePortType { + return v.value +} + +func (v *NullableConsolePortType) Set(val *ConsolePortType) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortType) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortType(val *ConsolePortType) *NullableConsolePortType { + return &NullableConsolePortType{value: val, isSet: true} +} + +func (v NullableConsolePortType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type_label.go new file mode 100644 index 00000000..69ea5572 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type_label.go @@ -0,0 +1,136 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ConsolePortTypeLabel the model 'ConsolePortTypeLabel' +type ConsolePortTypeLabel string + +// List of ConsolePort_type_label +const ( + CONSOLEPORTTYPELABEL_DE_9 ConsolePortTypeLabel = "DE-9" + CONSOLEPORTTYPELABEL_DB_25 ConsolePortTypeLabel = "DB-25" + CONSOLEPORTTYPELABEL_RJ_11 ConsolePortTypeLabel = "RJ-11" + CONSOLEPORTTYPELABEL_RJ_12 ConsolePortTypeLabel = "RJ-12" + CONSOLEPORTTYPELABEL_RJ_45 ConsolePortTypeLabel = "RJ-45" + CONSOLEPORTTYPELABEL_MINI_DIN_8 ConsolePortTypeLabel = "Mini-DIN 8" + CONSOLEPORTTYPELABEL_USB_TYPE_A ConsolePortTypeLabel = "USB Type A" + CONSOLEPORTTYPELABEL_USB_TYPE_B ConsolePortTypeLabel = "USB Type B" + CONSOLEPORTTYPELABEL_USB_TYPE_C ConsolePortTypeLabel = "USB Type C" + CONSOLEPORTTYPELABEL_USB_MINI_A ConsolePortTypeLabel = "USB Mini A" + CONSOLEPORTTYPELABEL_USB_MINI_B ConsolePortTypeLabel = "USB Mini B" + CONSOLEPORTTYPELABEL_USB_MICRO_A ConsolePortTypeLabel = "USB Micro A" + CONSOLEPORTTYPELABEL_USB_MICRO_B ConsolePortTypeLabel = "USB Micro B" + CONSOLEPORTTYPELABEL_USB_MICRO_AB ConsolePortTypeLabel = "USB Micro AB" + CONSOLEPORTTYPELABEL_OTHER ConsolePortTypeLabel = "Other" +) + +// All allowed values of ConsolePortTypeLabel enum +var AllowedConsolePortTypeLabelEnumValues = []ConsolePortTypeLabel{ + "DE-9", + "DB-25", + "RJ-11", + "RJ-12", + "RJ-45", + "Mini-DIN 8", + "USB Type A", + "USB Type B", + "USB Type C", + "USB Mini A", + "USB Mini B", + "USB Micro A", + "USB Micro B", + "USB Micro AB", + "Other", +} + +func (v *ConsolePortTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsolePortTypeLabel(value) + for _, existing := range AllowedConsolePortTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsolePortTypeLabel", value) +} + +// NewConsolePortTypeLabelFromValue returns a pointer to a valid ConsolePortTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsolePortTypeLabelFromValue(v string) (*ConsolePortTypeLabel, error) { + ev := ConsolePortTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsolePortTypeLabel: valid values are %v", v, AllowedConsolePortTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsolePortTypeLabel) IsValid() bool { + for _, existing := range AllowedConsolePortTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsolePort_type_label value +func (v ConsolePortTypeLabel) Ptr() *ConsolePortTypeLabel { + return &v +} + +type NullableConsolePortTypeLabel struct { + value *ConsolePortTypeLabel + isSet bool +} + +func (v NullableConsolePortTypeLabel) Get() *ConsolePortTypeLabel { + return v.value +} + +func (v *NullableConsolePortTypeLabel) Set(val *ConsolePortTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortTypeLabel(val *ConsolePortTypeLabel) *NullableConsolePortTypeLabel { + return &NullableConsolePortTypeLabel{value: val, isSet: true} +} + +func (v NullableConsolePortTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type_value.go new file mode 100644 index 00000000..761e19f0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_port_type_value.go @@ -0,0 +1,138 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ConsolePortTypeValue * `de-9` - DE-9 * `db-25` - DB-25 * `rj-11` - RJ-11 * `rj-12` - RJ-12 * `rj-45` - RJ-45 * `mini-din-8` - Mini-DIN 8 * `usb-a` - USB Type A * `usb-b` - USB Type B * `usb-c` - USB Type C * `usb-mini-a` - USB Mini A * `usb-mini-b` - USB Mini B * `usb-micro-a` - USB Micro A * `usb-micro-b` - USB Micro B * `usb-micro-ab` - USB Micro AB * `other` - Other +type ConsolePortTypeValue string + +// List of ConsolePort_type_value +const ( + CONSOLEPORTTYPEVALUE_DE_9 ConsolePortTypeValue = "de-9" + CONSOLEPORTTYPEVALUE_DB_25 ConsolePortTypeValue = "db-25" + CONSOLEPORTTYPEVALUE_RJ_11 ConsolePortTypeValue = "rj-11" + CONSOLEPORTTYPEVALUE_RJ_12 ConsolePortTypeValue = "rj-12" + CONSOLEPORTTYPEVALUE_RJ_45 ConsolePortTypeValue = "rj-45" + CONSOLEPORTTYPEVALUE_MINI_DIN_8 ConsolePortTypeValue = "mini-din-8" + CONSOLEPORTTYPEVALUE_USB_A ConsolePortTypeValue = "usb-a" + CONSOLEPORTTYPEVALUE_USB_B ConsolePortTypeValue = "usb-b" + CONSOLEPORTTYPEVALUE_USB_C ConsolePortTypeValue = "usb-c" + CONSOLEPORTTYPEVALUE_USB_MINI_A ConsolePortTypeValue = "usb-mini-a" + CONSOLEPORTTYPEVALUE_USB_MINI_B ConsolePortTypeValue = "usb-mini-b" + CONSOLEPORTTYPEVALUE_USB_MICRO_A ConsolePortTypeValue = "usb-micro-a" + CONSOLEPORTTYPEVALUE_USB_MICRO_B ConsolePortTypeValue = "usb-micro-b" + CONSOLEPORTTYPEVALUE_USB_MICRO_AB ConsolePortTypeValue = "usb-micro-ab" + CONSOLEPORTTYPEVALUE_OTHER ConsolePortTypeValue = "other" + CONSOLEPORTTYPEVALUE_EMPTY ConsolePortTypeValue = "" +) + +// All allowed values of ConsolePortTypeValue enum +var AllowedConsolePortTypeValueEnumValues = []ConsolePortTypeValue{ + "de-9", + "db-25", + "rj-11", + "rj-12", + "rj-45", + "mini-din-8", + "usb-a", + "usb-b", + "usb-c", + "usb-mini-a", + "usb-mini-b", + "usb-micro-a", + "usb-micro-b", + "usb-micro-ab", + "other", + "", +} + +func (v *ConsolePortTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsolePortTypeValue(value) + for _, existing := range AllowedConsolePortTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsolePortTypeValue", value) +} + +// NewConsolePortTypeValueFromValue returns a pointer to a valid ConsolePortTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsolePortTypeValueFromValue(v string) (*ConsolePortTypeValue, error) { + ev := ConsolePortTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsolePortTypeValue: valid values are %v", v, AllowedConsolePortTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsolePortTypeValue) IsValid() bool { + for _, existing := range AllowedConsolePortTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsolePort_type_value value +func (v ConsolePortTypeValue) Ptr() *ConsolePortTypeValue { + return &v +} + +type NullableConsolePortTypeValue struct { + value *ConsolePortTypeValue + isSet bool +} + +func (v NullableConsolePortTypeValue) Get() *ConsolePortTypeValue { + return v.value +} + +func (v *NullableConsolePortTypeValue) Set(val *ConsolePortTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableConsolePortTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableConsolePortTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsolePortTypeValue(val *ConsolePortTypeValue) *NullableConsolePortTypeValue { + return &NullableConsolePortTypeValue{value: val, isSet: true} +} + +func (v NullableConsolePortTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsolePortTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port.go new file mode 100644 index 00000000..d35747c3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port.go @@ -0,0 +1,900 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ConsoleServerPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsoleServerPort{} + +// ConsoleServerPort Adds support for custom fields and tags. +type ConsoleServerPort struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Module NullableComponentNestedModule `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortType `json:"type,omitempty"` + Speed NullableConsolePortSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` + ConnectedEndpointsType string `json:"connected_endpoints_type"` + ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _ConsoleServerPort ConsoleServerPort + +// NewConsoleServerPort instantiates a new ConsoleServerPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsoleServerPort(id int32, url string, display string, device NestedDevice, name string, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, connectedEndpoints []interface{}, connectedEndpointsType string, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *ConsoleServerPort { + this := ConsoleServerPort{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.ConnectedEndpoints = connectedEndpoints + this.ConnectedEndpointsType = connectedEndpointsType + this.ConnectedEndpointsReachable = connectedEndpointsReachable + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewConsoleServerPortWithDefaults instantiates a new ConsoleServerPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsoleServerPortWithDefaults() *ConsoleServerPort { + this := ConsoleServerPort{} + return &this +} + +// GetId returns the Id field value +func (o *ConsoleServerPort) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConsoleServerPort) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ConsoleServerPort) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ConsoleServerPort) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ConsoleServerPort) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ConsoleServerPort) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *ConsoleServerPort) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ConsoleServerPort) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPort) GetModule() ComponentNestedModule { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModule + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPort) GetModuleOk() (*ComponentNestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModule and assigns it to the Module field. +func (o *ConsoleServerPort) SetModule(v ComponentNestedModule) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *ConsoleServerPort) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *ConsoleServerPort) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *ConsoleServerPort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsoleServerPort) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsoleServerPort) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsoleServerPort) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsoleServerPort) GetType() ConsolePortType { + if o == nil || IsNil(o.Type) { + var ret ConsolePortType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetTypeOk() (*ConsolePortType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortType and assigns it to the Type field. +func (o *ConsoleServerPort) SetType(v ConsolePortType) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPort) GetSpeed() ConsolePortSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret ConsolePortSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPort) GetSpeedOk() (*ConsolePortSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableConsolePortSpeed and assigns it to the Speed field. +func (o *ConsoleServerPort) SetSpeed(v ConsolePortSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *ConsoleServerPort) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *ConsoleServerPort) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsoleServerPort) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsoleServerPort) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *ConsoleServerPort) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *ConsoleServerPort) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *ConsoleServerPort) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPort) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *ConsoleServerPort) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *ConsoleServerPort) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *ConsoleServerPort) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *ConsoleServerPort) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *ConsoleServerPort) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *ConsoleServerPort) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *ConsoleServerPort) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetConnectedEndpoints returns the ConnectedEndpoints field value +func (o *ConsoleServerPort) GetConnectedEndpoints() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConnectedEndpoints +} + +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetConnectedEndpointsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConnectedEndpoints, true +} + +// SetConnectedEndpoints sets field value +func (o *ConsoleServerPort) SetConnectedEndpoints(v []interface{}) { + o.ConnectedEndpoints = v +} + +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value +func (o *ConsoleServerPort) GetConnectedEndpointsType() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectedEndpointsType +} + +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetConnectedEndpointsTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsType, true +} + +// SetConnectedEndpointsType sets field value +func (o *ConsoleServerPort) SetConnectedEndpointsType(v string) { + o.ConnectedEndpointsType = v +} + +// GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value +func (o *ConsoleServerPort) GetConnectedEndpointsReachable() bool { + if o == nil { + var ret bool + return ret + } + + return o.ConnectedEndpointsReachable +} + +// GetConnectedEndpointsReachableOk returns a tuple with the ConnectedEndpointsReachable field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetConnectedEndpointsReachableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsReachable, true +} + +// SetConnectedEndpointsReachable sets field value +func (o *ConsoleServerPort) SetConnectedEndpointsReachable(v bool) { + o.ConnectedEndpointsReachable = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConsoleServerPort) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ConsoleServerPort) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ConsoleServerPort) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ConsoleServerPort) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsoleServerPort) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPort) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ConsoleServerPort) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsoleServerPort) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPort) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ConsoleServerPort) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *ConsoleServerPort) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPort) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *ConsoleServerPort) SetOccupied(v bool) { + o.Occupied = v +} + +func (o ConsoleServerPort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsoleServerPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + toSerialize["connected_endpoints"] = o.ConnectedEndpoints + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType + toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsoleServerPort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "connected_endpoints", + "connected_endpoints_type", + "connected_endpoints_reachable", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsoleServerPort := _ConsoleServerPort{} + + err = json.Unmarshal(data, &varConsoleServerPort) + + if err != nil { + return err + } + + *o = ConsoleServerPort(varConsoleServerPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "connected_endpoints") + delete(additionalProperties, "connected_endpoints_type") + delete(additionalProperties, "connected_endpoints_reachable") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsoleServerPort struct { + value *ConsoleServerPort + isSet bool +} + +func (v NullableConsoleServerPort) Get() *ConsoleServerPort { + return v.value +} + +func (v *NullableConsoleServerPort) Set(val *ConsoleServerPort) { + v.value = val + v.isSet = true +} + +func (v NullableConsoleServerPort) IsSet() bool { + return v.isSet +} + +func (v *NullableConsoleServerPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsoleServerPort(val *ConsoleServerPort) *NullableConsoleServerPort { + return &NullableConsoleServerPort{value: val, isSet: true} +} + +func (v NullableConsoleServerPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsoleServerPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_request.go new file mode 100644 index 00000000..331f5a5b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_request.go @@ -0,0 +1,515 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsoleServerPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsoleServerPortRequest{} + +// ConsoleServerPortRequest Adds support for custom fields and tags. +type ConsoleServerPortRequest struct { + Device NestedDeviceRequest `json:"device"` + Module NullableComponentNestedModuleRequest `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Speed NullableConsolePortRequestSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsoleServerPortRequest ConsoleServerPortRequest + +// NewConsoleServerPortRequest instantiates a new ConsoleServerPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsoleServerPortRequest(device NestedDeviceRequest, name string) *ConsoleServerPortRequest { + this := ConsoleServerPortRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewConsoleServerPortRequestWithDefaults instantiates a new ConsoleServerPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsoleServerPortRequestWithDefaults() *ConsoleServerPortRequest { + this := ConsoleServerPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *ConsoleServerPortRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ConsoleServerPortRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPortRequest) GetModule() ComponentNestedModuleRequest { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModuleRequest + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortRequest) GetModuleOk() (*ComponentNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModuleRequest and assigns it to the Module field. +func (o *ConsoleServerPortRequest) SetModule(v ComponentNestedModuleRequest) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *ConsoleServerPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *ConsoleServerPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *ConsoleServerPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsoleServerPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsoleServerPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsoleServerPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsoleServerPortRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *ConsoleServerPortRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPortRequest) GetSpeed() ConsolePortRequestSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret ConsolePortRequestSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortRequest) GetSpeedOk() (*ConsolePortRequestSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableConsolePortRequestSpeed and assigns it to the Speed field. +func (o *ConsoleServerPortRequest) SetSpeed(v ConsolePortRequestSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *ConsoleServerPortRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *ConsoleServerPortRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsoleServerPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsoleServerPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *ConsoleServerPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *ConsoleServerPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ConsoleServerPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ConsoleServerPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ConsoleServerPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ConsoleServerPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ConsoleServerPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ConsoleServerPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsoleServerPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsoleServerPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsoleServerPortRequest := _ConsoleServerPortRequest{} + + err = json.Unmarshal(data, &varConsoleServerPortRequest) + + if err != nil { + return err + } + + *o = ConsoleServerPortRequest(varConsoleServerPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsoleServerPortRequest struct { + value *ConsoleServerPortRequest + isSet bool +} + +func (v NullableConsoleServerPortRequest) Get() *ConsoleServerPortRequest { + return v.value +} + +func (v *NullableConsoleServerPortRequest) Set(val *ConsoleServerPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConsoleServerPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConsoleServerPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsoleServerPortRequest(val *ConsoleServerPortRequest) *NullableConsoleServerPortRequest { + return &NullableConsoleServerPortRequest{value: val, isSet: true} +} + +func (v NullableConsoleServerPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsoleServerPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_template.go new file mode 100644 index 00000000..5f90fd8d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_template.go @@ -0,0 +1,525 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ConsoleServerPortTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsoleServerPortTemplate{} + +// ConsoleServerPortTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ConsoleServerPortTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NullableNestedDeviceType `json:"device_type,omitempty"` + ModuleType NullableNestedModuleType `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortType `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ConsoleServerPortTemplate ConsoleServerPortTemplate + +// NewConsoleServerPortTemplate instantiates a new ConsoleServerPortTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsoleServerPortTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *ConsoleServerPortTemplate { + this := ConsoleServerPortTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewConsoleServerPortTemplateWithDefaults instantiates a new ConsoleServerPortTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsoleServerPortTemplateWithDefaults() *ConsoleServerPortTemplate { + this := ConsoleServerPortTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *ConsoleServerPortTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConsoleServerPortTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ConsoleServerPortTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ConsoleServerPortTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ConsoleServerPortTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ConsoleServerPortTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPortTemplate) GetDeviceType() NestedDeviceType { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceType + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplate) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceType and assigns it to the DeviceType field. +func (o *ConsoleServerPortTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *ConsoleServerPortTemplate) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *ConsoleServerPortTemplate) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPortTemplate) GetModuleType() NestedModuleType { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleType + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortTemplate) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplate) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleType and assigns it to the ModuleType field. +func (o *ConsoleServerPortTemplate) SetModuleType(v NestedModuleType) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *ConsoleServerPortTemplate) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *ConsoleServerPortTemplate) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *ConsoleServerPortTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsoleServerPortTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsoleServerPortTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsoleServerPortTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsoleServerPortTemplate) GetType() ConsolePortType { + if o == nil || IsNil(o.Type) { + var ret ConsolePortType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplate) GetTypeOk() (*ConsolePortType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplate) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortType and assigns it to the Type field. +func (o *ConsoleServerPortTemplate) SetType(v ConsolePortType) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsoleServerPortTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsoleServerPortTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsoleServerPortTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ConsoleServerPortTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ConsoleServerPortTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ConsoleServerPortTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ConsoleServerPortTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsoleServerPortTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsoleServerPortTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsoleServerPortTemplate := _ConsoleServerPortTemplate{} + + err = json.Unmarshal(data, &varConsoleServerPortTemplate) + + if err != nil { + return err + } + + *o = ConsoleServerPortTemplate(varConsoleServerPortTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsoleServerPortTemplate struct { + value *ConsoleServerPortTemplate + isSet bool +} + +func (v NullableConsoleServerPortTemplate) Get() *ConsoleServerPortTemplate { + return v.value +} + +func (v *NullableConsoleServerPortTemplate) Set(val *ConsoleServerPortTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableConsoleServerPortTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableConsoleServerPortTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsoleServerPortTemplate(val *ConsoleServerPortTemplate) *NullableConsoleServerPortTemplate { + return &NullableConsoleServerPortTemplate{value: val, isSet: true} +} + +func (v NullableConsoleServerPortTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsoleServerPortTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_template_request.go new file mode 100644 index 00000000..5855ad80 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_console_server_port_template_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsoleServerPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsoleServerPortTemplateRequest{} + +// ConsoleServerPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ConsoleServerPortTemplateRequest struct { + DeviceType NullableNestedDeviceTypeRequest `json:"device_type,omitempty"` + ModuleType NullableNestedModuleTypeRequest `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsoleServerPortTemplateRequest ConsoleServerPortTemplateRequest + +// NewConsoleServerPortTemplateRequest instantiates a new ConsoleServerPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsoleServerPortTemplateRequest(name string) *ConsoleServerPortTemplateRequest { + this := ConsoleServerPortTemplateRequest{} + this.Name = name + return &this +} + +// NewConsoleServerPortTemplateRequestWithDefaults instantiates a new ConsoleServerPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsoleServerPortTemplateRequestWithDefaults() *ConsoleServerPortTemplateRequest { + this := ConsoleServerPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPortTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceTypeRequest + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceTypeRequest and assigns it to the DeviceType field. +func (o *ConsoleServerPortTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *ConsoleServerPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *ConsoleServerPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConsoleServerPortTemplateRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleTypeRequest + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConsoleServerPortTemplateRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleTypeRequest and assigns it to the ModuleType field. +func (o *ConsoleServerPortTemplateRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *ConsoleServerPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *ConsoleServerPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *ConsoleServerPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsoleServerPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ConsoleServerPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ConsoleServerPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ConsoleServerPortTemplateRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplateRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *ConsoleServerPortTemplateRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConsoleServerPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsoleServerPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConsoleServerPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o ConsoleServerPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsoleServerPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsoleServerPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsoleServerPortTemplateRequest := _ConsoleServerPortTemplateRequest{} + + err = json.Unmarshal(data, &varConsoleServerPortTemplateRequest) + + if err != nil { + return err + } + + *o = ConsoleServerPortTemplateRequest(varConsoleServerPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsoleServerPortTemplateRequest struct { + value *ConsoleServerPortTemplateRequest + isSet bool +} + +func (v NullableConsoleServerPortTemplateRequest) Get() *ConsoleServerPortTemplateRequest { + return v.value +} + +func (v *NullableConsoleServerPortTemplateRequest) Set(val *ConsoleServerPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConsoleServerPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConsoleServerPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsoleServerPortTemplateRequest(val *ConsoleServerPortTemplateRequest) *NullableConsoleServerPortTemplateRequest { + return &NullableConsoleServerPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableConsoleServerPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsoleServerPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact.go new file mode 100644 index 00000000..beb2ac09 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact.go @@ -0,0 +1,697 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Contact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Contact{} + +// Contact Adds support for custom fields and tags. +type Contact struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Group NullableNestedContactGroup `json:"group,omitempty"` + Name string `json:"name"` + Title *string `json:"title,omitempty"` + Phone *string `json:"phone,omitempty"` + Email *string `json:"email,omitempty"` + Address *string `json:"address,omitempty"` + Link *string `json:"link,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Contact Contact + +// NewContact instantiates a new Contact object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContact(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *Contact { + this := Contact{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewContactWithDefaults instantiates a new Contact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactWithDefaults() *Contact { + this := Contact{} + return &this +} + +// GetId returns the Id field value +func (o *Contact) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Contact) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Contact) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Contact) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Contact) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Contact) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Contact) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Contact) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Contact) SetDisplay(v string) { + o.Display = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Contact) GetGroup() NestedContactGroup { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedContactGroup + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Contact) GetGroupOk() (*NestedContactGroup, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *Contact) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedContactGroup and assigns it to the Group field. +func (o *Contact) SetGroup(v NestedContactGroup) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *Contact) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *Contact) UnsetGroup() { + o.Group.Unset() +} + +// GetName returns the Name field value +func (o *Contact) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Contact) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Contact) SetName(v string) { + o.Name = v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *Contact) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *Contact) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *Contact) SetTitle(v string) { + o.Title = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *Contact) GetPhone() string { + if o == nil || IsNil(o.Phone) { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetPhoneOk() (*string, bool) { + if o == nil || IsNil(o.Phone) { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *Contact) HasPhone() bool { + if o != nil && !IsNil(o.Phone) { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *Contact) SetPhone(v string) { + o.Phone = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *Contact) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *Contact) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *Contact) SetEmail(v string) { + o.Email = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *Contact) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *Contact) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *Contact) SetAddress(v string) { + o.Address = &v +} + +// GetLink returns the Link field value if set, zero value otherwise. +func (o *Contact) GetLink() string { + if o == nil || IsNil(o.Link) { + var ret string + return ret + } + return *o.Link +} + +// GetLinkOk returns a tuple with the Link field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetLinkOk() (*string, bool) { + if o == nil || IsNil(o.Link) { + return nil, false + } + return o.Link, true +} + +// HasLink returns a boolean if a field has been set. +func (o *Contact) HasLink() bool { + if o != nil && !IsNil(o.Link) { + return true + } + + return false +} + +// SetLink gets a reference to the given string and assigns it to the Link field. +func (o *Contact) SetLink(v string) { + o.Link = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Contact) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Contact) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Contact) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Contact) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Contact) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Contact) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Contact) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Contact) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Contact) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Contact) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Contact) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Contact) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Contact) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Contact) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Contact) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Contact) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Contact) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Contact) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Contact) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Contact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.Phone) { + toSerialize["phone"] = o.Phone + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Link) { + toSerialize["link"] = o.Link + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Contact) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContact := _Contact{} + + err = json.Unmarshal(data, &varContact) + + if err != nil { + return err + } + + *o = Contact(varContact) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "group") + delete(additionalProperties, "name") + delete(additionalProperties, "title") + delete(additionalProperties, "phone") + delete(additionalProperties, "email") + delete(additionalProperties, "address") + delete(additionalProperties, "link") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContact struct { + value *Contact + isSet bool +} + +func (v NullableContact) Get() *Contact { + return v.value +} + +func (v *NullableContact) Set(val *Contact) { + v.value = val + v.isSet = true +} + +func (v NullableContact) IsSet() bool { + return v.isSet +} + +func (v *NullableContact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContact(val *Contact) *NullableContact { + return &NullableContact{value: val, isSet: true} +} + +func (v NullableContact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment.go new file mode 100644 index 00000000..24be898e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ContactAssignment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactAssignment{} + +// ContactAssignment Adds support for custom fields and tags. +type ContactAssignment struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ContentType string `json:"content_type"` + ObjectId int64 `json:"object_id"` + Object map[string]interface{} `json:"object"` + Contact NestedContact `json:"contact"` + Role NullableNestedContactRole `json:"role,omitempty"` + Priority *ContactAssignmentPriority `json:"priority,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ContactAssignment ContactAssignment + +// NewContactAssignment instantiates a new ContactAssignment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactAssignment(id int32, url string, display string, contentType string, objectId int64, object map[string]interface{}, contact NestedContact, created NullableTime, lastUpdated NullableTime) *ContactAssignment { + this := ContactAssignment{} + this.Id = id + this.Url = url + this.Display = display + this.ContentType = contentType + this.ObjectId = objectId + this.Object = object + this.Contact = contact + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewContactAssignmentWithDefaults instantiates a new ContactAssignment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactAssignmentWithDefaults() *ContactAssignment { + this := ContactAssignment{} + return &this +} + +// GetId returns the Id field value +func (o *ContactAssignment) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ContactAssignment) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ContactAssignment) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ContactAssignment) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ContactAssignment) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ContactAssignment) SetDisplay(v string) { + o.Display = v +} + +// GetContentType returns the ContentType field value +func (o *ContactAssignment) GetContentType() string { + if o == nil { + var ret string + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetContentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *ContactAssignment) SetContentType(v string) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value +func (o *ContactAssignment) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *ContactAssignment) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetObject returns the Object field value +func (o *ContactAssignment) GetObject() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetObjectOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Object, true +} + +// SetObject sets field value +func (o *ContactAssignment) SetObject(v map[string]interface{}) { + o.Object = v +} + +// GetContact returns the Contact field value +func (o *ContactAssignment) GetContact() NestedContact { + if o == nil { + var ret NestedContact + return ret + } + + return o.Contact +} + +// GetContactOk returns a tuple with the Contact field value +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetContactOk() (*NestedContact, bool) { + if o == nil { + return nil, false + } + return &o.Contact, true +} + +// SetContact sets field value +func (o *ContactAssignment) SetContact(v NestedContact) { + o.Contact = v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContactAssignment) GetRole() NestedContactRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedContactRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactAssignment) GetRoleOk() (*NestedContactRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *ContactAssignment) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedContactRole and assigns it to the Role field. +func (o *ContactAssignment) SetRole(v NestedContactRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *ContactAssignment) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *ContactAssignment) UnsetRole() { + o.Role.Unset() +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *ContactAssignment) GetPriority() ContactAssignmentPriority { + if o == nil || IsNil(o.Priority) { + var ret ContactAssignmentPriority + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetPriorityOk() (*ContactAssignmentPriority, bool) { + if o == nil || IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *ContactAssignment) HasPriority() bool { + if o != nil && !IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given ContactAssignmentPriority and assigns it to the Priority field. +func (o *ContactAssignment) SetPriority(v ContactAssignmentPriority) { + o.Priority = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ContactAssignment) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ContactAssignment) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ContactAssignment) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ContactAssignment) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignment) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ContactAssignment) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ContactAssignment) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ContactAssignment) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactAssignment) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ContactAssignment) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ContactAssignment) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactAssignment) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ContactAssignment) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ContactAssignment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactAssignment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["content_type"] = o.ContentType + toSerialize["object_id"] = o.ObjectId + toSerialize["object"] = o.Object + toSerialize["contact"] = o.Contact + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactAssignment) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "content_type", + "object_id", + "object", + "contact", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContactAssignment := _ContactAssignment{} + + err = json.Unmarshal(data, &varContactAssignment) + + if err != nil { + return err + } + + *o = ContactAssignment(varContactAssignment) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "object") + delete(additionalProperties, "contact") + delete(additionalProperties, "role") + delete(additionalProperties, "priority") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactAssignment struct { + value *ContactAssignment + isSet bool +} + +func (v NullableContactAssignment) Get() *ContactAssignment { + return v.value +} + +func (v *NullableContactAssignment) Set(val *ContactAssignment) { + v.value = val + v.isSet = true +} + +func (v NullableContactAssignment) IsSet() bool { + return v.isSet +} + +func (v *NullableContactAssignment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactAssignment(val *ContactAssignment) *NullableContactAssignment { + return &NullableContactAssignment{value: val, isSet: true} +} + +func (v NullableContactAssignment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactAssignment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority.go new file mode 100644 index 00000000..10558561 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ContactAssignmentPriority type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactAssignmentPriority{} + +// ContactAssignmentPriority struct for ContactAssignmentPriority +type ContactAssignmentPriority struct { + Value *ContactAssignmentPriorityValue `json:"value,omitempty"` + Label *ContactAssignmentPriorityLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContactAssignmentPriority ContactAssignmentPriority + +// NewContactAssignmentPriority instantiates a new ContactAssignmentPriority object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactAssignmentPriority() *ContactAssignmentPriority { + this := ContactAssignmentPriority{} + return &this +} + +// NewContactAssignmentPriorityWithDefaults instantiates a new ContactAssignmentPriority object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactAssignmentPriorityWithDefaults() *ContactAssignmentPriority { + this := ContactAssignmentPriority{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ContactAssignmentPriority) GetValue() ContactAssignmentPriorityValue { + if o == nil || IsNil(o.Value) { + var ret ContactAssignmentPriorityValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignmentPriority) GetValueOk() (*ContactAssignmentPriorityValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ContactAssignmentPriority) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given ContactAssignmentPriorityValue and assigns it to the Value field. +func (o *ContactAssignmentPriority) SetValue(v ContactAssignmentPriorityValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ContactAssignmentPriority) GetLabel() ContactAssignmentPriorityLabel { + if o == nil || IsNil(o.Label) { + var ret ContactAssignmentPriorityLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignmentPriority) GetLabelOk() (*ContactAssignmentPriorityLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ContactAssignmentPriority) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given ContactAssignmentPriorityLabel and assigns it to the Label field. +func (o *ContactAssignmentPriority) SetLabel(v ContactAssignmentPriorityLabel) { + o.Label = &v +} + +func (o ContactAssignmentPriority) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactAssignmentPriority) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactAssignmentPriority) UnmarshalJSON(data []byte) (err error) { + varContactAssignmentPriority := _ContactAssignmentPriority{} + + err = json.Unmarshal(data, &varContactAssignmentPriority) + + if err != nil { + return err + } + + *o = ContactAssignmentPriority(varContactAssignmentPriority) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactAssignmentPriority struct { + value *ContactAssignmentPriority + isSet bool +} + +func (v NullableContactAssignmentPriority) Get() *ContactAssignmentPriority { + return v.value +} + +func (v *NullableContactAssignmentPriority) Set(val *ContactAssignmentPriority) { + v.value = val + v.isSet = true +} + +func (v NullableContactAssignmentPriority) IsSet() bool { + return v.isSet +} + +func (v *NullableContactAssignmentPriority) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactAssignmentPriority(val *ContactAssignmentPriority) *NullableContactAssignmentPriority { + return &NullableContactAssignmentPriority{value: val, isSet: true} +} + +func (v NullableContactAssignmentPriority) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactAssignmentPriority) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority_label.go new file mode 100644 index 00000000..3602cd60 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ContactAssignmentPriorityLabel the model 'ContactAssignmentPriorityLabel' +type ContactAssignmentPriorityLabel string + +// List of ContactAssignment_priority_label +const ( + CONTACTASSIGNMENTPRIORITYLABEL_PRIMARY ContactAssignmentPriorityLabel = "Primary" + CONTACTASSIGNMENTPRIORITYLABEL_SECONDARY ContactAssignmentPriorityLabel = "Secondary" + CONTACTASSIGNMENTPRIORITYLABEL_TERTIARY ContactAssignmentPriorityLabel = "Tertiary" + CONTACTASSIGNMENTPRIORITYLABEL_INACTIVE ContactAssignmentPriorityLabel = "Inactive" +) + +// All allowed values of ContactAssignmentPriorityLabel enum +var AllowedContactAssignmentPriorityLabelEnumValues = []ContactAssignmentPriorityLabel{ + "Primary", + "Secondary", + "Tertiary", + "Inactive", +} + +func (v *ContactAssignmentPriorityLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ContactAssignmentPriorityLabel(value) + for _, existing := range AllowedContactAssignmentPriorityLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ContactAssignmentPriorityLabel", value) +} + +// NewContactAssignmentPriorityLabelFromValue returns a pointer to a valid ContactAssignmentPriorityLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewContactAssignmentPriorityLabelFromValue(v string) (*ContactAssignmentPriorityLabel, error) { + ev := ContactAssignmentPriorityLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ContactAssignmentPriorityLabel: valid values are %v", v, AllowedContactAssignmentPriorityLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ContactAssignmentPriorityLabel) IsValid() bool { + for _, existing := range AllowedContactAssignmentPriorityLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ContactAssignment_priority_label value +func (v ContactAssignmentPriorityLabel) Ptr() *ContactAssignmentPriorityLabel { + return &v +} + +type NullableContactAssignmentPriorityLabel struct { + value *ContactAssignmentPriorityLabel + isSet bool +} + +func (v NullableContactAssignmentPriorityLabel) Get() *ContactAssignmentPriorityLabel { + return v.value +} + +func (v *NullableContactAssignmentPriorityLabel) Set(val *ContactAssignmentPriorityLabel) { + v.value = val + v.isSet = true +} + +func (v NullableContactAssignmentPriorityLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableContactAssignmentPriorityLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactAssignmentPriorityLabel(val *ContactAssignmentPriorityLabel) *NullableContactAssignmentPriorityLabel { + return &NullableContactAssignmentPriorityLabel{value: val, isSet: true} +} + +func (v NullableContactAssignmentPriorityLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactAssignmentPriorityLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority_value.go new file mode 100644 index 00000000..5f3dd888 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_priority_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ContactAssignmentPriorityValue * `primary` - Primary * `secondary` - Secondary * `tertiary` - Tertiary * `inactive` - Inactive +type ContactAssignmentPriorityValue string + +// List of ContactAssignment_priority_value +const ( + CONTACTASSIGNMENTPRIORITYVALUE_PRIMARY ContactAssignmentPriorityValue = "primary" + CONTACTASSIGNMENTPRIORITYVALUE_SECONDARY ContactAssignmentPriorityValue = "secondary" + CONTACTASSIGNMENTPRIORITYVALUE_TERTIARY ContactAssignmentPriorityValue = "tertiary" + CONTACTASSIGNMENTPRIORITYVALUE_INACTIVE ContactAssignmentPriorityValue = "inactive" + CONTACTASSIGNMENTPRIORITYVALUE_EMPTY ContactAssignmentPriorityValue = "" +) + +// All allowed values of ContactAssignmentPriorityValue enum +var AllowedContactAssignmentPriorityValueEnumValues = []ContactAssignmentPriorityValue{ + "primary", + "secondary", + "tertiary", + "inactive", + "", +} + +func (v *ContactAssignmentPriorityValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ContactAssignmentPriorityValue(value) + for _, existing := range AllowedContactAssignmentPriorityValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ContactAssignmentPriorityValue", value) +} + +// NewContactAssignmentPriorityValueFromValue returns a pointer to a valid ContactAssignmentPriorityValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewContactAssignmentPriorityValueFromValue(v string) (*ContactAssignmentPriorityValue, error) { + ev := ContactAssignmentPriorityValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ContactAssignmentPriorityValue: valid values are %v", v, AllowedContactAssignmentPriorityValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ContactAssignmentPriorityValue) IsValid() bool { + for _, existing := range AllowedContactAssignmentPriorityValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ContactAssignment_priority_value value +func (v ContactAssignmentPriorityValue) Ptr() *ContactAssignmentPriorityValue { + return &v +} + +type NullableContactAssignmentPriorityValue struct { + value *ContactAssignmentPriorityValue + isSet bool +} + +func (v NullableContactAssignmentPriorityValue) Get() *ContactAssignmentPriorityValue { + return v.value +} + +func (v *NullableContactAssignmentPriorityValue) Set(val *ContactAssignmentPriorityValue) { + v.value = val + v.isSet = true +} + +func (v NullableContactAssignmentPriorityValue) IsSet() bool { + return v.isSet +} + +func (v *NullableContactAssignmentPriorityValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactAssignmentPriorityValue(val *ContactAssignmentPriorityValue) *NullableContactAssignmentPriorityValue { + return &NullableContactAssignmentPriorityValue{value: val, isSet: true} +} + +func (v NullableContactAssignmentPriorityValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactAssignmentPriorityValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_request.go new file mode 100644 index 00000000..163aa34a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_assignment_request.go @@ -0,0 +1,383 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContactAssignmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactAssignmentRequest{} + +// ContactAssignmentRequest Adds support for custom fields and tags. +type ContactAssignmentRequest struct { + ContentType string `json:"content_type"` + ObjectId int64 `json:"object_id"` + Contact NestedContactRequest `json:"contact"` + Role NullableNestedContactRoleRequest `json:"role,omitempty"` + Priority *ContactAssignmentPriorityValue `json:"priority,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContactAssignmentRequest ContactAssignmentRequest + +// NewContactAssignmentRequest instantiates a new ContactAssignmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactAssignmentRequest(contentType string, objectId int64, contact NestedContactRequest) *ContactAssignmentRequest { + this := ContactAssignmentRequest{} + this.ContentType = contentType + this.ObjectId = objectId + this.Contact = contact + return &this +} + +// NewContactAssignmentRequestWithDefaults instantiates a new ContactAssignmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactAssignmentRequestWithDefaults() *ContactAssignmentRequest { + this := ContactAssignmentRequest{} + return &this +} + +// GetContentType returns the ContentType field value +func (o *ContactAssignmentRequest) GetContentType() string { + if o == nil { + var ret string + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *ContactAssignmentRequest) GetContentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *ContactAssignmentRequest) SetContentType(v string) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value +func (o *ContactAssignmentRequest) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *ContactAssignmentRequest) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *ContactAssignmentRequest) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetContact returns the Contact field value +func (o *ContactAssignmentRequest) GetContact() NestedContactRequest { + if o == nil { + var ret NestedContactRequest + return ret + } + + return o.Contact +} + +// GetContactOk returns a tuple with the Contact field value +// and a boolean to check if the value has been set. +func (o *ContactAssignmentRequest) GetContactOk() (*NestedContactRequest, bool) { + if o == nil { + return nil, false + } + return &o.Contact, true +} + +// SetContact sets field value +func (o *ContactAssignmentRequest) SetContact(v NestedContactRequest) { + o.Contact = v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContactAssignmentRequest) GetRole() NestedContactRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedContactRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactAssignmentRequest) GetRoleOk() (*NestedContactRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *ContactAssignmentRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedContactRoleRequest and assigns it to the Role field. +func (o *ContactAssignmentRequest) SetRole(v NestedContactRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *ContactAssignmentRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *ContactAssignmentRequest) UnsetRole() { + o.Role.Unset() +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *ContactAssignmentRequest) GetPriority() ContactAssignmentPriorityValue { + if o == nil || IsNil(o.Priority) { + var ret ContactAssignmentPriorityValue + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignmentRequest) GetPriorityOk() (*ContactAssignmentPriorityValue, bool) { + if o == nil || IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *ContactAssignmentRequest) HasPriority() bool { + if o != nil && !IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given ContactAssignmentPriorityValue and assigns it to the Priority field. +func (o *ContactAssignmentRequest) SetPriority(v ContactAssignmentPriorityValue) { + o.Priority = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ContactAssignmentRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignmentRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ContactAssignmentRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ContactAssignmentRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ContactAssignmentRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactAssignmentRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ContactAssignmentRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ContactAssignmentRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ContactAssignmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactAssignmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_type"] = o.ContentType + toSerialize["object_id"] = o.ObjectId + toSerialize["contact"] = o.Contact + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactAssignmentRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_type", + "object_id", + "contact", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContactAssignmentRequest := _ContactAssignmentRequest{} + + err = json.Unmarshal(data, &varContactAssignmentRequest) + + if err != nil { + return err + } + + *o = ContactAssignmentRequest(varContactAssignmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "contact") + delete(additionalProperties, "role") + delete(additionalProperties, "priority") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactAssignmentRequest struct { + value *ContactAssignmentRequest + isSet bool +} + +func (v NullableContactAssignmentRequest) Get() *ContactAssignmentRequest { + return v.value +} + +func (v *NullableContactAssignmentRequest) Set(val *ContactAssignmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableContactAssignmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableContactAssignmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactAssignmentRequest(val *ContactAssignmentRequest) *NullableContactAssignmentRequest { + return &NullableContactAssignmentRequest{value: val, isSet: true} +} + +func (v NullableContactAssignmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactAssignmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_group.go new file mode 100644 index 00000000..94863285 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_group.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ContactGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactGroup{} + +// ContactGroup Extends PrimaryModelSerializer to include MPTT support. +type ContactGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedContactGroup `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + ContactCount int32 `json:"contact_count"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _ContactGroup ContactGroup + +// NewContactGroup instantiates a new ContactGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, contactCount int32, depth int32) *ContactGroup { + this := ContactGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.ContactCount = contactCount + this.Depth = depth + return &this +} + +// NewContactGroupWithDefaults instantiates a new ContactGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactGroupWithDefaults() *ContactGroup { + this := ContactGroup{} + return &this +} + +// GetId returns the Id field value +func (o *ContactGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ContactGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ContactGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ContactGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ContactGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ContactGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ContactGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ContactGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ContactGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ContactGroup) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContactGroup) GetParent() NestedContactGroup { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedContactGroup + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactGroup) GetParentOk() (*NestedContactGroup, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *ContactGroup) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedContactGroup and assigns it to the Parent field. +func (o *ContactGroup) SetParent(v NestedContactGroup) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *ContactGroup) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *ContactGroup) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ContactGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ContactGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ContactGroup) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ContactGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ContactGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ContactGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ContactGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ContactGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ContactGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ContactGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ContactGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ContactGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ContactGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetContactCount returns the ContactCount field value +func (o *ContactGroup) GetContactCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ContactCount +} + +// GetContactCountOk returns a tuple with the ContactCount field value +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetContactCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ContactCount, true +} + +// SetContactCount sets field value +func (o *ContactGroup) SetContactCount(v int32) { + o.ContactCount = v +} + +// GetDepth returns the Depth field value +func (o *ContactGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *ContactGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *ContactGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o ContactGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["contact_count"] = o.ContactCount + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "contact_count", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContactGroup := _ContactGroup{} + + err = json.Unmarshal(data, &varContactGroup) + + if err != nil { + return err + } + + *o = ContactGroup(varContactGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "contact_count") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactGroup struct { + value *ContactGroup + isSet bool +} + +func (v NullableContactGroup) Get() *ContactGroup { + return v.value +} + +func (v *NullableContactGroup) Set(val *ContactGroup) { + v.value = val + v.isSet = true +} + +func (v NullableContactGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableContactGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactGroup(val *ContactGroup) *NullableContactGroup { + return &NullableContactGroup{value: val, isSet: true} +} + +func (v NullableContactGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_group_request.go new file mode 100644 index 00000000..81928fb5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContactGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactGroupRequest{} + +// ContactGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type ContactGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedContactGroupRequest `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContactGroupRequest ContactGroupRequest + +// NewContactGroupRequest instantiates a new ContactGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactGroupRequest(name string, slug string) *ContactGroupRequest { + this := ContactGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewContactGroupRequestWithDefaults instantiates a new ContactGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactGroupRequestWithDefaults() *ContactGroupRequest { + this := ContactGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ContactGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ContactGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ContactGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ContactGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ContactGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ContactGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContactGroupRequest) GetParent() NestedContactGroupRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedContactGroupRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactGroupRequest) GetParentOk() (*NestedContactGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *ContactGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedContactGroupRequest and assigns it to the Parent field. +func (o *ContactGroupRequest) SetParent(v NestedContactGroupRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *ContactGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *ContactGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ContactGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ContactGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ContactGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ContactGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ContactGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ContactGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ContactGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ContactGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ContactGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ContactGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContactGroupRequest := _ContactGroupRequest{} + + err = json.Unmarshal(data, &varContactGroupRequest) + + if err != nil { + return err + } + + *o = ContactGroupRequest(varContactGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactGroupRequest struct { + value *ContactGroupRequest + isSet bool +} + +func (v NullableContactGroupRequest) Get() *ContactGroupRequest { + return v.value +} + +func (v *NullableContactGroupRequest) Set(val *ContactGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableContactGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableContactGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactGroupRequest(val *ContactGroupRequest) *NullableContactGroupRequest { + return &NullableContactGroupRequest{value: val, isSet: true} +} + +func (v NullableContactGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_request.go new file mode 100644 index 00000000..ff1de877 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_request.go @@ -0,0 +1,547 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContactRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactRequest{} + +// ContactRequest Adds support for custom fields and tags. +type ContactRequest struct { + Group NullableNestedContactGroupRequest `json:"group,omitempty"` + Name string `json:"name"` + Title *string `json:"title,omitempty"` + Phone *string `json:"phone,omitempty"` + Email *string `json:"email,omitempty"` + Address *string `json:"address,omitempty"` + Link *string `json:"link,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContactRequest ContactRequest + +// NewContactRequest instantiates a new ContactRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactRequest(name string) *ContactRequest { + this := ContactRequest{} + this.Name = name + return &this +} + +// NewContactRequestWithDefaults instantiates a new ContactRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactRequestWithDefaults() *ContactRequest { + this := ContactRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContactRequest) GetGroup() NestedContactGroupRequest { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedContactGroupRequest + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactRequest) GetGroupOk() (*NestedContactGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *ContactRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedContactGroupRequest and assigns it to the Group field. +func (o *ContactRequest) SetGroup(v NestedContactGroupRequest) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *ContactRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *ContactRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetName returns the Name field value +func (o *ContactRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ContactRequest) SetName(v string) { + o.Name = v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *ContactRequest) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *ContactRequest) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *ContactRequest) SetTitle(v string) { + o.Title = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *ContactRequest) GetPhone() string { + if o == nil || IsNil(o.Phone) { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetPhoneOk() (*string, bool) { + if o == nil || IsNil(o.Phone) { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *ContactRequest) HasPhone() bool { + if o != nil && !IsNil(o.Phone) { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *ContactRequest) SetPhone(v string) { + o.Phone = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *ContactRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *ContactRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *ContactRequest) SetEmail(v string) { + o.Email = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *ContactRequest) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *ContactRequest) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *ContactRequest) SetAddress(v string) { + o.Address = &v +} + +// GetLink returns the Link field value if set, zero value otherwise. +func (o *ContactRequest) GetLink() string { + if o == nil || IsNil(o.Link) { + var ret string + return ret + } + return *o.Link +} + +// GetLinkOk returns a tuple with the Link field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetLinkOk() (*string, bool) { + if o == nil || IsNil(o.Link) { + return nil, false + } + return o.Link, true +} + +// HasLink returns a boolean if a field has been set. +func (o *ContactRequest) HasLink() bool { + if o != nil && !IsNil(o.Link) { + return true + } + + return false +} + +// SetLink gets a reference to the given string and assigns it to the Link field. +func (o *ContactRequest) SetLink(v string) { + o.Link = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ContactRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ContactRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ContactRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ContactRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ContactRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ContactRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ContactRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ContactRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ContactRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ContactRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ContactRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ContactRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ContactRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.Phone) { + toSerialize["phone"] = o.Phone + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Link) { + toSerialize["link"] = o.Link + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContactRequest := _ContactRequest{} + + err = json.Unmarshal(data, &varContactRequest) + + if err != nil { + return err + } + + *o = ContactRequest(varContactRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "name") + delete(additionalProperties, "title") + delete(additionalProperties, "phone") + delete(additionalProperties, "email") + delete(additionalProperties, "address") + delete(additionalProperties, "link") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactRequest struct { + value *ContactRequest + isSet bool +} + +func (v NullableContactRequest) Get() *ContactRequest { + return v.value +} + +func (v *NullableContactRequest) Set(val *ContactRequest) { + v.value = val + v.isSet = true +} + +func (v NullableContactRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableContactRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactRequest(val *ContactRequest) *NullableContactRequest { + return &NullableContactRequest{value: val, isSet: true} +} + +func (v NullableContactRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_role.go new file mode 100644 index 00000000..b9b04bb7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_role.go @@ -0,0 +1,456 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ContactRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactRole{} + +// ContactRole Adds support for custom fields and tags. +type ContactRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ContactRole ContactRole + +// NewContactRole instantiates a new ContactRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *ContactRole { + this := ContactRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewContactRoleWithDefaults instantiates a new ContactRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactRoleWithDefaults() *ContactRole { + this := ContactRole{} + return &this +} + +// GetId returns the Id field value +func (o *ContactRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ContactRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ContactRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ContactRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ContactRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ContactRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ContactRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ContactRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ContactRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ContactRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ContactRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ContactRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ContactRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ContactRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ContactRole) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ContactRole) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRole) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ContactRole) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ContactRole) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ContactRole) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRole) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ContactRole) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ContactRole) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ContactRole) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRole) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ContactRole) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ContactRole) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ContactRole) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactRole) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ContactRole) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ContactRole) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContactRole) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ContactRole) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ContactRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContactRole := _ContactRole{} + + err = json.Unmarshal(data, &varContactRole) + + if err != nil { + return err + } + + *o = ContactRole(varContactRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactRole struct { + value *ContactRole + isSet bool +} + +func (v NullableContactRole) Get() *ContactRole { + return v.value +} + +func (v *NullableContactRole) Set(val *ContactRole) { + v.value = val + v.isSet = true +} + +func (v NullableContactRole) IsSet() bool { + return v.isSet +} + +func (v *NullableContactRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactRole(val *ContactRole) *NullableContactRole { + return &NullableContactRole{value: val, isSet: true} +} + +func (v NullableContactRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_contact_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_role_request.go new file mode 100644 index 00000000..38c949b7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_contact_role_request.go @@ -0,0 +1,306 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContactRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactRoleRequest{} + +// ContactRoleRequest Adds support for custom fields and tags. +type ContactRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContactRoleRequest ContactRoleRequest + +// NewContactRoleRequest instantiates a new ContactRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContactRoleRequest(name string, slug string) *ContactRoleRequest { + this := ContactRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewContactRoleRequestWithDefaults instantiates a new ContactRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContactRoleRequestWithDefaults() *ContactRoleRequest { + this := ContactRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ContactRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ContactRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ContactRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ContactRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ContactRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ContactRoleRequest) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ContactRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ContactRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ContactRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ContactRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ContactRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ContactRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ContactRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ContactRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ContactRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ContactRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContactRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContactRoleRequest := _ContactRoleRequest{} + + err = json.Unmarshal(data, &varContactRoleRequest) + + if err != nil { + return err + } + + *o = ContactRoleRequest(varContactRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContactRoleRequest struct { + value *ContactRoleRequest + isSet bool +} + +func (v NullableContactRoleRequest) Get() *ContactRoleRequest { + return v.value +} + +func (v *NullableContactRoleRequest) Set(val *ContactRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableContactRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableContactRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactRoleRequest(val *ContactRoleRequest) *NullableContactRoleRequest { + return &NullableContactRoleRequest{value: val, isSet: true} +} + +func (v NullableContactRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_content_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_content_type.go new file mode 100644 index 00000000..97a68c44 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_content_type.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContentType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContentType{} + +// ContentType struct for ContentType +type ContentType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + AppLabel string `json:"app_label"` + Model string `json:"model"` + AdditionalProperties map[string]interface{} +} + +type _ContentType ContentType + +// NewContentType instantiates a new ContentType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContentType(id int32, url string, display string, appLabel string, model string) *ContentType { + this := ContentType{} + this.Id = id + this.Url = url + this.Display = display + this.AppLabel = appLabel + this.Model = model + return &this +} + +// NewContentTypeWithDefaults instantiates a new ContentType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContentTypeWithDefaults() *ContentType { + this := ContentType{} + return &this +} + +// GetId returns the Id field value +func (o *ContentType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ContentType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ContentType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ContentType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ContentType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ContentType) SetDisplay(v string) { + o.Display = v +} + +// GetAppLabel returns the AppLabel field value +func (o *ContentType) GetAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabel +} + +// GetAppLabelOk returns a tuple with the AppLabel field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabel, true +} + +// SetAppLabel sets field value +func (o *ContentType) SetAppLabel(v string) { + o.AppLabel = v +} + +// GetModel returns the Model field value +func (o *ContentType) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *ContentType) SetModel(v string) { + o.Model = v +} + +func (o ContentType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContentType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["app_label"] = o.AppLabel + toSerialize["model"] = o.Model + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContentType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "app_label", + "model", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContentType := _ContentType{} + + err = json.Unmarshal(data, &varContentType) + + if err != nil { + return err + } + + *o = ContentType(varContentType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "app_label") + delete(additionalProperties, "model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContentType struct { + value *ContentType + isSet bool +} + +func (v NullableContentType) Get() *ContentType { + return v.value +} + +func (v *NullableContentType) Set(val *ContentType) { + v.value = val + v.isSet = true +} + +func (v NullableContentType) IsSet() bool { + return v.isSet +} + +func (v *NullableContentType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentType(val *ContentType) *NullableContentType { + return &NullableContentType{value: val, isSet: true} +} + +func (v NullableContentType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field.go new file mode 100644 index 00000000..dba10045 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field.go @@ -0,0 +1,1051 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CustomField type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomField{} + +// CustomField Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type CustomField struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ContentTypes []string `json:"content_types"` + Type CustomFieldType `json:"type"` + ObjectType NullableString `json:"object_type,omitempty"` + DataType string `json:"data_type"` + // Internal field name + Name string `json:"name"` + // Name of the field as displayed to users (if not provided, 'the field's name will be used) + Label *string `json:"label,omitempty"` + // Custom fields within the same group will be displayed together + GroupName *string `json:"group_name,omitempty"` + Description *string `json:"description,omitempty"` + // If true, this field is required when creating new objects or editing an existing object. + Required *bool `json:"required,omitempty"` + // Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored. + SearchWeight *int32 `json:"search_weight,omitempty"` + FilterLogic *CustomFieldFilterLogic `json:"filter_logic,omitempty"` + UiVisible *CustomFieldUiVisible `json:"ui_visible,omitempty"` + UiEditable *CustomFieldUiEditable `json:"ui_editable,omitempty"` + // Replicate this value when cloning objects + IsCloneable *bool `json:"is_cloneable,omitempty"` + // Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. \"Foo\"). + Default interface{} `json:"default,omitempty"` + // Fields with higher weights appear lower in a form. + Weight *int32 `json:"weight,omitempty"` + // Minimum allowed value (for numeric fields) + ValidationMinimum NullableInt64 `json:"validation_minimum,omitempty"` + // Maximum allowed value (for numeric fields) + ValidationMaximum NullableInt64 `json:"validation_maximum,omitempty"` + // Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, ^[A-Z]{3}$ will limit values to exactly three uppercase letters. + ValidationRegex *string `json:"validation_regex,omitempty"` + ChoiceSet NullableNestedCustomFieldChoiceSet `json:"choice_set,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _CustomField CustomField + +// NewCustomField instantiates a new CustomField object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomField(id int32, url string, display string, contentTypes []string, type_ CustomFieldType, dataType string, name string, created NullableTime, lastUpdated NullableTime) *CustomField { + this := CustomField{} + this.Id = id + this.Url = url + this.Display = display + this.ContentTypes = contentTypes + this.Type = type_ + this.DataType = dataType + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewCustomFieldWithDefaults instantiates a new CustomField object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldWithDefaults() *CustomField { + this := CustomField{} + return &this +} + +// GetId returns the Id field value +func (o *CustomField) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CustomField) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CustomField) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *CustomField) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CustomField) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *CustomField) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *CustomField) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *CustomField) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *CustomField) SetDisplay(v string) { + o.Display = v +} + +// GetContentTypes returns the ContentTypes field value +func (o *CustomField) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *CustomField) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *CustomField) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetType returns the Type field value +func (o *CustomField) GetType() CustomFieldType { + if o == nil { + var ret CustomFieldType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CustomField) GetTypeOk() (*CustomFieldType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CustomField) SetType(v CustomFieldType) { + o.Type = v +} + +// GetObjectType returns the ObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomField) GetObjectType() string { + if o == nil || IsNil(o.ObjectType.Get()) { + var ret string + return ret + } + return *o.ObjectType.Get() +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomField) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectType.Get(), o.ObjectType.IsSet() +} + +// HasObjectType returns a boolean if a field has been set. +func (o *CustomField) HasObjectType() bool { + if o != nil && o.ObjectType.IsSet() { + return true + } + + return false +} + +// SetObjectType gets a reference to the given NullableString and assigns it to the ObjectType field. +func (o *CustomField) SetObjectType(v string) { + o.ObjectType.Set(&v) +} + +// SetObjectTypeNil sets the value for ObjectType to be an explicit nil +func (o *CustomField) SetObjectTypeNil() { + o.ObjectType.Set(nil) +} + +// UnsetObjectType ensures that no value is present for ObjectType, not even an explicit nil +func (o *CustomField) UnsetObjectType() { + o.ObjectType.Unset() +} + +// GetDataType returns the DataType field value +func (o *CustomField) GetDataType() string { + if o == nil { + var ret string + return ret + } + + return o.DataType +} + +// GetDataTypeOk returns a tuple with the DataType field value +// and a boolean to check if the value has been set. +func (o *CustomField) GetDataTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DataType, true +} + +// SetDataType sets field value +func (o *CustomField) SetDataType(v string) { + o.DataType = v +} + +// GetName returns the Name field value +func (o *CustomField) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomField) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomField) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CustomField) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CustomField) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *CustomField) SetLabel(v string) { + o.Label = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *CustomField) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *CustomField) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *CustomField) SetGroupName(v string) { + o.GroupName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CustomField) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CustomField) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CustomField) SetDescription(v string) { + o.Description = &v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *CustomField) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *CustomField) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *CustomField) SetRequired(v bool) { + o.Required = &v +} + +// GetSearchWeight returns the SearchWeight field value if set, zero value otherwise. +func (o *CustomField) GetSearchWeight() int32 { + if o == nil || IsNil(o.SearchWeight) { + var ret int32 + return ret + } + return *o.SearchWeight +} + +// GetSearchWeightOk returns a tuple with the SearchWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetSearchWeightOk() (*int32, bool) { + if o == nil || IsNil(o.SearchWeight) { + return nil, false + } + return o.SearchWeight, true +} + +// HasSearchWeight returns a boolean if a field has been set. +func (o *CustomField) HasSearchWeight() bool { + if o != nil && !IsNil(o.SearchWeight) { + return true + } + + return false +} + +// SetSearchWeight gets a reference to the given int32 and assigns it to the SearchWeight field. +func (o *CustomField) SetSearchWeight(v int32) { + o.SearchWeight = &v +} + +// GetFilterLogic returns the FilterLogic field value if set, zero value otherwise. +func (o *CustomField) GetFilterLogic() CustomFieldFilterLogic { + if o == nil || IsNil(o.FilterLogic) { + var ret CustomFieldFilterLogic + return ret + } + return *o.FilterLogic +} + +// GetFilterLogicOk returns a tuple with the FilterLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetFilterLogicOk() (*CustomFieldFilterLogic, bool) { + if o == nil || IsNil(o.FilterLogic) { + return nil, false + } + return o.FilterLogic, true +} + +// HasFilterLogic returns a boolean if a field has been set. +func (o *CustomField) HasFilterLogic() bool { + if o != nil && !IsNil(o.FilterLogic) { + return true + } + + return false +} + +// SetFilterLogic gets a reference to the given CustomFieldFilterLogic and assigns it to the FilterLogic field. +func (o *CustomField) SetFilterLogic(v CustomFieldFilterLogic) { + o.FilterLogic = &v +} + +// GetUiVisible returns the UiVisible field value if set, zero value otherwise. +func (o *CustomField) GetUiVisible() CustomFieldUiVisible { + if o == nil || IsNil(o.UiVisible) { + var ret CustomFieldUiVisible + return ret + } + return *o.UiVisible +} + +// GetUiVisibleOk returns a tuple with the UiVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetUiVisibleOk() (*CustomFieldUiVisible, bool) { + if o == nil || IsNil(o.UiVisible) { + return nil, false + } + return o.UiVisible, true +} + +// HasUiVisible returns a boolean if a field has been set. +func (o *CustomField) HasUiVisible() bool { + if o != nil && !IsNil(o.UiVisible) { + return true + } + + return false +} + +// SetUiVisible gets a reference to the given CustomFieldUiVisible and assigns it to the UiVisible field. +func (o *CustomField) SetUiVisible(v CustomFieldUiVisible) { + o.UiVisible = &v +} + +// GetUiEditable returns the UiEditable field value if set, zero value otherwise. +func (o *CustomField) GetUiEditable() CustomFieldUiEditable { + if o == nil || IsNil(o.UiEditable) { + var ret CustomFieldUiEditable + return ret + } + return *o.UiEditable +} + +// GetUiEditableOk returns a tuple with the UiEditable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetUiEditableOk() (*CustomFieldUiEditable, bool) { + if o == nil || IsNil(o.UiEditable) { + return nil, false + } + return o.UiEditable, true +} + +// HasUiEditable returns a boolean if a field has been set. +func (o *CustomField) HasUiEditable() bool { + if o != nil && !IsNil(o.UiEditable) { + return true + } + + return false +} + +// SetUiEditable gets a reference to the given CustomFieldUiEditable and assigns it to the UiEditable field. +func (o *CustomField) SetUiEditable(v CustomFieldUiEditable) { + o.UiEditable = &v +} + +// GetIsCloneable returns the IsCloneable field value if set, zero value otherwise. +func (o *CustomField) GetIsCloneable() bool { + if o == nil || IsNil(o.IsCloneable) { + var ret bool + return ret + } + return *o.IsCloneable +} + +// GetIsCloneableOk returns a tuple with the IsCloneable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetIsCloneableOk() (*bool, bool) { + if o == nil || IsNil(o.IsCloneable) { + return nil, false + } + return o.IsCloneable, true +} + +// HasIsCloneable returns a boolean if a field has been set. +func (o *CustomField) HasIsCloneable() bool { + if o != nil && !IsNil(o.IsCloneable) { + return true + } + + return false +} + +// SetIsCloneable gets a reference to the given bool and assigns it to the IsCloneable field. +func (o *CustomField) SetIsCloneable(v bool) { + o.IsCloneable = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomField) GetDefault() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomField) GetDefaultOk() (*interface{}, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return &o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *CustomField) HasDefault() bool { + if o != nil && IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given interface{} and assigns it to the Default field. +func (o *CustomField) SetDefault(v interface{}) { + o.Default = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *CustomField) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *CustomField) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *CustomField) SetWeight(v int32) { + o.Weight = &v +} + +// GetValidationMinimum returns the ValidationMinimum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomField) GetValidationMinimum() int64 { + if o == nil || IsNil(o.ValidationMinimum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMinimum.Get() +} + +// GetValidationMinimumOk returns a tuple with the ValidationMinimum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomField) GetValidationMinimumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMinimum.Get(), o.ValidationMinimum.IsSet() +} + +// HasValidationMinimum returns a boolean if a field has been set. +func (o *CustomField) HasValidationMinimum() bool { + if o != nil && o.ValidationMinimum.IsSet() { + return true + } + + return false +} + +// SetValidationMinimum gets a reference to the given NullableInt64 and assigns it to the ValidationMinimum field. +func (o *CustomField) SetValidationMinimum(v int64) { + o.ValidationMinimum.Set(&v) +} + +// SetValidationMinimumNil sets the value for ValidationMinimum to be an explicit nil +func (o *CustomField) SetValidationMinimumNil() { + o.ValidationMinimum.Set(nil) +} + +// UnsetValidationMinimum ensures that no value is present for ValidationMinimum, not even an explicit nil +func (o *CustomField) UnsetValidationMinimum() { + o.ValidationMinimum.Unset() +} + +// GetValidationMaximum returns the ValidationMaximum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomField) GetValidationMaximum() int64 { + if o == nil || IsNil(o.ValidationMaximum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMaximum.Get() +} + +// GetValidationMaximumOk returns a tuple with the ValidationMaximum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomField) GetValidationMaximumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMaximum.Get(), o.ValidationMaximum.IsSet() +} + +// HasValidationMaximum returns a boolean if a field has been set. +func (o *CustomField) HasValidationMaximum() bool { + if o != nil && o.ValidationMaximum.IsSet() { + return true + } + + return false +} + +// SetValidationMaximum gets a reference to the given NullableInt64 and assigns it to the ValidationMaximum field. +func (o *CustomField) SetValidationMaximum(v int64) { + o.ValidationMaximum.Set(&v) +} + +// SetValidationMaximumNil sets the value for ValidationMaximum to be an explicit nil +func (o *CustomField) SetValidationMaximumNil() { + o.ValidationMaximum.Set(nil) +} + +// UnsetValidationMaximum ensures that no value is present for ValidationMaximum, not even an explicit nil +func (o *CustomField) UnsetValidationMaximum() { + o.ValidationMaximum.Unset() +} + +// GetValidationRegex returns the ValidationRegex field value if set, zero value otherwise. +func (o *CustomField) GetValidationRegex() string { + if o == nil || IsNil(o.ValidationRegex) { + var ret string + return ret + } + return *o.ValidationRegex +} + +// GetValidationRegexOk returns a tuple with the ValidationRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomField) GetValidationRegexOk() (*string, bool) { + if o == nil || IsNil(o.ValidationRegex) { + return nil, false + } + return o.ValidationRegex, true +} + +// HasValidationRegex returns a boolean if a field has been set. +func (o *CustomField) HasValidationRegex() bool { + if o != nil && !IsNil(o.ValidationRegex) { + return true + } + + return false +} + +// SetValidationRegex gets a reference to the given string and assigns it to the ValidationRegex field. +func (o *CustomField) SetValidationRegex(v string) { + o.ValidationRegex = &v +} + +// GetChoiceSet returns the ChoiceSet field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomField) GetChoiceSet() NestedCustomFieldChoiceSet { + if o == nil || IsNil(o.ChoiceSet.Get()) { + var ret NestedCustomFieldChoiceSet + return ret + } + return *o.ChoiceSet.Get() +} + +// GetChoiceSetOk returns a tuple with the ChoiceSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomField) GetChoiceSetOk() (*NestedCustomFieldChoiceSet, bool) { + if o == nil { + return nil, false + } + return o.ChoiceSet.Get(), o.ChoiceSet.IsSet() +} + +// HasChoiceSet returns a boolean if a field has been set. +func (o *CustomField) HasChoiceSet() bool { + if o != nil && o.ChoiceSet.IsSet() { + return true + } + + return false +} + +// SetChoiceSet gets a reference to the given NullableNestedCustomFieldChoiceSet and assigns it to the ChoiceSet field. +func (o *CustomField) SetChoiceSet(v NestedCustomFieldChoiceSet) { + o.ChoiceSet.Set(&v) +} + +// SetChoiceSetNil sets the value for ChoiceSet to be an explicit nil +func (o *CustomField) SetChoiceSetNil() { + o.ChoiceSet.Set(nil) +} + +// UnsetChoiceSet ensures that no value is present for ChoiceSet, not even an explicit nil +func (o *CustomField) UnsetChoiceSet() { + o.ChoiceSet.Unset() +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CustomField) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomField) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *CustomField) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CustomField) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomField) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *CustomField) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o CustomField) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomField) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["content_types"] = o.ContentTypes + toSerialize["type"] = o.Type + if o.ObjectType.IsSet() { + toSerialize["object_type"] = o.ObjectType.Get() + } + toSerialize["data_type"] = o.DataType + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.GroupName) { + toSerialize["group_name"] = o.GroupName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.SearchWeight) { + toSerialize["search_weight"] = o.SearchWeight + } + if !IsNil(o.FilterLogic) { + toSerialize["filter_logic"] = o.FilterLogic + } + if !IsNil(o.UiVisible) { + toSerialize["ui_visible"] = o.UiVisible + } + if !IsNil(o.UiEditable) { + toSerialize["ui_editable"] = o.UiEditable + } + if !IsNil(o.IsCloneable) { + toSerialize["is_cloneable"] = o.IsCloneable + } + if o.Default != nil { + toSerialize["default"] = o.Default + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if o.ValidationMinimum.IsSet() { + toSerialize["validation_minimum"] = o.ValidationMinimum.Get() + } + if o.ValidationMaximum.IsSet() { + toSerialize["validation_maximum"] = o.ValidationMaximum.Get() + } + if !IsNil(o.ValidationRegex) { + toSerialize["validation_regex"] = o.ValidationRegex + } + if o.ChoiceSet.IsSet() { + toSerialize["choice_set"] = o.ChoiceSet.Get() + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomField) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "content_types", + "type", + "data_type", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomField := _CustomField{} + + err = json.Unmarshal(data, &varCustomField) + + if err != nil { + return err + } + + *o = CustomField(varCustomField) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "content_types") + delete(additionalProperties, "type") + delete(additionalProperties, "object_type") + delete(additionalProperties, "data_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "group_name") + delete(additionalProperties, "description") + delete(additionalProperties, "required") + delete(additionalProperties, "search_weight") + delete(additionalProperties, "filter_logic") + delete(additionalProperties, "ui_visible") + delete(additionalProperties, "ui_editable") + delete(additionalProperties, "is_cloneable") + delete(additionalProperties, "default") + delete(additionalProperties, "weight") + delete(additionalProperties, "validation_minimum") + delete(additionalProperties, "validation_maximum") + delete(additionalProperties, "validation_regex") + delete(additionalProperties, "choice_set") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomField struct { + value *CustomField + isSet bool +} + +func (v NullableCustomField) Get() *CustomField { + return v.value +} + +func (v *NullableCustomField) Set(val *CustomField) { + v.value = val + v.isSet = true +} + +func (v NullableCustomField) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomField) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomField(val *CustomField) *NullableCustomField { + return &NullableCustomField{value: val, isSet: true} +} + +func (v NullableCustomField) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomField) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set.go new file mode 100644 index 00000000..c36500d9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set.go @@ -0,0 +1,495 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CustomFieldChoiceSet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldChoiceSet{} + +// CustomFieldChoiceSet Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type CustomFieldChoiceSet struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + BaseChoices *CustomFieldChoiceSetBaseChoices `json:"base_choices,omitempty"` + ExtraChoices [][]string `json:"extra_choices,omitempty"` + // Choices are automatically ordered alphabetically + OrderAlphabetically *bool `json:"order_alphabetically,omitempty"` + ChoicesCount string `json:"choices_count"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldChoiceSet CustomFieldChoiceSet + +// NewCustomFieldChoiceSet instantiates a new CustomFieldChoiceSet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldChoiceSet(id int32, url string, display string, name string, choicesCount string, created NullableTime, lastUpdated NullableTime) *CustomFieldChoiceSet { + this := CustomFieldChoiceSet{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.ChoicesCount = choicesCount + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewCustomFieldChoiceSetWithDefaults instantiates a new CustomFieldChoiceSet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldChoiceSetWithDefaults() *CustomFieldChoiceSet { + this := CustomFieldChoiceSet{} + return &this +} + +// GetId returns the Id field value +func (o *CustomFieldChoiceSet) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CustomFieldChoiceSet) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *CustomFieldChoiceSet) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *CustomFieldChoiceSet) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *CustomFieldChoiceSet) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *CustomFieldChoiceSet) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *CustomFieldChoiceSet) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomFieldChoiceSet) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CustomFieldChoiceSet) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CustomFieldChoiceSet) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CustomFieldChoiceSet) SetDescription(v string) { + o.Description = &v +} + +// GetBaseChoices returns the BaseChoices field value if set, zero value otherwise. +func (o *CustomFieldChoiceSet) GetBaseChoices() CustomFieldChoiceSetBaseChoices { + if o == nil || IsNil(o.BaseChoices) { + var ret CustomFieldChoiceSetBaseChoices + return ret + } + return *o.BaseChoices +} + +// GetBaseChoicesOk returns a tuple with the BaseChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetBaseChoicesOk() (*CustomFieldChoiceSetBaseChoices, bool) { + if o == nil || IsNil(o.BaseChoices) { + return nil, false + } + return o.BaseChoices, true +} + +// HasBaseChoices returns a boolean if a field has been set. +func (o *CustomFieldChoiceSet) HasBaseChoices() bool { + if o != nil && !IsNil(o.BaseChoices) { + return true + } + + return false +} + +// SetBaseChoices gets a reference to the given CustomFieldChoiceSetBaseChoices and assigns it to the BaseChoices field. +func (o *CustomFieldChoiceSet) SetBaseChoices(v CustomFieldChoiceSetBaseChoices) { + o.BaseChoices = &v +} + +// GetExtraChoices returns the ExtraChoices field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomFieldChoiceSet) GetExtraChoices() [][]string { + if o == nil { + var ret [][]string + return ret + } + return o.ExtraChoices +} + +// GetExtraChoicesOk returns a tuple with the ExtraChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldChoiceSet) GetExtraChoicesOk() ([][]string, bool) { + if o == nil || IsNil(o.ExtraChoices) { + return nil, false + } + return o.ExtraChoices, true +} + +// HasExtraChoices returns a boolean if a field has been set. +func (o *CustomFieldChoiceSet) HasExtraChoices() bool { + if o != nil && IsNil(o.ExtraChoices) { + return true + } + + return false +} + +// SetExtraChoices gets a reference to the given [][]string and assigns it to the ExtraChoices field. +func (o *CustomFieldChoiceSet) SetExtraChoices(v [][]string) { + o.ExtraChoices = v +} + +// GetOrderAlphabetically returns the OrderAlphabetically field value if set, zero value otherwise. +func (o *CustomFieldChoiceSet) GetOrderAlphabetically() bool { + if o == nil || IsNil(o.OrderAlphabetically) { + var ret bool + return ret + } + return *o.OrderAlphabetically +} + +// GetOrderAlphabeticallyOk returns a tuple with the OrderAlphabetically field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetOrderAlphabeticallyOk() (*bool, bool) { + if o == nil || IsNil(o.OrderAlphabetically) { + return nil, false + } + return o.OrderAlphabetically, true +} + +// HasOrderAlphabetically returns a boolean if a field has been set. +func (o *CustomFieldChoiceSet) HasOrderAlphabetically() bool { + if o != nil && !IsNil(o.OrderAlphabetically) { + return true + } + + return false +} + +// SetOrderAlphabetically gets a reference to the given bool and assigns it to the OrderAlphabetically field. +func (o *CustomFieldChoiceSet) SetOrderAlphabetically(v bool) { + o.OrderAlphabetically = &v +} + +// GetChoicesCount returns the ChoicesCount field value +func (o *CustomFieldChoiceSet) GetChoicesCount() string { + if o == nil { + var ret string + return ret + } + + return o.ChoicesCount +} + +// GetChoicesCountOk returns a tuple with the ChoicesCount field value +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChoicesCount, true +} + +// SetChoicesCount sets field value +func (o *CustomFieldChoiceSet) SetChoicesCount(v string) { + o.ChoicesCount = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CustomFieldChoiceSet) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldChoiceSet) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *CustomFieldChoiceSet) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CustomFieldChoiceSet) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldChoiceSet) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *CustomFieldChoiceSet) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o CustomFieldChoiceSet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldChoiceSet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.BaseChoices) { + toSerialize["base_choices"] = o.BaseChoices + } + if o.ExtraChoices != nil { + toSerialize["extra_choices"] = o.ExtraChoices + } + if !IsNil(o.OrderAlphabetically) { + toSerialize["order_alphabetically"] = o.OrderAlphabetically + } + toSerialize["choices_count"] = o.ChoicesCount + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldChoiceSet) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "choices_count", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomFieldChoiceSet := _CustomFieldChoiceSet{} + + err = json.Unmarshal(data, &varCustomFieldChoiceSet) + + if err != nil { + return err + } + + *o = CustomFieldChoiceSet(varCustomFieldChoiceSet) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "base_choices") + delete(additionalProperties, "extra_choices") + delete(additionalProperties, "order_alphabetically") + delete(additionalProperties, "choices_count") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldChoiceSet struct { + value *CustomFieldChoiceSet + isSet bool +} + +func (v NullableCustomFieldChoiceSet) Get() *CustomFieldChoiceSet { + return v.value +} + +func (v *NullableCustomFieldChoiceSet) Set(val *CustomFieldChoiceSet) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldChoiceSet) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldChoiceSet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldChoiceSet(val *CustomFieldChoiceSet) *NullableCustomFieldChoiceSet { + return &NullableCustomFieldChoiceSet{value: val, isSet: true} +} + +func (v NullableCustomFieldChoiceSet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldChoiceSet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices.go new file mode 100644 index 00000000..2d7a08e5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CustomFieldChoiceSetBaseChoices type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldChoiceSetBaseChoices{} + +// CustomFieldChoiceSetBaseChoices struct for CustomFieldChoiceSetBaseChoices +type CustomFieldChoiceSetBaseChoices struct { + Value *CustomFieldChoiceSetBaseChoicesValue `json:"value,omitempty"` + Label *CustomFieldChoiceSetBaseChoicesLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldChoiceSetBaseChoices CustomFieldChoiceSetBaseChoices + +// NewCustomFieldChoiceSetBaseChoices instantiates a new CustomFieldChoiceSetBaseChoices object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldChoiceSetBaseChoices() *CustomFieldChoiceSetBaseChoices { + this := CustomFieldChoiceSetBaseChoices{} + return &this +} + +// NewCustomFieldChoiceSetBaseChoicesWithDefaults instantiates a new CustomFieldChoiceSetBaseChoices object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldChoiceSetBaseChoicesWithDefaults() *CustomFieldChoiceSetBaseChoices { + this := CustomFieldChoiceSetBaseChoices{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CustomFieldChoiceSetBaseChoices) GetValue() CustomFieldChoiceSetBaseChoicesValue { + if o == nil || IsNil(o.Value) { + var ret CustomFieldChoiceSetBaseChoicesValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSetBaseChoices) GetValueOk() (*CustomFieldChoiceSetBaseChoicesValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CustomFieldChoiceSetBaseChoices) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CustomFieldChoiceSetBaseChoicesValue and assigns it to the Value field. +func (o *CustomFieldChoiceSetBaseChoices) SetValue(v CustomFieldChoiceSetBaseChoicesValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CustomFieldChoiceSetBaseChoices) GetLabel() CustomFieldChoiceSetBaseChoicesLabel { + if o == nil || IsNil(o.Label) { + var ret CustomFieldChoiceSetBaseChoicesLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSetBaseChoices) GetLabelOk() (*CustomFieldChoiceSetBaseChoicesLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CustomFieldChoiceSetBaseChoices) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CustomFieldChoiceSetBaseChoicesLabel and assigns it to the Label field. +func (o *CustomFieldChoiceSetBaseChoices) SetLabel(v CustomFieldChoiceSetBaseChoicesLabel) { + o.Label = &v +} + +func (o CustomFieldChoiceSetBaseChoices) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldChoiceSetBaseChoices) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldChoiceSetBaseChoices) UnmarshalJSON(data []byte) (err error) { + varCustomFieldChoiceSetBaseChoices := _CustomFieldChoiceSetBaseChoices{} + + err = json.Unmarshal(data, &varCustomFieldChoiceSetBaseChoices) + + if err != nil { + return err + } + + *o = CustomFieldChoiceSetBaseChoices(varCustomFieldChoiceSetBaseChoices) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldChoiceSetBaseChoices struct { + value *CustomFieldChoiceSetBaseChoices + isSet bool +} + +func (v NullableCustomFieldChoiceSetBaseChoices) Get() *CustomFieldChoiceSetBaseChoices { + return v.value +} + +func (v *NullableCustomFieldChoiceSetBaseChoices) Set(val *CustomFieldChoiceSetBaseChoices) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldChoiceSetBaseChoices) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldChoiceSetBaseChoices) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldChoiceSetBaseChoices(val *CustomFieldChoiceSetBaseChoices) *NullableCustomFieldChoiceSetBaseChoices { + return &NullableCustomFieldChoiceSetBaseChoices{value: val, isSet: true} +} + +func (v NullableCustomFieldChoiceSetBaseChoices) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldChoiceSetBaseChoices) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices_label.go new file mode 100644 index 00000000..0d9f5288 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldChoiceSetBaseChoicesLabel the model 'CustomFieldChoiceSetBaseChoicesLabel' +type CustomFieldChoiceSetBaseChoicesLabel string + +// List of CustomFieldChoiceSet_base_choices_label +const ( + CUSTOMFIELDCHOICESETBASECHOICESLABEL_IATA__AIRPORT_CODES CustomFieldChoiceSetBaseChoicesLabel = "IATA (Airport codes)" + CUSTOMFIELDCHOICESETBASECHOICESLABEL_ISO_3166__COUNTRY_CODES CustomFieldChoiceSetBaseChoicesLabel = "ISO 3166 (Country codes)" + CUSTOMFIELDCHOICESETBASECHOICESLABEL_UN_LOCODE__LOCATION_CODES CustomFieldChoiceSetBaseChoicesLabel = "UN/LOCODE (Location codes)" +) + +// All allowed values of CustomFieldChoiceSetBaseChoicesLabel enum +var AllowedCustomFieldChoiceSetBaseChoicesLabelEnumValues = []CustomFieldChoiceSetBaseChoicesLabel{ + "IATA (Airport codes)", + "ISO 3166 (Country codes)", + "UN/LOCODE (Location codes)", +} + +func (v *CustomFieldChoiceSetBaseChoicesLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldChoiceSetBaseChoicesLabel(value) + for _, existing := range AllowedCustomFieldChoiceSetBaseChoicesLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldChoiceSetBaseChoicesLabel", value) +} + +// NewCustomFieldChoiceSetBaseChoicesLabelFromValue returns a pointer to a valid CustomFieldChoiceSetBaseChoicesLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldChoiceSetBaseChoicesLabelFromValue(v string) (*CustomFieldChoiceSetBaseChoicesLabel, error) { + ev := CustomFieldChoiceSetBaseChoicesLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldChoiceSetBaseChoicesLabel: valid values are %v", v, AllowedCustomFieldChoiceSetBaseChoicesLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldChoiceSetBaseChoicesLabel) IsValid() bool { + for _, existing := range AllowedCustomFieldChoiceSetBaseChoicesLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomFieldChoiceSet_base_choices_label value +func (v CustomFieldChoiceSetBaseChoicesLabel) Ptr() *CustomFieldChoiceSetBaseChoicesLabel { + return &v +} + +type NullableCustomFieldChoiceSetBaseChoicesLabel struct { + value *CustomFieldChoiceSetBaseChoicesLabel + isSet bool +} + +func (v NullableCustomFieldChoiceSetBaseChoicesLabel) Get() *CustomFieldChoiceSetBaseChoicesLabel { + return v.value +} + +func (v *NullableCustomFieldChoiceSetBaseChoicesLabel) Set(val *CustomFieldChoiceSetBaseChoicesLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldChoiceSetBaseChoicesLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldChoiceSetBaseChoicesLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldChoiceSetBaseChoicesLabel(val *CustomFieldChoiceSetBaseChoicesLabel) *NullableCustomFieldChoiceSetBaseChoicesLabel { + return &NullableCustomFieldChoiceSetBaseChoicesLabel{value: val, isSet: true} +} + +func (v NullableCustomFieldChoiceSetBaseChoicesLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldChoiceSetBaseChoicesLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices_value.go new file mode 100644 index 00000000..3871ab2a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_base_choices_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldChoiceSetBaseChoicesValue * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes) +type CustomFieldChoiceSetBaseChoicesValue string + +// List of CustomFieldChoiceSet_base_choices_value +const ( + CUSTOMFIELDCHOICESETBASECHOICESVALUE_IATA CustomFieldChoiceSetBaseChoicesValue = "IATA" + CUSTOMFIELDCHOICESETBASECHOICESVALUE_ISO_3166 CustomFieldChoiceSetBaseChoicesValue = "ISO_3166" + CUSTOMFIELDCHOICESETBASECHOICESVALUE_UN_LOCODE CustomFieldChoiceSetBaseChoicesValue = "UN_LOCODE" +) + +// All allowed values of CustomFieldChoiceSetBaseChoicesValue enum +var AllowedCustomFieldChoiceSetBaseChoicesValueEnumValues = []CustomFieldChoiceSetBaseChoicesValue{ + "IATA", + "ISO_3166", + "UN_LOCODE", +} + +func (v *CustomFieldChoiceSetBaseChoicesValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldChoiceSetBaseChoicesValue(value) + for _, existing := range AllowedCustomFieldChoiceSetBaseChoicesValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldChoiceSetBaseChoicesValue", value) +} + +// NewCustomFieldChoiceSetBaseChoicesValueFromValue returns a pointer to a valid CustomFieldChoiceSetBaseChoicesValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldChoiceSetBaseChoicesValueFromValue(v string) (*CustomFieldChoiceSetBaseChoicesValue, error) { + ev := CustomFieldChoiceSetBaseChoicesValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldChoiceSetBaseChoicesValue: valid values are %v", v, AllowedCustomFieldChoiceSetBaseChoicesValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldChoiceSetBaseChoicesValue) IsValid() bool { + for _, existing := range AllowedCustomFieldChoiceSetBaseChoicesValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomFieldChoiceSet_base_choices_value value +func (v CustomFieldChoiceSetBaseChoicesValue) Ptr() *CustomFieldChoiceSetBaseChoicesValue { + return &v +} + +type NullableCustomFieldChoiceSetBaseChoicesValue struct { + value *CustomFieldChoiceSetBaseChoicesValue + isSet bool +} + +func (v NullableCustomFieldChoiceSetBaseChoicesValue) Get() *CustomFieldChoiceSetBaseChoicesValue { + return v.value +} + +func (v *NullableCustomFieldChoiceSetBaseChoicesValue) Set(val *CustomFieldChoiceSetBaseChoicesValue) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldChoiceSetBaseChoicesValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldChoiceSetBaseChoicesValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldChoiceSetBaseChoicesValue(val *CustomFieldChoiceSetBaseChoicesValue) *NullableCustomFieldChoiceSetBaseChoicesValue { + return &NullableCustomFieldChoiceSetBaseChoicesValue{value: val, isSet: true} +} + +func (v NullableCustomFieldChoiceSetBaseChoicesValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldChoiceSetBaseChoicesValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_request.go new file mode 100644 index 00000000..328362f7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_choice_set_request.go @@ -0,0 +1,316 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CustomFieldChoiceSetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldChoiceSetRequest{} + +// CustomFieldChoiceSetRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type CustomFieldChoiceSetRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + BaseChoices *CustomFieldChoiceSetBaseChoicesValue `json:"base_choices,omitempty"` + ExtraChoices [][]string `json:"extra_choices,omitempty"` + // Choices are automatically ordered alphabetically + OrderAlphabetically *bool `json:"order_alphabetically,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldChoiceSetRequest CustomFieldChoiceSetRequest + +// NewCustomFieldChoiceSetRequest instantiates a new CustomFieldChoiceSetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldChoiceSetRequest(name string) *CustomFieldChoiceSetRequest { + this := CustomFieldChoiceSetRequest{} + this.Name = name + return &this +} + +// NewCustomFieldChoiceSetRequestWithDefaults instantiates a new CustomFieldChoiceSetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldChoiceSetRequestWithDefaults() *CustomFieldChoiceSetRequest { + this := CustomFieldChoiceSetRequest{} + return &this +} + +// GetName returns the Name field value +func (o *CustomFieldChoiceSetRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSetRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomFieldChoiceSetRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CustomFieldChoiceSetRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSetRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CustomFieldChoiceSetRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CustomFieldChoiceSetRequest) SetDescription(v string) { + o.Description = &v +} + +// GetBaseChoices returns the BaseChoices field value if set, zero value otherwise. +func (o *CustomFieldChoiceSetRequest) GetBaseChoices() CustomFieldChoiceSetBaseChoicesValue { + if o == nil || IsNil(o.BaseChoices) { + var ret CustomFieldChoiceSetBaseChoicesValue + return ret + } + return *o.BaseChoices +} + +// GetBaseChoicesOk returns a tuple with the BaseChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSetRequest) GetBaseChoicesOk() (*CustomFieldChoiceSetBaseChoicesValue, bool) { + if o == nil || IsNil(o.BaseChoices) { + return nil, false + } + return o.BaseChoices, true +} + +// HasBaseChoices returns a boolean if a field has been set. +func (o *CustomFieldChoiceSetRequest) HasBaseChoices() bool { + if o != nil && !IsNil(o.BaseChoices) { + return true + } + + return false +} + +// SetBaseChoices gets a reference to the given CustomFieldChoiceSetBaseChoicesValue and assigns it to the BaseChoices field. +func (o *CustomFieldChoiceSetRequest) SetBaseChoices(v CustomFieldChoiceSetBaseChoicesValue) { + o.BaseChoices = &v +} + +// GetExtraChoices returns the ExtraChoices field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomFieldChoiceSetRequest) GetExtraChoices() [][]string { + if o == nil { + var ret [][]string + return ret + } + return o.ExtraChoices +} + +// GetExtraChoicesOk returns a tuple with the ExtraChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldChoiceSetRequest) GetExtraChoicesOk() ([][]string, bool) { + if o == nil || IsNil(o.ExtraChoices) { + return nil, false + } + return o.ExtraChoices, true +} + +// HasExtraChoices returns a boolean if a field has been set. +func (o *CustomFieldChoiceSetRequest) HasExtraChoices() bool { + if o != nil && IsNil(o.ExtraChoices) { + return true + } + + return false +} + +// SetExtraChoices gets a reference to the given [][]string and assigns it to the ExtraChoices field. +func (o *CustomFieldChoiceSetRequest) SetExtraChoices(v [][]string) { + o.ExtraChoices = v +} + +// GetOrderAlphabetically returns the OrderAlphabetically field value if set, zero value otherwise. +func (o *CustomFieldChoiceSetRequest) GetOrderAlphabetically() bool { + if o == nil || IsNil(o.OrderAlphabetically) { + var ret bool + return ret + } + return *o.OrderAlphabetically +} + +// GetOrderAlphabeticallyOk returns a tuple with the OrderAlphabetically field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldChoiceSetRequest) GetOrderAlphabeticallyOk() (*bool, bool) { + if o == nil || IsNil(o.OrderAlphabetically) { + return nil, false + } + return o.OrderAlphabetically, true +} + +// HasOrderAlphabetically returns a boolean if a field has been set. +func (o *CustomFieldChoiceSetRequest) HasOrderAlphabetically() bool { + if o != nil && !IsNil(o.OrderAlphabetically) { + return true + } + + return false +} + +// SetOrderAlphabetically gets a reference to the given bool and assigns it to the OrderAlphabetically field. +func (o *CustomFieldChoiceSetRequest) SetOrderAlphabetically(v bool) { + o.OrderAlphabetically = &v +} + +func (o CustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldChoiceSetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.BaseChoices) { + toSerialize["base_choices"] = o.BaseChoices + } + if o.ExtraChoices != nil { + toSerialize["extra_choices"] = o.ExtraChoices + } + if !IsNil(o.OrderAlphabetically) { + toSerialize["order_alphabetically"] = o.OrderAlphabetically + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldChoiceSetRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomFieldChoiceSetRequest := _CustomFieldChoiceSetRequest{} + + err = json.Unmarshal(data, &varCustomFieldChoiceSetRequest) + + if err != nil { + return err + } + + *o = CustomFieldChoiceSetRequest(varCustomFieldChoiceSetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "base_choices") + delete(additionalProperties, "extra_choices") + delete(additionalProperties, "order_alphabetically") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldChoiceSetRequest struct { + value *CustomFieldChoiceSetRequest + isSet bool +} + +func (v NullableCustomFieldChoiceSetRequest) Get() *CustomFieldChoiceSetRequest { + return v.value +} + +func (v *NullableCustomFieldChoiceSetRequest) Set(val *CustomFieldChoiceSetRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldChoiceSetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldChoiceSetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldChoiceSetRequest(val *CustomFieldChoiceSetRequest) *NullableCustomFieldChoiceSetRequest { + return &NullableCustomFieldChoiceSetRequest{value: val, isSet: true} +} + +func (v NullableCustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldChoiceSetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic.go new file mode 100644 index 00000000..b1571de1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CustomFieldFilterLogic type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldFilterLogic{} + +// CustomFieldFilterLogic struct for CustomFieldFilterLogic +type CustomFieldFilterLogic struct { + Value *CustomFieldFilterLogicValue `json:"value,omitempty"` + Label *CustomFieldFilterLogicLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldFilterLogic CustomFieldFilterLogic + +// NewCustomFieldFilterLogic instantiates a new CustomFieldFilterLogic object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldFilterLogic() *CustomFieldFilterLogic { + this := CustomFieldFilterLogic{} + return &this +} + +// NewCustomFieldFilterLogicWithDefaults instantiates a new CustomFieldFilterLogic object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldFilterLogicWithDefaults() *CustomFieldFilterLogic { + this := CustomFieldFilterLogic{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CustomFieldFilterLogic) GetValue() CustomFieldFilterLogicValue { + if o == nil || IsNil(o.Value) { + var ret CustomFieldFilterLogicValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldFilterLogic) GetValueOk() (*CustomFieldFilterLogicValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CustomFieldFilterLogic) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CustomFieldFilterLogicValue and assigns it to the Value field. +func (o *CustomFieldFilterLogic) SetValue(v CustomFieldFilterLogicValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CustomFieldFilterLogic) GetLabel() CustomFieldFilterLogicLabel { + if o == nil || IsNil(o.Label) { + var ret CustomFieldFilterLogicLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldFilterLogic) GetLabelOk() (*CustomFieldFilterLogicLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CustomFieldFilterLogic) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CustomFieldFilterLogicLabel and assigns it to the Label field. +func (o *CustomFieldFilterLogic) SetLabel(v CustomFieldFilterLogicLabel) { + o.Label = &v +} + +func (o CustomFieldFilterLogic) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldFilterLogic) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldFilterLogic) UnmarshalJSON(data []byte) (err error) { + varCustomFieldFilterLogic := _CustomFieldFilterLogic{} + + err = json.Unmarshal(data, &varCustomFieldFilterLogic) + + if err != nil { + return err + } + + *o = CustomFieldFilterLogic(varCustomFieldFilterLogic) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldFilterLogic struct { + value *CustomFieldFilterLogic + isSet bool +} + +func (v NullableCustomFieldFilterLogic) Get() *CustomFieldFilterLogic { + return v.value +} + +func (v *NullableCustomFieldFilterLogic) Set(val *CustomFieldFilterLogic) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldFilterLogic) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldFilterLogic) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldFilterLogic(val *CustomFieldFilterLogic) *NullableCustomFieldFilterLogic { + return &NullableCustomFieldFilterLogic{value: val, isSet: true} +} + +func (v NullableCustomFieldFilterLogic) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldFilterLogic) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic_label.go new file mode 100644 index 00000000..1a3f34f9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldFilterLogicLabel the model 'CustomFieldFilterLogicLabel' +type CustomFieldFilterLogicLabel string + +// List of CustomField_filter_logic_label +const ( + CUSTOMFIELDFILTERLOGICLABEL_DISABLED CustomFieldFilterLogicLabel = "Disabled" + CUSTOMFIELDFILTERLOGICLABEL_LOOSE CustomFieldFilterLogicLabel = "Loose" + CUSTOMFIELDFILTERLOGICLABEL_EXACT CustomFieldFilterLogicLabel = "Exact" +) + +// All allowed values of CustomFieldFilterLogicLabel enum +var AllowedCustomFieldFilterLogicLabelEnumValues = []CustomFieldFilterLogicLabel{ + "Disabled", + "Loose", + "Exact", +} + +func (v *CustomFieldFilterLogicLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldFilterLogicLabel(value) + for _, existing := range AllowedCustomFieldFilterLogicLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldFilterLogicLabel", value) +} + +// NewCustomFieldFilterLogicLabelFromValue returns a pointer to a valid CustomFieldFilterLogicLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldFilterLogicLabelFromValue(v string) (*CustomFieldFilterLogicLabel, error) { + ev := CustomFieldFilterLogicLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldFilterLogicLabel: valid values are %v", v, AllowedCustomFieldFilterLogicLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldFilterLogicLabel) IsValid() bool { + for _, existing := range AllowedCustomFieldFilterLogicLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_filter_logic_label value +func (v CustomFieldFilterLogicLabel) Ptr() *CustomFieldFilterLogicLabel { + return &v +} + +type NullableCustomFieldFilterLogicLabel struct { + value *CustomFieldFilterLogicLabel + isSet bool +} + +func (v NullableCustomFieldFilterLogicLabel) Get() *CustomFieldFilterLogicLabel { + return v.value +} + +func (v *NullableCustomFieldFilterLogicLabel) Set(val *CustomFieldFilterLogicLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldFilterLogicLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldFilterLogicLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldFilterLogicLabel(val *CustomFieldFilterLogicLabel) *NullableCustomFieldFilterLogicLabel { + return &NullableCustomFieldFilterLogicLabel{value: val, isSet: true} +} + +func (v NullableCustomFieldFilterLogicLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldFilterLogicLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic_value.go new file mode 100644 index 00000000..5ca99b5f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_filter_logic_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldFilterLogicValue * `disabled` - Disabled * `loose` - Loose * `exact` - Exact +type CustomFieldFilterLogicValue string + +// List of CustomField_filter_logic_value +const ( + CUSTOMFIELDFILTERLOGICVALUE_DISABLED CustomFieldFilterLogicValue = "disabled" + CUSTOMFIELDFILTERLOGICVALUE_LOOSE CustomFieldFilterLogicValue = "loose" + CUSTOMFIELDFILTERLOGICVALUE_EXACT CustomFieldFilterLogicValue = "exact" +) + +// All allowed values of CustomFieldFilterLogicValue enum +var AllowedCustomFieldFilterLogicValueEnumValues = []CustomFieldFilterLogicValue{ + "disabled", + "loose", + "exact", +} + +func (v *CustomFieldFilterLogicValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldFilterLogicValue(value) + for _, existing := range AllowedCustomFieldFilterLogicValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldFilterLogicValue", value) +} + +// NewCustomFieldFilterLogicValueFromValue returns a pointer to a valid CustomFieldFilterLogicValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldFilterLogicValueFromValue(v string) (*CustomFieldFilterLogicValue, error) { + ev := CustomFieldFilterLogicValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldFilterLogicValue: valid values are %v", v, AllowedCustomFieldFilterLogicValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldFilterLogicValue) IsValid() bool { + for _, existing := range AllowedCustomFieldFilterLogicValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_filter_logic_value value +func (v CustomFieldFilterLogicValue) Ptr() *CustomFieldFilterLogicValue { + return &v +} + +type NullableCustomFieldFilterLogicValue struct { + value *CustomFieldFilterLogicValue + isSet bool +} + +func (v NullableCustomFieldFilterLogicValue) Get() *CustomFieldFilterLogicValue { + return v.value +} + +func (v *NullableCustomFieldFilterLogicValue) Set(val *CustomFieldFilterLogicValue) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldFilterLogicValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldFilterLogicValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldFilterLogicValue(val *CustomFieldFilterLogicValue) *NullableCustomFieldFilterLogicValue { + return &NullableCustomFieldFilterLogicValue{value: val, isSet: true} +} + +func (v NullableCustomFieldFilterLogicValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldFilterLogicValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_request.go new file mode 100644 index 00000000..f073b314 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_request.go @@ -0,0 +1,872 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CustomFieldRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldRequest{} + +// CustomFieldRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type CustomFieldRequest struct { + ContentTypes []string `json:"content_types"` + Type CustomFieldTypeValue `json:"type"` + ObjectType NullableString `json:"object_type,omitempty"` + // Internal field name + Name string `json:"name"` + // Name of the field as displayed to users (if not provided, 'the field's name will be used) + Label *string `json:"label,omitempty"` + // Custom fields within the same group will be displayed together + GroupName *string `json:"group_name,omitempty"` + Description *string `json:"description,omitempty"` + // If true, this field is required when creating new objects or editing an existing object. + Required *bool `json:"required,omitempty"` + // Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored. + SearchWeight *int32 `json:"search_weight,omitempty"` + FilterLogic *CustomFieldFilterLogicValue `json:"filter_logic,omitempty"` + UiVisible *CustomFieldUiVisibleValue `json:"ui_visible,omitempty"` + UiEditable *CustomFieldUiEditableValue `json:"ui_editable,omitempty"` + // Replicate this value when cloning objects + IsCloneable *bool `json:"is_cloneable,omitempty"` + // Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. \"Foo\"). + Default interface{} `json:"default,omitempty"` + // Fields with higher weights appear lower in a form. + Weight *int32 `json:"weight,omitempty"` + // Minimum allowed value (for numeric fields) + ValidationMinimum NullableInt64 `json:"validation_minimum,omitempty"` + // Maximum allowed value (for numeric fields) + ValidationMaximum NullableInt64 `json:"validation_maximum,omitempty"` + // Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, ^[A-Z]{3}$ will limit values to exactly three uppercase letters. + ValidationRegex *string `json:"validation_regex,omitempty"` + ChoiceSet NullableNestedCustomFieldChoiceSetRequest `json:"choice_set,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldRequest CustomFieldRequest + +// NewCustomFieldRequest instantiates a new CustomFieldRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldRequest(contentTypes []string, type_ CustomFieldTypeValue, name string) *CustomFieldRequest { + this := CustomFieldRequest{} + this.ContentTypes = contentTypes + this.Type = type_ + this.Name = name + return &this +} + +// NewCustomFieldRequestWithDefaults instantiates a new CustomFieldRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldRequestWithDefaults() *CustomFieldRequest { + this := CustomFieldRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *CustomFieldRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *CustomFieldRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetType returns the Type field value +func (o *CustomFieldRequest) GetType() CustomFieldTypeValue { + if o == nil { + var ret CustomFieldTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetTypeOk() (*CustomFieldTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CustomFieldRequest) SetType(v CustomFieldTypeValue) { + o.Type = v +} + +// GetObjectType returns the ObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomFieldRequest) GetObjectType() string { + if o == nil || IsNil(o.ObjectType.Get()) { + var ret string + return ret + } + return *o.ObjectType.Get() +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldRequest) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectType.Get(), o.ObjectType.IsSet() +} + +// HasObjectType returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasObjectType() bool { + if o != nil && o.ObjectType.IsSet() { + return true + } + + return false +} + +// SetObjectType gets a reference to the given NullableString and assigns it to the ObjectType field. +func (o *CustomFieldRequest) SetObjectType(v string) { + o.ObjectType.Set(&v) +} + +// SetObjectTypeNil sets the value for ObjectType to be an explicit nil +func (o *CustomFieldRequest) SetObjectTypeNil() { + o.ObjectType.Set(nil) +} + +// UnsetObjectType ensures that no value is present for ObjectType, not even an explicit nil +func (o *CustomFieldRequest) UnsetObjectType() { + o.ObjectType.Unset() +} + +// GetName returns the Name field value +func (o *CustomFieldRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomFieldRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *CustomFieldRequest) SetLabel(v string) { + o.Label = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *CustomFieldRequest) SetGroupName(v string) { + o.GroupName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CustomFieldRequest) SetDescription(v string) { + o.Description = &v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *CustomFieldRequest) SetRequired(v bool) { + o.Required = &v +} + +// GetSearchWeight returns the SearchWeight field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetSearchWeight() int32 { + if o == nil || IsNil(o.SearchWeight) { + var ret int32 + return ret + } + return *o.SearchWeight +} + +// GetSearchWeightOk returns a tuple with the SearchWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetSearchWeightOk() (*int32, bool) { + if o == nil || IsNil(o.SearchWeight) { + return nil, false + } + return o.SearchWeight, true +} + +// HasSearchWeight returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasSearchWeight() bool { + if o != nil && !IsNil(o.SearchWeight) { + return true + } + + return false +} + +// SetSearchWeight gets a reference to the given int32 and assigns it to the SearchWeight field. +func (o *CustomFieldRequest) SetSearchWeight(v int32) { + o.SearchWeight = &v +} + +// GetFilterLogic returns the FilterLogic field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetFilterLogic() CustomFieldFilterLogicValue { + if o == nil || IsNil(o.FilterLogic) { + var ret CustomFieldFilterLogicValue + return ret + } + return *o.FilterLogic +} + +// GetFilterLogicOk returns a tuple with the FilterLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetFilterLogicOk() (*CustomFieldFilterLogicValue, bool) { + if o == nil || IsNil(o.FilterLogic) { + return nil, false + } + return o.FilterLogic, true +} + +// HasFilterLogic returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasFilterLogic() bool { + if o != nil && !IsNil(o.FilterLogic) { + return true + } + + return false +} + +// SetFilterLogic gets a reference to the given CustomFieldFilterLogicValue and assigns it to the FilterLogic field. +func (o *CustomFieldRequest) SetFilterLogic(v CustomFieldFilterLogicValue) { + o.FilterLogic = &v +} + +// GetUiVisible returns the UiVisible field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetUiVisible() CustomFieldUiVisibleValue { + if o == nil || IsNil(o.UiVisible) { + var ret CustomFieldUiVisibleValue + return ret + } + return *o.UiVisible +} + +// GetUiVisibleOk returns a tuple with the UiVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetUiVisibleOk() (*CustomFieldUiVisibleValue, bool) { + if o == nil || IsNil(o.UiVisible) { + return nil, false + } + return o.UiVisible, true +} + +// HasUiVisible returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasUiVisible() bool { + if o != nil && !IsNil(o.UiVisible) { + return true + } + + return false +} + +// SetUiVisible gets a reference to the given CustomFieldUiVisibleValue and assigns it to the UiVisible field. +func (o *CustomFieldRequest) SetUiVisible(v CustomFieldUiVisibleValue) { + o.UiVisible = &v +} + +// GetUiEditable returns the UiEditable field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetUiEditable() CustomFieldUiEditableValue { + if o == nil || IsNil(o.UiEditable) { + var ret CustomFieldUiEditableValue + return ret + } + return *o.UiEditable +} + +// GetUiEditableOk returns a tuple with the UiEditable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetUiEditableOk() (*CustomFieldUiEditableValue, bool) { + if o == nil || IsNil(o.UiEditable) { + return nil, false + } + return o.UiEditable, true +} + +// HasUiEditable returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasUiEditable() bool { + if o != nil && !IsNil(o.UiEditable) { + return true + } + + return false +} + +// SetUiEditable gets a reference to the given CustomFieldUiEditableValue and assigns it to the UiEditable field. +func (o *CustomFieldRequest) SetUiEditable(v CustomFieldUiEditableValue) { + o.UiEditable = &v +} + +// GetIsCloneable returns the IsCloneable field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetIsCloneable() bool { + if o == nil || IsNil(o.IsCloneable) { + var ret bool + return ret + } + return *o.IsCloneable +} + +// GetIsCloneableOk returns a tuple with the IsCloneable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetIsCloneableOk() (*bool, bool) { + if o == nil || IsNil(o.IsCloneable) { + return nil, false + } + return o.IsCloneable, true +} + +// HasIsCloneable returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasIsCloneable() bool { + if o != nil && !IsNil(o.IsCloneable) { + return true + } + + return false +} + +// SetIsCloneable gets a reference to the given bool and assigns it to the IsCloneable field. +func (o *CustomFieldRequest) SetIsCloneable(v bool) { + o.IsCloneable = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomFieldRequest) GetDefault() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldRequest) GetDefaultOk() (*interface{}, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return &o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasDefault() bool { + if o != nil && IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given interface{} and assigns it to the Default field. +func (o *CustomFieldRequest) SetDefault(v interface{}) { + o.Default = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *CustomFieldRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetValidationMinimum returns the ValidationMinimum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomFieldRequest) GetValidationMinimum() int64 { + if o == nil || IsNil(o.ValidationMinimum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMinimum.Get() +} + +// GetValidationMinimumOk returns a tuple with the ValidationMinimum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldRequest) GetValidationMinimumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMinimum.Get(), o.ValidationMinimum.IsSet() +} + +// HasValidationMinimum returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasValidationMinimum() bool { + if o != nil && o.ValidationMinimum.IsSet() { + return true + } + + return false +} + +// SetValidationMinimum gets a reference to the given NullableInt64 and assigns it to the ValidationMinimum field. +func (o *CustomFieldRequest) SetValidationMinimum(v int64) { + o.ValidationMinimum.Set(&v) +} + +// SetValidationMinimumNil sets the value for ValidationMinimum to be an explicit nil +func (o *CustomFieldRequest) SetValidationMinimumNil() { + o.ValidationMinimum.Set(nil) +} + +// UnsetValidationMinimum ensures that no value is present for ValidationMinimum, not even an explicit nil +func (o *CustomFieldRequest) UnsetValidationMinimum() { + o.ValidationMinimum.Unset() +} + +// GetValidationMaximum returns the ValidationMaximum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomFieldRequest) GetValidationMaximum() int64 { + if o == nil || IsNil(o.ValidationMaximum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMaximum.Get() +} + +// GetValidationMaximumOk returns a tuple with the ValidationMaximum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldRequest) GetValidationMaximumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMaximum.Get(), o.ValidationMaximum.IsSet() +} + +// HasValidationMaximum returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasValidationMaximum() bool { + if o != nil && o.ValidationMaximum.IsSet() { + return true + } + + return false +} + +// SetValidationMaximum gets a reference to the given NullableInt64 and assigns it to the ValidationMaximum field. +func (o *CustomFieldRequest) SetValidationMaximum(v int64) { + o.ValidationMaximum.Set(&v) +} + +// SetValidationMaximumNil sets the value for ValidationMaximum to be an explicit nil +func (o *CustomFieldRequest) SetValidationMaximumNil() { + o.ValidationMaximum.Set(nil) +} + +// UnsetValidationMaximum ensures that no value is present for ValidationMaximum, not even an explicit nil +func (o *CustomFieldRequest) UnsetValidationMaximum() { + o.ValidationMaximum.Unset() +} + +// GetValidationRegex returns the ValidationRegex field value if set, zero value otherwise. +func (o *CustomFieldRequest) GetValidationRegex() string { + if o == nil || IsNil(o.ValidationRegex) { + var ret string + return ret + } + return *o.ValidationRegex +} + +// GetValidationRegexOk returns a tuple with the ValidationRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldRequest) GetValidationRegexOk() (*string, bool) { + if o == nil || IsNil(o.ValidationRegex) { + return nil, false + } + return o.ValidationRegex, true +} + +// HasValidationRegex returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasValidationRegex() bool { + if o != nil && !IsNil(o.ValidationRegex) { + return true + } + + return false +} + +// SetValidationRegex gets a reference to the given string and assigns it to the ValidationRegex field. +func (o *CustomFieldRequest) SetValidationRegex(v string) { + o.ValidationRegex = &v +} + +// GetChoiceSet returns the ChoiceSet field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomFieldRequest) GetChoiceSet() NestedCustomFieldChoiceSetRequest { + if o == nil || IsNil(o.ChoiceSet.Get()) { + var ret NestedCustomFieldChoiceSetRequest + return ret + } + return *o.ChoiceSet.Get() +} + +// GetChoiceSetOk returns a tuple with the ChoiceSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomFieldRequest) GetChoiceSetOk() (*NestedCustomFieldChoiceSetRequest, bool) { + if o == nil { + return nil, false + } + return o.ChoiceSet.Get(), o.ChoiceSet.IsSet() +} + +// HasChoiceSet returns a boolean if a field has been set. +func (o *CustomFieldRequest) HasChoiceSet() bool { + if o != nil && o.ChoiceSet.IsSet() { + return true + } + + return false +} + +// SetChoiceSet gets a reference to the given NullableNestedCustomFieldChoiceSetRequest and assigns it to the ChoiceSet field. +func (o *CustomFieldRequest) SetChoiceSet(v NestedCustomFieldChoiceSetRequest) { + o.ChoiceSet.Set(&v) +} + +// SetChoiceSetNil sets the value for ChoiceSet to be an explicit nil +func (o *CustomFieldRequest) SetChoiceSetNil() { + o.ChoiceSet.Set(nil) +} + +// UnsetChoiceSet ensures that no value is present for ChoiceSet, not even an explicit nil +func (o *CustomFieldRequest) UnsetChoiceSet() { + o.ChoiceSet.Unset() +} + +func (o CustomFieldRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + toSerialize["type"] = o.Type + if o.ObjectType.IsSet() { + toSerialize["object_type"] = o.ObjectType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.GroupName) { + toSerialize["group_name"] = o.GroupName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.SearchWeight) { + toSerialize["search_weight"] = o.SearchWeight + } + if !IsNil(o.FilterLogic) { + toSerialize["filter_logic"] = o.FilterLogic + } + if !IsNil(o.UiVisible) { + toSerialize["ui_visible"] = o.UiVisible + } + if !IsNil(o.UiEditable) { + toSerialize["ui_editable"] = o.UiEditable + } + if !IsNil(o.IsCloneable) { + toSerialize["is_cloneable"] = o.IsCloneable + } + if o.Default != nil { + toSerialize["default"] = o.Default + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if o.ValidationMinimum.IsSet() { + toSerialize["validation_minimum"] = o.ValidationMinimum.Get() + } + if o.ValidationMaximum.IsSet() { + toSerialize["validation_maximum"] = o.ValidationMaximum.Get() + } + if !IsNil(o.ValidationRegex) { + toSerialize["validation_regex"] = o.ValidationRegex + } + if o.ChoiceSet.IsSet() { + toSerialize["choice_set"] = o.ChoiceSet.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "type", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomFieldRequest := _CustomFieldRequest{} + + err = json.Unmarshal(data, &varCustomFieldRequest) + + if err != nil { + return err + } + + *o = CustomFieldRequest(varCustomFieldRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "type") + delete(additionalProperties, "object_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "group_name") + delete(additionalProperties, "description") + delete(additionalProperties, "required") + delete(additionalProperties, "search_weight") + delete(additionalProperties, "filter_logic") + delete(additionalProperties, "ui_visible") + delete(additionalProperties, "ui_editable") + delete(additionalProperties, "is_cloneable") + delete(additionalProperties, "default") + delete(additionalProperties, "weight") + delete(additionalProperties, "validation_minimum") + delete(additionalProperties, "validation_maximum") + delete(additionalProperties, "validation_regex") + delete(additionalProperties, "choice_set") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldRequest struct { + value *CustomFieldRequest + isSet bool +} + +func (v NullableCustomFieldRequest) Get() *CustomFieldRequest { + return v.value +} + +func (v *NullableCustomFieldRequest) Set(val *CustomFieldRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldRequest(val *CustomFieldRequest) *NullableCustomFieldRequest { + return &NullableCustomFieldRequest{value: val, isSet: true} +} + +func (v NullableCustomFieldRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type.go new file mode 100644 index 00000000..802b7eb0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CustomFieldType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldType{} + +// CustomFieldType struct for CustomFieldType +type CustomFieldType struct { + Value *CustomFieldTypeValue `json:"value,omitempty"` + Label *CustomFieldTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldType CustomFieldType + +// NewCustomFieldType instantiates a new CustomFieldType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldType() *CustomFieldType { + this := CustomFieldType{} + return &this +} + +// NewCustomFieldTypeWithDefaults instantiates a new CustomFieldType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldTypeWithDefaults() *CustomFieldType { + this := CustomFieldType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CustomFieldType) GetValue() CustomFieldTypeValue { + if o == nil || IsNil(o.Value) { + var ret CustomFieldTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldType) GetValueOk() (*CustomFieldTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CustomFieldType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CustomFieldTypeValue and assigns it to the Value field. +func (o *CustomFieldType) SetValue(v CustomFieldTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CustomFieldType) GetLabel() CustomFieldTypeLabel { + if o == nil || IsNil(o.Label) { + var ret CustomFieldTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldType) GetLabelOk() (*CustomFieldTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CustomFieldType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CustomFieldTypeLabel and assigns it to the Label field. +func (o *CustomFieldType) SetLabel(v CustomFieldTypeLabel) { + o.Label = &v +} + +func (o CustomFieldType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldType) UnmarshalJSON(data []byte) (err error) { + varCustomFieldType := _CustomFieldType{} + + err = json.Unmarshal(data, &varCustomFieldType) + + if err != nil { + return err + } + + *o = CustomFieldType(varCustomFieldType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldType struct { + value *CustomFieldType + isSet bool +} + +func (v NullableCustomFieldType) Get() *CustomFieldType { + return v.value +} + +func (v *NullableCustomFieldType) Set(val *CustomFieldType) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldType) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldType(val *CustomFieldType) *NullableCustomFieldType { + return &NullableCustomFieldType{value: val, isSet: true} +} + +func (v NullableCustomFieldType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type_label.go new file mode 100644 index 00000000..1d1023cd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type_label.go @@ -0,0 +1,132 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldTypeLabel the model 'CustomFieldTypeLabel' +type CustomFieldTypeLabel string + +// List of CustomField_type_label +const ( + CUSTOMFIELDTYPELABEL_TEXT CustomFieldTypeLabel = "Text" + CUSTOMFIELDTYPELABEL_TEXT__LONG CustomFieldTypeLabel = "Text (long)" + CUSTOMFIELDTYPELABEL_INTEGER CustomFieldTypeLabel = "Integer" + CUSTOMFIELDTYPELABEL_DECIMAL CustomFieldTypeLabel = "Decimal" + CUSTOMFIELDTYPELABEL_BOOLEAN__TRUE_FALSE CustomFieldTypeLabel = "Boolean (true/false)" + CUSTOMFIELDTYPELABEL_DATE CustomFieldTypeLabel = "Date" + CUSTOMFIELDTYPELABEL_DATE__TIME CustomFieldTypeLabel = "Date & time" + CUSTOMFIELDTYPELABEL_URL CustomFieldTypeLabel = "URL" + CUSTOMFIELDTYPELABEL_JSON CustomFieldTypeLabel = "JSON" + CUSTOMFIELDTYPELABEL_SELECTION CustomFieldTypeLabel = "Selection" + CUSTOMFIELDTYPELABEL_MULTIPLE_SELECTION CustomFieldTypeLabel = "Multiple selection" + CUSTOMFIELDTYPELABEL_OBJECT CustomFieldTypeLabel = "Object" + CUSTOMFIELDTYPELABEL_MULTIPLE_OBJECTS CustomFieldTypeLabel = "Multiple objects" +) + +// All allowed values of CustomFieldTypeLabel enum +var AllowedCustomFieldTypeLabelEnumValues = []CustomFieldTypeLabel{ + "Text", + "Text (long)", + "Integer", + "Decimal", + "Boolean (true/false)", + "Date", + "Date & time", + "URL", + "JSON", + "Selection", + "Multiple selection", + "Object", + "Multiple objects", +} + +func (v *CustomFieldTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldTypeLabel(value) + for _, existing := range AllowedCustomFieldTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldTypeLabel", value) +} + +// NewCustomFieldTypeLabelFromValue returns a pointer to a valid CustomFieldTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldTypeLabelFromValue(v string) (*CustomFieldTypeLabel, error) { + ev := CustomFieldTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldTypeLabel: valid values are %v", v, AllowedCustomFieldTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldTypeLabel) IsValid() bool { + for _, existing := range AllowedCustomFieldTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_type_label value +func (v CustomFieldTypeLabel) Ptr() *CustomFieldTypeLabel { + return &v +} + +type NullableCustomFieldTypeLabel struct { + value *CustomFieldTypeLabel + isSet bool +} + +func (v NullableCustomFieldTypeLabel) Get() *CustomFieldTypeLabel { + return v.value +} + +func (v *NullableCustomFieldTypeLabel) Set(val *CustomFieldTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldTypeLabel(val *CustomFieldTypeLabel) *NullableCustomFieldTypeLabel { + return &NullableCustomFieldTypeLabel{value: val, isSet: true} +} + +func (v NullableCustomFieldTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type_value.go new file mode 100644 index 00000000..a11f29ac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_type_value.go @@ -0,0 +1,132 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldTypeValue * `text` - Text * `longtext` - Text (long) * `integer` - Integer * `decimal` - Decimal * `boolean` - Boolean (true/false) * `date` - Date * `datetime` - Date & time * `url` - URL * `json` - JSON * `select` - Selection * `multiselect` - Multiple selection * `object` - Object * `multiobject` - Multiple objects +type CustomFieldTypeValue string + +// List of CustomField_type_value +const ( + CUSTOMFIELDTYPEVALUE_TEXT CustomFieldTypeValue = "text" + CUSTOMFIELDTYPEVALUE_LONGTEXT CustomFieldTypeValue = "longtext" + CUSTOMFIELDTYPEVALUE_INTEGER CustomFieldTypeValue = "integer" + CUSTOMFIELDTYPEVALUE_DECIMAL CustomFieldTypeValue = "decimal" + CUSTOMFIELDTYPEVALUE_BOOLEAN CustomFieldTypeValue = "boolean" + CUSTOMFIELDTYPEVALUE_DATE CustomFieldTypeValue = "date" + CUSTOMFIELDTYPEVALUE_DATETIME CustomFieldTypeValue = "datetime" + CUSTOMFIELDTYPEVALUE_URL CustomFieldTypeValue = "url" + CUSTOMFIELDTYPEVALUE_JSON CustomFieldTypeValue = "json" + CUSTOMFIELDTYPEVALUE_SELECT CustomFieldTypeValue = "select" + CUSTOMFIELDTYPEVALUE_MULTISELECT CustomFieldTypeValue = "multiselect" + CUSTOMFIELDTYPEVALUE_OBJECT CustomFieldTypeValue = "object" + CUSTOMFIELDTYPEVALUE_MULTIOBJECT CustomFieldTypeValue = "multiobject" +) + +// All allowed values of CustomFieldTypeValue enum +var AllowedCustomFieldTypeValueEnumValues = []CustomFieldTypeValue{ + "text", + "longtext", + "integer", + "decimal", + "boolean", + "date", + "datetime", + "url", + "json", + "select", + "multiselect", + "object", + "multiobject", +} + +func (v *CustomFieldTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldTypeValue(value) + for _, existing := range AllowedCustomFieldTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldTypeValue", value) +} + +// NewCustomFieldTypeValueFromValue returns a pointer to a valid CustomFieldTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldTypeValueFromValue(v string) (*CustomFieldTypeValue, error) { + ev := CustomFieldTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldTypeValue: valid values are %v", v, AllowedCustomFieldTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldTypeValue) IsValid() bool { + for _, existing := range AllowedCustomFieldTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_type_value value +func (v CustomFieldTypeValue) Ptr() *CustomFieldTypeValue { + return &v +} + +type NullableCustomFieldTypeValue struct { + value *CustomFieldTypeValue + isSet bool +} + +func (v NullableCustomFieldTypeValue) Get() *CustomFieldTypeValue { + return v.value +} + +func (v *NullableCustomFieldTypeValue) Set(val *CustomFieldTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldTypeValue(val *CustomFieldTypeValue) *NullableCustomFieldTypeValue { + return &NullableCustomFieldTypeValue{value: val, isSet: true} +} + +func (v NullableCustomFieldTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable.go new file mode 100644 index 00000000..194cb15e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CustomFieldUiEditable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldUiEditable{} + +// CustomFieldUiEditable struct for CustomFieldUiEditable +type CustomFieldUiEditable struct { + Value *CustomFieldUiEditableValue `json:"value,omitempty"` + Label *CustomFieldUiEditableLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldUiEditable CustomFieldUiEditable + +// NewCustomFieldUiEditable instantiates a new CustomFieldUiEditable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldUiEditable() *CustomFieldUiEditable { + this := CustomFieldUiEditable{} + return &this +} + +// NewCustomFieldUiEditableWithDefaults instantiates a new CustomFieldUiEditable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldUiEditableWithDefaults() *CustomFieldUiEditable { + this := CustomFieldUiEditable{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CustomFieldUiEditable) GetValue() CustomFieldUiEditableValue { + if o == nil || IsNil(o.Value) { + var ret CustomFieldUiEditableValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldUiEditable) GetValueOk() (*CustomFieldUiEditableValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CustomFieldUiEditable) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CustomFieldUiEditableValue and assigns it to the Value field. +func (o *CustomFieldUiEditable) SetValue(v CustomFieldUiEditableValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CustomFieldUiEditable) GetLabel() CustomFieldUiEditableLabel { + if o == nil || IsNil(o.Label) { + var ret CustomFieldUiEditableLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldUiEditable) GetLabelOk() (*CustomFieldUiEditableLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CustomFieldUiEditable) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CustomFieldUiEditableLabel and assigns it to the Label field. +func (o *CustomFieldUiEditable) SetLabel(v CustomFieldUiEditableLabel) { + o.Label = &v +} + +func (o CustomFieldUiEditable) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldUiEditable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldUiEditable) UnmarshalJSON(data []byte) (err error) { + varCustomFieldUiEditable := _CustomFieldUiEditable{} + + err = json.Unmarshal(data, &varCustomFieldUiEditable) + + if err != nil { + return err + } + + *o = CustomFieldUiEditable(varCustomFieldUiEditable) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldUiEditable struct { + value *CustomFieldUiEditable + isSet bool +} + +func (v NullableCustomFieldUiEditable) Get() *CustomFieldUiEditable { + return v.value +} + +func (v *NullableCustomFieldUiEditable) Set(val *CustomFieldUiEditable) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldUiEditable) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldUiEditable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldUiEditable(val *CustomFieldUiEditable) *NullableCustomFieldUiEditable { + return &NullableCustomFieldUiEditable{value: val, isSet: true} +} + +func (v NullableCustomFieldUiEditable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldUiEditable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable_label.go new file mode 100644 index 00000000..5074a6a9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldUiEditableLabel the model 'CustomFieldUiEditableLabel' +type CustomFieldUiEditableLabel string + +// List of CustomField_ui_editable_label +const ( + CUSTOMFIELDUIEDITABLELABEL_YES CustomFieldUiEditableLabel = "Yes" + CUSTOMFIELDUIEDITABLELABEL_NO CustomFieldUiEditableLabel = "No" + CUSTOMFIELDUIEDITABLELABEL_HIDDEN CustomFieldUiEditableLabel = "Hidden" +) + +// All allowed values of CustomFieldUiEditableLabel enum +var AllowedCustomFieldUiEditableLabelEnumValues = []CustomFieldUiEditableLabel{ + "Yes", + "No", + "Hidden", +} + +func (v *CustomFieldUiEditableLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldUiEditableLabel(value) + for _, existing := range AllowedCustomFieldUiEditableLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldUiEditableLabel", value) +} + +// NewCustomFieldUiEditableLabelFromValue returns a pointer to a valid CustomFieldUiEditableLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldUiEditableLabelFromValue(v string) (*CustomFieldUiEditableLabel, error) { + ev := CustomFieldUiEditableLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldUiEditableLabel: valid values are %v", v, AllowedCustomFieldUiEditableLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldUiEditableLabel) IsValid() bool { + for _, existing := range AllowedCustomFieldUiEditableLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_ui_editable_label value +func (v CustomFieldUiEditableLabel) Ptr() *CustomFieldUiEditableLabel { + return &v +} + +type NullableCustomFieldUiEditableLabel struct { + value *CustomFieldUiEditableLabel + isSet bool +} + +func (v NullableCustomFieldUiEditableLabel) Get() *CustomFieldUiEditableLabel { + return v.value +} + +func (v *NullableCustomFieldUiEditableLabel) Set(val *CustomFieldUiEditableLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldUiEditableLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldUiEditableLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldUiEditableLabel(val *CustomFieldUiEditableLabel) *NullableCustomFieldUiEditableLabel { + return &NullableCustomFieldUiEditableLabel{value: val, isSet: true} +} + +func (v NullableCustomFieldUiEditableLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldUiEditableLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable_value.go new file mode 100644 index 00000000..6e044452 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_editable_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldUiEditableValue * `yes` - Yes * `no` - No * `hidden` - Hidden +type CustomFieldUiEditableValue string + +// List of CustomField_ui_editable_value +const ( + CUSTOMFIELDUIEDITABLEVALUE_YES CustomFieldUiEditableValue = "yes" + CUSTOMFIELDUIEDITABLEVALUE_NO CustomFieldUiEditableValue = "no" + CUSTOMFIELDUIEDITABLEVALUE_HIDDEN CustomFieldUiEditableValue = "hidden" +) + +// All allowed values of CustomFieldUiEditableValue enum +var AllowedCustomFieldUiEditableValueEnumValues = []CustomFieldUiEditableValue{ + "yes", + "no", + "hidden", +} + +func (v *CustomFieldUiEditableValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldUiEditableValue(value) + for _, existing := range AllowedCustomFieldUiEditableValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldUiEditableValue", value) +} + +// NewCustomFieldUiEditableValueFromValue returns a pointer to a valid CustomFieldUiEditableValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldUiEditableValueFromValue(v string) (*CustomFieldUiEditableValue, error) { + ev := CustomFieldUiEditableValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldUiEditableValue: valid values are %v", v, AllowedCustomFieldUiEditableValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldUiEditableValue) IsValid() bool { + for _, existing := range AllowedCustomFieldUiEditableValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_ui_editable_value value +func (v CustomFieldUiEditableValue) Ptr() *CustomFieldUiEditableValue { + return &v +} + +type NullableCustomFieldUiEditableValue struct { + value *CustomFieldUiEditableValue + isSet bool +} + +func (v NullableCustomFieldUiEditableValue) Get() *CustomFieldUiEditableValue { + return v.value +} + +func (v *NullableCustomFieldUiEditableValue) Set(val *CustomFieldUiEditableValue) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldUiEditableValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldUiEditableValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldUiEditableValue(val *CustomFieldUiEditableValue) *NullableCustomFieldUiEditableValue { + return &NullableCustomFieldUiEditableValue{value: val, isSet: true} +} + +func (v NullableCustomFieldUiEditableValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldUiEditableValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible.go new file mode 100644 index 00000000..5e7ce10c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the CustomFieldUiVisible type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomFieldUiVisible{} + +// CustomFieldUiVisible struct for CustomFieldUiVisible +type CustomFieldUiVisible struct { + Value *CustomFieldUiVisibleValue `json:"value,omitempty"` + Label *CustomFieldUiVisibleLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomFieldUiVisible CustomFieldUiVisible + +// NewCustomFieldUiVisible instantiates a new CustomFieldUiVisible object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomFieldUiVisible() *CustomFieldUiVisible { + this := CustomFieldUiVisible{} + return &this +} + +// NewCustomFieldUiVisibleWithDefaults instantiates a new CustomFieldUiVisible object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomFieldUiVisibleWithDefaults() *CustomFieldUiVisible { + this := CustomFieldUiVisible{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CustomFieldUiVisible) GetValue() CustomFieldUiVisibleValue { + if o == nil || IsNil(o.Value) { + var ret CustomFieldUiVisibleValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldUiVisible) GetValueOk() (*CustomFieldUiVisibleValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CustomFieldUiVisible) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given CustomFieldUiVisibleValue and assigns it to the Value field. +func (o *CustomFieldUiVisible) SetValue(v CustomFieldUiVisibleValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *CustomFieldUiVisible) GetLabel() CustomFieldUiVisibleLabel { + if o == nil || IsNil(o.Label) { + var ret CustomFieldUiVisibleLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomFieldUiVisible) GetLabelOk() (*CustomFieldUiVisibleLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *CustomFieldUiVisible) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given CustomFieldUiVisibleLabel and assigns it to the Label field. +func (o *CustomFieldUiVisible) SetLabel(v CustomFieldUiVisibleLabel) { + o.Label = &v +} + +func (o CustomFieldUiVisible) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomFieldUiVisible) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomFieldUiVisible) UnmarshalJSON(data []byte) (err error) { + varCustomFieldUiVisible := _CustomFieldUiVisible{} + + err = json.Unmarshal(data, &varCustomFieldUiVisible) + + if err != nil { + return err + } + + *o = CustomFieldUiVisible(varCustomFieldUiVisible) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomFieldUiVisible struct { + value *CustomFieldUiVisible + isSet bool +} + +func (v NullableCustomFieldUiVisible) Get() *CustomFieldUiVisible { + return v.value +} + +func (v *NullableCustomFieldUiVisible) Set(val *CustomFieldUiVisible) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldUiVisible) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldUiVisible) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldUiVisible(val *CustomFieldUiVisible) *NullableCustomFieldUiVisible { + return &NullableCustomFieldUiVisible{value: val, isSet: true} +} + +func (v NullableCustomFieldUiVisible) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldUiVisible) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible_label.go new file mode 100644 index 00000000..504a3f84 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldUiVisibleLabel the model 'CustomFieldUiVisibleLabel' +type CustomFieldUiVisibleLabel string + +// List of CustomField_ui_visible_label +const ( + CUSTOMFIELDUIVISIBLELABEL_ALWAYS CustomFieldUiVisibleLabel = "Always" + CUSTOMFIELDUIVISIBLELABEL_IF_SET CustomFieldUiVisibleLabel = "If set" + CUSTOMFIELDUIVISIBLELABEL_HIDDEN CustomFieldUiVisibleLabel = "Hidden" +) + +// All allowed values of CustomFieldUiVisibleLabel enum +var AllowedCustomFieldUiVisibleLabelEnumValues = []CustomFieldUiVisibleLabel{ + "Always", + "If set", + "Hidden", +} + +func (v *CustomFieldUiVisibleLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldUiVisibleLabel(value) + for _, existing := range AllowedCustomFieldUiVisibleLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldUiVisibleLabel", value) +} + +// NewCustomFieldUiVisibleLabelFromValue returns a pointer to a valid CustomFieldUiVisibleLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldUiVisibleLabelFromValue(v string) (*CustomFieldUiVisibleLabel, error) { + ev := CustomFieldUiVisibleLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldUiVisibleLabel: valid values are %v", v, AllowedCustomFieldUiVisibleLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldUiVisibleLabel) IsValid() bool { + for _, existing := range AllowedCustomFieldUiVisibleLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_ui_visible_label value +func (v CustomFieldUiVisibleLabel) Ptr() *CustomFieldUiVisibleLabel { + return &v +} + +type NullableCustomFieldUiVisibleLabel struct { + value *CustomFieldUiVisibleLabel + isSet bool +} + +func (v NullableCustomFieldUiVisibleLabel) Get() *CustomFieldUiVisibleLabel { + return v.value +} + +func (v *NullableCustomFieldUiVisibleLabel) Set(val *CustomFieldUiVisibleLabel) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldUiVisibleLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldUiVisibleLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldUiVisibleLabel(val *CustomFieldUiVisibleLabel) *NullableCustomFieldUiVisibleLabel { + return &NullableCustomFieldUiVisibleLabel{value: val, isSet: true} +} + +func (v NullableCustomFieldUiVisibleLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldUiVisibleLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible_value.go new file mode 100644 index 00000000..4df345b7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_field_ui_visible_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomFieldUiVisibleValue * `always` - Always * `if-set` - If set * `hidden` - Hidden +type CustomFieldUiVisibleValue string + +// List of CustomField_ui_visible_value +const ( + CUSTOMFIELDUIVISIBLEVALUE_ALWAYS CustomFieldUiVisibleValue = "always" + CUSTOMFIELDUIVISIBLEVALUE_IF_SET CustomFieldUiVisibleValue = "if-set" + CUSTOMFIELDUIVISIBLEVALUE_HIDDEN CustomFieldUiVisibleValue = "hidden" +) + +// All allowed values of CustomFieldUiVisibleValue enum +var AllowedCustomFieldUiVisibleValueEnumValues = []CustomFieldUiVisibleValue{ + "always", + "if-set", + "hidden", +} + +func (v *CustomFieldUiVisibleValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomFieldUiVisibleValue(value) + for _, existing := range AllowedCustomFieldUiVisibleValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomFieldUiVisibleValue", value) +} + +// NewCustomFieldUiVisibleValueFromValue returns a pointer to a valid CustomFieldUiVisibleValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomFieldUiVisibleValueFromValue(v string) (*CustomFieldUiVisibleValue, error) { + ev := CustomFieldUiVisibleValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomFieldUiVisibleValue: valid values are %v", v, AllowedCustomFieldUiVisibleValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomFieldUiVisibleValue) IsValid() bool { + for _, existing := range AllowedCustomFieldUiVisibleValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomField_ui_visible_value value +func (v CustomFieldUiVisibleValue) Ptr() *CustomFieldUiVisibleValue { + return &v +} + +type NullableCustomFieldUiVisibleValue struct { + value *CustomFieldUiVisibleValue + isSet bool +} + +func (v NullableCustomFieldUiVisibleValue) Get() *CustomFieldUiVisibleValue { + return v.value +} + +func (v *NullableCustomFieldUiVisibleValue) Set(val *CustomFieldUiVisibleValue) { + v.value = val + v.isSet = true +} + +func (v NullableCustomFieldUiVisibleValue) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomFieldUiVisibleValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomFieldUiVisibleValue(val *CustomFieldUiVisibleValue) *NullableCustomFieldUiVisibleValue { + return &NullableCustomFieldUiVisibleValue{value: val, isSet: true} +} + +func (v NullableCustomFieldUiVisibleValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomFieldUiVisibleValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link.go new file mode 100644 index 00000000..e9d49f9e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link.go @@ -0,0 +1,592 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CustomLink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomLink{} + +// CustomLink Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type CustomLink struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + // Jinja2 template code for link text + LinkText string `json:"link_text"` + // Jinja2 template code for link URL + LinkUrl string `json:"link_url"` + Weight *int32 `json:"weight,omitempty"` + // Links with the same group will appear as a dropdown menu + GroupName *string `json:"group_name,omitempty"` + ButtonClass *CustomLinkButtonClass `json:"button_class,omitempty"` + // Force link to open in a new window + NewWindow *bool `json:"new_window,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _CustomLink CustomLink + +// NewCustomLink instantiates a new CustomLink object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomLink(id int32, url string, display string, contentTypes []string, name string, linkText string, linkUrl string, created NullableTime, lastUpdated NullableTime) *CustomLink { + this := CustomLink{} + this.Id = id + this.Url = url + this.Display = display + this.ContentTypes = contentTypes + this.Name = name + this.LinkText = linkText + this.LinkUrl = linkUrl + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewCustomLinkWithDefaults instantiates a new CustomLink object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomLinkWithDefaults() *CustomLink { + this := CustomLink{} + return &this +} + +// GetId returns the Id field value +func (o *CustomLink) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CustomLink) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CustomLink) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *CustomLink) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CustomLink) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *CustomLink) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *CustomLink) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *CustomLink) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *CustomLink) SetDisplay(v string) { + o.Display = v +} + +// GetContentTypes returns the ContentTypes field value +func (o *CustomLink) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *CustomLink) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *CustomLink) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *CustomLink) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomLink) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomLink) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *CustomLink) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLink) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *CustomLink) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *CustomLink) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetLinkText returns the LinkText field value +func (o *CustomLink) GetLinkText() string { + if o == nil { + var ret string + return ret + } + + return o.LinkText +} + +// GetLinkTextOk returns a tuple with the LinkText field value +// and a boolean to check if the value has been set. +func (o *CustomLink) GetLinkTextOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkText, true +} + +// SetLinkText sets field value +func (o *CustomLink) SetLinkText(v string) { + o.LinkText = v +} + +// GetLinkUrl returns the LinkUrl field value +func (o *CustomLink) GetLinkUrl() string { + if o == nil { + var ret string + return ret + } + + return o.LinkUrl +} + +// GetLinkUrlOk returns a tuple with the LinkUrl field value +// and a boolean to check if the value has been set. +func (o *CustomLink) GetLinkUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkUrl, true +} + +// SetLinkUrl sets field value +func (o *CustomLink) SetLinkUrl(v string) { + o.LinkUrl = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *CustomLink) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLink) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *CustomLink) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *CustomLink) SetWeight(v int32) { + o.Weight = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *CustomLink) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLink) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *CustomLink) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *CustomLink) SetGroupName(v string) { + o.GroupName = &v +} + +// GetButtonClass returns the ButtonClass field value if set, zero value otherwise. +func (o *CustomLink) GetButtonClass() CustomLinkButtonClass { + if o == nil || IsNil(o.ButtonClass) { + var ret CustomLinkButtonClass + return ret + } + return *o.ButtonClass +} + +// GetButtonClassOk returns a tuple with the ButtonClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLink) GetButtonClassOk() (*CustomLinkButtonClass, bool) { + if o == nil || IsNil(o.ButtonClass) { + return nil, false + } + return o.ButtonClass, true +} + +// HasButtonClass returns a boolean if a field has been set. +func (o *CustomLink) HasButtonClass() bool { + if o != nil && !IsNil(o.ButtonClass) { + return true + } + + return false +} + +// SetButtonClass gets a reference to the given CustomLinkButtonClass and assigns it to the ButtonClass field. +func (o *CustomLink) SetButtonClass(v CustomLinkButtonClass) { + o.ButtonClass = &v +} + +// GetNewWindow returns the NewWindow field value if set, zero value otherwise. +func (o *CustomLink) GetNewWindow() bool { + if o == nil || IsNil(o.NewWindow) { + var ret bool + return ret + } + return *o.NewWindow +} + +// GetNewWindowOk returns a tuple with the NewWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLink) GetNewWindowOk() (*bool, bool) { + if o == nil || IsNil(o.NewWindow) { + return nil, false + } + return o.NewWindow, true +} + +// HasNewWindow returns a boolean if a field has been set. +func (o *CustomLink) HasNewWindow() bool { + if o != nil && !IsNil(o.NewWindow) { + return true + } + + return false +} + +// SetNewWindow gets a reference to the given bool and assigns it to the NewWindow field. +func (o *CustomLink) SetNewWindow(v bool) { + o.NewWindow = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CustomLink) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomLink) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *CustomLink) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CustomLink) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomLink) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *CustomLink) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o CustomLink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomLink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["link_text"] = o.LinkText + toSerialize["link_url"] = o.LinkUrl + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.GroupName) { + toSerialize["group_name"] = o.GroupName + } + if !IsNil(o.ButtonClass) { + toSerialize["button_class"] = o.ButtonClass + } + if !IsNil(o.NewWindow) { + toSerialize["new_window"] = o.NewWindow + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomLink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "content_types", + "name", + "link_text", + "link_url", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomLink := _CustomLink{} + + err = json.Unmarshal(data, &varCustomLink) + + if err != nil { + return err + } + + *o = CustomLink(varCustomLink) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "link_text") + delete(additionalProperties, "link_url") + delete(additionalProperties, "weight") + delete(additionalProperties, "group_name") + delete(additionalProperties, "button_class") + delete(additionalProperties, "new_window") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomLink struct { + value *CustomLink + isSet bool +} + +func (v NullableCustomLink) Get() *CustomLink { + return v.value +} + +func (v *NullableCustomLink) Set(val *CustomLink) { + v.value = val + v.isSet = true +} + +func (v NullableCustomLink) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomLink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomLink(val *CustomLink) *NullableCustomLink { + return &NullableCustomLink{value: val, isSet: true} +} + +func (v NullableCustomLink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomLink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link_button_class.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link_button_class.go new file mode 100644 index 00000000..00dbbed3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link_button_class.go @@ -0,0 +1,136 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// CustomLinkButtonClass The class of the first link in a group will be used for the dropdown button * `outline-dark` - Default * `blue` - Blue * `indigo` - Indigo * `purple` - Purple * `pink` - Pink * `red` - Red * `orange` - Orange * `yellow` - Yellow * `green` - Green * `teal` - Teal * `cyan` - Cyan * `gray` - Gray * `black` - Black * `white` - White * `ghost-dark` - Link +type CustomLinkButtonClass string + +// List of CustomLink_button_class +const ( + CUSTOMLINKBUTTONCLASS_OUTLINE_DARK CustomLinkButtonClass = "outline-dark" + CUSTOMLINKBUTTONCLASS_BLUE CustomLinkButtonClass = "blue" + CUSTOMLINKBUTTONCLASS_INDIGO CustomLinkButtonClass = "indigo" + CUSTOMLINKBUTTONCLASS_PURPLE CustomLinkButtonClass = "purple" + CUSTOMLINKBUTTONCLASS_PINK CustomLinkButtonClass = "pink" + CUSTOMLINKBUTTONCLASS_RED CustomLinkButtonClass = "red" + CUSTOMLINKBUTTONCLASS_ORANGE CustomLinkButtonClass = "orange" + CUSTOMLINKBUTTONCLASS_YELLOW CustomLinkButtonClass = "yellow" + CUSTOMLINKBUTTONCLASS_GREEN CustomLinkButtonClass = "green" + CUSTOMLINKBUTTONCLASS_TEAL CustomLinkButtonClass = "teal" + CUSTOMLINKBUTTONCLASS_CYAN CustomLinkButtonClass = "cyan" + CUSTOMLINKBUTTONCLASS_GRAY CustomLinkButtonClass = "gray" + CUSTOMLINKBUTTONCLASS_BLACK CustomLinkButtonClass = "black" + CUSTOMLINKBUTTONCLASS_WHITE CustomLinkButtonClass = "white" + CUSTOMLINKBUTTONCLASS_GHOST_DARK CustomLinkButtonClass = "ghost-dark" +) + +// All allowed values of CustomLinkButtonClass enum +var AllowedCustomLinkButtonClassEnumValues = []CustomLinkButtonClass{ + "outline-dark", + "blue", + "indigo", + "purple", + "pink", + "red", + "orange", + "yellow", + "green", + "teal", + "cyan", + "gray", + "black", + "white", + "ghost-dark", +} + +func (v *CustomLinkButtonClass) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CustomLinkButtonClass(value) + for _, existing := range AllowedCustomLinkButtonClassEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CustomLinkButtonClass", value) +} + +// NewCustomLinkButtonClassFromValue returns a pointer to a valid CustomLinkButtonClass +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCustomLinkButtonClassFromValue(v string) (*CustomLinkButtonClass, error) { + ev := CustomLinkButtonClass(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CustomLinkButtonClass: valid values are %v", v, AllowedCustomLinkButtonClassEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CustomLinkButtonClass) IsValid() bool { + for _, existing := range AllowedCustomLinkButtonClassEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomLink_button_class value +func (v CustomLinkButtonClass) Ptr() *CustomLinkButtonClass { + return &v +} + +type NullableCustomLinkButtonClass struct { + value *CustomLinkButtonClass + isSet bool +} + +func (v NullableCustomLinkButtonClass) Get() *CustomLinkButtonClass { + return v.value +} + +func (v *NullableCustomLinkButtonClass) Set(val *CustomLinkButtonClass) { + v.value = val + v.isSet = true +} + +func (v NullableCustomLinkButtonClass) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomLinkButtonClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomLinkButtonClass(val *CustomLinkButtonClass) *NullableCustomLinkButtonClass { + return &NullableCustomLinkButtonClass{value: val, isSet: true} +} + +func (v NullableCustomLinkButtonClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomLinkButtonClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link_request.go new file mode 100644 index 00000000..94e0d4cf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_custom_link_request.go @@ -0,0 +1,442 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the CustomLinkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomLinkRequest{} + +// CustomLinkRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type CustomLinkRequest struct { + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + // Jinja2 template code for link text + LinkText string `json:"link_text"` + // Jinja2 template code for link URL + LinkUrl string `json:"link_url"` + Weight *int32 `json:"weight,omitempty"` + // Links with the same group will appear as a dropdown menu + GroupName *string `json:"group_name,omitempty"` + ButtonClass *CustomLinkButtonClass `json:"button_class,omitempty"` + // Force link to open in a new window + NewWindow *bool `json:"new_window,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CustomLinkRequest CustomLinkRequest + +// NewCustomLinkRequest instantiates a new CustomLinkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomLinkRequest(contentTypes []string, name string, linkText string, linkUrl string) *CustomLinkRequest { + this := CustomLinkRequest{} + this.ContentTypes = contentTypes + this.Name = name + this.LinkText = linkText + this.LinkUrl = linkUrl + return &this +} + +// NewCustomLinkRequestWithDefaults instantiates a new CustomLinkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomLinkRequestWithDefaults() *CustomLinkRequest { + this := CustomLinkRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *CustomLinkRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *CustomLinkRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *CustomLinkRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomLinkRequest) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *CustomLinkRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *CustomLinkRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *CustomLinkRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetLinkText returns the LinkText field value +func (o *CustomLinkRequest) GetLinkText() string { + if o == nil { + var ret string + return ret + } + + return o.LinkText +} + +// GetLinkTextOk returns a tuple with the LinkText field value +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetLinkTextOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkText, true +} + +// SetLinkText sets field value +func (o *CustomLinkRequest) SetLinkText(v string) { + o.LinkText = v +} + +// GetLinkUrl returns the LinkUrl field value +func (o *CustomLinkRequest) GetLinkUrl() string { + if o == nil { + var ret string + return ret + } + + return o.LinkUrl +} + +// GetLinkUrlOk returns a tuple with the LinkUrl field value +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetLinkUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkUrl, true +} + +// SetLinkUrl sets field value +func (o *CustomLinkRequest) SetLinkUrl(v string) { + o.LinkUrl = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *CustomLinkRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *CustomLinkRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *CustomLinkRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *CustomLinkRequest) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *CustomLinkRequest) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *CustomLinkRequest) SetGroupName(v string) { + o.GroupName = &v +} + +// GetButtonClass returns the ButtonClass field value if set, zero value otherwise. +func (o *CustomLinkRequest) GetButtonClass() CustomLinkButtonClass { + if o == nil || IsNil(o.ButtonClass) { + var ret CustomLinkButtonClass + return ret + } + return *o.ButtonClass +} + +// GetButtonClassOk returns a tuple with the ButtonClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetButtonClassOk() (*CustomLinkButtonClass, bool) { + if o == nil || IsNil(o.ButtonClass) { + return nil, false + } + return o.ButtonClass, true +} + +// HasButtonClass returns a boolean if a field has been set. +func (o *CustomLinkRequest) HasButtonClass() bool { + if o != nil && !IsNil(o.ButtonClass) { + return true + } + + return false +} + +// SetButtonClass gets a reference to the given CustomLinkButtonClass and assigns it to the ButtonClass field. +func (o *CustomLinkRequest) SetButtonClass(v CustomLinkButtonClass) { + o.ButtonClass = &v +} + +// GetNewWindow returns the NewWindow field value if set, zero value otherwise. +func (o *CustomLinkRequest) GetNewWindow() bool { + if o == nil || IsNil(o.NewWindow) { + var ret bool + return ret + } + return *o.NewWindow +} + +// GetNewWindowOk returns a tuple with the NewWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomLinkRequest) GetNewWindowOk() (*bool, bool) { + if o == nil || IsNil(o.NewWindow) { + return nil, false + } + return o.NewWindow, true +} + +// HasNewWindow returns a boolean if a field has been set. +func (o *CustomLinkRequest) HasNewWindow() bool { + if o != nil && !IsNil(o.NewWindow) { + return true + } + + return false +} + +// SetNewWindow gets a reference to the given bool and assigns it to the NewWindow field. +func (o *CustomLinkRequest) SetNewWindow(v bool) { + o.NewWindow = &v +} + +func (o CustomLinkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomLinkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["link_text"] = o.LinkText + toSerialize["link_url"] = o.LinkUrl + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.GroupName) { + toSerialize["group_name"] = o.GroupName + } + if !IsNil(o.ButtonClass) { + toSerialize["button_class"] = o.ButtonClass + } + if !IsNil(o.NewWindow) { + toSerialize["new_window"] = o.NewWindow + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CustomLinkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "name", + "link_text", + "link_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomLinkRequest := _CustomLinkRequest{} + + err = json.Unmarshal(data, &varCustomLinkRequest) + + if err != nil { + return err + } + + *o = CustomLinkRequest(varCustomLinkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "link_text") + delete(additionalProperties, "link_url") + delete(additionalProperties, "weight") + delete(additionalProperties, "group_name") + delete(additionalProperties, "button_class") + delete(additionalProperties, "new_window") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCustomLinkRequest struct { + value *CustomLinkRequest + isSet bool +} + +func (v NullableCustomLinkRequest) Get() *CustomLinkRequest { + return v.value +} + +func (v *NullableCustomLinkRequest) Set(val *CustomLinkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCustomLinkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomLinkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomLinkRequest(val *CustomLinkRequest) *NullableCustomLinkRequest { + return &NullableCustomLinkRequest{value: val, isSet: true} +} + +func (v NullableCustomLinkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomLinkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_dashboard.go b/vendor/github.com/netbox-community/go-netbox/v3/model_dashboard.go new file mode 100644 index 00000000..be0b5abc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_dashboard.go @@ -0,0 +1,192 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the Dashboard type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Dashboard{} + +// Dashboard struct for Dashboard +type Dashboard struct { + Layout interface{} `json:"layout,omitempty"` + Config interface{} `json:"config,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Dashboard Dashboard + +// NewDashboard instantiates a new Dashboard object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDashboard() *Dashboard { + this := Dashboard{} + return &this +} + +// NewDashboardWithDefaults instantiates a new Dashboard object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDashboardWithDefaults() *Dashboard { + this := Dashboard{} + return &this +} + +// GetLayout returns the Layout field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dashboard) GetLayout() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dashboard) GetLayoutOk() (*interface{}, bool) { + if o == nil || IsNil(o.Layout) { + return nil, false + } + return &o.Layout, true +} + +// HasLayout returns a boolean if a field has been set. +func (o *Dashboard) HasLayout() bool { + if o != nil && IsNil(o.Layout) { + return true + } + + return false +} + +// SetLayout gets a reference to the given interface{} and assigns it to the Layout field. +func (o *Dashboard) SetLayout(v interface{}) { + o.Layout = v +} + +// GetConfig returns the Config field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dashboard) GetConfig() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dashboard) GetConfigOk() (*interface{}, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return &o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *Dashboard) HasConfig() bool { + if o != nil && IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given interface{} and assigns it to the Config field. +func (o *Dashboard) SetConfig(v interface{}) { + o.Config = v +} + +func (o Dashboard) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Dashboard) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Layout != nil { + toSerialize["layout"] = o.Layout + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Dashboard) UnmarshalJSON(data []byte) (err error) { + varDashboard := _Dashboard{} + + err = json.Unmarshal(data, &varDashboard) + + if err != nil { + return err + } + + *o = Dashboard(varDashboard) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "layout") + delete(additionalProperties, "config") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDashboard struct { + value *Dashboard + isSet bool +} + +func (v NullableDashboard) Get() *Dashboard { + return v.value +} + +func (v *NullableDashboard) Set(val *Dashboard) { + v.value = val + v.isSet = true +} + +func (v NullableDashboard) IsSet() bool { + return v.isSet +} + +func (v *NullableDashboard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDashboard(val *Dashboard) *NullableDashboard { + return &NullableDashboard{value: val, isSet: true} +} + +func (v NullableDashboard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDashboard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_dashboard_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_dashboard_request.go new file mode 100644 index 00000000..ec79fd32 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_dashboard_request.go @@ -0,0 +1,192 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DashboardRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DashboardRequest{} + +// DashboardRequest struct for DashboardRequest +type DashboardRequest struct { + Layout interface{} `json:"layout,omitempty"` + Config interface{} `json:"config,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DashboardRequest DashboardRequest + +// NewDashboardRequest instantiates a new DashboardRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDashboardRequest() *DashboardRequest { + this := DashboardRequest{} + return &this +} + +// NewDashboardRequestWithDefaults instantiates a new DashboardRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDashboardRequestWithDefaults() *DashboardRequest { + this := DashboardRequest{} + return &this +} + +// GetLayout returns the Layout field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardRequest) GetLayout() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DashboardRequest) GetLayoutOk() (*interface{}, bool) { + if o == nil || IsNil(o.Layout) { + return nil, false + } + return &o.Layout, true +} + +// HasLayout returns a boolean if a field has been set. +func (o *DashboardRequest) HasLayout() bool { + if o != nil && IsNil(o.Layout) { + return true + } + + return false +} + +// SetLayout gets a reference to the given interface{} and assigns it to the Layout field. +func (o *DashboardRequest) SetLayout(v interface{}) { + o.Layout = v +} + +// GetConfig returns the Config field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DashboardRequest) GetConfig() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DashboardRequest) GetConfigOk() (*interface{}, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return &o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *DashboardRequest) HasConfig() bool { + if o != nil && IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given interface{} and assigns it to the Config field. +func (o *DashboardRequest) SetConfig(v interface{}) { + o.Config = v +} + +func (o DashboardRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DashboardRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Layout != nil { + toSerialize["layout"] = o.Layout + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DashboardRequest) UnmarshalJSON(data []byte) (err error) { + varDashboardRequest := _DashboardRequest{} + + err = json.Unmarshal(data, &varDashboardRequest) + + if err != nil { + return err + } + + *o = DashboardRequest(varDashboardRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "layout") + delete(additionalProperties, "config") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDashboardRequest struct { + value *DashboardRequest + isSet bool +} + +func (v NullableDashboardRequest) Get() *DashboardRequest { + return v.value +} + +func (v *NullableDashboardRequest) Set(val *DashboardRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDashboardRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDashboardRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDashboardRequest(val *DashboardRequest) *NullableDashboardRequest { + return &NullableDashboardRequest{value: val, isSet: true} +} + +func (v NullableDashboardRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDashboardRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_file.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_file.go new file mode 100644 index 00000000..a831b09d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_file.go @@ -0,0 +1,372 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DataFile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataFile{} + +// DataFile Adds support for custom fields and tags. +type DataFile struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Source NestedDataSource `json:"source"` + // File path relative to the data source's root + Path string `json:"path"` + LastUpdated time.Time `json:"last_updated"` + Size int32 `json:"size"` + // SHA256 hash of the file data + Hash string `json:"hash"` + AdditionalProperties map[string]interface{} +} + +type _DataFile DataFile + +// NewDataFile instantiates a new DataFile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataFile(id int32, url string, display string, source NestedDataSource, path string, lastUpdated time.Time, size int32, hash string) *DataFile { + this := DataFile{} + this.Id = id + this.Url = url + this.Display = display + this.Source = source + this.Path = path + this.LastUpdated = lastUpdated + this.Size = size + this.Hash = hash + return &this +} + +// NewDataFileWithDefaults instantiates a new DataFile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataFileWithDefaults() *DataFile { + this := DataFile{} + return &this +} + +// GetId returns the Id field value +func (o *DataFile) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DataFile) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DataFile) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DataFile) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DataFile) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DataFile) SetDisplay(v string) { + o.Display = v +} + +// GetSource returns the Source field value +func (o *DataFile) GetSource() NestedDataSource { + if o == nil { + var ret NestedDataSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetSourceOk() (*NestedDataSource, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *DataFile) SetSource(v NestedDataSource) { + o.Source = v +} + +// GetPath returns the Path field value +func (o *DataFile) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *DataFile) SetPath(v string) { + o.Path = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *DataFile) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *DataFile) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +// GetSize returns the Size field value +func (o *DataFile) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *DataFile) SetSize(v int32) { + o.Size = v +} + +// GetHash returns the Hash field value +func (o *DataFile) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *DataFile) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *DataFile) SetHash(v string) { + o.Hash = v +} + +func (o DataFile) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataFile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["source"] = o.Source + toSerialize["path"] = o.Path + toSerialize["last_updated"] = o.LastUpdated + toSerialize["size"] = o.Size + toSerialize["hash"] = o.Hash + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DataFile) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "source", + "path", + "last_updated", + "size", + "hash", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDataFile := _DataFile{} + + err = json.Unmarshal(data, &varDataFile) + + if err != nil { + return err + } + + *o = DataFile(varDataFile) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "source") + delete(additionalProperties, "path") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "size") + delete(additionalProperties, "hash") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDataFile struct { + value *DataFile + isSet bool +} + +func (v NullableDataFile) Get() *DataFile { + return v.value +} + +func (v *NullableDataFile) Set(val *DataFile) { + v.value = val + v.isSet = true +} + +func (v NullableDataFile) IsSet() bool { + return v.isSet +} + +func (v *NullableDataFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataFile(val *DataFile) *NullableDataFile { + return &NullableDataFile{value: val, isSet: true} +} + +func (v NullableDataFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source.go new file mode 100644 index 00000000..8093ab8b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source.go @@ -0,0 +1,619 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DataSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataSource{} + +// DataSource Adds support for custom fields and tags. +type DataSource struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Type DataSourceType `json:"type"` + SourceUrl string `json:"source_url"` + Enabled *bool `json:"enabled,omitempty"` + Status DataSourceStatus `json:"status"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` + // Patterns (one per line) matching files to ignore when syncing + IgnoreRules *string `json:"ignore_rules,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + FileCount int32 `json:"file_count"` + AdditionalProperties map[string]interface{} +} + +type _DataSource DataSource + +// NewDataSource instantiates a new DataSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataSource(id int32, url string, display string, name string, type_ DataSourceType, sourceUrl string, status DataSourceStatus, created NullableTime, lastUpdated NullableTime, fileCount int32) *DataSource { + this := DataSource{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Type = type_ + this.SourceUrl = sourceUrl + this.Status = status + this.Created = created + this.LastUpdated = lastUpdated + this.FileCount = fileCount + return &this +} + +// NewDataSourceWithDefaults instantiates a new DataSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataSourceWithDefaults() *DataSource { + this := DataSource{} + return &this +} + +// GetId returns the Id field value +func (o *DataSource) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DataSource) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DataSource) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DataSource) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DataSource) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DataSource) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *DataSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DataSource) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *DataSource) GetType() DataSourceType { + if o == nil { + var ret DataSourceType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetTypeOk() (*DataSourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DataSource) SetType(v DataSourceType) { + o.Type = v +} + +// GetSourceUrl returns the SourceUrl field value +func (o *DataSource) GetSourceUrl() string { + if o == nil { + var ret string + return ret + } + + return o.SourceUrl +} + +// GetSourceUrlOk returns a tuple with the SourceUrl field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetSourceUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceUrl, true +} + +// SetSourceUrl sets field value +func (o *DataSource) SetSourceUrl(v string) { + o.SourceUrl = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *DataSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *DataSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *DataSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetStatus returns the Status field value +func (o *DataSource) GetStatus() DataSourceStatus { + if o == nil { + var ret DataSourceStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetStatusOk() (*DataSourceStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *DataSource) SetStatus(v DataSourceStatus) { + o.Status = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DataSource) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSource) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DataSource) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DataSource) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *DataSource) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSource) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *DataSource) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *DataSource) SetComments(v string) { + o.Comments = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DataSource) GetParameters() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DataSource) GetParametersOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *DataSource) HasParameters() bool { + if o != nil && IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given interface{} and assigns it to the Parameters field. +func (o *DataSource) SetParameters(v interface{}) { + o.Parameters = v +} + +// GetIgnoreRules returns the IgnoreRules field value if set, zero value otherwise. +func (o *DataSource) GetIgnoreRules() string { + if o == nil || IsNil(o.IgnoreRules) { + var ret string + return ret + } + return *o.IgnoreRules +} + +// GetIgnoreRulesOk returns a tuple with the IgnoreRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSource) GetIgnoreRulesOk() (*string, bool) { + if o == nil || IsNil(o.IgnoreRules) { + return nil, false + } + return o.IgnoreRules, true +} + +// HasIgnoreRules returns a boolean if a field has been set. +func (o *DataSource) HasIgnoreRules() bool { + if o != nil && !IsNil(o.IgnoreRules) { + return true + } + + return false +} + +// SetIgnoreRules gets a reference to the given string and assigns it to the IgnoreRules field. +func (o *DataSource) SetIgnoreRules(v string) { + o.IgnoreRules = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DataSource) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DataSource) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *DataSource) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DataSource) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DataSource) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *DataSource) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetFileCount returns the FileCount field value +func (o *DataSource) GetFileCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.FileCount +} + +// GetFileCountOk returns a tuple with the FileCount field value +// and a boolean to check if the value has been set. +func (o *DataSource) GetFileCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.FileCount, true +} + +// SetFileCount sets field value +func (o *DataSource) SetFileCount(v int32) { + o.FileCount = v +} + +func (o DataSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + toSerialize["source_url"] = o.SourceUrl + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["status"] = o.Status + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.IgnoreRules) { + toSerialize["ignore_rules"] = o.IgnoreRules + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["file_count"] = o.FileCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DataSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "type", + "source_url", + "status", + "created", + "last_updated", + "file_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDataSource := _DataSource{} + + err = json.Unmarshal(data, &varDataSource) + + if err != nil { + return err + } + + *o = DataSource(varDataSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "source_url") + delete(additionalProperties, "enabled") + delete(additionalProperties, "status") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "parameters") + delete(additionalProperties, "ignore_rules") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "file_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDataSource struct { + value *DataSource + isSet bool +} + +func (v NullableDataSource) Get() *DataSource { + return v.value +} + +func (v *NullableDataSource) Set(val *DataSource) { + v.value = val + v.isSet = true +} + +func (v NullableDataSource) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSource(val *DataSource) *NullableDataSource { + return &NullableDataSource{value: val, isSet: true} +} + +func (v NullableDataSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_request.go new file mode 100644 index 00000000..e27d7324 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_request.go @@ -0,0 +1,411 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the DataSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataSourceRequest{} + +// DataSourceRequest Adds support for custom fields and tags. +type DataSourceRequest struct { + Name string `json:"name"` + Type DataSourceTypeValue `json:"type"` + SourceUrl string `json:"source_url"` + Enabled *bool `json:"enabled,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` + // Patterns (one per line) matching files to ignore when syncing + IgnoreRules *string `json:"ignore_rules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DataSourceRequest DataSourceRequest + +// NewDataSourceRequest instantiates a new DataSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataSourceRequest(name string, type_ DataSourceTypeValue, sourceUrl string) *DataSourceRequest { + this := DataSourceRequest{} + this.Name = name + this.Type = type_ + this.SourceUrl = sourceUrl + return &this +} + +// NewDataSourceRequestWithDefaults instantiates a new DataSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataSourceRequestWithDefaults() *DataSourceRequest { + this := DataSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DataSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DataSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DataSourceRequest) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *DataSourceRequest) GetType() DataSourceTypeValue { + if o == nil { + var ret DataSourceTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DataSourceRequest) GetTypeOk() (*DataSourceTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DataSourceRequest) SetType(v DataSourceTypeValue) { + o.Type = v +} + +// GetSourceUrl returns the SourceUrl field value +func (o *DataSourceRequest) GetSourceUrl() string { + if o == nil { + var ret string + return ret + } + + return o.SourceUrl +} + +// GetSourceUrlOk returns a tuple with the SourceUrl field value +// and a boolean to check if the value has been set. +func (o *DataSourceRequest) GetSourceUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceUrl, true +} + +// SetSourceUrl sets field value +func (o *DataSourceRequest) SetSourceUrl(v string) { + o.SourceUrl = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *DataSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *DataSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *DataSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DataSourceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DataSourceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DataSourceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *DataSourceRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *DataSourceRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *DataSourceRequest) SetComments(v string) { + o.Comments = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DataSourceRequest) GetParameters() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DataSourceRequest) GetParametersOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *DataSourceRequest) HasParameters() bool { + if o != nil && IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given interface{} and assigns it to the Parameters field. +func (o *DataSourceRequest) SetParameters(v interface{}) { + o.Parameters = v +} + +// GetIgnoreRules returns the IgnoreRules field value if set, zero value otherwise. +func (o *DataSourceRequest) GetIgnoreRules() string { + if o == nil || IsNil(o.IgnoreRules) { + var ret string + return ret + } + return *o.IgnoreRules +} + +// GetIgnoreRulesOk returns a tuple with the IgnoreRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceRequest) GetIgnoreRulesOk() (*string, bool) { + if o == nil || IsNil(o.IgnoreRules) { + return nil, false + } + return o.IgnoreRules, true +} + +// HasIgnoreRules returns a boolean if a field has been set. +func (o *DataSourceRequest) HasIgnoreRules() bool { + if o != nil && !IsNil(o.IgnoreRules) { + return true + } + + return false +} + +// SetIgnoreRules gets a reference to the given string and assigns it to the IgnoreRules field. +func (o *DataSourceRequest) SetIgnoreRules(v string) { + o.IgnoreRules = &v +} + +func (o DataSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + toSerialize["source_url"] = o.SourceUrl + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.IgnoreRules) { + toSerialize["ignore_rules"] = o.IgnoreRules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DataSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + "source_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDataSourceRequest := _DataSourceRequest{} + + err = json.Unmarshal(data, &varDataSourceRequest) + + if err != nil { + return err + } + + *o = DataSourceRequest(varDataSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "source_url") + delete(additionalProperties, "enabled") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "parameters") + delete(additionalProperties, "ignore_rules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDataSourceRequest struct { + value *DataSourceRequest + isSet bool +} + +func (v NullableDataSourceRequest) Get() *DataSourceRequest { + return v.value +} + +func (v *NullableDataSourceRequest) Set(val *DataSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDataSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSourceRequest(val *DataSourceRequest) *NullableDataSourceRequest { + return &NullableDataSourceRequest{value: val, isSet: true} +} + +func (v NullableDataSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status.go new file mode 100644 index 00000000..cab233eb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DataSourceStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataSourceStatus{} + +// DataSourceStatus struct for DataSourceStatus +type DataSourceStatus struct { + Value *DataSourceStatusValue `json:"value,omitempty"` + Label *DataSourceStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DataSourceStatus DataSourceStatus + +// NewDataSourceStatus instantiates a new DataSourceStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataSourceStatus() *DataSourceStatus { + this := DataSourceStatus{} + return &this +} + +// NewDataSourceStatusWithDefaults instantiates a new DataSourceStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataSourceStatusWithDefaults() *DataSourceStatus { + this := DataSourceStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DataSourceStatus) GetValue() DataSourceStatusValue { + if o == nil || IsNil(o.Value) { + var ret DataSourceStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceStatus) GetValueOk() (*DataSourceStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DataSourceStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DataSourceStatusValue and assigns it to the Value field. +func (o *DataSourceStatus) SetValue(v DataSourceStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DataSourceStatus) GetLabel() DataSourceStatusLabel { + if o == nil || IsNil(o.Label) { + var ret DataSourceStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceStatus) GetLabelOk() (*DataSourceStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DataSourceStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DataSourceStatusLabel and assigns it to the Label field. +func (o *DataSourceStatus) SetLabel(v DataSourceStatusLabel) { + o.Label = &v +} + +func (o DataSourceStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataSourceStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DataSourceStatus) UnmarshalJSON(data []byte) (err error) { + varDataSourceStatus := _DataSourceStatus{} + + err = json.Unmarshal(data, &varDataSourceStatus) + + if err != nil { + return err + } + + *o = DataSourceStatus(varDataSourceStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDataSourceStatus struct { + value *DataSourceStatus + isSet bool +} + +func (v NullableDataSourceStatus) Get() *DataSourceStatus { + return v.value +} + +func (v *NullableDataSourceStatus) Set(val *DataSourceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDataSourceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSourceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSourceStatus(val *DataSourceStatus) *NullableDataSourceStatus { + return &NullableDataSourceStatus{value: val, isSet: true} +} + +func (v NullableDataSourceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSourceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status_label.go new file mode 100644 index 00000000..8b1bdf3e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status_label.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DataSourceStatusLabel the model 'DataSourceStatusLabel' +type DataSourceStatusLabel string + +// List of DataSource_status_label +const ( + DATASOURCESTATUSLABEL_NEW DataSourceStatusLabel = "New" + DATASOURCESTATUSLABEL_QUEUED DataSourceStatusLabel = "Queued" + DATASOURCESTATUSLABEL_SYNCING DataSourceStatusLabel = "Syncing" + DATASOURCESTATUSLABEL_COMPLETED DataSourceStatusLabel = "Completed" + DATASOURCESTATUSLABEL_FAILED DataSourceStatusLabel = "Failed" +) + +// All allowed values of DataSourceStatusLabel enum +var AllowedDataSourceStatusLabelEnumValues = []DataSourceStatusLabel{ + "New", + "Queued", + "Syncing", + "Completed", + "Failed", +} + +func (v *DataSourceStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DataSourceStatusLabel(value) + for _, existing := range AllowedDataSourceStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DataSourceStatusLabel", value) +} + +// NewDataSourceStatusLabelFromValue returns a pointer to a valid DataSourceStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDataSourceStatusLabelFromValue(v string) (*DataSourceStatusLabel, error) { + ev := DataSourceStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DataSourceStatusLabel: valid values are %v", v, AllowedDataSourceStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DataSourceStatusLabel) IsValid() bool { + for _, existing := range AllowedDataSourceStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DataSource_status_label value +func (v DataSourceStatusLabel) Ptr() *DataSourceStatusLabel { + return &v +} + +type NullableDataSourceStatusLabel struct { + value *DataSourceStatusLabel + isSet bool +} + +func (v NullableDataSourceStatusLabel) Get() *DataSourceStatusLabel { + return v.value +} + +func (v *NullableDataSourceStatusLabel) Set(val *DataSourceStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableDataSourceStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSourceStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSourceStatusLabel(val *DataSourceStatusLabel) *NullableDataSourceStatusLabel { + return &NullableDataSourceStatusLabel{value: val, isSet: true} +} + +func (v NullableDataSourceStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSourceStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status_value.go new file mode 100644 index 00000000..562163bb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_status_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DataSourceStatusValue * `new` - New * `queued` - Queued * `syncing` - Syncing * `completed` - Completed * `failed` - Failed +type DataSourceStatusValue string + +// List of DataSource_status_value +const ( + DATASOURCESTATUSVALUE_NEW DataSourceStatusValue = "new" + DATASOURCESTATUSVALUE_QUEUED DataSourceStatusValue = "queued" + DATASOURCESTATUSVALUE_SYNCING DataSourceStatusValue = "syncing" + DATASOURCESTATUSVALUE_COMPLETED DataSourceStatusValue = "completed" + DATASOURCESTATUSVALUE_FAILED DataSourceStatusValue = "failed" +) + +// All allowed values of DataSourceStatusValue enum +var AllowedDataSourceStatusValueEnumValues = []DataSourceStatusValue{ + "new", + "queued", + "syncing", + "completed", + "failed", +} + +func (v *DataSourceStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DataSourceStatusValue(value) + for _, existing := range AllowedDataSourceStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DataSourceStatusValue", value) +} + +// NewDataSourceStatusValueFromValue returns a pointer to a valid DataSourceStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDataSourceStatusValueFromValue(v string) (*DataSourceStatusValue, error) { + ev := DataSourceStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DataSourceStatusValue: valid values are %v", v, AllowedDataSourceStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DataSourceStatusValue) IsValid() bool { + for _, existing := range AllowedDataSourceStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DataSource_status_value value +func (v DataSourceStatusValue) Ptr() *DataSourceStatusValue { + return &v +} + +type NullableDataSourceStatusValue struct { + value *DataSourceStatusValue + isSet bool +} + +func (v NullableDataSourceStatusValue) Get() *DataSourceStatusValue { + return v.value +} + +func (v *NullableDataSourceStatusValue) Set(val *DataSourceStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableDataSourceStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSourceStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSourceStatusValue(val *DataSourceStatusValue) *NullableDataSourceStatusValue { + return &NullableDataSourceStatusValue{value: val, isSet: true} +} + +func (v NullableDataSourceStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSourceStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type.go new file mode 100644 index 00000000..f050841c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DataSourceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataSourceType{} + +// DataSourceType struct for DataSourceType +type DataSourceType struct { + Value *DataSourceTypeValue `json:"value,omitempty"` + Label *DataSourceTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DataSourceType DataSourceType + +// NewDataSourceType instantiates a new DataSourceType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataSourceType() *DataSourceType { + this := DataSourceType{} + return &this +} + +// NewDataSourceTypeWithDefaults instantiates a new DataSourceType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataSourceTypeWithDefaults() *DataSourceType { + this := DataSourceType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DataSourceType) GetValue() DataSourceTypeValue { + if o == nil || IsNil(o.Value) { + var ret DataSourceTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceType) GetValueOk() (*DataSourceTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DataSourceType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DataSourceTypeValue and assigns it to the Value field. +func (o *DataSourceType) SetValue(v DataSourceTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DataSourceType) GetLabel() DataSourceTypeLabel { + if o == nil || IsNil(o.Label) { + var ret DataSourceTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataSourceType) GetLabelOk() (*DataSourceTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DataSourceType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DataSourceTypeLabel and assigns it to the Label field. +func (o *DataSourceType) SetLabel(v DataSourceTypeLabel) { + o.Label = &v +} + +func (o DataSourceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataSourceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DataSourceType) UnmarshalJSON(data []byte) (err error) { + varDataSourceType := _DataSourceType{} + + err = json.Unmarshal(data, &varDataSourceType) + + if err != nil { + return err + } + + *o = DataSourceType(varDataSourceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDataSourceType struct { + value *DataSourceType + isSet bool +} + +func (v NullableDataSourceType) Get() *DataSourceType { + return v.value +} + +func (v *NullableDataSourceType) Set(val *DataSourceType) { + v.value = val + v.isSet = true +} + +func (v NullableDataSourceType) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSourceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSourceType(val *DataSourceType) *NullableDataSourceType { + return &NullableDataSourceType{value: val, isSet: true} +} + +func (v NullableDataSourceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSourceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type_label.go new file mode 100644 index 00000000..f09a52fc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DataSourceTypeLabel the model 'DataSourceTypeLabel' +type DataSourceTypeLabel string + +// List of DataSource_type_label +const ( + DATASOURCETYPELABEL________ DataSourceTypeLabel = "---------" + DATASOURCETYPELABEL_LOCAL DataSourceTypeLabel = "Local" + DATASOURCETYPELABEL_GIT DataSourceTypeLabel = "Git" + DATASOURCETYPELABEL_AMAZON_S3 DataSourceTypeLabel = "Amazon S3" +) + +// All allowed values of DataSourceTypeLabel enum +var AllowedDataSourceTypeLabelEnumValues = []DataSourceTypeLabel{ + "---------", + "Local", + "Git", + "Amazon S3", +} + +func (v *DataSourceTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DataSourceTypeLabel(value) + for _, existing := range AllowedDataSourceTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DataSourceTypeLabel", value) +} + +// NewDataSourceTypeLabelFromValue returns a pointer to a valid DataSourceTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDataSourceTypeLabelFromValue(v string) (*DataSourceTypeLabel, error) { + ev := DataSourceTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DataSourceTypeLabel: valid values are %v", v, AllowedDataSourceTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DataSourceTypeLabel) IsValid() bool { + for _, existing := range AllowedDataSourceTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DataSource_type_label value +func (v DataSourceTypeLabel) Ptr() *DataSourceTypeLabel { + return &v +} + +type NullableDataSourceTypeLabel struct { + value *DataSourceTypeLabel + isSet bool +} + +func (v NullableDataSourceTypeLabel) Get() *DataSourceTypeLabel { + return v.value +} + +func (v *NullableDataSourceTypeLabel) Set(val *DataSourceTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableDataSourceTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSourceTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSourceTypeLabel(val *DataSourceTypeLabel) *NullableDataSourceTypeLabel { + return &NullableDataSourceTypeLabel{value: val, isSet: true} +} + +func (v NullableDataSourceTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSourceTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type_value.go new file mode 100644 index 00000000..48e2f4ac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_data_source_type_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DataSourceTypeValue * `None` - --------- * `local` - Local * `git` - Git * `amazon-s3` - Amazon S3 +type DataSourceTypeValue string + +// List of DataSource_type_value +const ( + DATASOURCETYPEVALUE_LOCAL DataSourceTypeValue = "local" + DATASOURCETYPEVALUE_GIT DataSourceTypeValue = "git" + DATASOURCETYPEVALUE_AMAZON_S3 DataSourceTypeValue = "amazon-s3" +) + +// All allowed values of DataSourceTypeValue enum +var AllowedDataSourceTypeValueEnumValues = []DataSourceTypeValue{ + "local", + "git", + "amazon-s3", +} + +func (v *DataSourceTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DataSourceTypeValue(value) + for _, existing := range AllowedDataSourceTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DataSourceTypeValue", value) +} + +// NewDataSourceTypeValueFromValue returns a pointer to a valid DataSourceTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDataSourceTypeValueFromValue(v string) (*DataSourceTypeValue, error) { + ev := DataSourceTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DataSourceTypeValue: valid values are %v", v, AllowedDataSourceTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DataSourceTypeValue) IsValid() bool { + for _, existing := range AllowedDataSourceTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DataSource_type_value value +func (v DataSourceTypeValue) Ptr() *DataSourceTypeValue { + return &v +} + +type NullableDataSourceTypeValue struct { + value *DataSourceTypeValue + isSet bool +} + +func (v NullableDataSourceTypeValue) Get() *DataSourceTypeValue { + return v.value +} + +func (v *NullableDataSourceTypeValue) Set(val *DataSourceTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableDataSourceTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableDataSourceTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataSourceTypeValue(val *DataSourceTypeValue) *NullableDataSourceTypeValue { + return &NullableDataSourceTypeValue{value: val, isSet: true} +} + +func (v NullableDataSourceTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataSourceTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_dcim_devices_render_config_create_format_parameter.go b/vendor/github.com/netbox-community/go-netbox/v3/model_dcim_devices_render_config_create_format_parameter.go new file mode 100644 index 00000000..6e3e8520 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_dcim_devices_render_config_create_format_parameter.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DcimDevicesRenderConfigCreateFormatParameter the model 'DcimDevicesRenderConfigCreateFormatParameter' +type DcimDevicesRenderConfigCreateFormatParameter string + +// List of dcim_devices_render_config_create_format_parameter +const ( + DCIMDEVICESRENDERCONFIGCREATEFORMATPARAMETER_JSON DcimDevicesRenderConfigCreateFormatParameter = "json" + DCIMDEVICESRENDERCONFIGCREATEFORMATPARAMETER_TXT DcimDevicesRenderConfigCreateFormatParameter = "txt" +) + +// All allowed values of DcimDevicesRenderConfigCreateFormatParameter enum +var AllowedDcimDevicesRenderConfigCreateFormatParameterEnumValues = []DcimDevicesRenderConfigCreateFormatParameter{ + "json", + "txt", +} + +func (v *DcimDevicesRenderConfigCreateFormatParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DcimDevicesRenderConfigCreateFormatParameter(value) + for _, existing := range AllowedDcimDevicesRenderConfigCreateFormatParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DcimDevicesRenderConfigCreateFormatParameter", value) +} + +// NewDcimDevicesRenderConfigCreateFormatParameterFromValue returns a pointer to a valid DcimDevicesRenderConfigCreateFormatParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDcimDevicesRenderConfigCreateFormatParameterFromValue(v string) (*DcimDevicesRenderConfigCreateFormatParameter, error) { + ev := DcimDevicesRenderConfigCreateFormatParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DcimDevicesRenderConfigCreateFormatParameter: valid values are %v", v, AllowedDcimDevicesRenderConfigCreateFormatParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DcimDevicesRenderConfigCreateFormatParameter) IsValid() bool { + for _, existing := range AllowedDcimDevicesRenderConfigCreateFormatParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to dcim_devices_render_config_create_format_parameter value +func (v DcimDevicesRenderConfigCreateFormatParameter) Ptr() *DcimDevicesRenderConfigCreateFormatParameter { + return &v +} + +type NullableDcimDevicesRenderConfigCreateFormatParameter struct { + value *DcimDevicesRenderConfigCreateFormatParameter + isSet bool +} + +func (v NullableDcimDevicesRenderConfigCreateFormatParameter) Get() *DcimDevicesRenderConfigCreateFormatParameter { + return v.value +} + +func (v *NullableDcimDevicesRenderConfigCreateFormatParameter) Set(val *DcimDevicesRenderConfigCreateFormatParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDcimDevicesRenderConfigCreateFormatParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDcimDevicesRenderConfigCreateFormatParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDcimDevicesRenderConfigCreateFormatParameter(val *DcimDevicesRenderConfigCreateFormatParameter) *NullableDcimDevicesRenderConfigCreateFormatParameter { + return &NullableDcimDevicesRenderConfigCreateFormatParameter{value: val, isSet: true} +} + +func (v NullableDcimDevicesRenderConfigCreateFormatParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDcimDevicesRenderConfigCreateFormatParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device.go new file mode 100644 index 00000000..f0185c5c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device.go @@ -0,0 +1,1911 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Device type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Device{} + +// Device Adds support for custom fields and tags. +type Device struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name NullableString `json:"name,omitempty"` + DeviceType NestedDeviceType `json:"device_type"` + Role NestedDeviceRole `json:"role"` + DeviceRole DeviceDeviceRole `json:"device_role"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Platform NullableNestedPlatform `json:"platform,omitempty"` + // Chassis serial number, assigned by the manufacturer + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Site NestedSite `json:"site"` + Location NullableNestedLocation `json:"location,omitempty"` + Rack NullableNestedRack `json:"rack,omitempty"` + Position NullableFloat64 `json:"position,omitempty"` + Face *DeviceFace `json:"face,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + ParentDevice NullableNestedDevice `json:"parent_device"` + Status *DeviceStatus `json:"status,omitempty"` + Airflow *DeviceAirflow `json:"airflow,omitempty"` + PrimaryIp NullableNestedIPAddress `json:"primary_ip"` + PrimaryIp4 NullableNestedIPAddress `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableNestedIPAddress `json:"primary_ip6,omitempty"` + OobIp NullableNestedIPAddress `json:"oob_ip,omitempty"` + Cluster NullableNestedCluster `json:"cluster,omitempty"` + VirtualChassis NullableNestedVirtualChassis `json:"virtual_chassis,omitempty"` + VcPosition NullableInt32 `json:"vc_position,omitempty"` + // Virtual chassis master election priority + VcPriority NullableInt32 `json:"vc_priority,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ConfigTemplate NullableNestedConfigTemplate `json:"config_template,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + ConsolePortCount int32 `json:"console_port_count"` + ConsoleServerPortCount int32 `json:"console_server_port_count"` + PowerPortCount int32 `json:"power_port_count"` + PowerOutletCount int32 `json:"power_outlet_count"` + InterfaceCount int32 `json:"interface_count"` + FrontPortCount int32 `json:"front_port_count"` + RearPortCount int32 `json:"rear_port_count"` + DeviceBayCount int32 `json:"device_bay_count"` + ModuleBayCount int32 `json:"module_bay_count"` + InventoryItemCount int32 `json:"inventory_item_count"` + AdditionalProperties map[string]interface{} +} + +type _Device Device + +// NewDevice instantiates a new Device object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDevice(id int32, url string, display string, deviceType NestedDeviceType, role NestedDeviceRole, deviceRole DeviceDeviceRole, site NestedSite, parentDevice NullableNestedDevice, primaryIp NullableNestedIPAddress, created NullableTime, lastUpdated NullableTime, consolePortCount int32, consoleServerPortCount int32, powerPortCount int32, powerOutletCount int32, interfaceCount int32, frontPortCount int32, rearPortCount int32, deviceBayCount int32, moduleBayCount int32, inventoryItemCount int32) *Device { + this := Device{} + this.Id = id + this.Url = url + this.Display = display + this.DeviceType = deviceType + this.Role = role + this.DeviceRole = deviceRole + this.Site = site + this.ParentDevice = parentDevice + this.PrimaryIp = primaryIp + this.Created = created + this.LastUpdated = lastUpdated + this.ConsolePortCount = consolePortCount + this.ConsoleServerPortCount = consoleServerPortCount + this.PowerPortCount = powerPortCount + this.PowerOutletCount = powerOutletCount + this.InterfaceCount = interfaceCount + this.FrontPortCount = frontPortCount + this.RearPortCount = rearPortCount + this.DeviceBayCount = deviceBayCount + this.ModuleBayCount = moduleBayCount + this.InventoryItemCount = inventoryItemCount + return &this +} + +// NewDeviceWithDefaults instantiates a new Device object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceWithDefaults() *Device { + this := Device{} + return &this +} + +// GetId returns the Id field value +func (o *Device) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Device) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Device) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Device) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Device) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Device) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Device) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Device) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Device) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *Device) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *Device) SetName(v string) { + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *Device) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *Device) UnsetName() { + o.Name.Unset() +} + +// GetDeviceType returns the DeviceType field value +func (o *Device) GetDeviceType() NestedDeviceType { + if o == nil { + var ret NestedDeviceType + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *Device) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *Device) SetDeviceType(v NestedDeviceType) { + o.DeviceType = v +} + +// GetRole returns the Role field value +func (o *Device) GetRole() NestedDeviceRole { + if o == nil { + var ret NestedDeviceRole + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *Device) GetRoleOk() (*NestedDeviceRole, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *Device) SetRole(v NestedDeviceRole) { + o.Role = v +} + +// GetDeviceRole returns the DeviceRole field value +func (o *Device) GetDeviceRole() DeviceDeviceRole { + if o == nil { + var ret DeviceDeviceRole + return ret + } + + return o.DeviceRole +} + +// GetDeviceRoleOk returns a tuple with the DeviceRole field value +// and a boolean to check if the value has been set. +func (o *Device) GetDeviceRoleOk() (*DeviceDeviceRole, bool) { + if o == nil { + return nil, false + } + return &o.DeviceRole, true +} + +// SetDeviceRole sets field value +func (o *Device) SetDeviceRole(v DeviceDeviceRole) { + o.DeviceRole = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Device) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Device) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Device) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Device) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetPlatform() NestedPlatform { + if o == nil || IsNil(o.Platform.Get()) { + var ret NestedPlatform + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetPlatformOk() (*NestedPlatform, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *Device) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableNestedPlatform and assigns it to the Platform field. +func (o *Device) SetPlatform(v NestedPlatform) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *Device) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *Device) UnsetPlatform() { + o.Platform.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *Device) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *Device) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *Device) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *Device) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *Device) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *Device) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *Device) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetSite returns the Site field value +func (o *Device) GetSite() NestedSite { + if o == nil { + var ret NestedSite + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *Device) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *Device) SetSite(v NestedSite) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetLocation() NestedLocation { + if o == nil || IsNil(o.Location.Get()) { + var ret NestedLocation + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetLocationOk() (*NestedLocation, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *Device) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableNestedLocation and assigns it to the Location field. +func (o *Device) SetLocation(v NestedLocation) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *Device) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *Device) UnsetLocation() { + o.Location.Unset() +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetRack() NestedRack { + if o == nil || IsNil(o.Rack.Get()) { + var ret NestedRack + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetRackOk() (*NestedRack, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *Device) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableNestedRack and assigns it to the Rack field. +func (o *Device) SetRack(v NestedRack) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *Device) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *Device) UnsetRack() { + o.Rack.Unset() +} + +// GetPosition returns the Position field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetPosition() float64 { + if o == nil || IsNil(o.Position.Get()) { + var ret float64 + return ret + } + return *o.Position.Get() +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetPositionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Position.Get(), o.Position.IsSet() +} + +// HasPosition returns a boolean if a field has been set. +func (o *Device) HasPosition() bool { + if o != nil && o.Position.IsSet() { + return true + } + + return false +} + +// SetPosition gets a reference to the given NullableFloat64 and assigns it to the Position field. +func (o *Device) SetPosition(v float64) { + o.Position.Set(&v) +} + +// SetPositionNil sets the value for Position to be an explicit nil +func (o *Device) SetPositionNil() { + o.Position.Set(nil) +} + +// UnsetPosition ensures that no value is present for Position, not even an explicit nil +func (o *Device) UnsetPosition() { + o.Position.Unset() +} + +// GetFace returns the Face field value if set, zero value otherwise. +func (o *Device) GetFace() DeviceFace { + if o == nil || IsNil(o.Face) { + var ret DeviceFace + return ret + } + return *o.Face +} + +// GetFaceOk returns a tuple with the Face field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetFaceOk() (*DeviceFace, bool) { + if o == nil || IsNil(o.Face) { + return nil, false + } + return o.Face, true +} + +// HasFace returns a boolean if a field has been set. +func (o *Device) HasFace() bool { + if o != nil && !IsNil(o.Face) { + return true + } + + return false +} + +// SetFace gets a reference to the given DeviceFace and assigns it to the Face field. +func (o *Device) SetFace(v DeviceFace) { + o.Face = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *Device) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *Device) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *Device) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *Device) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *Device) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *Device) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *Device) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *Device) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetParentDevice returns the ParentDevice field value +// If the value is explicit nil, the zero value for NestedDevice will be returned +func (o *Device) GetParentDevice() NestedDevice { + if o == nil || o.ParentDevice.Get() == nil { + var ret NestedDevice + return ret + } + + return *o.ParentDevice.Get() +} + +// GetParentDeviceOk returns a tuple with the ParentDevice field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetParentDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return o.ParentDevice.Get(), o.ParentDevice.IsSet() +} + +// SetParentDevice sets field value +func (o *Device) SetParentDevice(v NestedDevice) { + o.ParentDevice.Set(&v) +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Device) GetStatus() DeviceStatus { + if o == nil || IsNil(o.Status) { + var ret DeviceStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetStatusOk() (*DeviceStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Device) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given DeviceStatus and assigns it to the Status field. +func (o *Device) SetStatus(v DeviceStatus) { + o.Status = &v +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise. +func (o *Device) GetAirflow() DeviceAirflow { + if o == nil || IsNil(o.Airflow) { + var ret DeviceAirflow + return ret + } + return *o.Airflow +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetAirflowOk() (*DeviceAirflow, bool) { + if o == nil || IsNil(o.Airflow) { + return nil, false + } + return o.Airflow, true +} + +// HasAirflow returns a boolean if a field has been set. +func (o *Device) HasAirflow() bool { + if o != nil && !IsNil(o.Airflow) { + return true + } + + return false +} + +// SetAirflow gets a reference to the given DeviceAirflow and assigns it to the Airflow field. +func (o *Device) SetAirflow(v DeviceAirflow) { + o.Airflow = &v +} + +// GetPrimaryIp returns the PrimaryIp field value +// If the value is explicit nil, the zero value for NestedIPAddress will be returned +func (o *Device) GetPrimaryIp() NestedIPAddress { + if o == nil || o.PrimaryIp.Get() == nil { + var ret NestedIPAddress + return ret + } + + return *o.PrimaryIp.Get() +} + +// GetPrimaryIpOk returns a tuple with the PrimaryIp field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetPrimaryIpOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp.Get(), o.PrimaryIp.IsSet() +} + +// SetPrimaryIp sets field value +func (o *Device) SetPrimaryIp(v NestedIPAddress) { + o.PrimaryIp.Set(&v) +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetPrimaryIp4() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetPrimaryIp4Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *Device) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp4 field. +func (o *Device) SetPrimaryIp4(v NestedIPAddress) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *Device) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *Device) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetPrimaryIp6() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetPrimaryIp6Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *Device) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp6 field. +func (o *Device) SetPrimaryIp6(v NestedIPAddress) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *Device) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *Device) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetOobIp returns the OobIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetOobIp() NestedIPAddress { + if o == nil || IsNil(o.OobIp.Get()) { + var ret NestedIPAddress + return ret + } + return *o.OobIp.Get() +} + +// GetOobIpOk returns a tuple with the OobIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetOobIpOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.OobIp.Get(), o.OobIp.IsSet() +} + +// HasOobIp returns a boolean if a field has been set. +func (o *Device) HasOobIp() bool { + if o != nil && o.OobIp.IsSet() { + return true + } + + return false +} + +// SetOobIp gets a reference to the given NullableNestedIPAddress and assigns it to the OobIp field. +func (o *Device) SetOobIp(v NestedIPAddress) { + o.OobIp.Set(&v) +} + +// SetOobIpNil sets the value for OobIp to be an explicit nil +func (o *Device) SetOobIpNil() { + o.OobIp.Set(nil) +} + +// UnsetOobIp ensures that no value is present for OobIp, not even an explicit nil +func (o *Device) UnsetOobIp() { + o.OobIp.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetCluster() NestedCluster { + if o == nil || IsNil(o.Cluster.Get()) { + var ret NestedCluster + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetClusterOk() (*NestedCluster, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *Device) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableNestedCluster and assigns it to the Cluster field. +func (o *Device) SetCluster(v NestedCluster) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *Device) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *Device) UnsetCluster() { + o.Cluster.Unset() +} + +// GetVirtualChassis returns the VirtualChassis field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetVirtualChassis() NestedVirtualChassis { + if o == nil || IsNil(o.VirtualChassis.Get()) { + var ret NestedVirtualChassis + return ret + } + return *o.VirtualChassis.Get() +} + +// GetVirtualChassisOk returns a tuple with the VirtualChassis field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetVirtualChassisOk() (*NestedVirtualChassis, bool) { + if o == nil { + return nil, false + } + return o.VirtualChassis.Get(), o.VirtualChassis.IsSet() +} + +// HasVirtualChassis returns a boolean if a field has been set. +func (o *Device) HasVirtualChassis() bool { + if o != nil && o.VirtualChassis.IsSet() { + return true + } + + return false +} + +// SetVirtualChassis gets a reference to the given NullableNestedVirtualChassis and assigns it to the VirtualChassis field. +func (o *Device) SetVirtualChassis(v NestedVirtualChassis) { + o.VirtualChassis.Set(&v) +} + +// SetVirtualChassisNil sets the value for VirtualChassis to be an explicit nil +func (o *Device) SetVirtualChassisNil() { + o.VirtualChassis.Set(nil) +} + +// UnsetVirtualChassis ensures that no value is present for VirtualChassis, not even an explicit nil +func (o *Device) UnsetVirtualChassis() { + o.VirtualChassis.Unset() +} + +// GetVcPosition returns the VcPosition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetVcPosition() int32 { + if o == nil || IsNil(o.VcPosition.Get()) { + var ret int32 + return ret + } + return *o.VcPosition.Get() +} + +// GetVcPositionOk returns a tuple with the VcPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetVcPositionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPosition.Get(), o.VcPosition.IsSet() +} + +// HasVcPosition returns a boolean if a field has been set. +func (o *Device) HasVcPosition() bool { + if o != nil && o.VcPosition.IsSet() { + return true + } + + return false +} + +// SetVcPosition gets a reference to the given NullableInt32 and assigns it to the VcPosition field. +func (o *Device) SetVcPosition(v int32) { + o.VcPosition.Set(&v) +} + +// SetVcPositionNil sets the value for VcPosition to be an explicit nil +func (o *Device) SetVcPositionNil() { + o.VcPosition.Set(nil) +} + +// UnsetVcPosition ensures that no value is present for VcPosition, not even an explicit nil +func (o *Device) UnsetVcPosition() { + o.VcPosition.Unset() +} + +// GetVcPriority returns the VcPriority field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetVcPriority() int32 { + if o == nil || IsNil(o.VcPriority.Get()) { + var ret int32 + return ret + } + return *o.VcPriority.Get() +} + +// GetVcPriorityOk returns a tuple with the VcPriority field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetVcPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPriority.Get(), o.VcPriority.IsSet() +} + +// HasVcPriority returns a boolean if a field has been set. +func (o *Device) HasVcPriority() bool { + if o != nil && o.VcPriority.IsSet() { + return true + } + + return false +} + +// SetVcPriority gets a reference to the given NullableInt32 and assigns it to the VcPriority field. +func (o *Device) SetVcPriority(v int32) { + o.VcPriority.Set(&v) +} + +// SetVcPriorityNil sets the value for VcPriority to be an explicit nil +func (o *Device) SetVcPriorityNil() { + o.VcPriority.Set(nil) +} + +// UnsetVcPriority ensures that no value is present for VcPriority, not even an explicit nil +func (o *Device) UnsetVcPriority() { + o.VcPriority.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Device) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Device) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Device) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Device) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Device) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Device) SetComments(v string) { + o.Comments = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetConfigTemplate() NestedConfigTemplate { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret NestedConfigTemplate + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetConfigTemplateOk() (*NestedConfigTemplate, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *Device) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableNestedConfigTemplate and assigns it to the ConfigTemplate field. +func (o *Device) SetConfigTemplate(v NestedConfigTemplate) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *Device) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *Device) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Device) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *Device) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *Device) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Device) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Device) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Device) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Device) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Device) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Device) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Device) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Device) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Device) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Device) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetConsolePortCount returns the ConsolePortCount field value +func (o *Device) GetConsolePortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ConsolePortCount +} + +// GetConsolePortCountOk returns a tuple with the ConsolePortCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetConsolePortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ConsolePortCount, true +} + +// SetConsolePortCount sets field value +func (o *Device) SetConsolePortCount(v int32) { + o.ConsolePortCount = v +} + +// GetConsoleServerPortCount returns the ConsoleServerPortCount field value +func (o *Device) GetConsoleServerPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ConsoleServerPortCount +} + +// GetConsoleServerPortCountOk returns a tuple with the ConsoleServerPortCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetConsoleServerPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ConsoleServerPortCount, true +} + +// SetConsoleServerPortCount sets field value +func (o *Device) SetConsoleServerPortCount(v int32) { + o.ConsoleServerPortCount = v +} + +// GetPowerPortCount returns the PowerPortCount field value +func (o *Device) GetPowerPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerPortCount +} + +// GetPowerPortCountOk returns a tuple with the PowerPortCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetPowerPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerPortCount, true +} + +// SetPowerPortCount sets field value +func (o *Device) SetPowerPortCount(v int32) { + o.PowerPortCount = v +} + +// GetPowerOutletCount returns the PowerOutletCount field value +func (o *Device) GetPowerOutletCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerOutletCount +} + +// GetPowerOutletCountOk returns a tuple with the PowerOutletCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetPowerOutletCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerOutletCount, true +} + +// SetPowerOutletCount sets field value +func (o *Device) SetPowerOutletCount(v int32) { + o.PowerOutletCount = v +} + +// GetInterfaceCount returns the InterfaceCount field value +func (o *Device) GetInterfaceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InterfaceCount +} + +// GetInterfaceCountOk returns a tuple with the InterfaceCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetInterfaceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceCount, true +} + +// SetInterfaceCount sets field value +func (o *Device) SetInterfaceCount(v int32) { + o.InterfaceCount = v +} + +// GetFrontPortCount returns the FrontPortCount field value +func (o *Device) GetFrontPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.FrontPortCount +} + +// GetFrontPortCountOk returns a tuple with the FrontPortCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetFrontPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.FrontPortCount, true +} + +// SetFrontPortCount sets field value +func (o *Device) SetFrontPortCount(v int32) { + o.FrontPortCount = v +} + +// GetRearPortCount returns the RearPortCount field value +func (o *Device) GetRearPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RearPortCount +} + +// GetRearPortCountOk returns a tuple with the RearPortCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetRearPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RearPortCount, true +} + +// SetRearPortCount sets field value +func (o *Device) SetRearPortCount(v int32) { + o.RearPortCount = v +} + +// GetDeviceBayCount returns the DeviceBayCount field value +func (o *Device) GetDeviceBayCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceBayCount +} + +// GetDeviceBayCountOk returns a tuple with the DeviceBayCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetDeviceBayCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceBayCount, true +} + +// SetDeviceBayCount sets field value +func (o *Device) SetDeviceBayCount(v int32) { + o.DeviceBayCount = v +} + +// GetModuleBayCount returns the ModuleBayCount field value +func (o *Device) GetModuleBayCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ModuleBayCount +} + +// GetModuleBayCountOk returns a tuple with the ModuleBayCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetModuleBayCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBayCount, true +} + +// SetModuleBayCount sets field value +func (o *Device) SetModuleBayCount(v int32) { + o.ModuleBayCount = v +} + +// GetInventoryItemCount returns the InventoryItemCount field value +func (o *Device) GetInventoryItemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InventoryItemCount +} + +// GetInventoryItemCountOk returns a tuple with the InventoryItemCount field value +// and a boolean to check if the value has been set. +func (o *Device) GetInventoryItemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InventoryItemCount, true +} + +// SetInventoryItemCount sets field value +func (o *Device) SetInventoryItemCount(v int32) { + o.InventoryItemCount = v +} + +func (o Device) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Device) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["device_type"] = o.DeviceType + toSerialize["role"] = o.Role + toSerialize["device_role"] = o.DeviceRole + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + if o.Position.IsSet() { + toSerialize["position"] = o.Position.Get() + } + if !IsNil(o.Face) { + toSerialize["face"] = o.Face + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + toSerialize["parent_device"] = o.ParentDevice.Get() + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Airflow) { + toSerialize["airflow"] = o.Airflow + } + toSerialize["primary_ip"] = o.PrimaryIp.Get() + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.OobIp.IsSet() { + toSerialize["oob_ip"] = o.OobIp.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.VirtualChassis.IsSet() { + toSerialize["virtual_chassis"] = o.VirtualChassis.Get() + } + if o.VcPosition.IsSet() { + toSerialize["vc_position"] = o.VcPosition.Get() + } + if o.VcPriority.IsSet() { + toSerialize["vc_priority"] = o.VcPriority.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["console_port_count"] = o.ConsolePortCount + toSerialize["console_server_port_count"] = o.ConsoleServerPortCount + toSerialize["power_port_count"] = o.PowerPortCount + toSerialize["power_outlet_count"] = o.PowerOutletCount + toSerialize["interface_count"] = o.InterfaceCount + toSerialize["front_port_count"] = o.FrontPortCount + toSerialize["rear_port_count"] = o.RearPortCount + toSerialize["device_bay_count"] = o.DeviceBayCount + toSerialize["module_bay_count"] = o.ModuleBayCount + toSerialize["inventory_item_count"] = o.InventoryItemCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Device) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device_type", + "role", + "device_role", + "site", + "parent_device", + "primary_ip", + "created", + "last_updated", + "console_port_count", + "console_server_port_count", + "power_port_count", + "power_outlet_count", + "interface_count", + "front_port_count", + "rear_port_count", + "device_bay_count", + "module_bay_count", + "inventory_item_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDevice := _Device{} + + err = json.Unmarshal(data, &varDevice) + + if err != nil { + return err + } + + *o = Device(varDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "device_type") + delete(additionalProperties, "role") + delete(additionalProperties, "device_role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "rack") + delete(additionalProperties, "position") + delete(additionalProperties, "face") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "parent_device") + delete(additionalProperties, "status") + delete(additionalProperties, "airflow") + delete(additionalProperties, "primary_ip") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "oob_ip") + delete(additionalProperties, "cluster") + delete(additionalProperties, "virtual_chassis") + delete(additionalProperties, "vc_position") + delete(additionalProperties, "vc_priority") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "config_template") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "console_port_count") + delete(additionalProperties, "console_server_port_count") + delete(additionalProperties, "power_port_count") + delete(additionalProperties, "power_outlet_count") + delete(additionalProperties, "interface_count") + delete(additionalProperties, "front_port_count") + delete(additionalProperties, "rear_port_count") + delete(additionalProperties, "device_bay_count") + delete(additionalProperties, "module_bay_count") + delete(additionalProperties, "inventory_item_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDevice struct { + value *Device + isSet bool +} + +func (v NullableDevice) Get() *Device { + return v.value +} + +func (v *NullableDevice) Set(val *Device) { + v.value = val + v.isSet = true +} + +func (v NullableDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDevice(val *Device) *NullableDevice { + return &NullableDevice{value: val, isSet: true} +} + +func (v NullableDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow.go new file mode 100644 index 00000000..2be8a5ec --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DeviceAirflow type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceAirflow{} + +// DeviceAirflow struct for DeviceAirflow +type DeviceAirflow struct { + Value *DeviceAirflowValue `json:"value,omitempty"` + Label *DeviceAirflowLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceAirflow DeviceAirflow + +// NewDeviceAirflow instantiates a new DeviceAirflow object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceAirflow() *DeviceAirflow { + this := DeviceAirflow{} + return &this +} + +// NewDeviceAirflowWithDefaults instantiates a new DeviceAirflow object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceAirflowWithDefaults() *DeviceAirflow { + this := DeviceAirflow{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeviceAirflow) GetValue() DeviceAirflowValue { + if o == nil || IsNil(o.Value) { + var ret DeviceAirflowValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceAirflow) GetValueOk() (*DeviceAirflowValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeviceAirflow) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DeviceAirflowValue and assigns it to the Value field. +func (o *DeviceAirflow) SetValue(v DeviceAirflowValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceAirflow) GetLabel() DeviceAirflowLabel { + if o == nil || IsNil(o.Label) { + var ret DeviceAirflowLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceAirflow) GetLabelOk() (*DeviceAirflowLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceAirflow) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DeviceAirflowLabel and assigns it to the Label field. +func (o *DeviceAirflow) SetLabel(v DeviceAirflowLabel) { + o.Label = &v +} + +func (o DeviceAirflow) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceAirflow) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceAirflow) UnmarshalJSON(data []byte) (err error) { + varDeviceAirflow := _DeviceAirflow{} + + err = json.Unmarshal(data, &varDeviceAirflow) + + if err != nil { + return err + } + + *o = DeviceAirflow(varDeviceAirflow) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceAirflow struct { + value *DeviceAirflow + isSet bool +} + +func (v NullableDeviceAirflow) Get() *DeviceAirflow { + return v.value +} + +func (v *NullableDeviceAirflow) Set(val *DeviceAirflow) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceAirflow) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceAirflow) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceAirflow(val *DeviceAirflow) *NullableDeviceAirflow { + return &NullableDeviceAirflow{value: val, isSet: true} +} + +func (v NullableDeviceAirflow) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceAirflow) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow_label.go new file mode 100644 index 00000000..0ea12a00 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow_label.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceAirflowLabel the model 'DeviceAirflowLabel' +type DeviceAirflowLabel string + +// List of Device_airflow_label +const ( + DEVICEAIRFLOWLABEL_FRONT_TO_REAR DeviceAirflowLabel = "Front to rear" + DEVICEAIRFLOWLABEL_REAR_TO_FRONT DeviceAirflowLabel = "Rear to front" + DEVICEAIRFLOWLABEL_LEFT_TO_RIGHT DeviceAirflowLabel = "Left to right" + DEVICEAIRFLOWLABEL_RIGHT_TO_LEFT DeviceAirflowLabel = "Right to left" + DEVICEAIRFLOWLABEL_SIDE_TO_REAR DeviceAirflowLabel = "Side to rear" + DEVICEAIRFLOWLABEL_PASSIVE DeviceAirflowLabel = "Passive" + DEVICEAIRFLOWLABEL_MIXED DeviceAirflowLabel = "Mixed" +) + +// All allowed values of DeviceAirflowLabel enum +var AllowedDeviceAirflowLabelEnumValues = []DeviceAirflowLabel{ + "Front to rear", + "Rear to front", + "Left to right", + "Right to left", + "Side to rear", + "Passive", + "Mixed", +} + +func (v *DeviceAirflowLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceAirflowLabel(value) + for _, existing := range AllowedDeviceAirflowLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceAirflowLabel", value) +} + +// NewDeviceAirflowLabelFromValue returns a pointer to a valid DeviceAirflowLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceAirflowLabelFromValue(v string) (*DeviceAirflowLabel, error) { + ev := DeviceAirflowLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceAirflowLabel: valid values are %v", v, AllowedDeviceAirflowLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceAirflowLabel) IsValid() bool { + for _, existing := range AllowedDeviceAirflowLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Device_airflow_label value +func (v DeviceAirflowLabel) Ptr() *DeviceAirflowLabel { + return &v +} + +type NullableDeviceAirflowLabel struct { + value *DeviceAirflowLabel + isSet bool +} + +func (v NullableDeviceAirflowLabel) Get() *DeviceAirflowLabel { + return v.value +} + +func (v *NullableDeviceAirflowLabel) Set(val *DeviceAirflowLabel) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceAirflowLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceAirflowLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceAirflowLabel(val *DeviceAirflowLabel) *NullableDeviceAirflowLabel { + return &NullableDeviceAirflowLabel{value: val, isSet: true} +} + +func (v NullableDeviceAirflowLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceAirflowLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow_value.go new file mode 100644 index 00000000..86567524 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_airflow_value.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceAirflowValue * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front * `left-to-right` - Left to right * `right-to-left` - Right to left * `side-to-rear` - Side to rear * `passive` - Passive * `mixed` - Mixed +type DeviceAirflowValue string + +// List of Device_airflow_value +const ( + DEVICEAIRFLOWVALUE_FRONT_TO_REAR DeviceAirflowValue = "front-to-rear" + DEVICEAIRFLOWVALUE_REAR_TO_FRONT DeviceAirflowValue = "rear-to-front" + DEVICEAIRFLOWVALUE_LEFT_TO_RIGHT DeviceAirflowValue = "left-to-right" + DEVICEAIRFLOWVALUE_RIGHT_TO_LEFT DeviceAirflowValue = "right-to-left" + DEVICEAIRFLOWVALUE_SIDE_TO_REAR DeviceAirflowValue = "side-to-rear" + DEVICEAIRFLOWVALUE_PASSIVE DeviceAirflowValue = "passive" + DEVICEAIRFLOWVALUE_MIXED DeviceAirflowValue = "mixed" + DEVICEAIRFLOWVALUE_EMPTY DeviceAirflowValue = "" +) + +// All allowed values of DeviceAirflowValue enum +var AllowedDeviceAirflowValueEnumValues = []DeviceAirflowValue{ + "front-to-rear", + "rear-to-front", + "left-to-right", + "right-to-left", + "side-to-rear", + "passive", + "mixed", + "", +} + +func (v *DeviceAirflowValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceAirflowValue(value) + for _, existing := range AllowedDeviceAirflowValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceAirflowValue", value) +} + +// NewDeviceAirflowValueFromValue returns a pointer to a valid DeviceAirflowValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceAirflowValueFromValue(v string) (*DeviceAirflowValue, error) { + ev := DeviceAirflowValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceAirflowValue: valid values are %v", v, AllowedDeviceAirflowValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceAirflowValue) IsValid() bool { + for _, existing := range AllowedDeviceAirflowValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Device_airflow_value value +func (v DeviceAirflowValue) Ptr() *DeviceAirflowValue { + return &v +} + +type NullableDeviceAirflowValue struct { + value *DeviceAirflowValue + isSet bool +} + +func (v NullableDeviceAirflowValue) Get() *DeviceAirflowValue { + return v.value +} + +func (v *NullableDeviceAirflowValue) Set(val *DeviceAirflowValue) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceAirflowValue) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceAirflowValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceAirflowValue(val *DeviceAirflowValue) *NullableDeviceAirflowValue { + return &NullableDeviceAirflowValue{value: val, isSet: true} +} + +func (v NullableDeviceAirflowValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceAirflowValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay.go new file mode 100644 index 00000000..bf4c883c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay.go @@ -0,0 +1,542 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceBay type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceBay{} + +// DeviceBay Adds support for custom fields and tags. +type DeviceBay struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + InstalledDevice NullableNestedDevice `json:"installed_device,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _DeviceBay DeviceBay + +// NewDeviceBay instantiates a new DeviceBay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceBay(id int32, url string, display string, device NestedDevice, name string, created NullableTime, lastUpdated NullableTime) *DeviceBay { + this := DeviceBay{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewDeviceBayWithDefaults instantiates a new DeviceBay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceBayWithDefaults() *DeviceBay { + this := DeviceBay{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceBay) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceBay) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DeviceBay) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DeviceBay) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DeviceBay) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DeviceBay) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *DeviceBay) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *DeviceBay) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetName returns the Name field value +func (o *DeviceBay) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceBay) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceBay) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceBay) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *DeviceBay) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceBay) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceBay) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceBay) SetDescription(v string) { + o.Description = &v +} + +// GetInstalledDevice returns the InstalledDevice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceBay) GetInstalledDevice() NestedDevice { + if o == nil || IsNil(o.InstalledDevice.Get()) { + var ret NestedDevice + return ret + } + return *o.InstalledDevice.Get() +} + +// GetInstalledDeviceOk returns a tuple with the InstalledDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceBay) GetInstalledDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return o.InstalledDevice.Get(), o.InstalledDevice.IsSet() +} + +// HasInstalledDevice returns a boolean if a field has been set. +func (o *DeviceBay) HasInstalledDevice() bool { + if o != nil && o.InstalledDevice.IsSet() { + return true + } + + return false +} + +// SetInstalledDevice gets a reference to the given NullableNestedDevice and assigns it to the InstalledDevice field. +func (o *DeviceBay) SetInstalledDevice(v NestedDevice) { + o.InstalledDevice.Set(&v) +} + +// SetInstalledDeviceNil sets the value for InstalledDevice to be an explicit nil +func (o *DeviceBay) SetInstalledDeviceNil() { + o.InstalledDevice.Set(nil) +} + +// UnsetInstalledDevice ensures that no value is present for InstalledDevice, not even an explicit nil +func (o *DeviceBay) UnsetInstalledDevice() { + o.InstalledDevice.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceBay) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceBay) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *DeviceBay) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceBay) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBay) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceBay) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceBay) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceBay) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceBay) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *DeviceBay) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceBay) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceBay) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *DeviceBay) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o DeviceBay) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceBay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.InstalledDevice.IsSet() { + toSerialize["installed_device"] = o.InstalledDevice.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceBay) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceBay := _DeviceBay{} + + err = json.Unmarshal(data, &varDeviceBay) + + if err != nil { + return err + } + + *o = DeviceBay(varDeviceBay) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + delete(additionalProperties, "installed_device") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceBay struct { + value *DeviceBay + isSet bool +} + +func (v NullableDeviceBay) Get() *DeviceBay { + return v.value +} + +func (v *NullableDeviceBay) Set(val *DeviceBay) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceBay) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceBay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceBay(val *DeviceBay) *NullableDeviceBay { + return &NullableDeviceBay{value: val, isSet: true} +} + +func (v NullableDeviceBay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceBay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_request.go new file mode 100644 index 00000000..ccff1bc5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_request.go @@ -0,0 +1,392 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceBayRequest{} + +// DeviceBayRequest Adds support for custom fields and tags. +type DeviceBayRequest struct { + Device NestedDeviceRequest `json:"device"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + InstalledDevice NullableNestedDeviceRequest `json:"installed_device,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceBayRequest DeviceBayRequest + +// NewDeviceBayRequest instantiates a new DeviceBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceBayRequest(device NestedDeviceRequest, name string) *DeviceBayRequest { + this := DeviceBayRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewDeviceBayRequestWithDefaults instantiates a new DeviceBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceBayRequestWithDefaults() *DeviceBayRequest { + this := DeviceBayRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *DeviceBayRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *DeviceBayRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *DeviceBayRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetName returns the Name field value +func (o *DeviceBayRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceBayRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceBayRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceBayRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceBayRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *DeviceBayRequest) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceBayRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceBayRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceBayRequest) SetDescription(v string) { + o.Description = &v +} + +// GetInstalledDevice returns the InstalledDevice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceBayRequest) GetInstalledDevice() NestedDeviceRequest { + if o == nil || IsNil(o.InstalledDevice.Get()) { + var ret NestedDeviceRequest + return ret + } + return *o.InstalledDevice.Get() +} + +// GetInstalledDeviceOk returns a tuple with the InstalledDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceBayRequest) GetInstalledDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return o.InstalledDevice.Get(), o.InstalledDevice.IsSet() +} + +// HasInstalledDevice returns a boolean if a field has been set. +func (o *DeviceBayRequest) HasInstalledDevice() bool { + if o != nil && o.InstalledDevice.IsSet() { + return true + } + + return false +} + +// SetInstalledDevice gets a reference to the given NullableNestedDeviceRequest and assigns it to the InstalledDevice field. +func (o *DeviceBayRequest) SetInstalledDevice(v NestedDeviceRequest) { + o.InstalledDevice.Set(&v) +} + +// SetInstalledDeviceNil sets the value for InstalledDevice to be an explicit nil +func (o *DeviceBayRequest) SetInstalledDeviceNil() { + o.InstalledDevice.Set(nil) +} + +// UnsetInstalledDevice ensures that no value is present for InstalledDevice, not even an explicit nil +func (o *DeviceBayRequest) UnsetInstalledDevice() { + o.InstalledDevice.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceBayRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceBayRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *DeviceBayRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceBayRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceBayRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceBayRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o DeviceBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.InstalledDevice.IsSet() { + toSerialize["installed_device"] = o.InstalledDevice.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceBayRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceBayRequest := _DeviceBayRequest{} + + err = json.Unmarshal(data, &varDeviceBayRequest) + + if err != nil { + return err + } + + *o = DeviceBayRequest(varDeviceBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + delete(additionalProperties, "installed_device") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceBayRequest struct { + value *DeviceBayRequest + isSet bool +} + +func (v NullableDeviceBayRequest) Get() *DeviceBayRequest { + return v.value +} + +func (v *NullableDeviceBayRequest) Set(val *DeviceBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceBayRequest(val *DeviceBayRequest) *NullableDeviceBayRequest { + return &NullableDeviceBayRequest{value: val, isSet: true} +} + +func (v NullableDeviceBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_template.go new file mode 100644 index 00000000..d31767e2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_template.go @@ -0,0 +1,421 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceBayTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceBayTemplate{} + +// DeviceBayTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type DeviceBayTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NestedDeviceType `json:"device_type"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _DeviceBayTemplate DeviceBayTemplate + +// NewDeviceBayTemplate instantiates a new DeviceBayTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceBayTemplate(id int32, url string, display string, deviceType NestedDeviceType, name string, created NullableTime, lastUpdated NullableTime) *DeviceBayTemplate { + this := DeviceBayTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.DeviceType = deviceType + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewDeviceBayTemplateWithDefaults instantiates a new DeviceBayTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceBayTemplateWithDefaults() *DeviceBayTemplate { + this := DeviceBayTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceBayTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceBayTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DeviceBayTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DeviceBayTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DeviceBayTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DeviceBayTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value +func (o *DeviceBayTemplate) GetDeviceType() NestedDeviceType { + if o == nil { + var ret NestedDeviceType + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *DeviceBayTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType = v +} + +// GetName returns the Name field value +func (o *DeviceBayTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceBayTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceBayTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceBayTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *DeviceBayTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceBayTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceBayTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceBayTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceBayTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceBayTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *DeviceBayTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceBayTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceBayTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *DeviceBayTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o DeviceBayTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceBayTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device_type"] = o.DeviceType + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceBayTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device_type", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceBayTemplate := _DeviceBayTemplate{} + + err = json.Unmarshal(data, &varDeviceBayTemplate) + + if err != nil { + return err + } + + *o = DeviceBayTemplate(varDeviceBayTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceBayTemplate struct { + value *DeviceBayTemplate + isSet bool +} + +func (v NullableDeviceBayTemplate) Get() *DeviceBayTemplate { + return v.value +} + +func (v *NullableDeviceBayTemplate) Set(val *DeviceBayTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceBayTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceBayTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceBayTemplate(val *DeviceBayTemplate) *NullableDeviceBayTemplate { + return &NullableDeviceBayTemplate{value: val, isSet: true} +} + +func (v NullableDeviceBayTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceBayTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_template_request.go new file mode 100644 index 00000000..3d4da437 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_bay_template_request.go @@ -0,0 +1,271 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceBayTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceBayTemplateRequest{} + +// DeviceBayTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type DeviceBayTemplateRequest struct { + DeviceType NestedDeviceTypeRequest `json:"device_type"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceBayTemplateRequest DeviceBayTemplateRequest + +// NewDeviceBayTemplateRequest instantiates a new DeviceBayTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceBayTemplateRequest(deviceType NestedDeviceTypeRequest, name string) *DeviceBayTemplateRequest { + this := DeviceBayTemplateRequest{} + this.DeviceType = deviceType + this.Name = name + return &this +} + +// NewDeviceBayTemplateRequestWithDefaults instantiates a new DeviceBayTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceBayTemplateRequestWithDefaults() *DeviceBayTemplateRequest { + this := DeviceBayTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value +func (o *DeviceBayTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil { + var ret NestedDeviceTypeRequest + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *DeviceBayTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType = v +} + +// GetName returns the Name field value +func (o *DeviceBayTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceBayTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceBayTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceBayTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *DeviceBayTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceBayTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceBayTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceBayTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceBayTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o DeviceBayTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceBayTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_type"] = o.DeviceType + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceBayTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceBayTemplateRequest := _DeviceBayTemplateRequest{} + + err = json.Unmarshal(data, &varDeviceBayTemplateRequest) + + if err != nil { + return err + } + + *o = DeviceBayTemplateRequest(varDeviceBayTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceBayTemplateRequest struct { + value *DeviceBayTemplateRequest + isSet bool +} + +func (v NullableDeviceBayTemplateRequest) Get() *DeviceBayTemplateRequest { + return v.value +} + +func (v *NullableDeviceBayTemplateRequest) Set(val *DeviceBayTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceBayTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceBayTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceBayTemplateRequest(val *DeviceBayTemplateRequest) *NullableDeviceBayTemplateRequest { + return &NullableDeviceBayTemplateRequest{value: val, isSet: true} +} + +func (v NullableDeviceBayTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceBayTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_device_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_device_role.go new file mode 100644 index 00000000..f2b6dd69 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_device_role.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceDeviceRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceDeviceRole{} + +// DeviceDeviceRole Deprecated in v3.6 in favor of `role`. +type DeviceDeviceRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _DeviceDeviceRole DeviceDeviceRole + +// NewDeviceDeviceRole instantiates a new DeviceDeviceRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceDeviceRole(id int32, url string, display string, name string, slug string) *DeviceDeviceRole { + this := DeviceDeviceRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewDeviceDeviceRoleWithDefaults instantiates a new DeviceDeviceRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceDeviceRoleWithDefaults() *DeviceDeviceRole { + this := DeviceDeviceRole{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceDeviceRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceDeviceRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceDeviceRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DeviceDeviceRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DeviceDeviceRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DeviceDeviceRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DeviceDeviceRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DeviceDeviceRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DeviceDeviceRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *DeviceDeviceRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceDeviceRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceDeviceRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *DeviceDeviceRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *DeviceDeviceRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *DeviceDeviceRole) SetSlug(v string) { + o.Slug = v +} + +func (o DeviceDeviceRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceDeviceRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceDeviceRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceDeviceRole := _DeviceDeviceRole{} + + err = json.Unmarshal(data, &varDeviceDeviceRole) + + if err != nil { + return err + } + + *o = DeviceDeviceRole(varDeviceDeviceRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceDeviceRole struct { + value *DeviceDeviceRole + isSet bool +} + +func (v NullableDeviceDeviceRole) Get() *DeviceDeviceRole { + return v.value +} + +func (v *NullableDeviceDeviceRole) Set(val *DeviceDeviceRole) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceDeviceRole) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceDeviceRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceDeviceRole(val *DeviceDeviceRole) *NullableDeviceDeviceRole { + return &NullableDeviceDeviceRole{value: val, isSet: true} +} + +func (v NullableDeviceDeviceRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceDeviceRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_face.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_face.go new file mode 100644 index 00000000..4efc40b5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_face.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DeviceFace type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceFace{} + +// DeviceFace struct for DeviceFace +type DeviceFace struct { + Value *DeviceFaceValue `json:"value,omitempty"` + Label *DeviceFaceLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceFace DeviceFace + +// NewDeviceFace instantiates a new DeviceFace object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceFace() *DeviceFace { + this := DeviceFace{} + return &this +} + +// NewDeviceFaceWithDefaults instantiates a new DeviceFace object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceFaceWithDefaults() *DeviceFace { + this := DeviceFace{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeviceFace) GetValue() DeviceFaceValue { + if o == nil || IsNil(o.Value) { + var ret DeviceFaceValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceFace) GetValueOk() (*DeviceFaceValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeviceFace) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DeviceFaceValue and assigns it to the Value field. +func (o *DeviceFace) SetValue(v DeviceFaceValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceFace) GetLabel() DeviceFaceLabel { + if o == nil || IsNil(o.Label) { + var ret DeviceFaceLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceFace) GetLabelOk() (*DeviceFaceLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceFace) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DeviceFaceLabel and assigns it to the Label field. +func (o *DeviceFace) SetLabel(v DeviceFaceLabel) { + o.Label = &v +} + +func (o DeviceFace) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceFace) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceFace) UnmarshalJSON(data []byte) (err error) { + varDeviceFace := _DeviceFace{} + + err = json.Unmarshal(data, &varDeviceFace) + + if err != nil { + return err + } + + *o = DeviceFace(varDeviceFace) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceFace struct { + value *DeviceFace + isSet bool +} + +func (v NullableDeviceFace) Get() *DeviceFace { + return v.value +} + +func (v *NullableDeviceFace) Set(val *DeviceFace) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceFace) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceFace) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceFace(val *DeviceFace) *NullableDeviceFace { + return &NullableDeviceFace{value: val, isSet: true} +} + +func (v NullableDeviceFace) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceFace) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_face_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_face_label.go new file mode 100644 index 00000000..72691292 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_face_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceFaceLabel the model 'DeviceFaceLabel' +type DeviceFaceLabel string + +// List of Device_face_label +const ( + DEVICEFACELABEL_FRONT DeviceFaceLabel = "Front" + DEVICEFACELABEL_REAR DeviceFaceLabel = "Rear" +) + +// All allowed values of DeviceFaceLabel enum +var AllowedDeviceFaceLabelEnumValues = []DeviceFaceLabel{ + "Front", + "Rear", +} + +func (v *DeviceFaceLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceFaceLabel(value) + for _, existing := range AllowedDeviceFaceLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceFaceLabel", value) +} + +// NewDeviceFaceLabelFromValue returns a pointer to a valid DeviceFaceLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceFaceLabelFromValue(v string) (*DeviceFaceLabel, error) { + ev := DeviceFaceLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceFaceLabel: valid values are %v", v, AllowedDeviceFaceLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceFaceLabel) IsValid() bool { + for _, existing := range AllowedDeviceFaceLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Device_face_label value +func (v DeviceFaceLabel) Ptr() *DeviceFaceLabel { + return &v +} + +type NullableDeviceFaceLabel struct { + value *DeviceFaceLabel + isSet bool +} + +func (v NullableDeviceFaceLabel) Get() *DeviceFaceLabel { + return v.value +} + +func (v *NullableDeviceFaceLabel) Set(val *DeviceFaceLabel) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceFaceLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceFaceLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceFaceLabel(val *DeviceFaceLabel) *NullableDeviceFaceLabel { + return &NullableDeviceFaceLabel{value: val, isSet: true} +} + +func (v NullableDeviceFaceLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceFaceLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_face_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_face_value.go new file mode 100644 index 00000000..07fa560c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_face_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceFaceValue * `front` - Front * `rear` - Rear +type DeviceFaceValue string + +// List of Device_face_value +const ( + DEVICEFACEVALUE_FRONT DeviceFaceValue = "front" + DEVICEFACEVALUE_REAR DeviceFaceValue = "rear" + DEVICEFACEVALUE_EMPTY DeviceFaceValue = "" +) + +// All allowed values of DeviceFaceValue enum +var AllowedDeviceFaceValueEnumValues = []DeviceFaceValue{ + "front", + "rear", + "", +} + +func (v *DeviceFaceValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceFaceValue(value) + for _, existing := range AllowedDeviceFaceValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceFaceValue", value) +} + +// NewDeviceFaceValueFromValue returns a pointer to a valid DeviceFaceValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceFaceValueFromValue(v string) (*DeviceFaceValue, error) { + ev := DeviceFaceValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceFaceValue: valid values are %v", v, AllowedDeviceFaceValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceFaceValue) IsValid() bool { + for _, existing := range AllowedDeviceFaceValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Device_face_value value +func (v DeviceFaceValue) Ptr() *DeviceFaceValue { + return &v +} + +type NullableDeviceFaceValue struct { + value *DeviceFaceValue + isSet bool +} + +func (v NullableDeviceFaceValue) Get() *DeviceFaceValue { + return v.value +} + +func (v *NullableDeviceFaceValue) Set(val *DeviceFaceValue) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceFaceValue) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceFaceValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceFaceValue(val *DeviceFaceValue) *NullableDeviceFaceValue { + return &NullableDeviceFaceValue{value: val, isSet: true} +} + +func (v NullableDeviceFaceValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceFaceValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_role.go new file mode 100644 index 00000000..47903266 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_role.go @@ -0,0 +1,637 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceRole{} + +// DeviceRole Adds support for custom fields and tags. +type DeviceRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + // Virtual machines may be assigned to this role + VmRole *bool `json:"vm_role,omitempty"` + ConfigTemplate NullableNestedConfigTemplate `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + DeviceCount int32 `json:"device_count"` + VirtualmachineCount int32 `json:"virtualmachine_count"` + AdditionalProperties map[string]interface{} +} + +type _DeviceRole DeviceRole + +// NewDeviceRole instantiates a new DeviceRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, deviceCount int32, virtualmachineCount int32) *DeviceRole { + this := DeviceRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.DeviceCount = deviceCount + this.VirtualmachineCount = virtualmachineCount + return &this +} + +// NewDeviceRoleWithDefaults instantiates a new DeviceRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceRoleWithDefaults() *DeviceRole { + this := DeviceRole{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DeviceRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DeviceRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DeviceRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DeviceRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *DeviceRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *DeviceRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *DeviceRole) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *DeviceRole) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *DeviceRole) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *DeviceRole) SetColor(v string) { + o.Color = &v +} + +// GetVmRole returns the VmRole field value if set, zero value otherwise. +func (o *DeviceRole) GetVmRole() bool { + if o == nil || IsNil(o.VmRole) { + var ret bool + return ret + } + return *o.VmRole +} + +// GetVmRoleOk returns a tuple with the VmRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetVmRoleOk() (*bool, bool) { + if o == nil || IsNil(o.VmRole) { + return nil, false + } + return o.VmRole, true +} + +// HasVmRole returns a boolean if a field has been set. +func (o *DeviceRole) HasVmRole() bool { + if o != nil && !IsNil(o.VmRole) { + return true + } + + return false +} + +// SetVmRole gets a reference to the given bool and assigns it to the VmRole field. +func (o *DeviceRole) SetVmRole(v bool) { + o.VmRole = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceRole) GetConfigTemplate() NestedConfigTemplate { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret NestedConfigTemplate + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceRole) GetConfigTemplateOk() (*NestedConfigTemplate, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *DeviceRole) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableNestedConfigTemplate and assigns it to the ConfigTemplate field. +func (o *DeviceRole) SetConfigTemplate(v NestedConfigTemplate) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *DeviceRole) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *DeviceRole) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceRole) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceRole) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceRole) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceRole) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceRole) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *DeviceRole) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceRole) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceRole) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceRole) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceRole) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceRole) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *DeviceRole) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceRole) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceRole) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *DeviceRole) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDeviceCount returns the DeviceCount field value +func (o *DeviceRole) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *DeviceRole) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetVirtualmachineCount returns the VirtualmachineCount field value +func (o *DeviceRole) GetVirtualmachineCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualmachineCount +} + +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// and a boolean to check if the value has been set. +func (o *DeviceRole) GetVirtualmachineCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualmachineCount, true +} + +// SetVirtualmachineCount sets field value +func (o *DeviceRole) SetVirtualmachineCount(v int32) { + o.VirtualmachineCount = v +} + +func (o DeviceRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.VmRole) { + toSerialize["vm_role"] = o.VmRole + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["device_count"] = o.DeviceCount + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "device_count", + "virtualmachine_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceRole := _DeviceRole{} + + err = json.Unmarshal(data, &varDeviceRole) + + if err != nil { + return err + } + + *o = DeviceRole(varDeviceRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "vm_role") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "device_count") + delete(additionalProperties, "virtualmachine_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceRole struct { + value *DeviceRole + isSet bool +} + +func (v NullableDeviceRole) Get() *DeviceRole { + return v.value +} + +func (v *NullableDeviceRole) Set(val *DeviceRole) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceRole) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceRole(val *DeviceRole) *NullableDeviceRole { + return &NullableDeviceRole{value: val, isSet: true} +} + +func (v NullableDeviceRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_role_request.go new file mode 100644 index 00000000..bd392fa7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_role_request.go @@ -0,0 +1,429 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceRoleRequest{} + +// DeviceRoleRequest Adds support for custom fields and tags. +type DeviceRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + // Virtual machines may be assigned to this role + VmRole *bool `json:"vm_role,omitempty"` + ConfigTemplate NullableNestedConfigTemplateRequest `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceRoleRequest DeviceRoleRequest + +// NewDeviceRoleRequest instantiates a new DeviceRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceRoleRequest(name string, slug string) *DeviceRoleRequest { + this := DeviceRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewDeviceRoleRequestWithDefaults instantiates a new DeviceRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceRoleRequestWithDefaults() *DeviceRoleRequest { + this := DeviceRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DeviceRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *DeviceRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *DeviceRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *DeviceRoleRequest) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *DeviceRoleRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRoleRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *DeviceRoleRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *DeviceRoleRequest) SetColor(v string) { + o.Color = &v +} + +// GetVmRole returns the VmRole field value if set, zero value otherwise. +func (o *DeviceRoleRequest) GetVmRole() bool { + if o == nil || IsNil(o.VmRole) { + var ret bool + return ret + } + return *o.VmRole +} + +// GetVmRoleOk returns a tuple with the VmRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRoleRequest) GetVmRoleOk() (*bool, bool) { + if o == nil || IsNil(o.VmRole) { + return nil, false + } + return o.VmRole, true +} + +// HasVmRole returns a boolean if a field has been set. +func (o *DeviceRoleRequest) HasVmRole() bool { + if o != nil && !IsNil(o.VmRole) { + return true + } + + return false +} + +// SetVmRole gets a reference to the given bool and assigns it to the VmRole field. +func (o *DeviceRoleRequest) SetVmRole(v bool) { + o.VmRole = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceRoleRequest) GetConfigTemplate() NestedConfigTemplateRequest { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret NestedConfigTemplateRequest + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceRoleRequest) GetConfigTemplateOk() (*NestedConfigTemplateRequest, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *DeviceRoleRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableNestedConfigTemplateRequest and assigns it to the ConfigTemplate field. +func (o *DeviceRoleRequest) SetConfigTemplate(v NestedConfigTemplateRequest) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *DeviceRoleRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *DeviceRoleRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *DeviceRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o DeviceRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.VmRole) { + toSerialize["vm_role"] = o.VmRole + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceRoleRequest := _DeviceRoleRequest{} + + err = json.Unmarshal(data, &varDeviceRoleRequest) + + if err != nil { + return err + } + + *o = DeviceRoleRequest(varDeviceRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "vm_role") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceRoleRequest struct { + value *DeviceRoleRequest + isSet bool +} + +func (v NullableDeviceRoleRequest) Get() *DeviceRoleRequest { + return v.value +} + +func (v *NullableDeviceRoleRequest) Set(val *DeviceRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceRoleRequest(val *DeviceRoleRequest) *NullableDeviceRoleRequest { + return &NullableDeviceRoleRequest{value: val, isSet: true} +} + +func (v NullableDeviceRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_status.go new file mode 100644 index 00000000..f3a5b0a1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DeviceStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceStatus{} + +// DeviceStatus struct for DeviceStatus +type DeviceStatus struct { + Value *DeviceStatusValue `json:"value,omitempty"` + Label *DeviceStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceStatus DeviceStatus + +// NewDeviceStatus instantiates a new DeviceStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceStatus() *DeviceStatus { + this := DeviceStatus{} + return &this +} + +// NewDeviceStatusWithDefaults instantiates a new DeviceStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceStatusWithDefaults() *DeviceStatus { + this := DeviceStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeviceStatus) GetValue() DeviceStatusValue { + if o == nil || IsNil(o.Value) { + var ret DeviceStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceStatus) GetValueOk() (*DeviceStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeviceStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DeviceStatusValue and assigns it to the Value field. +func (o *DeviceStatus) SetValue(v DeviceStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceStatus) GetLabel() DeviceStatusLabel { + if o == nil || IsNil(o.Label) { + var ret DeviceStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceStatus) GetLabelOk() (*DeviceStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DeviceStatusLabel and assigns it to the Label field. +func (o *DeviceStatus) SetLabel(v DeviceStatusLabel) { + o.Label = &v +} + +func (o DeviceStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceStatus) UnmarshalJSON(data []byte) (err error) { + varDeviceStatus := _DeviceStatus{} + + err = json.Unmarshal(data, &varDeviceStatus) + + if err != nil { + return err + } + + *o = DeviceStatus(varDeviceStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceStatus struct { + value *DeviceStatus + isSet bool +} + +func (v NullableDeviceStatus) Get() *DeviceStatus { + return v.value +} + +func (v *NullableDeviceStatus) Set(val *DeviceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceStatus(val *DeviceStatus) *NullableDeviceStatus { + return &NullableDeviceStatus{value: val, isSet: true} +} + +func (v NullableDeviceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_status_label.go new file mode 100644 index 00000000..f195f4d0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_status_label.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceStatusLabel the model 'DeviceStatusLabel' +type DeviceStatusLabel string + +// List of Device_status_label +const ( + DEVICESTATUSLABEL_OFFLINE DeviceStatusLabel = "Offline" + DEVICESTATUSLABEL_ACTIVE DeviceStatusLabel = "Active" + DEVICESTATUSLABEL_PLANNED DeviceStatusLabel = "Planned" + DEVICESTATUSLABEL_STAGED DeviceStatusLabel = "Staged" + DEVICESTATUSLABEL_FAILED DeviceStatusLabel = "Failed" + DEVICESTATUSLABEL_INVENTORY DeviceStatusLabel = "Inventory" + DEVICESTATUSLABEL_DECOMMISSIONING DeviceStatusLabel = "Decommissioning" +) + +// All allowed values of DeviceStatusLabel enum +var AllowedDeviceStatusLabelEnumValues = []DeviceStatusLabel{ + "Offline", + "Active", + "Planned", + "Staged", + "Failed", + "Inventory", + "Decommissioning", +} + +func (v *DeviceStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceStatusLabel(value) + for _, existing := range AllowedDeviceStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceStatusLabel", value) +} + +// NewDeviceStatusLabelFromValue returns a pointer to a valid DeviceStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceStatusLabelFromValue(v string) (*DeviceStatusLabel, error) { + ev := DeviceStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceStatusLabel: valid values are %v", v, AllowedDeviceStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceStatusLabel) IsValid() bool { + for _, existing := range AllowedDeviceStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Device_status_label value +func (v DeviceStatusLabel) Ptr() *DeviceStatusLabel { + return &v +} + +type NullableDeviceStatusLabel struct { + value *DeviceStatusLabel + isSet bool +} + +func (v NullableDeviceStatusLabel) Get() *DeviceStatusLabel { + return v.value +} + +func (v *NullableDeviceStatusLabel) Set(val *DeviceStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceStatusLabel(val *DeviceStatusLabel) *NullableDeviceStatusLabel { + return &NullableDeviceStatusLabel{value: val, isSet: true} +} + +func (v NullableDeviceStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_status_value.go new file mode 100644 index 00000000..e84b7da4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_status_value.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceStatusValue * `offline` - Offline * `active` - Active * `planned` - Planned * `staged` - Staged * `failed` - Failed * `inventory` - Inventory * `decommissioning` - Decommissioning +type DeviceStatusValue string + +// List of Device_status_value +const ( + DEVICESTATUSVALUE_OFFLINE DeviceStatusValue = "offline" + DEVICESTATUSVALUE_ACTIVE DeviceStatusValue = "active" + DEVICESTATUSVALUE_PLANNED DeviceStatusValue = "planned" + DEVICESTATUSVALUE_STAGED DeviceStatusValue = "staged" + DEVICESTATUSVALUE_FAILED DeviceStatusValue = "failed" + DEVICESTATUSVALUE_INVENTORY DeviceStatusValue = "inventory" + DEVICESTATUSVALUE_DECOMMISSIONING DeviceStatusValue = "decommissioning" +) + +// All allowed values of DeviceStatusValue enum +var AllowedDeviceStatusValueEnumValues = []DeviceStatusValue{ + "offline", + "active", + "planned", + "staged", + "failed", + "inventory", + "decommissioning", +} + +func (v *DeviceStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceStatusValue(value) + for _, existing := range AllowedDeviceStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceStatusValue", value) +} + +// NewDeviceStatusValueFromValue returns a pointer to a valid DeviceStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceStatusValueFromValue(v string) (*DeviceStatusValue, error) { + ev := DeviceStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceStatusValue: valid values are %v", v, AllowedDeviceStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceStatusValue) IsValid() bool { + for _, existing := range AllowedDeviceStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Device_status_value value +func (v DeviceStatusValue) Ptr() *DeviceStatusValue { + return &v +} + +type NullableDeviceStatusValue struct { + value *DeviceStatusValue + isSet bool +} + +func (v NullableDeviceStatusValue) Get() *DeviceStatusValue { + return v.value +} + +func (v *NullableDeviceStatusValue) Set(val *DeviceStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceStatusValue(val *DeviceStatusValue) *NullableDeviceStatusValue { + return &NullableDeviceStatusValue{value: val, isSet: true} +} + +func (v NullableDeviceStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type.go new file mode 100644 index 00000000..977877a2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type.go @@ -0,0 +1,1310 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceType{} + +// DeviceType Adds support for custom fields and tags. +type DeviceType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Manufacturer NestedManufacturer `json:"manufacturer"` + DefaultPlatform NullableNestedPlatform `json:"default_platform,omitempty"` + Model string `json:"model"` + Slug string `json:"slug"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + UHeight *float64 `json:"u_height,omitempty"` + // Devices of this type are excluded when calculating rack utilization. + ExcludeFromUtilization *bool `json:"exclude_from_utilization,omitempty"` + // Device consumes both front and rear rack faces. + IsFullDepth *bool `json:"is_full_depth,omitempty"` + SubdeviceRole NullableDeviceTypeSubdeviceRole `json:"subdevice_role,omitempty"` + Airflow NullableDeviceTypeAirflow `json:"airflow,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit NullableDeviceTypeWeightUnit `json:"weight_unit,omitempty"` + FrontImage *string `json:"front_image,omitempty"` + RearImage *string `json:"rear_image,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + DeviceCount int32 `json:"device_count"` + ConsolePortTemplateCount int32 `json:"console_port_template_count"` + ConsoleServerPortTemplateCount int32 `json:"console_server_port_template_count"` + PowerPortTemplateCount int32 `json:"power_port_template_count"` + PowerOutletTemplateCount int32 `json:"power_outlet_template_count"` + InterfaceTemplateCount int32 `json:"interface_template_count"` + FrontPortTemplateCount int32 `json:"front_port_template_count"` + RearPortTemplateCount int32 `json:"rear_port_template_count"` + DeviceBayTemplateCount int32 `json:"device_bay_template_count"` + ModuleBayTemplateCount int32 `json:"module_bay_template_count"` + InventoryItemTemplateCount int32 `json:"inventory_item_template_count"` + AdditionalProperties map[string]interface{} +} + +type _DeviceType DeviceType + +// NewDeviceType instantiates a new DeviceType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceType(id int32, url string, display string, manufacturer NestedManufacturer, model string, slug string, created NullableTime, lastUpdated NullableTime, deviceCount int32, consolePortTemplateCount int32, consoleServerPortTemplateCount int32, powerPortTemplateCount int32, powerOutletTemplateCount int32, interfaceTemplateCount int32, frontPortTemplateCount int32, rearPortTemplateCount int32, deviceBayTemplateCount int32, moduleBayTemplateCount int32, inventoryItemTemplateCount int32) *DeviceType { + this := DeviceType{} + this.Id = id + this.Url = url + this.Display = display + this.Manufacturer = manufacturer + this.Model = model + this.Slug = slug + var uHeight float64 = 1.0 + this.UHeight = &uHeight + this.Created = created + this.LastUpdated = lastUpdated + this.DeviceCount = deviceCount + this.ConsolePortTemplateCount = consolePortTemplateCount + this.ConsoleServerPortTemplateCount = consoleServerPortTemplateCount + this.PowerPortTemplateCount = powerPortTemplateCount + this.PowerOutletTemplateCount = powerOutletTemplateCount + this.InterfaceTemplateCount = interfaceTemplateCount + this.FrontPortTemplateCount = frontPortTemplateCount + this.RearPortTemplateCount = rearPortTemplateCount + this.DeviceBayTemplateCount = deviceBayTemplateCount + this.ModuleBayTemplateCount = moduleBayTemplateCount + this.InventoryItemTemplateCount = inventoryItemTemplateCount + return &this +} + +// NewDeviceTypeWithDefaults instantiates a new DeviceType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceTypeWithDefaults() *DeviceType { + this := DeviceType{} + var uHeight float64 = 1.0 + this.UHeight = &uHeight + return &this +} + +// GetId returns the Id field value +func (o *DeviceType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DeviceType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DeviceType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DeviceType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DeviceType) SetDisplay(v string) { + o.Display = v +} + +// GetManufacturer returns the Manufacturer field value +func (o *DeviceType) GetManufacturer() NestedManufacturer { + if o == nil { + var ret NestedManufacturer + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetManufacturerOk() (*NestedManufacturer, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *DeviceType) SetManufacturer(v NestedManufacturer) { + o.Manufacturer = v +} + +// GetDefaultPlatform returns the DefaultPlatform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceType) GetDefaultPlatform() NestedPlatform { + if o == nil || IsNil(o.DefaultPlatform.Get()) { + var ret NestedPlatform + return ret + } + return *o.DefaultPlatform.Get() +} + +// GetDefaultPlatformOk returns a tuple with the DefaultPlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceType) GetDefaultPlatformOk() (*NestedPlatform, bool) { + if o == nil { + return nil, false + } + return o.DefaultPlatform.Get(), o.DefaultPlatform.IsSet() +} + +// HasDefaultPlatform returns a boolean if a field has been set. +func (o *DeviceType) HasDefaultPlatform() bool { + if o != nil && o.DefaultPlatform.IsSet() { + return true + } + + return false +} + +// SetDefaultPlatform gets a reference to the given NullableNestedPlatform and assigns it to the DefaultPlatform field. +func (o *DeviceType) SetDefaultPlatform(v NestedPlatform) { + o.DefaultPlatform.Set(&v) +} + +// SetDefaultPlatformNil sets the value for DefaultPlatform to be an explicit nil +func (o *DeviceType) SetDefaultPlatformNil() { + o.DefaultPlatform.Set(nil) +} + +// UnsetDefaultPlatform ensures that no value is present for DefaultPlatform, not even an explicit nil +func (o *DeviceType) UnsetDefaultPlatform() { + o.DefaultPlatform.Unset() +} + +// GetModel returns the Model field value +func (o *DeviceType) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *DeviceType) SetModel(v string) { + o.Model = v +} + +// GetSlug returns the Slug field value +func (o *DeviceType) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *DeviceType) SetSlug(v string) { + o.Slug = v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *DeviceType) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *DeviceType) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *DeviceType) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *DeviceType) GetUHeight() float64 { + if o == nil || IsNil(o.UHeight) { + var ret float64 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetUHeightOk() (*float64, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *DeviceType) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given float64 and assigns it to the UHeight field. +func (o *DeviceType) SetUHeight(v float64) { + o.UHeight = &v +} + +// GetExcludeFromUtilization returns the ExcludeFromUtilization field value if set, zero value otherwise. +func (o *DeviceType) GetExcludeFromUtilization() bool { + if o == nil || IsNil(o.ExcludeFromUtilization) { + var ret bool + return ret + } + return *o.ExcludeFromUtilization +} + +// GetExcludeFromUtilizationOk returns a tuple with the ExcludeFromUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetExcludeFromUtilizationOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeFromUtilization) { + return nil, false + } + return o.ExcludeFromUtilization, true +} + +// HasExcludeFromUtilization returns a boolean if a field has been set. +func (o *DeviceType) HasExcludeFromUtilization() bool { + if o != nil && !IsNil(o.ExcludeFromUtilization) { + return true + } + + return false +} + +// SetExcludeFromUtilization gets a reference to the given bool and assigns it to the ExcludeFromUtilization field. +func (o *DeviceType) SetExcludeFromUtilization(v bool) { + o.ExcludeFromUtilization = &v +} + +// GetIsFullDepth returns the IsFullDepth field value if set, zero value otherwise. +func (o *DeviceType) GetIsFullDepth() bool { + if o == nil || IsNil(o.IsFullDepth) { + var ret bool + return ret + } + return *o.IsFullDepth +} + +// GetIsFullDepthOk returns a tuple with the IsFullDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetIsFullDepthOk() (*bool, bool) { + if o == nil || IsNil(o.IsFullDepth) { + return nil, false + } + return o.IsFullDepth, true +} + +// HasIsFullDepth returns a boolean if a field has been set. +func (o *DeviceType) HasIsFullDepth() bool { + if o != nil && !IsNil(o.IsFullDepth) { + return true + } + + return false +} + +// SetIsFullDepth gets a reference to the given bool and assigns it to the IsFullDepth field. +func (o *DeviceType) SetIsFullDepth(v bool) { + o.IsFullDepth = &v +} + +// GetSubdeviceRole returns the SubdeviceRole field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceType) GetSubdeviceRole() DeviceTypeSubdeviceRole { + if o == nil || IsNil(o.SubdeviceRole.Get()) { + var ret DeviceTypeSubdeviceRole + return ret + } + return *o.SubdeviceRole.Get() +} + +// GetSubdeviceRoleOk returns a tuple with the SubdeviceRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceType) GetSubdeviceRoleOk() (*DeviceTypeSubdeviceRole, bool) { + if o == nil { + return nil, false + } + return o.SubdeviceRole.Get(), o.SubdeviceRole.IsSet() +} + +// HasSubdeviceRole returns a boolean if a field has been set. +func (o *DeviceType) HasSubdeviceRole() bool { + if o != nil && o.SubdeviceRole.IsSet() { + return true + } + + return false +} + +// SetSubdeviceRole gets a reference to the given NullableDeviceTypeSubdeviceRole and assigns it to the SubdeviceRole field. +func (o *DeviceType) SetSubdeviceRole(v DeviceTypeSubdeviceRole) { + o.SubdeviceRole.Set(&v) +} + +// SetSubdeviceRoleNil sets the value for SubdeviceRole to be an explicit nil +func (o *DeviceType) SetSubdeviceRoleNil() { + o.SubdeviceRole.Set(nil) +} + +// UnsetSubdeviceRole ensures that no value is present for SubdeviceRole, not even an explicit nil +func (o *DeviceType) UnsetSubdeviceRole() { + o.SubdeviceRole.Unset() +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceType) GetAirflow() DeviceTypeAirflow { + if o == nil || IsNil(o.Airflow.Get()) { + var ret DeviceTypeAirflow + return ret + } + return *o.Airflow.Get() +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceType) GetAirflowOk() (*DeviceTypeAirflow, bool) { + if o == nil { + return nil, false + } + return o.Airflow.Get(), o.Airflow.IsSet() +} + +// HasAirflow returns a boolean if a field has been set. +func (o *DeviceType) HasAirflow() bool { + if o != nil && o.Airflow.IsSet() { + return true + } + + return false +} + +// SetAirflow gets a reference to the given NullableDeviceTypeAirflow and assigns it to the Airflow field. +func (o *DeviceType) SetAirflow(v DeviceTypeAirflow) { + o.Airflow.Set(&v) +} + +// SetAirflowNil sets the value for Airflow to be an explicit nil +func (o *DeviceType) SetAirflowNil() { + o.Airflow.Set(nil) +} + +// UnsetAirflow ensures that no value is present for Airflow, not even an explicit nil +func (o *DeviceType) UnsetAirflow() { + o.Airflow.Unset() +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceType) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceType) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *DeviceType) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *DeviceType) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *DeviceType) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *DeviceType) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceType) GetWeightUnit() DeviceTypeWeightUnit { + if o == nil || IsNil(o.WeightUnit.Get()) { + var ret DeviceTypeWeightUnit + return ret + } + return *o.WeightUnit.Get() +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceType) GetWeightUnitOk() (*DeviceTypeWeightUnit, bool) { + if o == nil { + return nil, false + } + return o.WeightUnit.Get(), o.WeightUnit.IsSet() +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *DeviceType) HasWeightUnit() bool { + if o != nil && o.WeightUnit.IsSet() { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given NullableDeviceTypeWeightUnit and assigns it to the WeightUnit field. +func (o *DeviceType) SetWeightUnit(v DeviceTypeWeightUnit) { + o.WeightUnit.Set(&v) +} + +// SetWeightUnitNil sets the value for WeightUnit to be an explicit nil +func (o *DeviceType) SetWeightUnitNil() { + o.WeightUnit.Set(nil) +} + +// UnsetWeightUnit ensures that no value is present for WeightUnit, not even an explicit nil +func (o *DeviceType) UnsetWeightUnit() { + o.WeightUnit.Unset() +} + +// GetFrontImage returns the FrontImage field value if set, zero value otherwise. +func (o *DeviceType) GetFrontImage() string { + if o == nil || IsNil(o.FrontImage) { + var ret string + return ret + } + return *o.FrontImage +} + +// GetFrontImageOk returns a tuple with the FrontImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetFrontImageOk() (*string, bool) { + if o == nil || IsNil(o.FrontImage) { + return nil, false + } + return o.FrontImage, true +} + +// HasFrontImage returns a boolean if a field has been set. +func (o *DeviceType) HasFrontImage() bool { + if o != nil && !IsNil(o.FrontImage) { + return true + } + + return false +} + +// SetFrontImage gets a reference to the given string and assigns it to the FrontImage field. +func (o *DeviceType) SetFrontImage(v string) { + o.FrontImage = &v +} + +// GetRearImage returns the RearImage field value if set, zero value otherwise. +func (o *DeviceType) GetRearImage() string { + if o == nil || IsNil(o.RearImage) { + var ret string + return ret + } + return *o.RearImage +} + +// GetRearImageOk returns a tuple with the RearImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetRearImageOk() (*string, bool) { + if o == nil || IsNil(o.RearImage) { + return nil, false + } + return o.RearImage, true +} + +// HasRearImage returns a boolean if a field has been set. +func (o *DeviceType) HasRearImage() bool { + if o != nil && !IsNil(o.RearImage) { + return true + } + + return false +} + +// SetRearImage gets a reference to the given string and assigns it to the RearImage field. +func (o *DeviceType) SetRearImage(v string) { + o.RearImage = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceType) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *DeviceType) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *DeviceType) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *DeviceType) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceType) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceType) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *DeviceType) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceType) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceType) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceType) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceType) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceType) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceType) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *DeviceType) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceType) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceType) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *DeviceType) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDeviceCount returns the DeviceCount field value +func (o *DeviceType) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *DeviceType) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetConsolePortTemplateCount returns the ConsolePortTemplateCount field value +func (o *DeviceType) GetConsolePortTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ConsolePortTemplateCount +} + +// GetConsolePortTemplateCountOk returns a tuple with the ConsolePortTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetConsolePortTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ConsolePortTemplateCount, true +} + +// SetConsolePortTemplateCount sets field value +func (o *DeviceType) SetConsolePortTemplateCount(v int32) { + o.ConsolePortTemplateCount = v +} + +// GetConsoleServerPortTemplateCount returns the ConsoleServerPortTemplateCount field value +func (o *DeviceType) GetConsoleServerPortTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ConsoleServerPortTemplateCount +} + +// GetConsoleServerPortTemplateCountOk returns a tuple with the ConsoleServerPortTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetConsoleServerPortTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ConsoleServerPortTemplateCount, true +} + +// SetConsoleServerPortTemplateCount sets field value +func (o *DeviceType) SetConsoleServerPortTemplateCount(v int32) { + o.ConsoleServerPortTemplateCount = v +} + +// GetPowerPortTemplateCount returns the PowerPortTemplateCount field value +func (o *DeviceType) GetPowerPortTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerPortTemplateCount +} + +// GetPowerPortTemplateCountOk returns a tuple with the PowerPortTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetPowerPortTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerPortTemplateCount, true +} + +// SetPowerPortTemplateCount sets field value +func (o *DeviceType) SetPowerPortTemplateCount(v int32) { + o.PowerPortTemplateCount = v +} + +// GetPowerOutletTemplateCount returns the PowerOutletTemplateCount field value +func (o *DeviceType) GetPowerOutletTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerOutletTemplateCount +} + +// GetPowerOutletTemplateCountOk returns a tuple with the PowerOutletTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetPowerOutletTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerOutletTemplateCount, true +} + +// SetPowerOutletTemplateCount sets field value +func (o *DeviceType) SetPowerOutletTemplateCount(v int32) { + o.PowerOutletTemplateCount = v +} + +// GetInterfaceTemplateCount returns the InterfaceTemplateCount field value +func (o *DeviceType) GetInterfaceTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InterfaceTemplateCount +} + +// GetInterfaceTemplateCountOk returns a tuple with the InterfaceTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetInterfaceTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceTemplateCount, true +} + +// SetInterfaceTemplateCount sets field value +func (o *DeviceType) SetInterfaceTemplateCount(v int32) { + o.InterfaceTemplateCount = v +} + +// GetFrontPortTemplateCount returns the FrontPortTemplateCount field value +func (o *DeviceType) GetFrontPortTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.FrontPortTemplateCount +} + +// GetFrontPortTemplateCountOk returns a tuple with the FrontPortTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetFrontPortTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.FrontPortTemplateCount, true +} + +// SetFrontPortTemplateCount sets field value +func (o *DeviceType) SetFrontPortTemplateCount(v int32) { + o.FrontPortTemplateCount = v +} + +// GetRearPortTemplateCount returns the RearPortTemplateCount field value +func (o *DeviceType) GetRearPortTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RearPortTemplateCount +} + +// GetRearPortTemplateCountOk returns a tuple with the RearPortTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetRearPortTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RearPortTemplateCount, true +} + +// SetRearPortTemplateCount sets field value +func (o *DeviceType) SetRearPortTemplateCount(v int32) { + o.RearPortTemplateCount = v +} + +// GetDeviceBayTemplateCount returns the DeviceBayTemplateCount field value +func (o *DeviceType) GetDeviceBayTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceBayTemplateCount +} + +// GetDeviceBayTemplateCountOk returns a tuple with the DeviceBayTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetDeviceBayTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceBayTemplateCount, true +} + +// SetDeviceBayTemplateCount sets field value +func (o *DeviceType) SetDeviceBayTemplateCount(v int32) { + o.DeviceBayTemplateCount = v +} + +// GetModuleBayTemplateCount returns the ModuleBayTemplateCount field value +func (o *DeviceType) GetModuleBayTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ModuleBayTemplateCount +} + +// GetModuleBayTemplateCountOk returns a tuple with the ModuleBayTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetModuleBayTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBayTemplateCount, true +} + +// SetModuleBayTemplateCount sets field value +func (o *DeviceType) SetModuleBayTemplateCount(v int32) { + o.ModuleBayTemplateCount = v +} + +// GetInventoryItemTemplateCount returns the InventoryItemTemplateCount field value +func (o *DeviceType) GetInventoryItemTemplateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InventoryItemTemplateCount +} + +// GetInventoryItemTemplateCountOk returns a tuple with the InventoryItemTemplateCount field value +// and a boolean to check if the value has been set. +func (o *DeviceType) GetInventoryItemTemplateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InventoryItemTemplateCount, true +} + +// SetInventoryItemTemplateCount sets field value +func (o *DeviceType) SetInventoryItemTemplateCount(v int32) { + o.InventoryItemTemplateCount = v +} + +func (o DeviceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["manufacturer"] = o.Manufacturer + if o.DefaultPlatform.IsSet() { + toSerialize["default_platform"] = o.DefaultPlatform.Get() + } + toSerialize["model"] = o.Model + toSerialize["slug"] = o.Slug + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.ExcludeFromUtilization) { + toSerialize["exclude_from_utilization"] = o.ExcludeFromUtilization + } + if !IsNil(o.IsFullDepth) { + toSerialize["is_full_depth"] = o.IsFullDepth + } + if o.SubdeviceRole.IsSet() { + toSerialize["subdevice_role"] = o.SubdeviceRole.Get() + } + if o.Airflow.IsSet() { + toSerialize["airflow"] = o.Airflow.Get() + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.WeightUnit.IsSet() { + toSerialize["weight_unit"] = o.WeightUnit.Get() + } + if !IsNil(o.FrontImage) { + toSerialize["front_image"] = o.FrontImage + } + if !IsNil(o.RearImage) { + toSerialize["rear_image"] = o.RearImage + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["device_count"] = o.DeviceCount + toSerialize["console_port_template_count"] = o.ConsolePortTemplateCount + toSerialize["console_server_port_template_count"] = o.ConsoleServerPortTemplateCount + toSerialize["power_port_template_count"] = o.PowerPortTemplateCount + toSerialize["power_outlet_template_count"] = o.PowerOutletTemplateCount + toSerialize["interface_template_count"] = o.InterfaceTemplateCount + toSerialize["front_port_template_count"] = o.FrontPortTemplateCount + toSerialize["rear_port_template_count"] = o.RearPortTemplateCount + toSerialize["device_bay_template_count"] = o.DeviceBayTemplateCount + toSerialize["module_bay_template_count"] = o.ModuleBayTemplateCount + toSerialize["inventory_item_template_count"] = o.InventoryItemTemplateCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "manufacturer", + "model", + "slug", + "created", + "last_updated", + "device_count", + "console_port_template_count", + "console_server_port_template_count", + "power_port_template_count", + "power_outlet_template_count", + "interface_template_count", + "front_port_template_count", + "rear_port_template_count", + "device_bay_template_count", + "module_bay_template_count", + "inventory_item_template_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceType := _DeviceType{} + + err = json.Unmarshal(data, &varDeviceType) + + if err != nil { + return err + } + + *o = DeviceType(varDeviceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "default_platform") + delete(additionalProperties, "model") + delete(additionalProperties, "slug") + delete(additionalProperties, "part_number") + delete(additionalProperties, "u_height") + delete(additionalProperties, "exclude_from_utilization") + delete(additionalProperties, "is_full_depth") + delete(additionalProperties, "subdevice_role") + delete(additionalProperties, "airflow") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "front_image") + delete(additionalProperties, "rear_image") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "device_count") + delete(additionalProperties, "console_port_template_count") + delete(additionalProperties, "console_server_port_template_count") + delete(additionalProperties, "power_port_template_count") + delete(additionalProperties, "power_outlet_template_count") + delete(additionalProperties, "interface_template_count") + delete(additionalProperties, "front_port_template_count") + delete(additionalProperties, "rear_port_template_count") + delete(additionalProperties, "device_bay_template_count") + delete(additionalProperties, "module_bay_template_count") + delete(additionalProperties, "inventory_item_template_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceType struct { + value *DeviceType + isSet bool +} + +func (v NullableDeviceType) Get() *DeviceType { + return v.value +} + +func (v *NullableDeviceType) Set(val *DeviceType) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceType) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceType(val *DeviceType) *NullableDeviceType { + return &NullableDeviceType{value: val, isSet: true} +} + +func (v NullableDeviceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_airflow.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_airflow.go new file mode 100644 index 00000000..1f244ea7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_airflow.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DeviceTypeAirflow type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceTypeAirflow{} + +// DeviceTypeAirflow struct for DeviceTypeAirflow +type DeviceTypeAirflow struct { + Value *DeviceAirflowValue `json:"value,omitempty"` + Label *DeviceAirflowLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceTypeAirflow DeviceTypeAirflow + +// NewDeviceTypeAirflow instantiates a new DeviceTypeAirflow object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceTypeAirflow() *DeviceTypeAirflow { + this := DeviceTypeAirflow{} + return &this +} + +// NewDeviceTypeAirflowWithDefaults instantiates a new DeviceTypeAirflow object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceTypeAirflowWithDefaults() *DeviceTypeAirflow { + this := DeviceTypeAirflow{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeviceTypeAirflow) GetValue() DeviceAirflowValue { + if o == nil || IsNil(o.Value) { + var ret DeviceAirflowValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeAirflow) GetValueOk() (*DeviceAirflowValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeviceTypeAirflow) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DeviceAirflowValue and assigns it to the Value field. +func (o *DeviceTypeAirflow) SetValue(v DeviceAirflowValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceTypeAirflow) GetLabel() DeviceAirflowLabel { + if o == nil || IsNil(o.Label) { + var ret DeviceAirflowLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeAirflow) GetLabelOk() (*DeviceAirflowLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceTypeAirflow) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DeviceAirflowLabel and assigns it to the Label field. +func (o *DeviceTypeAirflow) SetLabel(v DeviceAirflowLabel) { + o.Label = &v +} + +func (o DeviceTypeAirflow) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceTypeAirflow) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceTypeAirflow) UnmarshalJSON(data []byte) (err error) { + varDeviceTypeAirflow := _DeviceTypeAirflow{} + + err = json.Unmarshal(data, &varDeviceTypeAirflow) + + if err != nil { + return err + } + + *o = DeviceTypeAirflow(varDeviceTypeAirflow) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceTypeAirflow struct { + value *DeviceTypeAirflow + isSet bool +} + +func (v NullableDeviceTypeAirflow) Get() *DeviceTypeAirflow { + return v.value +} + +func (v *NullableDeviceTypeAirflow) Set(val *DeviceTypeAirflow) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeAirflow) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeAirflow) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeAirflow(val *DeviceTypeAirflow) *NullableDeviceTypeAirflow { + return &NullableDeviceTypeAirflow{value: val, isSet: true} +} + +func (v NullableDeviceTypeAirflow) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeAirflow) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request.go new file mode 100644 index 00000000..08c4c41a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request.go @@ -0,0 +1,842 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "os" +) + +// checks if the DeviceTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceTypeRequest{} + +// DeviceTypeRequest Adds support for custom fields and tags. +type DeviceTypeRequest struct { + Manufacturer NestedManufacturerRequest `json:"manufacturer"` + DefaultPlatform NullableNestedPlatformRequest `json:"default_platform,omitempty"` + Model string `json:"model"` + Slug string `json:"slug"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + UHeight *float64 `json:"u_height,omitempty"` + // Devices of this type are excluded when calculating rack utilization. + ExcludeFromUtilization *bool `json:"exclude_from_utilization,omitempty"` + // Device consumes both front and rear rack faces. + IsFullDepth *bool `json:"is_full_depth,omitempty"` + SubdeviceRole NullableDeviceTypeRequestSubdeviceRole `json:"subdevice_role,omitempty"` + Airflow NullableDeviceTypeRequestAirflow `json:"airflow,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit NullableDeviceTypeRequestWeightUnit `json:"weight_unit,omitempty"` + FrontImage **os.File `json:"front_image,omitempty"` + RearImage **os.File `json:"rear_image,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceTypeRequest DeviceTypeRequest + +// NewDeviceTypeRequest instantiates a new DeviceTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceTypeRequest(manufacturer NestedManufacturerRequest, model string, slug string) *DeviceTypeRequest { + this := DeviceTypeRequest{} + this.Manufacturer = manufacturer + this.Model = model + this.Slug = slug + var uHeight float64 = 1.0 + this.UHeight = &uHeight + return &this +} + +// NewDeviceTypeRequestWithDefaults instantiates a new DeviceTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceTypeRequestWithDefaults() *DeviceTypeRequest { + this := DeviceTypeRequest{} + var uHeight float64 = 1.0 + this.UHeight = &uHeight + return &this +} + +// GetManufacturer returns the Manufacturer field value +func (o *DeviceTypeRequest) GetManufacturer() NestedManufacturerRequest { + if o == nil { + var ret NestedManufacturerRequest + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetManufacturerOk() (*NestedManufacturerRequest, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *DeviceTypeRequest) SetManufacturer(v NestedManufacturerRequest) { + o.Manufacturer = v +} + +// GetDefaultPlatform returns the DefaultPlatform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceTypeRequest) GetDefaultPlatform() NestedPlatformRequest { + if o == nil || IsNil(o.DefaultPlatform.Get()) { + var ret NestedPlatformRequest + return ret + } + return *o.DefaultPlatform.Get() +} + +// GetDefaultPlatformOk returns a tuple with the DefaultPlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceTypeRequest) GetDefaultPlatformOk() (*NestedPlatformRequest, bool) { + if o == nil { + return nil, false + } + return o.DefaultPlatform.Get(), o.DefaultPlatform.IsSet() +} + +// HasDefaultPlatform returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasDefaultPlatform() bool { + if o != nil && o.DefaultPlatform.IsSet() { + return true + } + + return false +} + +// SetDefaultPlatform gets a reference to the given NullableNestedPlatformRequest and assigns it to the DefaultPlatform field. +func (o *DeviceTypeRequest) SetDefaultPlatform(v NestedPlatformRequest) { + o.DefaultPlatform.Set(&v) +} + +// SetDefaultPlatformNil sets the value for DefaultPlatform to be an explicit nil +func (o *DeviceTypeRequest) SetDefaultPlatformNil() { + o.DefaultPlatform.Set(nil) +} + +// UnsetDefaultPlatform ensures that no value is present for DefaultPlatform, not even an explicit nil +func (o *DeviceTypeRequest) UnsetDefaultPlatform() { + o.DefaultPlatform.Unset() +} + +// GetModel returns the Model field value +func (o *DeviceTypeRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *DeviceTypeRequest) SetModel(v string) { + o.Model = v +} + +// GetSlug returns the Slug field value +func (o *DeviceTypeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *DeviceTypeRequest) SetSlug(v string) { + o.Slug = v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *DeviceTypeRequest) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetUHeight() float64 { + if o == nil || IsNil(o.UHeight) { + var ret float64 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetUHeightOk() (*float64, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given float64 and assigns it to the UHeight field. +func (o *DeviceTypeRequest) SetUHeight(v float64) { + o.UHeight = &v +} + +// GetExcludeFromUtilization returns the ExcludeFromUtilization field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetExcludeFromUtilization() bool { + if o == nil || IsNil(o.ExcludeFromUtilization) { + var ret bool + return ret + } + return *o.ExcludeFromUtilization +} + +// GetExcludeFromUtilizationOk returns a tuple with the ExcludeFromUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetExcludeFromUtilizationOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeFromUtilization) { + return nil, false + } + return o.ExcludeFromUtilization, true +} + +// HasExcludeFromUtilization returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasExcludeFromUtilization() bool { + if o != nil && !IsNil(o.ExcludeFromUtilization) { + return true + } + + return false +} + +// SetExcludeFromUtilization gets a reference to the given bool and assigns it to the ExcludeFromUtilization field. +func (o *DeviceTypeRequest) SetExcludeFromUtilization(v bool) { + o.ExcludeFromUtilization = &v +} + +// GetIsFullDepth returns the IsFullDepth field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetIsFullDepth() bool { + if o == nil || IsNil(o.IsFullDepth) { + var ret bool + return ret + } + return *o.IsFullDepth +} + +// GetIsFullDepthOk returns a tuple with the IsFullDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetIsFullDepthOk() (*bool, bool) { + if o == nil || IsNil(o.IsFullDepth) { + return nil, false + } + return o.IsFullDepth, true +} + +// HasIsFullDepth returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasIsFullDepth() bool { + if o != nil && !IsNil(o.IsFullDepth) { + return true + } + + return false +} + +// SetIsFullDepth gets a reference to the given bool and assigns it to the IsFullDepth field. +func (o *DeviceTypeRequest) SetIsFullDepth(v bool) { + o.IsFullDepth = &v +} + +// GetSubdeviceRole returns the SubdeviceRole field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceTypeRequest) GetSubdeviceRole() DeviceTypeRequestSubdeviceRole { + if o == nil || IsNil(o.SubdeviceRole.Get()) { + var ret DeviceTypeRequestSubdeviceRole + return ret + } + return *o.SubdeviceRole.Get() +} + +// GetSubdeviceRoleOk returns a tuple with the SubdeviceRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceTypeRequest) GetSubdeviceRoleOk() (*DeviceTypeRequestSubdeviceRole, bool) { + if o == nil { + return nil, false + } + return o.SubdeviceRole.Get(), o.SubdeviceRole.IsSet() +} + +// HasSubdeviceRole returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasSubdeviceRole() bool { + if o != nil && o.SubdeviceRole.IsSet() { + return true + } + + return false +} + +// SetSubdeviceRole gets a reference to the given NullableDeviceTypeRequestSubdeviceRole and assigns it to the SubdeviceRole field. +func (o *DeviceTypeRequest) SetSubdeviceRole(v DeviceTypeRequestSubdeviceRole) { + o.SubdeviceRole.Set(&v) +} + +// SetSubdeviceRoleNil sets the value for SubdeviceRole to be an explicit nil +func (o *DeviceTypeRequest) SetSubdeviceRoleNil() { + o.SubdeviceRole.Set(nil) +} + +// UnsetSubdeviceRole ensures that no value is present for SubdeviceRole, not even an explicit nil +func (o *DeviceTypeRequest) UnsetSubdeviceRole() { + o.SubdeviceRole.Unset() +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceTypeRequest) GetAirflow() DeviceTypeRequestAirflow { + if o == nil || IsNil(o.Airflow.Get()) { + var ret DeviceTypeRequestAirflow + return ret + } + return *o.Airflow.Get() +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceTypeRequest) GetAirflowOk() (*DeviceTypeRequestAirflow, bool) { + if o == nil { + return nil, false + } + return o.Airflow.Get(), o.Airflow.IsSet() +} + +// HasAirflow returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasAirflow() bool { + if o != nil && o.Airflow.IsSet() { + return true + } + + return false +} + +// SetAirflow gets a reference to the given NullableDeviceTypeRequestAirflow and assigns it to the Airflow field. +func (o *DeviceTypeRequest) SetAirflow(v DeviceTypeRequestAirflow) { + o.Airflow.Set(&v) +} + +// SetAirflowNil sets the value for Airflow to be an explicit nil +func (o *DeviceTypeRequest) SetAirflowNil() { + o.Airflow.Set(nil) +} + +// UnsetAirflow ensures that no value is present for Airflow, not even an explicit nil +func (o *DeviceTypeRequest) UnsetAirflow() { + o.Airflow.Unset() +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceTypeRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceTypeRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *DeviceTypeRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *DeviceTypeRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *DeviceTypeRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceTypeRequest) GetWeightUnit() DeviceTypeRequestWeightUnit { + if o == nil || IsNil(o.WeightUnit.Get()) { + var ret DeviceTypeRequestWeightUnit + return ret + } + return *o.WeightUnit.Get() +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceTypeRequest) GetWeightUnitOk() (*DeviceTypeRequestWeightUnit, bool) { + if o == nil { + return nil, false + } + return o.WeightUnit.Get(), o.WeightUnit.IsSet() +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasWeightUnit() bool { + if o != nil && o.WeightUnit.IsSet() { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given NullableDeviceTypeRequestWeightUnit and assigns it to the WeightUnit field. +func (o *DeviceTypeRequest) SetWeightUnit(v DeviceTypeRequestWeightUnit) { + o.WeightUnit.Set(&v) +} + +// SetWeightUnitNil sets the value for WeightUnit to be an explicit nil +func (o *DeviceTypeRequest) SetWeightUnitNil() { + o.WeightUnit.Set(nil) +} + +// UnsetWeightUnit ensures that no value is present for WeightUnit, not even an explicit nil +func (o *DeviceTypeRequest) UnsetWeightUnit() { + o.WeightUnit.Unset() +} + +// GetFrontImage returns the FrontImage field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetFrontImage() *os.File { + if o == nil || IsNil(o.FrontImage) { + var ret *os.File + return ret + } + return *o.FrontImage +} + +// GetFrontImageOk returns a tuple with the FrontImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetFrontImageOk() (**os.File, bool) { + if o == nil || IsNil(o.FrontImage) { + return nil, false + } + return o.FrontImage, true +} + +// HasFrontImage returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasFrontImage() bool { + if o != nil && !IsNil(o.FrontImage) { + return true + } + + return false +} + +// SetFrontImage gets a reference to the given *os.File and assigns it to the FrontImage field. +func (o *DeviceTypeRequest) SetFrontImage(v *os.File) { + o.FrontImage = &v +} + +// GetRearImage returns the RearImage field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetRearImage() *os.File { + if o == nil || IsNil(o.RearImage) { + var ret *os.File + return ret + } + return *o.RearImage +} + +// GetRearImageOk returns a tuple with the RearImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetRearImageOk() (**os.File, bool) { + if o == nil || IsNil(o.RearImage) { + return nil, false + } + return o.RearImage, true +} + +// HasRearImage returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasRearImage() bool { + if o != nil && !IsNil(o.RearImage) { + return true + } + + return false +} + +// SetRearImage gets a reference to the given *os.File and assigns it to the RearImage field. +func (o *DeviceTypeRequest) SetRearImage(v *os.File) { + o.RearImage = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *DeviceTypeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *DeviceTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o DeviceTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["manufacturer"] = o.Manufacturer + if o.DefaultPlatform.IsSet() { + toSerialize["default_platform"] = o.DefaultPlatform.Get() + } + toSerialize["model"] = o.Model + toSerialize["slug"] = o.Slug + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.ExcludeFromUtilization) { + toSerialize["exclude_from_utilization"] = o.ExcludeFromUtilization + } + if !IsNil(o.IsFullDepth) { + toSerialize["is_full_depth"] = o.IsFullDepth + } + if o.SubdeviceRole.IsSet() { + toSerialize["subdevice_role"] = o.SubdeviceRole.Get() + } + if o.Airflow.IsSet() { + toSerialize["airflow"] = o.Airflow.Get() + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.WeightUnit.IsSet() { + toSerialize["weight_unit"] = o.WeightUnit.Get() + } + if !IsNil(o.FrontImage) { + toSerialize["front_image"] = o.FrontImage + } + if !IsNil(o.RearImage) { + toSerialize["rear_image"] = o.RearImage + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "manufacturer", + "model", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceTypeRequest := _DeviceTypeRequest{} + + err = json.Unmarshal(data, &varDeviceTypeRequest) + + if err != nil { + return err + } + + *o = DeviceTypeRequest(varDeviceTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "default_platform") + delete(additionalProperties, "model") + delete(additionalProperties, "slug") + delete(additionalProperties, "part_number") + delete(additionalProperties, "u_height") + delete(additionalProperties, "exclude_from_utilization") + delete(additionalProperties, "is_full_depth") + delete(additionalProperties, "subdevice_role") + delete(additionalProperties, "airflow") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "front_image") + delete(additionalProperties, "rear_image") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceTypeRequest struct { + value *DeviceTypeRequest + isSet bool +} + +func (v NullableDeviceTypeRequest) Get() *DeviceTypeRequest { + return v.value +} + +func (v *NullableDeviceTypeRequest) Set(val *DeviceTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeRequest(val *DeviceTypeRequest) *NullableDeviceTypeRequest { + return &NullableDeviceTypeRequest{value: val, isSet: true} +} + +func (v NullableDeviceTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_airflow.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_airflow.go new file mode 100644 index 00000000..7a37b4c6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_airflow.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceTypeRequestAirflow * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front * `left-to-right` - Left to right * `right-to-left` - Right to left * `side-to-rear` - Side to rear * `passive` - Passive * `mixed` - Mixed +type DeviceTypeRequestAirflow string + +// List of DeviceTypeRequest_airflow +const ( + DEVICETYPEREQUESTAIRFLOW_FRONT_TO_REAR DeviceTypeRequestAirflow = "front-to-rear" + DEVICETYPEREQUESTAIRFLOW_REAR_TO_FRONT DeviceTypeRequestAirflow = "rear-to-front" + DEVICETYPEREQUESTAIRFLOW_LEFT_TO_RIGHT DeviceTypeRequestAirflow = "left-to-right" + DEVICETYPEREQUESTAIRFLOW_RIGHT_TO_LEFT DeviceTypeRequestAirflow = "right-to-left" + DEVICETYPEREQUESTAIRFLOW_SIDE_TO_REAR DeviceTypeRequestAirflow = "side-to-rear" + DEVICETYPEREQUESTAIRFLOW_PASSIVE DeviceTypeRequestAirflow = "passive" + DEVICETYPEREQUESTAIRFLOW_MIXED DeviceTypeRequestAirflow = "mixed" + DEVICETYPEREQUESTAIRFLOW_EMPTY DeviceTypeRequestAirflow = "" +) + +// All allowed values of DeviceTypeRequestAirflow enum +var AllowedDeviceTypeRequestAirflowEnumValues = []DeviceTypeRequestAirflow{ + "front-to-rear", + "rear-to-front", + "left-to-right", + "right-to-left", + "side-to-rear", + "passive", + "mixed", + "", +} + +func (v *DeviceTypeRequestAirflow) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceTypeRequestAirflow(value) + for _, existing := range AllowedDeviceTypeRequestAirflowEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceTypeRequestAirflow", value) +} + +// NewDeviceTypeRequestAirflowFromValue returns a pointer to a valid DeviceTypeRequestAirflow +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceTypeRequestAirflowFromValue(v string) (*DeviceTypeRequestAirflow, error) { + ev := DeviceTypeRequestAirflow(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceTypeRequestAirflow: valid values are %v", v, AllowedDeviceTypeRequestAirflowEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceTypeRequestAirflow) IsValid() bool { + for _, existing := range AllowedDeviceTypeRequestAirflowEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceTypeRequest_airflow value +func (v DeviceTypeRequestAirflow) Ptr() *DeviceTypeRequestAirflow { + return &v +} + +type NullableDeviceTypeRequestAirflow struct { + value *DeviceTypeRequestAirflow + isSet bool +} + +func (v NullableDeviceTypeRequestAirflow) Get() *DeviceTypeRequestAirflow { + return v.value +} + +func (v *NullableDeviceTypeRequestAirflow) Set(val *DeviceTypeRequestAirflow) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeRequestAirflow) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeRequestAirflow) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeRequestAirflow(val *DeviceTypeRequestAirflow) *NullableDeviceTypeRequestAirflow { + return &NullableDeviceTypeRequestAirflow{value: val, isSet: true} +} + +func (v NullableDeviceTypeRequestAirflow) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeRequestAirflow) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_subdevice_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_subdevice_role.go new file mode 100644 index 00000000..d385cd22 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_subdevice_role.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceTypeRequestSubdeviceRole * `parent` - Parent * `child` - Child +type DeviceTypeRequestSubdeviceRole string + +// List of DeviceTypeRequest_subdevice_role +const ( + DEVICETYPEREQUESTSUBDEVICEROLE_PARENT DeviceTypeRequestSubdeviceRole = "parent" + DEVICETYPEREQUESTSUBDEVICEROLE_CHILD DeviceTypeRequestSubdeviceRole = "child" + DEVICETYPEREQUESTSUBDEVICEROLE_EMPTY DeviceTypeRequestSubdeviceRole = "" +) + +// All allowed values of DeviceTypeRequestSubdeviceRole enum +var AllowedDeviceTypeRequestSubdeviceRoleEnumValues = []DeviceTypeRequestSubdeviceRole{ + "parent", + "child", + "", +} + +func (v *DeviceTypeRequestSubdeviceRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceTypeRequestSubdeviceRole(value) + for _, existing := range AllowedDeviceTypeRequestSubdeviceRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceTypeRequestSubdeviceRole", value) +} + +// NewDeviceTypeRequestSubdeviceRoleFromValue returns a pointer to a valid DeviceTypeRequestSubdeviceRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceTypeRequestSubdeviceRoleFromValue(v string) (*DeviceTypeRequestSubdeviceRole, error) { + ev := DeviceTypeRequestSubdeviceRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceTypeRequestSubdeviceRole: valid values are %v", v, AllowedDeviceTypeRequestSubdeviceRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceTypeRequestSubdeviceRole) IsValid() bool { + for _, existing := range AllowedDeviceTypeRequestSubdeviceRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceTypeRequest_subdevice_role value +func (v DeviceTypeRequestSubdeviceRole) Ptr() *DeviceTypeRequestSubdeviceRole { + return &v +} + +type NullableDeviceTypeRequestSubdeviceRole struct { + value *DeviceTypeRequestSubdeviceRole + isSet bool +} + +func (v NullableDeviceTypeRequestSubdeviceRole) Get() *DeviceTypeRequestSubdeviceRole { + return v.value +} + +func (v *NullableDeviceTypeRequestSubdeviceRole) Set(val *DeviceTypeRequestSubdeviceRole) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeRequestSubdeviceRole) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeRequestSubdeviceRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeRequestSubdeviceRole(val *DeviceTypeRequestSubdeviceRole) *NullableDeviceTypeRequestSubdeviceRole { + return &NullableDeviceTypeRequestSubdeviceRole{value: val, isSet: true} +} + +func (v NullableDeviceTypeRequestSubdeviceRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeRequestSubdeviceRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_weight_unit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_weight_unit.go new file mode 100644 index 00000000..29c8ec59 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_request_weight_unit.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceTypeRequestWeightUnit * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces +type DeviceTypeRequestWeightUnit string + +// List of DeviceTypeRequest_weight_unit +const ( + DEVICETYPEREQUESTWEIGHTUNIT_KG DeviceTypeRequestWeightUnit = "kg" + DEVICETYPEREQUESTWEIGHTUNIT_G DeviceTypeRequestWeightUnit = "g" + DEVICETYPEREQUESTWEIGHTUNIT_LB DeviceTypeRequestWeightUnit = "lb" + DEVICETYPEREQUESTWEIGHTUNIT_OZ DeviceTypeRequestWeightUnit = "oz" + DEVICETYPEREQUESTWEIGHTUNIT_EMPTY DeviceTypeRequestWeightUnit = "" +) + +// All allowed values of DeviceTypeRequestWeightUnit enum +var AllowedDeviceTypeRequestWeightUnitEnumValues = []DeviceTypeRequestWeightUnit{ + "kg", + "g", + "lb", + "oz", + "", +} + +func (v *DeviceTypeRequestWeightUnit) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceTypeRequestWeightUnit(value) + for _, existing := range AllowedDeviceTypeRequestWeightUnitEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceTypeRequestWeightUnit", value) +} + +// NewDeviceTypeRequestWeightUnitFromValue returns a pointer to a valid DeviceTypeRequestWeightUnit +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceTypeRequestWeightUnitFromValue(v string) (*DeviceTypeRequestWeightUnit, error) { + ev := DeviceTypeRequestWeightUnit(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceTypeRequestWeightUnit: valid values are %v", v, AllowedDeviceTypeRequestWeightUnitEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceTypeRequestWeightUnit) IsValid() bool { + for _, existing := range AllowedDeviceTypeRequestWeightUnitEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceTypeRequest_weight_unit value +func (v DeviceTypeRequestWeightUnit) Ptr() *DeviceTypeRequestWeightUnit { + return &v +} + +type NullableDeviceTypeRequestWeightUnit struct { + value *DeviceTypeRequestWeightUnit + isSet bool +} + +func (v NullableDeviceTypeRequestWeightUnit) Get() *DeviceTypeRequestWeightUnit { + return v.value +} + +func (v *NullableDeviceTypeRequestWeightUnit) Set(val *DeviceTypeRequestWeightUnit) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeRequestWeightUnit) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeRequestWeightUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeRequestWeightUnit(val *DeviceTypeRequestWeightUnit) *NullableDeviceTypeRequestWeightUnit { + return &NullableDeviceTypeRequestWeightUnit{value: val, isSet: true} +} + +func (v NullableDeviceTypeRequestWeightUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeRequestWeightUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role.go new file mode 100644 index 00000000..0e561442 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DeviceTypeSubdeviceRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceTypeSubdeviceRole{} + +// DeviceTypeSubdeviceRole struct for DeviceTypeSubdeviceRole +type DeviceTypeSubdeviceRole struct { + Value *DeviceTypeSubdeviceRoleValue `json:"value,omitempty"` + Label *DeviceTypeSubdeviceRoleLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceTypeSubdeviceRole DeviceTypeSubdeviceRole + +// NewDeviceTypeSubdeviceRole instantiates a new DeviceTypeSubdeviceRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceTypeSubdeviceRole() *DeviceTypeSubdeviceRole { + this := DeviceTypeSubdeviceRole{} + return &this +} + +// NewDeviceTypeSubdeviceRoleWithDefaults instantiates a new DeviceTypeSubdeviceRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceTypeSubdeviceRoleWithDefaults() *DeviceTypeSubdeviceRole { + this := DeviceTypeSubdeviceRole{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeviceTypeSubdeviceRole) GetValue() DeviceTypeSubdeviceRoleValue { + if o == nil || IsNil(o.Value) { + var ret DeviceTypeSubdeviceRoleValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeSubdeviceRole) GetValueOk() (*DeviceTypeSubdeviceRoleValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeviceTypeSubdeviceRole) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DeviceTypeSubdeviceRoleValue and assigns it to the Value field. +func (o *DeviceTypeSubdeviceRole) SetValue(v DeviceTypeSubdeviceRoleValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceTypeSubdeviceRole) GetLabel() DeviceTypeSubdeviceRoleLabel { + if o == nil || IsNil(o.Label) { + var ret DeviceTypeSubdeviceRoleLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeSubdeviceRole) GetLabelOk() (*DeviceTypeSubdeviceRoleLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceTypeSubdeviceRole) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DeviceTypeSubdeviceRoleLabel and assigns it to the Label field. +func (o *DeviceTypeSubdeviceRole) SetLabel(v DeviceTypeSubdeviceRoleLabel) { + o.Label = &v +} + +func (o DeviceTypeSubdeviceRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceTypeSubdeviceRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceTypeSubdeviceRole) UnmarshalJSON(data []byte) (err error) { + varDeviceTypeSubdeviceRole := _DeviceTypeSubdeviceRole{} + + err = json.Unmarshal(data, &varDeviceTypeSubdeviceRole) + + if err != nil { + return err + } + + *o = DeviceTypeSubdeviceRole(varDeviceTypeSubdeviceRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceTypeSubdeviceRole struct { + value *DeviceTypeSubdeviceRole + isSet bool +} + +func (v NullableDeviceTypeSubdeviceRole) Get() *DeviceTypeSubdeviceRole { + return v.value +} + +func (v *NullableDeviceTypeSubdeviceRole) Set(val *DeviceTypeSubdeviceRole) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeSubdeviceRole) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeSubdeviceRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeSubdeviceRole(val *DeviceTypeSubdeviceRole) *NullableDeviceTypeSubdeviceRole { + return &NullableDeviceTypeSubdeviceRole{value: val, isSet: true} +} + +func (v NullableDeviceTypeSubdeviceRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeSubdeviceRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role_label.go new file mode 100644 index 00000000..9409c393 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceTypeSubdeviceRoleLabel the model 'DeviceTypeSubdeviceRoleLabel' +type DeviceTypeSubdeviceRoleLabel string + +// List of DeviceType_subdevice_role_label +const ( + DEVICETYPESUBDEVICEROLELABEL_PARENT DeviceTypeSubdeviceRoleLabel = "Parent" + DEVICETYPESUBDEVICEROLELABEL_CHILD DeviceTypeSubdeviceRoleLabel = "Child" +) + +// All allowed values of DeviceTypeSubdeviceRoleLabel enum +var AllowedDeviceTypeSubdeviceRoleLabelEnumValues = []DeviceTypeSubdeviceRoleLabel{ + "Parent", + "Child", +} + +func (v *DeviceTypeSubdeviceRoleLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceTypeSubdeviceRoleLabel(value) + for _, existing := range AllowedDeviceTypeSubdeviceRoleLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceTypeSubdeviceRoleLabel", value) +} + +// NewDeviceTypeSubdeviceRoleLabelFromValue returns a pointer to a valid DeviceTypeSubdeviceRoleLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceTypeSubdeviceRoleLabelFromValue(v string) (*DeviceTypeSubdeviceRoleLabel, error) { + ev := DeviceTypeSubdeviceRoleLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceTypeSubdeviceRoleLabel: valid values are %v", v, AllowedDeviceTypeSubdeviceRoleLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceTypeSubdeviceRoleLabel) IsValid() bool { + for _, existing := range AllowedDeviceTypeSubdeviceRoleLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceType_subdevice_role_label value +func (v DeviceTypeSubdeviceRoleLabel) Ptr() *DeviceTypeSubdeviceRoleLabel { + return &v +} + +type NullableDeviceTypeSubdeviceRoleLabel struct { + value *DeviceTypeSubdeviceRoleLabel + isSet bool +} + +func (v NullableDeviceTypeSubdeviceRoleLabel) Get() *DeviceTypeSubdeviceRoleLabel { + return v.value +} + +func (v *NullableDeviceTypeSubdeviceRoleLabel) Set(val *DeviceTypeSubdeviceRoleLabel) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeSubdeviceRoleLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeSubdeviceRoleLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeSubdeviceRoleLabel(val *DeviceTypeSubdeviceRoleLabel) *NullableDeviceTypeSubdeviceRoleLabel { + return &NullableDeviceTypeSubdeviceRoleLabel{value: val, isSet: true} +} + +func (v NullableDeviceTypeSubdeviceRoleLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeSubdeviceRoleLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role_value.go new file mode 100644 index 00000000..5e0f45af --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_subdevice_role_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceTypeSubdeviceRoleValue * `parent` - Parent * `child` - Child +type DeviceTypeSubdeviceRoleValue string + +// List of DeviceType_subdevice_role_value +const ( + DEVICETYPESUBDEVICEROLEVALUE_PARENT DeviceTypeSubdeviceRoleValue = "parent" + DEVICETYPESUBDEVICEROLEVALUE_CHILD DeviceTypeSubdeviceRoleValue = "child" + DEVICETYPESUBDEVICEROLEVALUE_EMPTY DeviceTypeSubdeviceRoleValue = "" +) + +// All allowed values of DeviceTypeSubdeviceRoleValue enum +var AllowedDeviceTypeSubdeviceRoleValueEnumValues = []DeviceTypeSubdeviceRoleValue{ + "parent", + "child", + "", +} + +func (v *DeviceTypeSubdeviceRoleValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceTypeSubdeviceRoleValue(value) + for _, existing := range AllowedDeviceTypeSubdeviceRoleValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceTypeSubdeviceRoleValue", value) +} + +// NewDeviceTypeSubdeviceRoleValueFromValue returns a pointer to a valid DeviceTypeSubdeviceRoleValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceTypeSubdeviceRoleValueFromValue(v string) (*DeviceTypeSubdeviceRoleValue, error) { + ev := DeviceTypeSubdeviceRoleValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceTypeSubdeviceRoleValue: valid values are %v", v, AllowedDeviceTypeSubdeviceRoleValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceTypeSubdeviceRoleValue) IsValid() bool { + for _, existing := range AllowedDeviceTypeSubdeviceRoleValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceType_subdevice_role_value value +func (v DeviceTypeSubdeviceRoleValue) Ptr() *DeviceTypeSubdeviceRoleValue { + return &v +} + +type NullableDeviceTypeSubdeviceRoleValue struct { + value *DeviceTypeSubdeviceRoleValue + isSet bool +} + +func (v NullableDeviceTypeSubdeviceRoleValue) Get() *DeviceTypeSubdeviceRoleValue { + return v.value +} + +func (v *NullableDeviceTypeSubdeviceRoleValue) Set(val *DeviceTypeSubdeviceRoleValue) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeSubdeviceRoleValue) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeSubdeviceRoleValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeSubdeviceRoleValue(val *DeviceTypeSubdeviceRoleValue) *NullableDeviceTypeSubdeviceRoleValue { + return &NullableDeviceTypeSubdeviceRoleValue{value: val, isSet: true} +} + +func (v NullableDeviceTypeSubdeviceRoleValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeSubdeviceRoleValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit.go new file mode 100644 index 00000000..725c4bc5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the DeviceTypeWeightUnit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceTypeWeightUnit{} + +// DeviceTypeWeightUnit struct for DeviceTypeWeightUnit +type DeviceTypeWeightUnit struct { + Value *DeviceTypeWeightUnitValue `json:"value,omitempty"` + Label *DeviceTypeWeightUnitLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceTypeWeightUnit DeviceTypeWeightUnit + +// NewDeviceTypeWeightUnit instantiates a new DeviceTypeWeightUnit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceTypeWeightUnit() *DeviceTypeWeightUnit { + this := DeviceTypeWeightUnit{} + return &this +} + +// NewDeviceTypeWeightUnitWithDefaults instantiates a new DeviceTypeWeightUnit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceTypeWeightUnitWithDefaults() *DeviceTypeWeightUnit { + this := DeviceTypeWeightUnit{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeviceTypeWeightUnit) GetValue() DeviceTypeWeightUnitValue { + if o == nil || IsNil(o.Value) { + var ret DeviceTypeWeightUnitValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeWeightUnit) GetValueOk() (*DeviceTypeWeightUnitValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeviceTypeWeightUnit) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given DeviceTypeWeightUnitValue and assigns it to the Value field. +func (o *DeviceTypeWeightUnit) SetValue(v DeviceTypeWeightUnitValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DeviceTypeWeightUnit) GetLabel() DeviceTypeWeightUnitLabel { + if o == nil || IsNil(o.Label) { + var ret DeviceTypeWeightUnitLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceTypeWeightUnit) GetLabelOk() (*DeviceTypeWeightUnitLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DeviceTypeWeightUnit) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given DeviceTypeWeightUnitLabel and assigns it to the Label field. +func (o *DeviceTypeWeightUnit) SetLabel(v DeviceTypeWeightUnitLabel) { + o.Label = &v +} + +func (o DeviceTypeWeightUnit) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceTypeWeightUnit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceTypeWeightUnit) UnmarshalJSON(data []byte) (err error) { + varDeviceTypeWeightUnit := _DeviceTypeWeightUnit{} + + err = json.Unmarshal(data, &varDeviceTypeWeightUnit) + + if err != nil { + return err + } + + *o = DeviceTypeWeightUnit(varDeviceTypeWeightUnit) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceTypeWeightUnit struct { + value *DeviceTypeWeightUnit + isSet bool +} + +func (v NullableDeviceTypeWeightUnit) Get() *DeviceTypeWeightUnit { + return v.value +} + +func (v *NullableDeviceTypeWeightUnit) Set(val *DeviceTypeWeightUnit) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeWeightUnit) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeWeightUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeWeightUnit(val *DeviceTypeWeightUnit) *NullableDeviceTypeWeightUnit { + return &NullableDeviceTypeWeightUnit{value: val, isSet: true} +} + +func (v NullableDeviceTypeWeightUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeWeightUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit_label.go new file mode 100644 index 00000000..f1c10da7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceTypeWeightUnitLabel the model 'DeviceTypeWeightUnitLabel' +type DeviceTypeWeightUnitLabel string + +// List of DeviceType_weight_unit_label +const ( + DEVICETYPEWEIGHTUNITLABEL_KILOGRAMS DeviceTypeWeightUnitLabel = "Kilograms" + DEVICETYPEWEIGHTUNITLABEL_GRAMS DeviceTypeWeightUnitLabel = "Grams" + DEVICETYPEWEIGHTUNITLABEL_POUNDS DeviceTypeWeightUnitLabel = "Pounds" + DEVICETYPEWEIGHTUNITLABEL_OUNCES DeviceTypeWeightUnitLabel = "Ounces" +) + +// All allowed values of DeviceTypeWeightUnitLabel enum +var AllowedDeviceTypeWeightUnitLabelEnumValues = []DeviceTypeWeightUnitLabel{ + "Kilograms", + "Grams", + "Pounds", + "Ounces", +} + +func (v *DeviceTypeWeightUnitLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceTypeWeightUnitLabel(value) + for _, existing := range AllowedDeviceTypeWeightUnitLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceTypeWeightUnitLabel", value) +} + +// NewDeviceTypeWeightUnitLabelFromValue returns a pointer to a valid DeviceTypeWeightUnitLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceTypeWeightUnitLabelFromValue(v string) (*DeviceTypeWeightUnitLabel, error) { + ev := DeviceTypeWeightUnitLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceTypeWeightUnitLabel: valid values are %v", v, AllowedDeviceTypeWeightUnitLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceTypeWeightUnitLabel) IsValid() bool { + for _, existing := range AllowedDeviceTypeWeightUnitLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceType_weight_unit_label value +func (v DeviceTypeWeightUnitLabel) Ptr() *DeviceTypeWeightUnitLabel { + return &v +} + +type NullableDeviceTypeWeightUnitLabel struct { + value *DeviceTypeWeightUnitLabel + isSet bool +} + +func (v NullableDeviceTypeWeightUnitLabel) Get() *DeviceTypeWeightUnitLabel { + return v.value +} + +func (v *NullableDeviceTypeWeightUnitLabel) Set(val *DeviceTypeWeightUnitLabel) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeWeightUnitLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeWeightUnitLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeWeightUnitLabel(val *DeviceTypeWeightUnitLabel) *NullableDeviceTypeWeightUnitLabel { + return &NullableDeviceTypeWeightUnitLabel{value: val, isSet: true} +} + +func (v NullableDeviceTypeWeightUnitLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeWeightUnitLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit_value.go new file mode 100644 index 00000000..9438fd66 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_type_weight_unit_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// DeviceTypeWeightUnitValue * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces +type DeviceTypeWeightUnitValue string + +// List of DeviceType_weight_unit_value +const ( + DEVICETYPEWEIGHTUNITVALUE_KG DeviceTypeWeightUnitValue = "kg" + DEVICETYPEWEIGHTUNITVALUE_G DeviceTypeWeightUnitValue = "g" + DEVICETYPEWEIGHTUNITVALUE_LB DeviceTypeWeightUnitValue = "lb" + DEVICETYPEWEIGHTUNITVALUE_OZ DeviceTypeWeightUnitValue = "oz" + DEVICETYPEWEIGHTUNITVALUE_EMPTY DeviceTypeWeightUnitValue = "" +) + +// All allowed values of DeviceTypeWeightUnitValue enum +var AllowedDeviceTypeWeightUnitValueEnumValues = []DeviceTypeWeightUnitValue{ + "kg", + "g", + "lb", + "oz", + "", +} + +func (v *DeviceTypeWeightUnitValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceTypeWeightUnitValue(value) + for _, existing := range AllowedDeviceTypeWeightUnitValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceTypeWeightUnitValue", value) +} + +// NewDeviceTypeWeightUnitValueFromValue returns a pointer to a valid DeviceTypeWeightUnitValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceTypeWeightUnitValueFromValue(v string) (*DeviceTypeWeightUnitValue, error) { + ev := DeviceTypeWeightUnitValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceTypeWeightUnitValue: valid values are %v", v, AllowedDeviceTypeWeightUnitValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceTypeWeightUnitValue) IsValid() bool { + for _, existing := range AllowedDeviceTypeWeightUnitValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceType_weight_unit_value value +func (v DeviceTypeWeightUnitValue) Ptr() *DeviceTypeWeightUnitValue { + return &v +} + +type NullableDeviceTypeWeightUnitValue struct { + value *DeviceTypeWeightUnitValue + isSet bool +} + +func (v NullableDeviceTypeWeightUnitValue) Get() *DeviceTypeWeightUnitValue { + return v.value +} + +func (v *NullableDeviceTypeWeightUnitValue) Set(val *DeviceTypeWeightUnitValue) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceTypeWeightUnitValue) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceTypeWeightUnitValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceTypeWeightUnitValue(val *DeviceTypeWeightUnitValue) *NullableDeviceTypeWeightUnitValue { + return &NullableDeviceTypeWeightUnitValue{value: val, isSet: true} +} + +func (v NullableDeviceTypeWeightUnitValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceTypeWeightUnitValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_with_config_context.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_with_config_context.go new file mode 100644 index 00000000..6068e551 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_with_config_context.go @@ -0,0 +1,1944 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceWithConfigContext type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceWithConfigContext{} + +// DeviceWithConfigContext Adds support for custom fields and tags. +type DeviceWithConfigContext struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name NullableString `json:"name,omitempty"` + DeviceType NestedDeviceType `json:"device_type"` + Role NestedDeviceRole `json:"role"` + DeviceRole DeviceDeviceRole `json:"device_role"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Platform NullableNestedPlatform `json:"platform,omitempty"` + // Chassis serial number, assigned by the manufacturer + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Site NestedSite `json:"site"` + Location NullableNestedLocation `json:"location,omitempty"` + Rack NullableNestedRack `json:"rack,omitempty"` + Position NullableFloat64 `json:"position,omitempty"` + Face *DeviceFace `json:"face,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + ParentDevice NullableNestedDevice `json:"parent_device"` + Status *DeviceStatus `json:"status,omitempty"` + Airflow *DeviceAirflow `json:"airflow,omitempty"` + PrimaryIp NullableNestedIPAddress `json:"primary_ip"` + PrimaryIp4 NullableNestedIPAddress `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableNestedIPAddress `json:"primary_ip6,omitempty"` + OobIp NullableNestedIPAddress `json:"oob_ip,omitempty"` + Cluster NullableNestedCluster `json:"cluster,omitempty"` + VirtualChassis NullableNestedVirtualChassis `json:"virtual_chassis,omitempty"` + VcPosition NullableInt32 `json:"vc_position,omitempty"` + // Virtual chassis master election priority + VcPriority NullableInt32 `json:"vc_priority,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ConfigTemplate NullableNestedConfigTemplate `json:"config_template,omitempty"` + ConfigContext interface{} `json:"config_context"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + ConsolePortCount int32 `json:"console_port_count"` + ConsoleServerPortCount int32 `json:"console_server_port_count"` + PowerPortCount int32 `json:"power_port_count"` + PowerOutletCount int32 `json:"power_outlet_count"` + InterfaceCount int32 `json:"interface_count"` + FrontPortCount int32 `json:"front_port_count"` + RearPortCount int32 `json:"rear_port_count"` + DeviceBayCount int32 `json:"device_bay_count"` + ModuleBayCount int32 `json:"module_bay_count"` + InventoryItemCount int32 `json:"inventory_item_count"` + AdditionalProperties map[string]interface{} +} + +type _DeviceWithConfigContext DeviceWithConfigContext + +// NewDeviceWithConfigContext instantiates a new DeviceWithConfigContext object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceWithConfigContext(id int32, url string, display string, deviceType NestedDeviceType, role NestedDeviceRole, deviceRole DeviceDeviceRole, site NestedSite, parentDevice NullableNestedDevice, primaryIp NullableNestedIPAddress, configContext interface{}, created NullableTime, lastUpdated NullableTime, consolePortCount int32, consoleServerPortCount int32, powerPortCount int32, powerOutletCount int32, interfaceCount int32, frontPortCount int32, rearPortCount int32, deviceBayCount int32, moduleBayCount int32, inventoryItemCount int32) *DeviceWithConfigContext { + this := DeviceWithConfigContext{} + this.Id = id + this.Url = url + this.Display = display + this.DeviceType = deviceType + this.Role = role + this.DeviceRole = deviceRole + this.Site = site + this.ParentDevice = parentDevice + this.PrimaryIp = primaryIp + this.ConfigContext = configContext + this.Created = created + this.LastUpdated = lastUpdated + this.ConsolePortCount = consolePortCount + this.ConsoleServerPortCount = consoleServerPortCount + this.PowerPortCount = powerPortCount + this.PowerOutletCount = powerOutletCount + this.InterfaceCount = interfaceCount + this.FrontPortCount = frontPortCount + this.RearPortCount = rearPortCount + this.DeviceBayCount = deviceBayCount + this.ModuleBayCount = moduleBayCount + this.InventoryItemCount = inventoryItemCount + return &this +} + +// NewDeviceWithConfigContextWithDefaults instantiates a new DeviceWithConfigContext object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceWithConfigContextWithDefaults() *DeviceWithConfigContext { + this := DeviceWithConfigContext{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceWithConfigContext) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceWithConfigContext) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *DeviceWithConfigContext) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DeviceWithConfigContext) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *DeviceWithConfigContext) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *DeviceWithConfigContext) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *DeviceWithConfigContext) SetName(v string) { + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *DeviceWithConfigContext) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetName() { + o.Name.Unset() +} + +// GetDeviceType returns the DeviceType field value +func (o *DeviceWithConfigContext) GetDeviceType() NestedDeviceType { + if o == nil { + var ret NestedDeviceType + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *DeviceWithConfigContext) SetDeviceType(v NestedDeviceType) { + o.DeviceType = v +} + +// GetRole returns the Role field value +func (o *DeviceWithConfigContext) GetRole() NestedDeviceRole { + if o == nil { + var ret NestedDeviceRole + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetRoleOk() (*NestedDeviceRole, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *DeviceWithConfigContext) SetRole(v NestedDeviceRole) { + o.Role = v +} + +// GetDeviceRole returns the DeviceRole field value +func (o *DeviceWithConfigContext) GetDeviceRole() DeviceDeviceRole { + if o == nil { + var ret DeviceDeviceRole + return ret + } + + return o.DeviceRole +} + +// GetDeviceRoleOk returns a tuple with the DeviceRole field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetDeviceRoleOk() (*DeviceDeviceRole, bool) { + if o == nil { + return nil, false + } + return &o.DeviceRole, true +} + +// SetDeviceRole sets field value +func (o *DeviceWithConfigContext) SetDeviceRole(v DeviceDeviceRole) { + o.DeviceRole = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *DeviceWithConfigContext) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *DeviceWithConfigContext) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetPlatform() NestedPlatform { + if o == nil || IsNil(o.Platform.Get()) { + var ret NestedPlatform + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetPlatformOk() (*NestedPlatform, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableNestedPlatform and assigns it to the Platform field. +func (o *DeviceWithConfigContext) SetPlatform(v NestedPlatform) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *DeviceWithConfigContext) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetPlatform() { + o.Platform.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *DeviceWithConfigContext) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *DeviceWithConfigContext) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *DeviceWithConfigContext) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetSite returns the Site field value +func (o *DeviceWithConfigContext) GetSite() NestedSite { + if o == nil { + var ret NestedSite + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *DeviceWithConfigContext) SetSite(v NestedSite) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetLocation() NestedLocation { + if o == nil || IsNil(o.Location.Get()) { + var ret NestedLocation + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetLocationOk() (*NestedLocation, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableNestedLocation and assigns it to the Location field. +func (o *DeviceWithConfigContext) SetLocation(v NestedLocation) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *DeviceWithConfigContext) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetLocation() { + o.Location.Unset() +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetRack() NestedRack { + if o == nil || IsNil(o.Rack.Get()) { + var ret NestedRack + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetRackOk() (*NestedRack, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableNestedRack and assigns it to the Rack field. +func (o *DeviceWithConfigContext) SetRack(v NestedRack) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *DeviceWithConfigContext) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetRack() { + o.Rack.Unset() +} + +// GetPosition returns the Position field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetPosition() float64 { + if o == nil || IsNil(o.Position.Get()) { + var ret float64 + return ret + } + return *o.Position.Get() +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetPositionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Position.Get(), o.Position.IsSet() +} + +// HasPosition returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasPosition() bool { + if o != nil && o.Position.IsSet() { + return true + } + + return false +} + +// SetPosition gets a reference to the given NullableFloat64 and assigns it to the Position field. +func (o *DeviceWithConfigContext) SetPosition(v float64) { + o.Position.Set(&v) +} + +// SetPositionNil sets the value for Position to be an explicit nil +func (o *DeviceWithConfigContext) SetPositionNil() { + o.Position.Set(nil) +} + +// UnsetPosition ensures that no value is present for Position, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetPosition() { + o.Position.Unset() +} + +// GetFace returns the Face field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetFace() DeviceFace { + if o == nil || IsNil(o.Face) { + var ret DeviceFace + return ret + } + return *o.Face +} + +// GetFaceOk returns a tuple with the Face field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetFaceOk() (*DeviceFace, bool) { + if o == nil || IsNil(o.Face) { + return nil, false + } + return o.Face, true +} + +// HasFace returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasFace() bool { + if o != nil && !IsNil(o.Face) { + return true + } + + return false +} + +// SetFace gets a reference to the given DeviceFace and assigns it to the Face field. +func (o *DeviceWithConfigContext) SetFace(v DeviceFace) { + o.Face = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *DeviceWithConfigContext) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *DeviceWithConfigContext) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *DeviceWithConfigContext) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *DeviceWithConfigContext) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetParentDevice returns the ParentDevice field value +// If the value is explicit nil, the zero value for NestedDevice will be returned +func (o *DeviceWithConfigContext) GetParentDevice() NestedDevice { + if o == nil || o.ParentDevice.Get() == nil { + var ret NestedDevice + return ret + } + + return *o.ParentDevice.Get() +} + +// GetParentDeviceOk returns a tuple with the ParentDevice field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetParentDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return o.ParentDevice.Get(), o.ParentDevice.IsSet() +} + +// SetParentDevice sets field value +func (o *DeviceWithConfigContext) SetParentDevice(v NestedDevice) { + o.ParentDevice.Set(&v) +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetStatus() DeviceStatus { + if o == nil || IsNil(o.Status) { + var ret DeviceStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetStatusOk() (*DeviceStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given DeviceStatus and assigns it to the Status field. +func (o *DeviceWithConfigContext) SetStatus(v DeviceStatus) { + o.Status = &v +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetAirflow() DeviceAirflow { + if o == nil || IsNil(o.Airflow) { + var ret DeviceAirflow + return ret + } + return *o.Airflow +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetAirflowOk() (*DeviceAirflow, bool) { + if o == nil || IsNil(o.Airflow) { + return nil, false + } + return o.Airflow, true +} + +// HasAirflow returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasAirflow() bool { + if o != nil && !IsNil(o.Airflow) { + return true + } + + return false +} + +// SetAirflow gets a reference to the given DeviceAirflow and assigns it to the Airflow field. +func (o *DeviceWithConfigContext) SetAirflow(v DeviceAirflow) { + o.Airflow = &v +} + +// GetPrimaryIp returns the PrimaryIp field value +// If the value is explicit nil, the zero value for NestedIPAddress will be returned +func (o *DeviceWithConfigContext) GetPrimaryIp() NestedIPAddress { + if o == nil || o.PrimaryIp.Get() == nil { + var ret NestedIPAddress + return ret + } + + return *o.PrimaryIp.Get() +} + +// GetPrimaryIpOk returns a tuple with the PrimaryIp field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetPrimaryIpOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp.Get(), o.PrimaryIp.IsSet() +} + +// SetPrimaryIp sets field value +func (o *DeviceWithConfigContext) SetPrimaryIp(v NestedIPAddress) { + o.PrimaryIp.Set(&v) +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetPrimaryIp4() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetPrimaryIp4Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp4 field. +func (o *DeviceWithConfigContext) SetPrimaryIp4(v NestedIPAddress) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *DeviceWithConfigContext) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetPrimaryIp6() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetPrimaryIp6Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp6 field. +func (o *DeviceWithConfigContext) SetPrimaryIp6(v NestedIPAddress) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *DeviceWithConfigContext) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetOobIp returns the OobIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetOobIp() NestedIPAddress { + if o == nil || IsNil(o.OobIp.Get()) { + var ret NestedIPAddress + return ret + } + return *o.OobIp.Get() +} + +// GetOobIpOk returns a tuple with the OobIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetOobIpOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.OobIp.Get(), o.OobIp.IsSet() +} + +// HasOobIp returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasOobIp() bool { + if o != nil && o.OobIp.IsSet() { + return true + } + + return false +} + +// SetOobIp gets a reference to the given NullableNestedIPAddress and assigns it to the OobIp field. +func (o *DeviceWithConfigContext) SetOobIp(v NestedIPAddress) { + o.OobIp.Set(&v) +} + +// SetOobIpNil sets the value for OobIp to be an explicit nil +func (o *DeviceWithConfigContext) SetOobIpNil() { + o.OobIp.Set(nil) +} + +// UnsetOobIp ensures that no value is present for OobIp, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetOobIp() { + o.OobIp.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetCluster() NestedCluster { + if o == nil || IsNil(o.Cluster.Get()) { + var ret NestedCluster + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetClusterOk() (*NestedCluster, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableNestedCluster and assigns it to the Cluster field. +func (o *DeviceWithConfigContext) SetCluster(v NestedCluster) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *DeviceWithConfigContext) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetCluster() { + o.Cluster.Unset() +} + +// GetVirtualChassis returns the VirtualChassis field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetVirtualChassis() NestedVirtualChassis { + if o == nil || IsNil(o.VirtualChassis.Get()) { + var ret NestedVirtualChassis + return ret + } + return *o.VirtualChassis.Get() +} + +// GetVirtualChassisOk returns a tuple with the VirtualChassis field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetVirtualChassisOk() (*NestedVirtualChassis, bool) { + if o == nil { + return nil, false + } + return o.VirtualChassis.Get(), o.VirtualChassis.IsSet() +} + +// HasVirtualChassis returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasVirtualChassis() bool { + if o != nil && o.VirtualChassis.IsSet() { + return true + } + + return false +} + +// SetVirtualChassis gets a reference to the given NullableNestedVirtualChassis and assigns it to the VirtualChassis field. +func (o *DeviceWithConfigContext) SetVirtualChassis(v NestedVirtualChassis) { + o.VirtualChassis.Set(&v) +} + +// SetVirtualChassisNil sets the value for VirtualChassis to be an explicit nil +func (o *DeviceWithConfigContext) SetVirtualChassisNil() { + o.VirtualChassis.Set(nil) +} + +// UnsetVirtualChassis ensures that no value is present for VirtualChassis, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetVirtualChassis() { + o.VirtualChassis.Unset() +} + +// GetVcPosition returns the VcPosition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetVcPosition() int32 { + if o == nil || IsNil(o.VcPosition.Get()) { + var ret int32 + return ret + } + return *o.VcPosition.Get() +} + +// GetVcPositionOk returns a tuple with the VcPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetVcPositionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPosition.Get(), o.VcPosition.IsSet() +} + +// HasVcPosition returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasVcPosition() bool { + if o != nil && o.VcPosition.IsSet() { + return true + } + + return false +} + +// SetVcPosition gets a reference to the given NullableInt32 and assigns it to the VcPosition field. +func (o *DeviceWithConfigContext) SetVcPosition(v int32) { + o.VcPosition.Set(&v) +} + +// SetVcPositionNil sets the value for VcPosition to be an explicit nil +func (o *DeviceWithConfigContext) SetVcPositionNil() { + o.VcPosition.Set(nil) +} + +// UnsetVcPosition ensures that no value is present for VcPosition, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetVcPosition() { + o.VcPosition.Unset() +} + +// GetVcPriority returns the VcPriority field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetVcPriority() int32 { + if o == nil || IsNil(o.VcPriority.Get()) { + var ret int32 + return ret + } + return *o.VcPriority.Get() +} + +// GetVcPriorityOk returns a tuple with the VcPriority field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetVcPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPriority.Get(), o.VcPriority.IsSet() +} + +// HasVcPriority returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasVcPriority() bool { + if o != nil && o.VcPriority.IsSet() { + return true + } + + return false +} + +// SetVcPriority gets a reference to the given NullableInt32 and assigns it to the VcPriority field. +func (o *DeviceWithConfigContext) SetVcPriority(v int32) { + o.VcPriority.Set(&v) +} + +// SetVcPriorityNil sets the value for VcPriority to be an explicit nil +func (o *DeviceWithConfigContext) SetVcPriorityNil() { + o.VcPriority.Set(nil) +} + +// UnsetVcPriority ensures that no value is present for VcPriority, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetVcPriority() { + o.VcPriority.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceWithConfigContext) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *DeviceWithConfigContext) SetComments(v string) { + o.Comments = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetConfigTemplate() NestedConfigTemplate { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret NestedConfigTemplate + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetConfigTemplateOk() (*NestedConfigTemplate, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableNestedConfigTemplate and assigns it to the ConfigTemplate field. +func (o *DeviceWithConfigContext) SetConfigTemplate(v NestedConfigTemplate) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *DeviceWithConfigContext) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetConfigContext returns the ConfigContext field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *DeviceWithConfigContext) GetConfigContext() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.ConfigContext +} + +// GetConfigContextOk returns a tuple with the ConfigContext field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetConfigContextOk() (*interface{}, bool) { + if o == nil || IsNil(o.ConfigContext) { + return nil, false + } + return &o.ConfigContext, true +} + +// SetConfigContext sets field value +func (o *DeviceWithConfigContext) SetConfigContext(v interface{}) { + o.ConfigContext = v +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContext) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *DeviceWithConfigContext) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *DeviceWithConfigContext) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceWithConfigContext) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceWithConfigContext) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceWithConfigContext) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *DeviceWithConfigContext) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceWithConfigContext) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContext) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *DeviceWithConfigContext) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetConsolePortCount returns the ConsolePortCount field value +func (o *DeviceWithConfigContext) GetConsolePortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ConsolePortCount +} + +// GetConsolePortCountOk returns a tuple with the ConsolePortCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetConsolePortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ConsolePortCount, true +} + +// SetConsolePortCount sets field value +func (o *DeviceWithConfigContext) SetConsolePortCount(v int32) { + o.ConsolePortCount = v +} + +// GetConsoleServerPortCount returns the ConsoleServerPortCount field value +func (o *DeviceWithConfigContext) GetConsoleServerPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ConsoleServerPortCount +} + +// GetConsoleServerPortCountOk returns a tuple with the ConsoleServerPortCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetConsoleServerPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ConsoleServerPortCount, true +} + +// SetConsoleServerPortCount sets field value +func (o *DeviceWithConfigContext) SetConsoleServerPortCount(v int32) { + o.ConsoleServerPortCount = v +} + +// GetPowerPortCount returns the PowerPortCount field value +func (o *DeviceWithConfigContext) GetPowerPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerPortCount +} + +// GetPowerPortCountOk returns a tuple with the PowerPortCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetPowerPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerPortCount, true +} + +// SetPowerPortCount sets field value +func (o *DeviceWithConfigContext) SetPowerPortCount(v int32) { + o.PowerPortCount = v +} + +// GetPowerOutletCount returns the PowerOutletCount field value +func (o *DeviceWithConfigContext) GetPowerOutletCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerOutletCount +} + +// GetPowerOutletCountOk returns a tuple with the PowerOutletCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetPowerOutletCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerOutletCount, true +} + +// SetPowerOutletCount sets field value +func (o *DeviceWithConfigContext) SetPowerOutletCount(v int32) { + o.PowerOutletCount = v +} + +// GetInterfaceCount returns the InterfaceCount field value +func (o *DeviceWithConfigContext) GetInterfaceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InterfaceCount +} + +// GetInterfaceCountOk returns a tuple with the InterfaceCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetInterfaceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceCount, true +} + +// SetInterfaceCount sets field value +func (o *DeviceWithConfigContext) SetInterfaceCount(v int32) { + o.InterfaceCount = v +} + +// GetFrontPortCount returns the FrontPortCount field value +func (o *DeviceWithConfigContext) GetFrontPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.FrontPortCount +} + +// GetFrontPortCountOk returns a tuple with the FrontPortCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetFrontPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.FrontPortCount, true +} + +// SetFrontPortCount sets field value +func (o *DeviceWithConfigContext) SetFrontPortCount(v int32) { + o.FrontPortCount = v +} + +// GetRearPortCount returns the RearPortCount field value +func (o *DeviceWithConfigContext) GetRearPortCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RearPortCount +} + +// GetRearPortCountOk returns a tuple with the RearPortCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetRearPortCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RearPortCount, true +} + +// SetRearPortCount sets field value +func (o *DeviceWithConfigContext) SetRearPortCount(v int32) { + o.RearPortCount = v +} + +// GetDeviceBayCount returns the DeviceBayCount field value +func (o *DeviceWithConfigContext) GetDeviceBayCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceBayCount +} + +// GetDeviceBayCountOk returns a tuple with the DeviceBayCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetDeviceBayCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceBayCount, true +} + +// SetDeviceBayCount sets field value +func (o *DeviceWithConfigContext) SetDeviceBayCount(v int32) { + o.DeviceBayCount = v +} + +// GetModuleBayCount returns the ModuleBayCount field value +func (o *DeviceWithConfigContext) GetModuleBayCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ModuleBayCount +} + +// GetModuleBayCountOk returns a tuple with the ModuleBayCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetModuleBayCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBayCount, true +} + +// SetModuleBayCount sets field value +func (o *DeviceWithConfigContext) SetModuleBayCount(v int32) { + o.ModuleBayCount = v +} + +// GetInventoryItemCount returns the InventoryItemCount field value +func (o *DeviceWithConfigContext) GetInventoryItemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InventoryItemCount +} + +// GetInventoryItemCountOk returns a tuple with the InventoryItemCount field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContext) GetInventoryItemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InventoryItemCount, true +} + +// SetInventoryItemCount sets field value +func (o *DeviceWithConfigContext) SetInventoryItemCount(v int32) { + o.InventoryItemCount = v +} + +func (o DeviceWithConfigContext) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceWithConfigContext) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["device_type"] = o.DeviceType + toSerialize["role"] = o.Role + toSerialize["device_role"] = o.DeviceRole + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + if o.Position.IsSet() { + toSerialize["position"] = o.Position.Get() + } + if !IsNil(o.Face) { + toSerialize["face"] = o.Face + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + toSerialize["parent_device"] = o.ParentDevice.Get() + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Airflow) { + toSerialize["airflow"] = o.Airflow + } + toSerialize["primary_ip"] = o.PrimaryIp.Get() + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.OobIp.IsSet() { + toSerialize["oob_ip"] = o.OobIp.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.VirtualChassis.IsSet() { + toSerialize["virtual_chassis"] = o.VirtualChassis.Get() + } + if o.VcPosition.IsSet() { + toSerialize["vc_position"] = o.VcPosition.Get() + } + if o.VcPriority.IsSet() { + toSerialize["vc_priority"] = o.VcPriority.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if o.ConfigContext != nil { + toSerialize["config_context"] = o.ConfigContext + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["console_port_count"] = o.ConsolePortCount + toSerialize["console_server_port_count"] = o.ConsoleServerPortCount + toSerialize["power_port_count"] = o.PowerPortCount + toSerialize["power_outlet_count"] = o.PowerOutletCount + toSerialize["interface_count"] = o.InterfaceCount + toSerialize["front_port_count"] = o.FrontPortCount + toSerialize["rear_port_count"] = o.RearPortCount + toSerialize["device_bay_count"] = o.DeviceBayCount + toSerialize["module_bay_count"] = o.ModuleBayCount + toSerialize["inventory_item_count"] = o.InventoryItemCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceWithConfigContext) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device_type", + "role", + "device_role", + "site", + "parent_device", + "primary_ip", + "config_context", + "created", + "last_updated", + "console_port_count", + "console_server_port_count", + "power_port_count", + "power_outlet_count", + "interface_count", + "front_port_count", + "rear_port_count", + "device_bay_count", + "module_bay_count", + "inventory_item_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceWithConfigContext := _DeviceWithConfigContext{} + + err = json.Unmarshal(data, &varDeviceWithConfigContext) + + if err != nil { + return err + } + + *o = DeviceWithConfigContext(varDeviceWithConfigContext) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "device_type") + delete(additionalProperties, "role") + delete(additionalProperties, "device_role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "rack") + delete(additionalProperties, "position") + delete(additionalProperties, "face") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "parent_device") + delete(additionalProperties, "status") + delete(additionalProperties, "airflow") + delete(additionalProperties, "primary_ip") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "oob_ip") + delete(additionalProperties, "cluster") + delete(additionalProperties, "virtual_chassis") + delete(additionalProperties, "vc_position") + delete(additionalProperties, "vc_priority") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "config_template") + delete(additionalProperties, "config_context") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "console_port_count") + delete(additionalProperties, "console_server_port_count") + delete(additionalProperties, "power_port_count") + delete(additionalProperties, "power_outlet_count") + delete(additionalProperties, "interface_count") + delete(additionalProperties, "front_port_count") + delete(additionalProperties, "rear_port_count") + delete(additionalProperties, "device_bay_count") + delete(additionalProperties, "module_bay_count") + delete(additionalProperties, "inventory_item_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceWithConfigContext struct { + value *DeviceWithConfigContext + isSet bool +} + +func (v NullableDeviceWithConfigContext) Get() *DeviceWithConfigContext { + return v.value +} + +func (v *NullableDeviceWithConfigContext) Set(val *DeviceWithConfigContext) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceWithConfigContext) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceWithConfigContext) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceWithConfigContext(val *DeviceWithConfigContext) *NullableDeviceWithConfigContext { + return &NullableDeviceWithConfigContext{value: val, isSet: true} +} + +func (v NullableDeviceWithConfigContext) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceWithConfigContext) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_device_with_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_device_with_config_context_request.go new file mode 100644 index 00000000..f811ee87 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_device_with_config_context_request.go @@ -0,0 +1,1380 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceWithConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceWithConfigContextRequest{} + +// DeviceWithConfigContextRequest Adds support for custom fields and tags. +type DeviceWithConfigContextRequest struct { + Name NullableString `json:"name,omitempty"` + DeviceType NestedDeviceTypeRequest `json:"device_type"` + Role NestedDeviceRoleRequest `json:"role"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Platform NullableNestedPlatformRequest `json:"platform,omitempty"` + // Chassis serial number, assigned by the manufacturer + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Site NestedSiteRequest `json:"site"` + Location NullableNestedLocationRequest `json:"location,omitempty"` + Rack NullableNestedRackRequest `json:"rack,omitempty"` + Position NullableFloat64 `json:"position,omitempty"` + Face *DeviceFaceValue `json:"face,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + Status *DeviceStatusValue `json:"status,omitempty"` + Airflow *DeviceAirflowValue `json:"airflow,omitempty"` + PrimaryIp4 NullableNestedIPAddressRequest `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableNestedIPAddressRequest `json:"primary_ip6,omitempty"` + OobIp NullableNestedIPAddressRequest `json:"oob_ip,omitempty"` + Cluster NullableNestedClusterRequest `json:"cluster,omitempty"` + VirtualChassis NullableNestedVirtualChassisRequest `json:"virtual_chassis,omitempty"` + VcPosition NullableInt32 `json:"vc_position,omitempty"` + // Virtual chassis master election priority + VcPriority NullableInt32 `json:"vc_priority,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ConfigTemplate NullableNestedConfigTemplateRequest `json:"config_template,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceWithConfigContextRequest DeviceWithConfigContextRequest + +// NewDeviceWithConfigContextRequest instantiates a new DeviceWithConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceWithConfigContextRequest(deviceType NestedDeviceTypeRequest, role NestedDeviceRoleRequest, site NestedSiteRequest) *DeviceWithConfigContextRequest { + this := DeviceWithConfigContextRequest{} + this.DeviceType = deviceType + this.Role = role + this.Site = site + return &this +} + +// NewDeviceWithConfigContextRequestWithDefaults instantiates a new DeviceWithConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceWithConfigContextRequestWithDefaults() *DeviceWithConfigContextRequest { + this := DeviceWithConfigContextRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *DeviceWithConfigContextRequest) SetName(v string) { + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetName() { + o.Name.Unset() +} + +// GetDeviceType returns the DeviceType field value +func (o *DeviceWithConfigContextRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil { + var ret NestedDeviceTypeRequest + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *DeviceWithConfigContextRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType = v +} + +// GetRole returns the Role field value +func (o *DeviceWithConfigContextRequest) GetRole() NestedDeviceRoleRequest { + if o == nil { + var ret NestedDeviceRoleRequest + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetRoleOk() (*NestedDeviceRoleRequest, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *DeviceWithConfigContextRequest) SetRole(v NestedDeviceRoleRequest) { + o.Role = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *DeviceWithConfigContextRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetPlatform() NestedPlatformRequest { + if o == nil || IsNil(o.Platform.Get()) { + var ret NestedPlatformRequest + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetPlatformOk() (*NestedPlatformRequest, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableNestedPlatformRequest and assigns it to the Platform field. +func (o *DeviceWithConfigContextRequest) SetPlatform(v NestedPlatformRequest) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetPlatform() { + o.Platform.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *DeviceWithConfigContextRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *DeviceWithConfigContextRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetSite returns the Site field value +func (o *DeviceWithConfigContextRequest) GetSite() NestedSiteRequest { + if o == nil { + var ret NestedSiteRequest + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *DeviceWithConfigContextRequest) SetSite(v NestedSiteRequest) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetLocation() NestedLocationRequest { + if o == nil || IsNil(o.Location.Get()) { + var ret NestedLocationRequest + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetLocationOk() (*NestedLocationRequest, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableNestedLocationRequest and assigns it to the Location field. +func (o *DeviceWithConfigContextRequest) SetLocation(v NestedLocationRequest) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetRack() NestedRackRequest { + if o == nil || IsNil(o.Rack.Get()) { + var ret NestedRackRequest + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetRackOk() (*NestedRackRequest, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableNestedRackRequest and assigns it to the Rack field. +func (o *DeviceWithConfigContextRequest) SetRack(v NestedRackRequest) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetRack() { + o.Rack.Unset() +} + +// GetPosition returns the Position field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetPosition() float64 { + if o == nil || IsNil(o.Position.Get()) { + var ret float64 + return ret + } + return *o.Position.Get() +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetPositionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Position.Get(), o.Position.IsSet() +} + +// HasPosition returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasPosition() bool { + if o != nil && o.Position.IsSet() { + return true + } + + return false +} + +// SetPosition gets a reference to the given NullableFloat64 and assigns it to the Position field. +func (o *DeviceWithConfigContextRequest) SetPosition(v float64) { + o.Position.Set(&v) +} + +// SetPositionNil sets the value for Position to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetPositionNil() { + o.Position.Set(nil) +} + +// UnsetPosition ensures that no value is present for Position, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetPosition() { + o.Position.Unset() +} + +// GetFace returns the Face field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetFace() DeviceFaceValue { + if o == nil || IsNil(o.Face) { + var ret DeviceFaceValue + return ret + } + return *o.Face +} + +// GetFaceOk returns a tuple with the Face field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetFaceOk() (*DeviceFaceValue, bool) { + if o == nil || IsNil(o.Face) { + return nil, false + } + return o.Face, true +} + +// HasFace returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasFace() bool { + if o != nil && !IsNil(o.Face) { + return true + } + + return false +} + +// SetFace gets a reference to the given DeviceFaceValue and assigns it to the Face field. +func (o *DeviceWithConfigContextRequest) SetFace(v DeviceFaceValue) { + o.Face = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *DeviceWithConfigContextRequest) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *DeviceWithConfigContextRequest) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetStatus() DeviceStatusValue { + if o == nil || IsNil(o.Status) { + var ret DeviceStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetStatusOk() (*DeviceStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given DeviceStatusValue and assigns it to the Status field. +func (o *DeviceWithConfigContextRequest) SetStatus(v DeviceStatusValue) { + o.Status = &v +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetAirflow() DeviceAirflowValue { + if o == nil || IsNil(o.Airflow) { + var ret DeviceAirflowValue + return ret + } + return *o.Airflow +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetAirflowOk() (*DeviceAirflowValue, bool) { + if o == nil || IsNil(o.Airflow) { + return nil, false + } + return o.Airflow, true +} + +// HasAirflow returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasAirflow() bool { + if o != nil && !IsNil(o.Airflow) { + return true + } + + return false +} + +// SetAirflow gets a reference to the given DeviceAirflowValue and assigns it to the Airflow field. +func (o *DeviceWithConfigContextRequest) SetAirflow(v DeviceAirflowValue) { + o.Airflow = &v +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetPrimaryIp4() NestedIPAddressRequest { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetPrimaryIp4Ok() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableNestedIPAddressRequest and assigns it to the PrimaryIp4 field. +func (o *DeviceWithConfigContextRequest) SetPrimaryIp4(v NestedIPAddressRequest) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetPrimaryIp6() NestedIPAddressRequest { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetPrimaryIp6Ok() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableNestedIPAddressRequest and assigns it to the PrimaryIp6 field. +func (o *DeviceWithConfigContextRequest) SetPrimaryIp6(v NestedIPAddressRequest) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetOobIp returns the OobIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetOobIp() NestedIPAddressRequest { + if o == nil || IsNil(o.OobIp.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.OobIp.Get() +} + +// GetOobIpOk returns a tuple with the OobIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetOobIpOk() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.OobIp.Get(), o.OobIp.IsSet() +} + +// HasOobIp returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasOobIp() bool { + if o != nil && o.OobIp.IsSet() { + return true + } + + return false +} + +// SetOobIp gets a reference to the given NullableNestedIPAddressRequest and assigns it to the OobIp field. +func (o *DeviceWithConfigContextRequest) SetOobIp(v NestedIPAddressRequest) { + o.OobIp.Set(&v) +} + +// SetOobIpNil sets the value for OobIp to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetOobIpNil() { + o.OobIp.Set(nil) +} + +// UnsetOobIp ensures that no value is present for OobIp, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetOobIp() { + o.OobIp.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetCluster() NestedClusterRequest { + if o == nil || IsNil(o.Cluster.Get()) { + var ret NestedClusterRequest + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetClusterOk() (*NestedClusterRequest, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableNestedClusterRequest and assigns it to the Cluster field. +func (o *DeviceWithConfigContextRequest) SetCluster(v NestedClusterRequest) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetCluster() { + o.Cluster.Unset() +} + +// GetVirtualChassis returns the VirtualChassis field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetVirtualChassis() NestedVirtualChassisRequest { + if o == nil || IsNil(o.VirtualChassis.Get()) { + var ret NestedVirtualChassisRequest + return ret + } + return *o.VirtualChassis.Get() +} + +// GetVirtualChassisOk returns a tuple with the VirtualChassis field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetVirtualChassisOk() (*NestedVirtualChassisRequest, bool) { + if o == nil { + return nil, false + } + return o.VirtualChassis.Get(), o.VirtualChassis.IsSet() +} + +// HasVirtualChassis returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasVirtualChassis() bool { + if o != nil && o.VirtualChassis.IsSet() { + return true + } + + return false +} + +// SetVirtualChassis gets a reference to the given NullableNestedVirtualChassisRequest and assigns it to the VirtualChassis field. +func (o *DeviceWithConfigContextRequest) SetVirtualChassis(v NestedVirtualChassisRequest) { + o.VirtualChassis.Set(&v) +} + +// SetVirtualChassisNil sets the value for VirtualChassis to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetVirtualChassisNil() { + o.VirtualChassis.Set(nil) +} + +// UnsetVirtualChassis ensures that no value is present for VirtualChassis, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetVirtualChassis() { + o.VirtualChassis.Unset() +} + +// GetVcPosition returns the VcPosition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetVcPosition() int32 { + if o == nil || IsNil(o.VcPosition.Get()) { + var ret int32 + return ret + } + return *o.VcPosition.Get() +} + +// GetVcPositionOk returns a tuple with the VcPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetVcPositionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPosition.Get(), o.VcPosition.IsSet() +} + +// HasVcPosition returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasVcPosition() bool { + if o != nil && o.VcPosition.IsSet() { + return true + } + + return false +} + +// SetVcPosition gets a reference to the given NullableInt32 and assigns it to the VcPosition field. +func (o *DeviceWithConfigContextRequest) SetVcPosition(v int32) { + o.VcPosition.Set(&v) +} + +// SetVcPositionNil sets the value for VcPosition to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetVcPositionNil() { + o.VcPosition.Set(nil) +} + +// UnsetVcPosition ensures that no value is present for VcPosition, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetVcPosition() { + o.VcPosition.Unset() +} + +// GetVcPriority returns the VcPriority field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetVcPriority() int32 { + if o == nil || IsNil(o.VcPriority.Get()) { + var ret int32 + return ret + } + return *o.VcPriority.Get() +} + +// GetVcPriorityOk returns a tuple with the VcPriority field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetVcPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPriority.Get(), o.VcPriority.IsSet() +} + +// HasVcPriority returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasVcPriority() bool { + if o != nil && o.VcPriority.IsSet() { + return true + } + + return false +} + +// SetVcPriority gets a reference to the given NullableInt32 and assigns it to the VcPriority field. +func (o *DeviceWithConfigContextRequest) SetVcPriority(v int32) { + o.VcPriority.Set(&v) +} + +// SetVcPriorityNil sets the value for VcPriority to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetVcPriorityNil() { + o.VcPriority.Set(nil) +} + +// UnsetVcPriority ensures that no value is present for VcPriority, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetVcPriority() { + o.VcPriority.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceWithConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *DeviceWithConfigContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetConfigTemplate() NestedConfigTemplateRequest { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret NestedConfigTemplateRequest + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetConfigTemplateOk() (*NestedConfigTemplateRequest, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableNestedConfigTemplateRequest and assigns it to the ConfigTemplate field. +func (o *DeviceWithConfigContextRequest) SetConfigTemplate(v NestedConfigTemplateRequest) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *DeviceWithConfigContextRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *DeviceWithConfigContextRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceWithConfigContextRequest) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceWithConfigContextRequest) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *DeviceWithConfigContextRequest) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *DeviceWithConfigContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *DeviceWithConfigContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceWithConfigContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *DeviceWithConfigContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *DeviceWithConfigContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o DeviceWithConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceWithConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["device_type"] = o.DeviceType + toSerialize["role"] = o.Role + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + if o.Position.IsSet() { + toSerialize["position"] = o.Position.Get() + } + if !IsNil(o.Face) { + toSerialize["face"] = o.Face + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Airflow) { + toSerialize["airflow"] = o.Airflow + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.OobIp.IsSet() { + toSerialize["oob_ip"] = o.OobIp.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.VirtualChassis.IsSet() { + toSerialize["virtual_chassis"] = o.VirtualChassis.Get() + } + if o.VcPosition.IsSet() { + toSerialize["vc_position"] = o.VcPosition.Get() + } + if o.VcPriority.IsSet() { + toSerialize["vc_priority"] = o.VcPriority.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceWithConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "role", + "site", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceWithConfigContextRequest := _DeviceWithConfigContextRequest{} + + err = json.Unmarshal(data, &varDeviceWithConfigContextRequest) + + if err != nil { + return err + } + + *o = DeviceWithConfigContextRequest(varDeviceWithConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "device_type") + delete(additionalProperties, "role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "rack") + delete(additionalProperties, "position") + delete(additionalProperties, "face") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "status") + delete(additionalProperties, "airflow") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "oob_ip") + delete(additionalProperties, "cluster") + delete(additionalProperties, "virtual_chassis") + delete(additionalProperties, "vc_position") + delete(additionalProperties, "vc_priority") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "config_template") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceWithConfigContextRequest struct { + value *DeviceWithConfigContextRequest + isSet bool +} + +func (v NullableDeviceWithConfigContextRequest) Get() *DeviceWithConfigContextRequest { + return v.value +} + +func (v *NullableDeviceWithConfigContextRequest) Set(val *DeviceWithConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceWithConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceWithConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceWithConfigContextRequest(val *DeviceWithConfigContextRequest) *NullableDeviceWithConfigContextRequest { + return &NullableDeviceWithConfigContextRequest{value: val, isSet: true} +} + +func (v NullableDeviceWithConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceWithConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_encryption.go b/vendor/github.com/netbox-community/go-netbox/v3/model_encryption.go new file mode 100644 index 00000000..4097d9aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_encryption.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// Encryption * `aes-128-cbc` - 128-bit AES (CBC) * `aes-128-gcm` - 128-bit AES (GCM) * `aes-192-cbc` - 192-bit AES (CBC) * `aes-192-gcm` - 192-bit AES (GCM) * `aes-256-cbc` - 256-bit AES (CBC) * `aes-256-gcm` - 256-bit AES (GCM) * `3des-cbc` - DES +type Encryption string + +// List of Encryption +const ( + ENCRYPTION_AES_128_CBC Encryption = "aes-128-cbc" + ENCRYPTION_AES_128_GCM Encryption = "aes-128-gcm" + ENCRYPTION_AES_192_CBC Encryption = "aes-192-cbc" + ENCRYPTION_AES_192_GCM Encryption = "aes-192-gcm" + ENCRYPTION_AES_256_CBC Encryption = "aes-256-cbc" + ENCRYPTION_AES_256_GCM Encryption = "aes-256-gcm" + ENCRYPTION__3DES_CBC Encryption = "3des-cbc" + ENCRYPTION_EMPTY Encryption = "" +) + +// All allowed values of Encryption enum +var AllowedEncryptionEnumValues = []Encryption{ + "aes-128-cbc", + "aes-128-gcm", + "aes-192-cbc", + "aes-192-gcm", + "aes-256-cbc", + "aes-256-gcm", + "3des-cbc", + "", +} + +func (v *Encryption) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Encryption(value) + for _, existing := range AllowedEncryptionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Encryption", value) +} + +// NewEncryptionFromValue returns a pointer to a valid Encryption +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEncryptionFromValue(v string) (*Encryption, error) { + ev := Encryption(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Encryption: valid values are %v", v, AllowedEncryptionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Encryption) IsValid() bool { + for _, existing := range AllowedEncryptionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Encryption value +func (v Encryption) Ptr() *Encryption { + return &v +} + +type NullableEncryption struct { + value *Encryption + isSet bool +} + +func (v NullableEncryption) Get() *Encryption { + return v.value +} + +func (v *NullableEncryption) Set(val *Encryption) { + v.value = val + v.isSet = true +} + +func (v NullableEncryption) IsSet() bool { + return v.isSet +} + +func (v *NullableEncryption) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEncryption(val *Encryption) *NullableEncryption { + return &NullableEncryption{value: val, isSet: true} +} + +func (v NullableEncryption) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEncryption) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_end.go b/vendor/github.com/netbox-community/go-netbox/v3/model_end.go new file mode 100644 index 00000000..9351d385 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_end.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// End * `A` - A * `B` - B +type End string + +// List of End +const ( + END_A End = "A" + END_B End = "B" +) + +// All allowed values of End enum +var AllowedEndEnumValues = []End{ + "A", + "B", +} + +func (v *End) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := End(value) + for _, existing := range AllowedEndEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid End", value) +} + +// NewEndFromValue returns a pointer to a valid End +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEndFromValue(v string) (*End, error) { + ev := End(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for End: valid values are %v", v, AllowedEndEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v End) IsValid() bool { + for _, existing := range AllowedEndEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to End value +func (v End) Ptr() *End { + return &v +} + +type NullableEnd struct { + value *End + isSet bool +} + +func (v NullableEnd) Get() *End { + return v.value +} + +func (v *NullableEnd) Set(val *End) { + v.value = val + v.isSet = true +} + +func (v NullableEnd) IsSet() bool { + return v.isSet +} + +func (v *NullableEnd) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnd(val *End) *NullableEnd { + return &NullableEnd{value: val, isSet: true} +} + +func (v NullableEnd) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnd) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule.go b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule.go new file mode 100644 index 00000000..57b61fce --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule.go @@ -0,0 +1,857 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EventRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventRule{} + +// EventRule Adds support for custom fields and tags. +type EventRule struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + // Triggers when a matching object is created. + TypeCreate *bool `json:"type_create,omitempty"` + // Triggers when a matching object is updated. + TypeUpdate *bool `json:"type_update,omitempty"` + // Triggers when a matching object is deleted. + TypeDelete *bool `json:"type_delete,omitempty"` + // Triggers when a job for a matching object is started. + TypeJobStart *bool `json:"type_job_start,omitempty"` + // Triggers when a job for a matching object terminates. + TypeJobEnd *bool `json:"type_job_end,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + // A set of conditions which determine whether the event will be generated. + Conditions interface{} `json:"conditions,omitempty"` + ActionType EventRuleActionType `json:"action_type"` + ActionObjectType string `json:"action_object_type"` + ActionObjectId NullableInt64 `json:"action_object_id,omitempty"` + ActionObject map[string]interface{} `json:"action_object"` + Description *string `json:"description,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _EventRule EventRule + +// NewEventRule instantiates a new EventRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventRule(id int32, url string, display string, contentTypes []string, name string, actionType EventRuleActionType, actionObjectType string, actionObject map[string]interface{}, created NullableTime, lastUpdated NullableTime) *EventRule { + this := EventRule{} + this.Id = id + this.Url = url + this.Display = display + this.ContentTypes = contentTypes + this.Name = name + this.ActionType = actionType + this.ActionObjectType = actionObjectType + this.ActionObject = actionObject + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewEventRuleWithDefaults instantiates a new EventRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventRuleWithDefaults() *EventRule { + this := EventRule{} + return &this +} + +// GetId returns the Id field value +func (o *EventRule) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *EventRule) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *EventRule) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *EventRule) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *EventRule) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *EventRule) SetDisplay(v string) { + o.Display = v +} + +// GetContentTypes returns the ContentTypes field value +func (o *EventRule) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *EventRule) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *EventRule) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EventRule) SetName(v string) { + o.Name = v +} + +// GetTypeCreate returns the TypeCreate field value if set, zero value otherwise. +func (o *EventRule) GetTypeCreate() bool { + if o == nil || IsNil(o.TypeCreate) { + var ret bool + return ret + } + return *o.TypeCreate +} + +// GetTypeCreateOk returns a tuple with the TypeCreate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetTypeCreateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeCreate) { + return nil, false + } + return o.TypeCreate, true +} + +// HasTypeCreate returns a boolean if a field has been set. +func (o *EventRule) HasTypeCreate() bool { + if o != nil && !IsNil(o.TypeCreate) { + return true + } + + return false +} + +// SetTypeCreate gets a reference to the given bool and assigns it to the TypeCreate field. +func (o *EventRule) SetTypeCreate(v bool) { + o.TypeCreate = &v +} + +// GetTypeUpdate returns the TypeUpdate field value if set, zero value otherwise. +func (o *EventRule) GetTypeUpdate() bool { + if o == nil || IsNil(o.TypeUpdate) { + var ret bool + return ret + } + return *o.TypeUpdate +} + +// GetTypeUpdateOk returns a tuple with the TypeUpdate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetTypeUpdateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeUpdate) { + return nil, false + } + return o.TypeUpdate, true +} + +// HasTypeUpdate returns a boolean if a field has been set. +func (o *EventRule) HasTypeUpdate() bool { + if o != nil && !IsNil(o.TypeUpdate) { + return true + } + + return false +} + +// SetTypeUpdate gets a reference to the given bool and assigns it to the TypeUpdate field. +func (o *EventRule) SetTypeUpdate(v bool) { + o.TypeUpdate = &v +} + +// GetTypeDelete returns the TypeDelete field value if set, zero value otherwise. +func (o *EventRule) GetTypeDelete() bool { + if o == nil || IsNil(o.TypeDelete) { + var ret bool + return ret + } + return *o.TypeDelete +} + +// GetTypeDeleteOk returns a tuple with the TypeDelete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetTypeDeleteOk() (*bool, bool) { + if o == nil || IsNil(o.TypeDelete) { + return nil, false + } + return o.TypeDelete, true +} + +// HasTypeDelete returns a boolean if a field has been set. +func (o *EventRule) HasTypeDelete() bool { + if o != nil && !IsNil(o.TypeDelete) { + return true + } + + return false +} + +// SetTypeDelete gets a reference to the given bool and assigns it to the TypeDelete field. +func (o *EventRule) SetTypeDelete(v bool) { + o.TypeDelete = &v +} + +// GetTypeJobStart returns the TypeJobStart field value if set, zero value otherwise. +func (o *EventRule) GetTypeJobStart() bool { + if o == nil || IsNil(o.TypeJobStart) { + var ret bool + return ret + } + return *o.TypeJobStart +} + +// GetTypeJobStartOk returns a tuple with the TypeJobStart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetTypeJobStartOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobStart) { + return nil, false + } + return o.TypeJobStart, true +} + +// HasTypeJobStart returns a boolean if a field has been set. +func (o *EventRule) HasTypeJobStart() bool { + if o != nil && !IsNil(o.TypeJobStart) { + return true + } + + return false +} + +// SetTypeJobStart gets a reference to the given bool and assigns it to the TypeJobStart field. +func (o *EventRule) SetTypeJobStart(v bool) { + o.TypeJobStart = &v +} + +// GetTypeJobEnd returns the TypeJobEnd field value if set, zero value otherwise. +func (o *EventRule) GetTypeJobEnd() bool { + if o == nil || IsNil(o.TypeJobEnd) { + var ret bool + return ret + } + return *o.TypeJobEnd +} + +// GetTypeJobEndOk returns a tuple with the TypeJobEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetTypeJobEndOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobEnd) { + return nil, false + } + return o.TypeJobEnd, true +} + +// HasTypeJobEnd returns a boolean if a field has been set. +func (o *EventRule) HasTypeJobEnd() bool { + if o != nil && !IsNil(o.TypeJobEnd) { + return true + } + + return false +} + +// SetTypeJobEnd gets a reference to the given bool and assigns it to the TypeJobEnd field. +func (o *EventRule) SetTypeJobEnd(v bool) { + o.TypeJobEnd = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *EventRule) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *EventRule) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *EventRule) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventRule) GetConditions() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventRule) GetConditionsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return &o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *EventRule) HasConditions() bool { + if o != nil && IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given interface{} and assigns it to the Conditions field. +func (o *EventRule) SetConditions(v interface{}) { + o.Conditions = v +} + +// GetActionType returns the ActionType field value +func (o *EventRule) GetActionType() EventRuleActionType { + if o == nil { + var ret EventRuleActionType + return ret + } + + return o.ActionType +} + +// GetActionTypeOk returns a tuple with the ActionType field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetActionTypeOk() (*EventRuleActionType, bool) { + if o == nil { + return nil, false + } + return &o.ActionType, true +} + +// SetActionType sets field value +func (o *EventRule) SetActionType(v EventRuleActionType) { + o.ActionType = v +} + +// GetActionObjectType returns the ActionObjectType field value +func (o *EventRule) GetActionObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ActionObjectType +} + +// GetActionObjectTypeOk returns a tuple with the ActionObjectType field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetActionObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActionObjectType, true +} + +// SetActionObjectType sets field value +func (o *EventRule) SetActionObjectType(v string) { + o.ActionObjectType = v +} + +// GetActionObjectId returns the ActionObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventRule) GetActionObjectId() int64 { + if o == nil || IsNil(o.ActionObjectId.Get()) { + var ret int64 + return ret + } + return *o.ActionObjectId.Get() +} + +// GetActionObjectIdOk returns a tuple with the ActionObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventRule) GetActionObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ActionObjectId.Get(), o.ActionObjectId.IsSet() +} + +// HasActionObjectId returns a boolean if a field has been set. +func (o *EventRule) HasActionObjectId() bool { + if o != nil && o.ActionObjectId.IsSet() { + return true + } + + return false +} + +// SetActionObjectId gets a reference to the given NullableInt64 and assigns it to the ActionObjectId field. +func (o *EventRule) SetActionObjectId(v int64) { + o.ActionObjectId.Set(&v) +} + +// SetActionObjectIdNil sets the value for ActionObjectId to be an explicit nil +func (o *EventRule) SetActionObjectIdNil() { + o.ActionObjectId.Set(nil) +} + +// UnsetActionObjectId ensures that no value is present for ActionObjectId, not even an explicit nil +func (o *EventRule) UnsetActionObjectId() { + o.ActionObjectId.Unset() +} + +// GetActionObject returns the ActionObject field value +func (o *EventRule) GetActionObject() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.ActionObject +} + +// GetActionObjectOk returns a tuple with the ActionObject field value +// and a boolean to check if the value has been set. +func (o *EventRule) GetActionObjectOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.ActionObject, true +} + +// SetActionObject sets field value +func (o *EventRule) SetActionObject(v map[string]interface{}) { + o.ActionObject = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *EventRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *EventRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *EventRule) SetDescription(v string) { + o.Description = &v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *EventRule) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *EventRule) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *EventRule) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *EventRule) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRule) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *EventRule) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *EventRule) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *EventRule) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventRule) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *EventRule) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *EventRule) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventRule) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *EventRule) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o EventRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.TypeCreate) { + toSerialize["type_create"] = o.TypeCreate + } + if !IsNil(o.TypeUpdate) { + toSerialize["type_update"] = o.TypeUpdate + } + if !IsNil(o.TypeDelete) { + toSerialize["type_delete"] = o.TypeDelete + } + if !IsNil(o.TypeJobStart) { + toSerialize["type_job_start"] = o.TypeJobStart + } + if !IsNil(o.TypeJobEnd) { + toSerialize["type_job_end"] = o.TypeJobEnd + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Conditions != nil { + toSerialize["conditions"] = o.Conditions + } + toSerialize["action_type"] = o.ActionType + toSerialize["action_object_type"] = o.ActionObjectType + if o.ActionObjectId.IsSet() { + toSerialize["action_object_id"] = o.ActionObjectId.Get() + } + toSerialize["action_object"] = o.ActionObject + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "content_types", + "name", + "action_type", + "action_object_type", + "action_object", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventRule := _EventRule{} + + err = json.Unmarshal(data, &varEventRule) + + if err != nil { + return err + } + + *o = EventRule(varEventRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "type_create") + delete(additionalProperties, "type_update") + delete(additionalProperties, "type_delete") + delete(additionalProperties, "type_job_start") + delete(additionalProperties, "type_job_end") + delete(additionalProperties, "enabled") + delete(additionalProperties, "conditions") + delete(additionalProperties, "action_type") + delete(additionalProperties, "action_object_type") + delete(additionalProperties, "action_object_id") + delete(additionalProperties, "action_object") + delete(additionalProperties, "description") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "tags") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventRule struct { + value *EventRule + isSet bool +} + +func (v NullableEventRule) Get() *EventRule { + return v.value +} + +func (v *NullableEventRule) Set(val *EventRule) { + v.value = val + v.isSet = true +} + +func (v NullableEventRule) IsSet() bool { + return v.isSet +} + +func (v *NullableEventRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventRule(val *EventRule) *NullableEventRule { + return &NullableEventRule{value: val, isSet: true} +} + +func (v NullableEventRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type.go new file mode 100644 index 00000000..eac49ebb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the EventRuleActionType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventRuleActionType{} + +// EventRuleActionType struct for EventRuleActionType +type EventRuleActionType struct { + Value *EventRuleActionTypeValue `json:"value,omitempty"` + Label *EventRuleActionTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EventRuleActionType EventRuleActionType + +// NewEventRuleActionType instantiates a new EventRuleActionType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventRuleActionType() *EventRuleActionType { + this := EventRuleActionType{} + return &this +} + +// NewEventRuleActionTypeWithDefaults instantiates a new EventRuleActionType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventRuleActionTypeWithDefaults() *EventRuleActionType { + this := EventRuleActionType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EventRuleActionType) GetValue() EventRuleActionTypeValue { + if o == nil || IsNil(o.Value) { + var ret EventRuleActionTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleActionType) GetValueOk() (*EventRuleActionTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EventRuleActionType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given EventRuleActionTypeValue and assigns it to the Value field. +func (o *EventRuleActionType) SetValue(v EventRuleActionTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *EventRuleActionType) GetLabel() EventRuleActionTypeLabel { + if o == nil || IsNil(o.Label) { + var ret EventRuleActionTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleActionType) GetLabelOk() (*EventRuleActionTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *EventRuleActionType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given EventRuleActionTypeLabel and assigns it to the Label field. +func (o *EventRuleActionType) SetLabel(v EventRuleActionTypeLabel) { + o.Label = &v +} + +func (o EventRuleActionType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventRuleActionType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventRuleActionType) UnmarshalJSON(data []byte) (err error) { + varEventRuleActionType := _EventRuleActionType{} + + err = json.Unmarshal(data, &varEventRuleActionType) + + if err != nil { + return err + } + + *o = EventRuleActionType(varEventRuleActionType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventRuleActionType struct { + value *EventRuleActionType + isSet bool +} + +func (v NullableEventRuleActionType) Get() *EventRuleActionType { + return v.value +} + +func (v *NullableEventRuleActionType) Set(val *EventRuleActionType) { + v.value = val + v.isSet = true +} + +func (v NullableEventRuleActionType) IsSet() bool { + return v.isSet +} + +func (v *NullableEventRuleActionType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventRuleActionType(val *EventRuleActionType) *NullableEventRuleActionType { + return &NullableEventRuleActionType{value: val, isSet: true} +} + +func (v NullableEventRuleActionType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventRuleActionType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type_label.go new file mode 100644 index 00000000..8f6514be --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// EventRuleActionTypeLabel the model 'EventRuleActionTypeLabel' +type EventRuleActionTypeLabel string + +// List of EventRule_action_type_label +const ( + EVENTRULEACTIONTYPELABEL_WEBHOOK EventRuleActionTypeLabel = "Webhook" + EVENTRULEACTIONTYPELABEL_SCRIPT EventRuleActionTypeLabel = "Script" +) + +// All allowed values of EventRuleActionTypeLabel enum +var AllowedEventRuleActionTypeLabelEnumValues = []EventRuleActionTypeLabel{ + "Webhook", + "Script", +} + +func (v *EventRuleActionTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EventRuleActionTypeLabel(value) + for _, existing := range AllowedEventRuleActionTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EventRuleActionTypeLabel", value) +} + +// NewEventRuleActionTypeLabelFromValue returns a pointer to a valid EventRuleActionTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEventRuleActionTypeLabelFromValue(v string) (*EventRuleActionTypeLabel, error) { + ev := EventRuleActionTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EventRuleActionTypeLabel: valid values are %v", v, AllowedEventRuleActionTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EventRuleActionTypeLabel) IsValid() bool { + for _, existing := range AllowedEventRuleActionTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EventRule_action_type_label value +func (v EventRuleActionTypeLabel) Ptr() *EventRuleActionTypeLabel { + return &v +} + +type NullableEventRuleActionTypeLabel struct { + value *EventRuleActionTypeLabel + isSet bool +} + +func (v NullableEventRuleActionTypeLabel) Get() *EventRuleActionTypeLabel { + return v.value +} + +func (v *NullableEventRuleActionTypeLabel) Set(val *EventRuleActionTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableEventRuleActionTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableEventRuleActionTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventRuleActionTypeLabel(val *EventRuleActionTypeLabel) *NullableEventRuleActionTypeLabel { + return &NullableEventRuleActionTypeLabel{value: val, isSet: true} +} + +func (v NullableEventRuleActionTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventRuleActionTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type_value.go new file mode 100644 index 00000000..d1bd49bf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_action_type_value.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// EventRuleActionTypeValue * `webhook` - Webhook * `script` - Script +type EventRuleActionTypeValue string + +// List of EventRule_action_type_value +const ( + EVENTRULEACTIONTYPEVALUE_WEBHOOK EventRuleActionTypeValue = "webhook" + EVENTRULEACTIONTYPEVALUE_SCRIPT EventRuleActionTypeValue = "script" +) + +// All allowed values of EventRuleActionTypeValue enum +var AllowedEventRuleActionTypeValueEnumValues = []EventRuleActionTypeValue{ + "webhook", + "script", +} + +func (v *EventRuleActionTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EventRuleActionTypeValue(value) + for _, existing := range AllowedEventRuleActionTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EventRuleActionTypeValue", value) +} + +// NewEventRuleActionTypeValueFromValue returns a pointer to a valid EventRuleActionTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEventRuleActionTypeValueFromValue(v string) (*EventRuleActionTypeValue, error) { + ev := EventRuleActionTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EventRuleActionTypeValue: valid values are %v", v, AllowedEventRuleActionTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EventRuleActionTypeValue) IsValid() bool { + for _, existing := range AllowedEventRuleActionTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EventRule_action_type_value value +func (v EventRuleActionTypeValue) Ptr() *EventRuleActionTypeValue { + return &v +} + +type NullableEventRuleActionTypeValue struct { + value *EventRuleActionTypeValue + isSet bool +} + +func (v NullableEventRuleActionTypeValue) Get() *EventRuleActionTypeValue { + return v.value +} + +func (v *NullableEventRuleActionTypeValue) Set(val *EventRuleActionTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableEventRuleActionTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableEventRuleActionTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventRuleActionTypeValue(val *EventRuleActionTypeValue) *NullableEventRuleActionTypeValue { + return &NullableEventRuleActionTypeValue{value: val, isSet: true} +} + +func (v NullableEventRuleActionTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventRuleActionTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_request.go new file mode 100644 index 00000000..f41f13a8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_event_rule_request.go @@ -0,0 +1,678 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the EventRuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventRuleRequest{} + +// EventRuleRequest Adds support for custom fields and tags. +type EventRuleRequest struct { + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + // Triggers when a matching object is created. + TypeCreate *bool `json:"type_create,omitempty"` + // Triggers when a matching object is updated. + TypeUpdate *bool `json:"type_update,omitempty"` + // Triggers when a matching object is deleted. + TypeDelete *bool `json:"type_delete,omitempty"` + // Triggers when a job for a matching object is started. + TypeJobStart *bool `json:"type_job_start,omitempty"` + // Triggers when a job for a matching object terminates. + TypeJobEnd *bool `json:"type_job_end,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + // A set of conditions which determine whether the event will be generated. + Conditions interface{} `json:"conditions,omitempty"` + ActionType EventRuleActionTypeValue `json:"action_type"` + ActionObjectType string `json:"action_object_type"` + ActionObjectId NullableInt64 `json:"action_object_id,omitempty"` + Description *string `json:"description,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EventRuleRequest EventRuleRequest + +// NewEventRuleRequest instantiates a new EventRuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventRuleRequest(contentTypes []string, name string, actionType EventRuleActionTypeValue, actionObjectType string) *EventRuleRequest { + this := EventRuleRequest{} + this.ContentTypes = contentTypes + this.Name = name + this.ActionType = actionType + this.ActionObjectType = actionObjectType + return &this +} + +// NewEventRuleRequestWithDefaults instantiates a new EventRuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventRuleRequestWithDefaults() *EventRuleRequest { + this := EventRuleRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *EventRuleRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *EventRuleRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *EventRuleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EventRuleRequest) SetName(v string) { + o.Name = v +} + +// GetTypeCreate returns the TypeCreate field value if set, zero value otherwise. +func (o *EventRuleRequest) GetTypeCreate() bool { + if o == nil || IsNil(o.TypeCreate) { + var ret bool + return ret + } + return *o.TypeCreate +} + +// GetTypeCreateOk returns a tuple with the TypeCreate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetTypeCreateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeCreate) { + return nil, false + } + return o.TypeCreate, true +} + +// HasTypeCreate returns a boolean if a field has been set. +func (o *EventRuleRequest) HasTypeCreate() bool { + if o != nil && !IsNil(o.TypeCreate) { + return true + } + + return false +} + +// SetTypeCreate gets a reference to the given bool and assigns it to the TypeCreate field. +func (o *EventRuleRequest) SetTypeCreate(v bool) { + o.TypeCreate = &v +} + +// GetTypeUpdate returns the TypeUpdate field value if set, zero value otherwise. +func (o *EventRuleRequest) GetTypeUpdate() bool { + if o == nil || IsNil(o.TypeUpdate) { + var ret bool + return ret + } + return *o.TypeUpdate +} + +// GetTypeUpdateOk returns a tuple with the TypeUpdate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetTypeUpdateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeUpdate) { + return nil, false + } + return o.TypeUpdate, true +} + +// HasTypeUpdate returns a boolean if a field has been set. +func (o *EventRuleRequest) HasTypeUpdate() bool { + if o != nil && !IsNil(o.TypeUpdate) { + return true + } + + return false +} + +// SetTypeUpdate gets a reference to the given bool and assigns it to the TypeUpdate field. +func (o *EventRuleRequest) SetTypeUpdate(v bool) { + o.TypeUpdate = &v +} + +// GetTypeDelete returns the TypeDelete field value if set, zero value otherwise. +func (o *EventRuleRequest) GetTypeDelete() bool { + if o == nil || IsNil(o.TypeDelete) { + var ret bool + return ret + } + return *o.TypeDelete +} + +// GetTypeDeleteOk returns a tuple with the TypeDelete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetTypeDeleteOk() (*bool, bool) { + if o == nil || IsNil(o.TypeDelete) { + return nil, false + } + return o.TypeDelete, true +} + +// HasTypeDelete returns a boolean if a field has been set. +func (o *EventRuleRequest) HasTypeDelete() bool { + if o != nil && !IsNil(o.TypeDelete) { + return true + } + + return false +} + +// SetTypeDelete gets a reference to the given bool and assigns it to the TypeDelete field. +func (o *EventRuleRequest) SetTypeDelete(v bool) { + o.TypeDelete = &v +} + +// GetTypeJobStart returns the TypeJobStart field value if set, zero value otherwise. +func (o *EventRuleRequest) GetTypeJobStart() bool { + if o == nil || IsNil(o.TypeJobStart) { + var ret bool + return ret + } + return *o.TypeJobStart +} + +// GetTypeJobStartOk returns a tuple with the TypeJobStart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetTypeJobStartOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobStart) { + return nil, false + } + return o.TypeJobStart, true +} + +// HasTypeJobStart returns a boolean if a field has been set. +func (o *EventRuleRequest) HasTypeJobStart() bool { + if o != nil && !IsNil(o.TypeJobStart) { + return true + } + + return false +} + +// SetTypeJobStart gets a reference to the given bool and assigns it to the TypeJobStart field. +func (o *EventRuleRequest) SetTypeJobStart(v bool) { + o.TypeJobStart = &v +} + +// GetTypeJobEnd returns the TypeJobEnd field value if set, zero value otherwise. +func (o *EventRuleRequest) GetTypeJobEnd() bool { + if o == nil || IsNil(o.TypeJobEnd) { + var ret bool + return ret + } + return *o.TypeJobEnd +} + +// GetTypeJobEndOk returns a tuple with the TypeJobEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetTypeJobEndOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobEnd) { + return nil, false + } + return o.TypeJobEnd, true +} + +// HasTypeJobEnd returns a boolean if a field has been set. +func (o *EventRuleRequest) HasTypeJobEnd() bool { + if o != nil && !IsNil(o.TypeJobEnd) { + return true + } + + return false +} + +// SetTypeJobEnd gets a reference to the given bool and assigns it to the TypeJobEnd field. +func (o *EventRuleRequest) SetTypeJobEnd(v bool) { + o.TypeJobEnd = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *EventRuleRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *EventRuleRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *EventRuleRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventRuleRequest) GetConditions() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventRuleRequest) GetConditionsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return &o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *EventRuleRequest) HasConditions() bool { + if o != nil && IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given interface{} and assigns it to the Conditions field. +func (o *EventRuleRequest) SetConditions(v interface{}) { + o.Conditions = v +} + +// GetActionType returns the ActionType field value +func (o *EventRuleRequest) GetActionType() EventRuleActionTypeValue { + if o == nil { + var ret EventRuleActionTypeValue + return ret + } + + return o.ActionType +} + +// GetActionTypeOk returns a tuple with the ActionType field value +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetActionTypeOk() (*EventRuleActionTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.ActionType, true +} + +// SetActionType sets field value +func (o *EventRuleRequest) SetActionType(v EventRuleActionTypeValue) { + o.ActionType = v +} + +// GetActionObjectType returns the ActionObjectType field value +func (o *EventRuleRequest) GetActionObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ActionObjectType +} + +// GetActionObjectTypeOk returns a tuple with the ActionObjectType field value +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetActionObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActionObjectType, true +} + +// SetActionObjectType sets field value +func (o *EventRuleRequest) SetActionObjectType(v string) { + o.ActionObjectType = v +} + +// GetActionObjectId returns the ActionObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventRuleRequest) GetActionObjectId() int64 { + if o == nil || IsNil(o.ActionObjectId.Get()) { + var ret int64 + return ret + } + return *o.ActionObjectId.Get() +} + +// GetActionObjectIdOk returns a tuple with the ActionObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventRuleRequest) GetActionObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ActionObjectId.Get(), o.ActionObjectId.IsSet() +} + +// HasActionObjectId returns a boolean if a field has been set. +func (o *EventRuleRequest) HasActionObjectId() bool { + if o != nil && o.ActionObjectId.IsSet() { + return true + } + + return false +} + +// SetActionObjectId gets a reference to the given NullableInt64 and assigns it to the ActionObjectId field. +func (o *EventRuleRequest) SetActionObjectId(v int64) { + o.ActionObjectId.Set(&v) +} + +// SetActionObjectIdNil sets the value for ActionObjectId to be an explicit nil +func (o *EventRuleRequest) SetActionObjectIdNil() { + o.ActionObjectId.Set(nil) +} + +// UnsetActionObjectId ensures that no value is present for ActionObjectId, not even an explicit nil +func (o *EventRuleRequest) UnsetActionObjectId() { + o.ActionObjectId.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *EventRuleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *EventRuleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *EventRuleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *EventRuleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *EventRuleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *EventRuleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *EventRuleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRuleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *EventRuleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *EventRuleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o EventRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventRuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.TypeCreate) { + toSerialize["type_create"] = o.TypeCreate + } + if !IsNil(o.TypeUpdate) { + toSerialize["type_update"] = o.TypeUpdate + } + if !IsNil(o.TypeDelete) { + toSerialize["type_delete"] = o.TypeDelete + } + if !IsNil(o.TypeJobStart) { + toSerialize["type_job_start"] = o.TypeJobStart + } + if !IsNil(o.TypeJobEnd) { + toSerialize["type_job_end"] = o.TypeJobEnd + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Conditions != nil { + toSerialize["conditions"] = o.Conditions + } + toSerialize["action_type"] = o.ActionType + toSerialize["action_object_type"] = o.ActionObjectType + if o.ActionObjectId.IsSet() { + toSerialize["action_object_id"] = o.ActionObjectId.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventRuleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "name", + "action_type", + "action_object_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventRuleRequest := _EventRuleRequest{} + + err = json.Unmarshal(data, &varEventRuleRequest) + + if err != nil { + return err + } + + *o = EventRuleRequest(varEventRuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "type_create") + delete(additionalProperties, "type_update") + delete(additionalProperties, "type_delete") + delete(additionalProperties, "type_job_start") + delete(additionalProperties, "type_job_end") + delete(additionalProperties, "enabled") + delete(additionalProperties, "conditions") + delete(additionalProperties, "action_type") + delete(additionalProperties, "action_object_type") + delete(additionalProperties, "action_object_id") + delete(additionalProperties, "description") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventRuleRequest struct { + value *EventRuleRequest + isSet bool +} + +func (v NullableEventRuleRequest) Get() *EventRuleRequest { + return v.value +} + +func (v *NullableEventRuleRequest) Set(val *EventRuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEventRuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEventRuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventRuleRequest(val *EventRuleRequest) *NullableEventRuleRequest { + return &NullableEventRuleRequest{value: val, isSet: true} +} + +func (v NullableEventRuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventRuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_export_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_export_template.go new file mode 100644 index 00000000..a4718466 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_export_template.go @@ -0,0 +1,653 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ExportTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExportTemplate{} + +// ExportTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ExportTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // Jinja2 template code. The list of objects being exported is passed as a context variable named queryset. + TemplateCode string `json:"template_code"` + // Defaults to text/plain; charset=utf-8 + MimeType *string `json:"mime_type,omitempty"` + // Extension to append to the rendered filename + FileExtension *string `json:"file_extension,omitempty"` + // Download file as attachment + AsAttachment *bool `json:"as_attachment,omitempty"` + DataSource *NestedDataSource `json:"data_source,omitempty"` + // Path to remote file (relative to data source root) + DataPath string `json:"data_path"` + DataFile NestedDataFile `json:"data_file"` + DataSynced NullableTime `json:"data_synced"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ExportTemplate ExportTemplate + +// NewExportTemplate instantiates a new ExportTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExportTemplate(id int32, url string, display string, contentTypes []string, name string, templateCode string, dataPath string, dataFile NestedDataFile, dataSynced NullableTime, created NullableTime, lastUpdated NullableTime) *ExportTemplate { + this := ExportTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.ContentTypes = contentTypes + this.Name = name + this.TemplateCode = templateCode + this.DataPath = dataPath + this.DataFile = dataFile + this.DataSynced = dataSynced + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewExportTemplateWithDefaults instantiates a new ExportTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExportTemplateWithDefaults() *ExportTemplate { + this := ExportTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *ExportTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ExportTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ExportTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ExportTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ExportTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ExportTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetContentTypes returns the ContentTypes field value +func (o *ExportTemplate) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *ExportTemplate) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *ExportTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ExportTemplate) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ExportTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ExportTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ExportTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetTemplateCode returns the TemplateCode field value +func (o *ExportTemplate) GetTemplateCode() string { + if o == nil { + var ret string + return ret + } + + return o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetTemplateCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TemplateCode, true +} + +// SetTemplateCode sets field value +func (o *ExportTemplate) SetTemplateCode(v string) { + o.TemplateCode = v +} + +// GetMimeType returns the MimeType field value if set, zero value otherwise. +func (o *ExportTemplate) GetMimeType() string { + if o == nil || IsNil(o.MimeType) { + var ret string + return ret + } + return *o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetMimeTypeOk() (*string, bool) { + if o == nil || IsNil(o.MimeType) { + return nil, false + } + return o.MimeType, true +} + +// HasMimeType returns a boolean if a field has been set. +func (o *ExportTemplate) HasMimeType() bool { + if o != nil && !IsNil(o.MimeType) { + return true + } + + return false +} + +// SetMimeType gets a reference to the given string and assigns it to the MimeType field. +func (o *ExportTemplate) SetMimeType(v string) { + o.MimeType = &v +} + +// GetFileExtension returns the FileExtension field value if set, zero value otherwise. +func (o *ExportTemplate) GetFileExtension() string { + if o == nil || IsNil(o.FileExtension) { + var ret string + return ret + } + return *o.FileExtension +} + +// GetFileExtensionOk returns a tuple with the FileExtension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetFileExtensionOk() (*string, bool) { + if o == nil || IsNil(o.FileExtension) { + return nil, false + } + return o.FileExtension, true +} + +// HasFileExtension returns a boolean if a field has been set. +func (o *ExportTemplate) HasFileExtension() bool { + if o != nil && !IsNil(o.FileExtension) { + return true + } + + return false +} + +// SetFileExtension gets a reference to the given string and assigns it to the FileExtension field. +func (o *ExportTemplate) SetFileExtension(v string) { + o.FileExtension = &v +} + +// GetAsAttachment returns the AsAttachment field value if set, zero value otherwise. +func (o *ExportTemplate) GetAsAttachment() bool { + if o == nil || IsNil(o.AsAttachment) { + var ret bool + return ret + } + return *o.AsAttachment +} + +// GetAsAttachmentOk returns a tuple with the AsAttachment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetAsAttachmentOk() (*bool, bool) { + if o == nil || IsNil(o.AsAttachment) { + return nil, false + } + return o.AsAttachment, true +} + +// HasAsAttachment returns a boolean if a field has been set. +func (o *ExportTemplate) HasAsAttachment() bool { + if o != nil && !IsNil(o.AsAttachment) { + return true + } + + return false +} + +// SetAsAttachment gets a reference to the given bool and assigns it to the AsAttachment field. +func (o *ExportTemplate) SetAsAttachment(v bool) { + o.AsAttachment = &v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise. +func (o *ExportTemplate) GetDataSource() NestedDataSource { + if o == nil || IsNil(o.DataSource) { + var ret NestedDataSource + return ret + } + return *o.DataSource +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetDataSourceOk() (*NestedDataSource, bool) { + if o == nil || IsNil(o.DataSource) { + return nil, false + } + return o.DataSource, true +} + +// HasDataSource returns a boolean if a field has been set. +func (o *ExportTemplate) HasDataSource() bool { + if o != nil && !IsNil(o.DataSource) { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NestedDataSource and assigns it to the DataSource field. +func (o *ExportTemplate) SetDataSource(v NestedDataSource) { + o.DataSource = &v +} + +// GetDataPath returns the DataPath field value +func (o *ExportTemplate) GetDataPath() string { + if o == nil { + var ret string + return ret + } + + return o.DataPath +} + +// GetDataPathOk returns a tuple with the DataPath field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetDataPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DataPath, true +} + +// SetDataPath sets field value +func (o *ExportTemplate) SetDataPath(v string) { + o.DataPath = v +} + +// GetDataFile returns the DataFile field value +func (o *ExportTemplate) GetDataFile() NestedDataFile { + if o == nil { + var ret NestedDataFile + return ret + } + + return o.DataFile +} + +// GetDataFileOk returns a tuple with the DataFile field value +// and a boolean to check if the value has been set. +func (o *ExportTemplate) GetDataFileOk() (*NestedDataFile, bool) { + if o == nil { + return nil, false + } + return &o.DataFile, true +} + +// SetDataFile sets field value +func (o *ExportTemplate) SetDataFile(v NestedDataFile) { + o.DataFile = v +} + +// GetDataSynced returns the DataSynced field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ExportTemplate) GetDataSynced() time.Time { + if o == nil || o.DataSynced.Get() == nil { + var ret time.Time + return ret + } + + return *o.DataSynced.Get() +} + +// GetDataSyncedOk returns a tuple with the DataSynced field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExportTemplate) GetDataSyncedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DataSynced.Get(), o.DataSynced.IsSet() +} + +// SetDataSynced sets field value +func (o *ExportTemplate) SetDataSynced(v time.Time) { + o.DataSynced.Set(&v) +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ExportTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExportTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ExportTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ExportTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExportTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ExportTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ExportTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExportTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["template_code"] = o.TemplateCode + if !IsNil(o.MimeType) { + toSerialize["mime_type"] = o.MimeType + } + if !IsNil(o.FileExtension) { + toSerialize["file_extension"] = o.FileExtension + } + if !IsNil(o.AsAttachment) { + toSerialize["as_attachment"] = o.AsAttachment + } + if !IsNil(o.DataSource) { + toSerialize["data_source"] = o.DataSource + } + toSerialize["data_path"] = o.DataPath + toSerialize["data_file"] = o.DataFile + toSerialize["data_synced"] = o.DataSynced.Get() + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ExportTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "content_types", + "name", + "template_code", + "data_path", + "data_file", + "data_synced", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExportTemplate := _ExportTemplate{} + + err = json.Unmarshal(data, &varExportTemplate) + + if err != nil { + return err + } + + *o = ExportTemplate(varExportTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "template_code") + delete(additionalProperties, "mime_type") + delete(additionalProperties, "file_extension") + delete(additionalProperties, "as_attachment") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data_path") + delete(additionalProperties, "data_file") + delete(additionalProperties, "data_synced") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableExportTemplate struct { + value *ExportTemplate + isSet bool +} + +func (v NullableExportTemplate) Get() *ExportTemplate { + return v.value +} + +func (v *NullableExportTemplate) Set(val *ExportTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableExportTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableExportTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExportTemplate(val *ExportTemplate) *NullableExportTemplate { + return &NullableExportTemplate{value: val, isSet: true} +} + +func (v NullableExportTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExportTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_export_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_export_template_request.go new file mode 100644 index 00000000..a8f2029f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_export_template_request.go @@ -0,0 +1,413 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ExportTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExportTemplateRequest{} + +// ExportTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ExportTemplateRequest struct { + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // Jinja2 template code. The list of objects being exported is passed as a context variable named queryset. + TemplateCode string `json:"template_code"` + // Defaults to text/plain; charset=utf-8 + MimeType *string `json:"mime_type,omitempty"` + // Extension to append to the rendered filename + FileExtension *string `json:"file_extension,omitempty"` + // Download file as attachment + AsAttachment *bool `json:"as_attachment,omitempty"` + DataSource *NestedDataSourceRequest `json:"data_source,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ExportTemplateRequest ExportTemplateRequest + +// NewExportTemplateRequest instantiates a new ExportTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExportTemplateRequest(contentTypes []string, name string, templateCode string) *ExportTemplateRequest { + this := ExportTemplateRequest{} + this.ContentTypes = contentTypes + this.Name = name + this.TemplateCode = templateCode + return &this +} + +// NewExportTemplateRequestWithDefaults instantiates a new ExportTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExportTemplateRequestWithDefaults() *ExportTemplateRequest { + this := ExportTemplateRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *ExportTemplateRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *ExportTemplateRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *ExportTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ExportTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ExportTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ExportTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ExportTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTemplateCode returns the TemplateCode field value +func (o *ExportTemplateRequest) GetTemplateCode() string { + if o == nil { + var ret string + return ret + } + + return o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetTemplateCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TemplateCode, true +} + +// SetTemplateCode sets field value +func (o *ExportTemplateRequest) SetTemplateCode(v string) { + o.TemplateCode = v +} + +// GetMimeType returns the MimeType field value if set, zero value otherwise. +func (o *ExportTemplateRequest) GetMimeType() string { + if o == nil || IsNil(o.MimeType) { + var ret string + return ret + } + return *o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetMimeTypeOk() (*string, bool) { + if o == nil || IsNil(o.MimeType) { + return nil, false + } + return o.MimeType, true +} + +// HasMimeType returns a boolean if a field has been set. +func (o *ExportTemplateRequest) HasMimeType() bool { + if o != nil && !IsNil(o.MimeType) { + return true + } + + return false +} + +// SetMimeType gets a reference to the given string and assigns it to the MimeType field. +func (o *ExportTemplateRequest) SetMimeType(v string) { + o.MimeType = &v +} + +// GetFileExtension returns the FileExtension field value if set, zero value otherwise. +func (o *ExportTemplateRequest) GetFileExtension() string { + if o == nil || IsNil(o.FileExtension) { + var ret string + return ret + } + return *o.FileExtension +} + +// GetFileExtensionOk returns a tuple with the FileExtension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetFileExtensionOk() (*string, bool) { + if o == nil || IsNil(o.FileExtension) { + return nil, false + } + return o.FileExtension, true +} + +// HasFileExtension returns a boolean if a field has been set. +func (o *ExportTemplateRequest) HasFileExtension() bool { + if o != nil && !IsNil(o.FileExtension) { + return true + } + + return false +} + +// SetFileExtension gets a reference to the given string and assigns it to the FileExtension field. +func (o *ExportTemplateRequest) SetFileExtension(v string) { + o.FileExtension = &v +} + +// GetAsAttachment returns the AsAttachment field value if set, zero value otherwise. +func (o *ExportTemplateRequest) GetAsAttachment() bool { + if o == nil || IsNil(o.AsAttachment) { + var ret bool + return ret + } + return *o.AsAttachment +} + +// GetAsAttachmentOk returns a tuple with the AsAttachment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetAsAttachmentOk() (*bool, bool) { + if o == nil || IsNil(o.AsAttachment) { + return nil, false + } + return o.AsAttachment, true +} + +// HasAsAttachment returns a boolean if a field has been set. +func (o *ExportTemplateRequest) HasAsAttachment() bool { + if o != nil && !IsNil(o.AsAttachment) { + return true + } + + return false +} + +// SetAsAttachment gets a reference to the given bool and assigns it to the AsAttachment field. +func (o *ExportTemplateRequest) SetAsAttachment(v bool) { + o.AsAttachment = &v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise. +func (o *ExportTemplateRequest) GetDataSource() NestedDataSourceRequest { + if o == nil || IsNil(o.DataSource) { + var ret NestedDataSourceRequest + return ret + } + return *o.DataSource +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExportTemplateRequest) GetDataSourceOk() (*NestedDataSourceRequest, bool) { + if o == nil || IsNil(o.DataSource) { + return nil, false + } + return o.DataSource, true +} + +// HasDataSource returns a boolean if a field has been set. +func (o *ExportTemplateRequest) HasDataSource() bool { + if o != nil && !IsNil(o.DataSource) { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NestedDataSourceRequest and assigns it to the DataSource field. +func (o *ExportTemplateRequest) SetDataSource(v NestedDataSourceRequest) { + o.DataSource = &v +} + +func (o ExportTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExportTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["template_code"] = o.TemplateCode + if !IsNil(o.MimeType) { + toSerialize["mime_type"] = o.MimeType + } + if !IsNil(o.FileExtension) { + toSerialize["file_extension"] = o.FileExtension + } + if !IsNil(o.AsAttachment) { + toSerialize["as_attachment"] = o.AsAttachment + } + if !IsNil(o.DataSource) { + toSerialize["data_source"] = o.DataSource + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ExportTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "name", + "template_code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExportTemplateRequest := _ExportTemplateRequest{} + + err = json.Unmarshal(data, &varExportTemplateRequest) + + if err != nil { + return err + } + + *o = ExportTemplateRequest(varExportTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "template_code") + delete(additionalProperties, "mime_type") + delete(additionalProperties, "file_extension") + delete(additionalProperties, "as_attachment") + delete(additionalProperties, "data_source") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableExportTemplateRequest struct { + value *ExportTemplateRequest + isSet bool +} + +func (v NullableExportTemplateRequest) Get() *ExportTemplateRequest { + return v.value +} + +func (v *NullableExportTemplateRequest) Set(val *ExportTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableExportTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableExportTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExportTemplateRequest(val *ExportTemplateRequest) *NullableExportTemplateRequest { + return &NullableExportTemplateRequest{value: val, isSet: true} +} + +func (v NullableExportTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExportTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group.go new file mode 100644 index 00000000..23db4fd6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group.go @@ -0,0 +1,633 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the FHRPGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FHRPGroup{} + +// FHRPGroup Adds support for custom fields and tags. +type FHRPGroup struct { + Id int32 `json:"id"` + Name *string `json:"name,omitempty"` + Url string `json:"url"` + Display string `json:"display"` + Protocol FHRPGroupProtocol `json:"protocol"` + GroupId int32 `json:"group_id"` + AuthType *AuthenticationType `json:"auth_type,omitempty"` + AuthKey *string `json:"auth_key,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + IpAddresses []NestedIPAddress `json:"ip_addresses"` + AdditionalProperties map[string]interface{} +} + +type _FHRPGroup FHRPGroup + +// NewFHRPGroup instantiates a new FHRPGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFHRPGroup(id int32, url string, display string, protocol FHRPGroupProtocol, groupId int32, created NullableTime, lastUpdated NullableTime, ipAddresses []NestedIPAddress) *FHRPGroup { + this := FHRPGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Protocol = protocol + this.GroupId = groupId + this.Created = created + this.LastUpdated = lastUpdated + this.IpAddresses = ipAddresses + return &this +} + +// NewFHRPGroupWithDefaults instantiates a new FHRPGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFHRPGroupWithDefaults() *FHRPGroup { + this := FHRPGroup{} + return &this +} + +// GetId returns the Id field value +func (o *FHRPGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *FHRPGroup) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *FHRPGroup) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *FHRPGroup) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *FHRPGroup) SetName(v string) { + o.Name = &v +} + +// GetUrl returns the Url field value +func (o *FHRPGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FHRPGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *FHRPGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *FHRPGroup) SetDisplay(v string) { + o.Display = v +} + +// GetProtocol returns the Protocol field value +func (o *FHRPGroup) GetProtocol() FHRPGroupProtocol { + if o == nil { + var ret FHRPGroupProtocol + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetProtocolOk() (*FHRPGroupProtocol, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *FHRPGroup) SetProtocol(v FHRPGroupProtocol) { + o.Protocol = v +} + +// GetGroupId returns the GroupId field value +func (o *FHRPGroup) GetGroupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetGroupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *FHRPGroup) SetGroupId(v int32) { + o.GroupId = v +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *FHRPGroup) GetAuthType() AuthenticationType { + if o == nil || IsNil(o.AuthType) { + var ret AuthenticationType + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetAuthTypeOk() (*AuthenticationType, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *FHRPGroup) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthenticationType and assigns it to the AuthType field. +func (o *FHRPGroup) SetAuthType(v AuthenticationType) { + o.AuthType = &v +} + +// GetAuthKey returns the AuthKey field value if set, zero value otherwise. +func (o *FHRPGroup) GetAuthKey() string { + if o == nil || IsNil(o.AuthKey) { + var ret string + return ret + } + return *o.AuthKey +} + +// GetAuthKeyOk returns a tuple with the AuthKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetAuthKeyOk() (*string, bool) { + if o == nil || IsNil(o.AuthKey) { + return nil, false + } + return o.AuthKey, true +} + +// HasAuthKey returns a boolean if a field has been set. +func (o *FHRPGroup) HasAuthKey() bool { + if o != nil && !IsNil(o.AuthKey) { + return true + } + + return false +} + +// SetAuthKey gets a reference to the given string and assigns it to the AuthKey field. +func (o *FHRPGroup) SetAuthKey(v string) { + o.AuthKey = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FHRPGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FHRPGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FHRPGroup) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *FHRPGroup) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *FHRPGroup) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *FHRPGroup) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *FHRPGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *FHRPGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *FHRPGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *FHRPGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *FHRPGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *FHRPGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FHRPGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FHRPGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *FHRPGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FHRPGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FHRPGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *FHRPGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetIpAddresses returns the IpAddresses field value +func (o *FHRPGroup) GetIpAddresses() []NestedIPAddress { + if o == nil { + var ret []NestedIPAddress + return ret + } + + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value +// and a boolean to check if the value has been set. +func (o *FHRPGroup) GetIpAddressesOk() ([]NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.IpAddresses, true +} + +// SetIpAddresses sets field value +func (o *FHRPGroup) SetIpAddresses(v []NestedIPAddress) { + o.IpAddresses = v +} + +func (o FHRPGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FHRPGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["protocol"] = o.Protocol + toSerialize["group_id"] = o.GroupId + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthKey) { + toSerialize["auth_key"] = o.AuthKey + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["ip_addresses"] = o.IpAddresses + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FHRPGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "protocol", + "group_id", + "created", + "last_updated", + "ip_addresses", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFHRPGroup := _FHRPGroup{} + + err = json.Unmarshal(data, &varFHRPGroup) + + if err != nil { + return err + } + + *o = FHRPGroup(varFHRPGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "protocol") + delete(additionalProperties, "group_id") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_key") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "ip_addresses") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFHRPGroup struct { + value *FHRPGroup + isSet bool +} + +func (v NullableFHRPGroup) Get() *FHRPGroup { + return v.value +} + +func (v *NullableFHRPGroup) Set(val *FHRPGroup) { + v.value = val + v.isSet = true +} + +func (v NullableFHRPGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableFHRPGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFHRPGroup(val *FHRPGroup) *NullableFHRPGroup { + return &NullableFHRPGroup{value: val, isSet: true} +} + +func (v NullableFHRPGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFHRPGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_assignment.go b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_assignment.go new file mode 100644 index 00000000..5da205f4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_assignment.go @@ -0,0 +1,436 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the FHRPGroupAssignment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FHRPGroupAssignment{} + +// FHRPGroupAssignment Adds support for custom fields and tags. +type FHRPGroupAssignment struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Group NestedFHRPGroup `json:"group"` + InterfaceType string `json:"interface_type"` + InterfaceId int64 `json:"interface_id"` + Interface interface{} `json:"interface"` + Priority int32 `json:"priority"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _FHRPGroupAssignment FHRPGroupAssignment + +// NewFHRPGroupAssignment instantiates a new FHRPGroupAssignment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFHRPGroupAssignment(id int32, url string, display string, group NestedFHRPGroup, interfaceType string, interfaceId int64, interface_ interface{}, priority int32, created NullableTime, lastUpdated NullableTime) *FHRPGroupAssignment { + this := FHRPGroupAssignment{} + this.Id = id + this.Url = url + this.Display = display + this.Group = group + this.InterfaceType = interfaceType + this.InterfaceId = interfaceId + this.Interface = interface_ + this.Priority = priority + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewFHRPGroupAssignmentWithDefaults instantiates a new FHRPGroupAssignment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFHRPGroupAssignmentWithDefaults() *FHRPGroupAssignment { + this := FHRPGroupAssignment{} + return &this +} + +// GetId returns the Id field value +func (o *FHRPGroupAssignment) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignment) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *FHRPGroupAssignment) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *FHRPGroupAssignment) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignment) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FHRPGroupAssignment) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *FHRPGroupAssignment) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignment) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *FHRPGroupAssignment) SetDisplay(v string) { + o.Display = v +} + +// GetGroup returns the Group field value +func (o *FHRPGroupAssignment) GetGroup() NestedFHRPGroup { + if o == nil { + var ret NestedFHRPGroup + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignment) GetGroupOk() (*NestedFHRPGroup, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *FHRPGroupAssignment) SetGroup(v NestedFHRPGroup) { + o.Group = v +} + +// GetInterfaceType returns the InterfaceType field value +func (o *FHRPGroupAssignment) GetInterfaceType() string { + if o == nil { + var ret string + return ret + } + + return o.InterfaceType +} + +// GetInterfaceTypeOk returns a tuple with the InterfaceType field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignment) GetInterfaceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceType, true +} + +// SetInterfaceType sets field value +func (o *FHRPGroupAssignment) SetInterfaceType(v string) { + o.InterfaceType = v +} + +// GetInterfaceId returns the InterfaceId field value +func (o *FHRPGroupAssignment) GetInterfaceId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.InterfaceId +} + +// GetInterfaceIdOk returns a tuple with the InterfaceId field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignment) GetInterfaceIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceId, true +} + +// SetInterfaceId sets field value +func (o *FHRPGroupAssignment) SetInterfaceId(v int64) { + o.InterfaceId = v +} + +// GetInterface returns the Interface field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *FHRPGroupAssignment) GetInterface() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Interface +} + +// GetInterfaceOk returns a tuple with the Interface field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FHRPGroupAssignment) GetInterfaceOk() (*interface{}, bool) { + if o == nil || IsNil(o.Interface) { + return nil, false + } + return &o.Interface, true +} + +// SetInterface sets field value +func (o *FHRPGroupAssignment) SetInterface(v interface{}) { + o.Interface = v +} + +// GetPriority returns the Priority field value +func (o *FHRPGroupAssignment) GetPriority() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignment) GetPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Priority, true +} + +// SetPriority sets field value +func (o *FHRPGroupAssignment) SetPriority(v int32) { + o.Priority = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FHRPGroupAssignment) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FHRPGroupAssignment) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *FHRPGroupAssignment) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FHRPGroupAssignment) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FHRPGroupAssignment) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *FHRPGroupAssignment) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o FHRPGroupAssignment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FHRPGroupAssignment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["group"] = o.Group + toSerialize["interface_type"] = o.InterfaceType + toSerialize["interface_id"] = o.InterfaceId + if o.Interface != nil { + toSerialize["interface"] = o.Interface + } + toSerialize["priority"] = o.Priority + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FHRPGroupAssignment) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "group", + "interface_type", + "interface_id", + "interface", + "priority", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFHRPGroupAssignment := _FHRPGroupAssignment{} + + err = json.Unmarshal(data, &varFHRPGroupAssignment) + + if err != nil { + return err + } + + *o = FHRPGroupAssignment(varFHRPGroupAssignment) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "group") + delete(additionalProperties, "interface_type") + delete(additionalProperties, "interface_id") + delete(additionalProperties, "interface") + delete(additionalProperties, "priority") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFHRPGroupAssignment struct { + value *FHRPGroupAssignment + isSet bool +} + +func (v NullableFHRPGroupAssignment) Get() *FHRPGroupAssignment { + return v.value +} + +func (v *NullableFHRPGroupAssignment) Set(val *FHRPGroupAssignment) { + v.value = val + v.isSet = true +} + +func (v NullableFHRPGroupAssignment) IsSet() bool { + return v.isSet +} + +func (v *NullableFHRPGroupAssignment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFHRPGroupAssignment(val *FHRPGroupAssignment) *NullableFHRPGroupAssignment { + return &NullableFHRPGroupAssignment{value: val, isSet: true} +} + +func (v NullableFHRPGroupAssignment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFHRPGroupAssignment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_assignment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_assignment_request.go new file mode 100644 index 00000000..52e86abd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_assignment_request.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the FHRPGroupAssignmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FHRPGroupAssignmentRequest{} + +// FHRPGroupAssignmentRequest Adds support for custom fields and tags. +type FHRPGroupAssignmentRequest struct { + Group NestedFHRPGroupRequest `json:"group"` + InterfaceType string `json:"interface_type"` + InterfaceId int64 `json:"interface_id"` + Priority int32 `json:"priority"` + AdditionalProperties map[string]interface{} +} + +type _FHRPGroupAssignmentRequest FHRPGroupAssignmentRequest + +// NewFHRPGroupAssignmentRequest instantiates a new FHRPGroupAssignmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFHRPGroupAssignmentRequest(group NestedFHRPGroupRequest, interfaceType string, interfaceId int64, priority int32) *FHRPGroupAssignmentRequest { + this := FHRPGroupAssignmentRequest{} + this.Group = group + this.InterfaceType = interfaceType + this.InterfaceId = interfaceId + this.Priority = priority + return &this +} + +// NewFHRPGroupAssignmentRequestWithDefaults instantiates a new FHRPGroupAssignmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFHRPGroupAssignmentRequestWithDefaults() *FHRPGroupAssignmentRequest { + this := FHRPGroupAssignmentRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *FHRPGroupAssignmentRequest) GetGroup() NestedFHRPGroupRequest { + if o == nil { + var ret NestedFHRPGroupRequest + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignmentRequest) GetGroupOk() (*NestedFHRPGroupRequest, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *FHRPGroupAssignmentRequest) SetGroup(v NestedFHRPGroupRequest) { + o.Group = v +} + +// GetInterfaceType returns the InterfaceType field value +func (o *FHRPGroupAssignmentRequest) GetInterfaceType() string { + if o == nil { + var ret string + return ret + } + + return o.InterfaceType +} + +// GetInterfaceTypeOk returns a tuple with the InterfaceType field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignmentRequest) GetInterfaceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceType, true +} + +// SetInterfaceType sets field value +func (o *FHRPGroupAssignmentRequest) SetInterfaceType(v string) { + o.InterfaceType = v +} + +// GetInterfaceId returns the InterfaceId field value +func (o *FHRPGroupAssignmentRequest) GetInterfaceId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.InterfaceId +} + +// GetInterfaceIdOk returns a tuple with the InterfaceId field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignmentRequest) GetInterfaceIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceId, true +} + +// SetInterfaceId sets field value +func (o *FHRPGroupAssignmentRequest) SetInterfaceId(v int64) { + o.InterfaceId = v +} + +// GetPriority returns the Priority field value +func (o *FHRPGroupAssignmentRequest) GetPriority() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupAssignmentRequest) GetPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Priority, true +} + +// SetPriority sets field value +func (o *FHRPGroupAssignmentRequest) SetPriority(v int32) { + o.Priority = v +} + +func (o FHRPGroupAssignmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FHRPGroupAssignmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["interface_type"] = o.InterfaceType + toSerialize["interface_id"] = o.InterfaceId + toSerialize["priority"] = o.Priority + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FHRPGroupAssignmentRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "interface_type", + "interface_id", + "priority", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFHRPGroupAssignmentRequest := _FHRPGroupAssignmentRequest{} + + err = json.Unmarshal(data, &varFHRPGroupAssignmentRequest) + + if err != nil { + return err + } + + *o = FHRPGroupAssignmentRequest(varFHRPGroupAssignmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "interface_type") + delete(additionalProperties, "interface_id") + delete(additionalProperties, "priority") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFHRPGroupAssignmentRequest struct { + value *FHRPGroupAssignmentRequest + isSet bool +} + +func (v NullableFHRPGroupAssignmentRequest) Get() *FHRPGroupAssignmentRequest { + return v.value +} + +func (v *NullableFHRPGroupAssignmentRequest) Set(val *FHRPGroupAssignmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFHRPGroupAssignmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFHRPGroupAssignmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFHRPGroupAssignmentRequest(val *FHRPGroupAssignmentRequest) *NullableFHRPGroupAssignmentRequest { + return &NullableFHRPGroupAssignmentRequest{value: val, isSet: true} +} + +func (v NullableFHRPGroupAssignmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFHRPGroupAssignmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_protocol.go b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_protocol.go new file mode 100644 index 00000000..3da33764 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_protocol.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// FHRPGroupProtocol * `vrrp2` - VRRPv2 * `vrrp3` - VRRPv3 * `carp` - CARP * `clusterxl` - ClusterXL * `hsrp` - HSRP * `glbp` - GLBP * `other` - Other +type FHRPGroupProtocol string + +// List of FHRPGroup_protocol +const ( + FHRPGROUPPROTOCOL_VRRP2 FHRPGroupProtocol = "vrrp2" + FHRPGROUPPROTOCOL_VRRP3 FHRPGroupProtocol = "vrrp3" + FHRPGROUPPROTOCOL_CARP FHRPGroupProtocol = "carp" + FHRPGROUPPROTOCOL_CLUSTERXL FHRPGroupProtocol = "clusterxl" + FHRPGROUPPROTOCOL_HSRP FHRPGroupProtocol = "hsrp" + FHRPGROUPPROTOCOL_GLBP FHRPGroupProtocol = "glbp" + FHRPGROUPPROTOCOL_OTHER FHRPGroupProtocol = "other" +) + +// All allowed values of FHRPGroupProtocol enum +var AllowedFHRPGroupProtocolEnumValues = []FHRPGroupProtocol{ + "vrrp2", + "vrrp3", + "carp", + "clusterxl", + "hsrp", + "glbp", + "other", +} + +func (v *FHRPGroupProtocol) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FHRPGroupProtocol(value) + for _, existing := range AllowedFHRPGroupProtocolEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FHRPGroupProtocol", value) +} + +// NewFHRPGroupProtocolFromValue returns a pointer to a valid FHRPGroupProtocol +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFHRPGroupProtocolFromValue(v string) (*FHRPGroupProtocol, error) { + ev := FHRPGroupProtocol(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FHRPGroupProtocol: valid values are %v", v, AllowedFHRPGroupProtocolEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FHRPGroupProtocol) IsValid() bool { + for _, existing := range AllowedFHRPGroupProtocolEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FHRPGroup_protocol value +func (v FHRPGroupProtocol) Ptr() *FHRPGroupProtocol { + return &v +} + +type NullableFHRPGroupProtocol struct { + value *FHRPGroupProtocol + isSet bool +} + +func (v NullableFHRPGroupProtocol) Get() *FHRPGroupProtocol { + return v.value +} + +func (v *NullableFHRPGroupProtocol) Set(val *FHRPGroupProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableFHRPGroupProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableFHRPGroupProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFHRPGroupProtocol(val *FHRPGroupProtocol) *NullableFHRPGroupProtocol { + return &NullableFHRPGroupProtocol{value: val, isSet: true} +} + +func (v NullableFHRPGroupProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFHRPGroupProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_request.go new file mode 100644 index 00000000..d9a3a876 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_fhrp_group_request.go @@ -0,0 +1,454 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the FHRPGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FHRPGroupRequest{} + +// FHRPGroupRequest Adds support for custom fields and tags. +type FHRPGroupRequest struct { + Name *string `json:"name,omitempty"` + Protocol FHRPGroupProtocol `json:"protocol"` + GroupId int32 `json:"group_id"` + AuthType *AuthenticationType `json:"auth_type,omitempty"` + AuthKey *string `json:"auth_key,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FHRPGroupRequest FHRPGroupRequest + +// NewFHRPGroupRequest instantiates a new FHRPGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFHRPGroupRequest(protocol FHRPGroupProtocol, groupId int32) *FHRPGroupRequest { + this := FHRPGroupRequest{} + this.Protocol = protocol + this.GroupId = groupId + return &this +} + +// NewFHRPGroupRequestWithDefaults instantiates a new FHRPGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFHRPGroupRequestWithDefaults() *FHRPGroupRequest { + this := FHRPGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *FHRPGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *FHRPGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *FHRPGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetProtocol returns the Protocol field value +func (o *FHRPGroupRequest) GetProtocol() FHRPGroupProtocol { + if o == nil { + var ret FHRPGroupProtocol + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetProtocolOk() (*FHRPGroupProtocol, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *FHRPGroupRequest) SetProtocol(v FHRPGroupProtocol) { + o.Protocol = v +} + +// GetGroupId returns the GroupId field value +func (o *FHRPGroupRequest) GetGroupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetGroupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *FHRPGroupRequest) SetGroupId(v int32) { + o.GroupId = v +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *FHRPGroupRequest) GetAuthType() AuthenticationType { + if o == nil || IsNil(o.AuthType) { + var ret AuthenticationType + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetAuthTypeOk() (*AuthenticationType, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *FHRPGroupRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthenticationType and assigns it to the AuthType field. +func (o *FHRPGroupRequest) SetAuthType(v AuthenticationType) { + o.AuthType = &v +} + +// GetAuthKey returns the AuthKey field value if set, zero value otherwise. +func (o *FHRPGroupRequest) GetAuthKey() string { + if o == nil || IsNil(o.AuthKey) { + var ret string + return ret + } + return *o.AuthKey +} + +// GetAuthKeyOk returns a tuple with the AuthKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetAuthKeyOk() (*string, bool) { + if o == nil || IsNil(o.AuthKey) { + return nil, false + } + return o.AuthKey, true +} + +// HasAuthKey returns a boolean if a field has been set. +func (o *FHRPGroupRequest) HasAuthKey() bool { + if o != nil && !IsNil(o.AuthKey) { + return true + } + + return false +} + +// SetAuthKey gets a reference to the given string and assigns it to the AuthKey field. +func (o *FHRPGroupRequest) SetAuthKey(v string) { + o.AuthKey = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FHRPGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FHRPGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FHRPGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *FHRPGroupRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *FHRPGroupRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *FHRPGroupRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *FHRPGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *FHRPGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *FHRPGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *FHRPGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FHRPGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *FHRPGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *FHRPGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o FHRPGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FHRPGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["protocol"] = o.Protocol + toSerialize["group_id"] = o.GroupId + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthKey) { + toSerialize["auth_key"] = o.AuthKey + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FHRPGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "protocol", + "group_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFHRPGroupRequest := _FHRPGroupRequest{} + + err = json.Unmarshal(data, &varFHRPGroupRequest) + + if err != nil { + return err + } + + *o = FHRPGroupRequest(varFHRPGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "protocol") + delete(additionalProperties, "group_id") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_key") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFHRPGroupRequest struct { + value *FHRPGroupRequest + isSet bool +} + +func (v NullableFHRPGroupRequest) Get() *FHRPGroupRequest { + return v.value +} + +func (v *NullableFHRPGroupRequest) Set(val *FHRPGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFHRPGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFHRPGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFHRPGroupRequest(val *FHRPGroupRequest) *NullableFHRPGroupRequest { + return &NullableFHRPGroupRequest{value: val, isSet: true} +} + +func (v NullableFHRPGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFHRPGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port.go new file mode 100644 index 00000000..e903d823 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port.go @@ -0,0 +1,861 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the FrontPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrontPort{} + +// FrontPort Adds support for custom fields and tags. +type FrontPort struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Module NullableComponentNestedModule `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortType `json:"type"` + Color *string `json:"color,omitempty"` + RearPort FrontPortRearPort `json:"rear_port"` + // Mapped position on corresponding rear port + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _FrontPort FrontPort + +// NewFrontPort instantiates a new FrontPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrontPort(id int32, url string, display string, device NestedDevice, name string, type_ FrontPortType, rearPort FrontPortRearPort, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, created NullableTime, lastUpdated NullableTime, occupied bool) *FrontPort { + this := FrontPort{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Type = type_ + this.RearPort = rearPort + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewFrontPortWithDefaults instantiates a new FrontPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrontPortWithDefaults() *FrontPort { + this := FrontPort{} + return &this +} + +// GetId returns the Id field value +func (o *FrontPort) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *FrontPort) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *FrontPort) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FrontPort) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *FrontPort) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *FrontPort) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *FrontPort) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *FrontPort) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FrontPort) GetModule() ComponentNestedModule { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModule + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPort) GetModuleOk() (*ComponentNestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *FrontPort) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModule and assigns it to the Module field. +func (o *FrontPort) SetModule(v ComponentNestedModule) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *FrontPort) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *FrontPort) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *FrontPort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FrontPort) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *FrontPort) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPort) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *FrontPort) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *FrontPort) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *FrontPort) GetType() FrontPortType { + if o == nil { + var ret FrontPortType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetTypeOk() (*FrontPortType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *FrontPort) SetType(v FrontPortType) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *FrontPort) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPort) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *FrontPort) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *FrontPort) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value +func (o *FrontPort) GetRearPort() FrontPortRearPort { + if o == nil { + var ret FrontPortRearPort + return ret + } + + return o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetRearPortOk() (*FrontPortRearPort, bool) { + if o == nil { + return nil, false + } + return &o.RearPort, true +} + +// SetRearPort sets field value +func (o *FrontPort) SetRearPort(v FrontPortRearPort) { + o.RearPort = v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *FrontPort) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPort) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *FrontPort) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *FrontPort) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FrontPort) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPort) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FrontPort) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FrontPort) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *FrontPort) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPort) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *FrontPort) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *FrontPort) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *FrontPort) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPort) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *FrontPort) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *FrontPort) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *FrontPort) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *FrontPort) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *FrontPort) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *FrontPort) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *FrontPort) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *FrontPort) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPort) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *FrontPort) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *FrontPort) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *FrontPort) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPort) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *FrontPort) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *FrontPort) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FrontPort) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPort) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *FrontPort) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FrontPort) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPort) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *FrontPort) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *FrontPort) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *FrontPort) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *FrontPort) SetOccupied(v bool) { + o.Occupied = v +} + +func (o FrontPort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrontPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + toSerialize["rear_port"] = o.RearPort + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrontPort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "type", + "rear_port", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFrontPort := _FrontPort{} + + err = json.Unmarshal(data, &varFrontPort) + + if err != nil { + return err + } + + *o = FrontPort(varFrontPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrontPort struct { + value *FrontPort + isSet bool +} + +func (v NullableFrontPort) Get() *FrontPort { + return v.value +} + +func (v *NullableFrontPort) Set(val *FrontPort) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPort) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPort(val *FrontPort) *NullableFrontPort { + return &NullableFrontPort{value: val, isSet: true} +} + +func (v NullableFrontPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_rear_port.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_rear_port.go new file mode 100644 index 00000000..96caa396 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_rear_port.go @@ -0,0 +1,328 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the FrontPortRearPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrontPortRearPort{} + +// FrontPortRearPort NestedRearPortSerializer but with parent device omitted (since front and rear ports must belong to same device) +type FrontPortRearPort struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FrontPortRearPort FrontPortRearPort + +// NewFrontPortRearPort instantiates a new FrontPortRearPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrontPortRearPort(id int32, url string, display string, name string) *FrontPortRearPort { + this := FrontPortRearPort{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewFrontPortRearPortWithDefaults instantiates a new FrontPortRearPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrontPortRearPortWithDefaults() *FrontPortRearPort { + this := FrontPortRearPort{} + return &this +} + +// GetId returns the Id field value +func (o *FrontPortRearPort) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *FrontPortRearPort) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *FrontPortRearPort) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *FrontPortRearPort) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FrontPortRearPort) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FrontPortRearPort) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *FrontPortRearPort) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *FrontPortRearPort) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *FrontPortRearPort) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *FrontPortRearPort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FrontPortRearPort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FrontPortRearPort) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *FrontPortRearPort) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRearPort) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *FrontPortRearPort) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *FrontPortRearPort) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FrontPortRearPort) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRearPort) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FrontPortRearPort) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FrontPortRearPort) SetDescription(v string) { + o.Description = &v +} + +func (o FrontPortRearPort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrontPortRearPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrontPortRearPort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFrontPortRearPort := _FrontPortRearPort{} + + err = json.Unmarshal(data, &varFrontPortRearPort) + + if err != nil { + return err + } + + *o = FrontPortRearPort(varFrontPortRearPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrontPortRearPort struct { + value *FrontPortRearPort + isSet bool +} + +func (v NullableFrontPortRearPort) Get() *FrontPortRearPort { + return v.value +} + +func (v *NullableFrontPortRearPort) Set(val *FrontPortRearPort) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortRearPort) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortRearPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortRearPort(val *FrontPortRearPort) *NullableFrontPortRearPort { + return &NullableFrontPortRearPort{value: val, isSet: true} +} + +func (v NullableFrontPortRearPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortRearPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_rear_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_rear_port_request.go new file mode 100644 index 00000000..c1a6c52c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_rear_port_request.go @@ -0,0 +1,241 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the FrontPortRearPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrontPortRearPortRequest{} + +// FrontPortRearPortRequest NestedRearPortSerializer but with parent device omitted (since front and rear ports must belong to same device) +type FrontPortRearPortRequest struct { + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FrontPortRearPortRequest FrontPortRearPortRequest + +// NewFrontPortRearPortRequest instantiates a new FrontPortRearPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrontPortRearPortRequest(name string) *FrontPortRearPortRequest { + this := FrontPortRearPortRequest{} + this.Name = name + return &this +} + +// NewFrontPortRearPortRequestWithDefaults instantiates a new FrontPortRearPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrontPortRearPortRequestWithDefaults() *FrontPortRearPortRequest { + this := FrontPortRearPortRequest{} + return &this +} + +// GetName returns the Name field value +func (o *FrontPortRearPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FrontPortRearPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FrontPortRearPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *FrontPortRearPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRearPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *FrontPortRearPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *FrontPortRearPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FrontPortRearPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRearPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FrontPortRearPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FrontPortRearPortRequest) SetDescription(v string) { + o.Description = &v +} + +func (o FrontPortRearPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrontPortRearPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrontPortRearPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFrontPortRearPortRequest := _FrontPortRearPortRequest{} + + err = json.Unmarshal(data, &varFrontPortRearPortRequest) + + if err != nil { + return err + } + + *o = FrontPortRearPortRequest(varFrontPortRearPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrontPortRearPortRequest struct { + value *FrontPortRearPortRequest + isSet bool +} + +func (v NullableFrontPortRearPortRequest) Get() *FrontPortRearPortRequest { + return v.value +} + +func (v *NullableFrontPortRearPortRequest) Set(val *FrontPortRearPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortRearPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortRearPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortRearPortRequest(val *FrontPortRearPortRequest) *NullableFrontPortRearPortRequest { + return &NullableFrontPortRearPortRequest{value: val, isSet: true} +} + +func (v NullableFrontPortRearPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortRearPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_request.go new file mode 100644 index 00000000..c0840054 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_request.go @@ -0,0 +1,563 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the FrontPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrontPortRequest{} + +// FrontPortRequest Adds support for custom fields and tags. +type FrontPortRequest struct { + Device NestedDeviceRequest `json:"device"` + Module NullableComponentNestedModuleRequest `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + RearPort FrontPortRearPortRequest `json:"rear_port"` + // Mapped position on corresponding rear port + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FrontPortRequest FrontPortRequest + +// NewFrontPortRequest instantiates a new FrontPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrontPortRequest(device NestedDeviceRequest, name string, type_ FrontPortTypeValue, rearPort FrontPortRearPortRequest) *FrontPortRequest { + this := FrontPortRequest{} + this.Device = device + this.Name = name + this.Type = type_ + this.RearPort = rearPort + return &this +} + +// NewFrontPortRequestWithDefaults instantiates a new FrontPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrontPortRequestWithDefaults() *FrontPortRequest { + this := FrontPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *FrontPortRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *FrontPortRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FrontPortRequest) GetModule() ComponentNestedModuleRequest { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModuleRequest + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPortRequest) GetModuleOk() (*ComponentNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *FrontPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModuleRequest and assigns it to the Module field. +func (o *FrontPortRequest) SetModule(v ComponentNestedModuleRequest) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *FrontPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *FrontPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *FrontPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FrontPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *FrontPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *FrontPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *FrontPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *FrontPortRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *FrontPortRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *FrontPortRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *FrontPortRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *FrontPortRequest) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value +func (o *FrontPortRequest) GetRearPort() FrontPortRearPortRequest { + if o == nil { + var ret FrontPortRearPortRequest + return ret + } + + return o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetRearPortOk() (*FrontPortRearPortRequest, bool) { + if o == nil { + return nil, false + } + return &o.RearPort, true +} + +// SetRearPort sets field value +func (o *FrontPortRequest) SetRearPort(v FrontPortRearPortRequest) { + o.RearPort = v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *FrontPortRequest) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *FrontPortRequest) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *FrontPortRequest) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FrontPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FrontPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FrontPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *FrontPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *FrontPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *FrontPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *FrontPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *FrontPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *FrontPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *FrontPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *FrontPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *FrontPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o FrontPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrontPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + toSerialize["rear_port"] = o.RearPort + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrontPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + "type", + "rear_port", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFrontPortRequest := _FrontPortRequest{} + + err = json.Unmarshal(data, &varFrontPortRequest) + + if err != nil { + return err + } + + *o = FrontPortRequest(varFrontPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrontPortRequest struct { + value *FrontPortRequest + isSet bool +} + +func (v NullableFrontPortRequest) Get() *FrontPortRequest { + return v.value +} + +func (v *NullableFrontPortRequest) Set(val *FrontPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortRequest(val *FrontPortRequest) *NullableFrontPortRequest { + return &NullableFrontPortRequest{value: val, isSet: true} +} + +func (v NullableFrontPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_template.go new file mode 100644 index 00000000..527d76e6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_template.go @@ -0,0 +1,620 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the FrontPortTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrontPortTemplate{} + +// FrontPortTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type FrontPortTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NullableNestedDeviceType `json:"device_type,omitempty"` + ModuleType NullableNestedModuleType `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortType `json:"type"` + Color *string `json:"color,omitempty"` + RearPort NestedRearPortTemplate `json:"rear_port"` + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _FrontPortTemplate FrontPortTemplate + +// NewFrontPortTemplate instantiates a new FrontPortTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrontPortTemplate(id int32, url string, display string, name string, type_ FrontPortType, rearPort NestedRearPortTemplate, created NullableTime, lastUpdated NullableTime) *FrontPortTemplate { + this := FrontPortTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Type = type_ + this.RearPort = rearPort + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewFrontPortTemplateWithDefaults instantiates a new FrontPortTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrontPortTemplateWithDefaults() *FrontPortTemplate { + this := FrontPortTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *FrontPortTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *FrontPortTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *FrontPortTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FrontPortTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *FrontPortTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *FrontPortTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FrontPortTemplate) GetDeviceType() NestedDeviceType { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceType + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPortTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceType and assigns it to the DeviceType field. +func (o *FrontPortTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *FrontPortTemplate) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *FrontPortTemplate) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FrontPortTemplate) GetModuleType() NestedModuleType { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleType + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPortTemplate) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleType and assigns it to the ModuleType field. +func (o *FrontPortTemplate) SetModuleType(v NestedModuleType) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *FrontPortTemplate) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *FrontPortTemplate) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *FrontPortTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FrontPortTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *FrontPortTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *FrontPortTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *FrontPortTemplate) GetType() FrontPortType { + if o == nil { + var ret FrontPortType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetTypeOk() (*FrontPortType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *FrontPortTemplate) SetType(v FrontPortType) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *FrontPortTemplate) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *FrontPortTemplate) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value +func (o *FrontPortTemplate) GetRearPort() NestedRearPortTemplate { + if o == nil { + var ret NestedRearPortTemplate + return ret + } + + return o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetRearPortOk() (*NestedRearPortTemplate, bool) { + if o == nil { + return nil, false + } + return &o.RearPort, true +} + +// SetRearPort sets field value +func (o *FrontPortTemplate) SetRearPort(v NestedRearPortTemplate) { + o.RearPort = v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *FrontPortTemplate) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *FrontPortTemplate) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FrontPortTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FrontPortTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FrontPortTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPortTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *FrontPortTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *FrontPortTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *FrontPortTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o FrontPortTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrontPortTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + toSerialize["rear_port"] = o.RearPort + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrontPortTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "type", + "rear_port", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFrontPortTemplate := _FrontPortTemplate{} + + err = json.Unmarshal(data, &varFrontPortTemplate) + + if err != nil { + return err + } + + *o = FrontPortTemplate(varFrontPortTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrontPortTemplate struct { + value *FrontPortTemplate + isSet bool +} + +func (v NullableFrontPortTemplate) Get() *FrontPortTemplate { + return v.value +} + +func (v *NullableFrontPortTemplate) Set(val *FrontPortTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortTemplate(val *FrontPortTemplate) *NullableFrontPortTemplate { + return &NullableFrontPortTemplate{value: val, isSet: true} +} + +func (v NullableFrontPortTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_template_request.go new file mode 100644 index 00000000..cd1758f7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_template_request.go @@ -0,0 +1,470 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the FrontPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrontPortTemplateRequest{} + +// FrontPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type FrontPortTemplateRequest struct { + DeviceType NullableNestedDeviceTypeRequest `json:"device_type,omitempty"` + ModuleType NullableNestedModuleTypeRequest `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + RearPort NestedRearPortTemplateRequest `json:"rear_port"` + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FrontPortTemplateRequest FrontPortTemplateRequest + +// NewFrontPortTemplateRequest instantiates a new FrontPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrontPortTemplateRequest(name string, type_ FrontPortTypeValue, rearPort NestedRearPortTemplateRequest) *FrontPortTemplateRequest { + this := FrontPortTemplateRequest{} + this.Name = name + this.Type = type_ + this.RearPort = rearPort + return &this +} + +// NewFrontPortTemplateRequestWithDefaults instantiates a new FrontPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrontPortTemplateRequestWithDefaults() *FrontPortTemplateRequest { + this := FrontPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FrontPortTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceTypeRequest + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPortTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *FrontPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceTypeRequest and assigns it to the DeviceType field. +func (o *FrontPortTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *FrontPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *FrontPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FrontPortTemplateRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleTypeRequest + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FrontPortTemplateRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *FrontPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleTypeRequest and assigns it to the ModuleType field. +func (o *FrontPortTemplateRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *FrontPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *FrontPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *FrontPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FrontPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *FrontPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *FrontPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *FrontPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *FrontPortTemplateRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplateRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *FrontPortTemplateRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *FrontPortTemplateRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplateRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *FrontPortTemplateRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *FrontPortTemplateRequest) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value +func (o *FrontPortTemplateRequest) GetRearPort() NestedRearPortTemplateRequest { + if o == nil { + var ret NestedRearPortTemplateRequest + return ret + } + + return o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value +// and a boolean to check if the value has been set. +func (o *FrontPortTemplateRequest) GetRearPortOk() (*NestedRearPortTemplateRequest, bool) { + if o == nil { + return nil, false + } + return &o.RearPort, true +} + +// SetRearPort sets field value +func (o *FrontPortTemplateRequest) SetRearPort(v NestedRearPortTemplateRequest) { + o.RearPort = v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *FrontPortTemplateRequest) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplateRequest) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *FrontPortTemplateRequest) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *FrontPortTemplateRequest) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *FrontPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *FrontPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *FrontPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o FrontPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrontPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + toSerialize["rear_port"] = o.RearPort + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrontPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + "rear_port", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFrontPortTemplateRequest := _FrontPortTemplateRequest{} + + err = json.Unmarshal(data, &varFrontPortTemplateRequest) + + if err != nil { + return err + } + + *o = FrontPortTemplateRequest(varFrontPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrontPortTemplateRequest struct { + value *FrontPortTemplateRequest + isSet bool +} + +func (v NullableFrontPortTemplateRequest) Get() *FrontPortTemplateRequest { + return v.value +} + +func (v *NullableFrontPortTemplateRequest) Set(val *FrontPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortTemplateRequest(val *FrontPortTemplateRequest) *NullableFrontPortTemplateRequest { + return &NullableFrontPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableFrontPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type.go new file mode 100644 index 00000000..8991b4bc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the FrontPortType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrontPortType{} + +// FrontPortType struct for FrontPortType +type FrontPortType struct { + Value *FrontPortTypeValue `json:"value,omitempty"` + Label *FrontPortTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FrontPortType FrontPortType + +// NewFrontPortType instantiates a new FrontPortType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrontPortType() *FrontPortType { + this := FrontPortType{} + return &this +} + +// NewFrontPortTypeWithDefaults instantiates a new FrontPortType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrontPortTypeWithDefaults() *FrontPortType { + this := FrontPortType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *FrontPortType) GetValue() FrontPortTypeValue { + if o == nil || IsNil(o.Value) { + var ret FrontPortTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortType) GetValueOk() (*FrontPortTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *FrontPortType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given FrontPortTypeValue and assigns it to the Value field. +func (o *FrontPortType) SetValue(v FrontPortTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *FrontPortType) GetLabel() FrontPortTypeLabel { + if o == nil || IsNil(o.Label) { + var ret FrontPortTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrontPortType) GetLabelOk() (*FrontPortTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *FrontPortType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given FrontPortTypeLabel and assigns it to the Label field. +func (o *FrontPortType) SetLabel(v FrontPortTypeLabel) { + o.Label = &v +} + +func (o FrontPortType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrontPortType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrontPortType) UnmarshalJSON(data []byte) (err error) { + varFrontPortType := _FrontPortType{} + + err = json.Unmarshal(data, &varFrontPortType) + + if err != nil { + return err + } + + *o = FrontPortType(varFrontPortType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrontPortType struct { + value *FrontPortType + isSet bool +} + +func (v NullableFrontPortType) Get() *FrontPortType { + return v.value +} + +func (v *NullableFrontPortType) Set(val *FrontPortType) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortType) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortType(val *FrontPortType) *NullableFrontPortType { + return &NullableFrontPortType{value: val, isSet: true} +} + +func (v NullableFrontPortType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type_label.go new file mode 100644 index 00000000..b0e9ee32 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type_label.go @@ -0,0 +1,200 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// FrontPortTypeLabel the model 'FrontPortTypeLabel' +type FrontPortTypeLabel string + +// List of FrontPort_type_label +const ( + FRONTPORTTYPELABEL__8_P8_C FrontPortTypeLabel = "8P8C" + FRONTPORTTYPELABEL__8_P6_C FrontPortTypeLabel = "8P6C" + FRONTPORTTYPELABEL__8_P4_C FrontPortTypeLabel = "8P4C" + FRONTPORTTYPELABEL__8_P2_C FrontPortTypeLabel = "8P2C" + FRONTPORTTYPELABEL__6_P6_C FrontPortTypeLabel = "6P6C" + FRONTPORTTYPELABEL__6_P4_C FrontPortTypeLabel = "6P4C" + FRONTPORTTYPELABEL__6_P2_C FrontPortTypeLabel = "6P2C" + FRONTPORTTYPELABEL__4_P4_C FrontPortTypeLabel = "4P4C" + FRONTPORTTYPELABEL__4_P2_C FrontPortTypeLabel = "4P2C" + FRONTPORTTYPELABEL_GG45 FrontPortTypeLabel = "GG45" + FRONTPORTTYPELABEL_TERA_4_P FrontPortTypeLabel = "TERA 4P" + FRONTPORTTYPELABEL_TERA_2_P FrontPortTypeLabel = "TERA 2P" + FRONTPORTTYPELABEL_TERA_1_P FrontPortTypeLabel = "TERA 1P" + FRONTPORTTYPELABEL__110_PUNCH FrontPortTypeLabel = "110 Punch" + FRONTPORTTYPELABEL_BNC FrontPortTypeLabel = "BNC" + FRONTPORTTYPELABEL_F_CONNECTOR FrontPortTypeLabel = "F Connector" + FRONTPORTTYPELABEL_N_CONNECTOR FrontPortTypeLabel = "N Connector" + FRONTPORTTYPELABEL_MRJ21 FrontPortTypeLabel = "MRJ21" + FRONTPORTTYPELABEL_FC FrontPortTypeLabel = "FC" + FRONTPORTTYPELABEL_LC FrontPortTypeLabel = "LC" + FRONTPORTTYPELABEL_LC_PC FrontPortTypeLabel = "LC/PC" + FRONTPORTTYPELABEL_LC_UPC FrontPortTypeLabel = "LC/UPC" + FRONTPORTTYPELABEL_LC_APC FrontPortTypeLabel = "LC/APC" + FRONTPORTTYPELABEL_LSH FrontPortTypeLabel = "LSH" + FRONTPORTTYPELABEL_LSH_PC FrontPortTypeLabel = "LSH/PC" + FRONTPORTTYPELABEL_LSH_UPC FrontPortTypeLabel = "LSH/UPC" + FRONTPORTTYPELABEL_LSH_APC FrontPortTypeLabel = "LSH/APC" + FRONTPORTTYPELABEL_LX_5 FrontPortTypeLabel = "LX.5" + FRONTPORTTYPELABEL_LX_5_PC FrontPortTypeLabel = "LX.5/PC" + FRONTPORTTYPELABEL_LX_5_UPC FrontPortTypeLabel = "LX.5/UPC" + FRONTPORTTYPELABEL_LX_5_APC FrontPortTypeLabel = "LX.5/APC" + FRONTPORTTYPELABEL_MPO FrontPortTypeLabel = "MPO" + FRONTPORTTYPELABEL_MTRJ FrontPortTypeLabel = "MTRJ" + FRONTPORTTYPELABEL_SC FrontPortTypeLabel = "SC" + FRONTPORTTYPELABEL_SC_PC FrontPortTypeLabel = "SC/PC" + FRONTPORTTYPELABEL_SC_UPC FrontPortTypeLabel = "SC/UPC" + FRONTPORTTYPELABEL_SC_APC FrontPortTypeLabel = "SC/APC" + FRONTPORTTYPELABEL_ST FrontPortTypeLabel = "ST" + FRONTPORTTYPELABEL_CS FrontPortTypeLabel = "CS" + FRONTPORTTYPELABEL_SN FrontPortTypeLabel = "SN" + FRONTPORTTYPELABEL_SMA_905 FrontPortTypeLabel = "SMA 905" + FRONTPORTTYPELABEL_SMA_906 FrontPortTypeLabel = "SMA 906" + FRONTPORTTYPELABEL_URM_P2 FrontPortTypeLabel = "URM-P2" + FRONTPORTTYPELABEL_URM_P4 FrontPortTypeLabel = "URM-P4" + FRONTPORTTYPELABEL_URM_P8 FrontPortTypeLabel = "URM-P8" + FRONTPORTTYPELABEL_SPLICE FrontPortTypeLabel = "Splice" + FRONTPORTTYPELABEL_OTHER FrontPortTypeLabel = "Other" +) + +// All allowed values of FrontPortTypeLabel enum +var AllowedFrontPortTypeLabelEnumValues = []FrontPortTypeLabel{ + "8P8C", + "8P6C", + "8P4C", + "8P2C", + "6P6C", + "6P4C", + "6P2C", + "4P4C", + "4P2C", + "GG45", + "TERA 4P", + "TERA 2P", + "TERA 1P", + "110 Punch", + "BNC", + "F Connector", + "N Connector", + "MRJ21", + "FC", + "LC", + "LC/PC", + "LC/UPC", + "LC/APC", + "LSH", + "LSH/PC", + "LSH/UPC", + "LSH/APC", + "LX.5", + "LX.5/PC", + "LX.5/UPC", + "LX.5/APC", + "MPO", + "MTRJ", + "SC", + "SC/PC", + "SC/UPC", + "SC/APC", + "ST", + "CS", + "SN", + "SMA 905", + "SMA 906", + "URM-P2", + "URM-P4", + "URM-P8", + "Splice", + "Other", +} + +func (v *FrontPortTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FrontPortTypeLabel(value) + for _, existing := range AllowedFrontPortTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FrontPortTypeLabel", value) +} + +// NewFrontPortTypeLabelFromValue returns a pointer to a valid FrontPortTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFrontPortTypeLabelFromValue(v string) (*FrontPortTypeLabel, error) { + ev := FrontPortTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FrontPortTypeLabel: valid values are %v", v, AllowedFrontPortTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FrontPortTypeLabel) IsValid() bool { + for _, existing := range AllowedFrontPortTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FrontPort_type_label value +func (v FrontPortTypeLabel) Ptr() *FrontPortTypeLabel { + return &v +} + +type NullableFrontPortTypeLabel struct { + value *FrontPortTypeLabel + isSet bool +} + +func (v NullableFrontPortTypeLabel) Get() *FrontPortTypeLabel { + return v.value +} + +func (v *NullableFrontPortTypeLabel) Set(val *FrontPortTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortTypeLabel(val *FrontPortTypeLabel) *NullableFrontPortTypeLabel { + return &NullableFrontPortTypeLabel{value: val, isSet: true} +} + +func (v NullableFrontPortTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type_value.go new file mode 100644 index 00000000..4ebc442b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_front_port_type_value.go @@ -0,0 +1,200 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// FrontPortTypeValue * `8p8c` - 8P8C * `8p6c` - 8P6C * `8p4c` - 8P4C * `8p2c` - 8P2C * `6p6c` - 6P6C * `6p4c` - 6P4C * `6p2c` - 6P2C * `4p4c` - 4P4C * `4p2c` - 4P2C * `gg45` - GG45 * `tera-4p` - TERA 4P * `tera-2p` - TERA 2P * `tera-1p` - TERA 1P * `110-punch` - 110 Punch * `bnc` - BNC * `f` - F Connector * `n` - N Connector * `mrj21` - MRJ21 * `fc` - FC * `lc` - LC * `lc-pc` - LC/PC * `lc-upc` - LC/UPC * `lc-apc` - LC/APC * `lsh` - LSH * `lsh-pc` - LSH/PC * `lsh-upc` - LSH/UPC * `lsh-apc` - LSH/APC * `lx5` - LX.5 * `lx5-pc` - LX.5/PC * `lx5-upc` - LX.5/UPC * `lx5-apc` - LX.5/APC * `mpo` - MPO * `mtrj` - MTRJ * `sc` - SC * `sc-pc` - SC/PC * `sc-upc` - SC/UPC * `sc-apc` - SC/APC * `st` - ST * `cs` - CS * `sn` - SN * `sma-905` - SMA 905 * `sma-906` - SMA 906 * `urm-p2` - URM-P2 * `urm-p4` - URM-P4 * `urm-p8` - URM-P8 * `splice` - Splice * `other` - Other +type FrontPortTypeValue string + +// List of FrontPort_type_value +const ( + FRONTPORTTYPEVALUE__8P8C FrontPortTypeValue = "8p8c" + FRONTPORTTYPEVALUE__8P6C FrontPortTypeValue = "8p6c" + FRONTPORTTYPEVALUE__8P4C FrontPortTypeValue = "8p4c" + FRONTPORTTYPEVALUE__8P2C FrontPortTypeValue = "8p2c" + FRONTPORTTYPEVALUE__6P6C FrontPortTypeValue = "6p6c" + FRONTPORTTYPEVALUE__6P4C FrontPortTypeValue = "6p4c" + FRONTPORTTYPEVALUE__6P2C FrontPortTypeValue = "6p2c" + FRONTPORTTYPEVALUE__4P4C FrontPortTypeValue = "4p4c" + FRONTPORTTYPEVALUE__4P2C FrontPortTypeValue = "4p2c" + FRONTPORTTYPEVALUE_GG45 FrontPortTypeValue = "gg45" + FRONTPORTTYPEVALUE_TERA_4P FrontPortTypeValue = "tera-4p" + FRONTPORTTYPEVALUE_TERA_2P FrontPortTypeValue = "tera-2p" + FRONTPORTTYPEVALUE_TERA_1P FrontPortTypeValue = "tera-1p" + FRONTPORTTYPEVALUE__110_PUNCH FrontPortTypeValue = "110-punch" + FRONTPORTTYPEVALUE_BNC FrontPortTypeValue = "bnc" + FRONTPORTTYPEVALUE_F FrontPortTypeValue = "f" + FRONTPORTTYPEVALUE_N FrontPortTypeValue = "n" + FRONTPORTTYPEVALUE_MRJ21 FrontPortTypeValue = "mrj21" + FRONTPORTTYPEVALUE_FC FrontPortTypeValue = "fc" + FRONTPORTTYPEVALUE_LC FrontPortTypeValue = "lc" + FRONTPORTTYPEVALUE_LC_PC FrontPortTypeValue = "lc-pc" + FRONTPORTTYPEVALUE_LC_UPC FrontPortTypeValue = "lc-upc" + FRONTPORTTYPEVALUE_LC_APC FrontPortTypeValue = "lc-apc" + FRONTPORTTYPEVALUE_LSH FrontPortTypeValue = "lsh" + FRONTPORTTYPEVALUE_LSH_PC FrontPortTypeValue = "lsh-pc" + FRONTPORTTYPEVALUE_LSH_UPC FrontPortTypeValue = "lsh-upc" + FRONTPORTTYPEVALUE_LSH_APC FrontPortTypeValue = "lsh-apc" + FRONTPORTTYPEVALUE_LX5 FrontPortTypeValue = "lx5" + FRONTPORTTYPEVALUE_LX5_PC FrontPortTypeValue = "lx5-pc" + FRONTPORTTYPEVALUE_LX5_UPC FrontPortTypeValue = "lx5-upc" + FRONTPORTTYPEVALUE_LX5_APC FrontPortTypeValue = "lx5-apc" + FRONTPORTTYPEVALUE_MPO FrontPortTypeValue = "mpo" + FRONTPORTTYPEVALUE_MTRJ FrontPortTypeValue = "mtrj" + FRONTPORTTYPEVALUE_SC FrontPortTypeValue = "sc" + FRONTPORTTYPEVALUE_SC_PC FrontPortTypeValue = "sc-pc" + FRONTPORTTYPEVALUE_SC_UPC FrontPortTypeValue = "sc-upc" + FRONTPORTTYPEVALUE_SC_APC FrontPortTypeValue = "sc-apc" + FRONTPORTTYPEVALUE_ST FrontPortTypeValue = "st" + FRONTPORTTYPEVALUE_CS FrontPortTypeValue = "cs" + FRONTPORTTYPEVALUE_SN FrontPortTypeValue = "sn" + FRONTPORTTYPEVALUE_SMA_905 FrontPortTypeValue = "sma-905" + FRONTPORTTYPEVALUE_SMA_906 FrontPortTypeValue = "sma-906" + FRONTPORTTYPEVALUE_URM_P2 FrontPortTypeValue = "urm-p2" + FRONTPORTTYPEVALUE_URM_P4 FrontPortTypeValue = "urm-p4" + FRONTPORTTYPEVALUE_URM_P8 FrontPortTypeValue = "urm-p8" + FRONTPORTTYPEVALUE_SPLICE FrontPortTypeValue = "splice" + FRONTPORTTYPEVALUE_OTHER FrontPortTypeValue = "other" +) + +// All allowed values of FrontPortTypeValue enum +var AllowedFrontPortTypeValueEnumValues = []FrontPortTypeValue{ + "8p8c", + "8p6c", + "8p4c", + "8p2c", + "6p6c", + "6p4c", + "6p2c", + "4p4c", + "4p2c", + "gg45", + "tera-4p", + "tera-2p", + "tera-1p", + "110-punch", + "bnc", + "f", + "n", + "mrj21", + "fc", + "lc", + "lc-pc", + "lc-upc", + "lc-apc", + "lsh", + "lsh-pc", + "lsh-upc", + "lsh-apc", + "lx5", + "lx5-pc", + "lx5-upc", + "lx5-apc", + "mpo", + "mtrj", + "sc", + "sc-pc", + "sc-upc", + "sc-apc", + "st", + "cs", + "sn", + "sma-905", + "sma-906", + "urm-p2", + "urm-p4", + "urm-p8", + "splice", + "other", +} + +func (v *FrontPortTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FrontPortTypeValue(value) + for _, existing := range AllowedFrontPortTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FrontPortTypeValue", value) +} + +// NewFrontPortTypeValueFromValue returns a pointer to a valid FrontPortTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFrontPortTypeValueFromValue(v string) (*FrontPortTypeValue, error) { + ev := FrontPortTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FrontPortTypeValue: valid values are %v", v, AllowedFrontPortTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FrontPortTypeValue) IsValid() bool { + for _, existing := range AllowedFrontPortTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FrontPort_type_value value +func (v FrontPortTypeValue) Ptr() *FrontPortTypeValue { + return &v +} + +type NullableFrontPortTypeValue struct { + value *FrontPortTypeValue + isSet bool +} + +func (v NullableFrontPortTypeValue) Get() *FrontPortTypeValue { + return v.value +} + +func (v *NullableFrontPortTypeValue) Set(val *FrontPortTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableFrontPortTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableFrontPortTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrontPortTypeValue(val *FrontPortTypeValue) *NullableFrontPortTypeValue { + return &NullableFrontPortTypeValue{value: val, isSet: true} +} + +func (v NullableFrontPortTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrontPortTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_generic_object.go b/vendor/github.com/netbox-community/go-netbox/v3/model_generic_object.go new file mode 100644 index 00000000..3617dc5c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_generic_object.go @@ -0,0 +1,228 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the GenericObject type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericObject{} + +// GenericObject Minimal representation of some generic object identified by ContentType and PK. +type GenericObject struct { + ObjectType string `json:"object_type"` + ObjectId int32 `json:"object_id"` + Object interface{} `json:"object"` + AdditionalProperties map[string]interface{} +} + +type _GenericObject GenericObject + +// NewGenericObject instantiates a new GenericObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGenericObject(objectType string, objectId int32, object interface{}) *GenericObject { + this := GenericObject{} + this.ObjectType = objectType + this.ObjectId = objectId + this.Object = object + return &this +} + +// NewGenericObjectWithDefaults instantiates a new GenericObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenericObjectWithDefaults() *GenericObject { + this := GenericObject{} + return &this +} + +// GetObjectType returns the ObjectType field value +func (o *GenericObject) GetObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectType +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value +// and a boolean to check if the value has been set. +func (o *GenericObject) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectType, true +} + +// SetObjectType sets field value +func (o *GenericObject) SetObjectType(v string) { + o.ObjectType = v +} + +// GetObjectId returns the ObjectId field value +func (o *GenericObject) GetObjectId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *GenericObject) GetObjectIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *GenericObject) SetObjectId(v int32) { + o.ObjectId = v +} + +// GetObject returns the Object field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *GenericObject) GetObject() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GenericObject) GetObjectOk() (*interface{}, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return &o.Object, true +} + +// SetObject sets field value +func (o *GenericObject) SetObject(v interface{}) { + o.Object = v +} + +func (o GenericObject) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericObject) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["object_type"] = o.ObjectType + toSerialize["object_id"] = o.ObjectId + if o.Object != nil { + toSerialize["object"] = o.Object + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GenericObject) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "object_type", + "object_id", + "object", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenericObject := _GenericObject{} + + err = json.Unmarshal(data, &varGenericObject) + + if err != nil { + return err + } + + *o = GenericObject(varGenericObject) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "object") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGenericObject struct { + value *GenericObject + isSet bool +} + +func (v NullableGenericObject) Get() *GenericObject { + return v.value +} + +func (v *NullableGenericObject) Set(val *GenericObject) { + v.value = val + v.isSet = true +} + +func (v NullableGenericObject) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericObject(val *GenericObject) *NullableGenericObject { + return &NullableGenericObject{value: val, isSet: true} +} + +func (v NullableGenericObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_generic_object_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_generic_object_request.go new file mode 100644 index 00000000..3f2492eb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_generic_object_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the GenericObjectRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericObjectRequest{} + +// GenericObjectRequest Minimal representation of some generic object identified by ContentType and PK. +type GenericObjectRequest struct { + ObjectType string `json:"object_type"` + ObjectId int32 `json:"object_id"` + AdditionalProperties map[string]interface{} +} + +type _GenericObjectRequest GenericObjectRequest + +// NewGenericObjectRequest instantiates a new GenericObjectRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGenericObjectRequest(objectType string, objectId int32) *GenericObjectRequest { + this := GenericObjectRequest{} + this.ObjectType = objectType + this.ObjectId = objectId + return &this +} + +// NewGenericObjectRequestWithDefaults instantiates a new GenericObjectRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenericObjectRequestWithDefaults() *GenericObjectRequest { + this := GenericObjectRequest{} + return &this +} + +// GetObjectType returns the ObjectType field value +func (o *GenericObjectRequest) GetObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectType +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value +// and a boolean to check if the value has been set. +func (o *GenericObjectRequest) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectType, true +} + +// SetObjectType sets field value +func (o *GenericObjectRequest) SetObjectType(v string) { + o.ObjectType = v +} + +// GetObjectId returns the ObjectId field value +func (o *GenericObjectRequest) GetObjectId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *GenericObjectRequest) GetObjectIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *GenericObjectRequest) SetObjectId(v int32) { + o.ObjectId = v +} + +func (o GenericObjectRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericObjectRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["object_type"] = o.ObjectType + toSerialize["object_id"] = o.ObjectId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GenericObjectRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "object_type", + "object_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenericObjectRequest := _GenericObjectRequest{} + + err = json.Unmarshal(data, &varGenericObjectRequest) + + if err != nil { + return err + } + + *o = GenericObjectRequest(varGenericObjectRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object_type") + delete(additionalProperties, "object_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGenericObjectRequest struct { + value *GenericObjectRequest + isSet bool +} + +func (v NullableGenericObjectRequest) Get() *GenericObjectRequest { + return v.value +} + +func (v *NullableGenericObjectRequest) Set(val *GenericObjectRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGenericObjectRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericObjectRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericObjectRequest(val *GenericObjectRequest) *NullableGenericObjectRequest { + return &NullableGenericObjectRequest{value: val, isSet: true} +} + +func (v NullableGenericObjectRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericObjectRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_group.go new file mode 100644 index 00000000..a945c262 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_group.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the Group type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Group{} + +// Group Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type Group struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + UserCount int32 `json:"user_count"` + AdditionalProperties map[string]interface{} +} + +type _Group Group + +// NewGroup instantiates a new Group object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroup(id int32, url string, display string, name string, userCount int32) *Group { + this := Group{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.UserCount = userCount + return &this +} + +// NewGroupWithDefaults instantiates a new Group object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupWithDefaults() *Group { + this := Group{} + return &this +} + +// GetId returns the Id field value +func (o *Group) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Group) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Group) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Group) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Group) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Group) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Group) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Group) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Group) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Group) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Group) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Group) SetName(v string) { + o.Name = v +} + +// GetUserCount returns the UserCount field value +func (o *Group) GetUserCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.UserCount +} + +// GetUserCountOk returns a tuple with the UserCount field value +// and a boolean to check if the value has been set. +func (o *Group) GetUserCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.UserCount, true +} + +// SetUserCount sets field value +func (o *Group) SetUserCount(v int32) { + o.UserCount = v +} + +func (o Group) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Group) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["user_count"] = o.UserCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Group) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "user_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroup := _Group{} + + err = json.Unmarshal(data, &varGroup) + + if err != nil { + return err + } + + *o = Group(varGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "user_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroup struct { + value *Group + isSet bool +} + +func (v NullableGroup) Get() *Group { + return v.value +} + +func (v *NullableGroup) Set(val *Group) { + v.value = val + v.isSet = true +} + +func (v NullableGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroup(val *Group) *NullableGroup { + return &NullableGroup{value: val, isSet: true} +} + +func (v NullableGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_group_request.go new file mode 100644 index 00000000..4fa91450 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_group_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupRequest{} + +// GroupRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type GroupRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _GroupRequest GroupRequest + +// NewGroupRequest instantiates a new GroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupRequest(name string) *GroupRequest { + this := GroupRequest{} + this.Name = name + return &this +} + +// NewGroupRequestWithDefaults instantiates a new GroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupRequestWithDefaults() *GroupRequest { + this := GroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *GroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GroupRequest) SetName(v string) { + o.Name = v +} + +func (o GroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupRequest := _GroupRequest{} + + err = json.Unmarshal(data, &varGroupRequest) + + if err != nil { + return err + } + + *o = GroupRequest(varGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupRequest struct { + value *GroupRequest + isSet bool +} + +func (v NullableGroupRequest) Get() *GroupRequest { + return v.value +} + +func (v *NullableGroupRequest) Set(val *GroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupRequest(val *GroupRequest) *NullableGroupRequest { + return &NullableGroupRequest{value: val, isSet: true} +} + +func (v NullableGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy.go new file mode 100644 index 00000000..35ca3ad0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy.go @@ -0,0 +1,596 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IKEPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEPolicy{} + +// IKEPolicy Adds support for custom fields and tags. +type IKEPolicy struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Version IKEPolicyVersion `json:"version"` + Mode IKEPolicyMode `json:"mode"` + Proposals []int32 `json:"proposals,omitempty"` + PresharedKey *string `json:"preshared_key,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _IKEPolicy IKEPolicy + +// NewIKEPolicy instantiates a new IKEPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEPolicy(id int32, url string, display string, name string, version IKEPolicyVersion, mode IKEPolicyMode, created NullableTime, lastUpdated NullableTime) *IKEPolicy { + this := IKEPolicy{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Version = version + this.Mode = mode + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewIKEPolicyWithDefaults instantiates a new IKEPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEPolicyWithDefaults() *IKEPolicy { + this := IKEPolicy{} + return &this +} + +// GetId returns the Id field value +func (o *IKEPolicy) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *IKEPolicy) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *IKEPolicy) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *IKEPolicy) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *IKEPolicy) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *IKEPolicy) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *IKEPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IKEPolicy) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IKEPolicy) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IKEPolicy) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IKEPolicy) SetDescription(v string) { + o.Description = &v +} + +// GetVersion returns the Version field value +func (o *IKEPolicy) GetVersion() IKEPolicyVersion { + if o == nil { + var ret IKEPolicyVersion + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetVersionOk() (*IKEPolicyVersion, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *IKEPolicy) SetVersion(v IKEPolicyVersion) { + o.Version = v +} + +// GetMode returns the Mode field value +func (o *IKEPolicy) GetMode() IKEPolicyMode { + if o == nil { + var ret IKEPolicyMode + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetModeOk() (*IKEPolicyMode, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *IKEPolicy) SetMode(v IKEPolicyMode) { + o.Mode = v +} + +// GetProposals returns the Proposals field value if set, zero value otherwise. +func (o *IKEPolicy) GetProposals() []int32 { + if o == nil || IsNil(o.Proposals) { + var ret []int32 + return ret + } + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetProposalsOk() ([]int32, bool) { + if o == nil || IsNil(o.Proposals) { + return nil, false + } + return o.Proposals, true +} + +// HasProposals returns a boolean if a field has been set. +func (o *IKEPolicy) HasProposals() bool { + if o != nil && !IsNil(o.Proposals) { + return true + } + + return false +} + +// SetProposals gets a reference to the given []int32 and assigns it to the Proposals field. +func (o *IKEPolicy) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPresharedKey returns the PresharedKey field value if set, zero value otherwise. +func (o *IKEPolicy) GetPresharedKey() string { + if o == nil || IsNil(o.PresharedKey) { + var ret string + return ret + } + return *o.PresharedKey +} + +// GetPresharedKeyOk returns a tuple with the PresharedKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetPresharedKeyOk() (*string, bool) { + if o == nil || IsNil(o.PresharedKey) { + return nil, false + } + return o.PresharedKey, true +} + +// HasPresharedKey returns a boolean if a field has been set. +func (o *IKEPolicy) HasPresharedKey() bool { + if o != nil && !IsNil(o.PresharedKey) { + return true + } + + return false +} + +// SetPresharedKey gets a reference to the given string and assigns it to the PresharedKey field. +func (o *IKEPolicy) SetPresharedKey(v string) { + o.PresharedKey = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IKEPolicy) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IKEPolicy) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IKEPolicy) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IKEPolicy) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IKEPolicy) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *IKEPolicy) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IKEPolicy) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicy) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IKEPolicy) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IKEPolicy) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IKEPolicy) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IKEPolicy) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *IKEPolicy) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IKEPolicy) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IKEPolicy) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *IKEPolicy) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o IKEPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["version"] = o.Version + toSerialize["mode"] = o.Mode + if !IsNil(o.Proposals) { + toSerialize["proposals"] = o.Proposals + } + if !IsNil(o.PresharedKey) { + toSerialize["preshared_key"] = o.PresharedKey + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "version", + "mode", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIKEPolicy := _IKEPolicy{} + + err = json.Unmarshal(data, &varIKEPolicy) + + if err != nil { + return err + } + + *o = IKEPolicy(varIKEPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "version") + delete(additionalProperties, "mode") + delete(additionalProperties, "proposals") + delete(additionalProperties, "preshared_key") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEPolicy struct { + value *IKEPolicy + isSet bool +} + +func (v NullableIKEPolicy) Get() *IKEPolicy { + return v.value +} + +func (v *NullableIKEPolicy) Set(val *IKEPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicy(val *IKEPolicy) *NullableIKEPolicy { + return &NullableIKEPolicy{value: val, isSet: true} +} + +func (v NullableIKEPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode.go new file mode 100644 index 00000000..26259def --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IKEPolicyMode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEPolicyMode{} + +// IKEPolicyMode struct for IKEPolicyMode +type IKEPolicyMode struct { + Value *IKEPolicyModeValue `json:"value,omitempty"` + Label *IKEPolicyModeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEPolicyMode IKEPolicyMode + +// NewIKEPolicyMode instantiates a new IKEPolicyMode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEPolicyMode() *IKEPolicyMode { + this := IKEPolicyMode{} + return &this +} + +// NewIKEPolicyModeWithDefaults instantiates a new IKEPolicyMode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEPolicyModeWithDefaults() *IKEPolicyMode { + this := IKEPolicyMode{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IKEPolicyMode) GetValue() IKEPolicyModeValue { + if o == nil || IsNil(o.Value) { + var ret IKEPolicyModeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyMode) GetValueOk() (*IKEPolicyModeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IKEPolicyMode) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IKEPolicyModeValue and assigns it to the Value field. +func (o *IKEPolicyMode) SetValue(v IKEPolicyModeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IKEPolicyMode) GetLabel() IKEPolicyModeLabel { + if o == nil || IsNil(o.Label) { + var ret IKEPolicyModeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyMode) GetLabelOk() (*IKEPolicyModeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IKEPolicyMode) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IKEPolicyModeLabel and assigns it to the Label field. +func (o *IKEPolicyMode) SetLabel(v IKEPolicyModeLabel) { + o.Label = &v +} + +func (o IKEPolicyMode) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEPolicyMode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEPolicyMode) UnmarshalJSON(data []byte) (err error) { + varIKEPolicyMode := _IKEPolicyMode{} + + err = json.Unmarshal(data, &varIKEPolicyMode) + + if err != nil { + return err + } + + *o = IKEPolicyMode(varIKEPolicyMode) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEPolicyMode struct { + value *IKEPolicyMode + isSet bool +} + +func (v NullableIKEPolicyMode) Get() *IKEPolicyMode { + return v.value +} + +func (v *NullableIKEPolicyMode) Set(val *IKEPolicyMode) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicyMode) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicyMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicyMode(val *IKEPolicyMode) *NullableIKEPolicyMode { + return &NullableIKEPolicyMode{value: val, isSet: true} +} + +func (v NullableIKEPolicyMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicyMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode_label.go new file mode 100644 index 00000000..2e0201cc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEPolicyModeLabel the model 'IKEPolicyModeLabel' +type IKEPolicyModeLabel string + +// List of IKEPolicy_mode_label +const ( + IKEPOLICYMODELABEL_AGGRESSIVE IKEPolicyModeLabel = "Aggressive" + IKEPOLICYMODELABEL_MAIN IKEPolicyModeLabel = "Main" +) + +// All allowed values of IKEPolicyModeLabel enum +var AllowedIKEPolicyModeLabelEnumValues = []IKEPolicyModeLabel{ + "Aggressive", + "Main", +} + +func (v *IKEPolicyModeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEPolicyModeLabel(value) + for _, existing := range AllowedIKEPolicyModeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEPolicyModeLabel", value) +} + +// NewIKEPolicyModeLabelFromValue returns a pointer to a valid IKEPolicyModeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEPolicyModeLabelFromValue(v string) (*IKEPolicyModeLabel, error) { + ev := IKEPolicyModeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEPolicyModeLabel: valid values are %v", v, AllowedIKEPolicyModeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEPolicyModeLabel) IsValid() bool { + for _, existing := range AllowedIKEPolicyModeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEPolicy_mode_label value +func (v IKEPolicyModeLabel) Ptr() *IKEPolicyModeLabel { + return &v +} + +type NullableIKEPolicyModeLabel struct { + value *IKEPolicyModeLabel + isSet bool +} + +func (v NullableIKEPolicyModeLabel) Get() *IKEPolicyModeLabel { + return v.value +} + +func (v *NullableIKEPolicyModeLabel) Set(val *IKEPolicyModeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicyModeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicyModeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicyModeLabel(val *IKEPolicyModeLabel) *NullableIKEPolicyModeLabel { + return &NullableIKEPolicyModeLabel{value: val, isSet: true} +} + +func (v NullableIKEPolicyModeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicyModeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode_value.go new file mode 100644 index 00000000..6650a130 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_mode_value.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEPolicyModeValue * `aggressive` - Aggressive * `main` - Main +type IKEPolicyModeValue string + +// List of IKEPolicy_mode_value +const ( + IKEPOLICYMODEVALUE_AGGRESSIVE IKEPolicyModeValue = "aggressive" + IKEPOLICYMODEVALUE_MAIN IKEPolicyModeValue = "main" +) + +// All allowed values of IKEPolicyModeValue enum +var AllowedIKEPolicyModeValueEnumValues = []IKEPolicyModeValue{ + "aggressive", + "main", +} + +func (v *IKEPolicyModeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEPolicyModeValue(value) + for _, existing := range AllowedIKEPolicyModeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEPolicyModeValue", value) +} + +// NewIKEPolicyModeValueFromValue returns a pointer to a valid IKEPolicyModeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEPolicyModeValueFromValue(v string) (*IKEPolicyModeValue, error) { + ev := IKEPolicyModeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEPolicyModeValue: valid values are %v", v, AllowedIKEPolicyModeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEPolicyModeValue) IsValid() bool { + for _, existing := range AllowedIKEPolicyModeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEPolicy_mode_value value +func (v IKEPolicyModeValue) Ptr() *IKEPolicyModeValue { + return &v +} + +type NullableIKEPolicyModeValue struct { + value *IKEPolicyModeValue + isSet bool +} + +func (v NullableIKEPolicyModeValue) Get() *IKEPolicyModeValue { + return v.value +} + +func (v *NullableIKEPolicyModeValue) Set(val *IKEPolicyModeValue) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicyModeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicyModeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicyModeValue(val *IKEPolicyModeValue) *NullableIKEPolicyModeValue { + return &NullableIKEPolicyModeValue{value: val, isSet: true} +} + +func (v NullableIKEPolicyModeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicyModeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_request.go new file mode 100644 index 00000000..3047e492 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_request.go @@ -0,0 +1,446 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the IKEPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEPolicyRequest{} + +// IKEPolicyRequest Adds support for custom fields and tags. +type IKEPolicyRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Version IKEPolicyVersionValue `json:"version"` + Mode IKEPolicyModeValue `json:"mode"` + Proposals []int32 `json:"proposals,omitempty"` + PresharedKey *string `json:"preshared_key,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEPolicyRequest IKEPolicyRequest + +// NewIKEPolicyRequest instantiates a new IKEPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEPolicyRequest(name string, version IKEPolicyVersionValue, mode IKEPolicyModeValue) *IKEPolicyRequest { + this := IKEPolicyRequest{} + this.Name = name + this.Version = version + this.Mode = mode + return &this +} + +// NewIKEPolicyRequestWithDefaults instantiates a new IKEPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEPolicyRequestWithDefaults() *IKEPolicyRequest { + this := IKEPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *IKEPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IKEPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IKEPolicyRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IKEPolicyRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IKEPolicyRequest) SetDescription(v string) { + o.Description = &v +} + +// GetVersion returns the Version field value +func (o *IKEPolicyRequest) GetVersion() IKEPolicyVersionValue { + if o == nil { + var ret IKEPolicyVersionValue + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetVersionOk() (*IKEPolicyVersionValue, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *IKEPolicyRequest) SetVersion(v IKEPolicyVersionValue) { + o.Version = v +} + +// GetMode returns the Mode field value +func (o *IKEPolicyRequest) GetMode() IKEPolicyModeValue { + if o == nil { + var ret IKEPolicyModeValue + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetModeOk() (*IKEPolicyModeValue, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *IKEPolicyRequest) SetMode(v IKEPolicyModeValue) { + o.Mode = v +} + +// GetProposals returns the Proposals field value if set, zero value otherwise. +func (o *IKEPolicyRequest) GetProposals() []int32 { + if o == nil || IsNil(o.Proposals) { + var ret []int32 + return ret + } + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetProposalsOk() ([]int32, bool) { + if o == nil || IsNil(o.Proposals) { + return nil, false + } + return o.Proposals, true +} + +// HasProposals returns a boolean if a field has been set. +func (o *IKEPolicyRequest) HasProposals() bool { + if o != nil && !IsNil(o.Proposals) { + return true + } + + return false +} + +// SetProposals gets a reference to the given []int32 and assigns it to the Proposals field. +func (o *IKEPolicyRequest) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPresharedKey returns the PresharedKey field value if set, zero value otherwise. +func (o *IKEPolicyRequest) GetPresharedKey() string { + if o == nil || IsNil(o.PresharedKey) { + var ret string + return ret + } + return *o.PresharedKey +} + +// GetPresharedKeyOk returns a tuple with the PresharedKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetPresharedKeyOk() (*string, bool) { + if o == nil || IsNil(o.PresharedKey) { + return nil, false + } + return o.PresharedKey, true +} + +// HasPresharedKey returns a boolean if a field has been set. +func (o *IKEPolicyRequest) HasPresharedKey() bool { + if o != nil && !IsNil(o.PresharedKey) { + return true + } + + return false +} + +// SetPresharedKey gets a reference to the given string and assigns it to the PresharedKey field. +func (o *IKEPolicyRequest) SetPresharedKey(v string) { + o.PresharedKey = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IKEPolicyRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IKEPolicyRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IKEPolicyRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IKEPolicyRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IKEPolicyRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *IKEPolicyRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IKEPolicyRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IKEPolicyRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IKEPolicyRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o IKEPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["version"] = o.Version + toSerialize["mode"] = o.Mode + if !IsNil(o.Proposals) { + toSerialize["proposals"] = o.Proposals + } + if !IsNil(o.PresharedKey) { + toSerialize["preshared_key"] = o.PresharedKey + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "version", + "mode", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIKEPolicyRequest := _IKEPolicyRequest{} + + err = json.Unmarshal(data, &varIKEPolicyRequest) + + if err != nil { + return err + } + + *o = IKEPolicyRequest(varIKEPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "version") + delete(additionalProperties, "mode") + delete(additionalProperties, "proposals") + delete(additionalProperties, "preshared_key") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEPolicyRequest struct { + value *IKEPolicyRequest + isSet bool +} + +func (v NullableIKEPolicyRequest) Get() *IKEPolicyRequest { + return v.value +} + +func (v *NullableIKEPolicyRequest) Set(val *IKEPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicyRequest(val *IKEPolicyRequest) *NullableIKEPolicyRequest { + return &NullableIKEPolicyRequest{value: val, isSet: true} +} + +func (v NullableIKEPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version.go new file mode 100644 index 00000000..a5b1dc63 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IKEPolicyVersion type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEPolicyVersion{} + +// IKEPolicyVersion struct for IKEPolicyVersion +type IKEPolicyVersion struct { + Value *IKEPolicyVersionValue `json:"value,omitempty"` + Label *IKEPolicyVersionLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEPolicyVersion IKEPolicyVersion + +// NewIKEPolicyVersion instantiates a new IKEPolicyVersion object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEPolicyVersion() *IKEPolicyVersion { + this := IKEPolicyVersion{} + return &this +} + +// NewIKEPolicyVersionWithDefaults instantiates a new IKEPolicyVersion object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEPolicyVersionWithDefaults() *IKEPolicyVersion { + this := IKEPolicyVersion{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IKEPolicyVersion) GetValue() IKEPolicyVersionValue { + if o == nil || IsNil(o.Value) { + var ret IKEPolicyVersionValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyVersion) GetValueOk() (*IKEPolicyVersionValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IKEPolicyVersion) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IKEPolicyVersionValue and assigns it to the Value field. +func (o *IKEPolicyVersion) SetValue(v IKEPolicyVersionValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IKEPolicyVersion) GetLabel() IKEPolicyVersionLabel { + if o == nil || IsNil(o.Label) { + var ret IKEPolicyVersionLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEPolicyVersion) GetLabelOk() (*IKEPolicyVersionLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IKEPolicyVersion) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IKEPolicyVersionLabel and assigns it to the Label field. +func (o *IKEPolicyVersion) SetLabel(v IKEPolicyVersionLabel) { + o.Label = &v +} + +func (o IKEPolicyVersion) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEPolicyVersion) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEPolicyVersion) UnmarshalJSON(data []byte) (err error) { + varIKEPolicyVersion := _IKEPolicyVersion{} + + err = json.Unmarshal(data, &varIKEPolicyVersion) + + if err != nil { + return err + } + + *o = IKEPolicyVersion(varIKEPolicyVersion) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEPolicyVersion struct { + value *IKEPolicyVersion + isSet bool +} + +func (v NullableIKEPolicyVersion) Get() *IKEPolicyVersion { + return v.value +} + +func (v *NullableIKEPolicyVersion) Set(val *IKEPolicyVersion) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicyVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicyVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicyVersion(val *IKEPolicyVersion) *NullableIKEPolicyVersion { + return &NullableIKEPolicyVersion{value: val, isSet: true} +} + +func (v NullableIKEPolicyVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicyVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version_label.go new file mode 100644 index 00000000..dd68223c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEPolicyVersionLabel the model 'IKEPolicyVersionLabel' +type IKEPolicyVersionLabel string + +// List of IKEPolicy_version_label +const ( + IKEPOLICYVERSIONLABEL_IKEV1 IKEPolicyVersionLabel = "IKEv1" + IKEPOLICYVERSIONLABEL_IKEV2 IKEPolicyVersionLabel = "IKEv2" +) + +// All allowed values of IKEPolicyVersionLabel enum +var AllowedIKEPolicyVersionLabelEnumValues = []IKEPolicyVersionLabel{ + "IKEv1", + "IKEv2", +} + +func (v *IKEPolicyVersionLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEPolicyVersionLabel(value) + for _, existing := range AllowedIKEPolicyVersionLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEPolicyVersionLabel", value) +} + +// NewIKEPolicyVersionLabelFromValue returns a pointer to a valid IKEPolicyVersionLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEPolicyVersionLabelFromValue(v string) (*IKEPolicyVersionLabel, error) { + ev := IKEPolicyVersionLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEPolicyVersionLabel: valid values are %v", v, AllowedIKEPolicyVersionLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEPolicyVersionLabel) IsValid() bool { + for _, existing := range AllowedIKEPolicyVersionLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEPolicy_version_label value +func (v IKEPolicyVersionLabel) Ptr() *IKEPolicyVersionLabel { + return &v +} + +type NullableIKEPolicyVersionLabel struct { + value *IKEPolicyVersionLabel + isSet bool +} + +func (v NullableIKEPolicyVersionLabel) Get() *IKEPolicyVersionLabel { + return v.value +} + +func (v *NullableIKEPolicyVersionLabel) Set(val *IKEPolicyVersionLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicyVersionLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicyVersionLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicyVersionLabel(val *IKEPolicyVersionLabel) *NullableIKEPolicyVersionLabel { + return &NullableIKEPolicyVersionLabel{value: val, isSet: true} +} + +func (v NullableIKEPolicyVersionLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicyVersionLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version_value.go new file mode 100644 index 00000000..9189d82a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_policy_version_value.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEPolicyVersionValue * `1` - IKEv1 * `2` - IKEv2 +type IKEPolicyVersionValue int32 + +// List of IKEPolicy_version_value +const ( + IKEPOLICYVERSIONVALUE__1 IKEPolicyVersionValue = 1 + IKEPOLICYVERSIONVALUE__2 IKEPolicyVersionValue = 2 +) + +// All allowed values of IKEPolicyVersionValue enum +var AllowedIKEPolicyVersionValueEnumValues = []IKEPolicyVersionValue{ + 1, + 2, +} + +func (v *IKEPolicyVersionValue) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEPolicyVersionValue(value) + for _, existing := range AllowedIKEPolicyVersionValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEPolicyVersionValue", value) +} + +// NewIKEPolicyVersionValueFromValue returns a pointer to a valid IKEPolicyVersionValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEPolicyVersionValueFromValue(v int32) (*IKEPolicyVersionValue, error) { + ev := IKEPolicyVersionValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEPolicyVersionValue: valid values are %v", v, AllowedIKEPolicyVersionValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEPolicyVersionValue) IsValid() bool { + for _, existing := range AllowedIKEPolicyVersionValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEPolicy_version_value value +func (v IKEPolicyVersionValue) Ptr() *IKEPolicyVersionValue { + return &v +} + +type NullableIKEPolicyVersionValue struct { + value *IKEPolicyVersionValue + isSet bool +} + +func (v NullableIKEPolicyVersionValue) Get() *IKEPolicyVersionValue { + return v.value +} + +func (v *NullableIKEPolicyVersionValue) Set(val *IKEPolicyVersionValue) { + v.value = val + v.isSet = true +} + +func (v NullableIKEPolicyVersionValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEPolicyVersionValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEPolicyVersionValue(val *IKEPolicyVersionValue) *NullableIKEPolicyVersionValue { + return &NullableIKEPolicyVersionValue{value: val, isSet: true} +} + +func (v NullableIKEPolicyVersionValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEPolicyVersionValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal.go new file mode 100644 index 00000000..aa2d28bc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal.go @@ -0,0 +1,629 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IKEProposal type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEProposal{} + +// IKEProposal Adds support for custom fields and tags. +type IKEProposal struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + AuthenticationMethod IKEProposalAuthenticationMethod `json:"authentication_method"` + EncryptionAlgorithm IKEProposalEncryptionAlgorithm `json:"encryption_algorithm"` + AuthenticationAlgorithm IKEProposalAuthenticationAlgorithm `json:"authentication_algorithm"` + Group IKEProposalGroup `json:"group"` + // Security association lifetime (in seconds) + SaLifetime NullableInt32 `json:"sa_lifetime,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _IKEProposal IKEProposal + +// NewIKEProposal instantiates a new IKEProposal object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEProposal(id int32, url string, display string, name string, authenticationMethod IKEProposalAuthenticationMethod, encryptionAlgorithm IKEProposalEncryptionAlgorithm, authenticationAlgorithm IKEProposalAuthenticationAlgorithm, group IKEProposalGroup, created NullableTime, lastUpdated NullableTime) *IKEProposal { + this := IKEProposal{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.AuthenticationMethod = authenticationMethod + this.EncryptionAlgorithm = encryptionAlgorithm + this.AuthenticationAlgorithm = authenticationAlgorithm + this.Group = group + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewIKEProposalWithDefaults instantiates a new IKEProposal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEProposalWithDefaults() *IKEProposal { + this := IKEProposal{} + return &this +} + +// GetId returns the Id field value +func (o *IKEProposal) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *IKEProposal) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *IKEProposal) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *IKEProposal) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *IKEProposal) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *IKEProposal) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *IKEProposal) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IKEProposal) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IKEProposal) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IKEProposal) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IKEProposal) SetDescription(v string) { + o.Description = &v +} + +// GetAuthenticationMethod returns the AuthenticationMethod field value +func (o *IKEProposal) GetAuthenticationMethod() IKEProposalAuthenticationMethod { + if o == nil { + var ret IKEProposalAuthenticationMethod + return ret + } + + return o.AuthenticationMethod +} + +// GetAuthenticationMethodOk returns a tuple with the AuthenticationMethod field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetAuthenticationMethodOk() (*IKEProposalAuthenticationMethod, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationMethod, true +} + +// SetAuthenticationMethod sets field value +func (o *IKEProposal) SetAuthenticationMethod(v IKEProposalAuthenticationMethod) { + o.AuthenticationMethod = v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value +func (o *IKEProposal) GetEncryptionAlgorithm() IKEProposalEncryptionAlgorithm { + if o == nil { + var ret IKEProposalEncryptionAlgorithm + return ret + } + + return o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetEncryptionAlgorithmOk() (*IKEProposalEncryptionAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.EncryptionAlgorithm, true +} + +// SetEncryptionAlgorithm sets field value +func (o *IKEProposal) SetEncryptionAlgorithm(v IKEProposalEncryptionAlgorithm) { + o.EncryptionAlgorithm = v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value +func (o *IKEProposal) GetAuthenticationAlgorithm() IKEProposalAuthenticationAlgorithm { + if o == nil { + var ret IKEProposalAuthenticationAlgorithm + return ret + } + + return o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetAuthenticationAlgorithmOk() (*IKEProposalAuthenticationAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationAlgorithm, true +} + +// SetAuthenticationAlgorithm sets field value +func (o *IKEProposal) SetAuthenticationAlgorithm(v IKEProposalAuthenticationAlgorithm) { + o.AuthenticationAlgorithm = v +} + +// GetGroup returns the Group field value +func (o *IKEProposal) GetGroup() IKEProposalGroup { + if o == nil { + var ret IKEProposalGroup + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetGroupOk() (*IKEProposalGroup, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *IKEProposal) SetGroup(v IKEProposalGroup) { + o.Group = v +} + +// GetSaLifetime returns the SaLifetime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IKEProposal) GetSaLifetime() int32 { + if o == nil || IsNil(o.SaLifetime.Get()) { + var ret int32 + return ret + } + return *o.SaLifetime.Get() +} + +// GetSaLifetimeOk returns a tuple with the SaLifetime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IKEProposal) GetSaLifetimeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetime.Get(), o.SaLifetime.IsSet() +} + +// HasSaLifetime returns a boolean if a field has been set. +func (o *IKEProposal) HasSaLifetime() bool { + if o != nil && o.SaLifetime.IsSet() { + return true + } + + return false +} + +// SetSaLifetime gets a reference to the given NullableInt32 and assigns it to the SaLifetime field. +func (o *IKEProposal) SetSaLifetime(v int32) { + o.SaLifetime.Set(&v) +} + +// SetSaLifetimeNil sets the value for SaLifetime to be an explicit nil +func (o *IKEProposal) SetSaLifetimeNil() { + o.SaLifetime.Set(nil) +} + +// UnsetSaLifetime ensures that no value is present for SaLifetime, not even an explicit nil +func (o *IKEProposal) UnsetSaLifetime() { + o.SaLifetime.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IKEProposal) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IKEProposal) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IKEProposal) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IKEProposal) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IKEProposal) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *IKEProposal) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IKEProposal) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposal) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IKEProposal) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IKEProposal) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IKEProposal) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IKEProposal) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *IKEProposal) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IKEProposal) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IKEProposal) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *IKEProposal) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o IKEProposal) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEProposal) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["authentication_method"] = o.AuthenticationMethod + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + toSerialize["group"] = o.Group + if o.SaLifetime.IsSet() { + toSerialize["sa_lifetime"] = o.SaLifetime.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEProposal) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "authentication_method", + "encryption_algorithm", + "authentication_algorithm", + "group", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIKEProposal := _IKEProposal{} + + err = json.Unmarshal(data, &varIKEProposal) + + if err != nil { + return err + } + + *o = IKEProposal(varIKEProposal) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "authentication_method") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "group") + delete(additionalProperties, "sa_lifetime") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEProposal struct { + value *IKEProposal + isSet bool +} + +func (v NullableIKEProposal) Get() *IKEProposal { + return v.value +} + +func (v *NullableIKEProposal) Set(val *IKEProposal) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposal) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposal(val *IKEProposal) *NullableIKEProposal { + return &NullableIKEProposal{value: val, isSet: true} +} + +func (v NullableIKEProposal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm.go new file mode 100644 index 00000000..303239c8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IKEProposalAuthenticationAlgorithm type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEProposalAuthenticationAlgorithm{} + +// IKEProposalAuthenticationAlgorithm struct for IKEProposalAuthenticationAlgorithm +type IKEProposalAuthenticationAlgorithm struct { + Value *IKEProposalAuthenticationAlgorithmValue `json:"value,omitempty"` + Label *IKEProposalAuthenticationAlgorithmLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEProposalAuthenticationAlgorithm IKEProposalAuthenticationAlgorithm + +// NewIKEProposalAuthenticationAlgorithm instantiates a new IKEProposalAuthenticationAlgorithm object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEProposalAuthenticationAlgorithm() *IKEProposalAuthenticationAlgorithm { + this := IKEProposalAuthenticationAlgorithm{} + return &this +} + +// NewIKEProposalAuthenticationAlgorithmWithDefaults instantiates a new IKEProposalAuthenticationAlgorithm object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEProposalAuthenticationAlgorithmWithDefaults() *IKEProposalAuthenticationAlgorithm { + this := IKEProposalAuthenticationAlgorithm{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IKEProposalAuthenticationAlgorithm) GetValue() IKEProposalAuthenticationAlgorithmValue { + if o == nil || IsNil(o.Value) { + var ret IKEProposalAuthenticationAlgorithmValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalAuthenticationAlgorithm) GetValueOk() (*IKEProposalAuthenticationAlgorithmValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IKEProposalAuthenticationAlgorithm) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IKEProposalAuthenticationAlgorithmValue and assigns it to the Value field. +func (o *IKEProposalAuthenticationAlgorithm) SetValue(v IKEProposalAuthenticationAlgorithmValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IKEProposalAuthenticationAlgorithm) GetLabel() IKEProposalAuthenticationAlgorithmLabel { + if o == nil || IsNil(o.Label) { + var ret IKEProposalAuthenticationAlgorithmLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalAuthenticationAlgorithm) GetLabelOk() (*IKEProposalAuthenticationAlgorithmLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IKEProposalAuthenticationAlgorithm) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IKEProposalAuthenticationAlgorithmLabel and assigns it to the Label field. +func (o *IKEProposalAuthenticationAlgorithm) SetLabel(v IKEProposalAuthenticationAlgorithmLabel) { + o.Label = &v +} + +func (o IKEProposalAuthenticationAlgorithm) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEProposalAuthenticationAlgorithm) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEProposalAuthenticationAlgorithm) UnmarshalJSON(data []byte) (err error) { + varIKEProposalAuthenticationAlgorithm := _IKEProposalAuthenticationAlgorithm{} + + err = json.Unmarshal(data, &varIKEProposalAuthenticationAlgorithm) + + if err != nil { + return err + } + + *o = IKEProposalAuthenticationAlgorithm(varIKEProposalAuthenticationAlgorithm) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEProposalAuthenticationAlgorithm struct { + value *IKEProposalAuthenticationAlgorithm + isSet bool +} + +func (v NullableIKEProposalAuthenticationAlgorithm) Get() *IKEProposalAuthenticationAlgorithm { + return v.value +} + +func (v *NullableIKEProposalAuthenticationAlgorithm) Set(val *IKEProposalAuthenticationAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalAuthenticationAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalAuthenticationAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalAuthenticationAlgorithm(val *IKEProposalAuthenticationAlgorithm) *NullableIKEProposalAuthenticationAlgorithm { + return &NullableIKEProposalAuthenticationAlgorithm{value: val, isSet: true} +} + +func (v NullableIKEProposalAuthenticationAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalAuthenticationAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm_label.go new file mode 100644 index 00000000..fc39ad72 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm_label.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalAuthenticationAlgorithmLabel the model 'IKEProposalAuthenticationAlgorithmLabel' +type IKEProposalAuthenticationAlgorithmLabel string + +// List of IKEProposal_authentication_algorithm_label +const ( + IKEPROPOSALAUTHENTICATIONALGORITHMLABEL_SHA_1_HMAC IKEProposalAuthenticationAlgorithmLabel = "SHA-1 HMAC" + IKEPROPOSALAUTHENTICATIONALGORITHMLABEL_SHA_256_HMAC IKEProposalAuthenticationAlgorithmLabel = "SHA-256 HMAC" + IKEPROPOSALAUTHENTICATIONALGORITHMLABEL_SHA_384_HMAC IKEProposalAuthenticationAlgorithmLabel = "SHA-384 HMAC" + IKEPROPOSALAUTHENTICATIONALGORITHMLABEL_SHA_512_HMAC IKEProposalAuthenticationAlgorithmLabel = "SHA-512 HMAC" + IKEPROPOSALAUTHENTICATIONALGORITHMLABEL_MD5_HMAC IKEProposalAuthenticationAlgorithmLabel = "MD5 HMAC" +) + +// All allowed values of IKEProposalAuthenticationAlgorithmLabel enum +var AllowedIKEProposalAuthenticationAlgorithmLabelEnumValues = []IKEProposalAuthenticationAlgorithmLabel{ + "SHA-1 HMAC", + "SHA-256 HMAC", + "SHA-384 HMAC", + "SHA-512 HMAC", + "MD5 HMAC", +} + +func (v *IKEProposalAuthenticationAlgorithmLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalAuthenticationAlgorithmLabel(value) + for _, existing := range AllowedIKEProposalAuthenticationAlgorithmLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalAuthenticationAlgorithmLabel", value) +} + +// NewIKEProposalAuthenticationAlgorithmLabelFromValue returns a pointer to a valid IKEProposalAuthenticationAlgorithmLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalAuthenticationAlgorithmLabelFromValue(v string) (*IKEProposalAuthenticationAlgorithmLabel, error) { + ev := IKEProposalAuthenticationAlgorithmLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalAuthenticationAlgorithmLabel: valid values are %v", v, AllowedIKEProposalAuthenticationAlgorithmLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalAuthenticationAlgorithmLabel) IsValid() bool { + for _, existing := range AllowedIKEProposalAuthenticationAlgorithmLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_authentication_algorithm_label value +func (v IKEProposalAuthenticationAlgorithmLabel) Ptr() *IKEProposalAuthenticationAlgorithmLabel { + return &v +} + +type NullableIKEProposalAuthenticationAlgorithmLabel struct { + value *IKEProposalAuthenticationAlgorithmLabel + isSet bool +} + +func (v NullableIKEProposalAuthenticationAlgorithmLabel) Get() *IKEProposalAuthenticationAlgorithmLabel { + return v.value +} + +func (v *NullableIKEProposalAuthenticationAlgorithmLabel) Set(val *IKEProposalAuthenticationAlgorithmLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalAuthenticationAlgorithmLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalAuthenticationAlgorithmLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalAuthenticationAlgorithmLabel(val *IKEProposalAuthenticationAlgorithmLabel) *NullableIKEProposalAuthenticationAlgorithmLabel { + return &NullableIKEProposalAuthenticationAlgorithmLabel{value: val, isSet: true} +} + +func (v NullableIKEProposalAuthenticationAlgorithmLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalAuthenticationAlgorithmLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm_value.go new file mode 100644 index 00000000..339bca74 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_algorithm_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalAuthenticationAlgorithmValue * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC +type IKEProposalAuthenticationAlgorithmValue string + +// List of IKEProposal_authentication_algorithm_value +const ( + IKEPROPOSALAUTHENTICATIONALGORITHMVALUE_SHA1 IKEProposalAuthenticationAlgorithmValue = "hmac-sha1" + IKEPROPOSALAUTHENTICATIONALGORITHMVALUE_SHA256 IKEProposalAuthenticationAlgorithmValue = "hmac-sha256" + IKEPROPOSALAUTHENTICATIONALGORITHMVALUE_SHA384 IKEProposalAuthenticationAlgorithmValue = "hmac-sha384" + IKEPROPOSALAUTHENTICATIONALGORITHMVALUE_SHA512 IKEProposalAuthenticationAlgorithmValue = "hmac-sha512" + IKEPROPOSALAUTHENTICATIONALGORITHMVALUE_MD5 IKEProposalAuthenticationAlgorithmValue = "hmac-md5" +) + +// All allowed values of IKEProposalAuthenticationAlgorithmValue enum +var AllowedIKEProposalAuthenticationAlgorithmValueEnumValues = []IKEProposalAuthenticationAlgorithmValue{ + "hmac-sha1", + "hmac-sha256", + "hmac-sha384", + "hmac-sha512", + "hmac-md5", +} + +func (v *IKEProposalAuthenticationAlgorithmValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalAuthenticationAlgorithmValue(value) + for _, existing := range AllowedIKEProposalAuthenticationAlgorithmValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalAuthenticationAlgorithmValue", value) +} + +// NewIKEProposalAuthenticationAlgorithmValueFromValue returns a pointer to a valid IKEProposalAuthenticationAlgorithmValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalAuthenticationAlgorithmValueFromValue(v string) (*IKEProposalAuthenticationAlgorithmValue, error) { + ev := IKEProposalAuthenticationAlgorithmValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalAuthenticationAlgorithmValue: valid values are %v", v, AllowedIKEProposalAuthenticationAlgorithmValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalAuthenticationAlgorithmValue) IsValid() bool { + for _, existing := range AllowedIKEProposalAuthenticationAlgorithmValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_authentication_algorithm_value value +func (v IKEProposalAuthenticationAlgorithmValue) Ptr() *IKEProposalAuthenticationAlgorithmValue { + return &v +} + +type NullableIKEProposalAuthenticationAlgorithmValue struct { + value *IKEProposalAuthenticationAlgorithmValue + isSet bool +} + +func (v NullableIKEProposalAuthenticationAlgorithmValue) Get() *IKEProposalAuthenticationAlgorithmValue { + return v.value +} + +func (v *NullableIKEProposalAuthenticationAlgorithmValue) Set(val *IKEProposalAuthenticationAlgorithmValue) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalAuthenticationAlgorithmValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalAuthenticationAlgorithmValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalAuthenticationAlgorithmValue(val *IKEProposalAuthenticationAlgorithmValue) *NullableIKEProposalAuthenticationAlgorithmValue { + return &NullableIKEProposalAuthenticationAlgorithmValue{value: val, isSet: true} +} + +func (v NullableIKEProposalAuthenticationAlgorithmValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalAuthenticationAlgorithmValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method.go new file mode 100644 index 00000000..3a44efdb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IKEProposalAuthenticationMethod type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEProposalAuthenticationMethod{} + +// IKEProposalAuthenticationMethod struct for IKEProposalAuthenticationMethod +type IKEProposalAuthenticationMethod struct { + Value *IKEProposalAuthenticationMethodValue `json:"value,omitempty"` + Label *IKEProposalAuthenticationMethodLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEProposalAuthenticationMethod IKEProposalAuthenticationMethod + +// NewIKEProposalAuthenticationMethod instantiates a new IKEProposalAuthenticationMethod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEProposalAuthenticationMethod() *IKEProposalAuthenticationMethod { + this := IKEProposalAuthenticationMethod{} + return &this +} + +// NewIKEProposalAuthenticationMethodWithDefaults instantiates a new IKEProposalAuthenticationMethod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEProposalAuthenticationMethodWithDefaults() *IKEProposalAuthenticationMethod { + this := IKEProposalAuthenticationMethod{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IKEProposalAuthenticationMethod) GetValue() IKEProposalAuthenticationMethodValue { + if o == nil || IsNil(o.Value) { + var ret IKEProposalAuthenticationMethodValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalAuthenticationMethod) GetValueOk() (*IKEProposalAuthenticationMethodValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IKEProposalAuthenticationMethod) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IKEProposalAuthenticationMethodValue and assigns it to the Value field. +func (o *IKEProposalAuthenticationMethod) SetValue(v IKEProposalAuthenticationMethodValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IKEProposalAuthenticationMethod) GetLabel() IKEProposalAuthenticationMethodLabel { + if o == nil || IsNil(o.Label) { + var ret IKEProposalAuthenticationMethodLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalAuthenticationMethod) GetLabelOk() (*IKEProposalAuthenticationMethodLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IKEProposalAuthenticationMethod) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IKEProposalAuthenticationMethodLabel and assigns it to the Label field. +func (o *IKEProposalAuthenticationMethod) SetLabel(v IKEProposalAuthenticationMethodLabel) { + o.Label = &v +} + +func (o IKEProposalAuthenticationMethod) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEProposalAuthenticationMethod) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEProposalAuthenticationMethod) UnmarshalJSON(data []byte) (err error) { + varIKEProposalAuthenticationMethod := _IKEProposalAuthenticationMethod{} + + err = json.Unmarshal(data, &varIKEProposalAuthenticationMethod) + + if err != nil { + return err + } + + *o = IKEProposalAuthenticationMethod(varIKEProposalAuthenticationMethod) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEProposalAuthenticationMethod struct { + value *IKEProposalAuthenticationMethod + isSet bool +} + +func (v NullableIKEProposalAuthenticationMethod) Get() *IKEProposalAuthenticationMethod { + return v.value +} + +func (v *NullableIKEProposalAuthenticationMethod) Set(val *IKEProposalAuthenticationMethod) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalAuthenticationMethod) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalAuthenticationMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalAuthenticationMethod(val *IKEProposalAuthenticationMethod) *NullableIKEProposalAuthenticationMethod { + return &NullableIKEProposalAuthenticationMethod{value: val, isSet: true} +} + +func (v NullableIKEProposalAuthenticationMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalAuthenticationMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method_label.go new file mode 100644 index 00000000..efd7fcac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalAuthenticationMethodLabel the model 'IKEProposalAuthenticationMethodLabel' +type IKEProposalAuthenticationMethodLabel string + +// List of IKEProposal_authentication_method_label +const ( + IKEPROPOSALAUTHENTICATIONMETHODLABEL_PRE_SHARED_KEYS IKEProposalAuthenticationMethodLabel = "Pre-shared keys" + IKEPROPOSALAUTHENTICATIONMETHODLABEL_CERTIFICATES IKEProposalAuthenticationMethodLabel = "Certificates" + IKEPROPOSALAUTHENTICATIONMETHODLABEL_RSA_SIGNATURES IKEProposalAuthenticationMethodLabel = "RSA signatures" + IKEPROPOSALAUTHENTICATIONMETHODLABEL_DSA_SIGNATURES IKEProposalAuthenticationMethodLabel = "DSA signatures" +) + +// All allowed values of IKEProposalAuthenticationMethodLabel enum +var AllowedIKEProposalAuthenticationMethodLabelEnumValues = []IKEProposalAuthenticationMethodLabel{ + "Pre-shared keys", + "Certificates", + "RSA signatures", + "DSA signatures", +} + +func (v *IKEProposalAuthenticationMethodLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalAuthenticationMethodLabel(value) + for _, existing := range AllowedIKEProposalAuthenticationMethodLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalAuthenticationMethodLabel", value) +} + +// NewIKEProposalAuthenticationMethodLabelFromValue returns a pointer to a valid IKEProposalAuthenticationMethodLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalAuthenticationMethodLabelFromValue(v string) (*IKEProposalAuthenticationMethodLabel, error) { + ev := IKEProposalAuthenticationMethodLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalAuthenticationMethodLabel: valid values are %v", v, AllowedIKEProposalAuthenticationMethodLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalAuthenticationMethodLabel) IsValid() bool { + for _, existing := range AllowedIKEProposalAuthenticationMethodLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_authentication_method_label value +func (v IKEProposalAuthenticationMethodLabel) Ptr() *IKEProposalAuthenticationMethodLabel { + return &v +} + +type NullableIKEProposalAuthenticationMethodLabel struct { + value *IKEProposalAuthenticationMethodLabel + isSet bool +} + +func (v NullableIKEProposalAuthenticationMethodLabel) Get() *IKEProposalAuthenticationMethodLabel { + return v.value +} + +func (v *NullableIKEProposalAuthenticationMethodLabel) Set(val *IKEProposalAuthenticationMethodLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalAuthenticationMethodLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalAuthenticationMethodLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalAuthenticationMethodLabel(val *IKEProposalAuthenticationMethodLabel) *NullableIKEProposalAuthenticationMethodLabel { + return &NullableIKEProposalAuthenticationMethodLabel{value: val, isSet: true} +} + +func (v NullableIKEProposalAuthenticationMethodLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalAuthenticationMethodLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method_value.go new file mode 100644 index 00000000..bf174e99 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_authentication_method_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalAuthenticationMethodValue * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures +type IKEProposalAuthenticationMethodValue string + +// List of IKEProposal_authentication_method_value +const ( + IKEPROPOSALAUTHENTICATIONMETHODVALUE_PRESHARED_KEYS IKEProposalAuthenticationMethodValue = "preshared-keys" + IKEPROPOSALAUTHENTICATIONMETHODVALUE_CERTIFICATES IKEProposalAuthenticationMethodValue = "certificates" + IKEPROPOSALAUTHENTICATIONMETHODVALUE_RSA_SIGNATURES IKEProposalAuthenticationMethodValue = "rsa-signatures" + IKEPROPOSALAUTHENTICATIONMETHODVALUE_DSA_SIGNATURES IKEProposalAuthenticationMethodValue = "dsa-signatures" +) + +// All allowed values of IKEProposalAuthenticationMethodValue enum +var AllowedIKEProposalAuthenticationMethodValueEnumValues = []IKEProposalAuthenticationMethodValue{ + "preshared-keys", + "certificates", + "rsa-signatures", + "dsa-signatures", +} + +func (v *IKEProposalAuthenticationMethodValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalAuthenticationMethodValue(value) + for _, existing := range AllowedIKEProposalAuthenticationMethodValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalAuthenticationMethodValue", value) +} + +// NewIKEProposalAuthenticationMethodValueFromValue returns a pointer to a valid IKEProposalAuthenticationMethodValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalAuthenticationMethodValueFromValue(v string) (*IKEProposalAuthenticationMethodValue, error) { + ev := IKEProposalAuthenticationMethodValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalAuthenticationMethodValue: valid values are %v", v, AllowedIKEProposalAuthenticationMethodValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalAuthenticationMethodValue) IsValid() bool { + for _, existing := range AllowedIKEProposalAuthenticationMethodValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_authentication_method_value value +func (v IKEProposalAuthenticationMethodValue) Ptr() *IKEProposalAuthenticationMethodValue { + return &v +} + +type NullableIKEProposalAuthenticationMethodValue struct { + value *IKEProposalAuthenticationMethodValue + isSet bool +} + +func (v NullableIKEProposalAuthenticationMethodValue) Get() *IKEProposalAuthenticationMethodValue { + return v.value +} + +func (v *NullableIKEProposalAuthenticationMethodValue) Set(val *IKEProposalAuthenticationMethodValue) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalAuthenticationMethodValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalAuthenticationMethodValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalAuthenticationMethodValue(val *IKEProposalAuthenticationMethodValue) *NullableIKEProposalAuthenticationMethodValue { + return &NullableIKEProposalAuthenticationMethodValue{value: val, isSet: true} +} + +func (v NullableIKEProposalAuthenticationMethodValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalAuthenticationMethodValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm.go new file mode 100644 index 00000000..36a87a90 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IKEProposalEncryptionAlgorithm type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEProposalEncryptionAlgorithm{} + +// IKEProposalEncryptionAlgorithm struct for IKEProposalEncryptionAlgorithm +type IKEProposalEncryptionAlgorithm struct { + Value *IKEProposalEncryptionAlgorithmValue `json:"value,omitempty"` + Label *IKEProposalEncryptionAlgorithmLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEProposalEncryptionAlgorithm IKEProposalEncryptionAlgorithm + +// NewIKEProposalEncryptionAlgorithm instantiates a new IKEProposalEncryptionAlgorithm object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEProposalEncryptionAlgorithm() *IKEProposalEncryptionAlgorithm { + this := IKEProposalEncryptionAlgorithm{} + return &this +} + +// NewIKEProposalEncryptionAlgorithmWithDefaults instantiates a new IKEProposalEncryptionAlgorithm object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEProposalEncryptionAlgorithmWithDefaults() *IKEProposalEncryptionAlgorithm { + this := IKEProposalEncryptionAlgorithm{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IKEProposalEncryptionAlgorithm) GetValue() IKEProposalEncryptionAlgorithmValue { + if o == nil || IsNil(o.Value) { + var ret IKEProposalEncryptionAlgorithmValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalEncryptionAlgorithm) GetValueOk() (*IKEProposalEncryptionAlgorithmValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IKEProposalEncryptionAlgorithm) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IKEProposalEncryptionAlgorithmValue and assigns it to the Value field. +func (o *IKEProposalEncryptionAlgorithm) SetValue(v IKEProposalEncryptionAlgorithmValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IKEProposalEncryptionAlgorithm) GetLabel() IKEProposalEncryptionAlgorithmLabel { + if o == nil || IsNil(o.Label) { + var ret IKEProposalEncryptionAlgorithmLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalEncryptionAlgorithm) GetLabelOk() (*IKEProposalEncryptionAlgorithmLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IKEProposalEncryptionAlgorithm) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IKEProposalEncryptionAlgorithmLabel and assigns it to the Label field. +func (o *IKEProposalEncryptionAlgorithm) SetLabel(v IKEProposalEncryptionAlgorithmLabel) { + o.Label = &v +} + +func (o IKEProposalEncryptionAlgorithm) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEProposalEncryptionAlgorithm) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEProposalEncryptionAlgorithm) UnmarshalJSON(data []byte) (err error) { + varIKEProposalEncryptionAlgorithm := _IKEProposalEncryptionAlgorithm{} + + err = json.Unmarshal(data, &varIKEProposalEncryptionAlgorithm) + + if err != nil { + return err + } + + *o = IKEProposalEncryptionAlgorithm(varIKEProposalEncryptionAlgorithm) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEProposalEncryptionAlgorithm struct { + value *IKEProposalEncryptionAlgorithm + isSet bool +} + +func (v NullableIKEProposalEncryptionAlgorithm) Get() *IKEProposalEncryptionAlgorithm { + return v.value +} + +func (v *NullableIKEProposalEncryptionAlgorithm) Set(val *IKEProposalEncryptionAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalEncryptionAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalEncryptionAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalEncryptionAlgorithm(val *IKEProposalEncryptionAlgorithm) *NullableIKEProposalEncryptionAlgorithm { + return &NullableIKEProposalEncryptionAlgorithm{value: val, isSet: true} +} + +func (v NullableIKEProposalEncryptionAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalEncryptionAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm_label.go new file mode 100644 index 00000000..1f0265e6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm_label.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalEncryptionAlgorithmLabel the model 'IKEProposalEncryptionAlgorithmLabel' +type IKEProposalEncryptionAlgorithmLabel string + +// List of IKEProposal_encryption_algorithm_label +const ( + IKEPROPOSALENCRYPTIONALGORITHMLABEL__128_BIT_AES__CBC IKEProposalEncryptionAlgorithmLabel = "128-bit AES (CBC)" + IKEPROPOSALENCRYPTIONALGORITHMLABEL__128_BIT_AES__GCM IKEProposalEncryptionAlgorithmLabel = "128-bit AES (GCM)" + IKEPROPOSALENCRYPTIONALGORITHMLABEL__192_BIT_AES__CBC IKEProposalEncryptionAlgorithmLabel = "192-bit AES (CBC)" + IKEPROPOSALENCRYPTIONALGORITHMLABEL__192_BIT_AES__GCM IKEProposalEncryptionAlgorithmLabel = "192-bit AES (GCM)" + IKEPROPOSALENCRYPTIONALGORITHMLABEL__256_BIT_AES__CBC IKEProposalEncryptionAlgorithmLabel = "256-bit AES (CBC)" + IKEPROPOSALENCRYPTIONALGORITHMLABEL__256_BIT_AES__GCM IKEProposalEncryptionAlgorithmLabel = "256-bit AES (GCM)" + IKEPROPOSALENCRYPTIONALGORITHMLABEL_DES IKEProposalEncryptionAlgorithmLabel = "DES" +) + +// All allowed values of IKEProposalEncryptionAlgorithmLabel enum +var AllowedIKEProposalEncryptionAlgorithmLabelEnumValues = []IKEProposalEncryptionAlgorithmLabel{ + "128-bit AES (CBC)", + "128-bit AES (GCM)", + "192-bit AES (CBC)", + "192-bit AES (GCM)", + "256-bit AES (CBC)", + "256-bit AES (GCM)", + "DES", +} + +func (v *IKEProposalEncryptionAlgorithmLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalEncryptionAlgorithmLabel(value) + for _, existing := range AllowedIKEProposalEncryptionAlgorithmLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalEncryptionAlgorithmLabel", value) +} + +// NewIKEProposalEncryptionAlgorithmLabelFromValue returns a pointer to a valid IKEProposalEncryptionAlgorithmLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalEncryptionAlgorithmLabelFromValue(v string) (*IKEProposalEncryptionAlgorithmLabel, error) { + ev := IKEProposalEncryptionAlgorithmLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalEncryptionAlgorithmLabel: valid values are %v", v, AllowedIKEProposalEncryptionAlgorithmLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalEncryptionAlgorithmLabel) IsValid() bool { + for _, existing := range AllowedIKEProposalEncryptionAlgorithmLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_encryption_algorithm_label value +func (v IKEProposalEncryptionAlgorithmLabel) Ptr() *IKEProposalEncryptionAlgorithmLabel { + return &v +} + +type NullableIKEProposalEncryptionAlgorithmLabel struct { + value *IKEProposalEncryptionAlgorithmLabel + isSet bool +} + +func (v NullableIKEProposalEncryptionAlgorithmLabel) Get() *IKEProposalEncryptionAlgorithmLabel { + return v.value +} + +func (v *NullableIKEProposalEncryptionAlgorithmLabel) Set(val *IKEProposalEncryptionAlgorithmLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalEncryptionAlgorithmLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalEncryptionAlgorithmLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalEncryptionAlgorithmLabel(val *IKEProposalEncryptionAlgorithmLabel) *NullableIKEProposalEncryptionAlgorithmLabel { + return &NullableIKEProposalEncryptionAlgorithmLabel{value: val, isSet: true} +} + +func (v NullableIKEProposalEncryptionAlgorithmLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalEncryptionAlgorithmLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm_value.go new file mode 100644 index 00000000..5292b93a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_encryption_algorithm_value.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalEncryptionAlgorithmValue * `aes-128-cbc` - 128-bit AES (CBC) * `aes-128-gcm` - 128-bit AES (GCM) * `aes-192-cbc` - 192-bit AES (CBC) * `aes-192-gcm` - 192-bit AES (GCM) * `aes-256-cbc` - 256-bit AES (CBC) * `aes-256-gcm` - 256-bit AES (GCM) * `3des-cbc` - DES +type IKEProposalEncryptionAlgorithmValue string + +// List of IKEProposal_encryption_algorithm_value +const ( + IKEPROPOSALENCRYPTIONALGORITHMVALUE_AES_128_CBC IKEProposalEncryptionAlgorithmValue = "aes-128-cbc" + IKEPROPOSALENCRYPTIONALGORITHMVALUE_AES_128_GCM IKEProposalEncryptionAlgorithmValue = "aes-128-gcm" + IKEPROPOSALENCRYPTIONALGORITHMVALUE_AES_192_CBC IKEProposalEncryptionAlgorithmValue = "aes-192-cbc" + IKEPROPOSALENCRYPTIONALGORITHMVALUE_AES_192_GCM IKEProposalEncryptionAlgorithmValue = "aes-192-gcm" + IKEPROPOSALENCRYPTIONALGORITHMVALUE_AES_256_CBC IKEProposalEncryptionAlgorithmValue = "aes-256-cbc" + IKEPROPOSALENCRYPTIONALGORITHMVALUE_AES_256_GCM IKEProposalEncryptionAlgorithmValue = "aes-256-gcm" + IKEPROPOSALENCRYPTIONALGORITHMVALUE__3DES_CBC IKEProposalEncryptionAlgorithmValue = "3des-cbc" +) + +// All allowed values of IKEProposalEncryptionAlgorithmValue enum +var AllowedIKEProposalEncryptionAlgorithmValueEnumValues = []IKEProposalEncryptionAlgorithmValue{ + "aes-128-cbc", + "aes-128-gcm", + "aes-192-cbc", + "aes-192-gcm", + "aes-256-cbc", + "aes-256-gcm", + "3des-cbc", +} + +func (v *IKEProposalEncryptionAlgorithmValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalEncryptionAlgorithmValue(value) + for _, existing := range AllowedIKEProposalEncryptionAlgorithmValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalEncryptionAlgorithmValue", value) +} + +// NewIKEProposalEncryptionAlgorithmValueFromValue returns a pointer to a valid IKEProposalEncryptionAlgorithmValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalEncryptionAlgorithmValueFromValue(v string) (*IKEProposalEncryptionAlgorithmValue, error) { + ev := IKEProposalEncryptionAlgorithmValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalEncryptionAlgorithmValue: valid values are %v", v, AllowedIKEProposalEncryptionAlgorithmValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalEncryptionAlgorithmValue) IsValid() bool { + for _, existing := range AllowedIKEProposalEncryptionAlgorithmValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_encryption_algorithm_value value +func (v IKEProposalEncryptionAlgorithmValue) Ptr() *IKEProposalEncryptionAlgorithmValue { + return &v +} + +type NullableIKEProposalEncryptionAlgorithmValue struct { + value *IKEProposalEncryptionAlgorithmValue + isSet bool +} + +func (v NullableIKEProposalEncryptionAlgorithmValue) Get() *IKEProposalEncryptionAlgorithmValue { + return v.value +} + +func (v *NullableIKEProposalEncryptionAlgorithmValue) Set(val *IKEProposalEncryptionAlgorithmValue) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalEncryptionAlgorithmValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalEncryptionAlgorithmValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalEncryptionAlgorithmValue(val *IKEProposalEncryptionAlgorithmValue) *NullableIKEProposalEncryptionAlgorithmValue { + return &NullableIKEProposalEncryptionAlgorithmValue{value: val, isSet: true} +} + +func (v NullableIKEProposalEncryptionAlgorithmValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalEncryptionAlgorithmValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group.go new file mode 100644 index 00000000..1d8379e5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IKEProposalGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEProposalGroup{} + +// IKEProposalGroup struct for IKEProposalGroup +type IKEProposalGroup struct { + Value *IKEProposalGroupValue `json:"value,omitempty"` + Label *IKEProposalGroupLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEProposalGroup IKEProposalGroup + +// NewIKEProposalGroup instantiates a new IKEProposalGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEProposalGroup() *IKEProposalGroup { + this := IKEProposalGroup{} + return &this +} + +// NewIKEProposalGroupWithDefaults instantiates a new IKEProposalGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEProposalGroupWithDefaults() *IKEProposalGroup { + this := IKEProposalGroup{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IKEProposalGroup) GetValue() IKEProposalGroupValue { + if o == nil || IsNil(o.Value) { + var ret IKEProposalGroupValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalGroup) GetValueOk() (*IKEProposalGroupValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IKEProposalGroup) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IKEProposalGroupValue and assigns it to the Value field. +func (o *IKEProposalGroup) SetValue(v IKEProposalGroupValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IKEProposalGroup) GetLabel() IKEProposalGroupLabel { + if o == nil || IsNil(o.Label) { + var ret IKEProposalGroupLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalGroup) GetLabelOk() (*IKEProposalGroupLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IKEProposalGroup) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IKEProposalGroupLabel and assigns it to the Label field. +func (o *IKEProposalGroup) SetLabel(v IKEProposalGroupLabel) { + o.Label = &v +} + +func (o IKEProposalGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEProposalGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEProposalGroup) UnmarshalJSON(data []byte) (err error) { + varIKEProposalGroup := _IKEProposalGroup{} + + err = json.Unmarshal(data, &varIKEProposalGroup) + + if err != nil { + return err + } + + *o = IKEProposalGroup(varIKEProposalGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEProposalGroup struct { + value *IKEProposalGroup + isSet bool +} + +func (v NullableIKEProposalGroup) Get() *IKEProposalGroup { + return v.value +} + +func (v *NullableIKEProposalGroup) Set(val *IKEProposalGroup) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalGroup(val *IKEProposalGroup) *NullableIKEProposalGroup { + return &NullableIKEProposalGroup{value: val, isSet: true} +} + +func (v NullableIKEProposalGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group_label.go new file mode 100644 index 00000000..8482247d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group_label.go @@ -0,0 +1,154 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalGroupLabel the model 'IKEProposalGroupLabel' +type IKEProposalGroupLabel string + +// List of IKEProposal_group_label +const ( + IKEPROPOSALGROUPLABEL__1 IKEProposalGroupLabel = "Group 1" + IKEPROPOSALGROUPLABEL__2 IKEProposalGroupLabel = "Group 2" + IKEPROPOSALGROUPLABEL__5 IKEProposalGroupLabel = "Group 5" + IKEPROPOSALGROUPLABEL__14 IKEProposalGroupLabel = "Group 14" + IKEPROPOSALGROUPLABEL__15 IKEProposalGroupLabel = "Group 15" + IKEPROPOSALGROUPLABEL__16 IKEProposalGroupLabel = "Group 16" + IKEPROPOSALGROUPLABEL__17 IKEProposalGroupLabel = "Group 17" + IKEPROPOSALGROUPLABEL__18 IKEProposalGroupLabel = "Group 18" + IKEPROPOSALGROUPLABEL__19 IKEProposalGroupLabel = "Group 19" + IKEPROPOSALGROUPLABEL__20 IKEProposalGroupLabel = "Group 20" + IKEPROPOSALGROUPLABEL__21 IKEProposalGroupLabel = "Group 21" + IKEPROPOSALGROUPLABEL__22 IKEProposalGroupLabel = "Group 22" + IKEPROPOSALGROUPLABEL__23 IKEProposalGroupLabel = "Group 23" + IKEPROPOSALGROUPLABEL__24 IKEProposalGroupLabel = "Group 24" + IKEPROPOSALGROUPLABEL__25 IKEProposalGroupLabel = "Group 25" + IKEPROPOSALGROUPLABEL__26 IKEProposalGroupLabel = "Group 26" + IKEPROPOSALGROUPLABEL__27 IKEProposalGroupLabel = "Group 27" + IKEPROPOSALGROUPLABEL__28 IKEProposalGroupLabel = "Group 28" + IKEPROPOSALGROUPLABEL__29 IKEProposalGroupLabel = "Group 29" + IKEPROPOSALGROUPLABEL__30 IKEProposalGroupLabel = "Group 30" + IKEPROPOSALGROUPLABEL__31 IKEProposalGroupLabel = "Group 31" + IKEPROPOSALGROUPLABEL__32 IKEProposalGroupLabel = "Group 32" + IKEPROPOSALGROUPLABEL__33 IKEProposalGroupLabel = "Group 33" + IKEPROPOSALGROUPLABEL__34 IKEProposalGroupLabel = "Group 34" +) + +// All allowed values of IKEProposalGroupLabel enum +var AllowedIKEProposalGroupLabelEnumValues = []IKEProposalGroupLabel{ + "Group 1", + "Group 2", + "Group 5", + "Group 14", + "Group 15", + "Group 16", + "Group 17", + "Group 18", + "Group 19", + "Group 20", + "Group 21", + "Group 22", + "Group 23", + "Group 24", + "Group 25", + "Group 26", + "Group 27", + "Group 28", + "Group 29", + "Group 30", + "Group 31", + "Group 32", + "Group 33", + "Group 34", +} + +func (v *IKEProposalGroupLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalGroupLabel(value) + for _, existing := range AllowedIKEProposalGroupLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalGroupLabel", value) +} + +// NewIKEProposalGroupLabelFromValue returns a pointer to a valid IKEProposalGroupLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalGroupLabelFromValue(v string) (*IKEProposalGroupLabel, error) { + ev := IKEProposalGroupLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalGroupLabel: valid values are %v", v, AllowedIKEProposalGroupLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalGroupLabel) IsValid() bool { + for _, existing := range AllowedIKEProposalGroupLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_group_label value +func (v IKEProposalGroupLabel) Ptr() *IKEProposalGroupLabel { + return &v +} + +type NullableIKEProposalGroupLabel struct { + value *IKEProposalGroupLabel + isSet bool +} + +func (v NullableIKEProposalGroupLabel) Get() *IKEProposalGroupLabel { + return v.value +} + +func (v *NullableIKEProposalGroupLabel) Set(val *IKEProposalGroupLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalGroupLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalGroupLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalGroupLabel(val *IKEProposalGroupLabel) *NullableIKEProposalGroupLabel { + return &NullableIKEProposalGroupLabel{value: val, isSet: true} +} + +func (v NullableIKEProposalGroupLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalGroupLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group_value.go new file mode 100644 index 00000000..66a7291e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_group_value.go @@ -0,0 +1,154 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IKEProposalGroupValue * `1` - Group 1 * `2` - Group 2 * `5` - Group 5 * `14` - Group 14 * `15` - Group 15 * `16` - Group 16 * `17` - Group 17 * `18` - Group 18 * `19` - Group 19 * `20` - Group 20 * `21` - Group 21 * `22` - Group 22 * `23` - Group 23 * `24` - Group 24 * `25` - Group 25 * `26` - Group 26 * `27` - Group 27 * `28` - Group 28 * `29` - Group 29 * `30` - Group 30 * `31` - Group 31 * `32` - Group 32 * `33` - Group 33 * `34` - Group 34 +type IKEProposalGroupValue int32 + +// List of IKEProposal_group_value +const ( + IKEPROPOSALGROUPVALUE__1 IKEProposalGroupValue = 1 + IKEPROPOSALGROUPVALUE__2 IKEProposalGroupValue = 2 + IKEPROPOSALGROUPVALUE__5 IKEProposalGroupValue = 5 + IKEPROPOSALGROUPVALUE__14 IKEProposalGroupValue = 14 + IKEPROPOSALGROUPVALUE__15 IKEProposalGroupValue = 15 + IKEPROPOSALGROUPVALUE__16 IKEProposalGroupValue = 16 + IKEPROPOSALGROUPVALUE__17 IKEProposalGroupValue = 17 + IKEPROPOSALGROUPVALUE__18 IKEProposalGroupValue = 18 + IKEPROPOSALGROUPVALUE__19 IKEProposalGroupValue = 19 + IKEPROPOSALGROUPVALUE__20 IKEProposalGroupValue = 20 + IKEPROPOSALGROUPVALUE__21 IKEProposalGroupValue = 21 + IKEPROPOSALGROUPVALUE__22 IKEProposalGroupValue = 22 + IKEPROPOSALGROUPVALUE__23 IKEProposalGroupValue = 23 + IKEPROPOSALGROUPVALUE__24 IKEProposalGroupValue = 24 + IKEPROPOSALGROUPVALUE__25 IKEProposalGroupValue = 25 + IKEPROPOSALGROUPVALUE__26 IKEProposalGroupValue = 26 + IKEPROPOSALGROUPVALUE__27 IKEProposalGroupValue = 27 + IKEPROPOSALGROUPVALUE__28 IKEProposalGroupValue = 28 + IKEPROPOSALGROUPVALUE__29 IKEProposalGroupValue = 29 + IKEPROPOSALGROUPVALUE__30 IKEProposalGroupValue = 30 + IKEPROPOSALGROUPVALUE__31 IKEProposalGroupValue = 31 + IKEPROPOSALGROUPVALUE__32 IKEProposalGroupValue = 32 + IKEPROPOSALGROUPVALUE__33 IKEProposalGroupValue = 33 + IKEPROPOSALGROUPVALUE__34 IKEProposalGroupValue = 34 +) + +// All allowed values of IKEProposalGroupValue enum +var AllowedIKEProposalGroupValueEnumValues = []IKEProposalGroupValue{ + 1, + 2, + 5, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, +} + +func (v *IKEProposalGroupValue) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IKEProposalGroupValue(value) + for _, existing := range AllowedIKEProposalGroupValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IKEProposalGroupValue", value) +} + +// NewIKEProposalGroupValueFromValue returns a pointer to a valid IKEProposalGroupValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIKEProposalGroupValueFromValue(v int32) (*IKEProposalGroupValue, error) { + ev := IKEProposalGroupValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IKEProposalGroupValue: valid values are %v", v, AllowedIKEProposalGroupValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IKEProposalGroupValue) IsValid() bool { + for _, existing := range AllowedIKEProposalGroupValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IKEProposal_group_value value +func (v IKEProposalGroupValue) Ptr() *IKEProposalGroupValue { + return &v +} + +type NullableIKEProposalGroupValue struct { + value *IKEProposalGroupValue + isSet bool +} + +func (v NullableIKEProposalGroupValue) Get() *IKEProposalGroupValue { + return v.value +} + +func (v *NullableIKEProposalGroupValue) Set(val *IKEProposalGroupValue) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalGroupValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalGroupValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalGroupValue(val *IKEProposalGroupValue) *NullableIKEProposalGroupValue { + return &NullableIKEProposalGroupValue{value: val, isSet: true} +} + +func (v NullableIKEProposalGroupValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalGroupValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_request.go new file mode 100644 index 00000000..cc011db0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ike_proposal_request.go @@ -0,0 +1,479 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the IKEProposalRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IKEProposalRequest{} + +// IKEProposalRequest Adds support for custom fields and tags. +type IKEProposalRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + AuthenticationMethod IKEProposalAuthenticationMethodValue `json:"authentication_method"` + EncryptionAlgorithm IKEProposalEncryptionAlgorithmValue `json:"encryption_algorithm"` + AuthenticationAlgorithm IKEProposalAuthenticationAlgorithmValue `json:"authentication_algorithm"` + Group IKEProposalGroupValue `json:"group"` + // Security association lifetime (in seconds) + SaLifetime NullableInt32 `json:"sa_lifetime,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IKEProposalRequest IKEProposalRequest + +// NewIKEProposalRequest instantiates a new IKEProposalRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIKEProposalRequest(name string, authenticationMethod IKEProposalAuthenticationMethodValue, encryptionAlgorithm IKEProposalEncryptionAlgorithmValue, authenticationAlgorithm IKEProposalAuthenticationAlgorithmValue, group IKEProposalGroupValue) *IKEProposalRequest { + this := IKEProposalRequest{} + this.Name = name + this.AuthenticationMethod = authenticationMethod + this.EncryptionAlgorithm = encryptionAlgorithm + this.AuthenticationAlgorithm = authenticationAlgorithm + this.Group = group + return &this +} + +// NewIKEProposalRequestWithDefaults instantiates a new IKEProposalRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIKEProposalRequestWithDefaults() *IKEProposalRequest { + this := IKEProposalRequest{} + return &this +} + +// GetName returns the Name field value +func (o *IKEProposalRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IKEProposalRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IKEProposalRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IKEProposalRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IKEProposalRequest) SetDescription(v string) { + o.Description = &v +} + +// GetAuthenticationMethod returns the AuthenticationMethod field value +func (o *IKEProposalRequest) GetAuthenticationMethod() IKEProposalAuthenticationMethodValue { + if o == nil { + var ret IKEProposalAuthenticationMethodValue + return ret + } + + return o.AuthenticationMethod +} + +// GetAuthenticationMethodOk returns a tuple with the AuthenticationMethod field value +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetAuthenticationMethodOk() (*IKEProposalAuthenticationMethodValue, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationMethod, true +} + +// SetAuthenticationMethod sets field value +func (o *IKEProposalRequest) SetAuthenticationMethod(v IKEProposalAuthenticationMethodValue) { + o.AuthenticationMethod = v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value +func (o *IKEProposalRequest) GetEncryptionAlgorithm() IKEProposalEncryptionAlgorithmValue { + if o == nil { + var ret IKEProposalEncryptionAlgorithmValue + return ret + } + + return o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetEncryptionAlgorithmOk() (*IKEProposalEncryptionAlgorithmValue, bool) { + if o == nil { + return nil, false + } + return &o.EncryptionAlgorithm, true +} + +// SetEncryptionAlgorithm sets field value +func (o *IKEProposalRequest) SetEncryptionAlgorithm(v IKEProposalEncryptionAlgorithmValue) { + o.EncryptionAlgorithm = v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value +func (o *IKEProposalRequest) GetAuthenticationAlgorithm() IKEProposalAuthenticationAlgorithmValue { + if o == nil { + var ret IKEProposalAuthenticationAlgorithmValue + return ret + } + + return o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetAuthenticationAlgorithmOk() (*IKEProposalAuthenticationAlgorithmValue, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationAlgorithm, true +} + +// SetAuthenticationAlgorithm sets field value +func (o *IKEProposalRequest) SetAuthenticationAlgorithm(v IKEProposalAuthenticationAlgorithmValue) { + o.AuthenticationAlgorithm = v +} + +// GetGroup returns the Group field value +func (o *IKEProposalRequest) GetGroup() IKEProposalGroupValue { + if o == nil { + var ret IKEProposalGroupValue + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetGroupOk() (*IKEProposalGroupValue, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *IKEProposalRequest) SetGroup(v IKEProposalGroupValue) { + o.Group = v +} + +// GetSaLifetime returns the SaLifetime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IKEProposalRequest) GetSaLifetime() int32 { + if o == nil || IsNil(o.SaLifetime.Get()) { + var ret int32 + return ret + } + return *o.SaLifetime.Get() +} + +// GetSaLifetimeOk returns a tuple with the SaLifetime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IKEProposalRequest) GetSaLifetimeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetime.Get(), o.SaLifetime.IsSet() +} + +// HasSaLifetime returns a boolean if a field has been set. +func (o *IKEProposalRequest) HasSaLifetime() bool { + if o != nil && o.SaLifetime.IsSet() { + return true + } + + return false +} + +// SetSaLifetime gets a reference to the given NullableInt32 and assigns it to the SaLifetime field. +func (o *IKEProposalRequest) SetSaLifetime(v int32) { + o.SaLifetime.Set(&v) +} + +// SetSaLifetimeNil sets the value for SaLifetime to be an explicit nil +func (o *IKEProposalRequest) SetSaLifetimeNil() { + o.SaLifetime.Set(nil) +} + +// UnsetSaLifetime ensures that no value is present for SaLifetime, not even an explicit nil +func (o *IKEProposalRequest) UnsetSaLifetime() { + o.SaLifetime.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IKEProposalRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IKEProposalRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IKEProposalRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IKEProposalRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IKEProposalRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *IKEProposalRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IKEProposalRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IKEProposalRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IKEProposalRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IKEProposalRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o IKEProposalRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IKEProposalRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["authentication_method"] = o.AuthenticationMethod + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + toSerialize["group"] = o.Group + if o.SaLifetime.IsSet() { + toSerialize["sa_lifetime"] = o.SaLifetime.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IKEProposalRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authentication_method", + "encryption_algorithm", + "authentication_algorithm", + "group", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIKEProposalRequest := _IKEProposalRequest{} + + err = json.Unmarshal(data, &varIKEProposalRequest) + + if err != nil { + return err + } + + *o = IKEProposalRequest(varIKEProposalRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "authentication_method") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "group") + delete(additionalProperties, "sa_lifetime") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIKEProposalRequest struct { + value *IKEProposalRequest + isSet bool +} + +func (v NullableIKEProposalRequest) Get() *IKEProposalRequest { + return v.value +} + +func (v *NullableIKEProposalRequest) Set(val *IKEProposalRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIKEProposalRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIKEProposalRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIKEProposalRequest(val *IKEProposalRequest) *NullableIKEProposalRequest { + return &NullableIKEProposalRequest{value: val, isSet: true} +} + +func (v NullableIKEProposalRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIKEProposalRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_image_attachment.go b/vendor/github.com/netbox-community/go-netbox/v3/model_image_attachment.go new file mode 100644 index 00000000..c0ceca53 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_image_attachment.go @@ -0,0 +1,502 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ImageAttachment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageAttachment{} + +// ImageAttachment Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ImageAttachment struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ContentType string `json:"content_type"` + ObjectId int64 `json:"object_id"` + Parent interface{} `json:"parent"` + Name *string `json:"name,omitempty"` + Image string `json:"image"` + ImageHeight int32 `json:"image_height"` + ImageWidth int32 `json:"image_width"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ImageAttachment ImageAttachment + +// NewImageAttachment instantiates a new ImageAttachment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageAttachment(id int32, url string, display string, contentType string, objectId int64, parent interface{}, image string, imageHeight int32, imageWidth int32, created NullableTime, lastUpdated NullableTime) *ImageAttachment { + this := ImageAttachment{} + this.Id = id + this.Url = url + this.Display = display + this.ContentType = contentType + this.ObjectId = objectId + this.Parent = parent + this.Image = image + this.ImageHeight = imageHeight + this.ImageWidth = imageWidth + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewImageAttachmentWithDefaults instantiates a new ImageAttachment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageAttachmentWithDefaults() *ImageAttachment { + this := ImageAttachment{} + return &this +} + +// GetId returns the Id field value +func (o *ImageAttachment) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ImageAttachment) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ImageAttachment) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ImageAttachment) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ImageAttachment) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ImageAttachment) SetDisplay(v string) { + o.Display = v +} + +// GetContentType returns the ContentType field value +func (o *ImageAttachment) GetContentType() string { + if o == nil { + var ret string + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetContentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *ImageAttachment) SetContentType(v string) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value +func (o *ImageAttachment) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *ImageAttachment) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetParent returns the Parent field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ImageAttachment) GetParent() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Parent +} + +// GetParentOk returns a tuple with the Parent field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageAttachment) GetParentOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parent) { + return nil, false + } + return &o.Parent, true +} + +// SetParent sets field value +func (o *ImageAttachment) SetParent(v interface{}) { + o.Parent = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ImageAttachment) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ImageAttachment) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ImageAttachment) SetName(v string) { + o.Name = &v +} + +// GetImage returns the Image field value +func (o *ImageAttachment) GetImage() string { + if o == nil { + var ret string + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetImageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *ImageAttachment) SetImage(v string) { + o.Image = v +} + +// GetImageHeight returns the ImageHeight field value +func (o *ImageAttachment) GetImageHeight() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ImageHeight +} + +// GetImageHeightOk returns a tuple with the ImageHeight field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetImageHeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ImageHeight, true +} + +// SetImageHeight sets field value +func (o *ImageAttachment) SetImageHeight(v int32) { + o.ImageHeight = v +} + +// GetImageWidth returns the ImageWidth field value +func (o *ImageAttachment) GetImageWidth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ImageWidth +} + +// GetImageWidthOk returns a tuple with the ImageWidth field value +// and a boolean to check if the value has been set. +func (o *ImageAttachment) GetImageWidthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ImageWidth, true +} + +// SetImageWidth sets field value +func (o *ImageAttachment) SetImageWidth(v int32) { + o.ImageWidth = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ImageAttachment) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageAttachment) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ImageAttachment) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ImageAttachment) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageAttachment) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ImageAttachment) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ImageAttachment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageAttachment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["content_type"] = o.ContentType + toSerialize["object_id"] = o.ObjectId + if o.Parent != nil { + toSerialize["parent"] = o.Parent + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["image"] = o.Image + toSerialize["image_height"] = o.ImageHeight + toSerialize["image_width"] = o.ImageWidth + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ImageAttachment) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "content_type", + "object_id", + "parent", + "image", + "image_height", + "image_width", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageAttachment := _ImageAttachment{} + + err = json.Unmarshal(data, &varImageAttachment) + + if err != nil { + return err + } + + *o = ImageAttachment(varImageAttachment) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "image") + delete(additionalProperties, "image_height") + delete(additionalProperties, "image_width") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableImageAttachment struct { + value *ImageAttachment + isSet bool +} + +func (v NullableImageAttachment) Get() *ImageAttachment { + return v.value +} + +func (v *NullableImageAttachment) Set(val *ImageAttachment) { + v.value = val + v.isSet = true +} + +func (v NullableImageAttachment) IsSet() bool { + return v.isSet +} + +func (v *NullableImageAttachment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageAttachment(val *ImageAttachment) *NullableImageAttachment { + return &NullableImageAttachment{value: val, isSet: true} +} + +func (v NullableImageAttachment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageAttachment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_image_attachment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_image_attachment_request.go new file mode 100644 index 00000000..7c8cb2ea --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_image_attachment_request.go @@ -0,0 +1,320 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "os" +) + +// checks if the ImageAttachmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageAttachmentRequest{} + +// ImageAttachmentRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ImageAttachmentRequest struct { + ContentType string `json:"content_type"` + ObjectId int64 `json:"object_id"` + Name *string `json:"name,omitempty"` + Image *os.File `json:"image"` + ImageHeight int32 `json:"image_height"` + ImageWidth int32 `json:"image_width"` + AdditionalProperties map[string]interface{} +} + +type _ImageAttachmentRequest ImageAttachmentRequest + +// NewImageAttachmentRequest instantiates a new ImageAttachmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageAttachmentRequest(contentType string, objectId int64, image *os.File, imageHeight int32, imageWidth int32) *ImageAttachmentRequest { + this := ImageAttachmentRequest{} + this.ContentType = contentType + this.ObjectId = objectId + this.Image = image + this.ImageHeight = imageHeight + this.ImageWidth = imageWidth + return &this +} + +// NewImageAttachmentRequestWithDefaults instantiates a new ImageAttachmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageAttachmentRequestWithDefaults() *ImageAttachmentRequest { + this := ImageAttachmentRequest{} + return &this +} + +// GetContentType returns the ContentType field value +func (o *ImageAttachmentRequest) GetContentType() string { + if o == nil { + var ret string + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *ImageAttachmentRequest) GetContentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *ImageAttachmentRequest) SetContentType(v string) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value +func (o *ImageAttachmentRequest) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *ImageAttachmentRequest) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *ImageAttachmentRequest) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ImageAttachmentRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAttachmentRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ImageAttachmentRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ImageAttachmentRequest) SetName(v string) { + o.Name = &v +} + +// GetImage returns the Image field value +func (o *ImageAttachmentRequest) GetImage() *os.File { + if o == nil { + var ret *os.File + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *ImageAttachmentRequest) GetImageOk() (**os.File, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *ImageAttachmentRequest) SetImage(v *os.File) { + o.Image = v +} + +// GetImageHeight returns the ImageHeight field value +func (o *ImageAttachmentRequest) GetImageHeight() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ImageHeight +} + +// GetImageHeightOk returns a tuple with the ImageHeight field value +// and a boolean to check if the value has been set. +func (o *ImageAttachmentRequest) GetImageHeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ImageHeight, true +} + +// SetImageHeight sets field value +func (o *ImageAttachmentRequest) SetImageHeight(v int32) { + o.ImageHeight = v +} + +// GetImageWidth returns the ImageWidth field value +func (o *ImageAttachmentRequest) GetImageWidth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ImageWidth +} + +// GetImageWidthOk returns a tuple with the ImageWidth field value +// and a boolean to check if the value has been set. +func (o *ImageAttachmentRequest) GetImageWidthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ImageWidth, true +} + +// SetImageWidth sets field value +func (o *ImageAttachmentRequest) SetImageWidth(v int32) { + o.ImageWidth = v +} + +func (o ImageAttachmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageAttachmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_type"] = o.ContentType + toSerialize["object_id"] = o.ObjectId + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["image"] = o.Image + toSerialize["image_height"] = o.ImageHeight + toSerialize["image_width"] = o.ImageWidth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ImageAttachmentRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_type", + "object_id", + "image", + "image_height", + "image_width", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageAttachmentRequest := _ImageAttachmentRequest{} + + err = json.Unmarshal(data, &varImageAttachmentRequest) + + if err != nil { + return err + } + + *o = ImageAttachmentRequest(varImageAttachmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "name") + delete(additionalProperties, "image") + delete(additionalProperties, "image_height") + delete(additionalProperties, "image_width") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableImageAttachmentRequest struct { + value *ImageAttachmentRequest + isSet bool +} + +func (v NullableImageAttachmentRequest) Get() *ImageAttachmentRequest { + return v.value +} + +func (v *NullableImageAttachmentRequest) Set(val *ImageAttachmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableImageAttachmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableImageAttachmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageAttachmentRequest(val *ImageAttachmentRequest) *NullableImageAttachmentRequest { + return &NullableImageAttachmentRequest{value: val, isSet: true} +} + +func (v NullableImageAttachmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageAttachmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface.go new file mode 100644 index 00000000..567f64cc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface.go @@ -0,0 +1,1961 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Interface type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Interface{} + +// Interface Adds support for custom fields and tags. +type Interface struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Vdcs []int32 `json:"vdcs,omitempty"` + Module NullableComponentNestedModule `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type InterfaceType `json:"type"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableNestedInterface `json:"parent,omitempty"` + Bridge NullableNestedInterface `json:"bridge,omitempty"` + Lag NullableNestedInterface `json:"lag,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Speed NullableInt32 `json:"speed,omitempty"` + Duplex NullableInterfaceDuplex `json:"duplex,omitempty"` + Wwn NullableString `json:"wwn,omitempty"` + // This interface is used only for out-of-band management + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Mode *InterfaceMode `json:"mode,omitempty"` + RfRole *InterfaceRfRole `json:"rf_role,omitempty"` + RfChannel *InterfaceRfChannel `json:"rf_channel,omitempty"` + PoeMode *InterfacePoeMode `json:"poe_mode,omitempty"` + PoeType *InterfacePoeType `json:"poe_type,omitempty"` + // Populated by selected channel (if set) + RfChannelFrequency NullableFloat64 `json:"rf_channel_frequency,omitempty"` + // Populated by selected channel (if set) + RfChannelWidth NullableFloat64 `json:"rf_channel_width,omitempty"` + TxPower NullableInt32 `json:"tx_power,omitempty"` + UntaggedVlan NullableNestedVLAN `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + WirelessLink NullableNestedWirelessLink `json:"wireless_link"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + WirelessLans []int32 `json:"wireless_lans,omitempty"` + Vrf NullableNestedVRF `json:"vrf,omitempty"` + L2vpnTermination NullableNestedL2VPNTermination `json:"l2vpn_termination"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` + ConnectedEndpointsType string `json:"connected_endpoints_type"` + ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + CountIpaddresses int32 `json:"count_ipaddresses"` + CountFhrpGroups int32 `json:"count_fhrp_groups"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _Interface Interface + +// NewInterface instantiates a new Interface object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterface(id int32, url string, display string, device NestedDevice, name string, type_ InterfaceType, cable NullableNestedCable, cableEnd string, wirelessLink NullableNestedWirelessLink, linkPeers []interface{}, linkPeersType string, l2vpnTermination NullableNestedL2VPNTermination, connectedEndpoints []interface{}, connectedEndpointsType string, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, countIpaddresses int32, countFhrpGroups int32, occupied bool) *Interface { + this := Interface{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Type = type_ + this.Cable = cable + this.CableEnd = cableEnd + this.WirelessLink = wirelessLink + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.L2vpnTermination = l2vpnTermination + this.ConnectedEndpoints = connectedEndpoints + this.ConnectedEndpointsType = connectedEndpointsType + this.ConnectedEndpointsReachable = connectedEndpointsReachable + this.Created = created + this.LastUpdated = lastUpdated + this.CountIpaddresses = countIpaddresses + this.CountFhrpGroups = countFhrpGroups + this.Occupied = occupied + return &this +} + +// NewInterfaceWithDefaults instantiates a new Interface object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceWithDefaults() *Interface { + this := Interface{} + return &this +} + +// GetId returns the Id field value +func (o *Interface) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Interface) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Interface) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Interface) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Interface) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Interface) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Interface) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Interface) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Interface) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *Interface) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *Interface) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *Interface) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetVdcs returns the Vdcs field value if set, zero value otherwise. +func (o *Interface) GetVdcs() []int32 { + if o == nil || IsNil(o.Vdcs) { + var ret []int32 + return ret + } + return o.Vdcs +} + +// GetVdcsOk returns a tuple with the Vdcs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetVdcsOk() ([]int32, bool) { + if o == nil || IsNil(o.Vdcs) { + return nil, false + } + return o.Vdcs, true +} + +// HasVdcs returns a boolean if a field has been set. +func (o *Interface) HasVdcs() bool { + if o != nil && !IsNil(o.Vdcs) { + return true + } + + return false +} + +// SetVdcs gets a reference to the given []int32 and assigns it to the Vdcs field. +func (o *Interface) SetVdcs(v []int32) { + o.Vdcs = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetModule() ComponentNestedModule { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModule + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetModuleOk() (*ComponentNestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *Interface) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModule and assigns it to the Module field. +func (o *Interface) SetModule(v ComponentNestedModule) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *Interface) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *Interface) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *Interface) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Interface) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Interface) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *Interface) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *Interface) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *Interface) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *Interface) GetType() InterfaceType { + if o == nil { + var ret InterfaceType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Interface) GetTypeOk() (*InterfaceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Interface) SetType(v InterfaceType) { + o.Type = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *Interface) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *Interface) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *Interface) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetParent() NestedInterface { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedInterface + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetParentOk() (*NestedInterface, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *Interface) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedInterface and assigns it to the Parent field. +func (o *Interface) SetParent(v NestedInterface) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *Interface) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *Interface) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetBridge() NestedInterface { + if o == nil || IsNil(o.Bridge.Get()) { + var ret NestedInterface + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetBridgeOk() (*NestedInterface, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *Interface) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableNestedInterface and assigns it to the Bridge field. +func (o *Interface) SetBridge(v NestedInterface) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *Interface) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *Interface) UnsetBridge() { + o.Bridge.Unset() +} + +// GetLag returns the Lag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetLag() NestedInterface { + if o == nil || IsNil(o.Lag.Get()) { + var ret NestedInterface + return ret + } + return *o.Lag.Get() +} + +// GetLagOk returns a tuple with the Lag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetLagOk() (*NestedInterface, bool) { + if o == nil { + return nil, false + } + return o.Lag.Get(), o.Lag.IsSet() +} + +// HasLag returns a boolean if a field has been set. +func (o *Interface) HasLag() bool { + if o != nil && o.Lag.IsSet() { + return true + } + + return false +} + +// SetLag gets a reference to the given NullableNestedInterface and assigns it to the Lag field. +func (o *Interface) SetLag(v NestedInterface) { + o.Lag.Set(&v) +} + +// SetLagNil sets the value for Lag to be an explicit nil +func (o *Interface) SetLagNil() { + o.Lag.Set(nil) +} + +// UnsetLag ensures that no value is present for Lag, not even an explicit nil +func (o *Interface) UnsetLag() { + o.Lag.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *Interface) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *Interface) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *Interface) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *Interface) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *Interface) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *Interface) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *Interface) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *Interface) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetSpeed() int32 { + if o == nil || IsNil(o.Speed.Get()) { + var ret int32 + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *Interface) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableInt32 and assigns it to the Speed field. +func (o *Interface) SetSpeed(v int32) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *Interface) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *Interface) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDuplex returns the Duplex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetDuplex() InterfaceDuplex { + if o == nil || IsNil(o.Duplex.Get()) { + var ret InterfaceDuplex + return ret + } + return *o.Duplex.Get() +} + +// GetDuplexOk returns a tuple with the Duplex field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetDuplexOk() (*InterfaceDuplex, bool) { + if o == nil { + return nil, false + } + return o.Duplex.Get(), o.Duplex.IsSet() +} + +// HasDuplex returns a boolean if a field has been set. +func (o *Interface) HasDuplex() bool { + if o != nil && o.Duplex.IsSet() { + return true + } + + return false +} + +// SetDuplex gets a reference to the given NullableInterfaceDuplex and assigns it to the Duplex field. +func (o *Interface) SetDuplex(v InterfaceDuplex) { + o.Duplex.Set(&v) +} + +// SetDuplexNil sets the value for Duplex to be an explicit nil +func (o *Interface) SetDuplexNil() { + o.Duplex.Set(nil) +} + +// UnsetDuplex ensures that no value is present for Duplex, not even an explicit nil +func (o *Interface) UnsetDuplex() { + o.Duplex.Unset() +} + +// GetWwn returns the Wwn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetWwn() string { + if o == nil || IsNil(o.Wwn.Get()) { + var ret string + return ret + } + return *o.Wwn.Get() +} + +// GetWwnOk returns a tuple with the Wwn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetWwnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Wwn.Get(), o.Wwn.IsSet() +} + +// HasWwn returns a boolean if a field has been set. +func (o *Interface) HasWwn() bool { + if o != nil && o.Wwn.IsSet() { + return true + } + + return false +} + +// SetWwn gets a reference to the given NullableString and assigns it to the Wwn field. +func (o *Interface) SetWwn(v string) { + o.Wwn.Set(&v) +} + +// SetWwnNil sets the value for Wwn to be an explicit nil +func (o *Interface) SetWwnNil() { + o.Wwn.Set(nil) +} + +// UnsetWwn ensures that no value is present for Wwn, not even an explicit nil +func (o *Interface) UnsetWwn() { + o.Wwn.Unset() +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *Interface) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *Interface) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *Interface) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Interface) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Interface) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Interface) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *Interface) GetMode() InterfaceMode { + if o == nil || IsNil(o.Mode) { + var ret InterfaceMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetModeOk() (*InterfaceMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *Interface) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given InterfaceMode and assigns it to the Mode field. +func (o *Interface) SetMode(v InterfaceMode) { + o.Mode = &v +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise. +func (o *Interface) GetRfRole() InterfaceRfRole { + if o == nil || IsNil(o.RfRole) { + var ret InterfaceRfRole + return ret + } + return *o.RfRole +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetRfRoleOk() (*InterfaceRfRole, bool) { + if o == nil || IsNil(o.RfRole) { + return nil, false + } + return o.RfRole, true +} + +// HasRfRole returns a boolean if a field has been set. +func (o *Interface) HasRfRole() bool { + if o != nil && !IsNil(o.RfRole) { + return true + } + + return false +} + +// SetRfRole gets a reference to the given InterfaceRfRole and assigns it to the RfRole field. +func (o *Interface) SetRfRole(v InterfaceRfRole) { + o.RfRole = &v +} + +// GetRfChannel returns the RfChannel field value if set, zero value otherwise. +func (o *Interface) GetRfChannel() InterfaceRfChannel { + if o == nil || IsNil(o.RfChannel) { + var ret InterfaceRfChannel + return ret + } + return *o.RfChannel +} + +// GetRfChannelOk returns a tuple with the RfChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetRfChannelOk() (*InterfaceRfChannel, bool) { + if o == nil || IsNil(o.RfChannel) { + return nil, false + } + return o.RfChannel, true +} + +// HasRfChannel returns a boolean if a field has been set. +func (o *Interface) HasRfChannel() bool { + if o != nil && !IsNil(o.RfChannel) { + return true + } + + return false +} + +// SetRfChannel gets a reference to the given InterfaceRfChannel and assigns it to the RfChannel field. +func (o *Interface) SetRfChannel(v InterfaceRfChannel) { + o.RfChannel = &v +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise. +func (o *Interface) GetPoeMode() InterfacePoeMode { + if o == nil || IsNil(o.PoeMode) { + var ret InterfacePoeMode + return ret + } + return *o.PoeMode +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetPoeModeOk() (*InterfacePoeMode, bool) { + if o == nil || IsNil(o.PoeMode) { + return nil, false + } + return o.PoeMode, true +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *Interface) HasPoeMode() bool { + if o != nil && !IsNil(o.PoeMode) { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given InterfacePoeMode and assigns it to the PoeMode field. +func (o *Interface) SetPoeMode(v InterfacePoeMode) { + o.PoeMode = &v +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise. +func (o *Interface) GetPoeType() InterfacePoeType { + if o == nil || IsNil(o.PoeType) { + var ret InterfacePoeType + return ret + } + return *o.PoeType +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetPoeTypeOk() (*InterfacePoeType, bool) { + if o == nil || IsNil(o.PoeType) { + return nil, false + } + return o.PoeType, true +} + +// HasPoeType returns a boolean if a field has been set. +func (o *Interface) HasPoeType() bool { + if o != nil && !IsNil(o.PoeType) { + return true + } + + return false +} + +// SetPoeType gets a reference to the given InterfacePoeType and assigns it to the PoeType field. +func (o *Interface) SetPoeType(v InterfacePoeType) { + o.PoeType = &v +} + +// GetRfChannelFrequency returns the RfChannelFrequency field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetRfChannelFrequency() float64 { + if o == nil || IsNil(o.RfChannelFrequency.Get()) { + var ret float64 + return ret + } + return *o.RfChannelFrequency.Get() +} + +// GetRfChannelFrequencyOk returns a tuple with the RfChannelFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetRfChannelFrequencyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelFrequency.Get(), o.RfChannelFrequency.IsSet() +} + +// HasRfChannelFrequency returns a boolean if a field has been set. +func (o *Interface) HasRfChannelFrequency() bool { + if o != nil && o.RfChannelFrequency.IsSet() { + return true + } + + return false +} + +// SetRfChannelFrequency gets a reference to the given NullableFloat64 and assigns it to the RfChannelFrequency field. +func (o *Interface) SetRfChannelFrequency(v float64) { + o.RfChannelFrequency.Set(&v) +} + +// SetRfChannelFrequencyNil sets the value for RfChannelFrequency to be an explicit nil +func (o *Interface) SetRfChannelFrequencyNil() { + o.RfChannelFrequency.Set(nil) +} + +// UnsetRfChannelFrequency ensures that no value is present for RfChannelFrequency, not even an explicit nil +func (o *Interface) UnsetRfChannelFrequency() { + o.RfChannelFrequency.Unset() +} + +// GetRfChannelWidth returns the RfChannelWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetRfChannelWidth() float64 { + if o == nil || IsNil(o.RfChannelWidth.Get()) { + var ret float64 + return ret + } + return *o.RfChannelWidth.Get() +} + +// GetRfChannelWidthOk returns a tuple with the RfChannelWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetRfChannelWidthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelWidth.Get(), o.RfChannelWidth.IsSet() +} + +// HasRfChannelWidth returns a boolean if a field has been set. +func (o *Interface) HasRfChannelWidth() bool { + if o != nil && o.RfChannelWidth.IsSet() { + return true + } + + return false +} + +// SetRfChannelWidth gets a reference to the given NullableFloat64 and assigns it to the RfChannelWidth field. +func (o *Interface) SetRfChannelWidth(v float64) { + o.RfChannelWidth.Set(&v) +} + +// SetRfChannelWidthNil sets the value for RfChannelWidth to be an explicit nil +func (o *Interface) SetRfChannelWidthNil() { + o.RfChannelWidth.Set(nil) +} + +// UnsetRfChannelWidth ensures that no value is present for RfChannelWidth, not even an explicit nil +func (o *Interface) UnsetRfChannelWidth() { + o.RfChannelWidth.Unset() +} + +// GetTxPower returns the TxPower field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetTxPower() int32 { + if o == nil || IsNil(o.TxPower.Get()) { + var ret int32 + return ret + } + return *o.TxPower.Get() +} + +// GetTxPowerOk returns a tuple with the TxPower field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetTxPowerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.TxPower.Get(), o.TxPower.IsSet() +} + +// HasTxPower returns a boolean if a field has been set. +func (o *Interface) HasTxPower() bool { + if o != nil && o.TxPower.IsSet() { + return true + } + + return false +} + +// SetTxPower gets a reference to the given NullableInt32 and assigns it to the TxPower field. +func (o *Interface) SetTxPower(v int32) { + o.TxPower.Set(&v) +} + +// SetTxPowerNil sets the value for TxPower to be an explicit nil +func (o *Interface) SetTxPowerNil() { + o.TxPower.Set(nil) +} + +// UnsetTxPower ensures that no value is present for TxPower, not even an explicit nil +func (o *Interface) UnsetTxPower() { + o.TxPower.Unset() +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetUntaggedVlan() NestedVLAN { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret NestedVLAN + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetUntaggedVlanOk() (*NestedVLAN, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *Interface) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableNestedVLAN and assigns it to the UntaggedVlan field. +func (o *Interface) SetUntaggedVlan(v NestedVLAN) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *Interface) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *Interface) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *Interface) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *Interface) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *Interface) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *Interface) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *Interface) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *Interface) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *Interface) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *Interface) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *Interface) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *Interface) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *Interface) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetWirelessLink returns the WirelessLink field value +// If the value is explicit nil, the zero value for NestedWirelessLink will be returned +func (o *Interface) GetWirelessLink() NestedWirelessLink { + if o == nil || o.WirelessLink.Get() == nil { + var ret NestedWirelessLink + return ret + } + + return *o.WirelessLink.Get() +} + +// GetWirelessLinkOk returns a tuple with the WirelessLink field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetWirelessLinkOk() (*NestedWirelessLink, bool) { + if o == nil { + return nil, false + } + return o.WirelessLink.Get(), o.WirelessLink.IsSet() +} + +// SetWirelessLink sets field value +func (o *Interface) SetWirelessLink(v NestedWirelessLink) { + o.WirelessLink.Set(&v) +} + +// GetLinkPeers returns the LinkPeers field value +func (o *Interface) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *Interface) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *Interface) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *Interface) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *Interface) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *Interface) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetWirelessLans returns the WirelessLans field value if set, zero value otherwise. +func (o *Interface) GetWirelessLans() []int32 { + if o == nil || IsNil(o.WirelessLans) { + var ret []int32 + return ret + } + return o.WirelessLans +} + +// GetWirelessLansOk returns a tuple with the WirelessLans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetWirelessLansOk() ([]int32, bool) { + if o == nil || IsNil(o.WirelessLans) { + return nil, false + } + return o.WirelessLans, true +} + +// HasWirelessLans returns a boolean if a field has been set. +func (o *Interface) HasWirelessLans() bool { + if o != nil && !IsNil(o.WirelessLans) { + return true + } + + return false +} + +// SetWirelessLans gets a reference to the given []int32 and assigns it to the WirelessLans field. +func (o *Interface) SetWirelessLans(v []int32) { + o.WirelessLans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Interface) GetVrf() NestedVRF { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRF + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetVrfOk() (*NestedVRF, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *Interface) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRF and assigns it to the Vrf field. +func (o *Interface) SetVrf(v NestedVRF) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *Interface) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *Interface) UnsetVrf() { + o.Vrf.Unset() +} + +// GetL2vpnTermination returns the L2vpnTermination field value +// If the value is explicit nil, the zero value for NestedL2VPNTermination will be returned +func (o *Interface) GetL2vpnTermination() NestedL2VPNTermination { + if o == nil || o.L2vpnTermination.Get() == nil { + var ret NestedL2VPNTermination + return ret + } + + return *o.L2vpnTermination.Get() +} + +// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetL2vpnTerminationOk() (*NestedL2VPNTermination, bool) { + if o == nil { + return nil, false + } + return o.L2vpnTermination.Get(), o.L2vpnTermination.IsSet() +} + +// SetL2vpnTermination sets field value +func (o *Interface) SetL2vpnTermination(v NestedL2VPNTermination) { + o.L2vpnTermination.Set(&v) +} + +// GetConnectedEndpoints returns the ConnectedEndpoints field value +func (o *Interface) GetConnectedEndpoints() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConnectedEndpoints +} + +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// and a boolean to check if the value has been set. +func (o *Interface) GetConnectedEndpointsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConnectedEndpoints, true +} + +// SetConnectedEndpoints sets field value +func (o *Interface) SetConnectedEndpoints(v []interface{}) { + o.ConnectedEndpoints = v +} + +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value +func (o *Interface) GetConnectedEndpointsType() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectedEndpointsType +} + +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// and a boolean to check if the value has been set. +func (o *Interface) GetConnectedEndpointsTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsType, true +} + +// SetConnectedEndpointsType sets field value +func (o *Interface) SetConnectedEndpointsType(v string) { + o.ConnectedEndpointsType = v +} + +// GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value +func (o *Interface) GetConnectedEndpointsReachable() bool { + if o == nil { + var ret bool + return ret + } + + return o.ConnectedEndpointsReachable +} + +// GetConnectedEndpointsReachableOk returns a tuple with the ConnectedEndpointsReachable field value +// and a boolean to check if the value has been set. +func (o *Interface) GetConnectedEndpointsReachableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsReachable, true +} + +// SetConnectedEndpointsReachable sets field value +func (o *Interface) SetConnectedEndpointsReachable(v bool) { + o.ConnectedEndpointsReachable = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Interface) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Interface) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Interface) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Interface) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interface) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Interface) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Interface) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Interface) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Interface) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Interface) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Interface) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Interface) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetCountIpaddresses returns the CountIpaddresses field value +func (o *Interface) GetCountIpaddresses() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CountIpaddresses +} + +// GetCountIpaddressesOk returns a tuple with the CountIpaddresses field value +// and a boolean to check if the value has been set. +func (o *Interface) GetCountIpaddressesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CountIpaddresses, true +} + +// SetCountIpaddresses sets field value +func (o *Interface) SetCountIpaddresses(v int32) { + o.CountIpaddresses = v +} + +// GetCountFhrpGroups returns the CountFhrpGroups field value +func (o *Interface) GetCountFhrpGroups() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CountFhrpGroups +} + +// GetCountFhrpGroupsOk returns a tuple with the CountFhrpGroups field value +// and a boolean to check if the value has been set. +func (o *Interface) GetCountFhrpGroupsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CountFhrpGroups, true +} + +// SetCountFhrpGroups sets field value +func (o *Interface) SetCountFhrpGroups(v int32) { + o.CountFhrpGroups = v +} + +// GetOccupied returns the Occupied field value +func (o *Interface) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *Interface) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *Interface) SetOccupied(v bool) { + o.Occupied = v +} + +func (o Interface) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Interface) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if !IsNil(o.Vdcs) { + toSerialize["vdcs"] = o.Vdcs + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Lag.IsSet() { + toSerialize["lag"] = o.Lag.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if o.Duplex.IsSet() { + toSerialize["duplex"] = o.Duplex.Get() + } + if o.Wwn.IsSet() { + toSerialize["wwn"] = o.Wwn.Get() + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.RfRole) { + toSerialize["rf_role"] = o.RfRole + } + if !IsNil(o.RfChannel) { + toSerialize["rf_channel"] = o.RfChannel + } + if !IsNil(o.PoeMode) { + toSerialize["poe_mode"] = o.PoeMode + } + if !IsNil(o.PoeType) { + toSerialize["poe_type"] = o.PoeType + } + if o.RfChannelFrequency.IsSet() { + toSerialize["rf_channel_frequency"] = o.RfChannelFrequency.Get() + } + if o.RfChannelWidth.IsSet() { + toSerialize["rf_channel_width"] = o.RfChannelWidth.Get() + } + if o.TxPower.IsSet() { + toSerialize["tx_power"] = o.TxPower.Get() + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["wireless_link"] = o.WirelessLink.Get() + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + if !IsNil(o.WirelessLans) { + toSerialize["wireless_lans"] = o.WirelessLans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + toSerialize["connected_endpoints"] = o.ConnectedEndpoints + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType + toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["count_ipaddresses"] = o.CountIpaddresses + toSerialize["count_fhrp_groups"] = o.CountFhrpGroups + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Interface) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "type", + "cable", + "cable_end", + "wireless_link", + "link_peers", + "link_peers_type", + "l2vpn_termination", + "connected_endpoints", + "connected_endpoints_type", + "connected_endpoints_reachable", + "created", + "last_updated", + "count_ipaddresses", + "count_fhrp_groups", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInterface := _Interface{} + + err = json.Unmarshal(data, &varInterface) + + if err != nil { + return err + } + + *o = Interface(varInterface) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "vdcs") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "lag") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "speed") + delete(additionalProperties, "duplex") + delete(additionalProperties, "wwn") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "rf_role") + delete(additionalProperties, "rf_channel") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_channel_frequency") + delete(additionalProperties, "rf_channel_width") + delete(additionalProperties, "tx_power") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "wireless_link") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "wireless_lans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "l2vpn_termination") + delete(additionalProperties, "connected_endpoints") + delete(additionalProperties, "connected_endpoints_type") + delete(additionalProperties, "connected_endpoints_reachable") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "count_ipaddresses") + delete(additionalProperties, "count_fhrp_groups") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterface struct { + value *Interface + isSet bool +} + +func (v NullableInterface) Get() *Interface { + return v.value +} + +func (v *NullableInterface) Set(val *Interface) { + v.value = val + v.isSet = true +} + +func (v NullableInterface) IsSet() bool { + return v.isSet +} + +func (v *NullableInterface) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterface(val *Interface) *NullableInterface { + return &NullableInterface{value: val, isSet: true} +} + +func (v NullableInterface) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterface) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex.go new file mode 100644 index 00000000..67b5d91a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceDuplex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceDuplex{} + +// InterfaceDuplex struct for InterfaceDuplex +type InterfaceDuplex struct { + Value *InterfaceDuplexValue `json:"value,omitempty"` + Label *InterfaceDuplexLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceDuplex InterfaceDuplex + +// NewInterfaceDuplex instantiates a new InterfaceDuplex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceDuplex() *InterfaceDuplex { + this := InterfaceDuplex{} + return &this +} + +// NewInterfaceDuplexWithDefaults instantiates a new InterfaceDuplex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceDuplexWithDefaults() *InterfaceDuplex { + this := InterfaceDuplex{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceDuplex) GetValue() InterfaceDuplexValue { + if o == nil || IsNil(o.Value) { + var ret InterfaceDuplexValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceDuplex) GetValueOk() (*InterfaceDuplexValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceDuplex) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfaceDuplexValue and assigns it to the Value field. +func (o *InterfaceDuplex) SetValue(v InterfaceDuplexValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceDuplex) GetLabel() InterfaceDuplexLabel { + if o == nil || IsNil(o.Label) { + var ret InterfaceDuplexLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceDuplex) GetLabelOk() (*InterfaceDuplexLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceDuplex) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfaceDuplexLabel and assigns it to the Label field. +func (o *InterfaceDuplex) SetLabel(v InterfaceDuplexLabel) { + o.Label = &v +} + +func (o InterfaceDuplex) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceDuplex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceDuplex) UnmarshalJSON(data []byte) (err error) { + varInterfaceDuplex := _InterfaceDuplex{} + + err = json.Unmarshal(data, &varInterfaceDuplex) + + if err != nil { + return err + } + + *o = InterfaceDuplex(varInterfaceDuplex) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceDuplex struct { + value *InterfaceDuplex + isSet bool +} + +func (v NullableInterfaceDuplex) Get() *InterfaceDuplex { + return v.value +} + +func (v *NullableInterfaceDuplex) Set(val *InterfaceDuplex) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceDuplex) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceDuplex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceDuplex(val *InterfaceDuplex) *NullableInterfaceDuplex { + return &NullableInterfaceDuplex{value: val, isSet: true} +} + +func (v NullableInterfaceDuplex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceDuplex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex_label.go new file mode 100644 index 00000000..6f11a84b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceDuplexLabel the model 'InterfaceDuplexLabel' +type InterfaceDuplexLabel string + +// List of Interface_duplex_label +const ( + INTERFACEDUPLEXLABEL_HALF InterfaceDuplexLabel = "Half" + INTERFACEDUPLEXLABEL_FULL InterfaceDuplexLabel = "Full" + INTERFACEDUPLEXLABEL_AUTO InterfaceDuplexLabel = "Auto" +) + +// All allowed values of InterfaceDuplexLabel enum +var AllowedInterfaceDuplexLabelEnumValues = []InterfaceDuplexLabel{ + "Half", + "Full", + "Auto", +} + +func (v *InterfaceDuplexLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceDuplexLabel(value) + for _, existing := range AllowedInterfaceDuplexLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceDuplexLabel", value) +} + +// NewInterfaceDuplexLabelFromValue returns a pointer to a valid InterfaceDuplexLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceDuplexLabelFromValue(v string) (*InterfaceDuplexLabel, error) { + ev := InterfaceDuplexLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceDuplexLabel: valid values are %v", v, AllowedInterfaceDuplexLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceDuplexLabel) IsValid() bool { + for _, existing := range AllowedInterfaceDuplexLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_duplex_label value +func (v InterfaceDuplexLabel) Ptr() *InterfaceDuplexLabel { + return &v +} + +type NullableInterfaceDuplexLabel struct { + value *InterfaceDuplexLabel + isSet bool +} + +func (v NullableInterfaceDuplexLabel) Get() *InterfaceDuplexLabel { + return v.value +} + +func (v *NullableInterfaceDuplexLabel) Set(val *InterfaceDuplexLabel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceDuplexLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceDuplexLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceDuplexLabel(val *InterfaceDuplexLabel) *NullableInterfaceDuplexLabel { + return &NullableInterfaceDuplexLabel{value: val, isSet: true} +} + +func (v NullableInterfaceDuplexLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceDuplexLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex_value.go new file mode 100644 index 00000000..817c8336 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_duplex_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceDuplexValue * `half` - Half * `full` - Full * `auto` - Auto +type InterfaceDuplexValue string + +// List of Interface_duplex_value +const ( + INTERFACEDUPLEXVALUE_HALF InterfaceDuplexValue = "half" + INTERFACEDUPLEXVALUE_FULL InterfaceDuplexValue = "full" + INTERFACEDUPLEXVALUE_AUTO InterfaceDuplexValue = "auto" + INTERFACEDUPLEXVALUE_EMPTY InterfaceDuplexValue = "" +) + +// All allowed values of InterfaceDuplexValue enum +var AllowedInterfaceDuplexValueEnumValues = []InterfaceDuplexValue{ + "half", + "full", + "auto", + "", +} + +func (v *InterfaceDuplexValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceDuplexValue(value) + for _, existing := range AllowedInterfaceDuplexValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceDuplexValue", value) +} + +// NewInterfaceDuplexValueFromValue returns a pointer to a valid InterfaceDuplexValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceDuplexValueFromValue(v string) (*InterfaceDuplexValue, error) { + ev := InterfaceDuplexValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceDuplexValue: valid values are %v", v, AllowedInterfaceDuplexValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceDuplexValue) IsValid() bool { + for _, existing := range AllowedInterfaceDuplexValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_duplex_value value +func (v InterfaceDuplexValue) Ptr() *InterfaceDuplexValue { + return &v +} + +type NullableInterfaceDuplexValue struct { + value *InterfaceDuplexValue + isSet bool +} + +func (v NullableInterfaceDuplexValue) Get() *InterfaceDuplexValue { + return v.value +} + +func (v *NullableInterfaceDuplexValue) Set(val *InterfaceDuplexValue) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceDuplexValue) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceDuplexValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceDuplexValue(val *InterfaceDuplexValue) *NullableInterfaceDuplexValue { + return &NullableInterfaceDuplexValue{value: val, isSet: true} +} + +func (v NullableInterfaceDuplexValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceDuplexValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode.go new file mode 100644 index 00000000..466fe468 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceMode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceMode{} + +// InterfaceMode struct for InterfaceMode +type InterfaceMode struct { + Value *InterfaceModeValue `json:"value,omitempty"` + Label *InterfaceModeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceMode InterfaceMode + +// NewInterfaceMode instantiates a new InterfaceMode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceMode() *InterfaceMode { + this := InterfaceMode{} + return &this +} + +// NewInterfaceModeWithDefaults instantiates a new InterfaceMode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceModeWithDefaults() *InterfaceMode { + this := InterfaceMode{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceMode) GetValue() InterfaceModeValue { + if o == nil || IsNil(o.Value) { + var ret InterfaceModeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceMode) GetValueOk() (*InterfaceModeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceMode) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfaceModeValue and assigns it to the Value field. +func (o *InterfaceMode) SetValue(v InterfaceModeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceMode) GetLabel() InterfaceModeLabel { + if o == nil || IsNil(o.Label) { + var ret InterfaceModeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceMode) GetLabelOk() (*InterfaceModeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceMode) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfaceModeLabel and assigns it to the Label field. +func (o *InterfaceMode) SetLabel(v InterfaceModeLabel) { + o.Label = &v +} + +func (o InterfaceMode) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceMode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceMode) UnmarshalJSON(data []byte) (err error) { + varInterfaceMode := _InterfaceMode{} + + err = json.Unmarshal(data, &varInterfaceMode) + + if err != nil { + return err + } + + *o = InterfaceMode(varInterfaceMode) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceMode struct { + value *InterfaceMode + isSet bool +} + +func (v NullableInterfaceMode) Get() *InterfaceMode { + return v.value +} + +func (v *NullableInterfaceMode) Set(val *InterfaceMode) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceMode) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceMode(val *InterfaceMode) *NullableInterfaceMode { + return &NullableInterfaceMode{value: val, isSet: true} +} + +func (v NullableInterfaceMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode_label.go new file mode 100644 index 00000000..869a5b2d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceModeLabel the model 'InterfaceModeLabel' +type InterfaceModeLabel string + +// List of Interface_mode_label +const ( + INTERFACEMODELABEL_ACCESS InterfaceModeLabel = "Access" + INTERFACEMODELABEL_TAGGED InterfaceModeLabel = "Tagged" + INTERFACEMODELABEL_TAGGED__ALL InterfaceModeLabel = "Tagged (All)" +) + +// All allowed values of InterfaceModeLabel enum +var AllowedInterfaceModeLabelEnumValues = []InterfaceModeLabel{ + "Access", + "Tagged", + "Tagged (All)", +} + +func (v *InterfaceModeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceModeLabel(value) + for _, existing := range AllowedInterfaceModeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceModeLabel", value) +} + +// NewInterfaceModeLabelFromValue returns a pointer to a valid InterfaceModeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceModeLabelFromValue(v string) (*InterfaceModeLabel, error) { + ev := InterfaceModeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceModeLabel: valid values are %v", v, AllowedInterfaceModeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceModeLabel) IsValid() bool { + for _, existing := range AllowedInterfaceModeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_mode_label value +func (v InterfaceModeLabel) Ptr() *InterfaceModeLabel { + return &v +} + +type NullableInterfaceModeLabel struct { + value *InterfaceModeLabel + isSet bool +} + +func (v NullableInterfaceModeLabel) Get() *InterfaceModeLabel { + return v.value +} + +func (v *NullableInterfaceModeLabel) Set(val *InterfaceModeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceModeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceModeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceModeLabel(val *InterfaceModeLabel) *NullableInterfaceModeLabel { + return &NullableInterfaceModeLabel{value: val, isSet: true} +} + +func (v NullableInterfaceModeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceModeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode_value.go new file mode 100644 index 00000000..a952d752 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_mode_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceModeValue * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) +type InterfaceModeValue string + +// List of Interface_mode_value +const ( + INTERFACEMODEVALUE_ACCESS InterfaceModeValue = "access" + INTERFACEMODEVALUE_TAGGED InterfaceModeValue = "tagged" + INTERFACEMODEVALUE_TAGGED_ALL InterfaceModeValue = "tagged-all" + INTERFACEMODEVALUE_EMPTY InterfaceModeValue = "" +) + +// All allowed values of InterfaceModeValue enum +var AllowedInterfaceModeValueEnumValues = []InterfaceModeValue{ + "access", + "tagged", + "tagged-all", + "", +} + +func (v *InterfaceModeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceModeValue(value) + for _, existing := range AllowedInterfaceModeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceModeValue", value) +} + +// NewInterfaceModeValueFromValue returns a pointer to a valid InterfaceModeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceModeValueFromValue(v string) (*InterfaceModeValue, error) { + ev := InterfaceModeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceModeValue: valid values are %v", v, AllowedInterfaceModeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceModeValue) IsValid() bool { + for _, existing := range AllowedInterfaceModeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_mode_value value +func (v InterfaceModeValue) Ptr() *InterfaceModeValue { + return &v +} + +type NullableInterfaceModeValue struct { + value *InterfaceModeValue + isSet bool +} + +func (v NullableInterfaceModeValue) Get() *InterfaceModeValue { + return v.value +} + +func (v *NullableInterfaceModeValue) Set(val *InterfaceModeValue) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceModeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceModeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceModeValue(val *InterfaceModeValue) *NullableInterfaceModeValue { + return &NullableInterfaceModeValue{value: val, isSet: true} +} + +func (v NullableInterfaceModeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceModeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode.go new file mode 100644 index 00000000..256324aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfacePoeMode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfacePoeMode{} + +// InterfacePoeMode struct for InterfacePoeMode +type InterfacePoeMode struct { + Value *InterfacePoeModeValue `json:"value,omitempty"` + Label *InterfacePoeModeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfacePoeMode InterfacePoeMode + +// NewInterfacePoeMode instantiates a new InterfacePoeMode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfacePoeMode() *InterfacePoeMode { + this := InterfacePoeMode{} + return &this +} + +// NewInterfacePoeModeWithDefaults instantiates a new InterfacePoeMode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfacePoeModeWithDefaults() *InterfacePoeMode { + this := InterfacePoeMode{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfacePoeMode) GetValue() InterfacePoeModeValue { + if o == nil || IsNil(o.Value) { + var ret InterfacePoeModeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfacePoeMode) GetValueOk() (*InterfacePoeModeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfacePoeMode) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfacePoeModeValue and assigns it to the Value field. +func (o *InterfacePoeMode) SetValue(v InterfacePoeModeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfacePoeMode) GetLabel() InterfacePoeModeLabel { + if o == nil || IsNil(o.Label) { + var ret InterfacePoeModeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfacePoeMode) GetLabelOk() (*InterfacePoeModeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfacePoeMode) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfacePoeModeLabel and assigns it to the Label field. +func (o *InterfacePoeMode) SetLabel(v InterfacePoeModeLabel) { + o.Label = &v +} + +func (o InterfacePoeMode) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfacePoeMode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfacePoeMode) UnmarshalJSON(data []byte) (err error) { + varInterfacePoeMode := _InterfacePoeMode{} + + err = json.Unmarshal(data, &varInterfacePoeMode) + + if err != nil { + return err + } + + *o = InterfacePoeMode(varInterfacePoeMode) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfacePoeMode struct { + value *InterfacePoeMode + isSet bool +} + +func (v NullableInterfacePoeMode) Get() *InterfacePoeMode { + return v.value +} + +func (v *NullableInterfacePoeMode) Set(val *InterfacePoeMode) { + v.value = val + v.isSet = true +} + +func (v NullableInterfacePoeMode) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfacePoeMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfacePoeMode(val *InterfacePoeMode) *NullableInterfacePoeMode { + return &NullableInterfacePoeMode{value: val, isSet: true} +} + +func (v NullableInterfacePoeMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfacePoeMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode_label.go new file mode 100644 index 00000000..04b18355 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfacePoeModeLabel the model 'InterfacePoeModeLabel' +type InterfacePoeModeLabel string + +// List of Interface_poe_mode_label +const ( + INTERFACEPOEMODELABEL_PD InterfacePoeModeLabel = "PD" + INTERFACEPOEMODELABEL_PSE InterfacePoeModeLabel = "PSE" +) + +// All allowed values of InterfacePoeModeLabel enum +var AllowedInterfacePoeModeLabelEnumValues = []InterfacePoeModeLabel{ + "PD", + "PSE", +} + +func (v *InterfacePoeModeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfacePoeModeLabel(value) + for _, existing := range AllowedInterfacePoeModeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfacePoeModeLabel", value) +} + +// NewInterfacePoeModeLabelFromValue returns a pointer to a valid InterfacePoeModeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfacePoeModeLabelFromValue(v string) (*InterfacePoeModeLabel, error) { + ev := InterfacePoeModeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfacePoeModeLabel: valid values are %v", v, AllowedInterfacePoeModeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfacePoeModeLabel) IsValid() bool { + for _, existing := range AllowedInterfacePoeModeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_poe_mode_label value +func (v InterfacePoeModeLabel) Ptr() *InterfacePoeModeLabel { + return &v +} + +type NullableInterfacePoeModeLabel struct { + value *InterfacePoeModeLabel + isSet bool +} + +func (v NullableInterfacePoeModeLabel) Get() *InterfacePoeModeLabel { + return v.value +} + +func (v *NullableInterfacePoeModeLabel) Set(val *InterfacePoeModeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfacePoeModeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfacePoeModeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfacePoeModeLabel(val *InterfacePoeModeLabel) *NullableInterfacePoeModeLabel { + return &NullableInterfacePoeModeLabel{value: val, isSet: true} +} + +func (v NullableInterfacePoeModeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfacePoeModeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode_value.go new file mode 100644 index 00000000..271ff286 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_mode_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfacePoeModeValue * `pd` - PD * `pse` - PSE +type InterfacePoeModeValue string + +// List of Interface_poe_mode_value +const ( + INTERFACEPOEMODEVALUE_PD InterfacePoeModeValue = "pd" + INTERFACEPOEMODEVALUE_PSE InterfacePoeModeValue = "pse" + INTERFACEPOEMODEVALUE_EMPTY InterfacePoeModeValue = "" +) + +// All allowed values of InterfacePoeModeValue enum +var AllowedInterfacePoeModeValueEnumValues = []InterfacePoeModeValue{ + "pd", + "pse", + "", +} + +func (v *InterfacePoeModeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfacePoeModeValue(value) + for _, existing := range AllowedInterfacePoeModeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfacePoeModeValue", value) +} + +// NewInterfacePoeModeValueFromValue returns a pointer to a valid InterfacePoeModeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfacePoeModeValueFromValue(v string) (*InterfacePoeModeValue, error) { + ev := InterfacePoeModeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfacePoeModeValue: valid values are %v", v, AllowedInterfacePoeModeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfacePoeModeValue) IsValid() bool { + for _, existing := range AllowedInterfacePoeModeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_poe_mode_value value +func (v InterfacePoeModeValue) Ptr() *InterfacePoeModeValue { + return &v +} + +type NullableInterfacePoeModeValue struct { + value *InterfacePoeModeValue + isSet bool +} + +func (v NullableInterfacePoeModeValue) Get() *InterfacePoeModeValue { + return v.value +} + +func (v *NullableInterfacePoeModeValue) Set(val *InterfacePoeModeValue) { + v.value = val + v.isSet = true +} + +func (v NullableInterfacePoeModeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfacePoeModeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfacePoeModeValue(val *InterfacePoeModeValue) *NullableInterfacePoeModeValue { + return &NullableInterfacePoeModeValue{value: val, isSet: true} +} + +func (v NullableInterfacePoeModeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfacePoeModeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type.go new file mode 100644 index 00000000..7474f9d8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfacePoeType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfacePoeType{} + +// InterfacePoeType struct for InterfacePoeType +type InterfacePoeType struct { + Value *InterfacePoeTypeValue `json:"value,omitempty"` + Label *InterfacePoeTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfacePoeType InterfacePoeType + +// NewInterfacePoeType instantiates a new InterfacePoeType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfacePoeType() *InterfacePoeType { + this := InterfacePoeType{} + return &this +} + +// NewInterfacePoeTypeWithDefaults instantiates a new InterfacePoeType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfacePoeTypeWithDefaults() *InterfacePoeType { + this := InterfacePoeType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfacePoeType) GetValue() InterfacePoeTypeValue { + if o == nil || IsNil(o.Value) { + var ret InterfacePoeTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfacePoeType) GetValueOk() (*InterfacePoeTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfacePoeType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfacePoeTypeValue and assigns it to the Value field. +func (o *InterfacePoeType) SetValue(v InterfacePoeTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfacePoeType) GetLabel() InterfacePoeTypeLabel { + if o == nil || IsNil(o.Label) { + var ret InterfacePoeTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfacePoeType) GetLabelOk() (*InterfacePoeTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfacePoeType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfacePoeTypeLabel and assigns it to the Label field. +func (o *InterfacePoeType) SetLabel(v InterfacePoeTypeLabel) { + o.Label = &v +} + +func (o InterfacePoeType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfacePoeType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfacePoeType) UnmarshalJSON(data []byte) (err error) { + varInterfacePoeType := _InterfacePoeType{} + + err = json.Unmarshal(data, &varInterfacePoeType) + + if err != nil { + return err + } + + *o = InterfacePoeType(varInterfacePoeType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfacePoeType struct { + value *InterfacePoeType + isSet bool +} + +func (v NullableInterfacePoeType) Get() *InterfacePoeType { + return v.value +} + +func (v *NullableInterfacePoeType) Set(val *InterfacePoeType) { + v.value = val + v.isSet = true +} + +func (v NullableInterfacePoeType) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfacePoeType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfacePoeType(val *InterfacePoeType) *NullableInterfacePoeType { + return &NullableInterfacePoeType{value: val, isSet: true} +} + +func (v NullableInterfacePoeType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfacePoeType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type_label.go new file mode 100644 index 00000000..f6f8e029 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type_label.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfacePoeTypeLabel the model 'InterfacePoeTypeLabel' +type InterfacePoeTypeLabel string + +// List of Interface_poe_type_label +const ( + INTERFACEPOETYPELABEL__802_3AF__TYPE_1 InterfacePoeTypeLabel = "802.3af (Type 1)" + INTERFACEPOETYPELABEL__802_3AT__TYPE_2 InterfacePoeTypeLabel = "802.3at (Type 2)" + INTERFACEPOETYPELABEL__802_3BT__TYPE_3 InterfacePoeTypeLabel = "802.3bt (Type 3)" + INTERFACEPOETYPELABEL__802_3BT__TYPE_4 InterfacePoeTypeLabel = "802.3bt (Type 4)" + INTERFACEPOETYPELABEL_PASSIVE_24_V__2_PAIR InterfacePoeTypeLabel = "Passive 24V (2-pair)" + INTERFACEPOETYPELABEL_PASSIVE_24_V__4_PAIR InterfacePoeTypeLabel = "Passive 24V (4-pair)" + INTERFACEPOETYPELABEL_PASSIVE_48_V__2_PAIR InterfacePoeTypeLabel = "Passive 48V (2-pair)" + INTERFACEPOETYPELABEL_PASSIVE_48_V__4_PAIR InterfacePoeTypeLabel = "Passive 48V (4-pair)" +) + +// All allowed values of InterfacePoeTypeLabel enum +var AllowedInterfacePoeTypeLabelEnumValues = []InterfacePoeTypeLabel{ + "802.3af (Type 1)", + "802.3at (Type 2)", + "802.3bt (Type 3)", + "802.3bt (Type 4)", + "Passive 24V (2-pair)", + "Passive 24V (4-pair)", + "Passive 48V (2-pair)", + "Passive 48V (4-pair)", +} + +func (v *InterfacePoeTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfacePoeTypeLabel(value) + for _, existing := range AllowedInterfacePoeTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfacePoeTypeLabel", value) +} + +// NewInterfacePoeTypeLabelFromValue returns a pointer to a valid InterfacePoeTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfacePoeTypeLabelFromValue(v string) (*InterfacePoeTypeLabel, error) { + ev := InterfacePoeTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfacePoeTypeLabel: valid values are %v", v, AllowedInterfacePoeTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfacePoeTypeLabel) IsValid() bool { + for _, existing := range AllowedInterfacePoeTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_poe_type_label value +func (v InterfacePoeTypeLabel) Ptr() *InterfacePoeTypeLabel { + return &v +} + +type NullableInterfacePoeTypeLabel struct { + value *InterfacePoeTypeLabel + isSet bool +} + +func (v NullableInterfacePoeTypeLabel) Get() *InterfacePoeTypeLabel { + return v.value +} + +func (v *NullableInterfacePoeTypeLabel) Set(val *InterfacePoeTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfacePoeTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfacePoeTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfacePoeTypeLabel(val *InterfacePoeTypeLabel) *NullableInterfacePoeTypeLabel { + return &NullableInterfacePoeTypeLabel{value: val, isSet: true} +} + +func (v NullableInterfacePoeTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfacePoeTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type_value.go new file mode 100644 index 00000000..df681abb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_poe_type_value.go @@ -0,0 +1,124 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfacePoeTypeValue * `type1-ieee802.3af` - 802.3af (Type 1) * `type2-ieee802.3at` - 802.3at (Type 2) * `type3-ieee802.3bt` - 802.3bt (Type 3) * `type4-ieee802.3bt` - 802.3bt (Type 4) * `passive-24v-2pair` - Passive 24V (2-pair) * `passive-24v-4pair` - Passive 24V (4-pair) * `passive-48v-2pair` - Passive 48V (2-pair) * `passive-48v-4pair` - Passive 48V (4-pair) +type InterfacePoeTypeValue string + +// List of Interface_poe_type_value +const ( + INTERFACEPOETYPEVALUE_TYPE1_IEEE802_3AF InterfacePoeTypeValue = "type1-ieee802.3af" + INTERFACEPOETYPEVALUE_TYPE2_IEEE802_3AT InterfacePoeTypeValue = "type2-ieee802.3at" + INTERFACEPOETYPEVALUE_TYPE3_IEEE802_3BT InterfacePoeTypeValue = "type3-ieee802.3bt" + INTERFACEPOETYPEVALUE_TYPE4_IEEE802_3BT InterfacePoeTypeValue = "type4-ieee802.3bt" + INTERFACEPOETYPEVALUE_PASSIVE_24V_2PAIR InterfacePoeTypeValue = "passive-24v-2pair" + INTERFACEPOETYPEVALUE_PASSIVE_24V_4PAIR InterfacePoeTypeValue = "passive-24v-4pair" + INTERFACEPOETYPEVALUE_PASSIVE_48V_2PAIR InterfacePoeTypeValue = "passive-48v-2pair" + INTERFACEPOETYPEVALUE_PASSIVE_48V_4PAIR InterfacePoeTypeValue = "passive-48v-4pair" + INTERFACEPOETYPEVALUE_EMPTY InterfacePoeTypeValue = "" +) + +// All allowed values of InterfacePoeTypeValue enum +var AllowedInterfacePoeTypeValueEnumValues = []InterfacePoeTypeValue{ + "type1-ieee802.3af", + "type2-ieee802.3at", + "type3-ieee802.3bt", + "type4-ieee802.3bt", + "passive-24v-2pair", + "passive-24v-4pair", + "passive-48v-2pair", + "passive-48v-4pair", + "", +} + +func (v *InterfacePoeTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfacePoeTypeValue(value) + for _, existing := range AllowedInterfacePoeTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfacePoeTypeValue", value) +} + +// NewInterfacePoeTypeValueFromValue returns a pointer to a valid InterfacePoeTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfacePoeTypeValueFromValue(v string) (*InterfacePoeTypeValue, error) { + ev := InterfacePoeTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfacePoeTypeValue: valid values are %v", v, AllowedInterfacePoeTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfacePoeTypeValue) IsValid() bool { + for _, existing := range AllowedInterfacePoeTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_poe_type_value value +func (v InterfacePoeTypeValue) Ptr() *InterfacePoeTypeValue { + return &v +} + +type NullableInterfacePoeTypeValue struct { + value *InterfacePoeTypeValue + isSet bool +} + +func (v NullableInterfacePoeTypeValue) Get() *InterfacePoeTypeValue { + return v.value +} + +func (v *NullableInterfacePoeTypeValue) Set(val *InterfacePoeTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableInterfacePoeTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfacePoeTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfacePoeTypeValue(val *InterfacePoeTypeValue) *NullableInterfacePoeTypeValue { + return &NullableInterfacePoeTypeValue{value: val, isSet: true} +} + +func (v NullableInterfacePoeTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfacePoeTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_request.go new file mode 100644 index 00000000..4f6bb613 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_request.go @@ -0,0 +1,1456 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the InterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceRequest{} + +// InterfaceRequest Adds support for custom fields and tags. +type InterfaceRequest struct { + Device NestedDeviceRequest `json:"device"` + Vdcs []int32 `json:"vdcs,omitempty"` + Module NullableComponentNestedModuleRequest `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type InterfaceTypeValue `json:"type"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableNestedInterfaceRequest `json:"parent,omitempty"` + Bridge NullableNestedInterfaceRequest `json:"bridge,omitempty"` + Lag NullableNestedInterfaceRequest `json:"lag,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Speed NullableInt32 `json:"speed,omitempty"` + Duplex NullableInterfaceRequestDuplex `json:"duplex,omitempty"` + Wwn NullableString `json:"wwn,omitempty"` + // This interface is used only for out-of-band management + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Mode *InterfaceModeValue `json:"mode,omitempty"` + RfRole *InterfaceRfRoleValue `json:"rf_role,omitempty"` + RfChannel *InterfaceRfChannelValue `json:"rf_channel,omitempty"` + PoeMode *InterfacePoeModeValue `json:"poe_mode,omitempty"` + PoeType *InterfacePoeTypeValue `json:"poe_type,omitempty"` + // Populated by selected channel (if set) + RfChannelFrequency NullableFloat64 `json:"rf_channel_frequency,omitempty"` + // Populated by selected channel (if set) + RfChannelWidth NullableFloat64 `json:"rf_channel_width,omitempty"` + TxPower NullableInt32 `json:"tx_power,omitempty"` + UntaggedVlan NullableNestedVLANRequest `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + WirelessLans []int32 `json:"wireless_lans,omitempty"` + Vrf NullableNestedVRFRequest `json:"vrf,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceRequest InterfaceRequest + +// NewInterfaceRequest instantiates a new InterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceRequest(device NestedDeviceRequest, name string, type_ InterfaceTypeValue) *InterfaceRequest { + this := InterfaceRequest{} + this.Device = device + this.Name = name + this.Type = type_ + return &this +} + +// NewInterfaceRequestWithDefaults instantiates a new InterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceRequestWithDefaults() *InterfaceRequest { + this := InterfaceRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *InterfaceRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *InterfaceRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetVdcs returns the Vdcs field value if set, zero value otherwise. +func (o *InterfaceRequest) GetVdcs() []int32 { + if o == nil || IsNil(o.Vdcs) { + var ret []int32 + return ret + } + return o.Vdcs +} + +// GetVdcsOk returns a tuple with the Vdcs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetVdcsOk() ([]int32, bool) { + if o == nil || IsNil(o.Vdcs) { + return nil, false + } + return o.Vdcs, true +} + +// HasVdcs returns a boolean if a field has been set. +func (o *InterfaceRequest) HasVdcs() bool { + if o != nil && !IsNil(o.Vdcs) { + return true + } + + return false +} + +// SetVdcs gets a reference to the given []int32 and assigns it to the Vdcs field. +func (o *InterfaceRequest) SetVdcs(v []int32) { + o.Vdcs = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetModule() ComponentNestedModuleRequest { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModuleRequest + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetModuleOk() (*ComponentNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *InterfaceRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModuleRequest and assigns it to the Module field. +func (o *InterfaceRequest) SetModule(v ComponentNestedModuleRequest) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *InterfaceRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *InterfaceRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *InterfaceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InterfaceRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InterfaceRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *InterfaceRequest) GetType() InterfaceTypeValue { + if o == nil { + var ret InterfaceTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetTypeOk() (*InterfaceTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InterfaceRequest) SetType(v InterfaceTypeValue) { + o.Type = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *InterfaceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *InterfaceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *InterfaceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetParent() NestedInterfaceRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedInterfaceRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetParentOk() (*NestedInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *InterfaceRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedInterfaceRequest and assigns it to the Parent field. +func (o *InterfaceRequest) SetParent(v NestedInterfaceRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *InterfaceRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *InterfaceRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetBridge() NestedInterfaceRequest { + if o == nil || IsNil(o.Bridge.Get()) { + var ret NestedInterfaceRequest + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetBridgeOk() (*NestedInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *InterfaceRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableNestedInterfaceRequest and assigns it to the Bridge field. +func (o *InterfaceRequest) SetBridge(v NestedInterfaceRequest) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *InterfaceRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *InterfaceRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetLag returns the Lag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetLag() NestedInterfaceRequest { + if o == nil || IsNil(o.Lag.Get()) { + var ret NestedInterfaceRequest + return ret + } + return *o.Lag.Get() +} + +// GetLagOk returns a tuple with the Lag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetLagOk() (*NestedInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return o.Lag.Get(), o.Lag.IsSet() +} + +// HasLag returns a boolean if a field has been set. +func (o *InterfaceRequest) HasLag() bool { + if o != nil && o.Lag.IsSet() { + return true + } + + return false +} + +// SetLag gets a reference to the given NullableNestedInterfaceRequest and assigns it to the Lag field. +func (o *InterfaceRequest) SetLag(v NestedInterfaceRequest) { + o.Lag.Set(&v) +} + +// SetLagNil sets the value for Lag to be an explicit nil +func (o *InterfaceRequest) SetLagNil() { + o.Lag.Set(nil) +} + +// UnsetLag ensures that no value is present for Lag, not even an explicit nil +func (o *InterfaceRequest) UnsetLag() { + o.Lag.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *InterfaceRequest) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *InterfaceRequest) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *InterfaceRequest) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *InterfaceRequest) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *InterfaceRequest) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *InterfaceRequest) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *InterfaceRequest) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *InterfaceRequest) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetSpeed() int32 { + if o == nil || IsNil(o.Speed.Get()) { + var ret int32 + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *InterfaceRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableInt32 and assigns it to the Speed field. +func (o *InterfaceRequest) SetSpeed(v int32) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *InterfaceRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *InterfaceRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDuplex returns the Duplex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetDuplex() InterfaceRequestDuplex { + if o == nil || IsNil(o.Duplex.Get()) { + var ret InterfaceRequestDuplex + return ret + } + return *o.Duplex.Get() +} + +// GetDuplexOk returns a tuple with the Duplex field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetDuplexOk() (*InterfaceRequestDuplex, bool) { + if o == nil { + return nil, false + } + return o.Duplex.Get(), o.Duplex.IsSet() +} + +// HasDuplex returns a boolean if a field has been set. +func (o *InterfaceRequest) HasDuplex() bool { + if o != nil && o.Duplex.IsSet() { + return true + } + + return false +} + +// SetDuplex gets a reference to the given NullableInterfaceRequestDuplex and assigns it to the Duplex field. +func (o *InterfaceRequest) SetDuplex(v InterfaceRequestDuplex) { + o.Duplex.Set(&v) +} + +// SetDuplexNil sets the value for Duplex to be an explicit nil +func (o *InterfaceRequest) SetDuplexNil() { + o.Duplex.Set(nil) +} + +// UnsetDuplex ensures that no value is present for Duplex, not even an explicit nil +func (o *InterfaceRequest) UnsetDuplex() { + o.Duplex.Unset() +} + +// GetWwn returns the Wwn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetWwn() string { + if o == nil || IsNil(o.Wwn.Get()) { + var ret string + return ret + } + return *o.Wwn.Get() +} + +// GetWwnOk returns a tuple with the Wwn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetWwnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Wwn.Get(), o.Wwn.IsSet() +} + +// HasWwn returns a boolean if a field has been set. +func (o *InterfaceRequest) HasWwn() bool { + if o != nil && o.Wwn.IsSet() { + return true + } + + return false +} + +// SetWwn gets a reference to the given NullableString and assigns it to the Wwn field. +func (o *InterfaceRequest) SetWwn(v string) { + o.Wwn.Set(&v) +} + +// SetWwnNil sets the value for Wwn to be an explicit nil +func (o *InterfaceRequest) SetWwnNil() { + o.Wwn.Set(nil) +} + +// UnsetWwn ensures that no value is present for Wwn, not even an explicit nil +func (o *InterfaceRequest) UnsetWwn() { + o.Wwn.Unset() +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *InterfaceRequest) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *InterfaceRequest) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *InterfaceRequest) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InterfaceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InterfaceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InterfaceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *InterfaceRequest) GetMode() InterfaceModeValue { + if o == nil || IsNil(o.Mode) { + var ret InterfaceModeValue + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetModeOk() (*InterfaceModeValue, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *InterfaceRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given InterfaceModeValue and assigns it to the Mode field. +func (o *InterfaceRequest) SetMode(v InterfaceModeValue) { + o.Mode = &v +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise. +func (o *InterfaceRequest) GetRfRole() InterfaceRfRoleValue { + if o == nil || IsNil(o.RfRole) { + var ret InterfaceRfRoleValue + return ret + } + return *o.RfRole +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetRfRoleOk() (*InterfaceRfRoleValue, bool) { + if o == nil || IsNil(o.RfRole) { + return nil, false + } + return o.RfRole, true +} + +// HasRfRole returns a boolean if a field has been set. +func (o *InterfaceRequest) HasRfRole() bool { + if o != nil && !IsNil(o.RfRole) { + return true + } + + return false +} + +// SetRfRole gets a reference to the given InterfaceRfRoleValue and assigns it to the RfRole field. +func (o *InterfaceRequest) SetRfRole(v InterfaceRfRoleValue) { + o.RfRole = &v +} + +// GetRfChannel returns the RfChannel field value if set, zero value otherwise. +func (o *InterfaceRequest) GetRfChannel() InterfaceRfChannelValue { + if o == nil || IsNil(o.RfChannel) { + var ret InterfaceRfChannelValue + return ret + } + return *o.RfChannel +} + +// GetRfChannelOk returns a tuple with the RfChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetRfChannelOk() (*InterfaceRfChannelValue, bool) { + if o == nil || IsNil(o.RfChannel) { + return nil, false + } + return o.RfChannel, true +} + +// HasRfChannel returns a boolean if a field has been set. +func (o *InterfaceRequest) HasRfChannel() bool { + if o != nil && !IsNil(o.RfChannel) { + return true + } + + return false +} + +// SetRfChannel gets a reference to the given InterfaceRfChannelValue and assigns it to the RfChannel field. +func (o *InterfaceRequest) SetRfChannel(v InterfaceRfChannelValue) { + o.RfChannel = &v +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise. +func (o *InterfaceRequest) GetPoeMode() InterfacePoeModeValue { + if o == nil || IsNil(o.PoeMode) { + var ret InterfacePoeModeValue + return ret + } + return *o.PoeMode +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetPoeModeOk() (*InterfacePoeModeValue, bool) { + if o == nil || IsNil(o.PoeMode) { + return nil, false + } + return o.PoeMode, true +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *InterfaceRequest) HasPoeMode() bool { + if o != nil && !IsNil(o.PoeMode) { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given InterfacePoeModeValue and assigns it to the PoeMode field. +func (o *InterfaceRequest) SetPoeMode(v InterfacePoeModeValue) { + o.PoeMode = &v +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise. +func (o *InterfaceRequest) GetPoeType() InterfacePoeTypeValue { + if o == nil || IsNil(o.PoeType) { + var ret InterfacePoeTypeValue + return ret + } + return *o.PoeType +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetPoeTypeOk() (*InterfacePoeTypeValue, bool) { + if o == nil || IsNil(o.PoeType) { + return nil, false + } + return o.PoeType, true +} + +// HasPoeType returns a boolean if a field has been set. +func (o *InterfaceRequest) HasPoeType() bool { + if o != nil && !IsNil(o.PoeType) { + return true + } + + return false +} + +// SetPoeType gets a reference to the given InterfacePoeTypeValue and assigns it to the PoeType field. +func (o *InterfaceRequest) SetPoeType(v InterfacePoeTypeValue) { + o.PoeType = &v +} + +// GetRfChannelFrequency returns the RfChannelFrequency field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetRfChannelFrequency() float64 { + if o == nil || IsNil(o.RfChannelFrequency.Get()) { + var ret float64 + return ret + } + return *o.RfChannelFrequency.Get() +} + +// GetRfChannelFrequencyOk returns a tuple with the RfChannelFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetRfChannelFrequencyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelFrequency.Get(), o.RfChannelFrequency.IsSet() +} + +// HasRfChannelFrequency returns a boolean if a field has been set. +func (o *InterfaceRequest) HasRfChannelFrequency() bool { + if o != nil && o.RfChannelFrequency.IsSet() { + return true + } + + return false +} + +// SetRfChannelFrequency gets a reference to the given NullableFloat64 and assigns it to the RfChannelFrequency field. +func (o *InterfaceRequest) SetRfChannelFrequency(v float64) { + o.RfChannelFrequency.Set(&v) +} + +// SetRfChannelFrequencyNil sets the value for RfChannelFrequency to be an explicit nil +func (o *InterfaceRequest) SetRfChannelFrequencyNil() { + o.RfChannelFrequency.Set(nil) +} + +// UnsetRfChannelFrequency ensures that no value is present for RfChannelFrequency, not even an explicit nil +func (o *InterfaceRequest) UnsetRfChannelFrequency() { + o.RfChannelFrequency.Unset() +} + +// GetRfChannelWidth returns the RfChannelWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetRfChannelWidth() float64 { + if o == nil || IsNil(o.RfChannelWidth.Get()) { + var ret float64 + return ret + } + return *o.RfChannelWidth.Get() +} + +// GetRfChannelWidthOk returns a tuple with the RfChannelWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetRfChannelWidthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelWidth.Get(), o.RfChannelWidth.IsSet() +} + +// HasRfChannelWidth returns a boolean if a field has been set. +func (o *InterfaceRequest) HasRfChannelWidth() bool { + if o != nil && o.RfChannelWidth.IsSet() { + return true + } + + return false +} + +// SetRfChannelWidth gets a reference to the given NullableFloat64 and assigns it to the RfChannelWidth field. +func (o *InterfaceRequest) SetRfChannelWidth(v float64) { + o.RfChannelWidth.Set(&v) +} + +// SetRfChannelWidthNil sets the value for RfChannelWidth to be an explicit nil +func (o *InterfaceRequest) SetRfChannelWidthNil() { + o.RfChannelWidth.Set(nil) +} + +// UnsetRfChannelWidth ensures that no value is present for RfChannelWidth, not even an explicit nil +func (o *InterfaceRequest) UnsetRfChannelWidth() { + o.RfChannelWidth.Unset() +} + +// GetTxPower returns the TxPower field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetTxPower() int32 { + if o == nil || IsNil(o.TxPower.Get()) { + var ret int32 + return ret + } + return *o.TxPower.Get() +} + +// GetTxPowerOk returns a tuple with the TxPower field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetTxPowerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.TxPower.Get(), o.TxPower.IsSet() +} + +// HasTxPower returns a boolean if a field has been set. +func (o *InterfaceRequest) HasTxPower() bool { + if o != nil && o.TxPower.IsSet() { + return true + } + + return false +} + +// SetTxPower gets a reference to the given NullableInt32 and assigns it to the TxPower field. +func (o *InterfaceRequest) SetTxPower(v int32) { + o.TxPower.Set(&v) +} + +// SetTxPowerNil sets the value for TxPower to be an explicit nil +func (o *InterfaceRequest) SetTxPowerNil() { + o.TxPower.Set(nil) +} + +// UnsetTxPower ensures that no value is present for TxPower, not even an explicit nil +func (o *InterfaceRequest) UnsetTxPower() { + o.TxPower.Unset() +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetUntaggedVlan() NestedVLANRequest { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret NestedVLANRequest + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetUntaggedVlanOk() (*NestedVLANRequest, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *InterfaceRequest) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableNestedVLANRequest and assigns it to the UntaggedVlan field. +func (o *InterfaceRequest) SetUntaggedVlan(v NestedVLANRequest) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *InterfaceRequest) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *InterfaceRequest) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *InterfaceRequest) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *InterfaceRequest) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *InterfaceRequest) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *InterfaceRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *InterfaceRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *InterfaceRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetWirelessLans returns the WirelessLans field value if set, zero value otherwise. +func (o *InterfaceRequest) GetWirelessLans() []int32 { + if o == nil || IsNil(o.WirelessLans) { + var ret []int32 + return ret + } + return o.WirelessLans +} + +// GetWirelessLansOk returns a tuple with the WirelessLans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetWirelessLansOk() ([]int32, bool) { + if o == nil || IsNil(o.WirelessLans) { + return nil, false + } + return o.WirelessLans, true +} + +// HasWirelessLans returns a boolean if a field has been set. +func (o *InterfaceRequest) HasWirelessLans() bool { + if o != nil && !IsNil(o.WirelessLans) { + return true + } + + return false +} + +// SetWirelessLans gets a reference to the given []int32 and assigns it to the WirelessLans field. +func (o *InterfaceRequest) SetWirelessLans(v []int32) { + o.WirelessLans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceRequest) GetVrf() NestedVRFRequest { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRFRequest + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceRequest) GetVrfOk() (*NestedVRFRequest, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *InterfaceRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRFRequest and assigns it to the Vrf field. +func (o *InterfaceRequest) SetVrf(v NestedVRFRequest) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *InterfaceRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *InterfaceRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *InterfaceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *InterfaceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *InterfaceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *InterfaceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *InterfaceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *InterfaceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o InterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if !IsNil(o.Vdcs) { + toSerialize["vdcs"] = o.Vdcs + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Lag.IsSet() { + toSerialize["lag"] = o.Lag.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if o.Duplex.IsSet() { + toSerialize["duplex"] = o.Duplex.Get() + } + if o.Wwn.IsSet() { + toSerialize["wwn"] = o.Wwn.Get() + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.RfRole) { + toSerialize["rf_role"] = o.RfRole + } + if !IsNil(o.RfChannel) { + toSerialize["rf_channel"] = o.RfChannel + } + if !IsNil(o.PoeMode) { + toSerialize["poe_mode"] = o.PoeMode + } + if !IsNil(o.PoeType) { + toSerialize["poe_type"] = o.PoeType + } + if o.RfChannelFrequency.IsSet() { + toSerialize["rf_channel_frequency"] = o.RfChannelFrequency.Get() + } + if o.RfChannelWidth.IsSet() { + toSerialize["rf_channel_width"] = o.RfChannelWidth.Get() + } + if o.TxPower.IsSet() { + toSerialize["tx_power"] = o.TxPower.Get() + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.WirelessLans) { + toSerialize["wireless_lans"] = o.WirelessLans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInterfaceRequest := _InterfaceRequest{} + + err = json.Unmarshal(data, &varInterfaceRequest) + + if err != nil { + return err + } + + *o = InterfaceRequest(varInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "vdcs") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "lag") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "speed") + delete(additionalProperties, "duplex") + delete(additionalProperties, "wwn") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "rf_role") + delete(additionalProperties, "rf_channel") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_channel_frequency") + delete(additionalProperties, "rf_channel_width") + delete(additionalProperties, "tx_power") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "wireless_lans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceRequest struct { + value *InterfaceRequest + isSet bool +} + +func (v NullableInterfaceRequest) Get() *InterfaceRequest { + return v.value +} + +func (v *NullableInterfaceRequest) Set(val *InterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRequest(val *InterfaceRequest) *NullableInterfaceRequest { + return &NullableInterfaceRequest{value: val, isSet: true} +} + +func (v NullableInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_request_duplex.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_request_duplex.go new file mode 100644 index 00000000..e9d22cac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_request_duplex.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceRequestDuplex * `half` - Half * `full` - Full * `auto` - Auto +type InterfaceRequestDuplex string + +// List of InterfaceRequest_duplex +const ( + INTERFACEREQUESTDUPLEX_HALF InterfaceRequestDuplex = "half" + INTERFACEREQUESTDUPLEX_FULL InterfaceRequestDuplex = "full" + INTERFACEREQUESTDUPLEX_AUTO InterfaceRequestDuplex = "auto" + INTERFACEREQUESTDUPLEX_EMPTY InterfaceRequestDuplex = "" +) + +// All allowed values of InterfaceRequestDuplex enum +var AllowedInterfaceRequestDuplexEnumValues = []InterfaceRequestDuplex{ + "half", + "full", + "auto", + "", +} + +func (v *InterfaceRequestDuplex) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceRequestDuplex(value) + for _, existing := range AllowedInterfaceRequestDuplexEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceRequestDuplex", value) +} + +// NewInterfaceRequestDuplexFromValue returns a pointer to a valid InterfaceRequestDuplex +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceRequestDuplexFromValue(v string) (*InterfaceRequestDuplex, error) { + ev := InterfaceRequestDuplex(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceRequestDuplex: valid values are %v", v, AllowedInterfaceRequestDuplexEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceRequestDuplex) IsValid() bool { + for _, existing := range AllowedInterfaceRequestDuplexEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InterfaceRequest_duplex value +func (v InterfaceRequestDuplex) Ptr() *InterfaceRequestDuplex { + return &v +} + +type NullableInterfaceRequestDuplex struct { + value *InterfaceRequestDuplex + isSet bool +} + +func (v NullableInterfaceRequestDuplex) Get() *InterfaceRequestDuplex { + return v.value +} + +func (v *NullableInterfaceRequestDuplex) Set(val *InterfaceRequestDuplex) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRequestDuplex) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRequestDuplex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRequestDuplex(val *InterfaceRequestDuplex) *NullableInterfaceRequestDuplex { + return &NullableInterfaceRequestDuplex{value: val, isSet: true} +} + +func (v NullableInterfaceRequestDuplex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRequestDuplex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel.go new file mode 100644 index 00000000..d3d134e9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceRfChannel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceRfChannel{} + +// InterfaceRfChannel struct for InterfaceRfChannel +type InterfaceRfChannel struct { + Value *InterfaceRfChannelValue `json:"value,omitempty"` + Label *InterfaceRfChannelLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceRfChannel InterfaceRfChannel + +// NewInterfaceRfChannel instantiates a new InterfaceRfChannel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceRfChannel() *InterfaceRfChannel { + this := InterfaceRfChannel{} + return &this +} + +// NewInterfaceRfChannelWithDefaults instantiates a new InterfaceRfChannel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceRfChannelWithDefaults() *InterfaceRfChannel { + this := InterfaceRfChannel{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceRfChannel) GetValue() InterfaceRfChannelValue { + if o == nil || IsNil(o.Value) { + var ret InterfaceRfChannelValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRfChannel) GetValueOk() (*InterfaceRfChannelValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceRfChannel) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfaceRfChannelValue and assigns it to the Value field. +func (o *InterfaceRfChannel) SetValue(v InterfaceRfChannelValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceRfChannel) GetLabel() InterfaceRfChannelLabel { + if o == nil || IsNil(o.Label) { + var ret InterfaceRfChannelLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRfChannel) GetLabelOk() (*InterfaceRfChannelLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceRfChannel) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfaceRfChannelLabel and assigns it to the Label field. +func (o *InterfaceRfChannel) SetLabel(v InterfaceRfChannelLabel) { + o.Label = &v +} + +func (o InterfaceRfChannel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceRfChannel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceRfChannel) UnmarshalJSON(data []byte) (err error) { + varInterfaceRfChannel := _InterfaceRfChannel{} + + err = json.Unmarshal(data, &varInterfaceRfChannel) + + if err != nil { + return err + } + + *o = InterfaceRfChannel(varInterfaceRfChannel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceRfChannel struct { + value *InterfaceRfChannel + isSet bool +} + +func (v NullableInterfaceRfChannel) Get() *InterfaceRfChannel { + return v.value +} + +func (v *NullableInterfaceRfChannel) Set(val *InterfaceRfChannel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRfChannel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRfChannel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRfChannel(val *InterfaceRfChannel) *NullableInterfaceRfChannel { + return &NullableInterfaceRfChannel{value: val, isSet: true} +} + +func (v NullableInterfaceRfChannel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRfChannel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel_label.go new file mode 100644 index 00000000..ed25f621 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel_label.go @@ -0,0 +1,500 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceRfChannelLabel the model 'InterfaceRfChannelLabel' +type InterfaceRfChannelLabel string + +// List of Interface_rf_channel_label +const ( + INTERFACERFCHANNELLABEL__1__2412_MHZ InterfaceRfChannelLabel = "1 (2412 MHz)" + INTERFACERFCHANNELLABEL__2__2417_MHZ InterfaceRfChannelLabel = "2 (2417 MHz)" + INTERFACERFCHANNELLABEL__3__2422_MHZ InterfaceRfChannelLabel = "3 (2422 MHz)" + INTERFACERFCHANNELLABEL__4__2427_MHZ InterfaceRfChannelLabel = "4 (2427 MHz)" + INTERFACERFCHANNELLABEL__5__2432_MHZ InterfaceRfChannelLabel = "5 (2432 MHz)" + INTERFACERFCHANNELLABEL__6__2437_MHZ InterfaceRfChannelLabel = "6 (2437 MHz)" + INTERFACERFCHANNELLABEL__7__2442_MHZ InterfaceRfChannelLabel = "7 (2442 MHz)" + INTERFACERFCHANNELLABEL__8__2447_MHZ InterfaceRfChannelLabel = "8 (2447 MHz)" + INTERFACERFCHANNELLABEL__9__2452_MHZ InterfaceRfChannelLabel = "9 (2452 MHz)" + INTERFACERFCHANNELLABEL__10__2457_MHZ InterfaceRfChannelLabel = "10 (2457 MHz)" + INTERFACERFCHANNELLABEL__11__2462_MHZ InterfaceRfChannelLabel = "11 (2462 MHz)" + INTERFACERFCHANNELLABEL__12__2467_MHZ InterfaceRfChannelLabel = "12 (2467 MHz)" + INTERFACERFCHANNELLABEL__13__2472_MHZ InterfaceRfChannelLabel = "13 (2472 MHz)" + INTERFACERFCHANNELLABEL__32__5160_20_MHZ InterfaceRfChannelLabel = "32 (5160/20 MHz)" + INTERFACERFCHANNELLABEL__34__5170_40_MHZ InterfaceRfChannelLabel = "34 (5170/40 MHz)" + INTERFACERFCHANNELLABEL__36__5180_20_MHZ InterfaceRfChannelLabel = "36 (5180/20 MHz)" + INTERFACERFCHANNELLABEL__38__5190_40_MHZ InterfaceRfChannelLabel = "38 (5190/40 MHz)" + INTERFACERFCHANNELLABEL__40__5200_20_MHZ InterfaceRfChannelLabel = "40 (5200/20 MHz)" + INTERFACERFCHANNELLABEL__42__5210_80_MHZ InterfaceRfChannelLabel = "42 (5210/80 MHz)" + INTERFACERFCHANNELLABEL__44__5220_20_MHZ InterfaceRfChannelLabel = "44 (5220/20 MHz)" + INTERFACERFCHANNELLABEL__46__5230_40_MHZ InterfaceRfChannelLabel = "46 (5230/40 MHz)" + INTERFACERFCHANNELLABEL__48__5240_20_MHZ InterfaceRfChannelLabel = "48 (5240/20 MHz)" + INTERFACERFCHANNELLABEL__50__5250_160_MHZ InterfaceRfChannelLabel = "50 (5250/160 MHz)" + INTERFACERFCHANNELLABEL__52__5260_20_MHZ InterfaceRfChannelLabel = "52 (5260/20 MHz)" + INTERFACERFCHANNELLABEL__54__5270_40_MHZ InterfaceRfChannelLabel = "54 (5270/40 MHz)" + INTERFACERFCHANNELLABEL__56__5280_20_MHZ InterfaceRfChannelLabel = "56 (5280/20 MHz)" + INTERFACERFCHANNELLABEL__58__5290_80_MHZ InterfaceRfChannelLabel = "58 (5290/80 MHz)" + INTERFACERFCHANNELLABEL__60__5300_20_MHZ InterfaceRfChannelLabel = "60 (5300/20 MHz)" + INTERFACERFCHANNELLABEL__62__5310_40_MHZ InterfaceRfChannelLabel = "62 (5310/40 MHz)" + INTERFACERFCHANNELLABEL__64__5320_20_MHZ InterfaceRfChannelLabel = "64 (5320/20 MHz)" + INTERFACERFCHANNELLABEL__100__5500_20_MHZ InterfaceRfChannelLabel = "100 (5500/20 MHz)" + INTERFACERFCHANNELLABEL__102__5510_40_MHZ InterfaceRfChannelLabel = "102 (5510/40 MHz)" + INTERFACERFCHANNELLABEL__104__5520_20_MHZ InterfaceRfChannelLabel = "104 (5520/20 MHz)" + INTERFACERFCHANNELLABEL__106__5530_80_MHZ InterfaceRfChannelLabel = "106 (5530/80 MHz)" + INTERFACERFCHANNELLABEL__108__5540_20_MHZ InterfaceRfChannelLabel = "108 (5540/20 MHz)" + INTERFACERFCHANNELLABEL__110__5550_40_MHZ InterfaceRfChannelLabel = "110 (5550/40 MHz)" + INTERFACERFCHANNELLABEL__112__5560_20_MHZ InterfaceRfChannelLabel = "112 (5560/20 MHz)" + INTERFACERFCHANNELLABEL__114__5570_160_MHZ InterfaceRfChannelLabel = "114 (5570/160 MHz)" + INTERFACERFCHANNELLABEL__116__5580_20_MHZ InterfaceRfChannelLabel = "116 (5580/20 MHz)" + INTERFACERFCHANNELLABEL__118__5590_40_MHZ InterfaceRfChannelLabel = "118 (5590/40 MHz)" + INTERFACERFCHANNELLABEL__120__5600_20_MHZ InterfaceRfChannelLabel = "120 (5600/20 MHz)" + INTERFACERFCHANNELLABEL__122__5610_80_MHZ InterfaceRfChannelLabel = "122 (5610/80 MHz)" + INTERFACERFCHANNELLABEL__124__5620_20_MHZ InterfaceRfChannelLabel = "124 (5620/20 MHz)" + INTERFACERFCHANNELLABEL__126__5630_40_MHZ InterfaceRfChannelLabel = "126 (5630/40 MHz)" + INTERFACERFCHANNELLABEL__128__5640_20_MHZ InterfaceRfChannelLabel = "128 (5640/20 MHz)" + INTERFACERFCHANNELLABEL__132__5660_20_MHZ InterfaceRfChannelLabel = "132 (5660/20 MHz)" + INTERFACERFCHANNELLABEL__134__5670_40_MHZ InterfaceRfChannelLabel = "134 (5670/40 MHz)" + INTERFACERFCHANNELLABEL__136__5680_20_MHZ InterfaceRfChannelLabel = "136 (5680/20 MHz)" + INTERFACERFCHANNELLABEL__138__5690_80_MHZ InterfaceRfChannelLabel = "138 (5690/80 MHz)" + INTERFACERFCHANNELLABEL__140__5700_20_MHZ InterfaceRfChannelLabel = "140 (5700/20 MHz)" + INTERFACERFCHANNELLABEL__142__5710_40_MHZ InterfaceRfChannelLabel = "142 (5710/40 MHz)" + INTERFACERFCHANNELLABEL__144__5720_20_MHZ InterfaceRfChannelLabel = "144 (5720/20 MHz)" + INTERFACERFCHANNELLABEL__149__5745_20_MHZ InterfaceRfChannelLabel = "149 (5745/20 MHz)" + INTERFACERFCHANNELLABEL__151__5755_40_MHZ InterfaceRfChannelLabel = "151 (5755/40 MHz)" + INTERFACERFCHANNELLABEL__153__5765_20_MHZ InterfaceRfChannelLabel = "153 (5765/20 MHz)" + INTERFACERFCHANNELLABEL__155__5775_80_MHZ InterfaceRfChannelLabel = "155 (5775/80 MHz)" + INTERFACERFCHANNELLABEL__157__5785_20_MHZ InterfaceRfChannelLabel = "157 (5785/20 MHz)" + INTERFACERFCHANNELLABEL__159__5795_40_MHZ InterfaceRfChannelLabel = "159 (5795/40 MHz)" + INTERFACERFCHANNELLABEL__161__5805_20_MHZ InterfaceRfChannelLabel = "161 (5805/20 MHz)" + INTERFACERFCHANNELLABEL__163__5815_160_MHZ InterfaceRfChannelLabel = "163 (5815/160 MHz)" + INTERFACERFCHANNELLABEL__165__5825_20_MHZ InterfaceRfChannelLabel = "165 (5825/20 MHz)" + INTERFACERFCHANNELLABEL__167__5835_40_MHZ InterfaceRfChannelLabel = "167 (5835/40 MHz)" + INTERFACERFCHANNELLABEL__169__5845_20_MHZ InterfaceRfChannelLabel = "169 (5845/20 MHz)" + INTERFACERFCHANNELLABEL__171__5855_80_MHZ InterfaceRfChannelLabel = "171 (5855/80 MHz)" + INTERFACERFCHANNELLABEL__173__5865_20_MHZ InterfaceRfChannelLabel = "173 (5865/20 MHz)" + INTERFACERFCHANNELLABEL__175__5875_40_MHZ InterfaceRfChannelLabel = "175 (5875/40 MHz)" + INTERFACERFCHANNELLABEL__177__5885_20_MHZ InterfaceRfChannelLabel = "177 (5885/20 MHz)" + INTERFACERFCHANNELLABEL__1__5955_20_MHZ InterfaceRfChannelLabel = "1 (5955/20 MHz)" + INTERFACERFCHANNELLABEL__3__5965_40_MHZ InterfaceRfChannelLabel = "3 (5965/40 MHz)" + INTERFACERFCHANNELLABEL__5__5975_20_MHZ InterfaceRfChannelLabel = "5 (5975/20 MHz)" + INTERFACERFCHANNELLABEL__7__5985_80_MHZ InterfaceRfChannelLabel = "7 (5985/80 MHz)" + INTERFACERFCHANNELLABEL__9__5995_20_MHZ InterfaceRfChannelLabel = "9 (5995/20 MHz)" + INTERFACERFCHANNELLABEL__11__6005_40_MHZ InterfaceRfChannelLabel = "11 (6005/40 MHz)" + INTERFACERFCHANNELLABEL__13__6015_20_MHZ InterfaceRfChannelLabel = "13 (6015/20 MHz)" + INTERFACERFCHANNELLABEL__15__6025_160_MHZ InterfaceRfChannelLabel = "15 (6025/160 MHz)" + INTERFACERFCHANNELLABEL__17__6035_20_MHZ InterfaceRfChannelLabel = "17 (6035/20 MHz)" + INTERFACERFCHANNELLABEL__19__6045_40_MHZ InterfaceRfChannelLabel = "19 (6045/40 MHz)" + INTERFACERFCHANNELLABEL__21__6055_20_MHZ InterfaceRfChannelLabel = "21 (6055/20 MHz)" + INTERFACERFCHANNELLABEL__23__6065_80_MHZ InterfaceRfChannelLabel = "23 (6065/80 MHz)" + INTERFACERFCHANNELLABEL__25__6075_20_MHZ InterfaceRfChannelLabel = "25 (6075/20 MHz)" + INTERFACERFCHANNELLABEL__27__6085_40_MHZ InterfaceRfChannelLabel = "27 (6085/40 MHz)" + INTERFACERFCHANNELLABEL__29__6095_20_MHZ InterfaceRfChannelLabel = "29 (6095/20 MHz)" + INTERFACERFCHANNELLABEL__31__6105_320_MHZ InterfaceRfChannelLabel = "31 (6105/320 MHz)" + INTERFACERFCHANNELLABEL__33__6115_20_MHZ InterfaceRfChannelLabel = "33 (6115/20 MHz)" + INTERFACERFCHANNELLABEL__35__6125_40_MHZ InterfaceRfChannelLabel = "35 (6125/40 MHz)" + INTERFACERFCHANNELLABEL__37__6135_20_MHZ InterfaceRfChannelLabel = "37 (6135/20 MHz)" + INTERFACERFCHANNELLABEL__39__6145_80_MHZ InterfaceRfChannelLabel = "39 (6145/80 MHz)" + INTERFACERFCHANNELLABEL__41__6155_20_MHZ InterfaceRfChannelLabel = "41 (6155/20 MHz)" + INTERFACERFCHANNELLABEL__43__6165_40_MHZ InterfaceRfChannelLabel = "43 (6165/40 MHz)" + INTERFACERFCHANNELLABEL__45__6175_20_MHZ InterfaceRfChannelLabel = "45 (6175/20 MHz)" + INTERFACERFCHANNELLABEL__47__6185_160_MHZ InterfaceRfChannelLabel = "47 (6185/160 MHz)" + INTERFACERFCHANNELLABEL__49__6195_20_MHZ InterfaceRfChannelLabel = "49 (6195/20 MHz)" + INTERFACERFCHANNELLABEL__51__6205_40_MHZ InterfaceRfChannelLabel = "51 (6205/40 MHz)" + INTERFACERFCHANNELLABEL__53__6215_20_MHZ InterfaceRfChannelLabel = "53 (6215/20 MHz)" + INTERFACERFCHANNELLABEL__55__6225_80_MHZ InterfaceRfChannelLabel = "55 (6225/80 MHz)" + INTERFACERFCHANNELLABEL__57__6235_20_MHZ InterfaceRfChannelLabel = "57 (6235/20 MHz)" + INTERFACERFCHANNELLABEL__59__6245_40_MHZ InterfaceRfChannelLabel = "59 (6245/40 MHz)" + INTERFACERFCHANNELLABEL__61__6255_20_MHZ InterfaceRfChannelLabel = "61 (6255/20 MHz)" + INTERFACERFCHANNELLABEL__65__6275_20_MHZ InterfaceRfChannelLabel = "65 (6275/20 MHz)" + INTERFACERFCHANNELLABEL__67__6285_40_MHZ InterfaceRfChannelLabel = "67 (6285/40 MHz)" + INTERFACERFCHANNELLABEL__69__6295_20_MHZ InterfaceRfChannelLabel = "69 (6295/20 MHz)" + INTERFACERFCHANNELLABEL__71__6305_80_MHZ InterfaceRfChannelLabel = "71 (6305/80 MHz)" + INTERFACERFCHANNELLABEL__73__6315_20_MHZ InterfaceRfChannelLabel = "73 (6315/20 MHz)" + INTERFACERFCHANNELLABEL__75__6325_40_MHZ InterfaceRfChannelLabel = "75 (6325/40 MHz)" + INTERFACERFCHANNELLABEL__77__6335_20_MHZ InterfaceRfChannelLabel = "77 (6335/20 MHz)" + INTERFACERFCHANNELLABEL__79__6345_160_MHZ InterfaceRfChannelLabel = "79 (6345/160 MHz)" + INTERFACERFCHANNELLABEL__81__6355_20_MHZ InterfaceRfChannelLabel = "81 (6355/20 MHz)" + INTERFACERFCHANNELLABEL__83__6365_40_MHZ InterfaceRfChannelLabel = "83 (6365/40 MHz)" + INTERFACERFCHANNELLABEL__85__6375_20_MHZ InterfaceRfChannelLabel = "85 (6375/20 MHz)" + INTERFACERFCHANNELLABEL__87__6385_80_MHZ InterfaceRfChannelLabel = "87 (6385/80 MHz)" + INTERFACERFCHANNELLABEL__89__6395_20_MHZ InterfaceRfChannelLabel = "89 (6395/20 MHz)" + INTERFACERFCHANNELLABEL__91__6405_40_MHZ InterfaceRfChannelLabel = "91 (6405/40 MHz)" + INTERFACERFCHANNELLABEL__93__6415_20_MHZ InterfaceRfChannelLabel = "93 (6415/20 MHz)" + INTERFACERFCHANNELLABEL__95__6425_320_MHZ InterfaceRfChannelLabel = "95 (6425/320 MHz)" + INTERFACERFCHANNELLABEL__97__6435_20_MHZ InterfaceRfChannelLabel = "97 (6435/20 MHz)" + INTERFACERFCHANNELLABEL__99__6445_40_MHZ InterfaceRfChannelLabel = "99 (6445/40 MHz)" + INTERFACERFCHANNELLABEL__101__6455_20_MHZ InterfaceRfChannelLabel = "101 (6455/20 MHz)" + INTERFACERFCHANNELLABEL__103__6465_80_MHZ InterfaceRfChannelLabel = "103 (6465/80 MHz)" + INTERFACERFCHANNELLABEL__105__6475_20_MHZ InterfaceRfChannelLabel = "105 (6475/20 MHz)" + INTERFACERFCHANNELLABEL__107__6485_40_MHZ InterfaceRfChannelLabel = "107 (6485/40 MHz)" + INTERFACERFCHANNELLABEL__109__6495_20_MHZ InterfaceRfChannelLabel = "109 (6495/20 MHz)" + INTERFACERFCHANNELLABEL__111__6505_160_MHZ InterfaceRfChannelLabel = "111 (6505/160 MHz)" + INTERFACERFCHANNELLABEL__113__6515_20_MHZ InterfaceRfChannelLabel = "113 (6515/20 MHz)" + INTERFACERFCHANNELLABEL__115__6525_40_MHZ InterfaceRfChannelLabel = "115 (6525/40 MHz)" + INTERFACERFCHANNELLABEL__117__6535_20_MHZ InterfaceRfChannelLabel = "117 (6535/20 MHz)" + INTERFACERFCHANNELLABEL__119__6545_80_MHZ InterfaceRfChannelLabel = "119 (6545/80 MHz)" + INTERFACERFCHANNELLABEL__121__6555_20_MHZ InterfaceRfChannelLabel = "121 (6555/20 MHz)" + INTERFACERFCHANNELLABEL__123__6565_40_MHZ InterfaceRfChannelLabel = "123 (6565/40 MHz)" + INTERFACERFCHANNELLABEL__125__6575_20_MHZ InterfaceRfChannelLabel = "125 (6575/20 MHz)" + INTERFACERFCHANNELLABEL__129__6595_20_MHZ InterfaceRfChannelLabel = "129 (6595/20 MHz)" + INTERFACERFCHANNELLABEL__131__6605_40_MHZ InterfaceRfChannelLabel = "131 (6605/40 MHz)" + INTERFACERFCHANNELLABEL__133__6615_20_MHZ InterfaceRfChannelLabel = "133 (6615/20 MHz)" + INTERFACERFCHANNELLABEL__135__6625_80_MHZ InterfaceRfChannelLabel = "135 (6625/80 MHz)" + INTERFACERFCHANNELLABEL__137__6635_20_MHZ InterfaceRfChannelLabel = "137 (6635/20 MHz)" + INTERFACERFCHANNELLABEL__139__6645_40_MHZ InterfaceRfChannelLabel = "139 (6645/40 MHz)" + INTERFACERFCHANNELLABEL__141__6655_20_MHZ InterfaceRfChannelLabel = "141 (6655/20 MHz)" + INTERFACERFCHANNELLABEL__143__6665_160_MHZ InterfaceRfChannelLabel = "143 (6665/160 MHz)" + INTERFACERFCHANNELLABEL__145__6675_20_MHZ InterfaceRfChannelLabel = "145 (6675/20 MHz)" + INTERFACERFCHANNELLABEL__147__6685_40_MHZ InterfaceRfChannelLabel = "147 (6685/40 MHz)" + INTERFACERFCHANNELLABEL__149__6695_20_MHZ InterfaceRfChannelLabel = "149 (6695/20 MHz)" + INTERFACERFCHANNELLABEL__151__6705_80_MHZ InterfaceRfChannelLabel = "151 (6705/80 MHz)" + INTERFACERFCHANNELLABEL__153__6715_20_MHZ InterfaceRfChannelLabel = "153 (6715/20 MHz)" + INTERFACERFCHANNELLABEL__155__6725_40_MHZ InterfaceRfChannelLabel = "155 (6725/40 MHz)" + INTERFACERFCHANNELLABEL__157__6735_20_MHZ InterfaceRfChannelLabel = "157 (6735/20 MHz)" + INTERFACERFCHANNELLABEL__159__6745_320_MHZ InterfaceRfChannelLabel = "159 (6745/320 MHz)" + INTERFACERFCHANNELLABEL__161__6755_20_MHZ InterfaceRfChannelLabel = "161 (6755/20 MHz)" + INTERFACERFCHANNELLABEL__163__6765_40_MHZ InterfaceRfChannelLabel = "163 (6765/40 MHz)" + INTERFACERFCHANNELLABEL__165__6775_20_MHZ InterfaceRfChannelLabel = "165 (6775/20 MHz)" + INTERFACERFCHANNELLABEL__167__6785_80_MHZ InterfaceRfChannelLabel = "167 (6785/80 MHz)" + INTERFACERFCHANNELLABEL__169__6795_20_MHZ InterfaceRfChannelLabel = "169 (6795/20 MHz)" + INTERFACERFCHANNELLABEL__171__6805_40_MHZ InterfaceRfChannelLabel = "171 (6805/40 MHz)" + INTERFACERFCHANNELLABEL__173__6815_20_MHZ InterfaceRfChannelLabel = "173 (6815/20 MHz)" + INTERFACERFCHANNELLABEL__175__6825_160_MHZ InterfaceRfChannelLabel = "175 (6825/160 MHz)" + INTERFACERFCHANNELLABEL__177__6835_20_MHZ InterfaceRfChannelLabel = "177 (6835/20 MHz)" + INTERFACERFCHANNELLABEL__179__6845_40_MHZ InterfaceRfChannelLabel = "179 (6845/40 MHz)" + INTERFACERFCHANNELLABEL__181__6855_20_MHZ InterfaceRfChannelLabel = "181 (6855/20 MHz)" + INTERFACERFCHANNELLABEL__183__6865_80_MHZ InterfaceRfChannelLabel = "183 (6865/80 MHz)" + INTERFACERFCHANNELLABEL__185__6875_20_MHZ InterfaceRfChannelLabel = "185 (6875/20 MHz)" + INTERFACERFCHANNELLABEL__187__6885_40_MHZ InterfaceRfChannelLabel = "187 (6885/40 MHz)" + INTERFACERFCHANNELLABEL__189__6895_20_MHZ InterfaceRfChannelLabel = "189 (6895/20 MHz)" + INTERFACERFCHANNELLABEL__193__6915_20_MHZ InterfaceRfChannelLabel = "193 (6915/20 MHz)" + INTERFACERFCHANNELLABEL__195__6925_40_MHZ InterfaceRfChannelLabel = "195 (6925/40 MHz)" + INTERFACERFCHANNELLABEL__197__6935_20_MHZ InterfaceRfChannelLabel = "197 (6935/20 MHz)" + INTERFACERFCHANNELLABEL__199__6945_80_MHZ InterfaceRfChannelLabel = "199 (6945/80 MHz)" + INTERFACERFCHANNELLABEL__201__6955_20_MHZ InterfaceRfChannelLabel = "201 (6955/20 MHz)" + INTERFACERFCHANNELLABEL__203__6965_40_MHZ InterfaceRfChannelLabel = "203 (6965/40 MHz)" + INTERFACERFCHANNELLABEL__205__6975_20_MHZ InterfaceRfChannelLabel = "205 (6975/20 MHz)" + INTERFACERFCHANNELLABEL__207__6985_160_MHZ InterfaceRfChannelLabel = "207 (6985/160 MHz)" + INTERFACERFCHANNELLABEL__209__6995_20_MHZ InterfaceRfChannelLabel = "209 (6995/20 MHz)" + INTERFACERFCHANNELLABEL__211__7005_40_MHZ InterfaceRfChannelLabel = "211 (7005/40 MHz)" + INTERFACERFCHANNELLABEL__213__7015_20_MHZ InterfaceRfChannelLabel = "213 (7015/20 MHz)" + INTERFACERFCHANNELLABEL__215__7025_80_MHZ InterfaceRfChannelLabel = "215 (7025/80 MHz)" + INTERFACERFCHANNELLABEL__217__7035_20_MHZ InterfaceRfChannelLabel = "217 (7035/20 MHz)" + INTERFACERFCHANNELLABEL__219__7045_40_MHZ InterfaceRfChannelLabel = "219 (7045/40 MHz)" + INTERFACERFCHANNELLABEL__221__7055_20_MHZ InterfaceRfChannelLabel = "221 (7055/20 MHz)" + INTERFACERFCHANNELLABEL__225__7075_20_MHZ InterfaceRfChannelLabel = "225 (7075/20 MHz)" + INTERFACERFCHANNELLABEL__227__7085_40_MHZ InterfaceRfChannelLabel = "227 (7085/40 MHz)" + INTERFACERFCHANNELLABEL__229__7095_20_MHZ InterfaceRfChannelLabel = "229 (7095/20 MHz)" + INTERFACERFCHANNELLABEL__233__7115_20_MHZ InterfaceRfChannelLabel = "233 (7115/20 MHz)" + INTERFACERFCHANNELLABEL__1__58_32_2_16_GHZ InterfaceRfChannelLabel = "1 (58.32/2.16 GHz)" + INTERFACERFCHANNELLABEL__2__60_48_2_16_GHZ InterfaceRfChannelLabel = "2 (60.48/2.16 GHz)" + INTERFACERFCHANNELLABEL__3__62_64_2_16_GHZ InterfaceRfChannelLabel = "3 (62.64/2.16 GHz)" + INTERFACERFCHANNELLABEL__4__64_80_2_16_GHZ InterfaceRfChannelLabel = "4 (64.80/2.16 GHz)" + INTERFACERFCHANNELLABEL__5__66_96_2_16_GHZ InterfaceRfChannelLabel = "5 (66.96/2.16 GHz)" + INTERFACERFCHANNELLABEL__6__69_12_2_16_GHZ InterfaceRfChannelLabel = "6 (69.12/2.16 GHz)" + INTERFACERFCHANNELLABEL__9__59_40_4_32_GHZ InterfaceRfChannelLabel = "9 (59.40/4.32 GHz)" + INTERFACERFCHANNELLABEL__10__61_56_4_32_GHZ InterfaceRfChannelLabel = "10 (61.56/4.32 GHz)" + INTERFACERFCHANNELLABEL__11__63_72_4_32_GHZ InterfaceRfChannelLabel = "11 (63.72/4.32 GHz)" + INTERFACERFCHANNELLABEL__12__65_88_4_32_GHZ InterfaceRfChannelLabel = "12 (65.88/4.32 GHz)" + INTERFACERFCHANNELLABEL__13__68_04_4_32_GHZ InterfaceRfChannelLabel = "13 (68.04/4.32 GHz)" + INTERFACERFCHANNELLABEL__17__60_48_6_48_GHZ InterfaceRfChannelLabel = "17 (60.48/6.48 GHz)" + INTERFACERFCHANNELLABEL__18__62_64_6_48_GHZ InterfaceRfChannelLabel = "18 (62.64/6.48 GHz)" + INTERFACERFCHANNELLABEL__19__64_80_6_48_GHZ InterfaceRfChannelLabel = "19 (64.80/6.48 GHz)" + INTERFACERFCHANNELLABEL__20__66_96_6_48_GHZ InterfaceRfChannelLabel = "20 (66.96/6.48 GHz)" + INTERFACERFCHANNELLABEL__25__61_56_8_64_GHZ InterfaceRfChannelLabel = "25 (61.56/8.64 GHz)" + INTERFACERFCHANNELLABEL__26__63_72_8_64_GHZ InterfaceRfChannelLabel = "26 (63.72/8.64 GHz)" + INTERFACERFCHANNELLABEL__27__65_88_8_64_GHZ InterfaceRfChannelLabel = "27 (65.88/8.64 GHz)" +) + +// All allowed values of InterfaceRfChannelLabel enum +var AllowedInterfaceRfChannelLabelEnumValues = []InterfaceRfChannelLabel{ + "1 (2412 MHz)", + "2 (2417 MHz)", + "3 (2422 MHz)", + "4 (2427 MHz)", + "5 (2432 MHz)", + "6 (2437 MHz)", + "7 (2442 MHz)", + "8 (2447 MHz)", + "9 (2452 MHz)", + "10 (2457 MHz)", + "11 (2462 MHz)", + "12 (2467 MHz)", + "13 (2472 MHz)", + "32 (5160/20 MHz)", + "34 (5170/40 MHz)", + "36 (5180/20 MHz)", + "38 (5190/40 MHz)", + "40 (5200/20 MHz)", + "42 (5210/80 MHz)", + "44 (5220/20 MHz)", + "46 (5230/40 MHz)", + "48 (5240/20 MHz)", + "50 (5250/160 MHz)", + "52 (5260/20 MHz)", + "54 (5270/40 MHz)", + "56 (5280/20 MHz)", + "58 (5290/80 MHz)", + "60 (5300/20 MHz)", + "62 (5310/40 MHz)", + "64 (5320/20 MHz)", + "100 (5500/20 MHz)", + "102 (5510/40 MHz)", + "104 (5520/20 MHz)", + "106 (5530/80 MHz)", + "108 (5540/20 MHz)", + "110 (5550/40 MHz)", + "112 (5560/20 MHz)", + "114 (5570/160 MHz)", + "116 (5580/20 MHz)", + "118 (5590/40 MHz)", + "120 (5600/20 MHz)", + "122 (5610/80 MHz)", + "124 (5620/20 MHz)", + "126 (5630/40 MHz)", + "128 (5640/20 MHz)", + "132 (5660/20 MHz)", + "134 (5670/40 MHz)", + "136 (5680/20 MHz)", + "138 (5690/80 MHz)", + "140 (5700/20 MHz)", + "142 (5710/40 MHz)", + "144 (5720/20 MHz)", + "149 (5745/20 MHz)", + "151 (5755/40 MHz)", + "153 (5765/20 MHz)", + "155 (5775/80 MHz)", + "157 (5785/20 MHz)", + "159 (5795/40 MHz)", + "161 (5805/20 MHz)", + "163 (5815/160 MHz)", + "165 (5825/20 MHz)", + "167 (5835/40 MHz)", + "169 (5845/20 MHz)", + "171 (5855/80 MHz)", + "173 (5865/20 MHz)", + "175 (5875/40 MHz)", + "177 (5885/20 MHz)", + "1 (5955/20 MHz)", + "3 (5965/40 MHz)", + "5 (5975/20 MHz)", + "7 (5985/80 MHz)", + "9 (5995/20 MHz)", + "11 (6005/40 MHz)", + "13 (6015/20 MHz)", + "15 (6025/160 MHz)", + "17 (6035/20 MHz)", + "19 (6045/40 MHz)", + "21 (6055/20 MHz)", + "23 (6065/80 MHz)", + "25 (6075/20 MHz)", + "27 (6085/40 MHz)", + "29 (6095/20 MHz)", + "31 (6105/320 MHz)", + "33 (6115/20 MHz)", + "35 (6125/40 MHz)", + "37 (6135/20 MHz)", + "39 (6145/80 MHz)", + "41 (6155/20 MHz)", + "43 (6165/40 MHz)", + "45 (6175/20 MHz)", + "47 (6185/160 MHz)", + "49 (6195/20 MHz)", + "51 (6205/40 MHz)", + "53 (6215/20 MHz)", + "55 (6225/80 MHz)", + "57 (6235/20 MHz)", + "59 (6245/40 MHz)", + "61 (6255/20 MHz)", + "65 (6275/20 MHz)", + "67 (6285/40 MHz)", + "69 (6295/20 MHz)", + "71 (6305/80 MHz)", + "73 (6315/20 MHz)", + "75 (6325/40 MHz)", + "77 (6335/20 MHz)", + "79 (6345/160 MHz)", + "81 (6355/20 MHz)", + "83 (6365/40 MHz)", + "85 (6375/20 MHz)", + "87 (6385/80 MHz)", + "89 (6395/20 MHz)", + "91 (6405/40 MHz)", + "93 (6415/20 MHz)", + "95 (6425/320 MHz)", + "97 (6435/20 MHz)", + "99 (6445/40 MHz)", + "101 (6455/20 MHz)", + "103 (6465/80 MHz)", + "105 (6475/20 MHz)", + "107 (6485/40 MHz)", + "109 (6495/20 MHz)", + "111 (6505/160 MHz)", + "113 (6515/20 MHz)", + "115 (6525/40 MHz)", + "117 (6535/20 MHz)", + "119 (6545/80 MHz)", + "121 (6555/20 MHz)", + "123 (6565/40 MHz)", + "125 (6575/20 MHz)", + "129 (6595/20 MHz)", + "131 (6605/40 MHz)", + "133 (6615/20 MHz)", + "135 (6625/80 MHz)", + "137 (6635/20 MHz)", + "139 (6645/40 MHz)", + "141 (6655/20 MHz)", + "143 (6665/160 MHz)", + "145 (6675/20 MHz)", + "147 (6685/40 MHz)", + "149 (6695/20 MHz)", + "151 (6705/80 MHz)", + "153 (6715/20 MHz)", + "155 (6725/40 MHz)", + "157 (6735/20 MHz)", + "159 (6745/320 MHz)", + "161 (6755/20 MHz)", + "163 (6765/40 MHz)", + "165 (6775/20 MHz)", + "167 (6785/80 MHz)", + "169 (6795/20 MHz)", + "171 (6805/40 MHz)", + "173 (6815/20 MHz)", + "175 (6825/160 MHz)", + "177 (6835/20 MHz)", + "179 (6845/40 MHz)", + "181 (6855/20 MHz)", + "183 (6865/80 MHz)", + "185 (6875/20 MHz)", + "187 (6885/40 MHz)", + "189 (6895/20 MHz)", + "193 (6915/20 MHz)", + "195 (6925/40 MHz)", + "197 (6935/20 MHz)", + "199 (6945/80 MHz)", + "201 (6955/20 MHz)", + "203 (6965/40 MHz)", + "205 (6975/20 MHz)", + "207 (6985/160 MHz)", + "209 (6995/20 MHz)", + "211 (7005/40 MHz)", + "213 (7015/20 MHz)", + "215 (7025/80 MHz)", + "217 (7035/20 MHz)", + "219 (7045/40 MHz)", + "221 (7055/20 MHz)", + "225 (7075/20 MHz)", + "227 (7085/40 MHz)", + "229 (7095/20 MHz)", + "233 (7115/20 MHz)", + "1 (58.32/2.16 GHz)", + "2 (60.48/2.16 GHz)", + "3 (62.64/2.16 GHz)", + "4 (64.80/2.16 GHz)", + "5 (66.96/2.16 GHz)", + "6 (69.12/2.16 GHz)", + "9 (59.40/4.32 GHz)", + "10 (61.56/4.32 GHz)", + "11 (63.72/4.32 GHz)", + "12 (65.88/4.32 GHz)", + "13 (68.04/4.32 GHz)", + "17 (60.48/6.48 GHz)", + "18 (62.64/6.48 GHz)", + "19 (64.80/6.48 GHz)", + "20 (66.96/6.48 GHz)", + "25 (61.56/8.64 GHz)", + "26 (63.72/8.64 GHz)", + "27 (65.88/8.64 GHz)", +} + +func (v *InterfaceRfChannelLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceRfChannelLabel(value) + for _, existing := range AllowedInterfaceRfChannelLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceRfChannelLabel", value) +} + +// NewInterfaceRfChannelLabelFromValue returns a pointer to a valid InterfaceRfChannelLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceRfChannelLabelFromValue(v string) (*InterfaceRfChannelLabel, error) { + ev := InterfaceRfChannelLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceRfChannelLabel: valid values are %v", v, AllowedInterfaceRfChannelLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceRfChannelLabel) IsValid() bool { + for _, existing := range AllowedInterfaceRfChannelLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_rf_channel_label value +func (v InterfaceRfChannelLabel) Ptr() *InterfaceRfChannelLabel { + return &v +} + +type NullableInterfaceRfChannelLabel struct { + value *InterfaceRfChannelLabel + isSet bool +} + +func (v NullableInterfaceRfChannelLabel) Get() *InterfaceRfChannelLabel { + return v.value +} + +func (v *NullableInterfaceRfChannelLabel) Set(val *InterfaceRfChannelLabel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRfChannelLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRfChannelLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRfChannelLabel(val *InterfaceRfChannelLabel) *NullableInterfaceRfChannelLabel { + return &NullableInterfaceRfChannelLabel{value: val, isSet: true} +} + +func (v NullableInterfaceRfChannelLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRfChannelLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel_value.go new file mode 100644 index 00000000..76c99556 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_channel_value.go @@ -0,0 +1,502 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceRfChannelValue * `2.4g-1-2412-22` - 1 (2412 MHz) * `2.4g-2-2417-22` - 2 (2417 MHz) * `2.4g-3-2422-22` - 3 (2422 MHz) * `2.4g-4-2427-22` - 4 (2427 MHz) * `2.4g-5-2432-22` - 5 (2432 MHz) * `2.4g-6-2437-22` - 6 (2437 MHz) * `2.4g-7-2442-22` - 7 (2442 MHz) * `2.4g-8-2447-22` - 8 (2447 MHz) * `2.4g-9-2452-22` - 9 (2452 MHz) * `2.4g-10-2457-22` - 10 (2457 MHz) * `2.4g-11-2462-22` - 11 (2462 MHz) * `2.4g-12-2467-22` - 12 (2467 MHz) * `2.4g-13-2472-22` - 13 (2472 MHz) * `5g-32-5160-20` - 32 (5160/20 MHz) * `5g-34-5170-40` - 34 (5170/40 MHz) * `5g-36-5180-20` - 36 (5180/20 MHz) * `5g-38-5190-40` - 38 (5190/40 MHz) * `5g-40-5200-20` - 40 (5200/20 MHz) * `5g-42-5210-80` - 42 (5210/80 MHz) * `5g-44-5220-20` - 44 (5220/20 MHz) * `5g-46-5230-40` - 46 (5230/40 MHz) * `5g-48-5240-20` - 48 (5240/20 MHz) * `5g-50-5250-160` - 50 (5250/160 MHz) * `5g-52-5260-20` - 52 (5260/20 MHz) * `5g-54-5270-40` - 54 (5270/40 MHz) * `5g-56-5280-20` - 56 (5280/20 MHz) * `5g-58-5290-80` - 58 (5290/80 MHz) * `5g-60-5300-20` - 60 (5300/20 MHz) * `5g-62-5310-40` - 62 (5310/40 MHz) * `5g-64-5320-20` - 64 (5320/20 MHz) * `5g-100-5500-20` - 100 (5500/20 MHz) * `5g-102-5510-40` - 102 (5510/40 MHz) * `5g-104-5520-20` - 104 (5520/20 MHz) * `5g-106-5530-80` - 106 (5530/80 MHz) * `5g-108-5540-20` - 108 (5540/20 MHz) * `5g-110-5550-40` - 110 (5550/40 MHz) * `5g-112-5560-20` - 112 (5560/20 MHz) * `5g-114-5570-160` - 114 (5570/160 MHz) * `5g-116-5580-20` - 116 (5580/20 MHz) * `5g-118-5590-40` - 118 (5590/40 MHz) * `5g-120-5600-20` - 120 (5600/20 MHz) * `5g-122-5610-80` - 122 (5610/80 MHz) * `5g-124-5620-20` - 124 (5620/20 MHz) * `5g-126-5630-40` - 126 (5630/40 MHz) * `5g-128-5640-20` - 128 (5640/20 MHz) * `5g-132-5660-20` - 132 (5660/20 MHz) * `5g-134-5670-40` - 134 (5670/40 MHz) * `5g-136-5680-20` - 136 (5680/20 MHz) * `5g-138-5690-80` - 138 (5690/80 MHz) * `5g-140-5700-20` - 140 (5700/20 MHz) * `5g-142-5710-40` - 142 (5710/40 MHz) * `5g-144-5720-20` - 144 (5720/20 MHz) * `5g-149-5745-20` - 149 (5745/20 MHz) * `5g-151-5755-40` - 151 (5755/40 MHz) * `5g-153-5765-20` - 153 (5765/20 MHz) * `5g-155-5775-80` - 155 (5775/80 MHz) * `5g-157-5785-20` - 157 (5785/20 MHz) * `5g-159-5795-40` - 159 (5795/40 MHz) * `5g-161-5805-20` - 161 (5805/20 MHz) * `5g-163-5815-160` - 163 (5815/160 MHz) * `5g-165-5825-20` - 165 (5825/20 MHz) * `5g-167-5835-40` - 167 (5835/40 MHz) * `5g-169-5845-20` - 169 (5845/20 MHz) * `5g-171-5855-80` - 171 (5855/80 MHz) * `5g-173-5865-20` - 173 (5865/20 MHz) * `5g-175-5875-40` - 175 (5875/40 MHz) * `5g-177-5885-20` - 177 (5885/20 MHz) * `6g-1-5955-20` - 1 (5955/20 MHz) * `6g-3-5965-40` - 3 (5965/40 MHz) * `6g-5-5975-20` - 5 (5975/20 MHz) * `6g-7-5985-80` - 7 (5985/80 MHz) * `6g-9-5995-20` - 9 (5995/20 MHz) * `6g-11-6005-40` - 11 (6005/40 MHz) * `6g-13-6015-20` - 13 (6015/20 MHz) * `6g-15-6025-160` - 15 (6025/160 MHz) * `6g-17-6035-20` - 17 (6035/20 MHz) * `6g-19-6045-40` - 19 (6045/40 MHz) * `6g-21-6055-20` - 21 (6055/20 MHz) * `6g-23-6065-80` - 23 (6065/80 MHz) * `6g-25-6075-20` - 25 (6075/20 MHz) * `6g-27-6085-40` - 27 (6085/40 MHz) * `6g-29-6095-20` - 29 (6095/20 MHz) * `6g-31-6105-320` - 31 (6105/320 MHz) * `6g-33-6115-20` - 33 (6115/20 MHz) * `6g-35-6125-40` - 35 (6125/40 MHz) * `6g-37-6135-20` - 37 (6135/20 MHz) * `6g-39-6145-80` - 39 (6145/80 MHz) * `6g-41-6155-20` - 41 (6155/20 MHz) * `6g-43-6165-40` - 43 (6165/40 MHz) * `6g-45-6175-20` - 45 (6175/20 MHz) * `6g-47-6185-160` - 47 (6185/160 MHz) * `6g-49-6195-20` - 49 (6195/20 MHz) * `6g-51-6205-40` - 51 (6205/40 MHz) * `6g-53-6215-20` - 53 (6215/20 MHz) * `6g-55-6225-80` - 55 (6225/80 MHz) * `6g-57-6235-20` - 57 (6235/20 MHz) * `6g-59-6245-40` - 59 (6245/40 MHz) * `6g-61-6255-20` - 61 (6255/20 MHz) * `6g-65-6275-20` - 65 (6275/20 MHz) * `6g-67-6285-40` - 67 (6285/40 MHz) * `6g-69-6295-20` - 69 (6295/20 MHz) * `6g-71-6305-80` - 71 (6305/80 MHz) * `6g-73-6315-20` - 73 (6315/20 MHz) * `6g-75-6325-40` - 75 (6325/40 MHz) * `6g-77-6335-20` - 77 (6335/20 MHz) * `6g-79-6345-160` - 79 (6345/160 MHz) * `6g-81-6355-20` - 81 (6355/20 MHz) * `6g-83-6365-40` - 83 (6365/40 MHz) * `6g-85-6375-20` - 85 (6375/20 MHz) * `6g-87-6385-80` - 87 (6385/80 MHz) * `6g-89-6395-20` - 89 (6395/20 MHz) * `6g-91-6405-40` - 91 (6405/40 MHz) * `6g-93-6415-20` - 93 (6415/20 MHz) * `6g-95-6425-320` - 95 (6425/320 MHz) * `6g-97-6435-20` - 97 (6435/20 MHz) * `6g-99-6445-40` - 99 (6445/40 MHz) * `6g-101-6455-20` - 101 (6455/20 MHz) * `6g-103-6465-80` - 103 (6465/80 MHz) * `6g-105-6475-20` - 105 (6475/20 MHz) * `6g-107-6485-40` - 107 (6485/40 MHz) * `6g-109-6495-20` - 109 (6495/20 MHz) * `6g-111-6505-160` - 111 (6505/160 MHz) * `6g-113-6515-20` - 113 (6515/20 MHz) * `6g-115-6525-40` - 115 (6525/40 MHz) * `6g-117-6535-20` - 117 (6535/20 MHz) * `6g-119-6545-80` - 119 (6545/80 MHz) * `6g-121-6555-20` - 121 (6555/20 MHz) * `6g-123-6565-40` - 123 (6565/40 MHz) * `6g-125-6575-20` - 125 (6575/20 MHz) * `6g-129-6595-20` - 129 (6595/20 MHz) * `6g-131-6605-40` - 131 (6605/40 MHz) * `6g-133-6615-20` - 133 (6615/20 MHz) * `6g-135-6625-80` - 135 (6625/80 MHz) * `6g-137-6635-20` - 137 (6635/20 MHz) * `6g-139-6645-40` - 139 (6645/40 MHz) * `6g-141-6655-20` - 141 (6655/20 MHz) * `6g-143-6665-160` - 143 (6665/160 MHz) * `6g-145-6675-20` - 145 (6675/20 MHz) * `6g-147-6685-40` - 147 (6685/40 MHz) * `6g-149-6695-20` - 149 (6695/20 MHz) * `6g-151-6705-80` - 151 (6705/80 MHz) * `6g-153-6715-20` - 153 (6715/20 MHz) * `6g-155-6725-40` - 155 (6725/40 MHz) * `6g-157-6735-20` - 157 (6735/20 MHz) * `6g-159-6745-320` - 159 (6745/320 MHz) * `6g-161-6755-20` - 161 (6755/20 MHz) * `6g-163-6765-40` - 163 (6765/40 MHz) * `6g-165-6775-20` - 165 (6775/20 MHz) * `6g-167-6785-80` - 167 (6785/80 MHz) * `6g-169-6795-20` - 169 (6795/20 MHz) * `6g-171-6805-40` - 171 (6805/40 MHz) * `6g-173-6815-20` - 173 (6815/20 MHz) * `6g-175-6825-160` - 175 (6825/160 MHz) * `6g-177-6835-20` - 177 (6835/20 MHz) * `6g-179-6845-40` - 179 (6845/40 MHz) * `6g-181-6855-20` - 181 (6855/20 MHz) * `6g-183-6865-80` - 183 (6865/80 MHz) * `6g-185-6875-20` - 185 (6875/20 MHz) * `6g-187-6885-40` - 187 (6885/40 MHz) * `6g-189-6895-20` - 189 (6895/20 MHz) * `6g-193-6915-20` - 193 (6915/20 MHz) * `6g-195-6925-40` - 195 (6925/40 MHz) * `6g-197-6935-20` - 197 (6935/20 MHz) * `6g-199-6945-80` - 199 (6945/80 MHz) * `6g-201-6955-20` - 201 (6955/20 MHz) * `6g-203-6965-40` - 203 (6965/40 MHz) * `6g-205-6975-20` - 205 (6975/20 MHz) * `6g-207-6985-160` - 207 (6985/160 MHz) * `6g-209-6995-20` - 209 (6995/20 MHz) * `6g-211-7005-40` - 211 (7005/40 MHz) * `6g-213-7015-20` - 213 (7015/20 MHz) * `6g-215-7025-80` - 215 (7025/80 MHz) * `6g-217-7035-20` - 217 (7035/20 MHz) * `6g-219-7045-40` - 219 (7045/40 MHz) * `6g-221-7055-20` - 221 (7055/20 MHz) * `6g-225-7075-20` - 225 (7075/20 MHz) * `6g-227-7085-40` - 227 (7085/40 MHz) * `6g-229-7095-20` - 229 (7095/20 MHz) * `6g-233-7115-20` - 233 (7115/20 MHz) * `60g-1-58320-2160` - 1 (58.32/2.16 GHz) * `60g-2-60480-2160` - 2 (60.48/2.16 GHz) * `60g-3-62640-2160` - 3 (62.64/2.16 GHz) * `60g-4-64800-2160` - 4 (64.80/2.16 GHz) * `60g-5-66960-2160` - 5 (66.96/2.16 GHz) * `60g-6-69120-2160` - 6 (69.12/2.16 GHz) * `60g-9-59400-4320` - 9 (59.40/4.32 GHz) * `60g-10-61560-4320` - 10 (61.56/4.32 GHz) * `60g-11-63720-4320` - 11 (63.72/4.32 GHz) * `60g-12-65880-4320` - 12 (65.88/4.32 GHz) * `60g-13-68040-4320` - 13 (68.04/4.32 GHz) * `60g-17-60480-6480` - 17 (60.48/6.48 GHz) * `60g-18-62640-6480` - 18 (62.64/6.48 GHz) * `60g-19-64800-6480` - 19 (64.80/6.48 GHz) * `60g-20-66960-6480` - 20 (66.96/6.48 GHz) * `60g-25-61560-6480` - 25 (61.56/8.64 GHz) * `60g-26-63720-6480` - 26 (63.72/8.64 GHz) * `60g-27-65880-6480` - 27 (65.88/8.64 GHz) +type InterfaceRfChannelValue string + +// List of Interface_rf_channel_value +const ( + INTERFACERFCHANNELVALUE__2_4G_1_2412_22 InterfaceRfChannelValue = "2.4g-1-2412-22" + INTERFACERFCHANNELVALUE__2_4G_2_2417_22 InterfaceRfChannelValue = "2.4g-2-2417-22" + INTERFACERFCHANNELVALUE__2_4G_3_2422_22 InterfaceRfChannelValue = "2.4g-3-2422-22" + INTERFACERFCHANNELVALUE__2_4G_4_2427_22 InterfaceRfChannelValue = "2.4g-4-2427-22" + INTERFACERFCHANNELVALUE__2_4G_5_2432_22 InterfaceRfChannelValue = "2.4g-5-2432-22" + INTERFACERFCHANNELVALUE__2_4G_6_2437_22 InterfaceRfChannelValue = "2.4g-6-2437-22" + INTERFACERFCHANNELVALUE__2_4G_7_2442_22 InterfaceRfChannelValue = "2.4g-7-2442-22" + INTERFACERFCHANNELVALUE__2_4G_8_2447_22 InterfaceRfChannelValue = "2.4g-8-2447-22" + INTERFACERFCHANNELVALUE__2_4G_9_2452_22 InterfaceRfChannelValue = "2.4g-9-2452-22" + INTERFACERFCHANNELVALUE__2_4G_10_2457_22 InterfaceRfChannelValue = "2.4g-10-2457-22" + INTERFACERFCHANNELVALUE__2_4G_11_2462_22 InterfaceRfChannelValue = "2.4g-11-2462-22" + INTERFACERFCHANNELVALUE__2_4G_12_2467_22 InterfaceRfChannelValue = "2.4g-12-2467-22" + INTERFACERFCHANNELVALUE__2_4G_13_2472_22 InterfaceRfChannelValue = "2.4g-13-2472-22" + INTERFACERFCHANNELVALUE__5G_32_5160_20 InterfaceRfChannelValue = "5g-32-5160-20" + INTERFACERFCHANNELVALUE__5G_34_5170_40 InterfaceRfChannelValue = "5g-34-5170-40" + INTERFACERFCHANNELVALUE__5G_36_5180_20 InterfaceRfChannelValue = "5g-36-5180-20" + INTERFACERFCHANNELVALUE__5G_38_5190_40 InterfaceRfChannelValue = "5g-38-5190-40" + INTERFACERFCHANNELVALUE__5G_40_5200_20 InterfaceRfChannelValue = "5g-40-5200-20" + INTERFACERFCHANNELVALUE__5G_42_5210_80 InterfaceRfChannelValue = "5g-42-5210-80" + INTERFACERFCHANNELVALUE__5G_44_5220_20 InterfaceRfChannelValue = "5g-44-5220-20" + INTERFACERFCHANNELVALUE__5G_46_5230_40 InterfaceRfChannelValue = "5g-46-5230-40" + INTERFACERFCHANNELVALUE__5G_48_5240_20 InterfaceRfChannelValue = "5g-48-5240-20" + INTERFACERFCHANNELVALUE__5G_50_5250_160 InterfaceRfChannelValue = "5g-50-5250-160" + INTERFACERFCHANNELVALUE__5G_52_5260_20 InterfaceRfChannelValue = "5g-52-5260-20" + INTERFACERFCHANNELVALUE__5G_54_5270_40 InterfaceRfChannelValue = "5g-54-5270-40" + INTERFACERFCHANNELVALUE__5G_56_5280_20 InterfaceRfChannelValue = "5g-56-5280-20" + INTERFACERFCHANNELVALUE__5G_58_5290_80 InterfaceRfChannelValue = "5g-58-5290-80" + INTERFACERFCHANNELVALUE__5G_60_5300_20 InterfaceRfChannelValue = "5g-60-5300-20" + INTERFACERFCHANNELVALUE__5G_62_5310_40 InterfaceRfChannelValue = "5g-62-5310-40" + INTERFACERFCHANNELVALUE__5G_64_5320_20 InterfaceRfChannelValue = "5g-64-5320-20" + INTERFACERFCHANNELVALUE__5G_100_5500_20 InterfaceRfChannelValue = "5g-100-5500-20" + INTERFACERFCHANNELVALUE__5G_102_5510_40 InterfaceRfChannelValue = "5g-102-5510-40" + INTERFACERFCHANNELVALUE__5G_104_5520_20 InterfaceRfChannelValue = "5g-104-5520-20" + INTERFACERFCHANNELVALUE__5G_106_5530_80 InterfaceRfChannelValue = "5g-106-5530-80" + INTERFACERFCHANNELVALUE__5G_108_5540_20 InterfaceRfChannelValue = "5g-108-5540-20" + INTERFACERFCHANNELVALUE__5G_110_5550_40 InterfaceRfChannelValue = "5g-110-5550-40" + INTERFACERFCHANNELVALUE__5G_112_5560_20 InterfaceRfChannelValue = "5g-112-5560-20" + INTERFACERFCHANNELVALUE__5G_114_5570_160 InterfaceRfChannelValue = "5g-114-5570-160" + INTERFACERFCHANNELVALUE__5G_116_5580_20 InterfaceRfChannelValue = "5g-116-5580-20" + INTERFACERFCHANNELVALUE__5G_118_5590_40 InterfaceRfChannelValue = "5g-118-5590-40" + INTERFACERFCHANNELVALUE__5G_120_5600_20 InterfaceRfChannelValue = "5g-120-5600-20" + INTERFACERFCHANNELVALUE__5G_122_5610_80 InterfaceRfChannelValue = "5g-122-5610-80" + INTERFACERFCHANNELVALUE__5G_124_5620_20 InterfaceRfChannelValue = "5g-124-5620-20" + INTERFACERFCHANNELVALUE__5G_126_5630_40 InterfaceRfChannelValue = "5g-126-5630-40" + INTERFACERFCHANNELVALUE__5G_128_5640_20 InterfaceRfChannelValue = "5g-128-5640-20" + INTERFACERFCHANNELVALUE__5G_132_5660_20 InterfaceRfChannelValue = "5g-132-5660-20" + INTERFACERFCHANNELVALUE__5G_134_5670_40 InterfaceRfChannelValue = "5g-134-5670-40" + INTERFACERFCHANNELVALUE__5G_136_5680_20 InterfaceRfChannelValue = "5g-136-5680-20" + INTERFACERFCHANNELVALUE__5G_138_5690_80 InterfaceRfChannelValue = "5g-138-5690-80" + INTERFACERFCHANNELVALUE__5G_140_5700_20 InterfaceRfChannelValue = "5g-140-5700-20" + INTERFACERFCHANNELVALUE__5G_142_5710_40 InterfaceRfChannelValue = "5g-142-5710-40" + INTERFACERFCHANNELVALUE__5G_144_5720_20 InterfaceRfChannelValue = "5g-144-5720-20" + INTERFACERFCHANNELVALUE__5G_149_5745_20 InterfaceRfChannelValue = "5g-149-5745-20" + INTERFACERFCHANNELVALUE__5G_151_5755_40 InterfaceRfChannelValue = "5g-151-5755-40" + INTERFACERFCHANNELVALUE__5G_153_5765_20 InterfaceRfChannelValue = "5g-153-5765-20" + INTERFACERFCHANNELVALUE__5G_155_5775_80 InterfaceRfChannelValue = "5g-155-5775-80" + INTERFACERFCHANNELVALUE__5G_157_5785_20 InterfaceRfChannelValue = "5g-157-5785-20" + INTERFACERFCHANNELVALUE__5G_159_5795_40 InterfaceRfChannelValue = "5g-159-5795-40" + INTERFACERFCHANNELVALUE__5G_161_5805_20 InterfaceRfChannelValue = "5g-161-5805-20" + INTERFACERFCHANNELVALUE__5G_163_5815_160 InterfaceRfChannelValue = "5g-163-5815-160" + INTERFACERFCHANNELVALUE__5G_165_5825_20 InterfaceRfChannelValue = "5g-165-5825-20" + INTERFACERFCHANNELVALUE__5G_167_5835_40 InterfaceRfChannelValue = "5g-167-5835-40" + INTERFACERFCHANNELVALUE__5G_169_5845_20 InterfaceRfChannelValue = "5g-169-5845-20" + INTERFACERFCHANNELVALUE__5G_171_5855_80 InterfaceRfChannelValue = "5g-171-5855-80" + INTERFACERFCHANNELVALUE__5G_173_5865_20 InterfaceRfChannelValue = "5g-173-5865-20" + INTERFACERFCHANNELVALUE__5G_175_5875_40 InterfaceRfChannelValue = "5g-175-5875-40" + INTERFACERFCHANNELVALUE__5G_177_5885_20 InterfaceRfChannelValue = "5g-177-5885-20" + INTERFACERFCHANNELVALUE__6G_1_5955_20 InterfaceRfChannelValue = "6g-1-5955-20" + INTERFACERFCHANNELVALUE__6G_3_5965_40 InterfaceRfChannelValue = "6g-3-5965-40" + INTERFACERFCHANNELVALUE__6G_5_5975_20 InterfaceRfChannelValue = "6g-5-5975-20" + INTERFACERFCHANNELVALUE__6G_7_5985_80 InterfaceRfChannelValue = "6g-7-5985-80" + INTERFACERFCHANNELVALUE__6G_9_5995_20 InterfaceRfChannelValue = "6g-9-5995-20" + INTERFACERFCHANNELVALUE__6G_11_6005_40 InterfaceRfChannelValue = "6g-11-6005-40" + INTERFACERFCHANNELVALUE__6G_13_6015_20 InterfaceRfChannelValue = "6g-13-6015-20" + INTERFACERFCHANNELVALUE__6G_15_6025_160 InterfaceRfChannelValue = "6g-15-6025-160" + INTERFACERFCHANNELVALUE__6G_17_6035_20 InterfaceRfChannelValue = "6g-17-6035-20" + INTERFACERFCHANNELVALUE__6G_19_6045_40 InterfaceRfChannelValue = "6g-19-6045-40" + INTERFACERFCHANNELVALUE__6G_21_6055_20 InterfaceRfChannelValue = "6g-21-6055-20" + INTERFACERFCHANNELVALUE__6G_23_6065_80 InterfaceRfChannelValue = "6g-23-6065-80" + INTERFACERFCHANNELVALUE__6G_25_6075_20 InterfaceRfChannelValue = "6g-25-6075-20" + INTERFACERFCHANNELVALUE__6G_27_6085_40 InterfaceRfChannelValue = "6g-27-6085-40" + INTERFACERFCHANNELVALUE__6G_29_6095_20 InterfaceRfChannelValue = "6g-29-6095-20" + INTERFACERFCHANNELVALUE__6G_31_6105_320 InterfaceRfChannelValue = "6g-31-6105-320" + INTERFACERFCHANNELVALUE__6G_33_6115_20 InterfaceRfChannelValue = "6g-33-6115-20" + INTERFACERFCHANNELVALUE__6G_35_6125_40 InterfaceRfChannelValue = "6g-35-6125-40" + INTERFACERFCHANNELVALUE__6G_37_6135_20 InterfaceRfChannelValue = "6g-37-6135-20" + INTERFACERFCHANNELVALUE__6G_39_6145_80 InterfaceRfChannelValue = "6g-39-6145-80" + INTERFACERFCHANNELVALUE__6G_41_6155_20 InterfaceRfChannelValue = "6g-41-6155-20" + INTERFACERFCHANNELVALUE__6G_43_6165_40 InterfaceRfChannelValue = "6g-43-6165-40" + INTERFACERFCHANNELVALUE__6G_45_6175_20 InterfaceRfChannelValue = "6g-45-6175-20" + INTERFACERFCHANNELVALUE__6G_47_6185_160 InterfaceRfChannelValue = "6g-47-6185-160" + INTERFACERFCHANNELVALUE__6G_49_6195_20 InterfaceRfChannelValue = "6g-49-6195-20" + INTERFACERFCHANNELVALUE__6G_51_6205_40 InterfaceRfChannelValue = "6g-51-6205-40" + INTERFACERFCHANNELVALUE__6G_53_6215_20 InterfaceRfChannelValue = "6g-53-6215-20" + INTERFACERFCHANNELVALUE__6G_55_6225_80 InterfaceRfChannelValue = "6g-55-6225-80" + INTERFACERFCHANNELVALUE__6G_57_6235_20 InterfaceRfChannelValue = "6g-57-6235-20" + INTERFACERFCHANNELVALUE__6G_59_6245_40 InterfaceRfChannelValue = "6g-59-6245-40" + INTERFACERFCHANNELVALUE__6G_61_6255_20 InterfaceRfChannelValue = "6g-61-6255-20" + INTERFACERFCHANNELVALUE__6G_65_6275_20 InterfaceRfChannelValue = "6g-65-6275-20" + INTERFACERFCHANNELVALUE__6G_67_6285_40 InterfaceRfChannelValue = "6g-67-6285-40" + INTERFACERFCHANNELVALUE__6G_69_6295_20 InterfaceRfChannelValue = "6g-69-6295-20" + INTERFACERFCHANNELVALUE__6G_71_6305_80 InterfaceRfChannelValue = "6g-71-6305-80" + INTERFACERFCHANNELVALUE__6G_73_6315_20 InterfaceRfChannelValue = "6g-73-6315-20" + INTERFACERFCHANNELVALUE__6G_75_6325_40 InterfaceRfChannelValue = "6g-75-6325-40" + INTERFACERFCHANNELVALUE__6G_77_6335_20 InterfaceRfChannelValue = "6g-77-6335-20" + INTERFACERFCHANNELVALUE__6G_79_6345_160 InterfaceRfChannelValue = "6g-79-6345-160" + INTERFACERFCHANNELVALUE__6G_81_6355_20 InterfaceRfChannelValue = "6g-81-6355-20" + INTERFACERFCHANNELVALUE__6G_83_6365_40 InterfaceRfChannelValue = "6g-83-6365-40" + INTERFACERFCHANNELVALUE__6G_85_6375_20 InterfaceRfChannelValue = "6g-85-6375-20" + INTERFACERFCHANNELVALUE__6G_87_6385_80 InterfaceRfChannelValue = "6g-87-6385-80" + INTERFACERFCHANNELVALUE__6G_89_6395_20 InterfaceRfChannelValue = "6g-89-6395-20" + INTERFACERFCHANNELVALUE__6G_91_6405_40 InterfaceRfChannelValue = "6g-91-6405-40" + INTERFACERFCHANNELVALUE__6G_93_6415_20 InterfaceRfChannelValue = "6g-93-6415-20" + INTERFACERFCHANNELVALUE__6G_95_6425_320 InterfaceRfChannelValue = "6g-95-6425-320" + INTERFACERFCHANNELVALUE__6G_97_6435_20 InterfaceRfChannelValue = "6g-97-6435-20" + INTERFACERFCHANNELVALUE__6G_99_6445_40 InterfaceRfChannelValue = "6g-99-6445-40" + INTERFACERFCHANNELVALUE__6G_101_6455_20 InterfaceRfChannelValue = "6g-101-6455-20" + INTERFACERFCHANNELVALUE__6G_103_6465_80 InterfaceRfChannelValue = "6g-103-6465-80" + INTERFACERFCHANNELVALUE__6G_105_6475_20 InterfaceRfChannelValue = "6g-105-6475-20" + INTERFACERFCHANNELVALUE__6G_107_6485_40 InterfaceRfChannelValue = "6g-107-6485-40" + INTERFACERFCHANNELVALUE__6G_109_6495_20 InterfaceRfChannelValue = "6g-109-6495-20" + INTERFACERFCHANNELVALUE__6G_111_6505_160 InterfaceRfChannelValue = "6g-111-6505-160" + INTERFACERFCHANNELVALUE__6G_113_6515_20 InterfaceRfChannelValue = "6g-113-6515-20" + INTERFACERFCHANNELVALUE__6G_115_6525_40 InterfaceRfChannelValue = "6g-115-6525-40" + INTERFACERFCHANNELVALUE__6G_117_6535_20 InterfaceRfChannelValue = "6g-117-6535-20" + INTERFACERFCHANNELVALUE__6G_119_6545_80 InterfaceRfChannelValue = "6g-119-6545-80" + INTERFACERFCHANNELVALUE__6G_121_6555_20 InterfaceRfChannelValue = "6g-121-6555-20" + INTERFACERFCHANNELVALUE__6G_123_6565_40 InterfaceRfChannelValue = "6g-123-6565-40" + INTERFACERFCHANNELVALUE__6G_125_6575_20 InterfaceRfChannelValue = "6g-125-6575-20" + INTERFACERFCHANNELVALUE__6G_129_6595_20 InterfaceRfChannelValue = "6g-129-6595-20" + INTERFACERFCHANNELVALUE__6G_131_6605_40 InterfaceRfChannelValue = "6g-131-6605-40" + INTERFACERFCHANNELVALUE__6G_133_6615_20 InterfaceRfChannelValue = "6g-133-6615-20" + INTERFACERFCHANNELVALUE__6G_135_6625_80 InterfaceRfChannelValue = "6g-135-6625-80" + INTERFACERFCHANNELVALUE__6G_137_6635_20 InterfaceRfChannelValue = "6g-137-6635-20" + INTERFACERFCHANNELVALUE__6G_139_6645_40 InterfaceRfChannelValue = "6g-139-6645-40" + INTERFACERFCHANNELVALUE__6G_141_6655_20 InterfaceRfChannelValue = "6g-141-6655-20" + INTERFACERFCHANNELVALUE__6G_143_6665_160 InterfaceRfChannelValue = "6g-143-6665-160" + INTERFACERFCHANNELVALUE__6G_145_6675_20 InterfaceRfChannelValue = "6g-145-6675-20" + INTERFACERFCHANNELVALUE__6G_147_6685_40 InterfaceRfChannelValue = "6g-147-6685-40" + INTERFACERFCHANNELVALUE__6G_149_6695_20 InterfaceRfChannelValue = "6g-149-6695-20" + INTERFACERFCHANNELVALUE__6G_151_6705_80 InterfaceRfChannelValue = "6g-151-6705-80" + INTERFACERFCHANNELVALUE__6G_153_6715_20 InterfaceRfChannelValue = "6g-153-6715-20" + INTERFACERFCHANNELVALUE__6G_155_6725_40 InterfaceRfChannelValue = "6g-155-6725-40" + INTERFACERFCHANNELVALUE__6G_157_6735_20 InterfaceRfChannelValue = "6g-157-6735-20" + INTERFACERFCHANNELVALUE__6G_159_6745_320 InterfaceRfChannelValue = "6g-159-6745-320" + INTERFACERFCHANNELVALUE__6G_161_6755_20 InterfaceRfChannelValue = "6g-161-6755-20" + INTERFACERFCHANNELVALUE__6G_163_6765_40 InterfaceRfChannelValue = "6g-163-6765-40" + INTERFACERFCHANNELVALUE__6G_165_6775_20 InterfaceRfChannelValue = "6g-165-6775-20" + INTERFACERFCHANNELVALUE__6G_167_6785_80 InterfaceRfChannelValue = "6g-167-6785-80" + INTERFACERFCHANNELVALUE__6G_169_6795_20 InterfaceRfChannelValue = "6g-169-6795-20" + INTERFACERFCHANNELVALUE__6G_171_6805_40 InterfaceRfChannelValue = "6g-171-6805-40" + INTERFACERFCHANNELVALUE__6G_173_6815_20 InterfaceRfChannelValue = "6g-173-6815-20" + INTERFACERFCHANNELVALUE__6G_175_6825_160 InterfaceRfChannelValue = "6g-175-6825-160" + INTERFACERFCHANNELVALUE__6G_177_6835_20 InterfaceRfChannelValue = "6g-177-6835-20" + INTERFACERFCHANNELVALUE__6G_179_6845_40 InterfaceRfChannelValue = "6g-179-6845-40" + INTERFACERFCHANNELVALUE__6G_181_6855_20 InterfaceRfChannelValue = "6g-181-6855-20" + INTERFACERFCHANNELVALUE__6G_183_6865_80 InterfaceRfChannelValue = "6g-183-6865-80" + INTERFACERFCHANNELVALUE__6G_185_6875_20 InterfaceRfChannelValue = "6g-185-6875-20" + INTERFACERFCHANNELVALUE__6G_187_6885_40 InterfaceRfChannelValue = "6g-187-6885-40" + INTERFACERFCHANNELVALUE__6G_189_6895_20 InterfaceRfChannelValue = "6g-189-6895-20" + INTERFACERFCHANNELVALUE__6G_193_6915_20 InterfaceRfChannelValue = "6g-193-6915-20" + INTERFACERFCHANNELVALUE__6G_195_6925_40 InterfaceRfChannelValue = "6g-195-6925-40" + INTERFACERFCHANNELVALUE__6G_197_6935_20 InterfaceRfChannelValue = "6g-197-6935-20" + INTERFACERFCHANNELVALUE__6G_199_6945_80 InterfaceRfChannelValue = "6g-199-6945-80" + INTERFACERFCHANNELVALUE__6G_201_6955_20 InterfaceRfChannelValue = "6g-201-6955-20" + INTERFACERFCHANNELVALUE__6G_203_6965_40 InterfaceRfChannelValue = "6g-203-6965-40" + INTERFACERFCHANNELVALUE__6G_205_6975_20 InterfaceRfChannelValue = "6g-205-6975-20" + INTERFACERFCHANNELVALUE__6G_207_6985_160 InterfaceRfChannelValue = "6g-207-6985-160" + INTERFACERFCHANNELVALUE__6G_209_6995_20 InterfaceRfChannelValue = "6g-209-6995-20" + INTERFACERFCHANNELVALUE__6G_211_7005_40 InterfaceRfChannelValue = "6g-211-7005-40" + INTERFACERFCHANNELVALUE__6G_213_7015_20 InterfaceRfChannelValue = "6g-213-7015-20" + INTERFACERFCHANNELVALUE__6G_215_7025_80 InterfaceRfChannelValue = "6g-215-7025-80" + INTERFACERFCHANNELVALUE__6G_217_7035_20 InterfaceRfChannelValue = "6g-217-7035-20" + INTERFACERFCHANNELVALUE__6G_219_7045_40 InterfaceRfChannelValue = "6g-219-7045-40" + INTERFACERFCHANNELVALUE__6G_221_7055_20 InterfaceRfChannelValue = "6g-221-7055-20" + INTERFACERFCHANNELVALUE__6G_225_7075_20 InterfaceRfChannelValue = "6g-225-7075-20" + INTERFACERFCHANNELVALUE__6G_227_7085_40 InterfaceRfChannelValue = "6g-227-7085-40" + INTERFACERFCHANNELVALUE__6G_229_7095_20 InterfaceRfChannelValue = "6g-229-7095-20" + INTERFACERFCHANNELVALUE__6G_233_7115_20 InterfaceRfChannelValue = "6g-233-7115-20" + INTERFACERFCHANNELVALUE__60G_1_58320_2160 InterfaceRfChannelValue = "60g-1-58320-2160" + INTERFACERFCHANNELVALUE__60G_2_60480_2160 InterfaceRfChannelValue = "60g-2-60480-2160" + INTERFACERFCHANNELVALUE__60G_3_62640_2160 InterfaceRfChannelValue = "60g-3-62640-2160" + INTERFACERFCHANNELVALUE__60G_4_64800_2160 InterfaceRfChannelValue = "60g-4-64800-2160" + INTERFACERFCHANNELVALUE__60G_5_66960_2160 InterfaceRfChannelValue = "60g-5-66960-2160" + INTERFACERFCHANNELVALUE__60G_6_69120_2160 InterfaceRfChannelValue = "60g-6-69120-2160" + INTERFACERFCHANNELVALUE__60G_9_59400_4320 InterfaceRfChannelValue = "60g-9-59400-4320" + INTERFACERFCHANNELVALUE__60G_10_61560_4320 InterfaceRfChannelValue = "60g-10-61560-4320" + INTERFACERFCHANNELVALUE__60G_11_63720_4320 InterfaceRfChannelValue = "60g-11-63720-4320" + INTERFACERFCHANNELVALUE__60G_12_65880_4320 InterfaceRfChannelValue = "60g-12-65880-4320" + INTERFACERFCHANNELVALUE__60G_13_68040_4320 InterfaceRfChannelValue = "60g-13-68040-4320" + INTERFACERFCHANNELVALUE__60G_17_60480_6480 InterfaceRfChannelValue = "60g-17-60480-6480" + INTERFACERFCHANNELVALUE__60G_18_62640_6480 InterfaceRfChannelValue = "60g-18-62640-6480" + INTERFACERFCHANNELVALUE__60G_19_64800_6480 InterfaceRfChannelValue = "60g-19-64800-6480" + INTERFACERFCHANNELVALUE__60G_20_66960_6480 InterfaceRfChannelValue = "60g-20-66960-6480" + INTERFACERFCHANNELVALUE__60G_25_61560_6480 InterfaceRfChannelValue = "60g-25-61560-6480" + INTERFACERFCHANNELVALUE__60G_26_63720_6480 InterfaceRfChannelValue = "60g-26-63720-6480" + INTERFACERFCHANNELVALUE__60G_27_65880_6480 InterfaceRfChannelValue = "60g-27-65880-6480" + INTERFACERFCHANNELVALUE_EMPTY InterfaceRfChannelValue = "" +) + +// All allowed values of InterfaceRfChannelValue enum +var AllowedInterfaceRfChannelValueEnumValues = []InterfaceRfChannelValue{ + "2.4g-1-2412-22", + "2.4g-2-2417-22", + "2.4g-3-2422-22", + "2.4g-4-2427-22", + "2.4g-5-2432-22", + "2.4g-6-2437-22", + "2.4g-7-2442-22", + "2.4g-8-2447-22", + "2.4g-9-2452-22", + "2.4g-10-2457-22", + "2.4g-11-2462-22", + "2.4g-12-2467-22", + "2.4g-13-2472-22", + "5g-32-5160-20", + "5g-34-5170-40", + "5g-36-5180-20", + "5g-38-5190-40", + "5g-40-5200-20", + "5g-42-5210-80", + "5g-44-5220-20", + "5g-46-5230-40", + "5g-48-5240-20", + "5g-50-5250-160", + "5g-52-5260-20", + "5g-54-5270-40", + "5g-56-5280-20", + "5g-58-5290-80", + "5g-60-5300-20", + "5g-62-5310-40", + "5g-64-5320-20", + "5g-100-5500-20", + "5g-102-5510-40", + "5g-104-5520-20", + "5g-106-5530-80", + "5g-108-5540-20", + "5g-110-5550-40", + "5g-112-5560-20", + "5g-114-5570-160", + "5g-116-5580-20", + "5g-118-5590-40", + "5g-120-5600-20", + "5g-122-5610-80", + "5g-124-5620-20", + "5g-126-5630-40", + "5g-128-5640-20", + "5g-132-5660-20", + "5g-134-5670-40", + "5g-136-5680-20", + "5g-138-5690-80", + "5g-140-5700-20", + "5g-142-5710-40", + "5g-144-5720-20", + "5g-149-5745-20", + "5g-151-5755-40", + "5g-153-5765-20", + "5g-155-5775-80", + "5g-157-5785-20", + "5g-159-5795-40", + "5g-161-5805-20", + "5g-163-5815-160", + "5g-165-5825-20", + "5g-167-5835-40", + "5g-169-5845-20", + "5g-171-5855-80", + "5g-173-5865-20", + "5g-175-5875-40", + "5g-177-5885-20", + "6g-1-5955-20", + "6g-3-5965-40", + "6g-5-5975-20", + "6g-7-5985-80", + "6g-9-5995-20", + "6g-11-6005-40", + "6g-13-6015-20", + "6g-15-6025-160", + "6g-17-6035-20", + "6g-19-6045-40", + "6g-21-6055-20", + "6g-23-6065-80", + "6g-25-6075-20", + "6g-27-6085-40", + "6g-29-6095-20", + "6g-31-6105-320", + "6g-33-6115-20", + "6g-35-6125-40", + "6g-37-6135-20", + "6g-39-6145-80", + "6g-41-6155-20", + "6g-43-6165-40", + "6g-45-6175-20", + "6g-47-6185-160", + "6g-49-6195-20", + "6g-51-6205-40", + "6g-53-6215-20", + "6g-55-6225-80", + "6g-57-6235-20", + "6g-59-6245-40", + "6g-61-6255-20", + "6g-65-6275-20", + "6g-67-6285-40", + "6g-69-6295-20", + "6g-71-6305-80", + "6g-73-6315-20", + "6g-75-6325-40", + "6g-77-6335-20", + "6g-79-6345-160", + "6g-81-6355-20", + "6g-83-6365-40", + "6g-85-6375-20", + "6g-87-6385-80", + "6g-89-6395-20", + "6g-91-6405-40", + "6g-93-6415-20", + "6g-95-6425-320", + "6g-97-6435-20", + "6g-99-6445-40", + "6g-101-6455-20", + "6g-103-6465-80", + "6g-105-6475-20", + "6g-107-6485-40", + "6g-109-6495-20", + "6g-111-6505-160", + "6g-113-6515-20", + "6g-115-6525-40", + "6g-117-6535-20", + "6g-119-6545-80", + "6g-121-6555-20", + "6g-123-6565-40", + "6g-125-6575-20", + "6g-129-6595-20", + "6g-131-6605-40", + "6g-133-6615-20", + "6g-135-6625-80", + "6g-137-6635-20", + "6g-139-6645-40", + "6g-141-6655-20", + "6g-143-6665-160", + "6g-145-6675-20", + "6g-147-6685-40", + "6g-149-6695-20", + "6g-151-6705-80", + "6g-153-6715-20", + "6g-155-6725-40", + "6g-157-6735-20", + "6g-159-6745-320", + "6g-161-6755-20", + "6g-163-6765-40", + "6g-165-6775-20", + "6g-167-6785-80", + "6g-169-6795-20", + "6g-171-6805-40", + "6g-173-6815-20", + "6g-175-6825-160", + "6g-177-6835-20", + "6g-179-6845-40", + "6g-181-6855-20", + "6g-183-6865-80", + "6g-185-6875-20", + "6g-187-6885-40", + "6g-189-6895-20", + "6g-193-6915-20", + "6g-195-6925-40", + "6g-197-6935-20", + "6g-199-6945-80", + "6g-201-6955-20", + "6g-203-6965-40", + "6g-205-6975-20", + "6g-207-6985-160", + "6g-209-6995-20", + "6g-211-7005-40", + "6g-213-7015-20", + "6g-215-7025-80", + "6g-217-7035-20", + "6g-219-7045-40", + "6g-221-7055-20", + "6g-225-7075-20", + "6g-227-7085-40", + "6g-229-7095-20", + "6g-233-7115-20", + "60g-1-58320-2160", + "60g-2-60480-2160", + "60g-3-62640-2160", + "60g-4-64800-2160", + "60g-5-66960-2160", + "60g-6-69120-2160", + "60g-9-59400-4320", + "60g-10-61560-4320", + "60g-11-63720-4320", + "60g-12-65880-4320", + "60g-13-68040-4320", + "60g-17-60480-6480", + "60g-18-62640-6480", + "60g-19-64800-6480", + "60g-20-66960-6480", + "60g-25-61560-6480", + "60g-26-63720-6480", + "60g-27-65880-6480", + "", +} + +func (v *InterfaceRfChannelValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceRfChannelValue(value) + for _, existing := range AllowedInterfaceRfChannelValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceRfChannelValue", value) +} + +// NewInterfaceRfChannelValueFromValue returns a pointer to a valid InterfaceRfChannelValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceRfChannelValueFromValue(v string) (*InterfaceRfChannelValue, error) { + ev := InterfaceRfChannelValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceRfChannelValue: valid values are %v", v, AllowedInterfaceRfChannelValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceRfChannelValue) IsValid() bool { + for _, existing := range AllowedInterfaceRfChannelValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_rf_channel_value value +func (v InterfaceRfChannelValue) Ptr() *InterfaceRfChannelValue { + return &v +} + +type NullableInterfaceRfChannelValue struct { + value *InterfaceRfChannelValue + isSet bool +} + +func (v NullableInterfaceRfChannelValue) Get() *InterfaceRfChannelValue { + return v.value +} + +func (v *NullableInterfaceRfChannelValue) Set(val *InterfaceRfChannelValue) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRfChannelValue) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRfChannelValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRfChannelValue(val *InterfaceRfChannelValue) *NullableInterfaceRfChannelValue { + return &NullableInterfaceRfChannelValue{value: val, isSet: true} +} + +func (v NullableInterfaceRfChannelValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRfChannelValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role.go new file mode 100644 index 00000000..d462b011 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceRfRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceRfRole{} + +// InterfaceRfRole struct for InterfaceRfRole +type InterfaceRfRole struct { + Value *InterfaceRfRoleValue `json:"value,omitempty"` + Label *InterfaceRfRoleLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceRfRole InterfaceRfRole + +// NewInterfaceRfRole instantiates a new InterfaceRfRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceRfRole() *InterfaceRfRole { + this := InterfaceRfRole{} + return &this +} + +// NewInterfaceRfRoleWithDefaults instantiates a new InterfaceRfRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceRfRoleWithDefaults() *InterfaceRfRole { + this := InterfaceRfRole{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceRfRole) GetValue() InterfaceRfRoleValue { + if o == nil || IsNil(o.Value) { + var ret InterfaceRfRoleValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRfRole) GetValueOk() (*InterfaceRfRoleValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceRfRole) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfaceRfRoleValue and assigns it to the Value field. +func (o *InterfaceRfRole) SetValue(v InterfaceRfRoleValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceRfRole) GetLabel() InterfaceRfRoleLabel { + if o == nil || IsNil(o.Label) { + var ret InterfaceRfRoleLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceRfRole) GetLabelOk() (*InterfaceRfRoleLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceRfRole) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfaceRfRoleLabel and assigns it to the Label field. +func (o *InterfaceRfRole) SetLabel(v InterfaceRfRoleLabel) { + o.Label = &v +} + +func (o InterfaceRfRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceRfRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceRfRole) UnmarshalJSON(data []byte) (err error) { + varInterfaceRfRole := _InterfaceRfRole{} + + err = json.Unmarshal(data, &varInterfaceRfRole) + + if err != nil { + return err + } + + *o = InterfaceRfRole(varInterfaceRfRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceRfRole struct { + value *InterfaceRfRole + isSet bool +} + +func (v NullableInterfaceRfRole) Get() *InterfaceRfRole { + return v.value +} + +func (v *NullableInterfaceRfRole) Set(val *InterfaceRfRole) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRfRole) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRfRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRfRole(val *InterfaceRfRole) *NullableInterfaceRfRole { + return &NullableInterfaceRfRole{value: val, isSet: true} +} + +func (v NullableInterfaceRfRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRfRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role_label.go new file mode 100644 index 00000000..f8d3f8e7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceRfRoleLabel the model 'InterfaceRfRoleLabel' +type InterfaceRfRoleLabel string + +// List of Interface_rf_role_label +const ( + INTERFACERFROLELABEL_ACCESS_POINT InterfaceRfRoleLabel = "Access point" + INTERFACERFROLELABEL_STATION InterfaceRfRoleLabel = "Station" +) + +// All allowed values of InterfaceRfRoleLabel enum +var AllowedInterfaceRfRoleLabelEnumValues = []InterfaceRfRoleLabel{ + "Access point", + "Station", +} + +func (v *InterfaceRfRoleLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceRfRoleLabel(value) + for _, existing := range AllowedInterfaceRfRoleLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceRfRoleLabel", value) +} + +// NewInterfaceRfRoleLabelFromValue returns a pointer to a valid InterfaceRfRoleLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceRfRoleLabelFromValue(v string) (*InterfaceRfRoleLabel, error) { + ev := InterfaceRfRoleLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceRfRoleLabel: valid values are %v", v, AllowedInterfaceRfRoleLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceRfRoleLabel) IsValid() bool { + for _, existing := range AllowedInterfaceRfRoleLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_rf_role_label value +func (v InterfaceRfRoleLabel) Ptr() *InterfaceRfRoleLabel { + return &v +} + +type NullableInterfaceRfRoleLabel struct { + value *InterfaceRfRoleLabel + isSet bool +} + +func (v NullableInterfaceRfRoleLabel) Get() *InterfaceRfRoleLabel { + return v.value +} + +func (v *NullableInterfaceRfRoleLabel) Set(val *InterfaceRfRoleLabel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRfRoleLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRfRoleLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRfRoleLabel(val *InterfaceRfRoleLabel) *NullableInterfaceRfRoleLabel { + return &NullableInterfaceRfRoleLabel{value: val, isSet: true} +} + +func (v NullableInterfaceRfRoleLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRfRoleLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role_value.go new file mode 100644 index 00000000..11221016 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_rf_role_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceRfRoleValue * `ap` - Access point * `station` - Station +type InterfaceRfRoleValue string + +// List of Interface_rf_role_value +const ( + INTERFACERFROLEVALUE_AP InterfaceRfRoleValue = "ap" + INTERFACERFROLEVALUE_STATION InterfaceRfRoleValue = "station" + INTERFACERFROLEVALUE_EMPTY InterfaceRfRoleValue = "" +) + +// All allowed values of InterfaceRfRoleValue enum +var AllowedInterfaceRfRoleValueEnumValues = []InterfaceRfRoleValue{ + "ap", + "station", + "", +} + +func (v *InterfaceRfRoleValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceRfRoleValue(value) + for _, existing := range AllowedInterfaceRfRoleValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceRfRoleValue", value) +} + +// NewInterfaceRfRoleValueFromValue returns a pointer to a valid InterfaceRfRoleValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceRfRoleValueFromValue(v string) (*InterfaceRfRoleValue, error) { + ev := InterfaceRfRoleValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceRfRoleValue: valid values are %v", v, AllowedInterfaceRfRoleValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceRfRoleValue) IsValid() bool { + for _, existing := range AllowedInterfaceRfRoleValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_rf_role_value value +func (v InterfaceRfRoleValue) Ptr() *InterfaceRfRoleValue { + return &v +} + +type NullableInterfaceRfRoleValue struct { + value *InterfaceRfRoleValue + isSet bool +} + +func (v NullableInterfaceRfRoleValue) Get() *InterfaceRfRoleValue { + return v.value +} + +func (v *NullableInterfaceRfRoleValue) Set(val *InterfaceRfRoleValue) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceRfRoleValue) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceRfRoleValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceRfRoleValue(val *InterfaceRfRoleValue) *NullableInterfaceRfRoleValue { + return &NullableInterfaceRfRoleValue{value: val, isSet: true} +} + +func (v NullableInterfaceRfRoleValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceRfRoleValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template.go new file mode 100644 index 00000000..23b6bc79 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template.go @@ -0,0 +1,783 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the InterfaceTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceTemplate{} + +// InterfaceTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type InterfaceTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NullableNestedDeviceType `json:"device_type,omitempty"` + ModuleType NullableNestedModuleType `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type InterfaceType `json:"type"` + Enabled *bool `json:"enabled,omitempty"` + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Bridge NullableNestedInterfaceTemplate `json:"bridge,omitempty"` + PoeMode NullableInterfaceTemplatePoeMode `json:"poe_mode,omitempty"` + PoeType NullableInterfaceTemplatePoeType `json:"poe_type,omitempty"` + RfRole NullableInterfaceTemplateRfRole `json:"rf_role,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceTemplate InterfaceTemplate + +// NewInterfaceTemplate instantiates a new InterfaceTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceTemplate(id int32, url string, display string, name string, type_ InterfaceType, created NullableTime, lastUpdated NullableTime) *InterfaceTemplate { + this := InterfaceTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Type = type_ + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewInterfaceTemplateWithDefaults instantiates a new InterfaceTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceTemplateWithDefaults() *InterfaceTemplate { + this := InterfaceTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *InterfaceTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *InterfaceTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *InterfaceTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *InterfaceTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *InterfaceTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *InterfaceTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplate) GetDeviceType() NestedDeviceType { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceType + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceType and assigns it to the DeviceType field. +func (o *InterfaceTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *InterfaceTemplate) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *InterfaceTemplate) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplate) GetModuleType() NestedModuleType { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleType + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleType and assigns it to the ModuleType field. +func (o *InterfaceTemplate) SetModuleType(v NestedModuleType) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *InterfaceTemplate) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *InterfaceTemplate) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *InterfaceTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InterfaceTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InterfaceTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *InterfaceTemplate) GetType() InterfaceType { + if o == nil { + var ret InterfaceType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetTypeOk() (*InterfaceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InterfaceTemplate) SetType(v InterfaceType) { + o.Type = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *InterfaceTemplate) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *InterfaceTemplate) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *InterfaceTemplate) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *InterfaceTemplate) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InterfaceTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InterfaceTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplate) GetBridge() NestedInterfaceTemplate { + if o == nil || IsNil(o.Bridge.Get()) { + var ret NestedInterfaceTemplate + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetBridgeOk() (*NestedInterfaceTemplate, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableNestedInterfaceTemplate and assigns it to the Bridge field. +func (o *InterfaceTemplate) SetBridge(v NestedInterfaceTemplate) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *InterfaceTemplate) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *InterfaceTemplate) UnsetBridge() { + o.Bridge.Unset() +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplate) GetPoeMode() InterfaceTemplatePoeMode { + if o == nil || IsNil(o.PoeMode.Get()) { + var ret InterfaceTemplatePoeMode + return ret + } + return *o.PoeMode.Get() +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetPoeModeOk() (*InterfaceTemplatePoeMode, bool) { + if o == nil { + return nil, false + } + return o.PoeMode.Get(), o.PoeMode.IsSet() +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasPoeMode() bool { + if o != nil && o.PoeMode.IsSet() { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given NullableInterfaceTemplatePoeMode and assigns it to the PoeMode field. +func (o *InterfaceTemplate) SetPoeMode(v InterfaceTemplatePoeMode) { + o.PoeMode.Set(&v) +} + +// SetPoeModeNil sets the value for PoeMode to be an explicit nil +func (o *InterfaceTemplate) SetPoeModeNil() { + o.PoeMode.Set(nil) +} + +// UnsetPoeMode ensures that no value is present for PoeMode, not even an explicit nil +func (o *InterfaceTemplate) UnsetPoeMode() { + o.PoeMode.Unset() +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplate) GetPoeType() InterfaceTemplatePoeType { + if o == nil || IsNil(o.PoeType.Get()) { + var ret InterfaceTemplatePoeType + return ret + } + return *o.PoeType.Get() +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetPoeTypeOk() (*InterfaceTemplatePoeType, bool) { + if o == nil { + return nil, false + } + return o.PoeType.Get(), o.PoeType.IsSet() +} + +// HasPoeType returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasPoeType() bool { + if o != nil && o.PoeType.IsSet() { + return true + } + + return false +} + +// SetPoeType gets a reference to the given NullableInterfaceTemplatePoeType and assigns it to the PoeType field. +func (o *InterfaceTemplate) SetPoeType(v InterfaceTemplatePoeType) { + o.PoeType.Set(&v) +} + +// SetPoeTypeNil sets the value for PoeType to be an explicit nil +func (o *InterfaceTemplate) SetPoeTypeNil() { + o.PoeType.Set(nil) +} + +// UnsetPoeType ensures that no value is present for PoeType, not even an explicit nil +func (o *InterfaceTemplate) UnsetPoeType() { + o.PoeType.Unset() +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplate) GetRfRole() InterfaceTemplateRfRole { + if o == nil || IsNil(o.RfRole.Get()) { + var ret InterfaceTemplateRfRole + return ret + } + return *o.RfRole.Get() +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetRfRoleOk() (*InterfaceTemplateRfRole, bool) { + if o == nil { + return nil, false + } + return o.RfRole.Get(), o.RfRole.IsSet() +} + +// HasRfRole returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasRfRole() bool { + if o != nil && o.RfRole.IsSet() { + return true + } + + return false +} + +// SetRfRole gets a reference to the given NullableInterfaceTemplateRfRole and assigns it to the RfRole field. +func (o *InterfaceTemplate) SetRfRole(v InterfaceTemplateRfRole) { + o.RfRole.Set(&v) +} + +// SetRfRoleNil sets the value for RfRole to be an explicit nil +func (o *InterfaceTemplate) SetRfRoleNil() { + o.RfRole.Set(nil) +} + +// UnsetRfRole ensures that no value is present for RfRole, not even an explicit nil +func (o *InterfaceTemplate) UnsetRfRole() { + o.RfRole.Unset() +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InterfaceTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *InterfaceTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InterfaceTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *InterfaceTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o InterfaceTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.PoeMode.IsSet() { + toSerialize["poe_mode"] = o.PoeMode.Get() + } + if o.PoeType.IsSet() { + toSerialize["poe_type"] = o.PoeType.Get() + } + if o.RfRole.IsSet() { + toSerialize["rf_role"] = o.RfRole.Get() + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "type", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInterfaceTemplate := _InterfaceTemplate{} + + err = json.Unmarshal(data, &varInterfaceTemplate) + + if err != nil { + return err + } + + *o = InterfaceTemplate(varInterfaceTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "bridge") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_role") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceTemplate struct { + value *InterfaceTemplate + isSet bool +} + +func (v NullableInterfaceTemplate) Get() *InterfaceTemplate { + return v.value +} + +func (v *NullableInterfaceTemplate) Set(val *InterfaceTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplate(val *InterfaceTemplate) *NullableInterfaceTemplate { + return &NullableInterfaceTemplate{value: val, isSet: true} +} + +func (v NullableInterfaceTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_poe_mode.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_poe_mode.go new file mode 100644 index 00000000..0d151ba5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_poe_mode.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceTemplatePoeMode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceTemplatePoeMode{} + +// InterfaceTemplatePoeMode struct for InterfaceTemplatePoeMode +type InterfaceTemplatePoeMode struct { + Value *InterfacePoeModeValue `json:"value,omitempty"` + Label *InterfacePoeModeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceTemplatePoeMode InterfaceTemplatePoeMode + +// NewInterfaceTemplatePoeMode instantiates a new InterfaceTemplatePoeMode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceTemplatePoeMode() *InterfaceTemplatePoeMode { + this := InterfaceTemplatePoeMode{} + return &this +} + +// NewInterfaceTemplatePoeModeWithDefaults instantiates a new InterfaceTemplatePoeMode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceTemplatePoeModeWithDefaults() *InterfaceTemplatePoeMode { + this := InterfaceTemplatePoeMode{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceTemplatePoeMode) GetValue() InterfacePoeModeValue { + if o == nil || IsNil(o.Value) { + var ret InterfacePoeModeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplatePoeMode) GetValueOk() (*InterfacePoeModeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceTemplatePoeMode) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfacePoeModeValue and assigns it to the Value field. +func (o *InterfaceTemplatePoeMode) SetValue(v InterfacePoeModeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceTemplatePoeMode) GetLabel() InterfacePoeModeLabel { + if o == nil || IsNil(o.Label) { + var ret InterfacePoeModeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplatePoeMode) GetLabelOk() (*InterfacePoeModeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceTemplatePoeMode) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfacePoeModeLabel and assigns it to the Label field. +func (o *InterfaceTemplatePoeMode) SetLabel(v InterfacePoeModeLabel) { + o.Label = &v +} + +func (o InterfaceTemplatePoeMode) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceTemplatePoeMode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceTemplatePoeMode) UnmarshalJSON(data []byte) (err error) { + varInterfaceTemplatePoeMode := _InterfaceTemplatePoeMode{} + + err = json.Unmarshal(data, &varInterfaceTemplatePoeMode) + + if err != nil { + return err + } + + *o = InterfaceTemplatePoeMode(varInterfaceTemplatePoeMode) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceTemplatePoeMode struct { + value *InterfaceTemplatePoeMode + isSet bool +} + +func (v NullableInterfaceTemplatePoeMode) Get() *InterfaceTemplatePoeMode { + return v.value +} + +func (v *NullableInterfaceTemplatePoeMode) Set(val *InterfaceTemplatePoeMode) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplatePoeMode) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplatePoeMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplatePoeMode(val *InterfaceTemplatePoeMode) *NullableInterfaceTemplatePoeMode { + return &NullableInterfaceTemplatePoeMode{value: val, isSet: true} +} + +func (v NullableInterfaceTemplatePoeMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplatePoeMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_poe_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_poe_type.go new file mode 100644 index 00000000..db28e013 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_poe_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceTemplatePoeType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceTemplatePoeType{} + +// InterfaceTemplatePoeType struct for InterfaceTemplatePoeType +type InterfaceTemplatePoeType struct { + Value *InterfacePoeTypeValue `json:"value,omitempty"` + Label *InterfacePoeTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceTemplatePoeType InterfaceTemplatePoeType + +// NewInterfaceTemplatePoeType instantiates a new InterfaceTemplatePoeType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceTemplatePoeType() *InterfaceTemplatePoeType { + this := InterfaceTemplatePoeType{} + return &this +} + +// NewInterfaceTemplatePoeTypeWithDefaults instantiates a new InterfaceTemplatePoeType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceTemplatePoeTypeWithDefaults() *InterfaceTemplatePoeType { + this := InterfaceTemplatePoeType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceTemplatePoeType) GetValue() InterfacePoeTypeValue { + if o == nil || IsNil(o.Value) { + var ret InterfacePoeTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplatePoeType) GetValueOk() (*InterfacePoeTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceTemplatePoeType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfacePoeTypeValue and assigns it to the Value field. +func (o *InterfaceTemplatePoeType) SetValue(v InterfacePoeTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceTemplatePoeType) GetLabel() InterfacePoeTypeLabel { + if o == nil || IsNil(o.Label) { + var ret InterfacePoeTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplatePoeType) GetLabelOk() (*InterfacePoeTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceTemplatePoeType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfacePoeTypeLabel and assigns it to the Label field. +func (o *InterfaceTemplatePoeType) SetLabel(v InterfacePoeTypeLabel) { + o.Label = &v +} + +func (o InterfaceTemplatePoeType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceTemplatePoeType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceTemplatePoeType) UnmarshalJSON(data []byte) (err error) { + varInterfaceTemplatePoeType := _InterfaceTemplatePoeType{} + + err = json.Unmarshal(data, &varInterfaceTemplatePoeType) + + if err != nil { + return err + } + + *o = InterfaceTemplatePoeType(varInterfaceTemplatePoeType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceTemplatePoeType struct { + value *InterfaceTemplatePoeType + isSet bool +} + +func (v NullableInterfaceTemplatePoeType) Get() *InterfaceTemplatePoeType { + return v.value +} + +func (v *NullableInterfaceTemplatePoeType) Set(val *InterfaceTemplatePoeType) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplatePoeType) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplatePoeType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplatePoeType(val *InterfaceTemplatePoeType) *NullableInterfaceTemplatePoeType { + return &NullableInterfaceTemplatePoeType{value: val, isSet: true} +} + +func (v NullableInterfaceTemplatePoeType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplatePoeType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request.go new file mode 100644 index 00000000..f7e3970c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request.go @@ -0,0 +1,633 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the InterfaceTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceTemplateRequest{} + +// InterfaceTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type InterfaceTemplateRequest struct { + DeviceType NullableNestedDeviceTypeRequest `json:"device_type,omitempty"` + ModuleType NullableNestedModuleTypeRequest `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type InterfaceTypeValue `json:"type"` + Enabled *bool `json:"enabled,omitempty"` + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Bridge NullableNestedInterfaceTemplateRequest `json:"bridge,omitempty"` + PoeMode NullableInterfaceTemplateRequestPoeMode `json:"poe_mode,omitempty"` + PoeType NullableInterfaceTemplateRequestPoeType `json:"poe_type,omitempty"` + RfRole NullableInterfaceTemplateRequestRfRole `json:"rf_role,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceTemplateRequest InterfaceTemplateRequest + +// NewInterfaceTemplateRequest instantiates a new InterfaceTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceTemplateRequest(name string, type_ InterfaceTypeValue) *InterfaceTemplateRequest { + this := InterfaceTemplateRequest{} + this.Name = name + this.Type = type_ + return &this +} + +// NewInterfaceTemplateRequestWithDefaults instantiates a new InterfaceTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceTemplateRequestWithDefaults() *InterfaceTemplateRequest { + this := InterfaceTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceTypeRequest + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceTypeRequest and assigns it to the DeviceType field. +func (o *InterfaceTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *InterfaceTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *InterfaceTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplateRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleTypeRequest + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplateRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleTypeRequest and assigns it to the ModuleType field. +func (o *InterfaceTemplateRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *InterfaceTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *InterfaceTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *InterfaceTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InterfaceTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InterfaceTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *InterfaceTemplateRequest) GetType() InterfaceTypeValue { + if o == nil { + var ret InterfaceTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRequest) GetTypeOk() (*InterfaceTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InterfaceTemplateRequest) SetType(v InterfaceTypeValue) { + o.Type = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *InterfaceTemplateRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *InterfaceTemplateRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *InterfaceTemplateRequest) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRequest) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *InterfaceTemplateRequest) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InterfaceTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InterfaceTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplateRequest) GetBridge() NestedInterfaceTemplateRequest { + if o == nil || IsNil(o.Bridge.Get()) { + var ret NestedInterfaceTemplateRequest + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplateRequest) GetBridgeOk() (*NestedInterfaceTemplateRequest, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableNestedInterfaceTemplateRequest and assigns it to the Bridge field. +func (o *InterfaceTemplateRequest) SetBridge(v NestedInterfaceTemplateRequest) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *InterfaceTemplateRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *InterfaceTemplateRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplateRequest) GetPoeMode() InterfaceTemplateRequestPoeMode { + if o == nil || IsNil(o.PoeMode.Get()) { + var ret InterfaceTemplateRequestPoeMode + return ret + } + return *o.PoeMode.Get() +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplateRequest) GetPoeModeOk() (*InterfaceTemplateRequestPoeMode, bool) { + if o == nil { + return nil, false + } + return o.PoeMode.Get(), o.PoeMode.IsSet() +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasPoeMode() bool { + if o != nil && o.PoeMode.IsSet() { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given NullableInterfaceTemplateRequestPoeMode and assigns it to the PoeMode field. +func (o *InterfaceTemplateRequest) SetPoeMode(v InterfaceTemplateRequestPoeMode) { + o.PoeMode.Set(&v) +} + +// SetPoeModeNil sets the value for PoeMode to be an explicit nil +func (o *InterfaceTemplateRequest) SetPoeModeNil() { + o.PoeMode.Set(nil) +} + +// UnsetPoeMode ensures that no value is present for PoeMode, not even an explicit nil +func (o *InterfaceTemplateRequest) UnsetPoeMode() { + o.PoeMode.Unset() +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplateRequest) GetPoeType() InterfaceTemplateRequestPoeType { + if o == nil || IsNil(o.PoeType.Get()) { + var ret InterfaceTemplateRequestPoeType + return ret + } + return *o.PoeType.Get() +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplateRequest) GetPoeTypeOk() (*InterfaceTemplateRequestPoeType, bool) { + if o == nil { + return nil, false + } + return o.PoeType.Get(), o.PoeType.IsSet() +} + +// HasPoeType returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasPoeType() bool { + if o != nil && o.PoeType.IsSet() { + return true + } + + return false +} + +// SetPoeType gets a reference to the given NullableInterfaceTemplateRequestPoeType and assigns it to the PoeType field. +func (o *InterfaceTemplateRequest) SetPoeType(v InterfaceTemplateRequestPoeType) { + o.PoeType.Set(&v) +} + +// SetPoeTypeNil sets the value for PoeType to be an explicit nil +func (o *InterfaceTemplateRequest) SetPoeTypeNil() { + o.PoeType.Set(nil) +} + +// UnsetPoeType ensures that no value is present for PoeType, not even an explicit nil +func (o *InterfaceTemplateRequest) UnsetPoeType() { + o.PoeType.Unset() +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InterfaceTemplateRequest) GetRfRole() InterfaceTemplateRequestRfRole { + if o == nil || IsNil(o.RfRole.Get()) { + var ret InterfaceTemplateRequestRfRole + return ret + } + return *o.RfRole.Get() +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InterfaceTemplateRequest) GetRfRoleOk() (*InterfaceTemplateRequestRfRole, bool) { + if o == nil { + return nil, false + } + return o.RfRole.Get(), o.RfRole.IsSet() +} + +// HasRfRole returns a boolean if a field has been set. +func (o *InterfaceTemplateRequest) HasRfRole() bool { + if o != nil && o.RfRole.IsSet() { + return true + } + + return false +} + +// SetRfRole gets a reference to the given NullableInterfaceTemplateRequestRfRole and assigns it to the RfRole field. +func (o *InterfaceTemplateRequest) SetRfRole(v InterfaceTemplateRequestRfRole) { + o.RfRole.Set(&v) +} + +// SetRfRoleNil sets the value for RfRole to be an explicit nil +func (o *InterfaceTemplateRequest) SetRfRoleNil() { + o.RfRole.Set(nil) +} + +// UnsetRfRole ensures that no value is present for RfRole, not even an explicit nil +func (o *InterfaceTemplateRequest) UnsetRfRole() { + o.RfRole.Unset() +} + +func (o InterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.PoeMode.IsSet() { + toSerialize["poe_mode"] = o.PoeMode.Get() + } + if o.PoeType.IsSet() { + toSerialize["poe_type"] = o.PoeType.Get() + } + if o.RfRole.IsSet() { + toSerialize["rf_role"] = o.RfRole.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInterfaceTemplateRequest := _InterfaceTemplateRequest{} + + err = json.Unmarshal(data, &varInterfaceTemplateRequest) + + if err != nil { + return err + } + + *o = InterfaceTemplateRequest(varInterfaceTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "bridge") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_role") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceTemplateRequest struct { + value *InterfaceTemplateRequest + isSet bool +} + +func (v NullableInterfaceTemplateRequest) Get() *InterfaceTemplateRequest { + return v.value +} + +func (v *NullableInterfaceTemplateRequest) Set(val *InterfaceTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplateRequest(val *InterfaceTemplateRequest) *NullableInterfaceTemplateRequest { + return &NullableInterfaceTemplateRequest{value: val, isSet: true} +} + +func (v NullableInterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_poe_mode.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_poe_mode.go new file mode 100644 index 00000000..248e6cea --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_poe_mode.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceTemplateRequestPoeMode * `pd` - PD * `pse` - PSE +type InterfaceTemplateRequestPoeMode string + +// List of InterfaceTemplateRequest_poe_mode +const ( + INTERFACETEMPLATEREQUESTPOEMODE_PD InterfaceTemplateRequestPoeMode = "pd" + INTERFACETEMPLATEREQUESTPOEMODE_PSE InterfaceTemplateRequestPoeMode = "pse" + INTERFACETEMPLATEREQUESTPOEMODE_EMPTY InterfaceTemplateRequestPoeMode = "" +) + +// All allowed values of InterfaceTemplateRequestPoeMode enum +var AllowedInterfaceTemplateRequestPoeModeEnumValues = []InterfaceTemplateRequestPoeMode{ + "pd", + "pse", + "", +} + +func (v *InterfaceTemplateRequestPoeMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceTemplateRequestPoeMode(value) + for _, existing := range AllowedInterfaceTemplateRequestPoeModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceTemplateRequestPoeMode", value) +} + +// NewInterfaceTemplateRequestPoeModeFromValue returns a pointer to a valid InterfaceTemplateRequestPoeMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceTemplateRequestPoeModeFromValue(v string) (*InterfaceTemplateRequestPoeMode, error) { + ev := InterfaceTemplateRequestPoeMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceTemplateRequestPoeMode: valid values are %v", v, AllowedInterfaceTemplateRequestPoeModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceTemplateRequestPoeMode) IsValid() bool { + for _, existing := range AllowedInterfaceTemplateRequestPoeModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InterfaceTemplateRequest_poe_mode value +func (v InterfaceTemplateRequestPoeMode) Ptr() *InterfaceTemplateRequestPoeMode { + return &v +} + +type NullableInterfaceTemplateRequestPoeMode struct { + value *InterfaceTemplateRequestPoeMode + isSet bool +} + +func (v NullableInterfaceTemplateRequestPoeMode) Get() *InterfaceTemplateRequestPoeMode { + return v.value +} + +func (v *NullableInterfaceTemplateRequestPoeMode) Set(val *InterfaceTemplateRequestPoeMode) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplateRequestPoeMode) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplateRequestPoeMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplateRequestPoeMode(val *InterfaceTemplateRequestPoeMode) *NullableInterfaceTemplateRequestPoeMode { + return &NullableInterfaceTemplateRequestPoeMode{value: val, isSet: true} +} + +func (v NullableInterfaceTemplateRequestPoeMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplateRequestPoeMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_poe_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_poe_type.go new file mode 100644 index 00000000..ffe54c23 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_poe_type.go @@ -0,0 +1,124 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceTemplateRequestPoeType * `type1-ieee802.3af` - 802.3af (Type 1) * `type2-ieee802.3at` - 802.3at (Type 2) * `type3-ieee802.3bt` - 802.3bt (Type 3) * `type4-ieee802.3bt` - 802.3bt (Type 4) * `passive-24v-2pair` - Passive 24V (2-pair) * `passive-24v-4pair` - Passive 24V (4-pair) * `passive-48v-2pair` - Passive 48V (2-pair) * `passive-48v-4pair` - Passive 48V (4-pair) +type InterfaceTemplateRequestPoeType string + +// List of InterfaceTemplateRequest_poe_type +const ( + INTERFACETEMPLATEREQUESTPOETYPE_TYPE1_IEEE802_3AF InterfaceTemplateRequestPoeType = "type1-ieee802.3af" + INTERFACETEMPLATEREQUESTPOETYPE_TYPE2_IEEE802_3AT InterfaceTemplateRequestPoeType = "type2-ieee802.3at" + INTERFACETEMPLATEREQUESTPOETYPE_TYPE3_IEEE802_3BT InterfaceTemplateRequestPoeType = "type3-ieee802.3bt" + INTERFACETEMPLATEREQUESTPOETYPE_TYPE4_IEEE802_3BT InterfaceTemplateRequestPoeType = "type4-ieee802.3bt" + INTERFACETEMPLATEREQUESTPOETYPE_PASSIVE_24V_2PAIR InterfaceTemplateRequestPoeType = "passive-24v-2pair" + INTERFACETEMPLATEREQUESTPOETYPE_PASSIVE_24V_4PAIR InterfaceTemplateRequestPoeType = "passive-24v-4pair" + INTERFACETEMPLATEREQUESTPOETYPE_PASSIVE_48V_2PAIR InterfaceTemplateRequestPoeType = "passive-48v-2pair" + INTERFACETEMPLATEREQUESTPOETYPE_PASSIVE_48V_4PAIR InterfaceTemplateRequestPoeType = "passive-48v-4pair" + INTERFACETEMPLATEREQUESTPOETYPE_EMPTY InterfaceTemplateRequestPoeType = "" +) + +// All allowed values of InterfaceTemplateRequestPoeType enum +var AllowedInterfaceTemplateRequestPoeTypeEnumValues = []InterfaceTemplateRequestPoeType{ + "type1-ieee802.3af", + "type2-ieee802.3at", + "type3-ieee802.3bt", + "type4-ieee802.3bt", + "passive-24v-2pair", + "passive-24v-4pair", + "passive-48v-2pair", + "passive-48v-4pair", + "", +} + +func (v *InterfaceTemplateRequestPoeType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceTemplateRequestPoeType(value) + for _, existing := range AllowedInterfaceTemplateRequestPoeTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceTemplateRequestPoeType", value) +} + +// NewInterfaceTemplateRequestPoeTypeFromValue returns a pointer to a valid InterfaceTemplateRequestPoeType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceTemplateRequestPoeTypeFromValue(v string) (*InterfaceTemplateRequestPoeType, error) { + ev := InterfaceTemplateRequestPoeType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceTemplateRequestPoeType: valid values are %v", v, AllowedInterfaceTemplateRequestPoeTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceTemplateRequestPoeType) IsValid() bool { + for _, existing := range AllowedInterfaceTemplateRequestPoeTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InterfaceTemplateRequest_poe_type value +func (v InterfaceTemplateRequestPoeType) Ptr() *InterfaceTemplateRequestPoeType { + return &v +} + +type NullableInterfaceTemplateRequestPoeType struct { + value *InterfaceTemplateRequestPoeType + isSet bool +} + +func (v NullableInterfaceTemplateRequestPoeType) Get() *InterfaceTemplateRequestPoeType { + return v.value +} + +func (v *NullableInterfaceTemplateRequestPoeType) Set(val *InterfaceTemplateRequestPoeType) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplateRequestPoeType) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplateRequestPoeType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplateRequestPoeType(val *InterfaceTemplateRequestPoeType) *NullableInterfaceTemplateRequestPoeType { + return &NullableInterfaceTemplateRequestPoeType{value: val, isSet: true} +} + +func (v NullableInterfaceTemplateRequestPoeType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplateRequestPoeType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_rf_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_rf_role.go new file mode 100644 index 00000000..f66b29b8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_request_rf_role.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceTemplateRequestRfRole * `ap` - Access point * `station` - Station +type InterfaceTemplateRequestRfRole string + +// List of InterfaceTemplateRequest_rf_role +const ( + INTERFACETEMPLATEREQUESTRFROLE_AP InterfaceTemplateRequestRfRole = "ap" + INTERFACETEMPLATEREQUESTRFROLE_STATION InterfaceTemplateRequestRfRole = "station" + INTERFACETEMPLATEREQUESTRFROLE_EMPTY InterfaceTemplateRequestRfRole = "" +) + +// All allowed values of InterfaceTemplateRequestRfRole enum +var AllowedInterfaceTemplateRequestRfRoleEnumValues = []InterfaceTemplateRequestRfRole{ + "ap", + "station", + "", +} + +func (v *InterfaceTemplateRequestRfRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceTemplateRequestRfRole(value) + for _, existing := range AllowedInterfaceTemplateRequestRfRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceTemplateRequestRfRole", value) +} + +// NewInterfaceTemplateRequestRfRoleFromValue returns a pointer to a valid InterfaceTemplateRequestRfRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceTemplateRequestRfRoleFromValue(v string) (*InterfaceTemplateRequestRfRole, error) { + ev := InterfaceTemplateRequestRfRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceTemplateRequestRfRole: valid values are %v", v, AllowedInterfaceTemplateRequestRfRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceTemplateRequestRfRole) IsValid() bool { + for _, existing := range AllowedInterfaceTemplateRequestRfRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InterfaceTemplateRequest_rf_role value +func (v InterfaceTemplateRequestRfRole) Ptr() *InterfaceTemplateRequestRfRole { + return &v +} + +type NullableInterfaceTemplateRequestRfRole struct { + value *InterfaceTemplateRequestRfRole + isSet bool +} + +func (v NullableInterfaceTemplateRequestRfRole) Get() *InterfaceTemplateRequestRfRole { + return v.value +} + +func (v *NullableInterfaceTemplateRequestRfRole) Set(val *InterfaceTemplateRequestRfRole) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplateRequestRfRole) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplateRequestRfRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplateRequestRfRole(val *InterfaceTemplateRequestRfRole) *NullableInterfaceTemplateRequestRfRole { + return &NullableInterfaceTemplateRequestRfRole{value: val, isSet: true} +} + +func (v NullableInterfaceTemplateRequestRfRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplateRequestRfRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_rf_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_rf_role.go new file mode 100644 index 00000000..670be59e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_template_rf_role.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceTemplateRfRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceTemplateRfRole{} + +// InterfaceTemplateRfRole struct for InterfaceTemplateRfRole +type InterfaceTemplateRfRole struct { + Value *InterfaceRfRoleValue `json:"value,omitempty"` + Label *InterfaceRfRoleLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceTemplateRfRole InterfaceTemplateRfRole + +// NewInterfaceTemplateRfRole instantiates a new InterfaceTemplateRfRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceTemplateRfRole() *InterfaceTemplateRfRole { + this := InterfaceTemplateRfRole{} + return &this +} + +// NewInterfaceTemplateRfRoleWithDefaults instantiates a new InterfaceTemplateRfRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceTemplateRfRoleWithDefaults() *InterfaceTemplateRfRole { + this := InterfaceTemplateRfRole{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceTemplateRfRole) GetValue() InterfaceRfRoleValue { + if o == nil || IsNil(o.Value) { + var ret InterfaceRfRoleValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRfRole) GetValueOk() (*InterfaceRfRoleValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceTemplateRfRole) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfaceRfRoleValue and assigns it to the Value field. +func (o *InterfaceTemplateRfRole) SetValue(v InterfaceRfRoleValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceTemplateRfRole) GetLabel() InterfaceRfRoleLabel { + if o == nil || IsNil(o.Label) { + var ret InterfaceRfRoleLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceTemplateRfRole) GetLabelOk() (*InterfaceRfRoleLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceTemplateRfRole) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfaceRfRoleLabel and assigns it to the Label field. +func (o *InterfaceTemplateRfRole) SetLabel(v InterfaceRfRoleLabel) { + o.Label = &v +} + +func (o InterfaceTemplateRfRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceTemplateRfRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceTemplateRfRole) UnmarshalJSON(data []byte) (err error) { + varInterfaceTemplateRfRole := _InterfaceTemplateRfRole{} + + err = json.Unmarshal(data, &varInterfaceTemplateRfRole) + + if err != nil { + return err + } + + *o = InterfaceTemplateRfRole(varInterfaceTemplateRfRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceTemplateRfRole struct { + value *InterfaceTemplateRfRole + isSet bool +} + +func (v NullableInterfaceTemplateRfRole) Get() *InterfaceTemplateRfRole { + return v.value +} + +func (v *NullableInterfaceTemplateRfRole) Set(val *InterfaceTemplateRfRole) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTemplateRfRole) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTemplateRfRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTemplateRfRole(val *InterfaceTemplateRfRole) *NullableInterfaceTemplateRfRole { + return &NullableInterfaceTemplateRfRole{value: val, isSet: true} +} + +func (v NullableInterfaceTemplateRfRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTemplateRfRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type.go new file mode 100644 index 00000000..32959eb5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the InterfaceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceType{} + +// InterfaceType struct for InterfaceType +type InterfaceType struct { + Value *InterfaceTypeValue `json:"value,omitempty"` + Label *InterfaceTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterfaceType InterfaceType + +// NewInterfaceType instantiates a new InterfaceType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceType() *InterfaceType { + this := InterfaceType{} + return &this +} + +// NewInterfaceTypeWithDefaults instantiates a new InterfaceType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceTypeWithDefaults() *InterfaceType { + this := InterfaceType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InterfaceType) GetValue() InterfaceTypeValue { + if o == nil || IsNil(o.Value) { + var ret InterfaceTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceType) GetValueOk() (*InterfaceTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InterfaceType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given InterfaceTypeValue and assigns it to the Value field. +func (o *InterfaceType) SetValue(v InterfaceTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InterfaceType) GetLabel() InterfaceTypeLabel { + if o == nil || IsNil(o.Label) { + var ret InterfaceTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceType) GetLabelOk() (*InterfaceTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InterfaceType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given InterfaceTypeLabel and assigns it to the Label field. +func (o *InterfaceType) SetLabel(v InterfaceTypeLabel) { + o.Label = &v +} + +func (o InterfaceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterfaceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterfaceType) UnmarshalJSON(data []byte) (err error) { + varInterfaceType := _InterfaceType{} + + err = json.Unmarshal(data, &varInterfaceType) + + if err != nil { + return err + } + + *o = InterfaceType(varInterfaceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterfaceType struct { + value *InterfaceType + isSet bool +} + +func (v NullableInterfaceType) Get() *InterfaceType { + return v.value +} + +func (v *NullableInterfaceType) Set(val *InterfaceType) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceType) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceType(val *InterfaceType) *NullableInterfaceType { + return &NullableInterfaceType{value: val, isSet: true} +} + +func (v NullableInterfaceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type_label.go new file mode 100644 index 00000000..b578b6af --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type_label.go @@ -0,0 +1,336 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceTypeLabel the model 'InterfaceTypeLabel' +type InterfaceTypeLabel string + +// List of Interface_type_label +const ( + INTERFACETYPELABEL_VIRTUAL InterfaceTypeLabel = "Virtual" + INTERFACETYPELABEL_BRIDGE InterfaceTypeLabel = "Bridge" + INTERFACETYPELABEL_LINK_AGGREGATION_GROUP__LAG InterfaceTypeLabel = "Link Aggregation Group (LAG)" + INTERFACETYPELABEL__100_BASE_FX__10_100_ME_FIBER InterfaceTypeLabel = "100BASE-FX (10/100ME FIBER)" + INTERFACETYPELABEL__100_BASE_LFX__10_100_ME_FIBER InterfaceTypeLabel = "100BASE-LFX (10/100ME FIBER)" + INTERFACETYPELABEL__100_BASE_TX__10_100_ME InterfaceTypeLabel = "100BASE-TX (10/100ME)" + INTERFACETYPELABEL__100_BASE_T1__10_100_ME_SINGLE_PAIR InterfaceTypeLabel = "100BASE-T1 (10/100ME Single Pair)" + INTERFACETYPELABEL__1000_BASE_T__1_GE InterfaceTypeLabel = "1000BASE-T (1GE)" + INTERFACETYPELABEL__2_5_GBASE_T__2_5_GE InterfaceTypeLabel = "2.5GBASE-T (2.5GE)" + INTERFACETYPELABEL__5_GBASE_T__5_GE InterfaceTypeLabel = "5GBASE-T (5GE)" + INTERFACETYPELABEL__10_GBASE_T__10_GE InterfaceTypeLabel = "10GBASE-T (10GE)" + INTERFACETYPELABEL__10_GBASE_CX4__10_GE InterfaceTypeLabel = "10GBASE-CX4 (10GE)" + INTERFACETYPELABEL_GBIC__1_GE InterfaceTypeLabel = "GBIC (1GE)" + INTERFACETYPELABEL_SFP__1_GE InterfaceTypeLabel = "SFP (1GE)" + INTERFACETYPELABEL_SFP__10_GE InterfaceTypeLabel = "SFP+ (10GE)" + INTERFACETYPELABEL_XFP__10_GE InterfaceTypeLabel = "XFP (10GE)" + INTERFACETYPELABEL_XENPAK__10_GE InterfaceTypeLabel = "XENPAK (10GE)" + INTERFACETYPELABEL_X2__10_GE InterfaceTypeLabel = "X2 (10GE)" + INTERFACETYPELABEL_SFP28__25_GE InterfaceTypeLabel = "SFP28 (25GE)" + INTERFACETYPELABEL_SFP56__50_GE InterfaceTypeLabel = "SFP56 (50GE)" + INTERFACETYPELABEL_QSFP__40_GE InterfaceTypeLabel = "QSFP+ (40GE)" + INTERFACETYPELABEL_QSFP28__50_GE InterfaceTypeLabel = "QSFP28 (50GE)" + INTERFACETYPELABEL_CFP__100_GE InterfaceTypeLabel = "CFP (100GE)" + INTERFACETYPELABEL_CFP2__100_GE InterfaceTypeLabel = "CFP2 (100GE)" + INTERFACETYPELABEL_CFP2__200_GE InterfaceTypeLabel = "CFP2 (200GE)" + INTERFACETYPELABEL_CFP2__400_GE InterfaceTypeLabel = "CFP2 (400GE)" + INTERFACETYPELABEL_CFP4__100_GE InterfaceTypeLabel = "CFP4 (100GE)" + INTERFACETYPELABEL_CXP__100_GE InterfaceTypeLabel = "CXP (100GE)" + INTERFACETYPELABEL_CISCO_CPAK__100_GE InterfaceTypeLabel = "Cisco CPAK (100GE)" + INTERFACETYPELABEL_DSFP__100_GE InterfaceTypeLabel = "DSFP (100GE)" + INTERFACETYPELABEL_SFP_DD__100_GE InterfaceTypeLabel = "SFP-DD (100GE)" + INTERFACETYPELABEL_QSFP28__100_GE InterfaceTypeLabel = "QSFP28 (100GE)" + INTERFACETYPELABEL_QSFP_DD__100_GE InterfaceTypeLabel = "QSFP-DD (100GE)" + INTERFACETYPELABEL_QSFP56__200_GE InterfaceTypeLabel = "QSFP56 (200GE)" + INTERFACETYPELABEL_QSFP_DD__200_GE InterfaceTypeLabel = "QSFP-DD (200GE)" + INTERFACETYPELABEL_QSFP112__400_GE InterfaceTypeLabel = "QSFP112 (400GE)" + INTERFACETYPELABEL_QSFP_DD__400_GE InterfaceTypeLabel = "QSFP-DD (400GE)" + INTERFACETYPELABEL_OSFP__400_GE InterfaceTypeLabel = "OSFP (400GE)" + INTERFACETYPELABEL_OSFP_RHS__400_GE InterfaceTypeLabel = "OSFP-RHS (400GE)" + INTERFACETYPELABEL_CDFP__400_GE InterfaceTypeLabel = "CDFP (400GE)" + INTERFACETYPELABEL_CPF8__400_GE InterfaceTypeLabel = "CPF8 (400GE)" + INTERFACETYPELABEL_QSFP_DD__800_GE InterfaceTypeLabel = "QSFP-DD (800GE)" + INTERFACETYPELABEL_OSFP__800_GE InterfaceTypeLabel = "OSFP (800GE)" + INTERFACETYPELABEL__1000_BASE_KX__1_GE InterfaceTypeLabel = "1000BASE-KX (1GE)" + INTERFACETYPELABEL__10_GBASE_KR__10_GE InterfaceTypeLabel = "10GBASE-KR (10GE)" + INTERFACETYPELABEL__10_GBASE_KX4__10_GE InterfaceTypeLabel = "10GBASE-KX4 (10GE)" + INTERFACETYPELABEL__25_GBASE_KR__25_GE InterfaceTypeLabel = "25GBASE-KR (25GE)" + INTERFACETYPELABEL__40_GBASE_KR4__40_GE InterfaceTypeLabel = "40GBASE-KR4 (40GE)" + INTERFACETYPELABEL__50_GBASE_KR__50_GE InterfaceTypeLabel = "50GBASE-KR (50GE)" + INTERFACETYPELABEL__100_GBASE_KP4__100_GE InterfaceTypeLabel = "100GBASE-KP4 (100GE)" + INTERFACETYPELABEL__100_GBASE_KR2__100_GE InterfaceTypeLabel = "100GBASE-KR2 (100GE)" + INTERFACETYPELABEL__100_GBASE_KR4__100_GE InterfaceTypeLabel = "100GBASE-KR4 (100GE)" + INTERFACETYPELABEL_IEEE_802_11A InterfaceTypeLabel = "IEEE 802.11a" + INTERFACETYPELABEL_IEEE_802_11B_G InterfaceTypeLabel = "IEEE 802.11b/g" + INTERFACETYPELABEL_IEEE_802_11N InterfaceTypeLabel = "IEEE 802.11n" + INTERFACETYPELABEL_IEEE_802_11AC InterfaceTypeLabel = "IEEE 802.11ac" + INTERFACETYPELABEL_IEEE_802_11AD InterfaceTypeLabel = "IEEE 802.11ad" + INTERFACETYPELABEL_IEEE_802_11AX InterfaceTypeLabel = "IEEE 802.11ax" + INTERFACETYPELABEL_IEEE_802_11AY InterfaceTypeLabel = "IEEE 802.11ay" + INTERFACETYPELABEL_IEEE_802_15_1__BLUETOOTH InterfaceTypeLabel = "IEEE 802.15.1 (Bluetooth)" + INTERFACETYPELABEL_OTHER__WIRELESS InterfaceTypeLabel = "Other (Wireless)" + INTERFACETYPELABEL_GSM InterfaceTypeLabel = "GSM" + INTERFACETYPELABEL_CDMA InterfaceTypeLabel = "CDMA" + INTERFACETYPELABEL_LTE InterfaceTypeLabel = "LTE" + INTERFACETYPELABEL_OC_3_STM_1 InterfaceTypeLabel = "OC-3/STM-1" + INTERFACETYPELABEL_OC_12_STM_4 InterfaceTypeLabel = "OC-12/STM-4" + INTERFACETYPELABEL_OC_48_STM_16 InterfaceTypeLabel = "OC-48/STM-16" + INTERFACETYPELABEL_OC_192_STM_64 InterfaceTypeLabel = "OC-192/STM-64" + INTERFACETYPELABEL_OC_768_STM_256 InterfaceTypeLabel = "OC-768/STM-256" + INTERFACETYPELABEL_OC_1920_STM_640 InterfaceTypeLabel = "OC-1920/STM-640" + INTERFACETYPELABEL_OC_3840_STM_1234 InterfaceTypeLabel = "OC-3840/STM-1234" + INTERFACETYPELABEL_SFP__1_GFC InterfaceTypeLabel = "SFP (1GFC)" + INTERFACETYPELABEL_SFP__2_GFC InterfaceTypeLabel = "SFP (2GFC)" + INTERFACETYPELABEL_SFP__4_GFC InterfaceTypeLabel = "SFP (4GFC)" + INTERFACETYPELABEL_SFP__8_GFC InterfaceTypeLabel = "SFP+ (8GFC)" + INTERFACETYPELABEL_SFP__16_GFC InterfaceTypeLabel = "SFP+ (16GFC)" + INTERFACETYPELABEL_SFP28__32_GFC InterfaceTypeLabel = "SFP28 (32GFC)" + INTERFACETYPELABEL_QSFP__64_GFC InterfaceTypeLabel = "QSFP+ (64GFC)" + INTERFACETYPELABEL_QSFP28__128_GFC InterfaceTypeLabel = "QSFP28 (128GFC)" + INTERFACETYPELABEL_SDR__2_GBPS InterfaceTypeLabel = "SDR (2 Gbps)" + INTERFACETYPELABEL_DDR__4_GBPS InterfaceTypeLabel = "DDR (4 Gbps)" + INTERFACETYPELABEL_QDR__8_GBPS InterfaceTypeLabel = "QDR (8 Gbps)" + INTERFACETYPELABEL_FDR10__10_GBPS InterfaceTypeLabel = "FDR10 (10 Gbps)" + INTERFACETYPELABEL_FDR__13_5_GBPS InterfaceTypeLabel = "FDR (13.5 Gbps)" + INTERFACETYPELABEL_EDR__25_GBPS InterfaceTypeLabel = "EDR (25 Gbps)" + INTERFACETYPELABEL_HDR__50_GBPS InterfaceTypeLabel = "HDR (50 Gbps)" + INTERFACETYPELABEL_NDR__100_GBPS InterfaceTypeLabel = "NDR (100 Gbps)" + INTERFACETYPELABEL_XDR__250_GBPS InterfaceTypeLabel = "XDR (250 Gbps)" + INTERFACETYPELABEL_T1__1_544_MBPS InterfaceTypeLabel = "T1 (1.544 Mbps)" + INTERFACETYPELABEL_E1__2_048_MBPS InterfaceTypeLabel = "E1 (2.048 Mbps)" + INTERFACETYPELABEL_T3__45_MBPS InterfaceTypeLabel = "T3 (45 Mbps)" + INTERFACETYPELABEL_E3__34_MBPS InterfaceTypeLabel = "E3 (34 Mbps)" + INTERFACETYPELABEL_X_DSL InterfaceTypeLabel = "xDSL" + INTERFACETYPELABEL_DOCSIS InterfaceTypeLabel = "DOCSIS" + INTERFACETYPELABEL_GPON__2_5_GBPS___1_25_GPS InterfaceTypeLabel = "GPON (2.5 Gbps / 1.25 Gps)" + INTERFACETYPELABEL_XG_PON__10_GBPS___2_5_GBPS InterfaceTypeLabel = "XG-PON (10 Gbps / 2.5 Gbps)" + INTERFACETYPELABEL_XGS_PON__10_GBPS InterfaceTypeLabel = "XGS-PON (10 Gbps)" + INTERFACETYPELABEL_NG_PON2__TWDM_PON__4X10_GBPS InterfaceTypeLabel = "NG-PON2 (TWDM-PON) (4x10 Gbps)" + INTERFACETYPELABEL_EPON__1_GBPS InterfaceTypeLabel = "EPON (1 Gbps)" + INTERFACETYPELABEL__10_G_EPON__10_GBPS InterfaceTypeLabel = "10G-EPON (10 Gbps)" + INTERFACETYPELABEL_CISCO_STACK_WISE InterfaceTypeLabel = "Cisco StackWise" + INTERFACETYPELABEL_CISCO_STACK_WISE_PLUS InterfaceTypeLabel = "Cisco StackWise Plus" + INTERFACETYPELABEL_CISCO_FLEX_STACK InterfaceTypeLabel = "Cisco FlexStack" + INTERFACETYPELABEL_CISCO_FLEX_STACK_PLUS InterfaceTypeLabel = "Cisco FlexStack Plus" + INTERFACETYPELABEL_CISCO_STACK_WISE_80 InterfaceTypeLabel = "Cisco StackWise-80" + INTERFACETYPELABEL_CISCO_STACK_WISE_160 InterfaceTypeLabel = "Cisco StackWise-160" + INTERFACETYPELABEL_CISCO_STACK_WISE_320 InterfaceTypeLabel = "Cisco StackWise-320" + INTERFACETYPELABEL_CISCO_STACK_WISE_480 InterfaceTypeLabel = "Cisco StackWise-480" + INTERFACETYPELABEL_CISCO_STACK_WISE_1_T InterfaceTypeLabel = "Cisco StackWise-1T" + INTERFACETYPELABEL_JUNIPER_VCP InterfaceTypeLabel = "Juniper VCP" + INTERFACETYPELABEL_EXTREME_SUMMIT_STACK InterfaceTypeLabel = "Extreme SummitStack" + INTERFACETYPELABEL_EXTREME_SUMMIT_STACK_128 InterfaceTypeLabel = "Extreme SummitStack-128" + INTERFACETYPELABEL_EXTREME_SUMMIT_STACK_256 InterfaceTypeLabel = "Extreme SummitStack-256" + INTERFACETYPELABEL_EXTREME_SUMMIT_STACK_512 InterfaceTypeLabel = "Extreme SummitStack-512" + INTERFACETYPELABEL_OTHER InterfaceTypeLabel = "Other" +) + +// All allowed values of InterfaceTypeLabel enum +var AllowedInterfaceTypeLabelEnumValues = []InterfaceTypeLabel{ + "Virtual", + "Bridge", + "Link Aggregation Group (LAG)", + "100BASE-FX (10/100ME FIBER)", + "100BASE-LFX (10/100ME FIBER)", + "100BASE-TX (10/100ME)", + "100BASE-T1 (10/100ME Single Pair)", + "1000BASE-T (1GE)", + "2.5GBASE-T (2.5GE)", + "5GBASE-T (5GE)", + "10GBASE-T (10GE)", + "10GBASE-CX4 (10GE)", + "GBIC (1GE)", + "SFP (1GE)", + "SFP+ (10GE)", + "XFP (10GE)", + "XENPAK (10GE)", + "X2 (10GE)", + "SFP28 (25GE)", + "SFP56 (50GE)", + "QSFP+ (40GE)", + "QSFP28 (50GE)", + "CFP (100GE)", + "CFP2 (100GE)", + "CFP2 (200GE)", + "CFP2 (400GE)", + "CFP4 (100GE)", + "CXP (100GE)", + "Cisco CPAK (100GE)", + "DSFP (100GE)", + "SFP-DD (100GE)", + "QSFP28 (100GE)", + "QSFP-DD (100GE)", + "QSFP56 (200GE)", + "QSFP-DD (200GE)", + "QSFP112 (400GE)", + "QSFP-DD (400GE)", + "OSFP (400GE)", + "OSFP-RHS (400GE)", + "CDFP (400GE)", + "CPF8 (400GE)", + "QSFP-DD (800GE)", + "OSFP (800GE)", + "1000BASE-KX (1GE)", + "10GBASE-KR (10GE)", + "10GBASE-KX4 (10GE)", + "25GBASE-KR (25GE)", + "40GBASE-KR4 (40GE)", + "50GBASE-KR (50GE)", + "100GBASE-KP4 (100GE)", + "100GBASE-KR2 (100GE)", + "100GBASE-KR4 (100GE)", + "IEEE 802.11a", + "IEEE 802.11b/g", + "IEEE 802.11n", + "IEEE 802.11ac", + "IEEE 802.11ad", + "IEEE 802.11ax", + "IEEE 802.11ay", + "IEEE 802.15.1 (Bluetooth)", + "Other (Wireless)", + "GSM", + "CDMA", + "LTE", + "OC-3/STM-1", + "OC-12/STM-4", + "OC-48/STM-16", + "OC-192/STM-64", + "OC-768/STM-256", + "OC-1920/STM-640", + "OC-3840/STM-1234", + "SFP (1GFC)", + "SFP (2GFC)", + "SFP (4GFC)", + "SFP+ (8GFC)", + "SFP+ (16GFC)", + "SFP28 (32GFC)", + "QSFP+ (64GFC)", + "QSFP28 (128GFC)", + "SDR (2 Gbps)", + "DDR (4 Gbps)", + "QDR (8 Gbps)", + "FDR10 (10 Gbps)", + "FDR (13.5 Gbps)", + "EDR (25 Gbps)", + "HDR (50 Gbps)", + "NDR (100 Gbps)", + "XDR (250 Gbps)", + "T1 (1.544 Mbps)", + "E1 (2.048 Mbps)", + "T3 (45 Mbps)", + "E3 (34 Mbps)", + "xDSL", + "DOCSIS", + "GPON (2.5 Gbps / 1.25 Gps)", + "XG-PON (10 Gbps / 2.5 Gbps)", + "XGS-PON (10 Gbps)", + "NG-PON2 (TWDM-PON) (4x10 Gbps)", + "EPON (1 Gbps)", + "10G-EPON (10 Gbps)", + "Cisco StackWise", + "Cisco StackWise Plus", + "Cisco FlexStack", + "Cisco FlexStack Plus", + "Cisco StackWise-80", + "Cisco StackWise-160", + "Cisco StackWise-320", + "Cisco StackWise-480", + "Cisco StackWise-1T", + "Juniper VCP", + "Extreme SummitStack", + "Extreme SummitStack-128", + "Extreme SummitStack-256", + "Extreme SummitStack-512", + "Other", +} + +func (v *InterfaceTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceTypeLabel(value) + for _, existing := range AllowedInterfaceTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceTypeLabel", value) +} + +// NewInterfaceTypeLabelFromValue returns a pointer to a valid InterfaceTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceTypeLabelFromValue(v string) (*InterfaceTypeLabel, error) { + ev := InterfaceTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceTypeLabel: valid values are %v", v, AllowedInterfaceTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceTypeLabel) IsValid() bool { + for _, existing := range AllowedInterfaceTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_type_label value +func (v InterfaceTypeLabel) Ptr() *InterfaceTypeLabel { + return &v +} + +type NullableInterfaceTypeLabel struct { + value *InterfaceTypeLabel + isSet bool +} + +func (v NullableInterfaceTypeLabel) Get() *InterfaceTypeLabel { + return v.value +} + +func (v *NullableInterfaceTypeLabel) Set(val *InterfaceTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTypeLabel(val *InterfaceTypeLabel) *NullableInterfaceTypeLabel { + return &NullableInterfaceTypeLabel{value: val, isSet: true} +} + +func (v NullableInterfaceTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type_value.go new file mode 100644 index 00000000..1f924ced --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_interface_type_value.go @@ -0,0 +1,336 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// InterfaceTypeValue * `virtual` - Virtual * `bridge` - Bridge * `lag` - Link Aggregation Group (LAG) * `100base-fx` - 100BASE-FX (10/100ME FIBER) * `100base-lfx` - 100BASE-LFX (10/100ME FIBER) * `100base-tx` - 100BASE-TX (10/100ME) * `100base-t1` - 100BASE-T1 (10/100ME Single Pair) * `1000base-t` - 1000BASE-T (1GE) * `2.5gbase-t` - 2.5GBASE-T (2.5GE) * `5gbase-t` - 5GBASE-T (5GE) * `10gbase-t` - 10GBASE-T (10GE) * `10gbase-cx4` - 10GBASE-CX4 (10GE) * `1000base-x-gbic` - GBIC (1GE) * `1000base-x-sfp` - SFP (1GE) * `10gbase-x-sfpp` - SFP+ (10GE) * `10gbase-x-xfp` - XFP (10GE) * `10gbase-x-xenpak` - XENPAK (10GE) * `10gbase-x-x2` - X2 (10GE) * `25gbase-x-sfp28` - SFP28 (25GE) * `50gbase-x-sfp56` - SFP56 (50GE) * `40gbase-x-qsfpp` - QSFP+ (40GE) * `50gbase-x-sfp28` - QSFP28 (50GE) * `100gbase-x-cfp` - CFP (100GE) * `100gbase-x-cfp2` - CFP2 (100GE) * `200gbase-x-cfp2` - CFP2 (200GE) * `400gbase-x-cfp2` - CFP2 (400GE) * `100gbase-x-cfp4` - CFP4 (100GE) * `100gbase-x-cxp` - CXP (100GE) * `100gbase-x-cpak` - Cisco CPAK (100GE) * `100gbase-x-dsfp` - DSFP (100GE) * `100gbase-x-sfpdd` - SFP-DD (100GE) * `100gbase-x-qsfp28` - QSFP28 (100GE) * `100gbase-x-qsfpdd` - QSFP-DD (100GE) * `200gbase-x-qsfp56` - QSFP56 (200GE) * `200gbase-x-qsfpdd` - QSFP-DD (200GE) * `400gbase-x-qsfp112` - QSFP112 (400GE) * `400gbase-x-qsfpdd` - QSFP-DD (400GE) * `400gbase-x-osfp` - OSFP (400GE) * `400gbase-x-osfp-rhs` - OSFP-RHS (400GE) * `400gbase-x-cdfp` - CDFP (400GE) * `400gbase-x-cfp8` - CPF8 (400GE) * `800gbase-x-qsfpdd` - QSFP-DD (800GE) * `800gbase-x-osfp` - OSFP (800GE) * `1000base-kx` - 1000BASE-KX (1GE) * `10gbase-kr` - 10GBASE-KR (10GE) * `10gbase-kx4` - 10GBASE-KX4 (10GE) * `25gbase-kr` - 25GBASE-KR (25GE) * `40gbase-kr4` - 40GBASE-KR4 (40GE) * `50gbase-kr` - 50GBASE-KR (50GE) * `100gbase-kp4` - 100GBASE-KP4 (100GE) * `100gbase-kr2` - 100GBASE-KR2 (100GE) * `100gbase-kr4` - 100GBASE-KR4 (100GE) * `ieee802.11a` - IEEE 802.11a * `ieee802.11g` - IEEE 802.11b/g * `ieee802.11n` - IEEE 802.11n * `ieee802.11ac` - IEEE 802.11ac * `ieee802.11ad` - IEEE 802.11ad * `ieee802.11ax` - IEEE 802.11ax * `ieee802.11ay` - IEEE 802.11ay * `ieee802.15.1` - IEEE 802.15.1 (Bluetooth) * `other-wireless` - Other (Wireless) * `gsm` - GSM * `cdma` - CDMA * `lte` - LTE * `sonet-oc3` - OC-3/STM-1 * `sonet-oc12` - OC-12/STM-4 * `sonet-oc48` - OC-48/STM-16 * `sonet-oc192` - OC-192/STM-64 * `sonet-oc768` - OC-768/STM-256 * `sonet-oc1920` - OC-1920/STM-640 * `sonet-oc3840` - OC-3840/STM-1234 * `1gfc-sfp` - SFP (1GFC) * `2gfc-sfp` - SFP (2GFC) * `4gfc-sfp` - SFP (4GFC) * `8gfc-sfpp` - SFP+ (8GFC) * `16gfc-sfpp` - SFP+ (16GFC) * `32gfc-sfp28` - SFP28 (32GFC) * `64gfc-qsfpp` - QSFP+ (64GFC) * `128gfc-qsfp28` - QSFP28 (128GFC) * `infiniband-sdr` - SDR (2 Gbps) * `infiniband-ddr` - DDR (4 Gbps) * `infiniband-qdr` - QDR (8 Gbps) * `infiniband-fdr10` - FDR10 (10 Gbps) * `infiniband-fdr` - FDR (13.5 Gbps) * `infiniband-edr` - EDR (25 Gbps) * `infiniband-hdr` - HDR (50 Gbps) * `infiniband-ndr` - NDR (100 Gbps) * `infiniband-xdr` - XDR (250 Gbps) * `t1` - T1 (1.544 Mbps) * `e1` - E1 (2.048 Mbps) * `t3` - T3 (45 Mbps) * `e3` - E3 (34 Mbps) * `xdsl` - xDSL * `docsis` - DOCSIS * `gpon` - GPON (2.5 Gbps / 1.25 Gps) * `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps) * `xgs-pon` - XGS-PON (10 Gbps) * `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps) * `epon` - EPON (1 Gbps) * `10g-epon` - 10G-EPON (10 Gbps) * `cisco-stackwise` - Cisco StackWise * `cisco-stackwise-plus` - Cisco StackWise Plus * `cisco-flexstack` - Cisco FlexStack * `cisco-flexstack-plus` - Cisco FlexStack Plus * `cisco-stackwise-80` - Cisco StackWise-80 * `cisco-stackwise-160` - Cisco StackWise-160 * `cisco-stackwise-320` - Cisco StackWise-320 * `cisco-stackwise-480` - Cisco StackWise-480 * `cisco-stackwise-1t` - Cisco StackWise-1T * `juniper-vcp` - Juniper VCP * `extreme-summitstack` - Extreme SummitStack * `extreme-summitstack-128` - Extreme SummitStack-128 * `extreme-summitstack-256` - Extreme SummitStack-256 * `extreme-summitstack-512` - Extreme SummitStack-512 * `other` - Other +type InterfaceTypeValue string + +// List of Interface_type_value +const ( + INTERFACETYPEVALUE_VIRTUAL InterfaceTypeValue = "virtual" + INTERFACETYPEVALUE_BRIDGE InterfaceTypeValue = "bridge" + INTERFACETYPEVALUE_LAG InterfaceTypeValue = "lag" + INTERFACETYPEVALUE__100BASE_FX InterfaceTypeValue = "100base-fx" + INTERFACETYPEVALUE__100BASE_LFX InterfaceTypeValue = "100base-lfx" + INTERFACETYPEVALUE__100BASE_TX InterfaceTypeValue = "100base-tx" + INTERFACETYPEVALUE__100BASE_T1 InterfaceTypeValue = "100base-t1" + INTERFACETYPEVALUE__1000BASE_T InterfaceTypeValue = "1000base-t" + INTERFACETYPEVALUE__2_5GBASE_T InterfaceTypeValue = "2.5gbase-t" + INTERFACETYPEVALUE__5GBASE_T InterfaceTypeValue = "5gbase-t" + INTERFACETYPEVALUE__10GBASE_T InterfaceTypeValue = "10gbase-t" + INTERFACETYPEVALUE__10GBASE_CX4 InterfaceTypeValue = "10gbase-cx4" + INTERFACETYPEVALUE__1000BASE_X_GBIC InterfaceTypeValue = "1000base-x-gbic" + INTERFACETYPEVALUE__1000BASE_X_SFP InterfaceTypeValue = "1000base-x-sfp" + INTERFACETYPEVALUE__10GBASE_X_SFPP InterfaceTypeValue = "10gbase-x-sfpp" + INTERFACETYPEVALUE__10GBASE_X_XFP InterfaceTypeValue = "10gbase-x-xfp" + INTERFACETYPEVALUE__10GBASE_X_XENPAK InterfaceTypeValue = "10gbase-x-xenpak" + INTERFACETYPEVALUE__10GBASE_X_X2 InterfaceTypeValue = "10gbase-x-x2" + INTERFACETYPEVALUE__25GBASE_X_SFP28 InterfaceTypeValue = "25gbase-x-sfp28" + INTERFACETYPEVALUE__50GBASE_X_SFP56 InterfaceTypeValue = "50gbase-x-sfp56" + INTERFACETYPEVALUE__40GBASE_X_QSFPP InterfaceTypeValue = "40gbase-x-qsfpp" + INTERFACETYPEVALUE__50GBASE_X_SFP28 InterfaceTypeValue = "50gbase-x-sfp28" + INTERFACETYPEVALUE__100GBASE_X_CFP InterfaceTypeValue = "100gbase-x-cfp" + INTERFACETYPEVALUE__100GBASE_X_CFP2 InterfaceTypeValue = "100gbase-x-cfp2" + INTERFACETYPEVALUE__200GBASE_X_CFP2 InterfaceTypeValue = "200gbase-x-cfp2" + INTERFACETYPEVALUE__400GBASE_X_CFP2 InterfaceTypeValue = "400gbase-x-cfp2" + INTERFACETYPEVALUE__100GBASE_X_CFP4 InterfaceTypeValue = "100gbase-x-cfp4" + INTERFACETYPEVALUE__100GBASE_X_CXP InterfaceTypeValue = "100gbase-x-cxp" + INTERFACETYPEVALUE__100GBASE_X_CPAK InterfaceTypeValue = "100gbase-x-cpak" + INTERFACETYPEVALUE__100GBASE_X_DSFP InterfaceTypeValue = "100gbase-x-dsfp" + INTERFACETYPEVALUE__100GBASE_X_SFPDD InterfaceTypeValue = "100gbase-x-sfpdd" + INTERFACETYPEVALUE__100GBASE_X_QSFP28 InterfaceTypeValue = "100gbase-x-qsfp28" + INTERFACETYPEVALUE__100GBASE_X_QSFPDD InterfaceTypeValue = "100gbase-x-qsfpdd" + INTERFACETYPEVALUE__200GBASE_X_QSFP56 InterfaceTypeValue = "200gbase-x-qsfp56" + INTERFACETYPEVALUE__200GBASE_X_QSFPDD InterfaceTypeValue = "200gbase-x-qsfpdd" + INTERFACETYPEVALUE__400GBASE_X_QSFP112 InterfaceTypeValue = "400gbase-x-qsfp112" + INTERFACETYPEVALUE__400GBASE_X_QSFPDD InterfaceTypeValue = "400gbase-x-qsfpdd" + INTERFACETYPEVALUE__400GBASE_X_OSFP InterfaceTypeValue = "400gbase-x-osfp" + INTERFACETYPEVALUE__400GBASE_X_OSFP_RHS InterfaceTypeValue = "400gbase-x-osfp-rhs" + INTERFACETYPEVALUE__400GBASE_X_CDFP InterfaceTypeValue = "400gbase-x-cdfp" + INTERFACETYPEVALUE__400GBASE_X_CFP8 InterfaceTypeValue = "400gbase-x-cfp8" + INTERFACETYPEVALUE__800GBASE_X_QSFPDD InterfaceTypeValue = "800gbase-x-qsfpdd" + INTERFACETYPEVALUE__800GBASE_X_OSFP InterfaceTypeValue = "800gbase-x-osfp" + INTERFACETYPEVALUE__1000BASE_KX InterfaceTypeValue = "1000base-kx" + INTERFACETYPEVALUE__10GBASE_KR InterfaceTypeValue = "10gbase-kr" + INTERFACETYPEVALUE__10GBASE_KX4 InterfaceTypeValue = "10gbase-kx4" + INTERFACETYPEVALUE__25GBASE_KR InterfaceTypeValue = "25gbase-kr" + INTERFACETYPEVALUE__40GBASE_KR4 InterfaceTypeValue = "40gbase-kr4" + INTERFACETYPEVALUE__50GBASE_KR InterfaceTypeValue = "50gbase-kr" + INTERFACETYPEVALUE__100GBASE_KP4 InterfaceTypeValue = "100gbase-kp4" + INTERFACETYPEVALUE__100GBASE_KR2 InterfaceTypeValue = "100gbase-kr2" + INTERFACETYPEVALUE__100GBASE_KR4 InterfaceTypeValue = "100gbase-kr4" + INTERFACETYPEVALUE_IEEE802_11A InterfaceTypeValue = "ieee802.11a" + INTERFACETYPEVALUE_IEEE802_11G InterfaceTypeValue = "ieee802.11g" + INTERFACETYPEVALUE_IEEE802_11N InterfaceTypeValue = "ieee802.11n" + INTERFACETYPEVALUE_IEEE802_11AC InterfaceTypeValue = "ieee802.11ac" + INTERFACETYPEVALUE_IEEE802_11AD InterfaceTypeValue = "ieee802.11ad" + INTERFACETYPEVALUE_IEEE802_11AX InterfaceTypeValue = "ieee802.11ax" + INTERFACETYPEVALUE_IEEE802_11AY InterfaceTypeValue = "ieee802.11ay" + INTERFACETYPEVALUE_IEEE802_15_1 InterfaceTypeValue = "ieee802.15.1" + INTERFACETYPEVALUE_OTHER_WIRELESS InterfaceTypeValue = "other-wireless" + INTERFACETYPEVALUE_GSM InterfaceTypeValue = "gsm" + INTERFACETYPEVALUE_CDMA InterfaceTypeValue = "cdma" + INTERFACETYPEVALUE_LTE InterfaceTypeValue = "lte" + INTERFACETYPEVALUE_SONET_OC3 InterfaceTypeValue = "sonet-oc3" + INTERFACETYPEVALUE_SONET_OC12 InterfaceTypeValue = "sonet-oc12" + INTERFACETYPEVALUE_SONET_OC48 InterfaceTypeValue = "sonet-oc48" + INTERFACETYPEVALUE_SONET_OC192 InterfaceTypeValue = "sonet-oc192" + INTERFACETYPEVALUE_SONET_OC768 InterfaceTypeValue = "sonet-oc768" + INTERFACETYPEVALUE_SONET_OC1920 InterfaceTypeValue = "sonet-oc1920" + INTERFACETYPEVALUE_SONET_OC3840 InterfaceTypeValue = "sonet-oc3840" + INTERFACETYPEVALUE__1GFC_SFP InterfaceTypeValue = "1gfc-sfp" + INTERFACETYPEVALUE__2GFC_SFP InterfaceTypeValue = "2gfc-sfp" + INTERFACETYPEVALUE__4GFC_SFP InterfaceTypeValue = "4gfc-sfp" + INTERFACETYPEVALUE__8GFC_SFPP InterfaceTypeValue = "8gfc-sfpp" + INTERFACETYPEVALUE__16GFC_SFPP InterfaceTypeValue = "16gfc-sfpp" + INTERFACETYPEVALUE__32GFC_SFP28 InterfaceTypeValue = "32gfc-sfp28" + INTERFACETYPEVALUE__64GFC_QSFPP InterfaceTypeValue = "64gfc-qsfpp" + INTERFACETYPEVALUE__128GFC_QSFP28 InterfaceTypeValue = "128gfc-qsfp28" + INTERFACETYPEVALUE_INFINIBAND_SDR InterfaceTypeValue = "infiniband-sdr" + INTERFACETYPEVALUE_INFINIBAND_DDR InterfaceTypeValue = "infiniband-ddr" + INTERFACETYPEVALUE_INFINIBAND_QDR InterfaceTypeValue = "infiniband-qdr" + INTERFACETYPEVALUE_INFINIBAND_FDR10 InterfaceTypeValue = "infiniband-fdr10" + INTERFACETYPEVALUE_INFINIBAND_FDR InterfaceTypeValue = "infiniband-fdr" + INTERFACETYPEVALUE_INFINIBAND_EDR InterfaceTypeValue = "infiniband-edr" + INTERFACETYPEVALUE_INFINIBAND_HDR InterfaceTypeValue = "infiniband-hdr" + INTERFACETYPEVALUE_INFINIBAND_NDR InterfaceTypeValue = "infiniband-ndr" + INTERFACETYPEVALUE_INFINIBAND_XDR InterfaceTypeValue = "infiniband-xdr" + INTERFACETYPEVALUE_T1 InterfaceTypeValue = "t1" + INTERFACETYPEVALUE_E1 InterfaceTypeValue = "e1" + INTERFACETYPEVALUE_T3 InterfaceTypeValue = "t3" + INTERFACETYPEVALUE_E3 InterfaceTypeValue = "e3" + INTERFACETYPEVALUE_XDSL InterfaceTypeValue = "xdsl" + INTERFACETYPEVALUE_DOCSIS InterfaceTypeValue = "docsis" + INTERFACETYPEVALUE_GPON InterfaceTypeValue = "gpon" + INTERFACETYPEVALUE_XG_PON InterfaceTypeValue = "xg-pon" + INTERFACETYPEVALUE_XGS_PON InterfaceTypeValue = "xgs-pon" + INTERFACETYPEVALUE_NG_PON2 InterfaceTypeValue = "ng-pon2" + INTERFACETYPEVALUE_EPON InterfaceTypeValue = "epon" + INTERFACETYPEVALUE__10G_EPON InterfaceTypeValue = "10g-epon" + INTERFACETYPEVALUE_CISCO_STACKWISE InterfaceTypeValue = "cisco-stackwise" + INTERFACETYPEVALUE_CISCO_STACKWISE_PLUS InterfaceTypeValue = "cisco-stackwise-plus" + INTERFACETYPEVALUE_CISCO_FLEXSTACK InterfaceTypeValue = "cisco-flexstack" + INTERFACETYPEVALUE_CISCO_FLEXSTACK_PLUS InterfaceTypeValue = "cisco-flexstack-plus" + INTERFACETYPEVALUE_CISCO_STACKWISE_80 InterfaceTypeValue = "cisco-stackwise-80" + INTERFACETYPEVALUE_CISCO_STACKWISE_160 InterfaceTypeValue = "cisco-stackwise-160" + INTERFACETYPEVALUE_CISCO_STACKWISE_320 InterfaceTypeValue = "cisco-stackwise-320" + INTERFACETYPEVALUE_CISCO_STACKWISE_480 InterfaceTypeValue = "cisco-stackwise-480" + INTERFACETYPEVALUE_CISCO_STACKWISE_1T InterfaceTypeValue = "cisco-stackwise-1t" + INTERFACETYPEVALUE_JUNIPER_VCP InterfaceTypeValue = "juniper-vcp" + INTERFACETYPEVALUE_EXTREME_SUMMITSTACK InterfaceTypeValue = "extreme-summitstack" + INTERFACETYPEVALUE_EXTREME_SUMMITSTACK_128 InterfaceTypeValue = "extreme-summitstack-128" + INTERFACETYPEVALUE_EXTREME_SUMMITSTACK_256 InterfaceTypeValue = "extreme-summitstack-256" + INTERFACETYPEVALUE_EXTREME_SUMMITSTACK_512 InterfaceTypeValue = "extreme-summitstack-512" + INTERFACETYPEVALUE_OTHER InterfaceTypeValue = "other" +) + +// All allowed values of InterfaceTypeValue enum +var AllowedInterfaceTypeValueEnumValues = []InterfaceTypeValue{ + "virtual", + "bridge", + "lag", + "100base-fx", + "100base-lfx", + "100base-tx", + "100base-t1", + "1000base-t", + "2.5gbase-t", + "5gbase-t", + "10gbase-t", + "10gbase-cx4", + "1000base-x-gbic", + "1000base-x-sfp", + "10gbase-x-sfpp", + "10gbase-x-xfp", + "10gbase-x-xenpak", + "10gbase-x-x2", + "25gbase-x-sfp28", + "50gbase-x-sfp56", + "40gbase-x-qsfpp", + "50gbase-x-sfp28", + "100gbase-x-cfp", + "100gbase-x-cfp2", + "200gbase-x-cfp2", + "400gbase-x-cfp2", + "100gbase-x-cfp4", + "100gbase-x-cxp", + "100gbase-x-cpak", + "100gbase-x-dsfp", + "100gbase-x-sfpdd", + "100gbase-x-qsfp28", + "100gbase-x-qsfpdd", + "200gbase-x-qsfp56", + "200gbase-x-qsfpdd", + "400gbase-x-qsfp112", + "400gbase-x-qsfpdd", + "400gbase-x-osfp", + "400gbase-x-osfp-rhs", + "400gbase-x-cdfp", + "400gbase-x-cfp8", + "800gbase-x-qsfpdd", + "800gbase-x-osfp", + "1000base-kx", + "10gbase-kr", + "10gbase-kx4", + "25gbase-kr", + "40gbase-kr4", + "50gbase-kr", + "100gbase-kp4", + "100gbase-kr2", + "100gbase-kr4", + "ieee802.11a", + "ieee802.11g", + "ieee802.11n", + "ieee802.11ac", + "ieee802.11ad", + "ieee802.11ax", + "ieee802.11ay", + "ieee802.15.1", + "other-wireless", + "gsm", + "cdma", + "lte", + "sonet-oc3", + "sonet-oc12", + "sonet-oc48", + "sonet-oc192", + "sonet-oc768", + "sonet-oc1920", + "sonet-oc3840", + "1gfc-sfp", + "2gfc-sfp", + "4gfc-sfp", + "8gfc-sfpp", + "16gfc-sfpp", + "32gfc-sfp28", + "64gfc-qsfpp", + "128gfc-qsfp28", + "infiniband-sdr", + "infiniband-ddr", + "infiniband-qdr", + "infiniband-fdr10", + "infiniband-fdr", + "infiniband-edr", + "infiniband-hdr", + "infiniband-ndr", + "infiniband-xdr", + "t1", + "e1", + "t3", + "e3", + "xdsl", + "docsis", + "gpon", + "xg-pon", + "xgs-pon", + "ng-pon2", + "epon", + "10g-epon", + "cisco-stackwise", + "cisco-stackwise-plus", + "cisco-flexstack", + "cisco-flexstack-plus", + "cisco-stackwise-80", + "cisco-stackwise-160", + "cisco-stackwise-320", + "cisco-stackwise-480", + "cisco-stackwise-1t", + "juniper-vcp", + "extreme-summitstack", + "extreme-summitstack-128", + "extreme-summitstack-256", + "extreme-summitstack-512", + "other", +} + +func (v *InterfaceTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterfaceTypeValue(value) + for _, existing := range AllowedInterfaceTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterfaceTypeValue", value) +} + +// NewInterfaceTypeValueFromValue returns a pointer to a valid InterfaceTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterfaceTypeValueFromValue(v string) (*InterfaceTypeValue, error) { + ev := InterfaceTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterfaceTypeValue: valid values are %v", v, AllowedInterfaceTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterfaceTypeValue) IsValid() bool { + for _, existing := range AllowedInterfaceTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interface_type_value value +func (v InterfaceTypeValue) Ptr() *InterfaceTypeValue { + return &v +} + +type NullableInterfaceTypeValue struct { + value *InterfaceTypeValue + isSet bool +} + +func (v NullableInterfaceTypeValue) Get() *InterfaceTypeValue { + return v.value +} + +func (v *NullableInterfaceTypeValue) Set(val *InterfaceTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceTypeValue(val *InterfaceTypeValue) *NullableInterfaceTypeValue { + return &NullableInterfaceTypeValue{value: val, isSet: true} +} + +func (v NullableInterfaceTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item.go b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item.go new file mode 100644 index 00000000..aa85f5df --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item.go @@ -0,0 +1,958 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the InventoryItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InventoryItem{} + +// InventoryItem Adds support for custom fields and tags. +type InventoryItem struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Parent NullableInt32 `json:"parent,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableNestedInventoryItemRole `json:"role,omitempty"` + Manufacturer NullableNestedManufacturer `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this item + AssetTag NullableString `json:"asset_tag,omitempty"` + // This item was automatically discovered + Discovered *bool `json:"discovered,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + Component interface{} `json:"component"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _InventoryItem InventoryItem + +// NewInventoryItem instantiates a new InventoryItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInventoryItem(id int32, url string, display string, device NestedDevice, name string, component interface{}, created NullableTime, lastUpdated NullableTime, depth int32) *InventoryItem { + this := InventoryItem{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Component = component + this.Created = created + this.LastUpdated = lastUpdated + this.Depth = depth + return &this +} + +// NewInventoryItemWithDefaults instantiates a new InventoryItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInventoryItemWithDefaults() *InventoryItem { + this := InventoryItem{} + return &this +} + +// GetId returns the Id field value +func (o *InventoryItem) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *InventoryItem) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *InventoryItem) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *InventoryItem) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *InventoryItem) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *InventoryItem) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *InventoryItem) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *InventoryItem) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItem) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *InventoryItem) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *InventoryItem) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *InventoryItem) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *InventoryItem) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value +func (o *InventoryItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InventoryItem) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InventoryItem) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InventoryItem) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InventoryItem) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItem) GetRole() NestedInventoryItemRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedInventoryItemRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetRoleOk() (*NestedInventoryItemRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *InventoryItem) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedInventoryItemRole and assigns it to the Role field. +func (o *InventoryItem) SetRole(v NestedInventoryItemRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *InventoryItem) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *InventoryItem) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItem) GetManufacturer() NestedManufacturer { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret NestedManufacturer + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetManufacturerOk() (*NestedManufacturer, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *InventoryItem) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableNestedManufacturer and assigns it to the Manufacturer field. +func (o *InventoryItem) SetManufacturer(v NestedManufacturer) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *InventoryItem) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *InventoryItem) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *InventoryItem) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *InventoryItem) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *InventoryItem) SetPartId(v string) { + o.PartId = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *InventoryItem) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *InventoryItem) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *InventoryItem) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItem) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *InventoryItem) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *InventoryItem) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *InventoryItem) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *InventoryItem) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDiscovered returns the Discovered field value if set, zero value otherwise. +func (o *InventoryItem) GetDiscovered() bool { + if o == nil || IsNil(o.Discovered) { + var ret bool + return ret + } + return *o.Discovered +} + +// GetDiscoveredOk returns a tuple with the Discovered field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetDiscoveredOk() (*bool, bool) { + if o == nil || IsNil(o.Discovered) { + return nil, false + } + return o.Discovered, true +} + +// HasDiscovered returns a boolean if a field has been set. +func (o *InventoryItem) HasDiscovered() bool { + if o != nil && !IsNil(o.Discovered) { + return true + } + + return false +} + +// SetDiscovered gets a reference to the given bool and assigns it to the Discovered field. +func (o *InventoryItem) SetDiscovered(v bool) { + o.Discovered = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InventoryItem) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InventoryItem) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InventoryItem) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItem) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *InventoryItem) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *InventoryItem) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *InventoryItem) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *InventoryItem) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItem) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *InventoryItem) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *InventoryItem) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *InventoryItem) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *InventoryItem) UnsetComponentId() { + o.ComponentId.Unset() +} + +// GetComponent returns the Component field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *InventoryItem) GetComponent() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetComponentOk() (*interface{}, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *InventoryItem) SetComponent(v interface{}) { + o.Component = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *InventoryItem) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *InventoryItem) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *InventoryItem) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *InventoryItem) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *InventoryItem) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *InventoryItem) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InventoryItem) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *InventoryItem) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InventoryItem) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItem) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *InventoryItem) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDepth returns the Depth field value +func (o *InventoryItem) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *InventoryItem) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *InventoryItem) SetDepth(v int32) { + o.Depth = v +} + +func (o InventoryItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InventoryItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Discovered) { + toSerialize["discovered"] = o.Discovered + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + if o.Component != nil { + toSerialize["component"] = o.Component + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InventoryItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "component", + "created", + "last_updated", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInventoryItem := _InventoryItem{} + + err = json.Unmarshal(data, &varInventoryItem) + + if err != nil { + return err + } + + *o = InventoryItem(varInventoryItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "discovered") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + delete(additionalProperties, "component") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInventoryItem struct { + value *InventoryItem + isSet bool +} + +func (v NullableInventoryItem) Get() *InventoryItem { + return v.value +} + +func (v *NullableInventoryItem) Set(val *InventoryItem) { + v.value = val + v.isSet = true +} + +func (v NullableInventoryItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInventoryItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInventoryItem(val *InventoryItem) *NullableInventoryItem { + return &NullableInventoryItem{value: val, isSet: true} +} + +func (v NullableInventoryItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInventoryItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_request.go new file mode 100644 index 00000000..5aa53f93 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_request.go @@ -0,0 +1,746 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the InventoryItemRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InventoryItemRequest{} + +// InventoryItemRequest Adds support for custom fields and tags. +type InventoryItemRequest struct { + Device NestedDeviceRequest `json:"device"` + Parent NullableInt32 `json:"parent,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableNestedInventoryItemRoleRequest `json:"role,omitempty"` + Manufacturer NullableNestedManufacturerRequest `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this item + AssetTag NullableString `json:"asset_tag,omitempty"` + // This item was automatically discovered + Discovered *bool `json:"discovered,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InventoryItemRequest InventoryItemRequest + +// NewInventoryItemRequest instantiates a new InventoryItemRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInventoryItemRequest(device NestedDeviceRequest, name string) *InventoryItemRequest { + this := InventoryItemRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewInventoryItemRequestWithDefaults instantiates a new InventoryItemRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInventoryItemRequestWithDefaults() *InventoryItemRequest { + this := InventoryItemRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *InventoryItemRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *InventoryItemRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *InventoryItemRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *InventoryItemRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *InventoryItemRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value +func (o *InventoryItemRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InventoryItemRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InventoryItemRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InventoryItemRequest) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemRequest) GetRole() NestedInventoryItemRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedInventoryItemRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRequest) GetRoleOk() (*NestedInventoryItemRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedInventoryItemRoleRequest and assigns it to the Role field. +func (o *InventoryItemRequest) SetRole(v NestedInventoryItemRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *InventoryItemRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *InventoryItemRequest) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemRequest) GetManufacturer() NestedManufacturerRequest { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret NestedManufacturerRequest + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRequest) GetManufacturerOk() (*NestedManufacturerRequest, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableNestedManufacturerRequest and assigns it to the Manufacturer field. +func (o *InventoryItemRequest) SetManufacturer(v NestedManufacturerRequest) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *InventoryItemRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *InventoryItemRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *InventoryItemRequest) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *InventoryItemRequest) SetPartId(v string) { + o.PartId = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *InventoryItemRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *InventoryItemRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *InventoryItemRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *InventoryItemRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *InventoryItemRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDiscovered returns the Discovered field value if set, zero value otherwise. +func (o *InventoryItemRequest) GetDiscovered() bool { + if o == nil || IsNil(o.Discovered) { + var ret bool + return ret + } + return *o.Discovered +} + +// GetDiscoveredOk returns a tuple with the Discovered field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetDiscoveredOk() (*bool, bool) { + if o == nil || IsNil(o.Discovered) { + return nil, false + } + return o.Discovered, true +} + +// HasDiscovered returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasDiscovered() bool { + if o != nil && !IsNil(o.Discovered) { + return true + } + + return false +} + +// SetDiscovered gets a reference to the given bool and assigns it to the Discovered field. +func (o *InventoryItemRequest) SetDiscovered(v bool) { + o.Discovered = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InventoryItemRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InventoryItemRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemRequest) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRequest) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *InventoryItemRequest) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *InventoryItemRequest) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *InventoryItemRequest) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemRequest) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRequest) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *InventoryItemRequest) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *InventoryItemRequest) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *InventoryItemRequest) UnsetComponentId() { + o.ComponentId.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *InventoryItemRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *InventoryItemRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *InventoryItemRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *InventoryItemRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *InventoryItemRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o InventoryItemRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InventoryItemRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Discovered) { + toSerialize["discovered"] = o.Discovered + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InventoryItemRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInventoryItemRequest := _InventoryItemRequest{} + + err = json.Unmarshal(data, &varInventoryItemRequest) + + if err != nil { + return err + } + + *o = InventoryItemRequest(varInventoryItemRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "discovered") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInventoryItemRequest struct { + value *InventoryItemRequest + isSet bool +} + +func (v NullableInventoryItemRequest) Get() *InventoryItemRequest { + return v.value +} + +func (v *NullableInventoryItemRequest) Set(val *InventoryItemRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInventoryItemRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInventoryItemRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInventoryItemRequest(val *InventoryItemRequest) *NullableInventoryItemRequest { + return &NullableInventoryItemRequest{value: val, isSet: true} +} + +func (v NullableInventoryItemRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInventoryItemRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_role.go new file mode 100644 index 00000000..b906ca18 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_role.go @@ -0,0 +1,522 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the InventoryItemRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InventoryItemRole{} + +// InventoryItemRole Adds support for custom fields and tags. +type InventoryItemRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + InventoryitemCount int32 `json:"inventoryitem_count"` + AdditionalProperties map[string]interface{} +} + +type _InventoryItemRole InventoryItemRole + +// NewInventoryItemRole instantiates a new InventoryItemRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInventoryItemRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, inventoryitemCount int32) *InventoryItemRole { + this := InventoryItemRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.InventoryitemCount = inventoryitemCount + return &this +} + +// NewInventoryItemRoleWithDefaults instantiates a new InventoryItemRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInventoryItemRoleWithDefaults() *InventoryItemRole { + this := InventoryItemRole{} + return &this +} + +// GetId returns the Id field value +func (o *InventoryItemRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *InventoryItemRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *InventoryItemRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *InventoryItemRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *InventoryItemRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *InventoryItemRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *InventoryItemRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InventoryItemRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *InventoryItemRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *InventoryItemRole) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *InventoryItemRole) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *InventoryItemRole) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *InventoryItemRole) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InventoryItemRole) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InventoryItemRole) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InventoryItemRole) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *InventoryItemRole) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *InventoryItemRole) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *InventoryItemRole) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *InventoryItemRole) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *InventoryItemRole) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *InventoryItemRole) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InventoryItemRole) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRole) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *InventoryItemRole) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InventoryItemRole) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemRole) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *InventoryItemRole) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetInventoryitemCount returns the InventoryitemCount field value +func (o *InventoryItemRole) GetInventoryitemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InventoryitemCount +} + +// GetInventoryitemCountOk returns a tuple with the InventoryitemCount field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRole) GetInventoryitemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InventoryitemCount, true +} + +// SetInventoryitemCount sets field value +func (o *InventoryItemRole) SetInventoryitemCount(v int32) { + o.InventoryitemCount = v +} + +func (o InventoryItemRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InventoryItemRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["inventoryitem_count"] = o.InventoryitemCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InventoryItemRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "inventoryitem_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInventoryItemRole := _InventoryItemRole{} + + err = json.Unmarshal(data, &varInventoryItemRole) + + if err != nil { + return err + } + + *o = InventoryItemRole(varInventoryItemRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "inventoryitem_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInventoryItemRole struct { + value *InventoryItemRole + isSet bool +} + +func (v NullableInventoryItemRole) Get() *InventoryItemRole { + return v.value +} + +func (v *NullableInventoryItemRole) Set(val *InventoryItemRole) { + v.value = val + v.isSet = true +} + +func (v NullableInventoryItemRole) IsSet() bool { + return v.isSet +} + +func (v *NullableInventoryItemRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInventoryItemRole(val *InventoryItemRole) *NullableInventoryItemRole { + return &NullableInventoryItemRole{value: val, isSet: true} +} + +func (v NullableInventoryItemRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInventoryItemRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_role_request.go new file mode 100644 index 00000000..1cce0782 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_role_request.go @@ -0,0 +1,343 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the InventoryItemRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InventoryItemRoleRequest{} + +// InventoryItemRoleRequest Adds support for custom fields and tags. +type InventoryItemRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InventoryItemRoleRequest InventoryItemRoleRequest + +// NewInventoryItemRoleRequest instantiates a new InventoryItemRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInventoryItemRoleRequest(name string, slug string) *InventoryItemRoleRequest { + this := InventoryItemRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewInventoryItemRoleRequestWithDefaults instantiates a new InventoryItemRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInventoryItemRoleRequestWithDefaults() *InventoryItemRoleRequest { + this := InventoryItemRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *InventoryItemRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InventoryItemRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *InventoryItemRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *InventoryItemRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *InventoryItemRoleRequest) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *InventoryItemRoleRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRoleRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *InventoryItemRoleRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *InventoryItemRoleRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InventoryItemRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InventoryItemRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InventoryItemRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *InventoryItemRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *InventoryItemRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *InventoryItemRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *InventoryItemRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *InventoryItemRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *InventoryItemRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o InventoryItemRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InventoryItemRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InventoryItemRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInventoryItemRoleRequest := _InventoryItemRoleRequest{} + + err = json.Unmarshal(data, &varInventoryItemRoleRequest) + + if err != nil { + return err + } + + *o = InventoryItemRoleRequest(varInventoryItemRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInventoryItemRoleRequest struct { + value *InventoryItemRoleRequest + isSet bool +} + +func (v NullableInventoryItemRoleRequest) Get() *InventoryItemRoleRequest { + return v.value +} + +func (v *NullableInventoryItemRoleRequest) Set(val *InventoryItemRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInventoryItemRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInventoryItemRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInventoryItemRoleRequest(val *InventoryItemRoleRequest) *NullableInventoryItemRoleRequest { + return &NullableInventoryItemRoleRequest{value: val, isSet: true} +} + +func (v NullableInventoryItemRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInventoryItemRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_template.go new file mode 100644 index 00000000..a872796e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_template.go @@ -0,0 +1,761 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the InventoryItemTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InventoryItemTemplate{} + +// InventoryItemTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type InventoryItemTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NestedDeviceType `json:"device_type"` + Parent NullableInt32 `json:"parent,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableNestedInventoryItemRole `json:"role,omitempty"` + Manufacturer NullableNestedManufacturer `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + Component interface{} `json:"component"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _InventoryItemTemplate InventoryItemTemplate + +// NewInventoryItemTemplate instantiates a new InventoryItemTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInventoryItemTemplate(id int32, url string, display string, deviceType NestedDeviceType, name string, component interface{}, created NullableTime, lastUpdated NullableTime, depth int32) *InventoryItemTemplate { + this := InventoryItemTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.DeviceType = deviceType + this.Name = name + this.Component = component + this.Created = created + this.LastUpdated = lastUpdated + this.Depth = depth + return &this +} + +// NewInventoryItemTemplateWithDefaults instantiates a new InventoryItemTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInventoryItemTemplateWithDefaults() *InventoryItemTemplate { + this := InventoryItemTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *InventoryItemTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *InventoryItemTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *InventoryItemTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *InventoryItemTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *InventoryItemTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *InventoryItemTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value +func (o *InventoryItemTemplate) GetDeviceType() NestedDeviceType { + if o == nil { + var ret NestedDeviceType + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *InventoryItemTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplate) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *InventoryItemTemplate) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *InventoryItemTemplate) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *InventoryItemTemplate) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value +func (o *InventoryItemTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InventoryItemTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InventoryItemTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InventoryItemTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplate) GetRole() NestedInventoryItemRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedInventoryItemRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetRoleOk() (*NestedInventoryItemRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedInventoryItemRole and assigns it to the Role field. +func (o *InventoryItemTemplate) SetRole(v NestedInventoryItemRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *InventoryItemTemplate) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *InventoryItemTemplate) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplate) GetManufacturer() NestedManufacturer { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret NestedManufacturer + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetManufacturerOk() (*NestedManufacturer, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableNestedManufacturer and assigns it to the Manufacturer field. +func (o *InventoryItemTemplate) SetManufacturer(v NestedManufacturer) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *InventoryItemTemplate) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *InventoryItemTemplate) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *InventoryItemTemplate) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *InventoryItemTemplate) SetPartId(v string) { + o.PartId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InventoryItemTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InventoryItemTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplate) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *InventoryItemTemplate) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *InventoryItemTemplate) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *InventoryItemTemplate) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplate) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *InventoryItemTemplate) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *InventoryItemTemplate) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *InventoryItemTemplate) UnsetComponentId() { + o.ComponentId.Unset() +} + +// GetComponent returns the Component field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *InventoryItemTemplate) GetComponent() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetComponentOk() (*interface{}, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *InventoryItemTemplate) SetComponent(v interface{}) { + o.Component = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InventoryItemTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *InventoryItemTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *InventoryItemTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *InventoryItemTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDepth returns the Depth field value +func (o *InventoryItemTemplate) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplate) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *InventoryItemTemplate) SetDepth(v int32) { + o.Depth = v +} + +func (o InventoryItemTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InventoryItemTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device_type"] = o.DeviceType + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + if o.Component != nil { + toSerialize["component"] = o.Component + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InventoryItemTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device_type", + "name", + "component", + "created", + "last_updated", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInventoryItemTemplate := _InventoryItemTemplate{} + + err = json.Unmarshal(data, &varInventoryItemTemplate) + + if err != nil { + return err + } + + *o = InventoryItemTemplate(varInventoryItemTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + delete(additionalProperties, "component") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInventoryItemTemplate struct { + value *InventoryItemTemplate + isSet bool +} + +func (v NullableInventoryItemTemplate) Get() *InventoryItemTemplate { + return v.value +} + +func (v *NullableInventoryItemTemplate) Set(val *InventoryItemTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableInventoryItemTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableInventoryItemTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInventoryItemTemplate(val *InventoryItemTemplate) *NullableInventoryItemTemplate { + return &NullableInventoryItemTemplate{value: val, isSet: true} +} + +func (v NullableInventoryItemTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInventoryItemTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_template_request.go new file mode 100644 index 00000000..2ad0be55 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_inventory_item_template_request.go @@ -0,0 +1,549 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the InventoryItemTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InventoryItemTemplateRequest{} + +// InventoryItemTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type InventoryItemTemplateRequest struct { + DeviceType NestedDeviceTypeRequest `json:"device_type"` + Parent NullableInt32 `json:"parent,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableNestedInventoryItemRoleRequest `json:"role,omitempty"` + Manufacturer NullableNestedManufacturerRequest `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InventoryItemTemplateRequest InventoryItemTemplateRequest + +// NewInventoryItemTemplateRequest instantiates a new InventoryItemTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInventoryItemTemplateRequest(deviceType NestedDeviceTypeRequest, name string) *InventoryItemTemplateRequest { + this := InventoryItemTemplateRequest{} + this.DeviceType = deviceType + this.Name = name + return &this +} + +// NewInventoryItemTemplateRequestWithDefaults instantiates a new InventoryItemTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInventoryItemTemplateRequestWithDefaults() *InventoryItemTemplateRequest { + this := InventoryItemTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value +func (o *InventoryItemTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil { + var ret NestedDeviceTypeRequest + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *InventoryItemTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplateRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplateRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *InventoryItemTemplateRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *InventoryItemTemplateRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *InventoryItemTemplateRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value +func (o *InventoryItemTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InventoryItemTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InventoryItemTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InventoryItemTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplateRequest) GetRole() NestedInventoryItemRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedInventoryItemRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplateRequest) GetRoleOk() (*NestedInventoryItemRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedInventoryItemRoleRequest and assigns it to the Role field. +func (o *InventoryItemTemplateRequest) SetRole(v NestedInventoryItemRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *InventoryItemTemplateRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *InventoryItemTemplateRequest) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplateRequest) GetManufacturer() NestedManufacturerRequest { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret NestedManufacturerRequest + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplateRequest) GetManufacturerOk() (*NestedManufacturerRequest, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableNestedManufacturerRequest and assigns it to the Manufacturer field. +func (o *InventoryItemTemplateRequest) SetManufacturer(v NestedManufacturerRequest) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *InventoryItemTemplateRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *InventoryItemTemplateRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *InventoryItemTemplateRequest) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplateRequest) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *InventoryItemTemplateRequest) SetPartId(v string) { + o.PartId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InventoryItemTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InventoryItemTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InventoryItemTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplateRequest) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplateRequest) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *InventoryItemTemplateRequest) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *InventoryItemTemplateRequest) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *InventoryItemTemplateRequest) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InventoryItemTemplateRequest) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InventoryItemTemplateRequest) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *InventoryItemTemplateRequest) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *InventoryItemTemplateRequest) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *InventoryItemTemplateRequest) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *InventoryItemTemplateRequest) UnsetComponentId() { + o.ComponentId.Unset() +} + +func (o InventoryItemTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InventoryItemTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_type"] = o.DeviceType + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InventoryItemTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInventoryItemTemplateRequest := _InventoryItemTemplateRequest{} + + err = json.Unmarshal(data, &varInventoryItemTemplateRequest) + + if err != nil { + return err + } + + *o = InventoryItemTemplateRequest(varInventoryItemTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInventoryItemTemplateRequest struct { + value *InventoryItemTemplateRequest + isSet bool +} + +func (v NullableInventoryItemTemplateRequest) Get() *InventoryItemTemplateRequest { + return v.value +} + +func (v *NullableInventoryItemTemplateRequest) Set(val *InventoryItemTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInventoryItemTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInventoryItemTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInventoryItemTemplateRequest(val *InventoryItemTemplateRequest) *NullableInventoryItemTemplateRequest { + return &NullableInventoryItemTemplateRequest{value: val, isSet: true} +} + +func (v NullableInventoryItemTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInventoryItemTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address.go new file mode 100644 index 00000000..a5249b03 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address.go @@ -0,0 +1,907 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IPAddress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAddress{} + +// IPAddress Adds support for custom fields and tags. +type IPAddress struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Family AggregateFamily `json:"family"` + Address string `json:"address"` + Vrf NullableNestedVRF `json:"vrf,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Status *IPAddressStatus `json:"status,omitempty"` + Role *IPAddressRole `json:"role,omitempty"` + AssignedObjectType NullableString `json:"assigned_object_type,omitempty"` + AssignedObjectId NullableInt64 `json:"assigned_object_id,omitempty"` + AssignedObject interface{} `json:"assigned_object"` + NatInside NullableNestedIPAddress `json:"nat_inside,omitempty"` + NatOutside []NestedIPAddress `json:"nat_outside"` + // Hostname or FQDN (not case-sensitive) + DnsName *string `json:"dns_name,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _IPAddress IPAddress + +// NewIPAddress instantiates a new IPAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAddress(id int32, url string, display string, family AggregateFamily, address string, assignedObject interface{}, natOutside []NestedIPAddress, created NullableTime, lastUpdated NullableTime) *IPAddress { + this := IPAddress{} + this.Id = id + this.Url = url + this.Display = display + this.Family = family + this.Address = address + this.AssignedObject = assignedObject + this.NatOutside = natOutside + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewIPAddressWithDefaults instantiates a new IPAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAddressWithDefaults() *IPAddress { + this := IPAddress{} + return &this +} + +// GetId returns the Id field value +func (o *IPAddress) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IPAddress) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *IPAddress) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *IPAddress) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *IPAddress) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *IPAddress) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *IPAddress) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *IPAddress) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *IPAddress) SetDisplay(v string) { + o.Display = v +} + +// GetFamily returns the Family field value +func (o *IPAddress) GetFamily() AggregateFamily { + if o == nil { + var ret AggregateFamily + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *IPAddress) GetFamilyOk() (*AggregateFamily, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *IPAddress) SetFamily(v AggregateFamily) { + o.Family = v +} + +// GetAddress returns the Address field value +func (o *IPAddress) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *IPAddress) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *IPAddress) SetAddress(v string) { + o.Address = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddress) GetVrf() NestedVRF { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRF + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetVrfOk() (*NestedVRF, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *IPAddress) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRF and assigns it to the Vrf field. +func (o *IPAddress) SetVrf(v NestedVRF) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *IPAddress) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *IPAddress) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddress) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *IPAddress) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *IPAddress) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *IPAddress) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *IPAddress) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *IPAddress) GetStatus() IPAddressStatus { + if o == nil || IsNil(o.Status) { + var ret IPAddressStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetStatusOk() (*IPAddressStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *IPAddress) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given IPAddressStatus and assigns it to the Status field. +func (o *IPAddress) SetStatus(v IPAddressStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *IPAddress) GetRole() IPAddressRole { + if o == nil || IsNil(o.Role) { + var ret IPAddressRole + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetRoleOk() (*IPAddressRole, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *IPAddress) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given IPAddressRole and assigns it to the Role field. +func (o *IPAddress) SetRole(v IPAddressRole) { + o.Role = &v +} + +// GetAssignedObjectType returns the AssignedObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddress) GetAssignedObjectType() string { + if o == nil || IsNil(o.AssignedObjectType.Get()) { + var ret string + return ret + } + return *o.AssignedObjectType.Get() +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectType.Get(), o.AssignedObjectType.IsSet() +} + +// HasAssignedObjectType returns a boolean if a field has been set. +func (o *IPAddress) HasAssignedObjectType() bool { + if o != nil && o.AssignedObjectType.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectType gets a reference to the given NullableString and assigns it to the AssignedObjectType field. +func (o *IPAddress) SetAssignedObjectType(v string) { + o.AssignedObjectType.Set(&v) +} + +// SetAssignedObjectTypeNil sets the value for AssignedObjectType to be an explicit nil +func (o *IPAddress) SetAssignedObjectTypeNil() { + o.AssignedObjectType.Set(nil) +} + +// UnsetAssignedObjectType ensures that no value is present for AssignedObjectType, not even an explicit nil +func (o *IPAddress) UnsetAssignedObjectType() { + o.AssignedObjectType.Unset() +} + +// GetAssignedObjectId returns the AssignedObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddress) GetAssignedObjectId() int64 { + if o == nil || IsNil(o.AssignedObjectId.Get()) { + var ret int64 + return ret + } + return *o.AssignedObjectId.Get() +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectId.Get(), o.AssignedObjectId.IsSet() +} + +// HasAssignedObjectId returns a boolean if a field has been set. +func (o *IPAddress) HasAssignedObjectId() bool { + if o != nil && o.AssignedObjectId.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectId gets a reference to the given NullableInt64 and assigns it to the AssignedObjectId field. +func (o *IPAddress) SetAssignedObjectId(v int64) { + o.AssignedObjectId.Set(&v) +} + +// SetAssignedObjectIdNil sets the value for AssignedObjectId to be an explicit nil +func (o *IPAddress) SetAssignedObjectIdNil() { + o.AssignedObjectId.Set(nil) +} + +// UnsetAssignedObjectId ensures that no value is present for AssignedObjectId, not even an explicit nil +func (o *IPAddress) UnsetAssignedObjectId() { + o.AssignedObjectId.Unset() +} + +// GetAssignedObject returns the AssignedObject field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *IPAddress) GetAssignedObject() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.AssignedObject +} + +// GetAssignedObjectOk returns a tuple with the AssignedObject field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetAssignedObjectOk() (*interface{}, bool) { + if o == nil || IsNil(o.AssignedObject) { + return nil, false + } + return &o.AssignedObject, true +} + +// SetAssignedObject sets field value +func (o *IPAddress) SetAssignedObject(v interface{}) { + o.AssignedObject = v +} + +// GetNatInside returns the NatInside field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddress) GetNatInside() NestedIPAddress { + if o == nil || IsNil(o.NatInside.Get()) { + var ret NestedIPAddress + return ret + } + return *o.NatInside.Get() +} + +// GetNatInsideOk returns a tuple with the NatInside field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetNatInsideOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.NatInside.Get(), o.NatInside.IsSet() +} + +// HasNatInside returns a boolean if a field has been set. +func (o *IPAddress) HasNatInside() bool { + if o != nil && o.NatInside.IsSet() { + return true + } + + return false +} + +// SetNatInside gets a reference to the given NullableNestedIPAddress and assigns it to the NatInside field. +func (o *IPAddress) SetNatInside(v NestedIPAddress) { + o.NatInside.Set(&v) +} + +// SetNatInsideNil sets the value for NatInside to be an explicit nil +func (o *IPAddress) SetNatInsideNil() { + o.NatInside.Set(nil) +} + +// UnsetNatInside ensures that no value is present for NatInside, not even an explicit nil +func (o *IPAddress) UnsetNatInside() { + o.NatInside.Unset() +} + +// GetNatOutside returns the NatOutside field value +func (o *IPAddress) GetNatOutside() []NestedIPAddress { + if o == nil { + var ret []NestedIPAddress + return ret + } + + return o.NatOutside +} + +// GetNatOutsideOk returns a tuple with the NatOutside field value +// and a boolean to check if the value has been set. +func (o *IPAddress) GetNatOutsideOk() ([]NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.NatOutside, true +} + +// SetNatOutside sets field value +func (o *IPAddress) SetNatOutside(v []NestedIPAddress) { + o.NatOutside = v +} + +// GetDnsName returns the DnsName field value if set, zero value otherwise. +func (o *IPAddress) GetDnsName() string { + if o == nil || IsNil(o.DnsName) { + var ret string + return ret + } + return *o.DnsName +} + +// GetDnsNameOk returns a tuple with the DnsName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetDnsNameOk() (*string, bool) { + if o == nil || IsNil(o.DnsName) { + return nil, false + } + return o.DnsName, true +} + +// HasDnsName returns a boolean if a field has been set. +func (o *IPAddress) HasDnsName() bool { + if o != nil && !IsNil(o.DnsName) { + return true + } + + return false +} + +// SetDnsName gets a reference to the given string and assigns it to the DnsName field. +func (o *IPAddress) SetDnsName(v string) { + o.DnsName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPAddress) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPAddress) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPAddress) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPAddress) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPAddress) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPAddress) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPAddress) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPAddress) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *IPAddress) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPAddress) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPAddress) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPAddress) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPAddress) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *IPAddress) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPAddress) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddress) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *IPAddress) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o IPAddress) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["family"] = o.Family + toSerialize["address"] = o.Address + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if o.AssignedObjectType.IsSet() { + toSerialize["assigned_object_type"] = o.AssignedObjectType.Get() + } + if o.AssignedObjectId.IsSet() { + toSerialize["assigned_object_id"] = o.AssignedObjectId.Get() + } + if o.AssignedObject != nil { + toSerialize["assigned_object"] = o.AssignedObject + } + if o.NatInside.IsSet() { + toSerialize["nat_inside"] = o.NatInside.Get() + } + toSerialize["nat_outside"] = o.NatOutside + if !IsNil(o.DnsName) { + toSerialize["dns_name"] = o.DnsName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAddress) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "family", + "address", + "assigned_object", + "nat_outside", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPAddress := _IPAddress{} + + err = json.Unmarshal(data, &varIPAddress) + + if err != nil { + return err + } + + *o = IPAddress(varIPAddress) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "family") + delete(additionalProperties, "address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "assigned_object") + delete(additionalProperties, "nat_inside") + delete(additionalProperties, "nat_outside") + delete(additionalProperties, "dns_name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAddress struct { + value *IPAddress + isSet bool +} + +func (v NullableIPAddress) Get() *IPAddress { + return v.value +} + +func (v *NullableIPAddress) Set(val *IPAddress) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddress(val *IPAddress) *NullableIPAddress { + return &NullableIPAddress{value: val, isSet: true} +} + +func (v NullableIPAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_request.go new file mode 100644 index 00000000..7c4fa7fc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_request.go @@ -0,0 +1,666 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the IPAddressRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAddressRequest{} + +// IPAddressRequest Adds support for custom fields and tags. +type IPAddressRequest struct { + Address string `json:"address"` + Vrf NullableNestedVRFRequest `json:"vrf,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Status *IPAddressStatusValue `json:"status,omitempty"` + Role *IPAddressRoleValue `json:"role,omitempty"` + AssignedObjectType NullableString `json:"assigned_object_type,omitempty"` + AssignedObjectId NullableInt64 `json:"assigned_object_id,omitempty"` + NatInside NullableNestedIPAddressRequest `json:"nat_inside,omitempty"` + // Hostname or FQDN (not case-sensitive) + DnsName *string `json:"dns_name,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAddressRequest IPAddressRequest + +// NewIPAddressRequest instantiates a new IPAddressRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAddressRequest(address string) *IPAddressRequest { + this := IPAddressRequest{} + this.Address = address + return &this +} + +// NewIPAddressRequestWithDefaults instantiates a new IPAddressRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAddressRequestWithDefaults() *IPAddressRequest { + this := IPAddressRequest{} + return &this +} + +// GetAddress returns the Address field value +func (o *IPAddressRequest) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *IPAddressRequest) SetAddress(v string) { + o.Address = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddressRequest) GetVrf() NestedVRFRequest { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRFRequest + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddressRequest) GetVrfOk() (*NestedVRFRequest, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *IPAddressRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRFRequest and assigns it to the Vrf field. +func (o *IPAddressRequest) SetVrf(v NestedVRFRequest) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *IPAddressRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *IPAddressRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddressRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddressRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *IPAddressRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *IPAddressRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *IPAddressRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *IPAddressRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *IPAddressRequest) GetStatus() IPAddressStatusValue { + if o == nil || IsNil(o.Status) { + var ret IPAddressStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetStatusOk() (*IPAddressStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *IPAddressRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given IPAddressStatusValue and assigns it to the Status field. +func (o *IPAddressRequest) SetStatus(v IPAddressStatusValue) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *IPAddressRequest) GetRole() IPAddressRoleValue { + if o == nil || IsNil(o.Role) { + var ret IPAddressRoleValue + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetRoleOk() (*IPAddressRoleValue, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *IPAddressRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given IPAddressRoleValue and assigns it to the Role field. +func (o *IPAddressRequest) SetRole(v IPAddressRoleValue) { + o.Role = &v +} + +// GetAssignedObjectType returns the AssignedObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddressRequest) GetAssignedObjectType() string { + if o == nil || IsNil(o.AssignedObjectType.Get()) { + var ret string + return ret + } + return *o.AssignedObjectType.Get() +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddressRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectType.Get(), o.AssignedObjectType.IsSet() +} + +// HasAssignedObjectType returns a boolean if a field has been set. +func (o *IPAddressRequest) HasAssignedObjectType() bool { + if o != nil && o.AssignedObjectType.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectType gets a reference to the given NullableString and assigns it to the AssignedObjectType field. +func (o *IPAddressRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType.Set(&v) +} + +// SetAssignedObjectTypeNil sets the value for AssignedObjectType to be an explicit nil +func (o *IPAddressRequest) SetAssignedObjectTypeNil() { + o.AssignedObjectType.Set(nil) +} + +// UnsetAssignedObjectType ensures that no value is present for AssignedObjectType, not even an explicit nil +func (o *IPAddressRequest) UnsetAssignedObjectType() { + o.AssignedObjectType.Unset() +} + +// GetAssignedObjectId returns the AssignedObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddressRequest) GetAssignedObjectId() int64 { + if o == nil || IsNil(o.AssignedObjectId.Get()) { + var ret int64 + return ret + } + return *o.AssignedObjectId.Get() +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddressRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectId.Get(), o.AssignedObjectId.IsSet() +} + +// HasAssignedObjectId returns a boolean if a field has been set. +func (o *IPAddressRequest) HasAssignedObjectId() bool { + if o != nil && o.AssignedObjectId.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectId gets a reference to the given NullableInt64 and assigns it to the AssignedObjectId field. +func (o *IPAddressRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId.Set(&v) +} + +// SetAssignedObjectIdNil sets the value for AssignedObjectId to be an explicit nil +func (o *IPAddressRequest) SetAssignedObjectIdNil() { + o.AssignedObjectId.Set(nil) +} + +// UnsetAssignedObjectId ensures that no value is present for AssignedObjectId, not even an explicit nil +func (o *IPAddressRequest) UnsetAssignedObjectId() { + o.AssignedObjectId.Unset() +} + +// GetNatInside returns the NatInside field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPAddressRequest) GetNatInside() NestedIPAddressRequest { + if o == nil || IsNil(o.NatInside.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.NatInside.Get() +} + +// GetNatInsideOk returns a tuple with the NatInside field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPAddressRequest) GetNatInsideOk() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.NatInside.Get(), o.NatInside.IsSet() +} + +// HasNatInside returns a boolean if a field has been set. +func (o *IPAddressRequest) HasNatInside() bool { + if o != nil && o.NatInside.IsSet() { + return true + } + + return false +} + +// SetNatInside gets a reference to the given NullableNestedIPAddressRequest and assigns it to the NatInside field. +func (o *IPAddressRequest) SetNatInside(v NestedIPAddressRequest) { + o.NatInside.Set(&v) +} + +// SetNatInsideNil sets the value for NatInside to be an explicit nil +func (o *IPAddressRequest) SetNatInsideNil() { + o.NatInside.Set(nil) +} + +// UnsetNatInside ensures that no value is present for NatInside, not even an explicit nil +func (o *IPAddressRequest) UnsetNatInside() { + o.NatInside.Unset() +} + +// GetDnsName returns the DnsName field value if set, zero value otherwise. +func (o *IPAddressRequest) GetDnsName() string { + if o == nil || IsNil(o.DnsName) { + var ret string + return ret + } + return *o.DnsName +} + +// GetDnsNameOk returns a tuple with the DnsName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetDnsNameOk() (*string, bool) { + if o == nil || IsNil(o.DnsName) { + return nil, false + } + return o.DnsName, true +} + +// HasDnsName returns a boolean if a field has been set. +func (o *IPAddressRequest) HasDnsName() bool { + if o != nil && !IsNil(o.DnsName) { + return true + } + + return false +} + +// SetDnsName gets a reference to the given string and assigns it to the DnsName field. +func (o *IPAddressRequest) SetDnsName(v string) { + o.DnsName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPAddressRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPAddressRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPAddressRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPAddressRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPAddressRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPAddressRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPAddressRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPAddressRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *IPAddressRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPAddressRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPAddressRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPAddressRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o IPAddressRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAddressRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if o.AssignedObjectType.IsSet() { + toSerialize["assigned_object_type"] = o.AssignedObjectType.Get() + } + if o.AssignedObjectId.IsSet() { + toSerialize["assigned_object_id"] = o.AssignedObjectId.Get() + } + if o.NatInside.IsSet() { + toSerialize["nat_inside"] = o.NatInside.Get() + } + if !IsNil(o.DnsName) { + toSerialize["dns_name"] = o.DnsName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAddressRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPAddressRequest := _IPAddressRequest{} + + err = json.Unmarshal(data, &varIPAddressRequest) + + if err != nil { + return err + } + + *o = IPAddressRequest(varIPAddressRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "nat_inside") + delete(additionalProperties, "dns_name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAddressRequest struct { + value *IPAddressRequest + isSet bool +} + +func (v NullableIPAddressRequest) Get() *IPAddressRequest { + return v.value +} + +func (v *NullableIPAddressRequest) Set(val *IPAddressRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressRequest(val *IPAddressRequest) *NullableIPAddressRequest { + return &NullableIPAddressRequest{value: val, isSet: true} +} + +func (v NullableIPAddressRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role.go new file mode 100644 index 00000000..9e91a031 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IPAddressRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAddressRole{} + +// IPAddressRole struct for IPAddressRole +type IPAddressRole struct { + Value *IPAddressRoleValue `json:"value,omitempty"` + Label *IPAddressRoleLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAddressRole IPAddressRole + +// NewIPAddressRole instantiates a new IPAddressRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAddressRole() *IPAddressRole { + this := IPAddressRole{} + return &this +} + +// NewIPAddressRoleWithDefaults instantiates a new IPAddressRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAddressRoleWithDefaults() *IPAddressRole { + this := IPAddressRole{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IPAddressRole) GetValue() IPAddressRoleValue { + if o == nil || IsNil(o.Value) { + var ret IPAddressRoleValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRole) GetValueOk() (*IPAddressRoleValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IPAddressRole) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IPAddressRoleValue and assigns it to the Value field. +func (o *IPAddressRole) SetValue(v IPAddressRoleValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IPAddressRole) GetLabel() IPAddressRoleLabel { + if o == nil || IsNil(o.Label) { + var ret IPAddressRoleLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressRole) GetLabelOk() (*IPAddressRoleLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IPAddressRole) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IPAddressRoleLabel and assigns it to the Label field. +func (o *IPAddressRole) SetLabel(v IPAddressRoleLabel) { + o.Label = &v +} + +func (o IPAddressRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAddressRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAddressRole) UnmarshalJSON(data []byte) (err error) { + varIPAddressRole := _IPAddressRole{} + + err = json.Unmarshal(data, &varIPAddressRole) + + if err != nil { + return err + } + + *o = IPAddressRole(varIPAddressRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAddressRole struct { + value *IPAddressRole + isSet bool +} + +func (v NullableIPAddressRole) Get() *IPAddressRole { + return v.value +} + +func (v *NullableIPAddressRole) Set(val *IPAddressRole) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressRole) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressRole(val *IPAddressRole) *NullableIPAddressRole { + return &NullableIPAddressRole{value: val, isSet: true} +} + +func (v NullableIPAddressRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role_label.go new file mode 100644 index 00000000..c0101656 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role_label.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPAddressRoleLabel the model 'IPAddressRoleLabel' +type IPAddressRoleLabel string + +// List of IPAddress_role_label +const ( + IPADDRESSROLELABEL_LOOPBACK IPAddressRoleLabel = "Loopback" + IPADDRESSROLELABEL_SECONDARY IPAddressRoleLabel = "Secondary" + IPADDRESSROLELABEL_ANYCAST IPAddressRoleLabel = "Anycast" + IPADDRESSROLELABEL_VIP IPAddressRoleLabel = "VIP" + IPADDRESSROLELABEL_VRRP IPAddressRoleLabel = "VRRP" + IPADDRESSROLELABEL_HSRP IPAddressRoleLabel = "HSRP" + IPADDRESSROLELABEL_GLBP IPAddressRoleLabel = "GLBP" + IPADDRESSROLELABEL_CARP IPAddressRoleLabel = "CARP" +) + +// All allowed values of IPAddressRoleLabel enum +var AllowedIPAddressRoleLabelEnumValues = []IPAddressRoleLabel{ + "Loopback", + "Secondary", + "Anycast", + "VIP", + "VRRP", + "HSRP", + "GLBP", + "CARP", +} + +func (v *IPAddressRoleLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPAddressRoleLabel(value) + for _, existing := range AllowedIPAddressRoleLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPAddressRoleLabel", value) +} + +// NewIPAddressRoleLabelFromValue returns a pointer to a valid IPAddressRoleLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPAddressRoleLabelFromValue(v string) (*IPAddressRoleLabel, error) { + ev := IPAddressRoleLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPAddressRoleLabel: valid values are %v", v, AllowedIPAddressRoleLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPAddressRoleLabel) IsValid() bool { + for _, existing := range AllowedIPAddressRoleLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPAddress_role_label value +func (v IPAddressRoleLabel) Ptr() *IPAddressRoleLabel { + return &v +} + +type NullableIPAddressRoleLabel struct { + value *IPAddressRoleLabel + isSet bool +} + +func (v NullableIPAddressRoleLabel) Get() *IPAddressRoleLabel { + return v.value +} + +func (v *NullableIPAddressRoleLabel) Set(val *IPAddressRoleLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressRoleLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressRoleLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressRoleLabel(val *IPAddressRoleLabel) *NullableIPAddressRoleLabel { + return &NullableIPAddressRoleLabel{value: val, isSet: true} +} + +func (v NullableIPAddressRoleLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressRoleLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role_value.go new file mode 100644 index 00000000..e77ec611 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_role_value.go @@ -0,0 +1,124 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPAddressRoleValue * `loopback` - Loopback * `secondary` - Secondary * `anycast` - Anycast * `vip` - VIP * `vrrp` - VRRP * `hsrp` - HSRP * `glbp` - GLBP * `carp` - CARP +type IPAddressRoleValue string + +// List of IPAddress_role_value +const ( + IPADDRESSROLEVALUE_LOOPBACK IPAddressRoleValue = "loopback" + IPADDRESSROLEVALUE_SECONDARY IPAddressRoleValue = "secondary" + IPADDRESSROLEVALUE_ANYCAST IPAddressRoleValue = "anycast" + IPADDRESSROLEVALUE_VIP IPAddressRoleValue = "vip" + IPADDRESSROLEVALUE_VRRP IPAddressRoleValue = "vrrp" + IPADDRESSROLEVALUE_HSRP IPAddressRoleValue = "hsrp" + IPADDRESSROLEVALUE_GLBP IPAddressRoleValue = "glbp" + IPADDRESSROLEVALUE_CARP IPAddressRoleValue = "carp" + IPADDRESSROLEVALUE_EMPTY IPAddressRoleValue = "" +) + +// All allowed values of IPAddressRoleValue enum +var AllowedIPAddressRoleValueEnumValues = []IPAddressRoleValue{ + "loopback", + "secondary", + "anycast", + "vip", + "vrrp", + "hsrp", + "glbp", + "carp", + "", +} + +func (v *IPAddressRoleValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPAddressRoleValue(value) + for _, existing := range AllowedIPAddressRoleValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPAddressRoleValue", value) +} + +// NewIPAddressRoleValueFromValue returns a pointer to a valid IPAddressRoleValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPAddressRoleValueFromValue(v string) (*IPAddressRoleValue, error) { + ev := IPAddressRoleValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPAddressRoleValue: valid values are %v", v, AllowedIPAddressRoleValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPAddressRoleValue) IsValid() bool { + for _, existing := range AllowedIPAddressRoleValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPAddress_role_value value +func (v IPAddressRoleValue) Ptr() *IPAddressRoleValue { + return &v +} + +type NullableIPAddressRoleValue struct { + value *IPAddressRoleValue + isSet bool +} + +func (v NullableIPAddressRoleValue) Get() *IPAddressRoleValue { + return v.value +} + +func (v *NullableIPAddressRoleValue) Set(val *IPAddressRoleValue) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressRoleValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressRoleValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressRoleValue(val *IPAddressRoleValue) *NullableIPAddressRoleValue { + return &NullableIPAddressRoleValue{value: val, isSet: true} +} + +func (v NullableIPAddressRoleValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressRoleValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status.go new file mode 100644 index 00000000..e59766b2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IPAddressStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAddressStatus{} + +// IPAddressStatus struct for IPAddressStatus +type IPAddressStatus struct { + Value *IPAddressStatusValue `json:"value,omitempty"` + Label *IPAddressStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAddressStatus IPAddressStatus + +// NewIPAddressStatus instantiates a new IPAddressStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAddressStatus() *IPAddressStatus { + this := IPAddressStatus{} + return &this +} + +// NewIPAddressStatusWithDefaults instantiates a new IPAddressStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAddressStatusWithDefaults() *IPAddressStatus { + this := IPAddressStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IPAddressStatus) GetValue() IPAddressStatusValue { + if o == nil || IsNil(o.Value) { + var ret IPAddressStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressStatus) GetValueOk() (*IPAddressStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IPAddressStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IPAddressStatusValue and assigns it to the Value field. +func (o *IPAddressStatus) SetValue(v IPAddressStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IPAddressStatus) GetLabel() IPAddressStatusLabel { + if o == nil || IsNil(o.Label) { + var ret IPAddressStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddressStatus) GetLabelOk() (*IPAddressStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IPAddressStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IPAddressStatusLabel and assigns it to the Label field. +func (o *IPAddressStatus) SetLabel(v IPAddressStatusLabel) { + o.Label = &v +} + +func (o IPAddressStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAddressStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAddressStatus) UnmarshalJSON(data []byte) (err error) { + varIPAddressStatus := _IPAddressStatus{} + + err = json.Unmarshal(data, &varIPAddressStatus) + + if err != nil { + return err + } + + *o = IPAddressStatus(varIPAddressStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAddressStatus struct { + value *IPAddressStatus + isSet bool +} + +func (v NullableIPAddressStatus) Get() *IPAddressStatus { + return v.value +} + +func (v *NullableIPAddressStatus) Set(val *IPAddressStatus) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressStatus(val *IPAddressStatus) *NullableIPAddressStatus { + return &NullableIPAddressStatus{value: val, isSet: true} +} + +func (v NullableIPAddressStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status_label.go new file mode 100644 index 00000000..e79a5482 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status_label.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPAddressStatusLabel the model 'IPAddressStatusLabel' +type IPAddressStatusLabel string + +// List of IPAddress_status_label +const ( + IPADDRESSSTATUSLABEL_ACTIVE IPAddressStatusLabel = "Active" + IPADDRESSSTATUSLABEL_RESERVED IPAddressStatusLabel = "Reserved" + IPADDRESSSTATUSLABEL_DEPRECATED IPAddressStatusLabel = "Deprecated" + IPADDRESSSTATUSLABEL_DHCP IPAddressStatusLabel = "DHCP" + IPADDRESSSTATUSLABEL_SLAAC IPAddressStatusLabel = "SLAAC" +) + +// All allowed values of IPAddressStatusLabel enum +var AllowedIPAddressStatusLabelEnumValues = []IPAddressStatusLabel{ + "Active", + "Reserved", + "Deprecated", + "DHCP", + "SLAAC", +} + +func (v *IPAddressStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPAddressStatusLabel(value) + for _, existing := range AllowedIPAddressStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPAddressStatusLabel", value) +} + +// NewIPAddressStatusLabelFromValue returns a pointer to a valid IPAddressStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPAddressStatusLabelFromValue(v string) (*IPAddressStatusLabel, error) { + ev := IPAddressStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPAddressStatusLabel: valid values are %v", v, AllowedIPAddressStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPAddressStatusLabel) IsValid() bool { + for _, existing := range AllowedIPAddressStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPAddress_status_label value +func (v IPAddressStatusLabel) Ptr() *IPAddressStatusLabel { + return &v +} + +type NullableIPAddressStatusLabel struct { + value *IPAddressStatusLabel + isSet bool +} + +func (v NullableIPAddressStatusLabel) Get() *IPAddressStatusLabel { + return v.value +} + +func (v *NullableIPAddressStatusLabel) Set(val *IPAddressStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressStatusLabel(val *IPAddressStatusLabel) *NullableIPAddressStatusLabel { + return &NullableIPAddressStatusLabel{value: val, isSet: true} +} + +func (v NullableIPAddressStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status_value.go new file mode 100644 index 00000000..559bc439 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_address_status_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPAddressStatusValue * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated * `dhcp` - DHCP * `slaac` - SLAAC +type IPAddressStatusValue string + +// List of IPAddress_status_value +const ( + IPADDRESSSTATUSVALUE_ACTIVE IPAddressStatusValue = "active" + IPADDRESSSTATUSVALUE_RESERVED IPAddressStatusValue = "reserved" + IPADDRESSSTATUSVALUE_DEPRECATED IPAddressStatusValue = "deprecated" + IPADDRESSSTATUSVALUE_DHCP IPAddressStatusValue = "dhcp" + IPADDRESSSTATUSVALUE_SLAAC IPAddressStatusValue = "slaac" +) + +// All allowed values of IPAddressStatusValue enum +var AllowedIPAddressStatusValueEnumValues = []IPAddressStatusValue{ + "active", + "reserved", + "deprecated", + "dhcp", + "slaac", +} + +func (v *IPAddressStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPAddressStatusValue(value) + for _, existing := range AllowedIPAddressStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPAddressStatusValue", value) +} + +// NewIPAddressStatusValueFromValue returns a pointer to a valid IPAddressStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPAddressStatusValueFromValue(v string) (*IPAddressStatusValue, error) { + ev := IPAddressStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPAddressStatusValue: valid values are %v", v, AllowedIPAddressStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPAddressStatusValue) IsValid() bool { + for _, existing := range AllowedIPAddressStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPAddress_status_value value +func (v IPAddressStatusValue) Ptr() *IPAddressStatusValue { + return &v +} + +type NullableIPAddressStatusValue struct { + value *IPAddressStatusValue + isSet bool +} + +func (v NullableIPAddressStatusValue) Get() *IPAddressStatusValue { + return v.value +} + +func (v *NullableIPAddressStatusValue) Set(val *IPAddressStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressStatusValue(val *IPAddressStatusValue) *NullableIPAddressStatusValue { + return &NullableIPAddressStatusValue{value: val, isSet: true} +} + +func (v NullableIPAddressStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range.go new file mode 100644 index 00000000..c7b2cf09 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range.go @@ -0,0 +1,770 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IPRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPRange{} + +// IPRange Adds support for custom fields and tags. +type IPRange struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Family AggregateFamily `json:"family"` + StartAddress string `json:"start_address"` + EndAddress string `json:"end_address"` + Size int32 `json:"size"` + Vrf NullableNestedVRF `json:"vrf,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Status *IPRangeStatus `json:"status,omitempty"` + Role NullableNestedRole `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPRange IPRange + +// NewIPRange instantiates a new IPRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPRange(id int32, url string, display string, family AggregateFamily, startAddress string, endAddress string, size int32, created NullableTime, lastUpdated NullableTime) *IPRange { + this := IPRange{} + this.Id = id + this.Url = url + this.Display = display + this.Family = family + this.StartAddress = startAddress + this.EndAddress = endAddress + this.Size = size + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewIPRangeWithDefaults instantiates a new IPRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPRangeWithDefaults() *IPRange { + this := IPRange{} + return &this +} + +// GetId returns the Id field value +func (o *IPRange) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IPRange) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *IPRange) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *IPRange) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *IPRange) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *IPRange) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *IPRange) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *IPRange) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *IPRange) SetDisplay(v string) { + o.Display = v +} + +// GetFamily returns the Family field value +func (o *IPRange) GetFamily() AggregateFamily { + if o == nil { + var ret AggregateFamily + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *IPRange) GetFamilyOk() (*AggregateFamily, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *IPRange) SetFamily(v AggregateFamily) { + o.Family = v +} + +// GetStartAddress returns the StartAddress field value +func (o *IPRange) GetStartAddress() string { + if o == nil { + var ret string + return ret + } + + return o.StartAddress +} + +// GetStartAddressOk returns a tuple with the StartAddress field value +// and a boolean to check if the value has been set. +func (o *IPRange) GetStartAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartAddress, true +} + +// SetStartAddress sets field value +func (o *IPRange) SetStartAddress(v string) { + o.StartAddress = v +} + +// GetEndAddress returns the EndAddress field value +func (o *IPRange) GetEndAddress() string { + if o == nil { + var ret string + return ret + } + + return o.EndAddress +} + +// GetEndAddressOk returns a tuple with the EndAddress field value +// and a boolean to check if the value has been set. +func (o *IPRange) GetEndAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndAddress, true +} + +// SetEndAddress sets field value +func (o *IPRange) SetEndAddress(v string) { + o.EndAddress = v +} + +// GetSize returns the Size field value +func (o *IPRange) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *IPRange) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *IPRange) SetSize(v int32) { + o.Size = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPRange) GetVrf() NestedVRF { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRF + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRange) GetVrfOk() (*NestedVRF, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *IPRange) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRF and assigns it to the Vrf field. +func (o *IPRange) SetVrf(v NestedVRF) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *IPRange) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *IPRange) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPRange) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRange) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *IPRange) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *IPRange) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *IPRange) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *IPRange) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *IPRange) GetStatus() IPRangeStatus { + if o == nil || IsNil(o.Status) { + var ret IPRangeStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRange) GetStatusOk() (*IPRangeStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *IPRange) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given IPRangeStatus and assigns it to the Status field. +func (o *IPRange) SetStatus(v IPRangeStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPRange) GetRole() NestedRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRange) GetRoleOk() (*NestedRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *IPRange) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRole and assigns it to the Role field. +func (o *IPRange) SetRole(v NestedRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *IPRange) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *IPRange) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPRange) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRange) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPRange) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPRange) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPRange) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRange) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPRange) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPRange) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPRange) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRange) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPRange) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *IPRange) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPRange) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRange) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPRange) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPRange) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPRange) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRange) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *IPRange) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPRange) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRange) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *IPRange) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *IPRange) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRange) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *IPRange) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *IPRange) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +func (o IPRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["family"] = o.Family + toSerialize["start_address"] = o.StartAddress + toSerialize["end_address"] = o.EndAddress + toSerialize["size"] = o.Size + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "family", + "start_address", + "end_address", + "size", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPRange := _IPRange{} + + err = json.Unmarshal(data, &varIPRange) + + if err != nil { + return err + } + + *o = IPRange(varIPRange) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "family") + delete(additionalProperties, "start_address") + delete(additionalProperties, "end_address") + delete(additionalProperties, "size") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "mark_utilized") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPRange struct { + value *IPRange + isSet bool +} + +func (v NullableIPRange) Get() *IPRange { + return v.value +} + +func (v *NullableIPRange) Set(val *IPRange) { + v.value = val + v.isSet = true +} + +func (v NullableIPRange) IsSet() bool { + return v.isSet +} + +func (v *NullableIPRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPRange(val *IPRange) *NullableIPRange { + return &NullableIPRange{value: val, isSet: true} +} + +func (v NullableIPRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_request.go new file mode 100644 index 00000000..66348242 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_request.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the IPRangeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPRangeRequest{} + +// IPRangeRequest Adds support for custom fields and tags. +type IPRangeRequest struct { + StartAddress string `json:"start_address"` + EndAddress string `json:"end_address"` + Vrf NullableNestedVRFRequest `json:"vrf,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Status *IPRangeStatusValue `json:"status,omitempty"` + Role NullableNestedRoleRequest `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPRangeRequest IPRangeRequest + +// NewIPRangeRequest instantiates a new IPRangeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPRangeRequest(startAddress string, endAddress string) *IPRangeRequest { + this := IPRangeRequest{} + this.StartAddress = startAddress + this.EndAddress = endAddress + return &this +} + +// NewIPRangeRequestWithDefaults instantiates a new IPRangeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPRangeRequestWithDefaults() *IPRangeRequest { + this := IPRangeRequest{} + return &this +} + +// GetStartAddress returns the StartAddress field value +func (o *IPRangeRequest) GetStartAddress() string { + if o == nil { + var ret string + return ret + } + + return o.StartAddress +} + +// GetStartAddressOk returns a tuple with the StartAddress field value +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetStartAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartAddress, true +} + +// SetStartAddress sets field value +func (o *IPRangeRequest) SetStartAddress(v string) { + o.StartAddress = v +} + +// GetEndAddress returns the EndAddress field value +func (o *IPRangeRequest) GetEndAddress() string { + if o == nil { + var ret string + return ret + } + + return o.EndAddress +} + +// GetEndAddressOk returns a tuple with the EndAddress field value +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetEndAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndAddress, true +} + +// SetEndAddress sets field value +func (o *IPRangeRequest) SetEndAddress(v string) { + o.EndAddress = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPRangeRequest) GetVrf() NestedVRFRequest { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRFRequest + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRangeRequest) GetVrfOk() (*NestedVRFRequest, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *IPRangeRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRFRequest and assigns it to the Vrf field. +func (o *IPRangeRequest) SetVrf(v NestedVRFRequest) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *IPRangeRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *IPRangeRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPRangeRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRangeRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *IPRangeRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *IPRangeRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *IPRangeRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *IPRangeRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *IPRangeRequest) GetStatus() IPRangeStatusValue { + if o == nil || IsNil(o.Status) { + var ret IPRangeStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetStatusOk() (*IPRangeStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *IPRangeRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given IPRangeStatusValue and assigns it to the Status field. +func (o *IPRangeRequest) SetStatus(v IPRangeStatusValue) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPRangeRequest) GetRole() NestedRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPRangeRequest) GetRoleOk() (*NestedRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *IPRangeRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRoleRequest and assigns it to the Role field. +func (o *IPRangeRequest) SetRole(v NestedRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *IPRangeRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *IPRangeRequest) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPRangeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPRangeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPRangeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPRangeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPRangeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPRangeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPRangeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPRangeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *IPRangeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPRangeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPRangeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPRangeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *IPRangeRequest) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeRequest) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *IPRangeRequest) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *IPRangeRequest) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +func (o IPRangeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPRangeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["start_address"] = o.StartAddress + toSerialize["end_address"] = o.EndAddress + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPRangeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "start_address", + "end_address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPRangeRequest := _IPRangeRequest{} + + err = json.Unmarshal(data, &varIPRangeRequest) + + if err != nil { + return err + } + + *o = IPRangeRequest(varIPRangeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "start_address") + delete(additionalProperties, "end_address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "mark_utilized") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPRangeRequest struct { + value *IPRangeRequest + isSet bool +} + +func (v NullableIPRangeRequest) Get() *IPRangeRequest { + return v.value +} + +func (v *NullableIPRangeRequest) Set(val *IPRangeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIPRangeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIPRangeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPRangeRequest(val *IPRangeRequest) *NullableIPRangeRequest { + return &NullableIPRangeRequest{value: val, isSet: true} +} + +func (v NullableIPRangeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPRangeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status.go new file mode 100644 index 00000000..2c184fbc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IPRangeStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPRangeStatus{} + +// IPRangeStatus struct for IPRangeStatus +type IPRangeStatus struct { + Value *IPRangeStatusValue `json:"value,omitempty"` + Label *IPRangeStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPRangeStatus IPRangeStatus + +// NewIPRangeStatus instantiates a new IPRangeStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPRangeStatus() *IPRangeStatus { + this := IPRangeStatus{} + return &this +} + +// NewIPRangeStatusWithDefaults instantiates a new IPRangeStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPRangeStatusWithDefaults() *IPRangeStatus { + this := IPRangeStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IPRangeStatus) GetValue() IPRangeStatusValue { + if o == nil || IsNil(o.Value) { + var ret IPRangeStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeStatus) GetValueOk() (*IPRangeStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IPRangeStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IPRangeStatusValue and assigns it to the Value field. +func (o *IPRangeStatus) SetValue(v IPRangeStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IPRangeStatus) GetLabel() IPRangeStatusLabel { + if o == nil || IsNil(o.Label) { + var ret IPRangeStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRangeStatus) GetLabelOk() (*IPRangeStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IPRangeStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IPRangeStatusLabel and assigns it to the Label field. +func (o *IPRangeStatus) SetLabel(v IPRangeStatusLabel) { + o.Label = &v +} + +func (o IPRangeStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPRangeStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPRangeStatus) UnmarshalJSON(data []byte) (err error) { + varIPRangeStatus := _IPRangeStatus{} + + err = json.Unmarshal(data, &varIPRangeStatus) + + if err != nil { + return err + } + + *o = IPRangeStatus(varIPRangeStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPRangeStatus struct { + value *IPRangeStatus + isSet bool +} + +func (v NullableIPRangeStatus) Get() *IPRangeStatus { + return v.value +} + +func (v *NullableIPRangeStatus) Set(val *IPRangeStatus) { + v.value = val + v.isSet = true +} + +func (v NullableIPRangeStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableIPRangeStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPRangeStatus(val *IPRangeStatus) *NullableIPRangeStatus { + return &NullableIPRangeStatus{value: val, isSet: true} +} + +func (v NullableIPRangeStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPRangeStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status_label.go new file mode 100644 index 00000000..327de327 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPRangeStatusLabel the model 'IPRangeStatusLabel' +type IPRangeStatusLabel string + +// List of IPRange_status_label +const ( + IPRANGESTATUSLABEL_ACTIVE IPRangeStatusLabel = "Active" + IPRANGESTATUSLABEL_RESERVED IPRangeStatusLabel = "Reserved" + IPRANGESTATUSLABEL_DEPRECATED IPRangeStatusLabel = "Deprecated" +) + +// All allowed values of IPRangeStatusLabel enum +var AllowedIPRangeStatusLabelEnumValues = []IPRangeStatusLabel{ + "Active", + "Reserved", + "Deprecated", +} + +func (v *IPRangeStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPRangeStatusLabel(value) + for _, existing := range AllowedIPRangeStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPRangeStatusLabel", value) +} + +// NewIPRangeStatusLabelFromValue returns a pointer to a valid IPRangeStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPRangeStatusLabelFromValue(v string) (*IPRangeStatusLabel, error) { + ev := IPRangeStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPRangeStatusLabel: valid values are %v", v, AllowedIPRangeStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPRangeStatusLabel) IsValid() bool { + for _, existing := range AllowedIPRangeStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPRange_status_label value +func (v IPRangeStatusLabel) Ptr() *IPRangeStatusLabel { + return &v +} + +type NullableIPRangeStatusLabel struct { + value *IPRangeStatusLabel + isSet bool +} + +func (v NullableIPRangeStatusLabel) Get() *IPRangeStatusLabel { + return v.value +} + +func (v *NullableIPRangeStatusLabel) Set(val *IPRangeStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIPRangeStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIPRangeStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPRangeStatusLabel(val *IPRangeStatusLabel) *NullableIPRangeStatusLabel { + return &NullableIPRangeStatusLabel{value: val, isSet: true} +} + +func (v NullableIPRangeStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPRangeStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status_value.go new file mode 100644 index 00000000..69fc5328 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_range_status_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPRangeStatusValue * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated +type IPRangeStatusValue string + +// List of IPRange_status_value +const ( + IPRANGESTATUSVALUE_ACTIVE IPRangeStatusValue = "active" + IPRANGESTATUSVALUE_RESERVED IPRangeStatusValue = "reserved" + IPRANGESTATUSVALUE_DEPRECATED IPRangeStatusValue = "deprecated" +) + +// All allowed values of IPRangeStatusValue enum +var AllowedIPRangeStatusValueEnumValues = []IPRangeStatusValue{ + "active", + "reserved", + "deprecated", +} + +func (v *IPRangeStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPRangeStatusValue(value) + for _, existing := range AllowedIPRangeStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPRangeStatusValue", value) +} + +// NewIPRangeStatusValueFromValue returns a pointer to a valid IPRangeStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPRangeStatusValueFromValue(v string) (*IPRangeStatusValue, error) { + ev := IPRangeStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPRangeStatusValue: valid values are %v", v, AllowedIPRangeStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPRangeStatusValue) IsValid() bool { + for _, existing := range AllowedIPRangeStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPRange_status_value value +func (v IPRangeStatusValue) Ptr() *IPRangeStatusValue { + return &v +} + +type NullableIPRangeStatusValue struct { + value *IPRangeStatusValue + isSet bool +} + +func (v NullableIPRangeStatusValue) Get() *IPRangeStatusValue { + return v.value +} + +func (v *NullableIPRangeStatusValue) Set(val *IPRangeStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableIPRangeStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIPRangeStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPRangeStatusValue(val *IPRangeStatusValue) *NullableIPRangeStatusValue { + return &NullableIPRangeStatusValue{value: val, isSet: true} +} + +func (v NullableIPRangeStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPRangeStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_policy.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_policy.go new file mode 100644 index 00000000..8a6ee238 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_policy.go @@ -0,0 +1,538 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IPSecPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPSecPolicy{} + +// IPSecPolicy Adds support for custom fields and tags. +type IPSecPolicy struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Proposals []int32 `json:"proposals,omitempty"` + PfsGroup *IKEProposalGroup `json:"pfs_group,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _IPSecPolicy IPSecPolicy + +// NewIPSecPolicy instantiates a new IPSecPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPSecPolicy(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *IPSecPolicy { + this := IPSecPolicy{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewIPSecPolicyWithDefaults instantiates a new IPSecPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPSecPolicyWithDefaults() *IPSecPolicy { + this := IPSecPolicy{} + return &this +} + +// GetId returns the Id field value +func (o *IPSecPolicy) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *IPSecPolicy) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *IPSecPolicy) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *IPSecPolicy) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *IPSecPolicy) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *IPSecPolicy) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *IPSecPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IPSecPolicy) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPSecPolicy) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPSecPolicy) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPSecPolicy) SetDescription(v string) { + o.Description = &v +} + +// GetProposals returns the Proposals field value if set, zero value otherwise. +func (o *IPSecPolicy) GetProposals() []int32 { + if o == nil || IsNil(o.Proposals) { + var ret []int32 + return ret + } + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetProposalsOk() ([]int32, bool) { + if o == nil || IsNil(o.Proposals) { + return nil, false + } + return o.Proposals, true +} + +// HasProposals returns a boolean if a field has been set. +func (o *IPSecPolicy) HasProposals() bool { + if o != nil && !IsNil(o.Proposals) { + return true + } + + return false +} + +// SetProposals gets a reference to the given []int32 and assigns it to the Proposals field. +func (o *IPSecPolicy) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPfsGroup returns the PfsGroup field value if set, zero value otherwise. +func (o *IPSecPolicy) GetPfsGroup() IKEProposalGroup { + if o == nil || IsNil(o.PfsGroup) { + var ret IKEProposalGroup + return ret + } + return *o.PfsGroup +} + +// GetPfsGroupOk returns a tuple with the PfsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetPfsGroupOk() (*IKEProposalGroup, bool) { + if o == nil || IsNil(o.PfsGroup) { + return nil, false + } + return o.PfsGroup, true +} + +// HasPfsGroup returns a boolean if a field has been set. +func (o *IPSecPolicy) HasPfsGroup() bool { + if o != nil && !IsNil(o.PfsGroup) { + return true + } + + return false +} + +// SetPfsGroup gets a reference to the given IKEProposalGroup and assigns it to the PfsGroup field. +func (o *IPSecPolicy) SetPfsGroup(v IKEProposalGroup) { + o.PfsGroup = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPSecPolicy) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPSecPolicy) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPSecPolicy) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPSecPolicy) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPSecPolicy) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *IPSecPolicy) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPSecPolicy) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicy) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPSecPolicy) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPSecPolicy) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPSecPolicy) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecPolicy) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *IPSecPolicy) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPSecPolicy) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecPolicy) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *IPSecPolicy) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o IPSecPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPSecPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Proposals) { + toSerialize["proposals"] = o.Proposals + } + if !IsNil(o.PfsGroup) { + toSerialize["pfs_group"] = o.PfsGroup + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPSecPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPSecPolicy := _IPSecPolicy{} + + err = json.Unmarshal(data, &varIPSecPolicy) + + if err != nil { + return err + } + + *o = IPSecPolicy(varIPSecPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "proposals") + delete(additionalProperties, "pfs_group") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPSecPolicy struct { + value *IPSecPolicy + isSet bool +} + +func (v NullableIPSecPolicy) Get() *IPSecPolicy { + return v.value +} + +func (v *NullableIPSecPolicy) Set(val *IPSecPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecPolicy(val *IPSecPolicy) *NullableIPSecPolicy { + return &NullableIPSecPolicy{value: val, isSet: true} +} + +func (v NullableIPSecPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_policy_request.go new file mode 100644 index 00000000..c88fce9a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_policy_request.go @@ -0,0 +1,388 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the IPSecPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPSecPolicyRequest{} + +// IPSecPolicyRequest Adds support for custom fields and tags. +type IPSecPolicyRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Proposals []int32 `json:"proposals,omitempty"` + PfsGroup *IKEProposalGroupValue `json:"pfs_group,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPSecPolicyRequest IPSecPolicyRequest + +// NewIPSecPolicyRequest instantiates a new IPSecPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPSecPolicyRequest(name string) *IPSecPolicyRequest { + this := IPSecPolicyRequest{} + this.Name = name + return &this +} + +// NewIPSecPolicyRequestWithDefaults instantiates a new IPSecPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPSecPolicyRequestWithDefaults() *IPSecPolicyRequest { + this := IPSecPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *IPSecPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IPSecPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IPSecPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPSecPolicyRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicyRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPSecPolicyRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPSecPolicyRequest) SetDescription(v string) { + o.Description = &v +} + +// GetProposals returns the Proposals field value if set, zero value otherwise. +func (o *IPSecPolicyRequest) GetProposals() []int32 { + if o == nil || IsNil(o.Proposals) { + var ret []int32 + return ret + } + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicyRequest) GetProposalsOk() ([]int32, bool) { + if o == nil || IsNil(o.Proposals) { + return nil, false + } + return o.Proposals, true +} + +// HasProposals returns a boolean if a field has been set. +func (o *IPSecPolicyRequest) HasProposals() bool { + if o != nil && !IsNil(o.Proposals) { + return true + } + + return false +} + +// SetProposals gets a reference to the given []int32 and assigns it to the Proposals field. +func (o *IPSecPolicyRequest) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPfsGroup returns the PfsGroup field value if set, zero value otherwise. +func (o *IPSecPolicyRequest) GetPfsGroup() IKEProposalGroupValue { + if o == nil || IsNil(o.PfsGroup) { + var ret IKEProposalGroupValue + return ret + } + return *o.PfsGroup +} + +// GetPfsGroupOk returns a tuple with the PfsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicyRequest) GetPfsGroupOk() (*IKEProposalGroupValue, bool) { + if o == nil || IsNil(o.PfsGroup) { + return nil, false + } + return o.PfsGroup, true +} + +// HasPfsGroup returns a boolean if a field has been set. +func (o *IPSecPolicyRequest) HasPfsGroup() bool { + if o != nil && !IsNil(o.PfsGroup) { + return true + } + + return false +} + +// SetPfsGroup gets a reference to the given IKEProposalGroupValue and assigns it to the PfsGroup field. +func (o *IPSecPolicyRequest) SetPfsGroup(v IKEProposalGroupValue) { + o.PfsGroup = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPSecPolicyRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicyRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPSecPolicyRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPSecPolicyRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPSecPolicyRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicyRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPSecPolicyRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *IPSecPolicyRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPSecPolicyRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecPolicyRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPSecPolicyRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPSecPolicyRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o IPSecPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPSecPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Proposals) { + toSerialize["proposals"] = o.Proposals + } + if !IsNil(o.PfsGroup) { + toSerialize["pfs_group"] = o.PfsGroup + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPSecPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPSecPolicyRequest := _IPSecPolicyRequest{} + + err = json.Unmarshal(data, &varIPSecPolicyRequest) + + if err != nil { + return err + } + + *o = IPSecPolicyRequest(varIPSecPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "proposals") + delete(additionalProperties, "pfs_group") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPSecPolicyRequest struct { + value *IPSecPolicyRequest + isSet bool +} + +func (v NullableIPSecPolicyRequest) Get() *IPSecPolicyRequest { + return v.value +} + +func (v *NullableIPSecPolicyRequest) Set(val *IPSecPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecPolicyRequest(val *IPSecPolicyRequest) *NullableIPSecPolicyRequest { + return &NullableIPSecPolicyRequest{value: val, isSet: true} +} + +func (v NullableIPSecPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile.go new file mode 100644 index 00000000..8d8c8823 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile.go @@ -0,0 +1,551 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IPSecProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPSecProfile{} + +// IPSecProfile Adds support for custom fields and tags. +type IPSecProfile struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Mode IPSecProfileMode `json:"mode"` + IkePolicy NestedIKEPolicy `json:"ike_policy"` + IpsecPolicy NestedIPSecPolicy `json:"ipsec_policy"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _IPSecProfile IPSecProfile + +// NewIPSecProfile instantiates a new IPSecProfile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPSecProfile(id int32, url string, display string, name string, mode IPSecProfileMode, ikePolicy NestedIKEPolicy, ipsecPolicy NestedIPSecPolicy, created NullableTime, lastUpdated NullableTime) *IPSecProfile { + this := IPSecProfile{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Mode = mode + this.IkePolicy = ikePolicy + this.IpsecPolicy = ipsecPolicy + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewIPSecProfileWithDefaults instantiates a new IPSecProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPSecProfileWithDefaults() *IPSecProfile { + this := IPSecProfile{} + return &this +} + +// GetId returns the Id field value +func (o *IPSecProfile) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *IPSecProfile) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *IPSecProfile) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *IPSecProfile) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *IPSecProfile) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *IPSecProfile) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *IPSecProfile) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IPSecProfile) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPSecProfile) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPSecProfile) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPSecProfile) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value +func (o *IPSecProfile) GetMode() IPSecProfileMode { + if o == nil { + var ret IPSecProfileMode + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetModeOk() (*IPSecProfileMode, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *IPSecProfile) SetMode(v IPSecProfileMode) { + o.Mode = v +} + +// GetIkePolicy returns the IkePolicy field value +func (o *IPSecProfile) GetIkePolicy() NestedIKEPolicy { + if o == nil { + var ret NestedIKEPolicy + return ret + } + + return o.IkePolicy +} + +// GetIkePolicyOk returns a tuple with the IkePolicy field value +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetIkePolicyOk() (*NestedIKEPolicy, bool) { + if o == nil { + return nil, false + } + return &o.IkePolicy, true +} + +// SetIkePolicy sets field value +func (o *IPSecProfile) SetIkePolicy(v NestedIKEPolicy) { + o.IkePolicy = v +} + +// GetIpsecPolicy returns the IpsecPolicy field value +func (o *IPSecProfile) GetIpsecPolicy() NestedIPSecPolicy { + if o == nil { + var ret NestedIPSecPolicy + return ret + } + + return o.IpsecPolicy +} + +// GetIpsecPolicyOk returns a tuple with the IpsecPolicy field value +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetIpsecPolicyOk() (*NestedIPSecPolicy, bool) { + if o == nil { + return nil, false + } + return &o.IpsecPolicy, true +} + +// SetIpsecPolicy sets field value +func (o *IPSecProfile) SetIpsecPolicy(v NestedIPSecPolicy) { + o.IpsecPolicy = v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPSecProfile) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPSecProfile) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPSecProfile) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPSecProfile) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPSecProfile) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *IPSecProfile) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPSecProfile) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfile) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPSecProfile) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPSecProfile) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPSecProfile) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProfile) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *IPSecProfile) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPSecProfile) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProfile) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *IPSecProfile) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o IPSecProfile) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPSecProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["mode"] = o.Mode + toSerialize["ike_policy"] = o.IkePolicy + toSerialize["ipsec_policy"] = o.IpsecPolicy + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPSecProfile) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "mode", + "ike_policy", + "ipsec_policy", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPSecProfile := _IPSecProfile{} + + err = json.Unmarshal(data, &varIPSecProfile) + + if err != nil { + return err + } + + *o = IPSecProfile(varIPSecProfile) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "ike_policy") + delete(additionalProperties, "ipsec_policy") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPSecProfile struct { + value *IPSecProfile + isSet bool +} + +func (v NullableIPSecProfile) Get() *IPSecProfile { + return v.value +} + +func (v *NullableIPSecProfile) Set(val *IPSecProfile) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecProfile(val *IPSecProfile) *NullableIPSecProfile { + return &NullableIPSecProfile{value: val, isSet: true} +} + +func (v NullableIPSecProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode.go new file mode 100644 index 00000000..e0e0ccd6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the IPSecProfileMode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPSecProfileMode{} + +// IPSecProfileMode struct for IPSecProfileMode +type IPSecProfileMode struct { + Value *IPSecProfileModeValue `json:"value,omitempty"` + Label *IPSecProfileModeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPSecProfileMode IPSecProfileMode + +// NewIPSecProfileMode instantiates a new IPSecProfileMode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPSecProfileMode() *IPSecProfileMode { + this := IPSecProfileMode{} + return &this +} + +// NewIPSecProfileModeWithDefaults instantiates a new IPSecProfileMode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPSecProfileModeWithDefaults() *IPSecProfileMode { + this := IPSecProfileMode{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IPSecProfileMode) GetValue() IPSecProfileModeValue { + if o == nil || IsNil(o.Value) { + var ret IPSecProfileModeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfileMode) GetValueOk() (*IPSecProfileModeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IPSecProfileMode) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given IPSecProfileModeValue and assigns it to the Value field. +func (o *IPSecProfileMode) SetValue(v IPSecProfileModeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *IPSecProfileMode) GetLabel() IPSecProfileModeLabel { + if o == nil || IsNil(o.Label) { + var ret IPSecProfileModeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfileMode) GetLabelOk() (*IPSecProfileModeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *IPSecProfileMode) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given IPSecProfileModeLabel and assigns it to the Label field. +func (o *IPSecProfileMode) SetLabel(v IPSecProfileModeLabel) { + o.Label = &v +} + +func (o IPSecProfileMode) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPSecProfileMode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPSecProfileMode) UnmarshalJSON(data []byte) (err error) { + varIPSecProfileMode := _IPSecProfileMode{} + + err = json.Unmarshal(data, &varIPSecProfileMode) + + if err != nil { + return err + } + + *o = IPSecProfileMode(varIPSecProfileMode) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPSecProfileMode struct { + value *IPSecProfileMode + isSet bool +} + +func (v NullableIPSecProfileMode) Get() *IPSecProfileMode { + return v.value +} + +func (v *NullableIPSecProfileMode) Set(val *IPSecProfileMode) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecProfileMode) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecProfileMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecProfileMode(val *IPSecProfileMode) *NullableIPSecProfileMode { + return &NullableIPSecProfileMode{value: val, isSet: true} +} + +func (v NullableIPSecProfileMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecProfileMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode_label.go new file mode 100644 index 00000000..690de7b0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPSecProfileModeLabel the model 'IPSecProfileModeLabel' +type IPSecProfileModeLabel string + +// List of IPSecProfile_mode_label +const ( + IPSECPROFILEMODELABEL_ESP IPSecProfileModeLabel = "ESP" + IPSECPROFILEMODELABEL_AH IPSecProfileModeLabel = "AH" +) + +// All allowed values of IPSecProfileModeLabel enum +var AllowedIPSecProfileModeLabelEnumValues = []IPSecProfileModeLabel{ + "ESP", + "AH", +} + +func (v *IPSecProfileModeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPSecProfileModeLabel(value) + for _, existing := range AllowedIPSecProfileModeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPSecProfileModeLabel", value) +} + +// NewIPSecProfileModeLabelFromValue returns a pointer to a valid IPSecProfileModeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPSecProfileModeLabelFromValue(v string) (*IPSecProfileModeLabel, error) { + ev := IPSecProfileModeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPSecProfileModeLabel: valid values are %v", v, AllowedIPSecProfileModeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPSecProfileModeLabel) IsValid() bool { + for _, existing := range AllowedIPSecProfileModeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPSecProfile_mode_label value +func (v IPSecProfileModeLabel) Ptr() *IPSecProfileModeLabel { + return &v +} + +type NullableIPSecProfileModeLabel struct { + value *IPSecProfileModeLabel + isSet bool +} + +func (v NullableIPSecProfileModeLabel) Get() *IPSecProfileModeLabel { + return v.value +} + +func (v *NullableIPSecProfileModeLabel) Set(val *IPSecProfileModeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecProfileModeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecProfileModeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecProfileModeLabel(val *IPSecProfileModeLabel) *NullableIPSecProfileModeLabel { + return &NullableIPSecProfileModeLabel{value: val, isSet: true} +} + +func (v NullableIPSecProfileModeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecProfileModeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode_value.go new file mode 100644 index 00000000..1cf822ee --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_mode_value.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// IPSecProfileModeValue * `esp` - ESP * `ah` - AH +type IPSecProfileModeValue string + +// List of IPSecProfile_mode_value +const ( + IPSECPROFILEMODEVALUE_ESP IPSecProfileModeValue = "esp" + IPSECPROFILEMODEVALUE_AH IPSecProfileModeValue = "ah" +) + +// All allowed values of IPSecProfileModeValue enum +var AllowedIPSecProfileModeValueEnumValues = []IPSecProfileModeValue{ + "esp", + "ah", +} + +func (v *IPSecProfileModeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPSecProfileModeValue(value) + for _, existing := range AllowedIPSecProfileModeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPSecProfileModeValue", value) +} + +// NewIPSecProfileModeValueFromValue returns a pointer to a valid IPSecProfileModeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPSecProfileModeValueFromValue(v string) (*IPSecProfileModeValue, error) { + ev := IPSecProfileModeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPSecProfileModeValue: valid values are %v", v, AllowedIPSecProfileModeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPSecProfileModeValue) IsValid() bool { + for _, existing := range AllowedIPSecProfileModeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPSecProfile_mode_value value +func (v IPSecProfileModeValue) Ptr() *IPSecProfileModeValue { + return &v +} + +type NullableIPSecProfileModeValue struct { + value *IPSecProfileModeValue + isSet bool +} + +func (v NullableIPSecProfileModeValue) Get() *IPSecProfileModeValue { + return v.value +} + +func (v *NullableIPSecProfileModeValue) Set(val *IPSecProfileModeValue) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecProfileModeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecProfileModeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecProfileModeValue(val *IPSecProfileModeValue) *NullableIPSecProfileModeValue { + return &NullableIPSecProfileModeValue{value: val, isSet: true} +} + +func (v NullableIPSecProfileModeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecProfileModeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_request.go new file mode 100644 index 00000000..59cd5349 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_profile_request.go @@ -0,0 +1,401 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the IPSecProfileRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPSecProfileRequest{} + +// IPSecProfileRequest Adds support for custom fields and tags. +type IPSecProfileRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Mode IPSecProfileModeValue `json:"mode"` + IkePolicy NestedIKEPolicyRequest `json:"ike_policy"` + IpsecPolicy NestedIPSecPolicyRequest `json:"ipsec_policy"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPSecProfileRequest IPSecProfileRequest + +// NewIPSecProfileRequest instantiates a new IPSecProfileRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPSecProfileRequest(name string, mode IPSecProfileModeValue, ikePolicy NestedIKEPolicyRequest, ipsecPolicy NestedIPSecPolicyRequest) *IPSecProfileRequest { + this := IPSecProfileRequest{} + this.Name = name + this.Mode = mode + this.IkePolicy = ikePolicy + this.IpsecPolicy = ipsecPolicy + return &this +} + +// NewIPSecProfileRequestWithDefaults instantiates a new IPSecProfileRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPSecProfileRequestWithDefaults() *IPSecProfileRequest { + this := IPSecProfileRequest{} + return &this +} + +// GetName returns the Name field value +func (o *IPSecProfileRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IPSecProfileRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPSecProfileRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPSecProfileRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPSecProfileRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value +func (o *IPSecProfileRequest) GetMode() IPSecProfileModeValue { + if o == nil { + var ret IPSecProfileModeValue + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetModeOk() (*IPSecProfileModeValue, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *IPSecProfileRequest) SetMode(v IPSecProfileModeValue) { + o.Mode = v +} + +// GetIkePolicy returns the IkePolicy field value +func (o *IPSecProfileRequest) GetIkePolicy() NestedIKEPolicyRequest { + if o == nil { + var ret NestedIKEPolicyRequest + return ret + } + + return o.IkePolicy +} + +// GetIkePolicyOk returns a tuple with the IkePolicy field value +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetIkePolicyOk() (*NestedIKEPolicyRequest, bool) { + if o == nil { + return nil, false + } + return &o.IkePolicy, true +} + +// SetIkePolicy sets field value +func (o *IPSecProfileRequest) SetIkePolicy(v NestedIKEPolicyRequest) { + o.IkePolicy = v +} + +// GetIpsecPolicy returns the IpsecPolicy field value +func (o *IPSecProfileRequest) GetIpsecPolicy() NestedIPSecPolicyRequest { + if o == nil { + var ret NestedIPSecPolicyRequest + return ret + } + + return o.IpsecPolicy +} + +// GetIpsecPolicyOk returns a tuple with the IpsecPolicy field value +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetIpsecPolicyOk() (*NestedIPSecPolicyRequest, bool) { + if o == nil { + return nil, false + } + return &o.IpsecPolicy, true +} + +// SetIpsecPolicy sets field value +func (o *IPSecProfileRequest) SetIpsecPolicy(v NestedIPSecPolicyRequest) { + o.IpsecPolicy = v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPSecProfileRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPSecProfileRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPSecProfileRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPSecProfileRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPSecProfileRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *IPSecProfileRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPSecProfileRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProfileRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPSecProfileRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPSecProfileRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o IPSecProfileRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPSecProfileRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["mode"] = o.Mode + toSerialize["ike_policy"] = o.IkePolicy + toSerialize["ipsec_policy"] = o.IpsecPolicy + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPSecProfileRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mode", + "ike_policy", + "ipsec_policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPSecProfileRequest := _IPSecProfileRequest{} + + err = json.Unmarshal(data, &varIPSecProfileRequest) + + if err != nil { + return err + } + + *o = IPSecProfileRequest(varIPSecProfileRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "ike_policy") + delete(additionalProperties, "ipsec_policy") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPSecProfileRequest struct { + value *IPSecProfileRequest + isSet bool +} + +func (v NullableIPSecProfileRequest) Get() *IPSecProfileRequest { + return v.value +} + +func (v *NullableIPSecProfileRequest) Set(val *IPSecProfileRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecProfileRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecProfileRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecProfileRequest(val *IPSecProfileRequest) *NullableIPSecProfileRequest { + return &NullableIPSecProfileRequest{value: val, isSet: true} +} + +func (v NullableIPSecProfileRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecProfileRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_proposal.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_proposal.go new file mode 100644 index 00000000..1a8c9057 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_proposal.go @@ -0,0 +1,620 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IPSecProposal type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPSecProposal{} + +// IPSecProposal Adds support for custom fields and tags. +type IPSecProposal struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + EncryptionAlgorithm IKEProposalEncryptionAlgorithm `json:"encryption_algorithm"` + AuthenticationAlgorithm IKEProposalAuthenticationAlgorithm `json:"authentication_algorithm"` + // Security association lifetime (seconds) + SaLifetimeSeconds NullableInt32 `json:"sa_lifetime_seconds,omitempty"` + // Security association lifetime (in kilobytes) + SaLifetimeData NullableInt32 `json:"sa_lifetime_data,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _IPSecProposal IPSecProposal + +// NewIPSecProposal instantiates a new IPSecProposal object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPSecProposal(id int32, url string, display string, name string, encryptionAlgorithm IKEProposalEncryptionAlgorithm, authenticationAlgorithm IKEProposalAuthenticationAlgorithm, created NullableTime, lastUpdated NullableTime) *IPSecProposal { + this := IPSecProposal{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.EncryptionAlgorithm = encryptionAlgorithm + this.AuthenticationAlgorithm = authenticationAlgorithm + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewIPSecProposalWithDefaults instantiates a new IPSecProposal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPSecProposalWithDefaults() *IPSecProposal { + this := IPSecProposal{} + return &this +} + +// GetId returns the Id field value +func (o *IPSecProposal) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *IPSecProposal) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *IPSecProposal) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *IPSecProposal) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *IPSecProposal) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *IPSecProposal) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *IPSecProposal) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IPSecProposal) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPSecProposal) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPSecProposal) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPSecProposal) SetDescription(v string) { + o.Description = &v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value +func (o *IPSecProposal) GetEncryptionAlgorithm() IKEProposalEncryptionAlgorithm { + if o == nil { + var ret IKEProposalEncryptionAlgorithm + return ret + } + + return o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetEncryptionAlgorithmOk() (*IKEProposalEncryptionAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.EncryptionAlgorithm, true +} + +// SetEncryptionAlgorithm sets field value +func (o *IPSecProposal) SetEncryptionAlgorithm(v IKEProposalEncryptionAlgorithm) { + o.EncryptionAlgorithm = v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value +func (o *IPSecProposal) GetAuthenticationAlgorithm() IKEProposalAuthenticationAlgorithm { + if o == nil { + var ret IKEProposalAuthenticationAlgorithm + return ret + } + + return o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetAuthenticationAlgorithmOk() (*IKEProposalAuthenticationAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationAlgorithm, true +} + +// SetAuthenticationAlgorithm sets field value +func (o *IPSecProposal) SetAuthenticationAlgorithm(v IKEProposalAuthenticationAlgorithm) { + o.AuthenticationAlgorithm = v +} + +// GetSaLifetimeSeconds returns the SaLifetimeSeconds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPSecProposal) GetSaLifetimeSeconds() int32 { + if o == nil || IsNil(o.SaLifetimeSeconds.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeSeconds.Get() +} + +// GetSaLifetimeSecondsOk returns a tuple with the SaLifetimeSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProposal) GetSaLifetimeSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeSeconds.Get(), o.SaLifetimeSeconds.IsSet() +} + +// HasSaLifetimeSeconds returns a boolean if a field has been set. +func (o *IPSecProposal) HasSaLifetimeSeconds() bool { + if o != nil && o.SaLifetimeSeconds.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeSeconds gets a reference to the given NullableInt32 and assigns it to the SaLifetimeSeconds field. +func (o *IPSecProposal) SetSaLifetimeSeconds(v int32) { + o.SaLifetimeSeconds.Set(&v) +} + +// SetSaLifetimeSecondsNil sets the value for SaLifetimeSeconds to be an explicit nil +func (o *IPSecProposal) SetSaLifetimeSecondsNil() { + o.SaLifetimeSeconds.Set(nil) +} + +// UnsetSaLifetimeSeconds ensures that no value is present for SaLifetimeSeconds, not even an explicit nil +func (o *IPSecProposal) UnsetSaLifetimeSeconds() { + o.SaLifetimeSeconds.Unset() +} + +// GetSaLifetimeData returns the SaLifetimeData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPSecProposal) GetSaLifetimeData() int32 { + if o == nil || IsNil(o.SaLifetimeData.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeData.Get() +} + +// GetSaLifetimeDataOk returns a tuple with the SaLifetimeData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProposal) GetSaLifetimeDataOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeData.Get(), o.SaLifetimeData.IsSet() +} + +// HasSaLifetimeData returns a boolean if a field has been set. +func (o *IPSecProposal) HasSaLifetimeData() bool { + if o != nil && o.SaLifetimeData.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeData gets a reference to the given NullableInt32 and assigns it to the SaLifetimeData field. +func (o *IPSecProposal) SetSaLifetimeData(v int32) { + o.SaLifetimeData.Set(&v) +} + +// SetSaLifetimeDataNil sets the value for SaLifetimeData to be an explicit nil +func (o *IPSecProposal) SetSaLifetimeDataNil() { + o.SaLifetimeData.Set(nil) +} + +// UnsetSaLifetimeData ensures that no value is present for SaLifetimeData, not even an explicit nil +func (o *IPSecProposal) UnsetSaLifetimeData() { + o.SaLifetimeData.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPSecProposal) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPSecProposal) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPSecProposal) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPSecProposal) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPSecProposal) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *IPSecProposal) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPSecProposal) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposal) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPSecProposal) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPSecProposal) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPSecProposal) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProposal) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *IPSecProposal) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *IPSecProposal) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProposal) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *IPSecProposal) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o IPSecProposal) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPSecProposal) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + if o.SaLifetimeSeconds.IsSet() { + toSerialize["sa_lifetime_seconds"] = o.SaLifetimeSeconds.Get() + } + if o.SaLifetimeData.IsSet() { + toSerialize["sa_lifetime_data"] = o.SaLifetimeData.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPSecProposal) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "encryption_algorithm", + "authentication_algorithm", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPSecProposal := _IPSecProposal{} + + err = json.Unmarshal(data, &varIPSecProposal) + + if err != nil { + return err + } + + *o = IPSecProposal(varIPSecProposal) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "sa_lifetime_seconds") + delete(additionalProperties, "sa_lifetime_data") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPSecProposal struct { + value *IPSecProposal + isSet bool +} + +func (v NullableIPSecProposal) Get() *IPSecProposal { + return v.value +} + +func (v *NullableIPSecProposal) Set(val *IPSecProposal) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecProposal) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecProposal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecProposal(val *IPSecProposal) *NullableIPSecProposal { + return &NullableIPSecProposal{value: val, isSet: true} +} + +func (v NullableIPSecProposal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecProposal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_proposal_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_proposal_request.go new file mode 100644 index 00000000..8180a5aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_ip_sec_proposal_request.go @@ -0,0 +1,470 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the IPSecProposalRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPSecProposalRequest{} + +// IPSecProposalRequest Adds support for custom fields and tags. +type IPSecProposalRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + EncryptionAlgorithm IKEProposalEncryptionAlgorithmValue `json:"encryption_algorithm"` + AuthenticationAlgorithm IKEProposalAuthenticationAlgorithmValue `json:"authentication_algorithm"` + // Security association lifetime (seconds) + SaLifetimeSeconds NullableInt32 `json:"sa_lifetime_seconds,omitempty"` + // Security association lifetime (in kilobytes) + SaLifetimeData NullableInt32 `json:"sa_lifetime_data,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPSecProposalRequest IPSecProposalRequest + +// NewIPSecProposalRequest instantiates a new IPSecProposalRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPSecProposalRequest(name string, encryptionAlgorithm IKEProposalEncryptionAlgorithmValue, authenticationAlgorithm IKEProposalAuthenticationAlgorithmValue) *IPSecProposalRequest { + this := IPSecProposalRequest{} + this.Name = name + this.EncryptionAlgorithm = encryptionAlgorithm + this.AuthenticationAlgorithm = authenticationAlgorithm + return &this +} + +// NewIPSecProposalRequestWithDefaults instantiates a new IPSecProposalRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPSecProposalRequestWithDefaults() *IPSecProposalRequest { + this := IPSecProposalRequest{} + return &this +} + +// GetName returns the Name field value +func (o *IPSecProposalRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IPSecProposalRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IPSecProposalRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *IPSecProposalRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposalRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *IPSecProposalRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *IPSecProposalRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value +func (o *IPSecProposalRequest) GetEncryptionAlgorithm() IKEProposalEncryptionAlgorithmValue { + if o == nil { + var ret IKEProposalEncryptionAlgorithmValue + return ret + } + + return o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IPSecProposalRequest) GetEncryptionAlgorithmOk() (*IKEProposalEncryptionAlgorithmValue, bool) { + if o == nil { + return nil, false + } + return &o.EncryptionAlgorithm, true +} + +// SetEncryptionAlgorithm sets field value +func (o *IPSecProposalRequest) SetEncryptionAlgorithm(v IKEProposalEncryptionAlgorithmValue) { + o.EncryptionAlgorithm = v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value +func (o *IPSecProposalRequest) GetAuthenticationAlgorithm() IKEProposalAuthenticationAlgorithmValue { + if o == nil { + var ret IKEProposalAuthenticationAlgorithmValue + return ret + } + + return o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value +// and a boolean to check if the value has been set. +func (o *IPSecProposalRequest) GetAuthenticationAlgorithmOk() (*IKEProposalAuthenticationAlgorithmValue, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationAlgorithm, true +} + +// SetAuthenticationAlgorithm sets field value +func (o *IPSecProposalRequest) SetAuthenticationAlgorithm(v IKEProposalAuthenticationAlgorithmValue) { + o.AuthenticationAlgorithm = v +} + +// GetSaLifetimeSeconds returns the SaLifetimeSeconds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPSecProposalRequest) GetSaLifetimeSeconds() int32 { + if o == nil || IsNil(o.SaLifetimeSeconds.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeSeconds.Get() +} + +// GetSaLifetimeSecondsOk returns a tuple with the SaLifetimeSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProposalRequest) GetSaLifetimeSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeSeconds.Get(), o.SaLifetimeSeconds.IsSet() +} + +// HasSaLifetimeSeconds returns a boolean if a field has been set. +func (o *IPSecProposalRequest) HasSaLifetimeSeconds() bool { + if o != nil && o.SaLifetimeSeconds.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeSeconds gets a reference to the given NullableInt32 and assigns it to the SaLifetimeSeconds field. +func (o *IPSecProposalRequest) SetSaLifetimeSeconds(v int32) { + o.SaLifetimeSeconds.Set(&v) +} + +// SetSaLifetimeSecondsNil sets the value for SaLifetimeSeconds to be an explicit nil +func (o *IPSecProposalRequest) SetSaLifetimeSecondsNil() { + o.SaLifetimeSeconds.Set(nil) +} + +// UnsetSaLifetimeSeconds ensures that no value is present for SaLifetimeSeconds, not even an explicit nil +func (o *IPSecProposalRequest) UnsetSaLifetimeSeconds() { + o.SaLifetimeSeconds.Unset() +} + +// GetSaLifetimeData returns the SaLifetimeData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IPSecProposalRequest) GetSaLifetimeData() int32 { + if o == nil || IsNil(o.SaLifetimeData.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeData.Get() +} + +// GetSaLifetimeDataOk returns a tuple with the SaLifetimeData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IPSecProposalRequest) GetSaLifetimeDataOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeData.Get(), o.SaLifetimeData.IsSet() +} + +// HasSaLifetimeData returns a boolean if a field has been set. +func (o *IPSecProposalRequest) HasSaLifetimeData() bool { + if o != nil && o.SaLifetimeData.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeData gets a reference to the given NullableInt32 and assigns it to the SaLifetimeData field. +func (o *IPSecProposalRequest) SetSaLifetimeData(v int32) { + o.SaLifetimeData.Set(&v) +} + +// SetSaLifetimeDataNil sets the value for SaLifetimeData to be an explicit nil +func (o *IPSecProposalRequest) SetSaLifetimeDataNil() { + o.SaLifetimeData.Set(nil) +} + +// UnsetSaLifetimeData ensures that no value is present for SaLifetimeData, not even an explicit nil +func (o *IPSecProposalRequest) UnsetSaLifetimeData() { + o.SaLifetimeData.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPSecProposalRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposalRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPSecProposalRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPSecProposalRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPSecProposalRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposalRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPSecProposalRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *IPSecProposalRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *IPSecProposalRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPSecProposalRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *IPSecProposalRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *IPSecProposalRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o IPSecProposalRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPSecProposalRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + if o.SaLifetimeSeconds.IsSet() { + toSerialize["sa_lifetime_seconds"] = o.SaLifetimeSeconds.Get() + } + if o.SaLifetimeData.IsSet() { + toSerialize["sa_lifetime_data"] = o.SaLifetimeData.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPSecProposalRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "encryption_algorithm", + "authentication_algorithm", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPSecProposalRequest := _IPSecProposalRequest{} + + err = json.Unmarshal(data, &varIPSecProposalRequest) + + if err != nil { + return err + } + + *o = IPSecProposalRequest(varIPSecProposalRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "sa_lifetime_seconds") + delete(additionalProperties, "sa_lifetime_data") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPSecProposalRequest struct { + value *IPSecProposalRequest + isSet bool +} + +func (v NullableIPSecProposalRequest) Get() *IPSecProposalRequest { + return v.value +} + +func (v *NullableIPSecProposalRequest) Set(val *IPSecProposalRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIPSecProposalRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIPSecProposalRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPSecProposalRequest(val *IPSecProposalRequest) *NullableIPSecProposalRequest { + return &NullableIPSecProposalRequest{value: val, isSet: true} +} + +func (v NullableIPSecProposalRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPSecProposalRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_job.go b/vendor/github.com/netbox-community/go-netbox/v3/model_job.go new file mode 100644 index 00000000..e0922e83 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_job.go @@ -0,0 +1,707 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Job type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Job{} + +// Job struct for Job +type Job struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ObjectType string `json:"object_type"` + ObjectId NullableInt64 `json:"object_id,omitempty"` + Name string `json:"name"` + Status JobStatus `json:"status"` + Created time.Time `json:"created"` + Scheduled NullableTime `json:"scheduled,omitempty"` + // Recurrence interval (in minutes) + Interval NullableInt32 `json:"interval,omitempty"` + Started NullableTime `json:"started,omitempty"` + Completed NullableTime `json:"completed,omitempty"` + User NestedUser `json:"user"` + Data interface{} `json:"data,omitempty"` + Error string `json:"error"` + JobId string `json:"job_id"` + AdditionalProperties map[string]interface{} +} + +type _Job Job + +// NewJob instantiates a new Job object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJob(id int32, url string, display string, objectType string, name string, status JobStatus, created time.Time, user NestedUser, error_ string, jobId string) *Job { + this := Job{} + this.Id = id + this.Url = url + this.Display = display + this.ObjectType = objectType + this.Name = name + this.Status = status + this.Created = created + this.User = user + this.Error = error_ + this.JobId = jobId + return &this +} + +// NewJobWithDefaults instantiates a new Job object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJobWithDefaults() *Job { + this := Job{} + return &this +} + +// GetId returns the Id field value +func (o *Job) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Job) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Job) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Job) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Job) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Job) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Job) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Job) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Job) SetDisplay(v string) { + o.Display = v +} + +// GetObjectType returns the ObjectType field value +func (o *Job) GetObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectType +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value +// and a boolean to check if the value has been set. +func (o *Job) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectType, true +} + +// SetObjectType sets field value +func (o *Job) SetObjectType(v string) { + o.ObjectType = v +} + +// GetObjectId returns the ObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetObjectId() int64 { + if o == nil || IsNil(o.ObjectId.Get()) { + var ret int64 + return ret + } + return *o.ObjectId.Get() +} + +// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Job) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ObjectId.Get(), o.ObjectId.IsSet() +} + +// HasObjectId returns a boolean if a field has been set. +func (o *Job) HasObjectId() bool { + if o != nil && o.ObjectId.IsSet() { + return true + } + + return false +} + +// SetObjectId gets a reference to the given NullableInt64 and assigns it to the ObjectId field. +func (o *Job) SetObjectId(v int64) { + o.ObjectId.Set(&v) +} + +// SetObjectIdNil sets the value for ObjectId to be an explicit nil +func (o *Job) SetObjectIdNil() { + o.ObjectId.Set(nil) +} + +// UnsetObjectId ensures that no value is present for ObjectId, not even an explicit nil +func (o *Job) UnsetObjectId() { + o.ObjectId.Unset() +} + +// GetName returns the Name field value +func (o *Job) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Job) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Job) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *Job) GetStatus() JobStatus { + if o == nil { + var ret JobStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Job) GetStatusOk() (*JobStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Job) SetStatus(v JobStatus) { + o.Status = v +} + +// GetCreated returns the Created field value +func (o *Job) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Job) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Job) SetCreated(v time.Time) { + o.Created = v +} + +// GetScheduled returns the Scheduled field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetScheduled() time.Time { + if o == nil || IsNil(o.Scheduled.Get()) { + var ret time.Time + return ret + } + return *o.Scheduled.Get() +} + +// GetScheduledOk returns a tuple with the Scheduled field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Job) GetScheduledOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Scheduled.Get(), o.Scheduled.IsSet() +} + +// HasScheduled returns a boolean if a field has been set. +func (o *Job) HasScheduled() bool { + if o != nil && o.Scheduled.IsSet() { + return true + } + + return false +} + +// SetScheduled gets a reference to the given NullableTime and assigns it to the Scheduled field. +func (o *Job) SetScheduled(v time.Time) { + o.Scheduled.Set(&v) +} + +// SetScheduledNil sets the value for Scheduled to be an explicit nil +func (o *Job) SetScheduledNil() { + o.Scheduled.Set(nil) +} + +// UnsetScheduled ensures that no value is present for Scheduled, not even an explicit nil +func (o *Job) UnsetScheduled() { + o.Scheduled.Unset() +} + +// GetInterval returns the Interval field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetInterval() int32 { + if o == nil || IsNil(o.Interval.Get()) { + var ret int32 + return ret + } + return *o.Interval.Get() +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Job) GetIntervalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Interval.Get(), o.Interval.IsSet() +} + +// HasInterval returns a boolean if a field has been set. +func (o *Job) HasInterval() bool { + if o != nil && o.Interval.IsSet() { + return true + } + + return false +} + +// SetInterval gets a reference to the given NullableInt32 and assigns it to the Interval field. +func (o *Job) SetInterval(v int32) { + o.Interval.Set(&v) +} + +// SetIntervalNil sets the value for Interval to be an explicit nil +func (o *Job) SetIntervalNil() { + o.Interval.Set(nil) +} + +// UnsetInterval ensures that no value is present for Interval, not even an explicit nil +func (o *Job) UnsetInterval() { + o.Interval.Unset() +} + +// GetStarted returns the Started field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetStarted() time.Time { + if o == nil || IsNil(o.Started.Get()) { + var ret time.Time + return ret + } + return *o.Started.Get() +} + +// GetStartedOk returns a tuple with the Started field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Job) GetStartedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Started.Get(), o.Started.IsSet() +} + +// HasStarted returns a boolean if a field has been set. +func (o *Job) HasStarted() bool { + if o != nil && o.Started.IsSet() { + return true + } + + return false +} + +// SetStarted gets a reference to the given NullableTime and assigns it to the Started field. +func (o *Job) SetStarted(v time.Time) { + o.Started.Set(&v) +} + +// SetStartedNil sets the value for Started to be an explicit nil +func (o *Job) SetStartedNil() { + o.Started.Set(nil) +} + +// UnsetStarted ensures that no value is present for Started, not even an explicit nil +func (o *Job) UnsetStarted() { + o.Started.Unset() +} + +// GetCompleted returns the Completed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetCompleted() time.Time { + if o == nil || IsNil(o.Completed.Get()) { + var ret time.Time + return ret + } + return *o.Completed.Get() +} + +// GetCompletedOk returns a tuple with the Completed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Job) GetCompletedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Completed.Get(), o.Completed.IsSet() +} + +// HasCompleted returns a boolean if a field has been set. +func (o *Job) HasCompleted() bool { + if o != nil && o.Completed.IsSet() { + return true + } + + return false +} + +// SetCompleted gets a reference to the given NullableTime and assigns it to the Completed field. +func (o *Job) SetCompleted(v time.Time) { + o.Completed.Set(&v) +} + +// SetCompletedNil sets the value for Completed to be an explicit nil +func (o *Job) SetCompletedNil() { + o.Completed.Set(nil) +} + +// UnsetCompleted ensures that no value is present for Completed, not even an explicit nil +func (o *Job) UnsetCompleted() { + o.Completed.Unset() +} + +// GetUser returns the User field value +func (o *Job) GetUser() NestedUser { + if o == nil { + var ret NestedUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *Job) GetUserOk() (*NestedUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *Job) SetUser(v NestedUser) { + o.User = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Job) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *Job) HasData() bool { + if o != nil && IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *Job) SetData(v interface{}) { + o.Data = v +} + +// GetError returns the Error field value +func (o *Job) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Job) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Job) SetError(v string) { + o.Error = v +} + +// GetJobId returns the JobId field value +func (o *Job) GetJobId() string { + if o == nil { + var ret string + return ret + } + + return o.JobId +} + +// GetJobIdOk returns a tuple with the JobId field value +// and a boolean to check if the value has been set. +func (o *Job) GetJobIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JobId, true +} + +// SetJobId sets field value +func (o *Job) SetJobId(v string) { + o.JobId = v +} + +func (o Job) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Job) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["object_type"] = o.ObjectType + if o.ObjectId.IsSet() { + toSerialize["object_id"] = o.ObjectId.Get() + } + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + toSerialize["created"] = o.Created + if o.Scheduled.IsSet() { + toSerialize["scheduled"] = o.Scheduled.Get() + } + if o.Interval.IsSet() { + toSerialize["interval"] = o.Interval.Get() + } + if o.Started.IsSet() { + toSerialize["started"] = o.Started.Get() + } + if o.Completed.IsSet() { + toSerialize["completed"] = o.Completed.Get() + } + toSerialize["user"] = o.User + if o.Data != nil { + toSerialize["data"] = o.Data + } + toSerialize["error"] = o.Error + toSerialize["job_id"] = o.JobId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Job) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "object_type", + "name", + "status", + "created", + "user", + "error", + "job_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varJob := _Job{} + + err = json.Unmarshal(data, &varJob) + + if err != nil { + return err + } + + *o = Job(varJob) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "object_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "created") + delete(additionalProperties, "scheduled") + delete(additionalProperties, "interval") + delete(additionalProperties, "started") + delete(additionalProperties, "completed") + delete(additionalProperties, "user") + delete(additionalProperties, "data") + delete(additionalProperties, "error") + delete(additionalProperties, "job_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJob struct { + value *Job + isSet bool +} + +func (v NullableJob) Get() *Job { + return v.value +} + +func (v *NullableJob) Set(val *Job) { + v.value = val + v.isSet = true +} + +func (v NullableJob) IsSet() bool { + return v.isSet +} + +func (v *NullableJob) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJob(val *Job) *NullableJob { + return &NullableJob{value: val, isSet: true} +} + +func (v NullableJob) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJob) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_job_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_job_status.go new file mode 100644 index 00000000..e1e45b93 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_job_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the JobStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JobStatus{} + +// JobStatus struct for JobStatus +type JobStatus struct { + Value *JobStatusValue `json:"value,omitempty"` + Label *JobStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _JobStatus JobStatus + +// NewJobStatus instantiates a new JobStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJobStatus() *JobStatus { + this := JobStatus{} + return &this +} + +// NewJobStatusWithDefaults instantiates a new JobStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJobStatusWithDefaults() *JobStatus { + this := JobStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *JobStatus) GetValue() JobStatusValue { + if o == nil || IsNil(o.Value) { + var ret JobStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JobStatus) GetValueOk() (*JobStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *JobStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given JobStatusValue and assigns it to the Value field. +func (o *JobStatus) SetValue(v JobStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *JobStatus) GetLabel() JobStatusLabel { + if o == nil || IsNil(o.Label) { + var ret JobStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JobStatus) GetLabelOk() (*JobStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *JobStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given JobStatusLabel and assigns it to the Label field. +func (o *JobStatus) SetLabel(v JobStatusLabel) { + o.Label = &v +} + +func (o JobStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JobStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *JobStatus) UnmarshalJSON(data []byte) (err error) { + varJobStatus := _JobStatus{} + + err = json.Unmarshal(data, &varJobStatus) + + if err != nil { + return err + } + + *o = JobStatus(varJobStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJobStatus struct { + value *JobStatus + isSet bool +} + +func (v NullableJobStatus) Get() *JobStatus { + return v.value +} + +func (v *NullableJobStatus) Set(val *JobStatus) { + v.value = val + v.isSet = true +} + +func (v NullableJobStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableJobStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJobStatus(val *JobStatus) *NullableJobStatus { + return &NullableJobStatus{value: val, isSet: true} +} + +func (v NullableJobStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJobStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_job_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_job_status_label.go new file mode 100644 index 00000000..9e3a26fc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_job_status_label.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// JobStatusLabel the model 'JobStatusLabel' +type JobStatusLabel string + +// List of Job_status_label +const ( + JOBSTATUSLABEL_PENDING JobStatusLabel = "Pending" + JOBSTATUSLABEL_SCHEDULED JobStatusLabel = "Scheduled" + JOBSTATUSLABEL_RUNNING JobStatusLabel = "Running" + JOBSTATUSLABEL_COMPLETED JobStatusLabel = "Completed" + JOBSTATUSLABEL_ERRORED JobStatusLabel = "Errored" + JOBSTATUSLABEL_FAILED JobStatusLabel = "Failed" +) + +// All allowed values of JobStatusLabel enum +var AllowedJobStatusLabelEnumValues = []JobStatusLabel{ + "Pending", + "Scheduled", + "Running", + "Completed", + "Errored", + "Failed", +} + +func (v *JobStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := JobStatusLabel(value) + for _, existing := range AllowedJobStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid JobStatusLabel", value) +} + +// NewJobStatusLabelFromValue returns a pointer to a valid JobStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewJobStatusLabelFromValue(v string) (*JobStatusLabel, error) { + ev := JobStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for JobStatusLabel: valid values are %v", v, AllowedJobStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v JobStatusLabel) IsValid() bool { + for _, existing := range AllowedJobStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Job_status_label value +func (v JobStatusLabel) Ptr() *JobStatusLabel { + return &v +} + +type NullableJobStatusLabel struct { + value *JobStatusLabel + isSet bool +} + +func (v NullableJobStatusLabel) Get() *JobStatusLabel { + return v.value +} + +func (v *NullableJobStatusLabel) Set(val *JobStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableJobStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableJobStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJobStatusLabel(val *JobStatusLabel) *NullableJobStatusLabel { + return &NullableJobStatusLabel{value: val, isSet: true} +} + +func (v NullableJobStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJobStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_job_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_job_status_value.go new file mode 100644 index 00000000..903f9616 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_job_status_value.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// JobStatusValue * `pending` - Pending * `scheduled` - Scheduled * `running` - Running * `completed` - Completed * `errored` - Errored * `failed` - Failed +type JobStatusValue string + +// List of Job_status_value +const ( + JOBSTATUSVALUE_PENDING JobStatusValue = "pending" + JOBSTATUSVALUE_SCHEDULED JobStatusValue = "scheduled" + JOBSTATUSVALUE_RUNNING JobStatusValue = "running" + JOBSTATUSVALUE_COMPLETED JobStatusValue = "completed" + JOBSTATUSVALUE_ERRORED JobStatusValue = "errored" + JOBSTATUSVALUE_FAILED JobStatusValue = "failed" +) + +// All allowed values of JobStatusValue enum +var AllowedJobStatusValueEnumValues = []JobStatusValue{ + "pending", + "scheduled", + "running", + "completed", + "errored", + "failed", +} + +func (v *JobStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := JobStatusValue(value) + for _, existing := range AllowedJobStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid JobStatusValue", value) +} + +// NewJobStatusValueFromValue returns a pointer to a valid JobStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewJobStatusValueFromValue(v string) (*JobStatusValue, error) { + ev := JobStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for JobStatusValue: valid values are %v", v, AllowedJobStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v JobStatusValue) IsValid() bool { + for _, existing := range AllowedJobStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Job_status_value value +func (v JobStatusValue) Ptr() *JobStatusValue { + return &v +} + +type NullableJobStatusValue struct { + value *JobStatusValue + isSet bool +} + +func (v NullableJobStatusValue) Get() *JobStatusValue { + return v.value +} + +func (v *NullableJobStatusValue) Set(val *JobStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableJobStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableJobStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJobStatusValue(val *JobStatusValue) *NullableJobStatusValue { + return &NullableJobStatusValue{value: val, isSet: true} +} + +func (v NullableJobStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJobStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry.go b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry.go new file mode 100644 index 00000000..be5c4468 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry.go @@ -0,0 +1,566 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the JournalEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JournalEntry{} + +// JournalEntry Adds support for custom fields and tags. +type JournalEntry struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + AssignedObjectType string `json:"assigned_object_type"` + AssignedObjectId int64 `json:"assigned_object_id"` + AssignedObject interface{} `json:"assigned_object"` + Created NullableTime `json:"created"` + CreatedBy NullableInt32 `json:"created_by,omitempty"` + Kind *JournalEntryKind `json:"kind,omitempty"` + Comments string `json:"comments"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _JournalEntry JournalEntry + +// NewJournalEntry instantiates a new JournalEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJournalEntry(id int32, url string, display string, assignedObjectType string, assignedObjectId int64, assignedObject interface{}, created NullableTime, comments string, lastUpdated NullableTime) *JournalEntry { + this := JournalEntry{} + this.Id = id + this.Url = url + this.Display = display + this.AssignedObjectType = assignedObjectType + this.AssignedObjectId = assignedObjectId + this.AssignedObject = assignedObject + this.Created = created + this.Comments = comments + this.LastUpdated = lastUpdated + return &this +} + +// NewJournalEntryWithDefaults instantiates a new JournalEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJournalEntryWithDefaults() *JournalEntry { + this := JournalEntry{} + return &this +} + +// GetId returns the Id field value +func (o *JournalEntry) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *JournalEntry) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *JournalEntry) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *JournalEntry) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *JournalEntry) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *JournalEntry) SetDisplay(v string) { + o.Display = v +} + +// GetAssignedObjectType returns the AssignedObjectType field value +func (o *JournalEntry) GetAssignedObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectType, true +} + +// SetAssignedObjectType sets field value +func (o *JournalEntry) SetAssignedObjectType(v string) { + o.AssignedObjectType = v +} + +// GetAssignedObjectId returns the AssignedObjectId field value +func (o *JournalEntry) GetAssignedObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectId, true +} + +// SetAssignedObjectId sets field value +func (o *JournalEntry) SetAssignedObjectId(v int64) { + o.AssignedObjectId = v +} + +// GetAssignedObject returns the AssignedObject field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *JournalEntry) GetAssignedObject() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.AssignedObject +} + +// GetAssignedObjectOk returns a tuple with the AssignedObject field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *JournalEntry) GetAssignedObjectOk() (*interface{}, bool) { + if o == nil || IsNil(o.AssignedObject) { + return nil, false + } + return &o.AssignedObject, true +} + +// SetAssignedObject sets field value +func (o *JournalEntry) SetAssignedObject(v interface{}) { + o.AssignedObject = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *JournalEntry) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *JournalEntry) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *JournalEntry) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *JournalEntry) GetCreatedBy() int32 { + if o == nil || IsNil(o.CreatedBy.Get()) { + var ret int32 + return ret + } + return *o.CreatedBy.Get() +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *JournalEntry) GetCreatedByOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CreatedBy.Get(), o.CreatedBy.IsSet() +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *JournalEntry) HasCreatedBy() bool { + if o != nil && o.CreatedBy.IsSet() { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given NullableInt32 and assigns it to the CreatedBy field. +func (o *JournalEntry) SetCreatedBy(v int32) { + o.CreatedBy.Set(&v) +} + +// SetCreatedByNil sets the value for CreatedBy to be an explicit nil +func (o *JournalEntry) SetCreatedByNil() { + o.CreatedBy.Set(nil) +} + +// UnsetCreatedBy ensures that no value is present for CreatedBy, not even an explicit nil +func (o *JournalEntry) UnsetCreatedBy() { + o.CreatedBy.Unset() +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *JournalEntry) GetKind() JournalEntryKind { + if o == nil || IsNil(o.Kind) { + var ret JournalEntryKind + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetKindOk() (*JournalEntryKind, bool) { + if o == nil || IsNil(o.Kind) { + return nil, false + } + return o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *JournalEntry) HasKind() bool { + if o != nil && !IsNil(o.Kind) { + return true + } + + return false +} + +// SetKind gets a reference to the given JournalEntryKind and assigns it to the Kind field. +func (o *JournalEntry) SetKind(v JournalEntryKind) { + o.Kind = &v +} + +// GetComments returns the Comments field value +func (o *JournalEntry) GetComments() string { + if o == nil { + var ret string + return ret + } + + return o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetCommentsOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Comments, true +} + +// SetComments sets field value +func (o *JournalEntry) SetComments(v string) { + o.Comments = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *JournalEntry) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *JournalEntry) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *JournalEntry) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *JournalEntry) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntry) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *JournalEntry) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *JournalEntry) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *JournalEntry) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *JournalEntry) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *JournalEntry) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o JournalEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JournalEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["assigned_object_type"] = o.AssignedObjectType + toSerialize["assigned_object_id"] = o.AssignedObjectId + if o.AssignedObject != nil { + toSerialize["assigned_object"] = o.AssignedObject + } + toSerialize["created"] = o.Created.Get() + if o.CreatedBy.IsSet() { + toSerialize["created_by"] = o.CreatedBy.Get() + } + if !IsNil(o.Kind) { + toSerialize["kind"] = o.Kind + } + toSerialize["comments"] = o.Comments + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *JournalEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "assigned_object_type", + "assigned_object_id", + "assigned_object", + "created", + "comments", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varJournalEntry := _JournalEntry{} + + err = json.Unmarshal(data, &varJournalEntry) + + if err != nil { + return err + } + + *o = JournalEntry(varJournalEntry) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "assigned_object") + delete(additionalProperties, "created") + delete(additionalProperties, "created_by") + delete(additionalProperties, "kind") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJournalEntry struct { + value *JournalEntry + isSet bool +} + +func (v NullableJournalEntry) Get() *JournalEntry { + return v.value +} + +func (v *NullableJournalEntry) Set(val *JournalEntry) { + v.value = val + v.isSet = true +} + +func (v NullableJournalEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableJournalEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJournalEntry(val *JournalEntry) *NullableJournalEntry { + return &NullableJournalEntry{value: val, isSet: true} +} + +func (v NullableJournalEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJournalEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind.go b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind.go new file mode 100644 index 00000000..5ded296c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the JournalEntryKind type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JournalEntryKind{} + +// JournalEntryKind struct for JournalEntryKind +type JournalEntryKind struct { + Value *JournalEntryKindValue `json:"value,omitempty"` + Label *JournalEntryKindLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _JournalEntryKind JournalEntryKind + +// NewJournalEntryKind instantiates a new JournalEntryKind object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJournalEntryKind() *JournalEntryKind { + this := JournalEntryKind{} + return &this +} + +// NewJournalEntryKindWithDefaults instantiates a new JournalEntryKind object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJournalEntryKindWithDefaults() *JournalEntryKind { + this := JournalEntryKind{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *JournalEntryKind) GetValue() JournalEntryKindValue { + if o == nil || IsNil(o.Value) { + var ret JournalEntryKindValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntryKind) GetValueOk() (*JournalEntryKindValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *JournalEntryKind) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given JournalEntryKindValue and assigns it to the Value field. +func (o *JournalEntryKind) SetValue(v JournalEntryKindValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *JournalEntryKind) GetLabel() JournalEntryKindLabel { + if o == nil || IsNil(o.Label) { + var ret JournalEntryKindLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntryKind) GetLabelOk() (*JournalEntryKindLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *JournalEntryKind) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given JournalEntryKindLabel and assigns it to the Label field. +func (o *JournalEntryKind) SetLabel(v JournalEntryKindLabel) { + o.Label = &v +} + +func (o JournalEntryKind) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JournalEntryKind) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *JournalEntryKind) UnmarshalJSON(data []byte) (err error) { + varJournalEntryKind := _JournalEntryKind{} + + err = json.Unmarshal(data, &varJournalEntryKind) + + if err != nil { + return err + } + + *o = JournalEntryKind(varJournalEntryKind) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJournalEntryKind struct { + value *JournalEntryKind + isSet bool +} + +func (v NullableJournalEntryKind) Get() *JournalEntryKind { + return v.value +} + +func (v *NullableJournalEntryKind) Set(val *JournalEntryKind) { + v.value = val + v.isSet = true +} + +func (v NullableJournalEntryKind) IsSet() bool { + return v.isSet +} + +func (v *NullableJournalEntryKind) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJournalEntryKind(val *JournalEntryKind) *NullableJournalEntryKind { + return &NullableJournalEntryKind{value: val, isSet: true} +} + +func (v NullableJournalEntryKind) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJournalEntryKind) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind_label.go new file mode 100644 index 00000000..d3b86070 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// JournalEntryKindLabel the model 'JournalEntryKindLabel' +type JournalEntryKindLabel string + +// List of JournalEntry_kind_label +const ( + JOURNALENTRYKINDLABEL_INFO JournalEntryKindLabel = "Info" + JOURNALENTRYKINDLABEL_SUCCESS JournalEntryKindLabel = "Success" + JOURNALENTRYKINDLABEL_WARNING JournalEntryKindLabel = "Warning" + JOURNALENTRYKINDLABEL_DANGER JournalEntryKindLabel = "Danger" +) + +// All allowed values of JournalEntryKindLabel enum +var AllowedJournalEntryKindLabelEnumValues = []JournalEntryKindLabel{ + "Info", + "Success", + "Warning", + "Danger", +} + +func (v *JournalEntryKindLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := JournalEntryKindLabel(value) + for _, existing := range AllowedJournalEntryKindLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid JournalEntryKindLabel", value) +} + +// NewJournalEntryKindLabelFromValue returns a pointer to a valid JournalEntryKindLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewJournalEntryKindLabelFromValue(v string) (*JournalEntryKindLabel, error) { + ev := JournalEntryKindLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for JournalEntryKindLabel: valid values are %v", v, AllowedJournalEntryKindLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v JournalEntryKindLabel) IsValid() bool { + for _, existing := range AllowedJournalEntryKindLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to JournalEntry_kind_label value +func (v JournalEntryKindLabel) Ptr() *JournalEntryKindLabel { + return &v +} + +type NullableJournalEntryKindLabel struct { + value *JournalEntryKindLabel + isSet bool +} + +func (v NullableJournalEntryKindLabel) Get() *JournalEntryKindLabel { + return v.value +} + +func (v *NullableJournalEntryKindLabel) Set(val *JournalEntryKindLabel) { + v.value = val + v.isSet = true +} + +func (v NullableJournalEntryKindLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableJournalEntryKindLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJournalEntryKindLabel(val *JournalEntryKindLabel) *NullableJournalEntryKindLabel { + return &NullableJournalEntryKindLabel{value: val, isSet: true} +} + +func (v NullableJournalEntryKindLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJournalEntryKindLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind_value.go new file mode 100644 index 00000000..07f09cc0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_kind_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// JournalEntryKindValue * `info` - Info * `success` - Success * `warning` - Warning * `danger` - Danger +type JournalEntryKindValue string + +// List of JournalEntry_kind_value +const ( + JOURNALENTRYKINDVALUE_INFO JournalEntryKindValue = "info" + JOURNALENTRYKINDVALUE_SUCCESS JournalEntryKindValue = "success" + JOURNALENTRYKINDVALUE_WARNING JournalEntryKindValue = "warning" + JOURNALENTRYKINDVALUE_DANGER JournalEntryKindValue = "danger" +) + +// All allowed values of JournalEntryKindValue enum +var AllowedJournalEntryKindValueEnumValues = []JournalEntryKindValue{ + "info", + "success", + "warning", + "danger", +} + +func (v *JournalEntryKindValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := JournalEntryKindValue(value) + for _, existing := range AllowedJournalEntryKindValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid JournalEntryKindValue", value) +} + +// NewJournalEntryKindValueFromValue returns a pointer to a valid JournalEntryKindValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewJournalEntryKindValueFromValue(v string) (*JournalEntryKindValue, error) { + ev := JournalEntryKindValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for JournalEntryKindValue: valid values are %v", v, AllowedJournalEntryKindValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v JournalEntryKindValue) IsValid() bool { + for _, existing := range AllowedJournalEntryKindValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to JournalEntry_kind_value value +func (v JournalEntryKindValue) Ptr() *JournalEntryKindValue { + return &v +} + +type NullableJournalEntryKindValue struct { + value *JournalEntryKindValue + isSet bool +} + +func (v NullableJournalEntryKindValue) Get() *JournalEntryKindValue { + return v.value +} + +func (v *NullableJournalEntryKindValue) Set(val *JournalEntryKindValue) { + v.value = val + v.isSet = true +} + +func (v NullableJournalEntryKindValue) IsSet() bool { + return v.isSet +} + +func (v *NullableJournalEntryKindValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJournalEntryKindValue(val *JournalEntryKindValue) *NullableJournalEntryKindValue { + return &NullableJournalEntryKindValue{value: val, isSet: true} +} + +func (v NullableJournalEntryKindValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJournalEntryKindValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_request.go new file mode 100644 index 00000000..ff27f7fd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_journal_entry_request.go @@ -0,0 +1,383 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the JournalEntryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JournalEntryRequest{} + +// JournalEntryRequest Adds support for custom fields and tags. +type JournalEntryRequest struct { + AssignedObjectType string `json:"assigned_object_type"` + AssignedObjectId int64 `json:"assigned_object_id"` + CreatedBy NullableInt32 `json:"created_by,omitempty"` + Kind *JournalEntryKindValue `json:"kind,omitempty"` + Comments string `json:"comments"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _JournalEntryRequest JournalEntryRequest + +// NewJournalEntryRequest instantiates a new JournalEntryRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJournalEntryRequest(assignedObjectType string, assignedObjectId int64, comments string) *JournalEntryRequest { + this := JournalEntryRequest{} + this.AssignedObjectType = assignedObjectType + this.AssignedObjectId = assignedObjectId + this.Comments = comments + return &this +} + +// NewJournalEntryRequestWithDefaults instantiates a new JournalEntryRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJournalEntryRequestWithDefaults() *JournalEntryRequest { + this := JournalEntryRequest{} + return &this +} + +// GetAssignedObjectType returns the AssignedObjectType field value +func (o *JournalEntryRequest) GetAssignedObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value +// and a boolean to check if the value has been set. +func (o *JournalEntryRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectType, true +} + +// SetAssignedObjectType sets field value +func (o *JournalEntryRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType = v +} + +// GetAssignedObjectId returns the AssignedObjectId field value +func (o *JournalEntryRequest) GetAssignedObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value +// and a boolean to check if the value has been set. +func (o *JournalEntryRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectId, true +} + +// SetAssignedObjectId sets field value +func (o *JournalEntryRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId = v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *JournalEntryRequest) GetCreatedBy() int32 { + if o == nil || IsNil(o.CreatedBy.Get()) { + var ret int32 + return ret + } + return *o.CreatedBy.Get() +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *JournalEntryRequest) GetCreatedByOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CreatedBy.Get(), o.CreatedBy.IsSet() +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *JournalEntryRequest) HasCreatedBy() bool { + if o != nil && o.CreatedBy.IsSet() { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given NullableInt32 and assigns it to the CreatedBy field. +func (o *JournalEntryRequest) SetCreatedBy(v int32) { + o.CreatedBy.Set(&v) +} + +// SetCreatedByNil sets the value for CreatedBy to be an explicit nil +func (o *JournalEntryRequest) SetCreatedByNil() { + o.CreatedBy.Set(nil) +} + +// UnsetCreatedBy ensures that no value is present for CreatedBy, not even an explicit nil +func (o *JournalEntryRequest) UnsetCreatedBy() { + o.CreatedBy.Unset() +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *JournalEntryRequest) GetKind() JournalEntryKindValue { + if o == nil || IsNil(o.Kind) { + var ret JournalEntryKindValue + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntryRequest) GetKindOk() (*JournalEntryKindValue, bool) { + if o == nil || IsNil(o.Kind) { + return nil, false + } + return o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *JournalEntryRequest) HasKind() bool { + if o != nil && !IsNil(o.Kind) { + return true + } + + return false +} + +// SetKind gets a reference to the given JournalEntryKindValue and assigns it to the Kind field. +func (o *JournalEntryRequest) SetKind(v JournalEntryKindValue) { + o.Kind = &v +} + +// GetComments returns the Comments field value +func (o *JournalEntryRequest) GetComments() string { + if o == nil { + var ret string + return ret + } + + return o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value +// and a boolean to check if the value has been set. +func (o *JournalEntryRequest) GetCommentsOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Comments, true +} + +// SetComments sets field value +func (o *JournalEntryRequest) SetComments(v string) { + o.Comments = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *JournalEntryRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntryRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *JournalEntryRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *JournalEntryRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *JournalEntryRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JournalEntryRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *JournalEntryRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *JournalEntryRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o JournalEntryRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JournalEntryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assigned_object_type"] = o.AssignedObjectType + toSerialize["assigned_object_id"] = o.AssignedObjectId + if o.CreatedBy.IsSet() { + toSerialize["created_by"] = o.CreatedBy.Get() + } + if !IsNil(o.Kind) { + toSerialize["kind"] = o.Kind + } + toSerialize["comments"] = o.Comments + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *JournalEntryRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "assigned_object_type", + "assigned_object_id", + "comments", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varJournalEntryRequest := _JournalEntryRequest{} + + err = json.Unmarshal(data, &varJournalEntryRequest) + + if err != nil { + return err + } + + *o = JournalEntryRequest(varJournalEntryRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "created_by") + delete(additionalProperties, "kind") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJournalEntryRequest struct { + value *JournalEntryRequest + isSet bool +} + +func (v NullableJournalEntryRequest) Get() *JournalEntryRequest { + return v.value +} + +func (v *NullableJournalEntryRequest) Set(val *JournalEntryRequest) { + v.value = val + v.isSet = true +} + +func (v NullableJournalEntryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableJournalEntryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJournalEntryRequest(val *JournalEntryRequest) *NullableJournalEntryRequest { + return &NullableJournalEntryRequest{value: val, isSet: true} +} + +func (v NullableJournalEntryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJournalEntryRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn.go b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn.go new file mode 100644 index 00000000..594b1f57 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn.go @@ -0,0 +1,700 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the L2VPN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &L2VPN{} + +// L2VPN Adds support for custom fields and tags. +type L2VPN struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Identifier NullableInt64 `json:"identifier,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Type *L2VPNType `json:"type,omitempty"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _L2VPN L2VPN + +// NewL2VPN instantiates a new L2VPN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewL2VPN(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *L2VPN { + this := L2VPN{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewL2VPNWithDefaults instantiates a new L2VPN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewL2VPNWithDefaults() *L2VPN { + this := L2VPN{} + return &this +} + +// GetId returns the Id field value +func (o *L2VPN) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *L2VPN) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *L2VPN) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *L2VPN) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *L2VPN) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *L2VPN) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *L2VPN) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *L2VPN) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *L2VPN) SetDisplay(v string) { + o.Display = v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *L2VPN) GetIdentifier() int64 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int64 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPN) GetIdentifierOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *L2VPN) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt64 and assigns it to the Identifier field. +func (o *L2VPN) SetIdentifier(v int64) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *L2VPN) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *L2VPN) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetName returns the Name field value +func (o *L2VPN) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *L2VPN) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *L2VPN) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *L2VPN) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *L2VPN) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *L2VPN) SetSlug(v string) { + o.Slug = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *L2VPN) GetType() L2VPNType { + if o == nil || IsNil(o.Type) { + var ret L2VPNType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPN) GetTypeOk() (*L2VPNType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *L2VPN) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given L2VPNType and assigns it to the Type field. +func (o *L2VPN) SetType(v L2VPNType) { + o.Type = &v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *L2VPN) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPN) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *L2VPN) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *L2VPN) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *L2VPN) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPN) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *L2VPN) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *L2VPN) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *L2VPN) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPN) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *L2VPN) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *L2VPN) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *L2VPN) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPN) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *L2VPN) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *L2VPN) SetComments(v string) { + o.Comments = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *L2VPN) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPN) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *L2VPN) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *L2VPN) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *L2VPN) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *L2VPN) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *L2VPN) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPN) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *L2VPN) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *L2VPN) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *L2VPN) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPN) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *L2VPN) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *L2VPN) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *L2VPN) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPN) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *L2VPN) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *L2VPN) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPN) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *L2VPN) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o L2VPN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o L2VPN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *L2VPN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varL2VPN := _L2VPN{} + + err = json.Unmarshal(data, &varL2VPN) + + if err != nil { + return err + } + + *o = L2VPN(varL2VPN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "identifier") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "type") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableL2VPN struct { + value *L2VPN + isSet bool +} + +func (v NullableL2VPN) Get() *L2VPN { + return v.value +} + +func (v *NullableL2VPN) Set(val *L2VPN) { + v.value = val + v.isSet = true +} + +func (v NullableL2VPN) IsSet() bool { + return v.isSet +} + +func (v *NullableL2VPN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL2VPN(val *L2VPN) *NullableL2VPN { + return &NullableL2VPN{value: val, isSet: true} +} + +func (v NullableL2VPN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL2VPN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_request.go new file mode 100644 index 00000000..42a92a20 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_request.go @@ -0,0 +1,550 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the L2VPNRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &L2VPNRequest{} + +// L2VPNRequest Adds support for custom fields and tags. +type L2VPNRequest struct { + Identifier NullableInt64 `json:"identifier,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Type *L2VPNTypeValue `json:"type,omitempty"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _L2VPNRequest L2VPNRequest + +// NewL2VPNRequest instantiates a new L2VPNRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewL2VPNRequest(name string, slug string) *L2VPNRequest { + this := L2VPNRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewL2VPNRequestWithDefaults instantiates a new L2VPNRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewL2VPNRequestWithDefaults() *L2VPNRequest { + this := L2VPNRequest{} + return &this +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *L2VPNRequest) GetIdentifier() int64 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int64 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPNRequest) GetIdentifierOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *L2VPNRequest) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt64 and assigns it to the Identifier field. +func (o *L2VPNRequest) SetIdentifier(v int64) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *L2VPNRequest) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *L2VPNRequest) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetName returns the Name field value +func (o *L2VPNRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *L2VPNRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *L2VPNRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *L2VPNRequest) SetSlug(v string) { + o.Slug = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *L2VPNRequest) GetType() L2VPNTypeValue { + if o == nil || IsNil(o.Type) { + var ret L2VPNTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetTypeOk() (*L2VPNTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *L2VPNRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given L2VPNTypeValue and assigns it to the Type field. +func (o *L2VPNRequest) SetType(v L2VPNTypeValue) { + o.Type = &v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *L2VPNRequest) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *L2VPNRequest) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *L2VPNRequest) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *L2VPNRequest) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *L2VPNRequest) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *L2VPNRequest) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *L2VPNRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *L2VPNRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *L2VPNRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *L2VPNRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *L2VPNRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *L2VPNRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *L2VPNRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPNRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *L2VPNRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *L2VPNRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *L2VPNRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *L2VPNRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *L2VPNRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *L2VPNRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *L2VPNRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *L2VPNRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *L2VPNRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *L2VPNRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o L2VPNRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o L2VPNRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *L2VPNRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varL2VPNRequest := _L2VPNRequest{} + + err = json.Unmarshal(data, &varL2VPNRequest) + + if err != nil { + return err + } + + *o = L2VPNRequest(varL2VPNRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "identifier") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "type") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableL2VPNRequest struct { + value *L2VPNRequest + isSet bool +} + +func (v NullableL2VPNRequest) Get() *L2VPNRequest { + return v.value +} + +func (v *NullableL2VPNRequest) Set(val *L2VPNRequest) { + v.value = val + v.isSet = true +} + +func (v NullableL2VPNRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableL2VPNRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL2VPNRequest(val *L2VPNRequest) *NullableL2VPNRequest { + return &NullableL2VPNRequest{value: val, isSet: true} +} + +func (v NullableL2VPNRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL2VPNRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_termination.go b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_termination.go new file mode 100644 index 00000000..87d20fb4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_termination.go @@ -0,0 +1,481 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the L2VPNTermination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &L2VPNTermination{} + +// L2VPNTermination Adds support for custom fields and tags. +type L2VPNTermination struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + L2vpn NestedL2VPN `json:"l2vpn"` + AssignedObjectType string `json:"assigned_object_type"` + AssignedObjectId int64 `json:"assigned_object_id"` + AssignedObject interface{} `json:"assigned_object"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _L2VPNTermination L2VPNTermination + +// NewL2VPNTermination instantiates a new L2VPNTermination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewL2VPNTermination(id int32, url string, display string, l2vpn NestedL2VPN, assignedObjectType string, assignedObjectId int64, assignedObject interface{}, created NullableTime, lastUpdated NullableTime) *L2VPNTermination { + this := L2VPNTermination{} + this.Id = id + this.Url = url + this.Display = display + this.L2vpn = l2vpn + this.AssignedObjectType = assignedObjectType + this.AssignedObjectId = assignedObjectId + this.AssignedObject = assignedObject + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewL2VPNTerminationWithDefaults instantiates a new L2VPNTermination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewL2VPNTerminationWithDefaults() *L2VPNTermination { + this := L2VPNTermination{} + return &this +} + +// GetId returns the Id field value +func (o *L2VPNTermination) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *L2VPNTermination) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *L2VPNTermination) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *L2VPNTermination) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *L2VPNTermination) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *L2VPNTermination) SetDisplay(v string) { + o.Display = v +} + +// GetL2vpn returns the L2vpn field value +func (o *L2VPNTermination) GetL2vpn() NestedL2VPN { + if o == nil { + var ret NestedL2VPN + return ret + } + + return o.L2vpn +} + +// GetL2vpnOk returns a tuple with the L2vpn field value +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetL2vpnOk() (*NestedL2VPN, bool) { + if o == nil { + return nil, false + } + return &o.L2vpn, true +} + +// SetL2vpn sets field value +func (o *L2VPNTermination) SetL2vpn(v NestedL2VPN) { + o.L2vpn = v +} + +// GetAssignedObjectType returns the AssignedObjectType field value +func (o *L2VPNTermination) GetAssignedObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectType, true +} + +// SetAssignedObjectType sets field value +func (o *L2VPNTermination) SetAssignedObjectType(v string) { + o.AssignedObjectType = v +} + +// GetAssignedObjectId returns the AssignedObjectId field value +func (o *L2VPNTermination) GetAssignedObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectId, true +} + +// SetAssignedObjectId sets field value +func (o *L2VPNTermination) SetAssignedObjectId(v int64) { + o.AssignedObjectId = v +} + +// GetAssignedObject returns the AssignedObject field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *L2VPNTermination) GetAssignedObject() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.AssignedObject +} + +// GetAssignedObjectOk returns a tuple with the AssignedObject field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPNTermination) GetAssignedObjectOk() (*interface{}, bool) { + if o == nil || IsNil(o.AssignedObject) { + return nil, false + } + return &o.AssignedObject, true +} + +// SetAssignedObject sets field value +func (o *L2VPNTermination) SetAssignedObject(v interface{}) { + o.AssignedObject = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *L2VPNTermination) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *L2VPNTermination) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *L2VPNTermination) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *L2VPNTermination) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNTermination) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *L2VPNTermination) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *L2VPNTermination) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *L2VPNTermination) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPNTermination) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *L2VPNTermination) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *L2VPNTermination) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *L2VPNTermination) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *L2VPNTermination) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o L2VPNTermination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o L2VPNTermination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["l2vpn"] = o.L2vpn + toSerialize["assigned_object_type"] = o.AssignedObjectType + toSerialize["assigned_object_id"] = o.AssignedObjectId + if o.AssignedObject != nil { + toSerialize["assigned_object"] = o.AssignedObject + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *L2VPNTermination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "l2vpn", + "assigned_object_type", + "assigned_object_id", + "assigned_object", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varL2VPNTermination := _L2VPNTermination{} + + err = json.Unmarshal(data, &varL2VPNTermination) + + if err != nil { + return err + } + + *o = L2VPNTermination(varL2VPNTermination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "l2vpn") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "assigned_object") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableL2VPNTermination struct { + value *L2VPNTermination + isSet bool +} + +func (v NullableL2VPNTermination) Get() *L2VPNTermination { + return v.value +} + +func (v *NullableL2VPNTermination) Set(val *L2VPNTermination) { + v.value = val + v.isSet = true +} + +func (v NullableL2VPNTermination) IsSet() bool { + return v.isSet +} + +func (v *NullableL2VPNTermination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL2VPNTermination(val *L2VPNTermination) *NullableL2VPNTermination { + return &NullableL2VPNTermination{value: val, isSet: true} +} + +func (v NullableL2VPNTermination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL2VPNTermination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_termination_request.go new file mode 100644 index 00000000..2947a17e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_termination_request.go @@ -0,0 +1,298 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the L2VPNTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &L2VPNTerminationRequest{} + +// L2VPNTerminationRequest Adds support for custom fields and tags. +type L2VPNTerminationRequest struct { + L2vpn NestedL2VPNRequest `json:"l2vpn"` + AssignedObjectType string `json:"assigned_object_type"` + AssignedObjectId int64 `json:"assigned_object_id"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _L2VPNTerminationRequest L2VPNTerminationRequest + +// NewL2VPNTerminationRequest instantiates a new L2VPNTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewL2VPNTerminationRequest(l2vpn NestedL2VPNRequest, assignedObjectType string, assignedObjectId int64) *L2VPNTerminationRequest { + this := L2VPNTerminationRequest{} + this.L2vpn = l2vpn + this.AssignedObjectType = assignedObjectType + this.AssignedObjectId = assignedObjectId + return &this +} + +// NewL2VPNTerminationRequestWithDefaults instantiates a new L2VPNTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewL2VPNTerminationRequestWithDefaults() *L2VPNTerminationRequest { + this := L2VPNTerminationRequest{} + return &this +} + +// GetL2vpn returns the L2vpn field value +func (o *L2VPNTerminationRequest) GetL2vpn() NestedL2VPNRequest { + if o == nil { + var ret NestedL2VPNRequest + return ret + } + + return o.L2vpn +} + +// GetL2vpnOk returns a tuple with the L2vpn field value +// and a boolean to check if the value has been set. +func (o *L2VPNTerminationRequest) GetL2vpnOk() (*NestedL2VPNRequest, bool) { + if o == nil { + return nil, false + } + return &o.L2vpn, true +} + +// SetL2vpn sets field value +func (o *L2VPNTerminationRequest) SetL2vpn(v NestedL2VPNRequest) { + o.L2vpn = v +} + +// GetAssignedObjectType returns the AssignedObjectType field value +func (o *L2VPNTerminationRequest) GetAssignedObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value +// and a boolean to check if the value has been set. +func (o *L2VPNTerminationRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectType, true +} + +// SetAssignedObjectType sets field value +func (o *L2VPNTerminationRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType = v +} + +// GetAssignedObjectId returns the AssignedObjectId field value +func (o *L2VPNTerminationRequest) GetAssignedObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value +// and a boolean to check if the value has been set. +func (o *L2VPNTerminationRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectId, true +} + +// SetAssignedObjectId sets field value +func (o *L2VPNTerminationRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *L2VPNTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *L2VPNTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *L2VPNTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *L2VPNTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *L2VPNTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *L2VPNTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o L2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o L2VPNTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["l2vpn"] = o.L2vpn + toSerialize["assigned_object_type"] = o.AssignedObjectType + toSerialize["assigned_object_id"] = o.AssignedObjectId + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *L2VPNTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "l2vpn", + "assigned_object_type", + "assigned_object_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varL2VPNTerminationRequest := _L2VPNTerminationRequest{} + + err = json.Unmarshal(data, &varL2VPNTerminationRequest) + + if err != nil { + return err + } + + *o = L2VPNTerminationRequest(varL2VPNTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "l2vpn") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableL2VPNTerminationRequest struct { + value *L2VPNTerminationRequest + isSet bool +} + +func (v NullableL2VPNTerminationRequest) Get() *L2VPNTerminationRequest { + return v.value +} + +func (v *NullableL2VPNTerminationRequest) Set(val *L2VPNTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableL2VPNTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableL2VPNTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL2VPNTerminationRequest(val *L2VPNTerminationRequest) *NullableL2VPNTerminationRequest { + return &NullableL2VPNTerminationRequest{value: val, isSet: true} +} + +func (v NullableL2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL2VPNTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type.go new file mode 100644 index 00000000..ec5e3668 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the L2VPNType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &L2VPNType{} + +// L2VPNType struct for L2VPNType +type L2VPNType struct { + Value *L2VPNTypeValue `json:"value,omitempty"` + Label *L2VPNTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _L2VPNType L2VPNType + +// NewL2VPNType instantiates a new L2VPNType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewL2VPNType() *L2VPNType { + this := L2VPNType{} + return &this +} + +// NewL2VPNTypeWithDefaults instantiates a new L2VPNType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewL2VPNTypeWithDefaults() *L2VPNType { + this := L2VPNType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *L2VPNType) GetValue() L2VPNTypeValue { + if o == nil || IsNil(o.Value) { + var ret L2VPNTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNType) GetValueOk() (*L2VPNTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *L2VPNType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given L2VPNTypeValue and assigns it to the Value field. +func (o *L2VPNType) SetValue(v L2VPNTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *L2VPNType) GetLabel() L2VPNTypeLabel { + if o == nil || IsNil(o.Label) { + var ret L2VPNTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L2VPNType) GetLabelOk() (*L2VPNTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *L2VPNType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given L2VPNTypeLabel and assigns it to the Label field. +func (o *L2VPNType) SetLabel(v L2VPNTypeLabel) { + o.Label = &v +} + +func (o L2VPNType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o L2VPNType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *L2VPNType) UnmarshalJSON(data []byte) (err error) { + varL2VPNType := _L2VPNType{} + + err = json.Unmarshal(data, &varL2VPNType) + + if err != nil { + return err + } + + *o = L2VPNType(varL2VPNType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableL2VPNType struct { + value *L2VPNType + isSet bool +} + +func (v NullableL2VPNType) Get() *L2VPNType { + return v.value +} + +func (v *NullableL2VPNType) Set(val *L2VPNType) { + v.value = val + v.isSet = true +} + +func (v NullableL2VPNType) IsSet() bool { + return v.isSet +} + +func (v *NullableL2VPNType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL2VPNType(val *L2VPNType) *NullableL2VPNType { + return &NullableL2VPNType{value: val, isSet: true} +} + +func (v NullableL2VPNType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL2VPNType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type_label.go new file mode 100644 index 00000000..3665b98a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type_label.go @@ -0,0 +1,130 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// L2VPNTypeLabel the model 'L2VPNTypeLabel' +type L2VPNTypeLabel string + +// List of L2VPN_type_label +const ( + L2VPNTYPELABEL_VPWS L2VPNTypeLabel = "VPWS" + L2VPNTYPELABEL_VPLS L2VPNTypeLabel = "VPLS" + L2VPNTYPELABEL_VXLAN L2VPNTypeLabel = "VXLAN" + L2VPNTYPELABEL_VXLAN_EVPN L2VPNTypeLabel = "VXLAN-EVPN" + L2VPNTYPELABEL_MPLS_EVPN L2VPNTypeLabel = "MPLS EVPN" + L2VPNTYPELABEL_PBB_EVPN L2VPNTypeLabel = "PBB EVPN" + L2VPNTYPELABEL_EPL L2VPNTypeLabel = "EPL" + L2VPNTYPELABEL_EVPL L2VPNTypeLabel = "EVPL" + L2VPNTYPELABEL_ETHERNET_PRIVATE_LAN L2VPNTypeLabel = "Ethernet Private LAN" + L2VPNTYPELABEL_ETHERNET_VIRTUAL_PRIVATE_LAN L2VPNTypeLabel = "Ethernet Virtual Private LAN" + L2VPNTYPELABEL_ETHERNET_PRIVATE_TREE L2VPNTypeLabel = "Ethernet Private Tree" + L2VPNTYPELABEL_ETHERNET_VIRTUAL_PRIVATE_TREE L2VPNTypeLabel = "Ethernet Virtual Private Tree" +) + +// All allowed values of L2VPNTypeLabel enum +var AllowedL2VPNTypeLabelEnumValues = []L2VPNTypeLabel{ + "VPWS", + "VPLS", + "VXLAN", + "VXLAN-EVPN", + "MPLS EVPN", + "PBB EVPN", + "EPL", + "EVPL", + "Ethernet Private LAN", + "Ethernet Virtual Private LAN", + "Ethernet Private Tree", + "Ethernet Virtual Private Tree", +} + +func (v *L2VPNTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := L2VPNTypeLabel(value) + for _, existing := range AllowedL2VPNTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid L2VPNTypeLabel", value) +} + +// NewL2VPNTypeLabelFromValue returns a pointer to a valid L2VPNTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewL2VPNTypeLabelFromValue(v string) (*L2VPNTypeLabel, error) { + ev := L2VPNTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for L2VPNTypeLabel: valid values are %v", v, AllowedL2VPNTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v L2VPNTypeLabel) IsValid() bool { + for _, existing := range AllowedL2VPNTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to L2VPN_type_label value +func (v L2VPNTypeLabel) Ptr() *L2VPNTypeLabel { + return &v +} + +type NullableL2VPNTypeLabel struct { + value *L2VPNTypeLabel + isSet bool +} + +func (v NullableL2VPNTypeLabel) Get() *L2VPNTypeLabel { + return v.value +} + +func (v *NullableL2VPNTypeLabel) Set(val *L2VPNTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableL2VPNTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableL2VPNTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL2VPNTypeLabel(val *L2VPNTypeLabel) *NullableL2VPNTypeLabel { + return &NullableL2VPNTypeLabel{value: val, isSet: true} +} + +func (v NullableL2VPNTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL2VPNTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type_value.go new file mode 100644 index 00000000..2fe7051b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_l2_vpn_type_value.go @@ -0,0 +1,130 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// L2VPNTypeValue * `vpws` - VPWS * `vpls` - VPLS * `vxlan` - VXLAN * `vxlan-evpn` - VXLAN-EVPN * `mpls-evpn` - MPLS EVPN * `pbb-evpn` - PBB EVPN * `epl` - EPL * `evpl` - EVPL * `ep-lan` - Ethernet Private LAN * `evp-lan` - Ethernet Virtual Private LAN * `ep-tree` - Ethernet Private Tree * `evp-tree` - Ethernet Virtual Private Tree +type L2VPNTypeValue string + +// List of L2VPN_type_value +const ( + L2VPNTYPEVALUE_VPWS L2VPNTypeValue = "vpws" + L2VPNTYPEVALUE_VPLS L2VPNTypeValue = "vpls" + L2VPNTYPEVALUE_VXLAN L2VPNTypeValue = "vxlan" + L2VPNTYPEVALUE_VXLAN_EVPN L2VPNTypeValue = "vxlan-evpn" + L2VPNTYPEVALUE_MPLS_EVPN L2VPNTypeValue = "mpls-evpn" + L2VPNTYPEVALUE_PBB_EVPN L2VPNTypeValue = "pbb-evpn" + L2VPNTYPEVALUE_EPL L2VPNTypeValue = "epl" + L2VPNTYPEVALUE_EVPL L2VPNTypeValue = "evpl" + L2VPNTYPEVALUE_EP_LAN L2VPNTypeValue = "ep-lan" + L2VPNTYPEVALUE_EVP_LAN L2VPNTypeValue = "evp-lan" + L2VPNTYPEVALUE_EP_TREE L2VPNTypeValue = "ep-tree" + L2VPNTYPEVALUE_EVP_TREE L2VPNTypeValue = "evp-tree" +) + +// All allowed values of L2VPNTypeValue enum +var AllowedL2VPNTypeValueEnumValues = []L2VPNTypeValue{ + "vpws", + "vpls", + "vxlan", + "vxlan-evpn", + "mpls-evpn", + "pbb-evpn", + "epl", + "evpl", + "ep-lan", + "evp-lan", + "ep-tree", + "evp-tree", +} + +func (v *L2VPNTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := L2VPNTypeValue(value) + for _, existing := range AllowedL2VPNTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid L2VPNTypeValue", value) +} + +// NewL2VPNTypeValueFromValue returns a pointer to a valid L2VPNTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewL2VPNTypeValueFromValue(v string) (*L2VPNTypeValue, error) { + ev := L2VPNTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for L2VPNTypeValue: valid values are %v", v, AllowedL2VPNTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v L2VPNTypeValue) IsValid() bool { + for _, existing := range AllowedL2VPNTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to L2VPN_type_value value +func (v L2VPNTypeValue) Ptr() *L2VPNTypeValue { + return &v +} + +type NullableL2VPNTypeValue struct { + value *L2VPNTypeValue + isSet bool +} + +func (v NullableL2VPNTypeValue) Get() *L2VPNTypeValue { + return v.value +} + +func (v *NullableL2VPNTypeValue) Set(val *L2VPNTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableL2VPNTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableL2VPNTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL2VPNTypeValue(val *L2VPNTypeValue) *NullableL2VPNTypeValue { + return &NullableL2VPNTypeValue{value: val, isSet: true} +} + +func (v NullableL2VPNTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL2VPNTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_location.go b/vendor/github.com/netbox-community/go-netbox/v3/model_location.go new file mode 100644 index 00000000..bfc387cc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_location.go @@ -0,0 +1,705 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Location type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Location{} + +// Location Extends PrimaryModelSerializer to include MPTT support. +type Location struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Site NestedSite `json:"site"` + Parent NullableNestedLocation `json:"parent,omitempty"` + Status *LocationStatus `json:"status,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + RackCount int32 `json:"rack_count"` + DeviceCount int32 `json:"device_count"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _Location Location + +// NewLocation instantiates a new Location object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLocation(id int32, url string, display string, name string, slug string, site NestedSite, created NullableTime, lastUpdated NullableTime, rackCount int32, deviceCount int32, depth int32) *Location { + this := Location{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Site = site + this.Created = created + this.LastUpdated = lastUpdated + this.RackCount = rackCount + this.DeviceCount = deviceCount + this.Depth = depth + return &this +} + +// NewLocationWithDefaults instantiates a new Location object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLocationWithDefaults() *Location { + this := Location{} + return &this +} + +// GetId returns the Id field value +func (o *Location) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Location) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Location) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Location) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Location) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Location) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Location) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Location) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Location) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Location) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Location) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Location) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Location) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Location) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Location) SetSlug(v string) { + o.Slug = v +} + +// GetSite returns the Site field value +func (o *Location) GetSite() NestedSite { + if o == nil { + var ret NestedSite + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *Location) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *Location) SetSite(v NestedSite) { + o.Site = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Location) GetParent() NestedLocation { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedLocation + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Location) GetParentOk() (*NestedLocation, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *Location) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedLocation and assigns it to the Parent field. +func (o *Location) SetParent(v NestedLocation) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *Location) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *Location) UnsetParent() { + o.Parent.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Location) GetStatus() LocationStatus { + if o == nil || IsNil(o.Status) { + var ret LocationStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Location) GetStatusOk() (*LocationStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Location) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatus and assigns it to the Status field. +func (o *Location) SetStatus(v LocationStatus) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Location) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Location) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Location) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Location) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Location) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Location) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Location) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Location) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Location) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Location) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Location) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Location) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Location) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Location) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Location) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Location) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Location) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Location) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Location) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Location) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Location) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Location) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Location) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Location) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetRackCount returns the RackCount field value +func (o *Location) GetRackCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RackCount +} + +// GetRackCountOk returns a tuple with the RackCount field value +// and a boolean to check if the value has been set. +func (o *Location) GetRackCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RackCount, true +} + +// SetRackCount sets field value +func (o *Location) SetRackCount(v int32) { + o.RackCount = v +} + +// GetDeviceCount returns the DeviceCount field value +func (o *Location) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *Location) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *Location) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetDepth returns the Depth field value +func (o *Location) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *Location) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *Location) SetDepth(v int32) { + o.Depth = v +} + +func (o Location) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Location) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["site"] = o.Site + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["rack_count"] = o.RackCount + toSerialize["device_count"] = o.DeviceCount + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Location) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "site", + "created", + "last_updated", + "rack_count", + "device_count", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLocation := _Location{} + + err = json.Unmarshal(data, &varLocation) + + if err != nil { + return err + } + + *o = Location(varLocation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "site") + delete(additionalProperties, "parent") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "rack_count") + delete(additionalProperties, "device_count") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLocation struct { + value *Location + isSet bool +} + +func (v NullableLocation) Get() *Location { + return v.value +} + +func (v *NullableLocation) Set(val *Location) { + v.value = val + v.isSet = true +} + +func (v NullableLocation) IsSet() bool { + return v.isSet +} + +func (v *NullableLocation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocation(val *Location) *NullableLocation { + return &NullableLocation{value: val, isSet: true} +} + +func (v NullableLocation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_location_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_location_request.go new file mode 100644 index 00000000..afdb0fa9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_location_request.go @@ -0,0 +1,468 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the LocationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LocationRequest{} + +// LocationRequest Extends PrimaryModelSerializer to include MPTT support. +type LocationRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Site NestedSiteRequest `json:"site"` + Parent NullableNestedLocationRequest `json:"parent,omitempty"` + Status *LocationStatusValue `json:"status,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LocationRequest LocationRequest + +// NewLocationRequest instantiates a new LocationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLocationRequest(name string, slug string, site NestedSiteRequest) *LocationRequest { + this := LocationRequest{} + this.Name = name + this.Slug = slug + this.Site = site + return &this +} + +// NewLocationRequestWithDefaults instantiates a new LocationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLocationRequestWithDefaults() *LocationRequest { + this := LocationRequest{} + return &this +} + +// GetName returns the Name field value +func (o *LocationRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LocationRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LocationRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *LocationRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *LocationRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *LocationRequest) SetSlug(v string) { + o.Slug = v +} + +// GetSite returns the Site field value +func (o *LocationRequest) GetSite() NestedSiteRequest { + if o == nil { + var ret NestedSiteRequest + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *LocationRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *LocationRequest) SetSite(v NestedSiteRequest) { + o.Site = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LocationRequest) GetParent() NestedLocationRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedLocationRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LocationRequest) GetParentOk() (*NestedLocationRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *LocationRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedLocationRequest and assigns it to the Parent field. +func (o *LocationRequest) SetParent(v NestedLocationRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *LocationRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *LocationRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *LocationRequest) GetStatus() LocationStatusValue { + if o == nil || IsNil(o.Status) { + var ret LocationStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationRequest) GetStatusOk() (*LocationStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *LocationRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatusValue and assigns it to the Status field. +func (o *LocationRequest) SetStatus(v LocationStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LocationRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LocationRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *LocationRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *LocationRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *LocationRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *LocationRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LocationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LocationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LocationRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *LocationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *LocationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *LocationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *LocationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *LocationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *LocationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o LocationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LocationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["site"] = o.Site + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LocationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "site", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLocationRequest := _LocationRequest{} + + err = json.Unmarshal(data, &varLocationRequest) + + if err != nil { + return err + } + + *o = LocationRequest(varLocationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "site") + delete(additionalProperties, "parent") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLocationRequest struct { + value *LocationRequest + isSet bool +} + +func (v NullableLocationRequest) Get() *LocationRequest { + return v.value +} + +func (v *NullableLocationRequest) Set(val *LocationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLocationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLocationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocationRequest(val *LocationRequest) *NullableLocationRequest { + return &NullableLocationRequest{value: val, isSet: true} +} + +func (v NullableLocationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_location_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_location_status.go new file mode 100644 index 00000000..2bc020d2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_location_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the LocationStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LocationStatus{} + +// LocationStatus struct for LocationStatus +type LocationStatus struct { + Value *LocationStatusValue `json:"value,omitempty"` + Label *LocationStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LocationStatus LocationStatus + +// NewLocationStatus instantiates a new LocationStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLocationStatus() *LocationStatus { + this := LocationStatus{} + return &this +} + +// NewLocationStatusWithDefaults instantiates a new LocationStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLocationStatusWithDefaults() *LocationStatus { + this := LocationStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *LocationStatus) GetValue() LocationStatusValue { + if o == nil || IsNil(o.Value) { + var ret LocationStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationStatus) GetValueOk() (*LocationStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *LocationStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given LocationStatusValue and assigns it to the Value field. +func (o *LocationStatus) SetValue(v LocationStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *LocationStatus) GetLabel() LocationStatusLabel { + if o == nil || IsNil(o.Label) { + var ret LocationStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LocationStatus) GetLabelOk() (*LocationStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *LocationStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given LocationStatusLabel and assigns it to the Label field. +func (o *LocationStatus) SetLabel(v LocationStatusLabel) { + o.Label = &v +} + +func (o LocationStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LocationStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LocationStatus) UnmarshalJSON(data []byte) (err error) { + varLocationStatus := _LocationStatus{} + + err = json.Unmarshal(data, &varLocationStatus) + + if err != nil { + return err + } + + *o = LocationStatus(varLocationStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLocationStatus struct { + value *LocationStatus + isSet bool +} + +func (v NullableLocationStatus) Get() *LocationStatus { + return v.value +} + +func (v *NullableLocationStatus) Set(val *LocationStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLocationStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLocationStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocationStatus(val *LocationStatus) *NullableLocationStatus { + return &NullableLocationStatus{value: val, isSet: true} +} + +func (v NullableLocationStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocationStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_location_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_location_status_label.go new file mode 100644 index 00000000..3f974a91 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_location_status_label.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// LocationStatusLabel the model 'LocationStatusLabel' +type LocationStatusLabel string + +// List of Location_status_label +const ( + LOCATIONSTATUSLABEL_PLANNED LocationStatusLabel = "Planned" + LOCATIONSTATUSLABEL_STAGING LocationStatusLabel = "Staging" + LOCATIONSTATUSLABEL_ACTIVE LocationStatusLabel = "Active" + LOCATIONSTATUSLABEL_DECOMMISSIONING LocationStatusLabel = "Decommissioning" + LOCATIONSTATUSLABEL_RETIRED LocationStatusLabel = "Retired" +) + +// All allowed values of LocationStatusLabel enum +var AllowedLocationStatusLabelEnumValues = []LocationStatusLabel{ + "Planned", + "Staging", + "Active", + "Decommissioning", + "Retired", +} + +func (v *LocationStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LocationStatusLabel(value) + for _, existing := range AllowedLocationStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LocationStatusLabel", value) +} + +// NewLocationStatusLabelFromValue returns a pointer to a valid LocationStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLocationStatusLabelFromValue(v string) (*LocationStatusLabel, error) { + ev := LocationStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LocationStatusLabel: valid values are %v", v, AllowedLocationStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LocationStatusLabel) IsValid() bool { + for _, existing := range AllowedLocationStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Location_status_label value +func (v LocationStatusLabel) Ptr() *LocationStatusLabel { + return &v +} + +type NullableLocationStatusLabel struct { + value *LocationStatusLabel + isSet bool +} + +func (v NullableLocationStatusLabel) Get() *LocationStatusLabel { + return v.value +} + +func (v *NullableLocationStatusLabel) Set(val *LocationStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableLocationStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableLocationStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocationStatusLabel(val *LocationStatusLabel) *NullableLocationStatusLabel { + return &NullableLocationStatusLabel{value: val, isSet: true} +} + +func (v NullableLocationStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocationStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_location_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_location_status_value.go new file mode 100644 index 00000000..0a30e8bf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_location_status_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// LocationStatusValue * `planned` - Planned * `staging` - Staging * `active` - Active * `decommissioning` - Decommissioning * `retired` - Retired +type LocationStatusValue string + +// List of Location_status_value +const ( + LOCATIONSTATUSVALUE_PLANNED LocationStatusValue = "planned" + LOCATIONSTATUSVALUE_STAGING LocationStatusValue = "staging" + LOCATIONSTATUSVALUE_ACTIVE LocationStatusValue = "active" + LOCATIONSTATUSVALUE_DECOMMISSIONING LocationStatusValue = "decommissioning" + LOCATIONSTATUSVALUE_RETIRED LocationStatusValue = "retired" +) + +// All allowed values of LocationStatusValue enum +var AllowedLocationStatusValueEnumValues = []LocationStatusValue{ + "planned", + "staging", + "active", + "decommissioning", + "retired", +} + +func (v *LocationStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LocationStatusValue(value) + for _, existing := range AllowedLocationStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LocationStatusValue", value) +} + +// NewLocationStatusValueFromValue returns a pointer to a valid LocationStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLocationStatusValueFromValue(v string) (*LocationStatusValue, error) { + ev := LocationStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LocationStatusValue: valid values are %v", v, AllowedLocationStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LocationStatusValue) IsValid() bool { + for _, existing := range AllowedLocationStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Location_status_value value +func (v LocationStatusValue) Ptr() *LocationStatusValue { + return &v +} + +type NullableLocationStatusValue struct { + value *LocationStatusValue + isSet bool +} + +func (v NullableLocationStatusValue) Get() *LocationStatusValue { + return v.value +} + +func (v *NullableLocationStatusValue) Set(val *LocationStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableLocationStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableLocationStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocationStatusValue(val *LocationStatusValue) *NullableLocationStatusValue { + return &NullableLocationStatusValue{value: val, isSet: true} +} + +func (v NullableLocationStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocationStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_manufacturer.go b/vendor/github.com/netbox-community/go-netbox/v3/model_manufacturer.go new file mode 100644 index 00000000..5735a3f7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_manufacturer.go @@ -0,0 +1,543 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Manufacturer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Manufacturer{} + +// Manufacturer Adds support for custom fields and tags. +type Manufacturer struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + DevicetypeCount int32 `json:"devicetype_count"` + InventoryitemCount int32 `json:"inventoryitem_count"` + PlatformCount int32 `json:"platform_count"` + AdditionalProperties map[string]interface{} +} + +type _Manufacturer Manufacturer + +// NewManufacturer instantiates a new Manufacturer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewManufacturer(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, devicetypeCount int32, inventoryitemCount int32, platformCount int32) *Manufacturer { + this := Manufacturer{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.DevicetypeCount = devicetypeCount + this.InventoryitemCount = inventoryitemCount + this.PlatformCount = platformCount + return &this +} + +// NewManufacturerWithDefaults instantiates a new Manufacturer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewManufacturerWithDefaults() *Manufacturer { + this := Manufacturer{} + return &this +} + +// GetId returns the Id field value +func (o *Manufacturer) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Manufacturer) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Manufacturer) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Manufacturer) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Manufacturer) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Manufacturer) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Manufacturer) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Manufacturer) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Manufacturer) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Manufacturer) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Manufacturer) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Manufacturer) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Manufacturer) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Manufacturer) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Manufacturer) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Manufacturer) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Manufacturer) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Manufacturer) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Manufacturer) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Manufacturer) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Manufacturer) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Manufacturer) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Manufacturer) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Manufacturer) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Manufacturer) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDevicetypeCount returns the DevicetypeCount field value +func (o *Manufacturer) GetDevicetypeCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DevicetypeCount +} + +// GetDevicetypeCountOk returns a tuple with the DevicetypeCount field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetDevicetypeCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DevicetypeCount, true +} + +// SetDevicetypeCount sets field value +func (o *Manufacturer) SetDevicetypeCount(v int32) { + o.DevicetypeCount = v +} + +// GetInventoryitemCount returns the InventoryitemCount field value +func (o *Manufacturer) GetInventoryitemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InventoryitemCount +} + +// GetInventoryitemCountOk returns a tuple with the InventoryitemCount field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetInventoryitemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InventoryitemCount, true +} + +// SetInventoryitemCount sets field value +func (o *Manufacturer) SetInventoryitemCount(v int32) { + o.InventoryitemCount = v +} + +// GetPlatformCount returns the PlatformCount field value +func (o *Manufacturer) GetPlatformCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PlatformCount +} + +// GetPlatformCountOk returns a tuple with the PlatformCount field value +// and a boolean to check if the value has been set. +func (o *Manufacturer) GetPlatformCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PlatformCount, true +} + +// SetPlatformCount sets field value +func (o *Manufacturer) SetPlatformCount(v int32) { + o.PlatformCount = v +} + +func (o Manufacturer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Manufacturer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["devicetype_count"] = o.DevicetypeCount + toSerialize["inventoryitem_count"] = o.InventoryitemCount + toSerialize["platform_count"] = o.PlatformCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Manufacturer) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "devicetype_count", + "inventoryitem_count", + "platform_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varManufacturer := _Manufacturer{} + + err = json.Unmarshal(data, &varManufacturer) + + if err != nil { + return err + } + + *o = Manufacturer(varManufacturer) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "devicetype_count") + delete(additionalProperties, "inventoryitem_count") + delete(additionalProperties, "platform_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableManufacturer struct { + value *Manufacturer + isSet bool +} + +func (v NullableManufacturer) Get() *Manufacturer { + return v.value +} + +func (v *NullableManufacturer) Set(val *Manufacturer) { + v.value = val + v.isSet = true +} + +func (v NullableManufacturer) IsSet() bool { + return v.isSet +} + +func (v *NullableManufacturer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableManufacturer(val *Manufacturer) *NullableManufacturer { + return &NullableManufacturer{value: val, isSet: true} +} + +func (v NullableManufacturer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableManufacturer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_manufacturer_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_manufacturer_request.go new file mode 100644 index 00000000..0c473324 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_manufacturer_request.go @@ -0,0 +1,306 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ManufacturerRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ManufacturerRequest{} + +// ManufacturerRequest Adds support for custom fields and tags. +type ManufacturerRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ManufacturerRequest ManufacturerRequest + +// NewManufacturerRequest instantiates a new ManufacturerRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewManufacturerRequest(name string, slug string) *ManufacturerRequest { + this := ManufacturerRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewManufacturerRequestWithDefaults instantiates a new ManufacturerRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewManufacturerRequestWithDefaults() *ManufacturerRequest { + this := ManufacturerRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ManufacturerRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ManufacturerRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ManufacturerRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ManufacturerRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ManufacturerRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ManufacturerRequest) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ManufacturerRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ManufacturerRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ManufacturerRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ManufacturerRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ManufacturerRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ManufacturerRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ManufacturerRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ManufacturerRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ManufacturerRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ManufacturerRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ManufacturerRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ManufacturerRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ManufacturerRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ManufacturerRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ManufacturerRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varManufacturerRequest := _ManufacturerRequest{} + + err = json.Unmarshal(data, &varManufacturerRequest) + + if err != nil { + return err + } + + *o = ManufacturerRequest(varManufacturerRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableManufacturerRequest struct { + value *ManufacturerRequest + isSet bool +} + +func (v NullableManufacturerRequest) Get() *ManufacturerRequest { + return v.value +} + +func (v *NullableManufacturerRequest) Set(val *ManufacturerRequest) { + v.value = val + v.isSet = true +} + +func (v NullableManufacturerRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableManufacturerRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableManufacturerRequest(val *ManufacturerRequest) *NullableManufacturerRequest { + return &NullableManufacturerRequest{value: val, isSet: true} +} + +func (v NullableManufacturerRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableManufacturerRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module.go new file mode 100644 index 00000000..e11f760f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module.go @@ -0,0 +1,645 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Module type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Module{} + +// Module Adds support for custom fields and tags. +type Module struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + ModuleBay NestedModuleBay `json:"module_bay"` + ModuleType NestedModuleType `json:"module_type"` + Status *ModuleStatus `json:"status,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Module Module + +// NewModule instantiates a new Module object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModule(id int32, url string, display string, device NestedDevice, moduleBay NestedModuleBay, moduleType NestedModuleType, created NullableTime, lastUpdated NullableTime) *Module { + this := Module{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.ModuleBay = moduleBay + this.ModuleType = moduleType + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewModuleWithDefaults instantiates a new Module object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleWithDefaults() *Module { + this := Module{} + return &this +} + +// GetId returns the Id field value +func (o *Module) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Module) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Module) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Module) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Module) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Module) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Module) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Module) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Module) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *Module) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *Module) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *Module) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModuleBay returns the ModuleBay field value +func (o *Module) GetModuleBay() NestedModuleBay { + if o == nil { + var ret NestedModuleBay + return ret + } + + return o.ModuleBay +} + +// GetModuleBayOk returns a tuple with the ModuleBay field value +// and a boolean to check if the value has been set. +func (o *Module) GetModuleBayOk() (*NestedModuleBay, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBay, true +} + +// SetModuleBay sets field value +func (o *Module) SetModuleBay(v NestedModuleBay) { + o.ModuleBay = v +} + +// GetModuleType returns the ModuleType field value +func (o *Module) GetModuleType() NestedModuleType { + if o == nil { + var ret NestedModuleType + return ret + } + + return o.ModuleType +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value +// and a boolean to check if the value has been set. +func (o *Module) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return &o.ModuleType, true +} + +// SetModuleType sets field value +func (o *Module) SetModuleType(v NestedModuleType) { + o.ModuleType = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Module) GetStatus() ModuleStatus { + if o == nil || IsNil(o.Status) { + var ret ModuleStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Module) GetStatusOk() (*ModuleStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Module) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatus and assigns it to the Status field. +func (o *Module) SetStatus(v ModuleStatus) { + o.Status = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *Module) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Module) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *Module) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *Module) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Module) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Module) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *Module) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *Module) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *Module) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *Module) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Module) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Module) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Module) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Module) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Module) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Module) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Module) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Module) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Module) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Module) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Module) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Module) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Module) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Module) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Module) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Module) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Module) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Module) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Module) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Module) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Module) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Module) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Module) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Module) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + toSerialize["module_bay"] = o.ModuleBay + toSerialize["module_type"] = o.ModuleType + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Module) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "module_bay", + "module_type", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModule := _Module{} + + err = json.Unmarshal(data, &varModule) + + if err != nil { + return err + } + + *o = Module(varModule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module_bay") + delete(additionalProperties, "module_type") + delete(additionalProperties, "status") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModule struct { + value *Module + isSet bool +} + +func (v NullableModule) Get() *Module { + return v.value +} + +func (v *NullableModule) Set(val *Module) { + v.value = val + v.isSet = true +} + +func (v NullableModule) IsSet() bool { + return v.isSet +} + +func (v *NullableModule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModule(val *Module) *NullableModule { + return &NullableModule{value: val, isSet: true} +} + +func (v NullableModule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay.go new file mode 100644 index 00000000..3c7db25e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay.go @@ -0,0 +1,580 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ModuleBay type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleBay{} + +// ModuleBay Adds support for custom fields and tags. +type ModuleBay struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Name string `json:"name"` + InstalledModule NullableModuleBayNestedModule `json:"installed_module,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ModuleBay ModuleBay + +// NewModuleBay instantiates a new ModuleBay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleBay(id int32, url string, display string, device NestedDevice, name string, created NullableTime, lastUpdated NullableTime) *ModuleBay { + this := ModuleBay{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewModuleBayWithDefaults instantiates a new ModuleBay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleBayWithDefaults() *ModuleBay { + this := ModuleBay{} + return &this +} + +// GetId returns the Id field value +func (o *ModuleBay) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ModuleBay) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ModuleBay) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ModuleBay) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ModuleBay) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ModuleBay) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *ModuleBay) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ModuleBay) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetName returns the Name field value +func (o *ModuleBay) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ModuleBay) SetName(v string) { + o.Name = v +} + +// GetInstalledModule returns the InstalledModule field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModuleBay) GetInstalledModule() ModuleBayNestedModule { + if o == nil || IsNil(o.InstalledModule.Get()) { + var ret ModuleBayNestedModule + return ret + } + return *o.InstalledModule.Get() +} + +// GetInstalledModuleOk returns a tuple with the InstalledModule field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleBay) GetInstalledModuleOk() (*ModuleBayNestedModule, bool) { + if o == nil { + return nil, false + } + return o.InstalledModule.Get(), o.InstalledModule.IsSet() +} + +// HasInstalledModule returns a boolean if a field has been set. +func (o *ModuleBay) HasInstalledModule() bool { + if o != nil && o.InstalledModule.IsSet() { + return true + } + + return false +} + +// SetInstalledModule gets a reference to the given NullableModuleBayNestedModule and assigns it to the InstalledModule field. +func (o *ModuleBay) SetInstalledModule(v ModuleBayNestedModule) { + o.InstalledModule.Set(&v) +} + +// SetInstalledModuleNil sets the value for InstalledModule to be an explicit nil +func (o *ModuleBay) SetInstalledModuleNil() { + o.InstalledModule.Set(nil) +} + +// UnsetInstalledModule ensures that no value is present for InstalledModule, not even an explicit nil +func (o *ModuleBay) UnsetInstalledModule() { + o.InstalledModule.Unset() +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ModuleBay) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ModuleBay) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ModuleBay) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *ModuleBay) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *ModuleBay) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *ModuleBay) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ModuleBay) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ModuleBay) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ModuleBay) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ModuleBay) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ModuleBay) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ModuleBay) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ModuleBay) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBay) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ModuleBay) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ModuleBay) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ModuleBay) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleBay) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ModuleBay) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ModuleBay) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleBay) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ModuleBay) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ModuleBay) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleBay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + if o.InstalledModule.IsSet() { + toSerialize["installed_module"] = o.InstalledModule.Get() + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleBay) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleBay := _ModuleBay{} + + err = json.Unmarshal(data, &varModuleBay) + + if err != nil { + return err + } + + *o = ModuleBay(varModuleBay) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "installed_module") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleBay struct { + value *ModuleBay + isSet bool +} + +func (v NullableModuleBay) Get() *ModuleBay { + return v.value +} + +func (v *NullableModuleBay) Set(val *ModuleBay) { + v.value = val + v.isSet = true +} + +func (v NullableModuleBay) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleBay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleBay(val *ModuleBay) *NullableModuleBay { + return &NullableModuleBay{value: val, isSet: true} +} + +func (v NullableModuleBay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleBay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_nested_module.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_nested_module.go new file mode 100644 index 00000000..a343e2df --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_nested_module.go @@ -0,0 +1,261 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModuleBayNestedModule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleBayNestedModule{} + +// ModuleBayNestedModule Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type ModuleBayNestedModule struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Serial *string `json:"serial,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModuleBayNestedModule ModuleBayNestedModule + +// NewModuleBayNestedModule instantiates a new ModuleBayNestedModule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleBayNestedModule(id int32, url string, display string) *ModuleBayNestedModule { + this := ModuleBayNestedModule{} + this.Id = id + this.Url = url + this.Display = display + return &this +} + +// NewModuleBayNestedModuleWithDefaults instantiates a new ModuleBayNestedModule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleBayNestedModuleWithDefaults() *ModuleBayNestedModule { + this := ModuleBayNestedModule{} + return &this +} + +// GetId returns the Id field value +func (o *ModuleBayNestedModule) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModuleBayNestedModule) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ModuleBayNestedModule) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ModuleBayNestedModule) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ModuleBayNestedModule) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ModuleBayNestedModule) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ModuleBayNestedModule) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ModuleBayNestedModule) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ModuleBayNestedModule) SetDisplay(v string) { + o.Display = v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *ModuleBayNestedModule) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayNestedModule) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *ModuleBayNestedModule) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *ModuleBayNestedModule) SetSerial(v string) { + o.Serial = &v +} + +func (o ModuleBayNestedModule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleBayNestedModule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleBayNestedModule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleBayNestedModule := _ModuleBayNestedModule{} + + err = json.Unmarshal(data, &varModuleBayNestedModule) + + if err != nil { + return err + } + + *o = ModuleBayNestedModule(varModuleBayNestedModule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "serial") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleBayNestedModule struct { + value *ModuleBayNestedModule + isSet bool +} + +func (v NullableModuleBayNestedModule) Get() *ModuleBayNestedModule { + return v.value +} + +func (v *NullableModuleBayNestedModule) Set(val *ModuleBayNestedModule) { + v.value = val + v.isSet = true +} + +func (v NullableModuleBayNestedModule) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleBayNestedModule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleBayNestedModule(val *ModuleBayNestedModule) *NullableModuleBayNestedModule { + return &NullableModuleBayNestedModule{value: val, isSet: true} +} + +func (v NullableModuleBayNestedModule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleBayNestedModule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_nested_module_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_nested_module_request.go new file mode 100644 index 00000000..5b3cc823 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_nested_module_request.go @@ -0,0 +1,153 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ModuleBayNestedModuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleBayNestedModuleRequest{} + +// ModuleBayNestedModuleRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type ModuleBayNestedModuleRequest struct { + Serial *string `json:"serial,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModuleBayNestedModuleRequest ModuleBayNestedModuleRequest + +// NewModuleBayNestedModuleRequest instantiates a new ModuleBayNestedModuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleBayNestedModuleRequest() *ModuleBayNestedModuleRequest { + this := ModuleBayNestedModuleRequest{} + return &this +} + +// NewModuleBayNestedModuleRequestWithDefaults instantiates a new ModuleBayNestedModuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleBayNestedModuleRequestWithDefaults() *ModuleBayNestedModuleRequest { + this := ModuleBayNestedModuleRequest{} + return &this +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *ModuleBayNestedModuleRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayNestedModuleRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *ModuleBayNestedModuleRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *ModuleBayNestedModuleRequest) SetSerial(v string) { + o.Serial = &v +} + +func (o ModuleBayNestedModuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleBayNestedModuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleBayNestedModuleRequest) UnmarshalJSON(data []byte) (err error) { + varModuleBayNestedModuleRequest := _ModuleBayNestedModuleRequest{} + + err = json.Unmarshal(data, &varModuleBayNestedModuleRequest) + + if err != nil { + return err + } + + *o = ModuleBayNestedModuleRequest(varModuleBayNestedModuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "serial") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleBayNestedModuleRequest struct { + value *ModuleBayNestedModuleRequest + isSet bool +} + +func (v NullableModuleBayNestedModuleRequest) Get() *ModuleBayNestedModuleRequest { + return v.value +} + +func (v *NullableModuleBayNestedModuleRequest) Set(val *ModuleBayNestedModuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableModuleBayNestedModuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleBayNestedModuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleBayNestedModuleRequest(val *ModuleBayNestedModuleRequest) *NullableModuleBayNestedModuleRequest { + return &NullableModuleBayNestedModuleRequest{value: val, isSet: true} +} + +func (v NullableModuleBayNestedModuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleBayNestedModuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_request.go new file mode 100644 index 00000000..620138ce --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_request.go @@ -0,0 +1,430 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModuleBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleBayRequest{} + +// ModuleBayRequest Adds support for custom fields and tags. +type ModuleBayRequest struct { + Device NestedDeviceRequest `json:"device"` + Name string `json:"name"` + InstalledModule NullableModuleBayNestedModuleRequest `json:"installed_module,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModuleBayRequest ModuleBayRequest + +// NewModuleBayRequest instantiates a new ModuleBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleBayRequest(device NestedDeviceRequest, name string) *ModuleBayRequest { + this := ModuleBayRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewModuleBayRequestWithDefaults instantiates a new ModuleBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleBayRequestWithDefaults() *ModuleBayRequest { + this := ModuleBayRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *ModuleBayRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ModuleBayRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ModuleBayRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetName returns the Name field value +func (o *ModuleBayRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModuleBayRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ModuleBayRequest) SetName(v string) { + o.Name = v +} + +// GetInstalledModule returns the InstalledModule field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModuleBayRequest) GetInstalledModule() ModuleBayNestedModuleRequest { + if o == nil || IsNil(o.InstalledModule.Get()) { + var ret ModuleBayNestedModuleRequest + return ret + } + return *o.InstalledModule.Get() +} + +// GetInstalledModuleOk returns a tuple with the InstalledModule field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleBayRequest) GetInstalledModuleOk() (*ModuleBayNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.InstalledModule.Get(), o.InstalledModule.IsSet() +} + +// HasInstalledModule returns a boolean if a field has been set. +func (o *ModuleBayRequest) HasInstalledModule() bool { + if o != nil && o.InstalledModule.IsSet() { + return true + } + + return false +} + +// SetInstalledModule gets a reference to the given NullableModuleBayNestedModuleRequest and assigns it to the InstalledModule field. +func (o *ModuleBayRequest) SetInstalledModule(v ModuleBayNestedModuleRequest) { + o.InstalledModule.Set(&v) +} + +// SetInstalledModuleNil sets the value for InstalledModule to be an explicit nil +func (o *ModuleBayRequest) SetInstalledModuleNil() { + o.InstalledModule.Set(nil) +} + +// UnsetInstalledModule ensures that no value is present for InstalledModule, not even an explicit nil +func (o *ModuleBayRequest) UnsetInstalledModule() { + o.InstalledModule.Unset() +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ModuleBayRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ModuleBayRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ModuleBayRequest) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *ModuleBayRequest) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayRequest) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *ModuleBayRequest) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *ModuleBayRequest) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ModuleBayRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ModuleBayRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ModuleBayRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ModuleBayRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ModuleBayRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ModuleBayRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ModuleBayRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ModuleBayRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ModuleBayRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ModuleBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + if o.InstalledModule.IsSet() { + toSerialize["installed_module"] = o.InstalledModule.Get() + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleBayRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleBayRequest := _ModuleBayRequest{} + + err = json.Unmarshal(data, &varModuleBayRequest) + + if err != nil { + return err + } + + *o = ModuleBayRequest(varModuleBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "installed_module") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleBayRequest struct { + value *ModuleBayRequest + isSet bool +} + +func (v NullableModuleBayRequest) Get() *ModuleBayRequest { + return v.value +} + +func (v *NullableModuleBayRequest) Set(val *ModuleBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullableModuleBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleBayRequest(val *ModuleBayRequest) *NullableModuleBayRequest { + return &NullableModuleBayRequest{value: val, isSet: true} +} + +func (v NullableModuleBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_template.go new file mode 100644 index 00000000..a591d01c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_template.go @@ -0,0 +1,459 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ModuleBayTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleBayTemplate{} + +// ModuleBayTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ModuleBayTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NestedDeviceType `json:"device_type"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ModuleBayTemplate ModuleBayTemplate + +// NewModuleBayTemplate instantiates a new ModuleBayTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleBayTemplate(id int32, url string, display string, deviceType NestedDeviceType, name string, created NullableTime, lastUpdated NullableTime) *ModuleBayTemplate { + this := ModuleBayTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.DeviceType = deviceType + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewModuleBayTemplateWithDefaults instantiates a new ModuleBayTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleBayTemplateWithDefaults() *ModuleBayTemplate { + this := ModuleBayTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *ModuleBayTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ModuleBayTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ModuleBayTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ModuleBayTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ModuleBayTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ModuleBayTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value +func (o *ModuleBayTemplate) GetDeviceType() NestedDeviceType { + if o == nil { + var ret NestedDeviceType + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *ModuleBayTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType = v +} + +// GetName returns the Name field value +func (o *ModuleBayTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ModuleBayTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ModuleBayTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ModuleBayTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ModuleBayTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *ModuleBayTemplate) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *ModuleBayTemplate) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *ModuleBayTemplate) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ModuleBayTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ModuleBayTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ModuleBayTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ModuleBayTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleBayTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ModuleBayTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ModuleBayTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleBayTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ModuleBayTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ModuleBayTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleBayTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device_type"] = o.DeviceType + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleBayTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device_type", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleBayTemplate := _ModuleBayTemplate{} + + err = json.Unmarshal(data, &varModuleBayTemplate) + + if err != nil { + return err + } + + *o = ModuleBayTemplate(varModuleBayTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleBayTemplate struct { + value *ModuleBayTemplate + isSet bool +} + +func (v NullableModuleBayTemplate) Get() *ModuleBayTemplate { + return v.value +} + +func (v *NullableModuleBayTemplate) Set(val *ModuleBayTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableModuleBayTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleBayTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleBayTemplate(val *ModuleBayTemplate) *NullableModuleBayTemplate { + return &NullableModuleBayTemplate{value: val, isSet: true} +} + +func (v NullableModuleBayTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleBayTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_template_request.go new file mode 100644 index 00000000..d7c7ea77 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_bay_template_request.go @@ -0,0 +1,309 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModuleBayTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleBayTemplateRequest{} + +// ModuleBayTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ModuleBayTemplateRequest struct { + DeviceType NestedDeviceTypeRequest `json:"device_type"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModuleBayTemplateRequest ModuleBayTemplateRequest + +// NewModuleBayTemplateRequest instantiates a new ModuleBayTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleBayTemplateRequest(deviceType NestedDeviceTypeRequest, name string) *ModuleBayTemplateRequest { + this := ModuleBayTemplateRequest{} + this.DeviceType = deviceType + this.Name = name + return &this +} + +// NewModuleBayTemplateRequestWithDefaults instantiates a new ModuleBayTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleBayTemplateRequestWithDefaults() *ModuleBayTemplateRequest { + this := ModuleBayTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value +func (o *ModuleBayTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil { + var ret NestedDeviceTypeRequest + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *ModuleBayTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType = v +} + +// GetName returns the Name field value +func (o *ModuleBayTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ModuleBayTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ModuleBayTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ModuleBayTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *ModuleBayTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *ModuleBayTemplateRequest) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplateRequest) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *ModuleBayTemplateRequest) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *ModuleBayTemplateRequest) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ModuleBayTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleBayTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ModuleBayTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ModuleBayTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o ModuleBayTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleBayTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_type"] = o.DeviceType + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleBayTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleBayTemplateRequest := _ModuleBayTemplateRequest{} + + err = json.Unmarshal(data, &varModuleBayTemplateRequest) + + if err != nil { + return err + } + + *o = ModuleBayTemplateRequest(varModuleBayTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleBayTemplateRequest struct { + value *ModuleBayTemplateRequest + isSet bool +} + +func (v NullableModuleBayTemplateRequest) Get() *ModuleBayTemplateRequest { + return v.value +} + +func (v *NullableModuleBayTemplateRequest) Set(val *ModuleBayTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableModuleBayTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleBayTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleBayTemplateRequest(val *ModuleBayTemplateRequest) *NullableModuleBayTemplateRequest { + return &NullableModuleBayTemplateRequest{value: val, isSet: true} +} + +func (v NullableModuleBayTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleBayTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_nested_module_bay.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_nested_module_bay.go new file mode 100644 index 00000000..f3b53dcc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_nested_module_bay.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModuleNestedModuleBay type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleNestedModuleBay{} + +// ModuleNestedModuleBay Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type ModuleNestedModuleBay struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _ModuleNestedModuleBay ModuleNestedModuleBay + +// NewModuleNestedModuleBay instantiates a new ModuleNestedModuleBay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleNestedModuleBay(id int32, url string, display string, name string) *ModuleNestedModuleBay { + this := ModuleNestedModuleBay{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewModuleNestedModuleBayWithDefaults instantiates a new ModuleNestedModuleBay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleNestedModuleBayWithDefaults() *ModuleNestedModuleBay { + this := ModuleNestedModuleBay{} + return &this +} + +// GetId returns the Id field value +func (o *ModuleNestedModuleBay) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModuleNestedModuleBay) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ModuleNestedModuleBay) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ModuleNestedModuleBay) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ModuleNestedModuleBay) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ModuleNestedModuleBay) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ModuleNestedModuleBay) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ModuleNestedModuleBay) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ModuleNestedModuleBay) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ModuleNestedModuleBay) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModuleNestedModuleBay) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ModuleNestedModuleBay) SetName(v string) { + o.Name = v +} + +func (o ModuleNestedModuleBay) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleNestedModuleBay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleNestedModuleBay) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleNestedModuleBay := _ModuleNestedModuleBay{} + + err = json.Unmarshal(data, &varModuleNestedModuleBay) + + if err != nil { + return err + } + + *o = ModuleNestedModuleBay(varModuleNestedModuleBay) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleNestedModuleBay struct { + value *ModuleNestedModuleBay + isSet bool +} + +func (v NullableModuleNestedModuleBay) Get() *ModuleNestedModuleBay { + return v.value +} + +func (v *NullableModuleNestedModuleBay) Set(val *ModuleNestedModuleBay) { + v.value = val + v.isSet = true +} + +func (v NullableModuleNestedModuleBay) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleNestedModuleBay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleNestedModuleBay(val *ModuleNestedModuleBay) *NullableModuleNestedModuleBay { + return &NullableModuleNestedModuleBay{value: val, isSet: true} +} + +func (v NullableModuleNestedModuleBay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleNestedModuleBay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_nested_module_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_nested_module_bay_request.go new file mode 100644 index 00000000..7a27d963 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_nested_module_bay_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModuleNestedModuleBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleNestedModuleBayRequest{} + +// ModuleNestedModuleBayRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type ModuleNestedModuleBayRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _ModuleNestedModuleBayRequest ModuleNestedModuleBayRequest + +// NewModuleNestedModuleBayRequest instantiates a new ModuleNestedModuleBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleNestedModuleBayRequest(name string) *ModuleNestedModuleBayRequest { + this := ModuleNestedModuleBayRequest{} + this.Name = name + return &this +} + +// NewModuleNestedModuleBayRequestWithDefaults instantiates a new ModuleNestedModuleBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleNestedModuleBayRequestWithDefaults() *ModuleNestedModuleBayRequest { + this := ModuleNestedModuleBayRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ModuleNestedModuleBayRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModuleNestedModuleBayRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ModuleNestedModuleBayRequest) SetName(v string) { + o.Name = v +} + +func (o ModuleNestedModuleBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleNestedModuleBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleNestedModuleBayRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleNestedModuleBayRequest := _ModuleNestedModuleBayRequest{} + + err = json.Unmarshal(data, &varModuleNestedModuleBayRequest) + + if err != nil { + return err + } + + *o = ModuleNestedModuleBayRequest(varModuleNestedModuleBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleNestedModuleBayRequest struct { + value *ModuleNestedModuleBayRequest + isSet bool +} + +func (v NullableModuleNestedModuleBayRequest) Get() *ModuleNestedModuleBayRequest { + return v.value +} + +func (v *NullableModuleNestedModuleBayRequest) Set(val *ModuleNestedModuleBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullableModuleNestedModuleBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleNestedModuleBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleNestedModuleBayRequest(val *ModuleNestedModuleBayRequest) *NullableModuleNestedModuleBayRequest { + return &NullableModuleNestedModuleBayRequest{value: val, isSet: true} +} + +func (v NullableModuleNestedModuleBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleNestedModuleBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_request.go new file mode 100644 index 00000000..a3900a65 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_request.go @@ -0,0 +1,495 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleRequest{} + +// ModuleRequest Adds support for custom fields and tags. +type ModuleRequest struct { + Device NestedDeviceRequest `json:"device"` + ModuleBay NestedModuleBayRequest `json:"module_bay"` + ModuleType NestedModuleTypeRequest `json:"module_type"` + Status *ModuleStatusValue `json:"status,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModuleRequest ModuleRequest + +// NewModuleRequest instantiates a new ModuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleRequest(device NestedDeviceRequest, moduleBay NestedModuleBayRequest, moduleType NestedModuleTypeRequest) *ModuleRequest { + this := ModuleRequest{} + this.Device = device + this.ModuleBay = moduleBay + this.ModuleType = moduleType + return &this +} + +// NewModuleRequestWithDefaults instantiates a new ModuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleRequestWithDefaults() *ModuleRequest { + this := ModuleRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *ModuleRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *ModuleRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetModuleBay returns the ModuleBay field value +func (o *ModuleRequest) GetModuleBay() NestedModuleBayRequest { + if o == nil { + var ret NestedModuleBayRequest + return ret + } + + return o.ModuleBay +} + +// GetModuleBayOk returns a tuple with the ModuleBay field value +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetModuleBayOk() (*NestedModuleBayRequest, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBay, true +} + +// SetModuleBay sets field value +func (o *ModuleRequest) SetModuleBay(v NestedModuleBayRequest) { + o.ModuleBay = v +} + +// GetModuleType returns the ModuleType field value +func (o *ModuleRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil { + var ret NestedModuleTypeRequest + return ret + } + + return o.ModuleType +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return &o.ModuleType, true +} + +// SetModuleType sets field value +func (o *ModuleRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ModuleRequest) GetStatus() ModuleStatusValue { + if o == nil || IsNil(o.Status) { + var ret ModuleStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetStatusOk() (*ModuleStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ModuleRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatusValue and assigns it to the Status field. +func (o *ModuleRequest) SetStatus(v ModuleStatusValue) { + o.Status = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *ModuleRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *ModuleRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *ModuleRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModuleRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *ModuleRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *ModuleRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *ModuleRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *ModuleRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ModuleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ModuleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ModuleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ModuleRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ModuleRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ModuleRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ModuleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ModuleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ModuleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ModuleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ModuleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ModuleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ModuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["module_bay"] = o.ModuleBay + toSerialize["module_type"] = o.ModuleType + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "module_bay", + "module_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleRequest := _ModuleRequest{} + + err = json.Unmarshal(data, &varModuleRequest) + + if err != nil { + return err + } + + *o = ModuleRequest(varModuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module_bay") + delete(additionalProperties, "module_type") + delete(additionalProperties, "status") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleRequest struct { + value *ModuleRequest + isSet bool +} + +func (v NullableModuleRequest) Get() *ModuleRequest { + return v.value +} + +func (v *NullableModuleRequest) Set(val *ModuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableModuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleRequest(val *ModuleRequest) *NullableModuleRequest { + return &NullableModuleRequest{value: val, isSet: true} +} + +func (v NullableModuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_status.go new file mode 100644 index 00000000..b94d30f4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ModuleStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleStatus{} + +// ModuleStatus struct for ModuleStatus +type ModuleStatus struct { + Value *ModuleStatusValue `json:"value,omitempty"` + Label *ModuleStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModuleStatus ModuleStatus + +// NewModuleStatus instantiates a new ModuleStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleStatus() *ModuleStatus { + this := ModuleStatus{} + return &this +} + +// NewModuleStatusWithDefaults instantiates a new ModuleStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleStatusWithDefaults() *ModuleStatus { + this := ModuleStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ModuleStatus) GetValue() ModuleStatusValue { + if o == nil || IsNil(o.Value) { + var ret ModuleStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleStatus) GetValueOk() (*ModuleStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ModuleStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given ModuleStatusValue and assigns it to the Value field. +func (o *ModuleStatus) SetValue(v ModuleStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ModuleStatus) GetLabel() ModuleStatusLabel { + if o == nil || IsNil(o.Label) { + var ret ModuleStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleStatus) GetLabelOk() (*ModuleStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ModuleStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given ModuleStatusLabel and assigns it to the Label field. +func (o *ModuleStatus) SetLabel(v ModuleStatusLabel) { + o.Label = &v +} + +func (o ModuleStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleStatus) UnmarshalJSON(data []byte) (err error) { + varModuleStatus := _ModuleStatus{} + + err = json.Unmarshal(data, &varModuleStatus) + + if err != nil { + return err + } + + *o = ModuleStatus(varModuleStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleStatus struct { + value *ModuleStatus + isSet bool +} + +func (v NullableModuleStatus) Get() *ModuleStatus { + return v.value +} + +func (v *NullableModuleStatus) Set(val *ModuleStatus) { + v.value = val + v.isSet = true +} + +func (v NullableModuleStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleStatus(val *ModuleStatus) *NullableModuleStatus { + return &NullableModuleStatus{value: val, isSet: true} +} + +func (v NullableModuleStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_status_label.go new file mode 100644 index 00000000..bd4a91cd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_status_label.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ModuleStatusLabel the model 'ModuleStatusLabel' +type ModuleStatusLabel string + +// List of Module_status_label +const ( + MODULESTATUSLABEL_OFFLINE ModuleStatusLabel = "Offline" + MODULESTATUSLABEL_ACTIVE ModuleStatusLabel = "Active" + MODULESTATUSLABEL_PLANNED ModuleStatusLabel = "Planned" + MODULESTATUSLABEL_STAGED ModuleStatusLabel = "Staged" + MODULESTATUSLABEL_FAILED ModuleStatusLabel = "Failed" + MODULESTATUSLABEL_DECOMMISSIONING ModuleStatusLabel = "Decommissioning" +) + +// All allowed values of ModuleStatusLabel enum +var AllowedModuleStatusLabelEnumValues = []ModuleStatusLabel{ + "Offline", + "Active", + "Planned", + "Staged", + "Failed", + "Decommissioning", +} + +func (v *ModuleStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ModuleStatusLabel(value) + for _, existing := range AllowedModuleStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ModuleStatusLabel", value) +} + +// NewModuleStatusLabelFromValue returns a pointer to a valid ModuleStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewModuleStatusLabelFromValue(v string) (*ModuleStatusLabel, error) { + ev := ModuleStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ModuleStatusLabel: valid values are %v", v, AllowedModuleStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ModuleStatusLabel) IsValid() bool { + for _, existing := range AllowedModuleStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Module_status_label value +func (v ModuleStatusLabel) Ptr() *ModuleStatusLabel { + return &v +} + +type NullableModuleStatusLabel struct { + value *ModuleStatusLabel + isSet bool +} + +func (v NullableModuleStatusLabel) Get() *ModuleStatusLabel { + return v.value +} + +func (v *NullableModuleStatusLabel) Set(val *ModuleStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableModuleStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleStatusLabel(val *ModuleStatusLabel) *NullableModuleStatusLabel { + return &NullableModuleStatusLabel{value: val, isSet: true} +} + +func (v NullableModuleStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_status_value.go new file mode 100644 index 00000000..e4c08ca9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_status_value.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ModuleStatusValue * `offline` - Offline * `active` - Active * `planned` - Planned * `staged` - Staged * `failed` - Failed * `decommissioning` - Decommissioning +type ModuleStatusValue string + +// List of Module_status_value +const ( + MODULESTATUSVALUE_OFFLINE ModuleStatusValue = "offline" + MODULESTATUSVALUE_ACTIVE ModuleStatusValue = "active" + MODULESTATUSVALUE_PLANNED ModuleStatusValue = "planned" + MODULESTATUSVALUE_STAGED ModuleStatusValue = "staged" + MODULESTATUSVALUE_FAILED ModuleStatusValue = "failed" + MODULESTATUSVALUE_DECOMMISSIONING ModuleStatusValue = "decommissioning" +) + +// All allowed values of ModuleStatusValue enum +var AllowedModuleStatusValueEnumValues = []ModuleStatusValue{ + "offline", + "active", + "planned", + "staged", + "failed", + "decommissioning", +} + +func (v *ModuleStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ModuleStatusValue(value) + for _, existing := range AllowedModuleStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ModuleStatusValue", value) +} + +// NewModuleStatusValueFromValue returns a pointer to a valid ModuleStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewModuleStatusValueFromValue(v string) (*ModuleStatusValue, error) { + ev := ModuleStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ModuleStatusValue: valid values are %v", v, AllowedModuleStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ModuleStatusValue) IsValid() bool { + for _, existing := range AllowedModuleStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Module_status_value value +func (v ModuleStatusValue) Ptr() *ModuleStatusValue { + return &v +} + +type NullableModuleStatusValue struct { + value *ModuleStatusValue + isSet bool +} + +func (v NullableModuleStatusValue) Get() *ModuleStatusValue { + return v.value +} + +func (v *NullableModuleStatusValue) Set(val *ModuleStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableModuleStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleStatusValue(val *ModuleStatusValue) *NullableModuleStatusValue { + return &NullableModuleStatusValue{value: val, isSet: true} +} + +func (v NullableModuleStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_type.go new file mode 100644 index 00000000..a130fb65 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_type.go @@ -0,0 +1,627 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ModuleType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleType{} + +// ModuleType Adds support for custom fields and tags. +type ModuleType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Manufacturer NestedManufacturer `json:"manufacturer"` + Model string `json:"model"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit NullableDeviceTypeWeightUnit `json:"weight_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ModuleType ModuleType + +// NewModuleType instantiates a new ModuleType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleType(id int32, url string, display string, manufacturer NestedManufacturer, model string, created NullableTime, lastUpdated NullableTime) *ModuleType { + this := ModuleType{} + this.Id = id + this.Url = url + this.Display = display + this.Manufacturer = manufacturer + this.Model = model + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewModuleTypeWithDefaults instantiates a new ModuleType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleTypeWithDefaults() *ModuleType { + this := ModuleType{} + return &this +} + +// GetId returns the Id field value +func (o *ModuleType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModuleType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ModuleType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ModuleType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ModuleType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ModuleType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ModuleType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ModuleType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ModuleType) SetDisplay(v string) { + o.Display = v +} + +// GetManufacturer returns the Manufacturer field value +func (o *ModuleType) GetManufacturer() NestedManufacturer { + if o == nil { + var ret NestedManufacturer + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *ModuleType) GetManufacturerOk() (*NestedManufacturer, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *ModuleType) SetManufacturer(v NestedManufacturer) { + o.Manufacturer = v +} + +// GetModel returns the Model field value +func (o *ModuleType) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *ModuleType) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *ModuleType) SetModel(v string) { + o.Model = v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *ModuleType) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleType) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *ModuleType) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *ModuleType) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModuleType) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleType) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *ModuleType) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *ModuleType) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *ModuleType) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *ModuleType) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModuleType) GetWeightUnit() DeviceTypeWeightUnit { + if o == nil || IsNil(o.WeightUnit.Get()) { + var ret DeviceTypeWeightUnit + return ret + } + return *o.WeightUnit.Get() +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleType) GetWeightUnitOk() (*DeviceTypeWeightUnit, bool) { + if o == nil { + return nil, false + } + return o.WeightUnit.Get(), o.WeightUnit.IsSet() +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *ModuleType) HasWeightUnit() bool { + if o != nil && o.WeightUnit.IsSet() { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given NullableDeviceTypeWeightUnit and assigns it to the WeightUnit field. +func (o *ModuleType) SetWeightUnit(v DeviceTypeWeightUnit) { + o.WeightUnit.Set(&v) +} + +// SetWeightUnitNil sets the value for WeightUnit to be an explicit nil +func (o *ModuleType) SetWeightUnitNil() { + o.WeightUnit.Set(nil) +} + +// UnsetWeightUnit ensures that no value is present for WeightUnit, not even an explicit nil +func (o *ModuleType) UnsetWeightUnit() { + o.WeightUnit.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ModuleType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ModuleType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ModuleType) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ModuleType) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleType) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ModuleType) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ModuleType) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ModuleType) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleType) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ModuleType) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ModuleType) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ModuleType) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleType) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ModuleType) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ModuleType) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ModuleType) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleType) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ModuleType) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ModuleType) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleType) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ModuleType) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ModuleType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["manufacturer"] = o.Manufacturer + toSerialize["model"] = o.Model + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.WeightUnit.IsSet() { + toSerialize["weight_unit"] = o.WeightUnit.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "manufacturer", + "model", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleType := _ModuleType{} + + err = json.Unmarshal(data, &varModuleType) + + if err != nil { + return err + } + + *o = ModuleType(varModuleType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "model") + delete(additionalProperties, "part_number") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleType struct { + value *ModuleType + isSet bool +} + +func (v NullableModuleType) Get() *ModuleType { + return v.value +} + +func (v *NullableModuleType) Set(val *ModuleType) { + v.value = val + v.isSet = true +} + +func (v NullableModuleType) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleType(val *ModuleType) *NullableModuleType { + return &NullableModuleType{value: val, isSet: true} +} + +func (v NullableModuleType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_module_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_module_type_request.go new file mode 100644 index 00000000..7090982f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_module_type_request.go @@ -0,0 +1,477 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModuleTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModuleTypeRequest{} + +// ModuleTypeRequest Adds support for custom fields and tags. +type ModuleTypeRequest struct { + Manufacturer NestedManufacturerRequest `json:"manufacturer"` + Model string `json:"model"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit NullableDeviceTypeRequestWeightUnit `json:"weight_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModuleTypeRequest ModuleTypeRequest + +// NewModuleTypeRequest instantiates a new ModuleTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModuleTypeRequest(manufacturer NestedManufacturerRequest, model string) *ModuleTypeRequest { + this := ModuleTypeRequest{} + this.Manufacturer = manufacturer + this.Model = model + return &this +} + +// NewModuleTypeRequestWithDefaults instantiates a new ModuleTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModuleTypeRequestWithDefaults() *ModuleTypeRequest { + this := ModuleTypeRequest{} + return &this +} + +// GetManufacturer returns the Manufacturer field value +func (o *ModuleTypeRequest) GetManufacturer() NestedManufacturerRequest { + if o == nil { + var ret NestedManufacturerRequest + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *ModuleTypeRequest) GetManufacturerOk() (*NestedManufacturerRequest, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *ModuleTypeRequest) SetManufacturer(v NestedManufacturerRequest) { + o.Manufacturer = v +} + +// GetModel returns the Model field value +func (o *ModuleTypeRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *ModuleTypeRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *ModuleTypeRequest) SetModel(v string) { + o.Model = v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *ModuleTypeRequest) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleTypeRequest) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *ModuleTypeRequest) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *ModuleTypeRequest) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModuleTypeRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleTypeRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *ModuleTypeRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *ModuleTypeRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *ModuleTypeRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *ModuleTypeRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ModuleTypeRequest) GetWeightUnit() DeviceTypeRequestWeightUnit { + if o == nil || IsNil(o.WeightUnit.Get()) { + var ret DeviceTypeRequestWeightUnit + return ret + } + return *o.WeightUnit.Get() +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ModuleTypeRequest) GetWeightUnitOk() (*DeviceTypeRequestWeightUnit, bool) { + if o == nil { + return nil, false + } + return o.WeightUnit.Get(), o.WeightUnit.IsSet() +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *ModuleTypeRequest) HasWeightUnit() bool { + if o != nil && o.WeightUnit.IsSet() { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given NullableDeviceTypeRequestWeightUnit and assigns it to the WeightUnit field. +func (o *ModuleTypeRequest) SetWeightUnit(v DeviceTypeRequestWeightUnit) { + o.WeightUnit.Set(&v) +} + +// SetWeightUnitNil sets the value for WeightUnit to be an explicit nil +func (o *ModuleTypeRequest) SetWeightUnitNil() { + o.WeightUnit.Set(nil) +} + +// UnsetWeightUnit ensures that no value is present for WeightUnit, not even an explicit nil +func (o *ModuleTypeRequest) UnsetWeightUnit() { + o.WeightUnit.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ModuleTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ModuleTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ModuleTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ModuleTypeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleTypeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ModuleTypeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ModuleTypeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ModuleTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ModuleTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ModuleTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ModuleTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModuleTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ModuleTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ModuleTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ModuleTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModuleTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["manufacturer"] = o.Manufacturer + toSerialize["model"] = o.Model + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.WeightUnit.IsSet() { + toSerialize["weight_unit"] = o.WeightUnit.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModuleTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "manufacturer", + "model", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModuleTypeRequest := _ModuleTypeRequest{} + + err = json.Unmarshal(data, &varModuleTypeRequest) + + if err != nil { + return err + } + + *o = ModuleTypeRequest(varModuleTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "model") + delete(additionalProperties, "part_number") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModuleTypeRequest struct { + value *ModuleTypeRequest + isSet bool +} + +func (v NullableModuleTypeRequest) Get() *ModuleTypeRequest { + return v.value +} + +func (v *NullableModuleTypeRequest) Set(val *ModuleTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableModuleTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableModuleTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModuleTypeRequest(val *ModuleTypeRequest) *NullableModuleTypeRequest { + return &NullableModuleTypeRequest{value: val, isSet: true} +} + +func (v NullableModuleTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModuleTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cable.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cable.go new file mode 100644 index 00000000..6b7aea0f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cable.go @@ -0,0 +1,261 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCable{} + +// NestedCable Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCable struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Label *string `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedCable NestedCable + +// NewNestedCable instantiates a new NestedCable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCable(id int32, url string, display string) *NestedCable { + this := NestedCable{} + this.Id = id + this.Url = url + this.Display = display + return &this +} + +// NewNestedCableWithDefaults instantiates a new NestedCable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCableWithDefaults() *NestedCable { + this := NestedCable{} + return &this +} + +// GetId returns the Id field value +func (o *NestedCable) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedCable) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedCable) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedCable) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedCable) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedCable) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedCable) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedCable) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedCable) SetDisplay(v string) { + o.Display = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *NestedCable) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedCable) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *NestedCable) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *NestedCable) SetLabel(v string) { + o.Label = &v +} + +func (o NestedCable) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCable) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCable := _NestedCable{} + + err = json.Unmarshal(data, &varNestedCable) + + if err != nil { + return err + } + + *o = NestedCable(varNestedCable) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCable struct { + value *NestedCable + isSet bool +} + +func (v NullableNestedCable) Get() *NestedCable { + return v.value +} + +func (v *NullableNestedCable) Set(val *NestedCable) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCable) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCable(val *NestedCable) *NullableNestedCable { + return &NullableNestedCable{value: val, isSet: true} +} + +func (v NullableNestedCable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cable_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cable_request.go new file mode 100644 index 00000000..7fc2df80 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cable_request.go @@ -0,0 +1,153 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the NestedCableRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCableRequest{} + +// NestedCableRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCableRequest struct { + Label *string `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedCableRequest NestedCableRequest + +// NewNestedCableRequest instantiates a new NestedCableRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCableRequest() *NestedCableRequest { + this := NestedCableRequest{} + return &this +} + +// NewNestedCableRequestWithDefaults instantiates a new NestedCableRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCableRequestWithDefaults() *NestedCableRequest { + this := NestedCableRequest{} + return &this +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *NestedCableRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedCableRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *NestedCableRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *NestedCableRequest) SetLabel(v string) { + o.Label = &v +} + +func (o NestedCableRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCableRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCableRequest) UnmarshalJSON(data []byte) (err error) { + varNestedCableRequest := _NestedCableRequest{} + + err = json.Unmarshal(data, &varNestedCableRequest) + + if err != nil { + return err + } + + *o = NestedCableRequest(varNestedCableRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCableRequest struct { + value *NestedCableRequest + isSet bool +} + +func (v NullableNestedCableRequest) Get() *NestedCableRequest { + return v.value +} + +func (v *NullableNestedCableRequest) Set(val *NestedCableRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCableRequest(val *NestedCableRequest) *NullableNestedCableRequest { + return &NullableNestedCableRequest{value: val, isSet: true} +} + +func (v NullableNestedCableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit.go new file mode 100644 index 00000000..eb704658 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit.go @@ -0,0 +1,254 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCircuit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCircuit{} + +// NestedCircuit Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCircuit struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Unique circuit ID + Cid string `json:"cid"` + AdditionalProperties map[string]interface{} +} + +type _NestedCircuit NestedCircuit + +// NewNestedCircuit instantiates a new NestedCircuit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCircuit(id int32, url string, display string, cid string) *NestedCircuit { + this := NestedCircuit{} + this.Id = id + this.Url = url + this.Display = display + this.Cid = cid + return &this +} + +// NewNestedCircuitWithDefaults instantiates a new NestedCircuit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCircuitWithDefaults() *NestedCircuit { + this := NestedCircuit{} + return &this +} + +// GetId returns the Id field value +func (o *NestedCircuit) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedCircuit) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedCircuit) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedCircuit) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedCircuit) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedCircuit) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedCircuit) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedCircuit) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedCircuit) SetDisplay(v string) { + o.Display = v +} + +// GetCid returns the Cid field value +func (o *NestedCircuit) GetCid() string { + if o == nil { + var ret string + return ret + } + + return o.Cid +} + +// GetCidOk returns a tuple with the Cid field value +// and a boolean to check if the value has been set. +func (o *NestedCircuit) GetCidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cid, true +} + +// SetCid sets field value +func (o *NestedCircuit) SetCid(v string) { + o.Cid = v +} + +func (o NestedCircuit) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCircuit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["cid"] = o.Cid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCircuit) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "cid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCircuit := _NestedCircuit{} + + err = json.Unmarshal(data, &varNestedCircuit) + + if err != nil { + return err + } + + *o = NestedCircuit(varNestedCircuit) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "cid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCircuit struct { + value *NestedCircuit + isSet bool +} + +func (v NullableNestedCircuit) Get() *NestedCircuit { + return v.value +} + +func (v *NullableNestedCircuit) Set(val *NestedCircuit) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCircuit) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCircuit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCircuit(val *NestedCircuit) *NullableNestedCircuit { + return &NullableNestedCircuit{value: val, isSet: true} +} + +func (v NullableNestedCircuit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCircuit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_request.go new file mode 100644 index 00000000..09524e77 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_request.go @@ -0,0 +1,167 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCircuitRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCircuitRequest{} + +// NestedCircuitRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCircuitRequest struct { + // Unique circuit ID + Cid string `json:"cid"` + AdditionalProperties map[string]interface{} +} + +type _NestedCircuitRequest NestedCircuitRequest + +// NewNestedCircuitRequest instantiates a new NestedCircuitRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCircuitRequest(cid string) *NestedCircuitRequest { + this := NestedCircuitRequest{} + this.Cid = cid + return &this +} + +// NewNestedCircuitRequestWithDefaults instantiates a new NestedCircuitRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCircuitRequestWithDefaults() *NestedCircuitRequest { + this := NestedCircuitRequest{} + return &this +} + +// GetCid returns the Cid field value +func (o *NestedCircuitRequest) GetCid() string { + if o == nil { + var ret string + return ret + } + + return o.Cid +} + +// GetCidOk returns a tuple with the Cid field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitRequest) GetCidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cid, true +} + +// SetCid sets field value +func (o *NestedCircuitRequest) SetCid(v string) { + o.Cid = v +} + +func (o NestedCircuitRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCircuitRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cid"] = o.Cid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCircuitRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCircuitRequest := _NestedCircuitRequest{} + + err = json.Unmarshal(data, &varNestedCircuitRequest) + + if err != nil { + return err + } + + *o = NestedCircuitRequest(varNestedCircuitRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCircuitRequest struct { + value *NestedCircuitRequest + isSet bool +} + +func (v NullableNestedCircuitRequest) Get() *NestedCircuitRequest { + return v.value +} + +func (v *NullableNestedCircuitRequest) Set(val *NestedCircuitRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCircuitRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCircuitRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCircuitRequest(val *NestedCircuitRequest) *NullableNestedCircuitRequest { + return &NullableNestedCircuitRequest{value: val, isSet: true} +} + +func (v NullableNestedCircuitRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCircuitRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_type.go new file mode 100644 index 00000000..081ffbd2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_type.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCircuitType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCircuitType{} + +// NestedCircuitType Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCircuitType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedCircuitType NestedCircuitType + +// NewNestedCircuitType instantiates a new NestedCircuitType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCircuitType(id int32, url string, display string, name string, slug string) *NestedCircuitType { + this := NestedCircuitType{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedCircuitTypeWithDefaults instantiates a new NestedCircuitType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCircuitTypeWithDefaults() *NestedCircuitType { + this := NestedCircuitType{} + return &this +} + +// GetId returns the Id field value +func (o *NestedCircuitType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedCircuitType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedCircuitType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedCircuitType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedCircuitType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedCircuitType) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedCircuitType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedCircuitType) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedCircuitType) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitType) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedCircuitType) SetSlug(v string) { + o.Slug = v +} + +func (o NestedCircuitType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCircuitType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCircuitType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCircuitType := _NestedCircuitType{} + + err = json.Unmarshal(data, &varNestedCircuitType) + + if err != nil { + return err + } + + *o = NestedCircuitType(varNestedCircuitType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCircuitType struct { + value *NestedCircuitType + isSet bool +} + +func (v NullableNestedCircuitType) Get() *NestedCircuitType { + return v.value +} + +func (v *NullableNestedCircuitType) Set(val *NestedCircuitType) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCircuitType) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCircuitType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCircuitType(val *NestedCircuitType) *NullableNestedCircuitType { + return &NullableNestedCircuitType{value: val, isSet: true} +} + +func (v NullableNestedCircuitType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCircuitType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_type_request.go new file mode 100644 index 00000000..ddcbeb69 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_circuit_type_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCircuitTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCircuitTypeRequest{} + +// NestedCircuitTypeRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCircuitTypeRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedCircuitTypeRequest NestedCircuitTypeRequest + +// NewNestedCircuitTypeRequest instantiates a new NestedCircuitTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCircuitTypeRequest(name string, slug string) *NestedCircuitTypeRequest { + this := NestedCircuitTypeRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedCircuitTypeRequestWithDefaults instantiates a new NestedCircuitTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCircuitTypeRequestWithDefaults() *NestedCircuitTypeRequest { + this := NestedCircuitTypeRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedCircuitTypeRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitTypeRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedCircuitTypeRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedCircuitTypeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedCircuitTypeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedCircuitTypeRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedCircuitTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCircuitTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCircuitTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCircuitTypeRequest := _NestedCircuitTypeRequest{} + + err = json.Unmarshal(data, &varNestedCircuitTypeRequest) + + if err != nil { + return err + } + + *o = NestedCircuitTypeRequest(varNestedCircuitTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCircuitTypeRequest struct { + value *NestedCircuitTypeRequest + isSet bool +} + +func (v NullableNestedCircuitTypeRequest) Get() *NestedCircuitTypeRequest { + return v.value +} + +func (v *NullableNestedCircuitTypeRequest) Set(val *NestedCircuitTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCircuitTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCircuitTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCircuitTypeRequest(val *NestedCircuitTypeRequest) *NullableNestedCircuitTypeRequest { + return &NullableNestedCircuitTypeRequest{value: val, isSet: true} +} + +func (v NullableNestedCircuitTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCircuitTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster.go new file mode 100644 index 00000000..a8edbc71 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCluster type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCluster{} + +// NestedCluster Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCluster struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedCluster NestedCluster + +// NewNestedCluster instantiates a new NestedCluster object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCluster(id int32, url string, display string, name string) *NestedCluster { + this := NestedCluster{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedClusterWithDefaults instantiates a new NestedCluster object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedClusterWithDefaults() *NestedCluster { + this := NestedCluster{} + return &this +} + +// GetId returns the Id field value +func (o *NestedCluster) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedCluster) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedCluster) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedCluster) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedCluster) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedCluster) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedCluster) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedCluster) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedCluster) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedCluster) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedCluster) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedCluster) SetName(v string) { + o.Name = v +} + +func (o NestedCluster) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCluster) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCluster) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCluster := _NestedCluster{} + + err = json.Unmarshal(data, &varNestedCluster) + + if err != nil { + return err + } + + *o = NestedCluster(varNestedCluster) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCluster struct { + value *NestedCluster + isSet bool +} + +func (v NullableNestedCluster) Get() *NestedCluster { + return v.value +} + +func (v *NullableNestedCluster) Set(val *NestedCluster) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCluster) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCluster) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCluster(val *NestedCluster) *NullableNestedCluster { + return &NullableNestedCluster{value: val, isSet: true} +} + +func (v NullableNestedCluster) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCluster) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_group.go new file mode 100644 index 00000000..d14366f0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_group.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedClusterGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedClusterGroup{} + +// NestedClusterGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedClusterGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedClusterGroup NestedClusterGroup + +// NewNestedClusterGroup instantiates a new NestedClusterGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedClusterGroup(id int32, url string, display string, name string, slug string) *NestedClusterGroup { + this := NestedClusterGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedClusterGroupWithDefaults instantiates a new NestedClusterGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedClusterGroupWithDefaults() *NestedClusterGroup { + this := NestedClusterGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedClusterGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedClusterGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedClusterGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedClusterGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedClusterGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedClusterGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedClusterGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedClusterGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedClusterGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedClusterGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedClusterGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedClusterGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedClusterGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedClusterGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedClusterGroup) SetSlug(v string) { + o.Slug = v +} + +func (o NestedClusterGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedClusterGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedClusterGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedClusterGroup := _NestedClusterGroup{} + + err = json.Unmarshal(data, &varNestedClusterGroup) + + if err != nil { + return err + } + + *o = NestedClusterGroup(varNestedClusterGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedClusterGroup struct { + value *NestedClusterGroup + isSet bool +} + +func (v NullableNestedClusterGroup) Get() *NestedClusterGroup { + return v.value +} + +func (v *NullableNestedClusterGroup) Set(val *NestedClusterGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedClusterGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedClusterGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedClusterGroup(val *NestedClusterGroup) *NullableNestedClusterGroup { + return &NullableNestedClusterGroup{value: val, isSet: true} +} + +func (v NullableNestedClusterGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedClusterGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_group_request.go new file mode 100644 index 00000000..11c97fe6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedClusterGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedClusterGroupRequest{} + +// NestedClusterGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedClusterGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedClusterGroupRequest NestedClusterGroupRequest + +// NewNestedClusterGroupRequest instantiates a new NestedClusterGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedClusterGroupRequest(name string, slug string) *NestedClusterGroupRequest { + this := NestedClusterGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedClusterGroupRequestWithDefaults instantiates a new NestedClusterGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedClusterGroupRequestWithDefaults() *NestedClusterGroupRequest { + this := NestedClusterGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedClusterGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedClusterGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedClusterGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedClusterGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedClusterGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedClusterGroupRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedClusterGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedClusterGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedClusterGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedClusterGroupRequest := _NestedClusterGroupRequest{} + + err = json.Unmarshal(data, &varNestedClusterGroupRequest) + + if err != nil { + return err + } + + *o = NestedClusterGroupRequest(varNestedClusterGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedClusterGroupRequest struct { + value *NestedClusterGroupRequest + isSet bool +} + +func (v NullableNestedClusterGroupRequest) Get() *NestedClusterGroupRequest { + return v.value +} + +func (v *NullableNestedClusterGroupRequest) Set(val *NestedClusterGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedClusterGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedClusterGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedClusterGroupRequest(val *NestedClusterGroupRequest) *NullableNestedClusterGroupRequest { + return &NullableNestedClusterGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedClusterGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedClusterGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_request.go new file mode 100644 index 00000000..06283754 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedClusterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedClusterRequest{} + +// NestedClusterRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedClusterRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedClusterRequest NestedClusterRequest + +// NewNestedClusterRequest instantiates a new NestedClusterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedClusterRequest(name string) *NestedClusterRequest { + this := NestedClusterRequest{} + this.Name = name + return &this +} + +// NewNestedClusterRequestWithDefaults instantiates a new NestedClusterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedClusterRequestWithDefaults() *NestedClusterRequest { + this := NestedClusterRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedClusterRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedClusterRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedClusterRequest) SetName(v string) { + o.Name = v +} + +func (o NestedClusterRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedClusterRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedClusterRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedClusterRequest := _NestedClusterRequest{} + + err = json.Unmarshal(data, &varNestedClusterRequest) + + if err != nil { + return err + } + + *o = NestedClusterRequest(varNestedClusterRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedClusterRequest struct { + value *NestedClusterRequest + isSet bool +} + +func (v NullableNestedClusterRequest) Get() *NestedClusterRequest { + return v.value +} + +func (v *NullableNestedClusterRequest) Set(val *NestedClusterRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedClusterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedClusterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedClusterRequest(val *NestedClusterRequest) *NullableNestedClusterRequest { + return &NullableNestedClusterRequest{value: val, isSet: true} +} + +func (v NullableNestedClusterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedClusterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_type.go new file mode 100644 index 00000000..843f266f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_type.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedClusterType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedClusterType{} + +// NestedClusterType Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedClusterType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedClusterType NestedClusterType + +// NewNestedClusterType instantiates a new NestedClusterType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedClusterType(id int32, url string, display string, name string, slug string) *NestedClusterType { + this := NestedClusterType{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedClusterTypeWithDefaults instantiates a new NestedClusterType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedClusterTypeWithDefaults() *NestedClusterType { + this := NestedClusterType{} + return &this +} + +// GetId returns the Id field value +func (o *NestedClusterType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedClusterType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedClusterType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedClusterType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedClusterType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedClusterType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedClusterType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedClusterType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedClusterType) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedClusterType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedClusterType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedClusterType) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedClusterType) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedClusterType) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedClusterType) SetSlug(v string) { + o.Slug = v +} + +func (o NestedClusterType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedClusterType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedClusterType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedClusterType := _NestedClusterType{} + + err = json.Unmarshal(data, &varNestedClusterType) + + if err != nil { + return err + } + + *o = NestedClusterType(varNestedClusterType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedClusterType struct { + value *NestedClusterType + isSet bool +} + +func (v NullableNestedClusterType) Get() *NestedClusterType { + return v.value +} + +func (v *NullableNestedClusterType) Set(val *NestedClusterType) { + v.value = val + v.isSet = true +} + +func (v NullableNestedClusterType) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedClusterType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedClusterType(val *NestedClusterType) *NullableNestedClusterType { + return &NullableNestedClusterType{value: val, isSet: true} +} + +func (v NullableNestedClusterType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedClusterType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_type_request.go new file mode 100644 index 00000000..8f5ebc36 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_cluster_type_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedClusterTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedClusterTypeRequest{} + +// NestedClusterTypeRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedClusterTypeRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedClusterTypeRequest NestedClusterTypeRequest + +// NewNestedClusterTypeRequest instantiates a new NestedClusterTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedClusterTypeRequest(name string, slug string) *NestedClusterTypeRequest { + this := NestedClusterTypeRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedClusterTypeRequestWithDefaults instantiates a new NestedClusterTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedClusterTypeRequestWithDefaults() *NestedClusterTypeRequest { + this := NestedClusterTypeRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedClusterTypeRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedClusterTypeRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedClusterTypeRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedClusterTypeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedClusterTypeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedClusterTypeRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedClusterTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedClusterTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedClusterTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedClusterTypeRequest := _NestedClusterTypeRequest{} + + err = json.Unmarshal(data, &varNestedClusterTypeRequest) + + if err != nil { + return err + } + + *o = NestedClusterTypeRequest(varNestedClusterTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedClusterTypeRequest struct { + value *NestedClusterTypeRequest + isSet bool +} + +func (v NullableNestedClusterTypeRequest) Get() *NestedClusterTypeRequest { + return v.value +} + +func (v *NullableNestedClusterTypeRequest) Set(val *NestedClusterTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedClusterTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedClusterTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedClusterTypeRequest(val *NestedClusterTypeRequest) *NullableNestedClusterTypeRequest { + return &NullableNestedClusterTypeRequest{value: val, isSet: true} +} + +func (v NullableNestedClusterTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedClusterTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_config_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_config_template.go new file mode 100644 index 00000000..c7df4217 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_config_template.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedConfigTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedConfigTemplate{} + +// NestedConfigTemplate Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedConfigTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedConfigTemplate NestedConfigTemplate + +// NewNestedConfigTemplate instantiates a new NestedConfigTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedConfigTemplate(id int32, url string, display string, name string) *NestedConfigTemplate { + this := NestedConfigTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedConfigTemplateWithDefaults instantiates a new NestedConfigTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedConfigTemplateWithDefaults() *NestedConfigTemplate { + this := NestedConfigTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *NestedConfigTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedConfigTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedConfigTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedConfigTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedConfigTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedConfigTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedConfigTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedConfigTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedConfigTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedConfigTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedConfigTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedConfigTemplate) SetName(v string) { + o.Name = v +} + +func (o NestedConfigTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedConfigTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedConfigTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedConfigTemplate := _NestedConfigTemplate{} + + err = json.Unmarshal(data, &varNestedConfigTemplate) + + if err != nil { + return err + } + + *o = NestedConfigTemplate(varNestedConfigTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedConfigTemplate struct { + value *NestedConfigTemplate + isSet bool +} + +func (v NullableNestedConfigTemplate) Get() *NestedConfigTemplate { + return v.value +} + +func (v *NullableNestedConfigTemplate) Set(val *NestedConfigTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableNestedConfigTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedConfigTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedConfigTemplate(val *NestedConfigTemplate) *NullableNestedConfigTemplate { + return &NullableNestedConfigTemplate{value: val, isSet: true} +} + +func (v NullableNestedConfigTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedConfigTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_config_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_config_template_request.go new file mode 100644 index 00000000..79a9c14a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_config_template_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedConfigTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedConfigTemplateRequest{} + +// NestedConfigTemplateRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedConfigTemplateRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedConfigTemplateRequest NestedConfigTemplateRequest + +// NewNestedConfigTemplateRequest instantiates a new NestedConfigTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedConfigTemplateRequest(name string) *NestedConfigTemplateRequest { + this := NestedConfigTemplateRequest{} + this.Name = name + return &this +} + +// NewNestedConfigTemplateRequestWithDefaults instantiates a new NestedConfigTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedConfigTemplateRequestWithDefaults() *NestedConfigTemplateRequest { + this := NestedConfigTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedConfigTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedConfigTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedConfigTemplateRequest) SetName(v string) { + o.Name = v +} + +func (o NestedConfigTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedConfigTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedConfigTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedConfigTemplateRequest := _NestedConfigTemplateRequest{} + + err = json.Unmarshal(data, &varNestedConfigTemplateRequest) + + if err != nil { + return err + } + + *o = NestedConfigTemplateRequest(varNestedConfigTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedConfigTemplateRequest struct { + value *NestedConfigTemplateRequest + isSet bool +} + +func (v NullableNestedConfigTemplateRequest) Get() *NestedConfigTemplateRequest { + return v.value +} + +func (v *NullableNestedConfigTemplateRequest) Set(val *NestedConfigTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedConfigTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedConfigTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedConfigTemplateRequest(val *NestedConfigTemplateRequest) *NullableNestedConfigTemplateRequest { + return &NullableNestedConfigTemplateRequest{value: val, isSet: true} +} + +func (v NullableNestedConfigTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedConfigTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact.go new file mode 100644 index 00000000..ab6fef15 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedContact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedContact{} + +// NestedContact Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedContact struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedContact NestedContact + +// NewNestedContact instantiates a new NestedContact object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedContact(id int32, url string, display string, name string) *NestedContact { + this := NestedContact{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedContactWithDefaults instantiates a new NestedContact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedContactWithDefaults() *NestedContact { + this := NestedContact{} + return &this +} + +// GetId returns the Id field value +func (o *NestedContact) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedContact) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedContact) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedContact) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedContact) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedContact) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedContact) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedContact) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedContact) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedContact) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedContact) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedContact) SetName(v string) { + o.Name = v +} + +func (o NestedContact) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedContact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedContact) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedContact := _NestedContact{} + + err = json.Unmarshal(data, &varNestedContact) + + if err != nil { + return err + } + + *o = NestedContact(varNestedContact) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedContact struct { + value *NestedContact + isSet bool +} + +func (v NullableNestedContact) Get() *NestedContact { + return v.value +} + +func (v *NullableNestedContact) Set(val *NestedContact) { + v.value = val + v.isSet = true +} + +func (v NullableNestedContact) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedContact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedContact(val *NestedContact) *NullableNestedContact { + return &NullableNestedContact{value: val, isSet: true} +} + +func (v NullableNestedContact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedContact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_group.go new file mode 100644 index 00000000..36f18d55 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_group.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedContactGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedContactGroup{} + +// NestedContactGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedContactGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _NestedContactGroup NestedContactGroup + +// NewNestedContactGroup instantiates a new NestedContactGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedContactGroup(id int32, url string, display string, name string, slug string, depth int32) *NestedContactGroup { + this := NestedContactGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Depth = depth + return &this +} + +// NewNestedContactGroupWithDefaults instantiates a new NestedContactGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedContactGroupWithDefaults() *NestedContactGroup { + this := NestedContactGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedContactGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedContactGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedContactGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedContactGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedContactGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedContactGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedContactGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedContactGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedContactGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedContactGroup) SetSlug(v string) { + o.Slug = v +} + +// GetDepth returns the Depth field value +func (o *NestedContactGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *NestedContactGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o NestedContactGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedContactGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedContactGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedContactGroup := _NestedContactGroup{} + + err = json.Unmarshal(data, &varNestedContactGroup) + + if err != nil { + return err + } + + *o = NestedContactGroup(varNestedContactGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedContactGroup struct { + value *NestedContactGroup + isSet bool +} + +func (v NullableNestedContactGroup) Get() *NestedContactGroup { + return v.value +} + +func (v *NullableNestedContactGroup) Set(val *NestedContactGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedContactGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedContactGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedContactGroup(val *NestedContactGroup) *NullableNestedContactGroup { + return &NullableNestedContactGroup{value: val, isSet: true} +} + +func (v NullableNestedContactGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedContactGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_group_request.go new file mode 100644 index 00000000..ca45f428 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedContactGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedContactGroupRequest{} + +// NestedContactGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedContactGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedContactGroupRequest NestedContactGroupRequest + +// NewNestedContactGroupRequest instantiates a new NestedContactGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedContactGroupRequest(name string, slug string) *NestedContactGroupRequest { + this := NestedContactGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedContactGroupRequestWithDefaults instantiates a new NestedContactGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedContactGroupRequestWithDefaults() *NestedContactGroupRequest { + this := NestedContactGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedContactGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedContactGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedContactGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedContactGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedContactGroupRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedContactGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedContactGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedContactGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedContactGroupRequest := _NestedContactGroupRequest{} + + err = json.Unmarshal(data, &varNestedContactGroupRequest) + + if err != nil { + return err + } + + *o = NestedContactGroupRequest(varNestedContactGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedContactGroupRequest struct { + value *NestedContactGroupRequest + isSet bool +} + +func (v NullableNestedContactGroupRequest) Get() *NestedContactGroupRequest { + return v.value +} + +func (v *NullableNestedContactGroupRequest) Set(val *NestedContactGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedContactGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedContactGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedContactGroupRequest(val *NestedContactGroupRequest) *NullableNestedContactGroupRequest { + return &NullableNestedContactGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedContactGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedContactGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_request.go new file mode 100644 index 00000000..3e8c618b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedContactRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedContactRequest{} + +// NestedContactRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedContactRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedContactRequest NestedContactRequest + +// NewNestedContactRequest instantiates a new NestedContactRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedContactRequest(name string) *NestedContactRequest { + this := NestedContactRequest{} + this.Name = name + return &this +} + +// NewNestedContactRequestWithDefaults instantiates a new NestedContactRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedContactRequestWithDefaults() *NestedContactRequest { + this := NestedContactRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedContactRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedContactRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedContactRequest) SetName(v string) { + o.Name = v +} + +func (o NestedContactRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedContactRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedContactRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedContactRequest := _NestedContactRequest{} + + err = json.Unmarshal(data, &varNestedContactRequest) + + if err != nil { + return err + } + + *o = NestedContactRequest(varNestedContactRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedContactRequest struct { + value *NestedContactRequest + isSet bool +} + +func (v NullableNestedContactRequest) Get() *NestedContactRequest { + return v.value +} + +func (v *NullableNestedContactRequest) Set(val *NestedContactRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedContactRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedContactRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedContactRequest(val *NestedContactRequest) *NullableNestedContactRequest { + return &NullableNestedContactRequest{value: val, isSet: true} +} + +func (v NullableNestedContactRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedContactRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_role.go new file mode 100644 index 00000000..e75ce745 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_role.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedContactRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedContactRole{} + +// NestedContactRole Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedContactRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedContactRole NestedContactRole + +// NewNestedContactRole instantiates a new NestedContactRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedContactRole(id int32, url string, display string, name string, slug string) *NestedContactRole { + this := NestedContactRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedContactRoleWithDefaults instantiates a new NestedContactRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedContactRoleWithDefaults() *NestedContactRole { + this := NestedContactRole{} + return &this +} + +// GetId returns the Id field value +func (o *NestedContactRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedContactRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedContactRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedContactRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedContactRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedContactRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedContactRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedContactRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedContactRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedContactRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedContactRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedContactRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedContactRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedContactRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedContactRole) SetSlug(v string) { + o.Slug = v +} + +func (o NestedContactRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedContactRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedContactRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedContactRole := _NestedContactRole{} + + err = json.Unmarshal(data, &varNestedContactRole) + + if err != nil { + return err + } + + *o = NestedContactRole(varNestedContactRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedContactRole struct { + value *NestedContactRole + isSet bool +} + +func (v NullableNestedContactRole) Get() *NestedContactRole { + return v.value +} + +func (v *NullableNestedContactRole) Set(val *NestedContactRole) { + v.value = val + v.isSet = true +} + +func (v NullableNestedContactRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedContactRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedContactRole(val *NestedContactRole) *NullableNestedContactRole { + return &NullableNestedContactRole{value: val, isSet: true} +} + +func (v NullableNestedContactRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedContactRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_role_request.go new file mode 100644 index 00000000..a76bf7a7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_contact_role_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedContactRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedContactRoleRequest{} + +// NestedContactRoleRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedContactRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedContactRoleRequest NestedContactRoleRequest + +// NewNestedContactRoleRequest instantiates a new NestedContactRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedContactRoleRequest(name string, slug string) *NestedContactRoleRequest { + this := NestedContactRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedContactRoleRequestWithDefaults instantiates a new NestedContactRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedContactRoleRequestWithDefaults() *NestedContactRoleRequest { + this := NestedContactRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedContactRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedContactRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedContactRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedContactRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedContactRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedContactRoleRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedContactRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedContactRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedContactRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedContactRoleRequest := _NestedContactRoleRequest{} + + err = json.Unmarshal(data, &varNestedContactRoleRequest) + + if err != nil { + return err + } + + *o = NestedContactRoleRequest(varNestedContactRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedContactRoleRequest struct { + value *NestedContactRoleRequest + isSet bool +} + +func (v NullableNestedContactRoleRequest) Get() *NestedContactRoleRequest { + return v.value +} + +func (v *NullableNestedContactRoleRequest) Set(val *NestedContactRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedContactRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedContactRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedContactRoleRequest(val *NestedContactRoleRequest) *NullableNestedContactRoleRequest { + return &NullableNestedContactRoleRequest{value: val, isSet: true} +} + +func (v NullableNestedContactRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedContactRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_custom_field_choice_set.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_custom_field_choice_set.go new file mode 100644 index 00000000..0065ba5b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_custom_field_choice_set.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCustomFieldChoiceSet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCustomFieldChoiceSet{} + +// NestedCustomFieldChoiceSet Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCustomFieldChoiceSet struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + ChoicesCount string `json:"choices_count"` + AdditionalProperties map[string]interface{} +} + +type _NestedCustomFieldChoiceSet NestedCustomFieldChoiceSet + +// NewNestedCustomFieldChoiceSet instantiates a new NestedCustomFieldChoiceSet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCustomFieldChoiceSet(id int32, url string, display string, name string, choicesCount string) *NestedCustomFieldChoiceSet { + this := NestedCustomFieldChoiceSet{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.ChoicesCount = choicesCount + return &this +} + +// NewNestedCustomFieldChoiceSetWithDefaults instantiates a new NestedCustomFieldChoiceSet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCustomFieldChoiceSetWithDefaults() *NestedCustomFieldChoiceSet { + this := NestedCustomFieldChoiceSet{} + return &this +} + +// GetId returns the Id field value +func (o *NestedCustomFieldChoiceSet) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedCustomFieldChoiceSet) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedCustomFieldChoiceSet) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedCustomFieldChoiceSet) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedCustomFieldChoiceSet) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedCustomFieldChoiceSet) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedCustomFieldChoiceSet) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedCustomFieldChoiceSet) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedCustomFieldChoiceSet) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedCustomFieldChoiceSet) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedCustomFieldChoiceSet) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedCustomFieldChoiceSet) SetName(v string) { + o.Name = v +} + +// GetChoicesCount returns the ChoicesCount field value +func (o *NestedCustomFieldChoiceSet) GetChoicesCount() string { + if o == nil { + var ret string + return ret + } + + return o.ChoicesCount +} + +// GetChoicesCountOk returns a tuple with the ChoicesCount field value +// and a boolean to check if the value has been set. +func (o *NestedCustomFieldChoiceSet) GetChoicesCountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChoicesCount, true +} + +// SetChoicesCount sets field value +func (o *NestedCustomFieldChoiceSet) SetChoicesCount(v string) { + o.ChoicesCount = v +} + +func (o NestedCustomFieldChoiceSet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCustomFieldChoiceSet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["choices_count"] = o.ChoicesCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCustomFieldChoiceSet) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "choices_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCustomFieldChoiceSet := _NestedCustomFieldChoiceSet{} + + err = json.Unmarshal(data, &varNestedCustomFieldChoiceSet) + + if err != nil { + return err + } + + *o = NestedCustomFieldChoiceSet(varNestedCustomFieldChoiceSet) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "choices_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCustomFieldChoiceSet struct { + value *NestedCustomFieldChoiceSet + isSet bool +} + +func (v NullableNestedCustomFieldChoiceSet) Get() *NestedCustomFieldChoiceSet { + return v.value +} + +func (v *NullableNestedCustomFieldChoiceSet) Set(val *NestedCustomFieldChoiceSet) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCustomFieldChoiceSet) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCustomFieldChoiceSet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCustomFieldChoiceSet(val *NestedCustomFieldChoiceSet) *NullableNestedCustomFieldChoiceSet { + return &NullableNestedCustomFieldChoiceSet{value: val, isSet: true} +} + +func (v NullableNestedCustomFieldChoiceSet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCustomFieldChoiceSet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_custom_field_choice_set_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_custom_field_choice_set_request.go new file mode 100644 index 00000000..26e58e18 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_custom_field_choice_set_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedCustomFieldChoiceSetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedCustomFieldChoiceSetRequest{} + +// NestedCustomFieldChoiceSetRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedCustomFieldChoiceSetRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedCustomFieldChoiceSetRequest NestedCustomFieldChoiceSetRequest + +// NewNestedCustomFieldChoiceSetRequest instantiates a new NestedCustomFieldChoiceSetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedCustomFieldChoiceSetRequest(name string) *NestedCustomFieldChoiceSetRequest { + this := NestedCustomFieldChoiceSetRequest{} + this.Name = name + return &this +} + +// NewNestedCustomFieldChoiceSetRequestWithDefaults instantiates a new NestedCustomFieldChoiceSetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedCustomFieldChoiceSetRequestWithDefaults() *NestedCustomFieldChoiceSetRequest { + this := NestedCustomFieldChoiceSetRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedCustomFieldChoiceSetRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedCustomFieldChoiceSetRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedCustomFieldChoiceSetRequest) SetName(v string) { + o.Name = v +} + +func (o NestedCustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedCustomFieldChoiceSetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedCustomFieldChoiceSetRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedCustomFieldChoiceSetRequest := _NestedCustomFieldChoiceSetRequest{} + + err = json.Unmarshal(data, &varNestedCustomFieldChoiceSetRequest) + + if err != nil { + return err + } + + *o = NestedCustomFieldChoiceSetRequest(varNestedCustomFieldChoiceSetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedCustomFieldChoiceSetRequest struct { + value *NestedCustomFieldChoiceSetRequest + isSet bool +} + +func (v NullableNestedCustomFieldChoiceSetRequest) Get() *NestedCustomFieldChoiceSetRequest { + return v.value +} + +func (v *NullableNestedCustomFieldChoiceSetRequest) Set(val *NestedCustomFieldChoiceSetRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedCustomFieldChoiceSetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedCustomFieldChoiceSetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedCustomFieldChoiceSetRequest(val *NestedCustomFieldChoiceSetRequest) *NullableNestedCustomFieldChoiceSetRequest { + return &NullableNestedCustomFieldChoiceSetRequest{value: val, isSet: true} +} + +func (v NullableNestedCustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedCustomFieldChoiceSetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_file.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_file.go new file mode 100644 index 00000000..989faa81 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_file.go @@ -0,0 +1,254 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDataFile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDataFile{} + +// NestedDataFile Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDataFile struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // File path relative to the data source's root + Path string `json:"path"` + AdditionalProperties map[string]interface{} +} + +type _NestedDataFile NestedDataFile + +// NewNestedDataFile instantiates a new NestedDataFile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDataFile(id int32, url string, display string, path string) *NestedDataFile { + this := NestedDataFile{} + this.Id = id + this.Url = url + this.Display = display + this.Path = path + return &this +} + +// NewNestedDataFileWithDefaults instantiates a new NestedDataFile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDataFileWithDefaults() *NestedDataFile { + this := NestedDataFile{} + return &this +} + +// GetId returns the Id field value +func (o *NestedDataFile) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedDataFile) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedDataFile) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedDataFile) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedDataFile) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedDataFile) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedDataFile) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedDataFile) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedDataFile) SetDisplay(v string) { + o.Display = v +} + +// GetPath returns the Path field value +func (o *NestedDataFile) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *NestedDataFile) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *NestedDataFile) SetPath(v string) { + o.Path = v +} + +func (o NestedDataFile) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDataFile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["path"] = o.Path + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDataFile) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "path", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDataFile := _NestedDataFile{} + + err = json.Unmarshal(data, &varNestedDataFile) + + if err != nil { + return err + } + + *o = NestedDataFile(varNestedDataFile) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "path") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDataFile struct { + value *NestedDataFile + isSet bool +} + +func (v NullableNestedDataFile) Get() *NestedDataFile { + return v.value +} + +func (v *NullableNestedDataFile) Set(val *NestedDataFile) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDataFile) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDataFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDataFile(val *NestedDataFile) *NullableNestedDataFile { + return &NullableNestedDataFile{value: val, isSet: true} +} + +func (v NullableNestedDataFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDataFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_source.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_source.go new file mode 100644 index 00000000..1f109c0c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_source.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDataSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDataSource{} + +// NestedDataSource Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDataSource struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedDataSource NestedDataSource + +// NewNestedDataSource instantiates a new NestedDataSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDataSource(id int32, url string, display string, name string) *NestedDataSource { + this := NestedDataSource{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedDataSourceWithDefaults instantiates a new NestedDataSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDataSourceWithDefaults() *NestedDataSource { + this := NestedDataSource{} + return &this +} + +// GetId returns the Id field value +func (o *NestedDataSource) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedDataSource) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedDataSource) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedDataSource) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedDataSource) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedDataSource) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedDataSource) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedDataSource) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedDataSource) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedDataSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedDataSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedDataSource) SetName(v string) { + o.Name = v +} + +func (o NestedDataSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDataSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDataSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDataSource := _NestedDataSource{} + + err = json.Unmarshal(data, &varNestedDataSource) + + if err != nil { + return err + } + + *o = NestedDataSource(varNestedDataSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDataSource struct { + value *NestedDataSource + isSet bool +} + +func (v NullableNestedDataSource) Get() *NestedDataSource { + return v.value +} + +func (v *NullableNestedDataSource) Set(val *NestedDataSource) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDataSource) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDataSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDataSource(val *NestedDataSource) *NullableNestedDataSource { + return &NullableNestedDataSource{value: val, isSet: true} +} + +func (v NullableNestedDataSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDataSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_source_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_source_request.go new file mode 100644 index 00000000..8496fc3b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_data_source_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDataSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDataSourceRequest{} + +// NestedDataSourceRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDataSourceRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedDataSourceRequest NestedDataSourceRequest + +// NewNestedDataSourceRequest instantiates a new NestedDataSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDataSourceRequest(name string) *NestedDataSourceRequest { + this := NestedDataSourceRequest{} + this.Name = name + return &this +} + +// NewNestedDataSourceRequestWithDefaults instantiates a new NestedDataSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDataSourceRequestWithDefaults() *NestedDataSourceRequest { + this := NestedDataSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedDataSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedDataSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedDataSourceRequest) SetName(v string) { + o.Name = v +} + +func (o NestedDataSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDataSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDataSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDataSourceRequest := _NestedDataSourceRequest{} + + err = json.Unmarshal(data, &varNestedDataSourceRequest) + + if err != nil { + return err + } + + *o = NestedDataSourceRequest(varNestedDataSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDataSourceRequest struct { + value *NestedDataSourceRequest + isSet bool +} + +func (v NullableNestedDataSourceRequest) Get() *NestedDataSourceRequest { + return v.value +} + +func (v *NullableNestedDataSourceRequest) Set(val *NestedDataSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDataSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDataSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDataSourceRequest(val *NestedDataSourceRequest) *NullableNestedDataSourceRequest { + return &NullableNestedDataSourceRequest{value: val, isSet: true} +} + +func (v NullableNestedDataSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDataSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device.go new file mode 100644 index 00000000..c32b79f8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device.go @@ -0,0 +1,272 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDevice{} + +// NestedDevice Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDevice struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name NullableString `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedDevice NestedDevice + +// NewNestedDevice instantiates a new NestedDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDevice(id int32, url string, display string) *NestedDevice { + this := NestedDevice{} + this.Id = id + this.Url = url + this.Display = display + return &this +} + +// NewNestedDeviceWithDefaults instantiates a new NestedDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDeviceWithDefaults() *NestedDevice { + this := NestedDevice{} + return &this +} + +// GetId returns the Id field value +func (o *NestedDevice) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedDevice) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedDevice) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedDevice) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedDevice) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedDevice) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedDevice) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedDevice) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedDevice) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedDevice) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *NestedDevice) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *NestedDevice) SetName(v string) { + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *NestedDevice) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *NestedDevice) UnsetName() { + o.Name.Unset() +} + +func (o NestedDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDevice := _NestedDevice{} + + err = json.Unmarshal(data, &varNestedDevice) + + if err != nil { + return err + } + + *o = NestedDevice(varNestedDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDevice struct { + value *NestedDevice + isSet bool +} + +func (v NullableNestedDevice) Get() *NestedDevice { + return v.value +} + +func (v *NullableNestedDevice) Set(val *NestedDevice) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDevice(val *NestedDevice) *NullableNestedDevice { + return &NullableNestedDevice{value: val, isSet: true} +} + +func (v NullableNestedDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_request.go new file mode 100644 index 00000000..9e4a38a5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_request.go @@ -0,0 +1,164 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the NestedDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDeviceRequest{} + +// NestedDeviceRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDeviceRequest struct { + Name NullableString `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedDeviceRequest NestedDeviceRequest + +// NewNestedDeviceRequest instantiates a new NestedDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDeviceRequest() *NestedDeviceRequest { + this := NestedDeviceRequest{} + return &this +} + +// NewNestedDeviceRequestWithDefaults instantiates a new NestedDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDeviceRequestWithDefaults() *NestedDeviceRequest { + this := NestedDeviceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *NestedDeviceRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *NestedDeviceRequest) SetName(v string) { + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *NestedDeviceRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *NestedDeviceRequest) UnsetName() { + o.Name.Unset() +} + +func (o NestedDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varNestedDeviceRequest := _NestedDeviceRequest{} + + err = json.Unmarshal(data, &varNestedDeviceRequest) + + if err != nil { + return err + } + + *o = NestedDeviceRequest(varNestedDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDeviceRequest struct { + value *NestedDeviceRequest + isSet bool +} + +func (v NullableNestedDeviceRequest) Get() *NestedDeviceRequest { + return v.value +} + +func (v *NullableNestedDeviceRequest) Set(val *NestedDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDeviceRequest(val *NestedDeviceRequest) *NullableNestedDeviceRequest { + return &NullableNestedDeviceRequest{value: val, isSet: true} +} + +func (v NullableNestedDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_role.go new file mode 100644 index 00000000..6d97253f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_role.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDeviceRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDeviceRole{} + +// NestedDeviceRole Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDeviceRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedDeviceRole NestedDeviceRole + +// NewNestedDeviceRole instantiates a new NestedDeviceRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDeviceRole(id int32, url string, display string, name string, slug string) *NestedDeviceRole { + this := NestedDeviceRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedDeviceRoleWithDefaults instantiates a new NestedDeviceRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDeviceRoleWithDefaults() *NestedDeviceRole { + this := NestedDeviceRole{} + return &this +} + +// GetId returns the Id field value +func (o *NestedDeviceRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedDeviceRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedDeviceRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedDeviceRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedDeviceRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedDeviceRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedDeviceRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedDeviceRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedDeviceRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedDeviceRole) SetSlug(v string) { + o.Slug = v +} + +func (o NestedDeviceRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDeviceRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDeviceRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDeviceRole := _NestedDeviceRole{} + + err = json.Unmarshal(data, &varNestedDeviceRole) + + if err != nil { + return err + } + + *o = NestedDeviceRole(varNestedDeviceRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDeviceRole struct { + value *NestedDeviceRole + isSet bool +} + +func (v NullableNestedDeviceRole) Get() *NestedDeviceRole { + return v.value +} + +func (v *NullableNestedDeviceRole) Set(val *NestedDeviceRole) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDeviceRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDeviceRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDeviceRole(val *NestedDeviceRole) *NullableNestedDeviceRole { + return &NullableNestedDeviceRole{value: val, isSet: true} +} + +func (v NullableNestedDeviceRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDeviceRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_role_request.go new file mode 100644 index 00000000..1601bb05 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_role_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDeviceRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDeviceRoleRequest{} + +// NestedDeviceRoleRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDeviceRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedDeviceRoleRequest NestedDeviceRoleRequest + +// NewNestedDeviceRoleRequest instantiates a new NestedDeviceRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDeviceRoleRequest(name string, slug string) *NestedDeviceRoleRequest { + this := NestedDeviceRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedDeviceRoleRequestWithDefaults instantiates a new NestedDeviceRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDeviceRoleRequestWithDefaults() *NestedDeviceRoleRequest { + this := NestedDeviceRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedDeviceRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedDeviceRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedDeviceRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedDeviceRoleRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedDeviceRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDeviceRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDeviceRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDeviceRoleRequest := _NestedDeviceRoleRequest{} + + err = json.Unmarshal(data, &varNestedDeviceRoleRequest) + + if err != nil { + return err + } + + *o = NestedDeviceRoleRequest(varNestedDeviceRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDeviceRoleRequest struct { + value *NestedDeviceRoleRequest + isSet bool +} + +func (v NullableNestedDeviceRoleRequest) Get() *NestedDeviceRoleRequest { + return v.value +} + +func (v *NullableNestedDeviceRoleRequest) Set(val *NestedDeviceRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDeviceRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDeviceRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDeviceRoleRequest(val *NestedDeviceRoleRequest) *NullableNestedDeviceRoleRequest { + return &NullableNestedDeviceRoleRequest{value: val, isSet: true} +} + +func (v NullableNestedDeviceRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDeviceRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_type.go new file mode 100644 index 00000000..713bb840 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_type.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDeviceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDeviceType{} + +// NestedDeviceType Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDeviceType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Manufacturer NestedManufacturer `json:"manufacturer"` + Model string `json:"model"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedDeviceType NestedDeviceType + +// NewNestedDeviceType instantiates a new NestedDeviceType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDeviceType(id int32, url string, display string, manufacturer NestedManufacturer, model string, slug string) *NestedDeviceType { + this := NestedDeviceType{} + this.Id = id + this.Url = url + this.Display = display + this.Manufacturer = manufacturer + this.Model = model + this.Slug = slug + return &this +} + +// NewNestedDeviceTypeWithDefaults instantiates a new NestedDeviceType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDeviceTypeWithDefaults() *NestedDeviceType { + this := NestedDeviceType{} + return &this +} + +// GetId returns the Id field value +func (o *NestedDeviceType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedDeviceType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedDeviceType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedDeviceType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedDeviceType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedDeviceType) SetDisplay(v string) { + o.Display = v +} + +// GetManufacturer returns the Manufacturer field value +func (o *NestedDeviceType) GetManufacturer() NestedManufacturer { + if o == nil { + var ret NestedManufacturer + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceType) GetManufacturerOk() (*NestedManufacturer, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *NestedDeviceType) SetManufacturer(v NestedManufacturer) { + o.Manufacturer = v +} + +// GetModel returns the Model field value +func (o *NestedDeviceType) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceType) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *NestedDeviceType) SetModel(v string) { + o.Model = v +} + +// GetSlug returns the Slug field value +func (o *NestedDeviceType) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceType) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedDeviceType) SetSlug(v string) { + o.Slug = v +} + +func (o NestedDeviceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDeviceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["manufacturer"] = o.Manufacturer + toSerialize["model"] = o.Model + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDeviceType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "manufacturer", + "model", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDeviceType := _NestedDeviceType{} + + err = json.Unmarshal(data, &varNestedDeviceType) + + if err != nil { + return err + } + + *o = NestedDeviceType(varNestedDeviceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "model") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDeviceType struct { + value *NestedDeviceType + isSet bool +} + +func (v NullableNestedDeviceType) Get() *NestedDeviceType { + return v.value +} + +func (v *NullableNestedDeviceType) Set(val *NestedDeviceType) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDeviceType) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDeviceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDeviceType(val *NestedDeviceType) *NullableNestedDeviceType { + return &NullableNestedDeviceType{value: val, isSet: true} +} + +func (v NullableNestedDeviceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDeviceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_type_request.go new file mode 100644 index 00000000..f6b095de --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_device_type_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedDeviceTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedDeviceTypeRequest{} + +// NestedDeviceTypeRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedDeviceTypeRequest struct { + Model string `json:"model"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedDeviceTypeRequest NestedDeviceTypeRequest + +// NewNestedDeviceTypeRequest instantiates a new NestedDeviceTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedDeviceTypeRequest(model string, slug string) *NestedDeviceTypeRequest { + this := NestedDeviceTypeRequest{} + this.Model = model + this.Slug = slug + return &this +} + +// NewNestedDeviceTypeRequestWithDefaults instantiates a new NestedDeviceTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedDeviceTypeRequestWithDefaults() *NestedDeviceTypeRequest { + this := NestedDeviceTypeRequest{} + return &this +} + +// GetModel returns the Model field value +func (o *NestedDeviceTypeRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceTypeRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *NestedDeviceTypeRequest) SetModel(v string) { + o.Model = v +} + +// GetSlug returns the Slug field value +func (o *NestedDeviceTypeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedDeviceTypeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedDeviceTypeRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedDeviceTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedDeviceTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["model"] = o.Model + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedDeviceTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "model", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedDeviceTypeRequest := _NestedDeviceTypeRequest{} + + err = json.Unmarshal(data, &varNestedDeviceTypeRequest) + + if err != nil { + return err + } + + *o = NestedDeviceTypeRequest(varNestedDeviceTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "model") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedDeviceTypeRequest struct { + value *NestedDeviceTypeRequest + isSet bool +} + +func (v NullableNestedDeviceTypeRequest) Get() *NestedDeviceTypeRequest { + return v.value +} + +func (v *NullableNestedDeviceTypeRequest) Set(val *NestedDeviceTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedDeviceTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedDeviceTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedDeviceTypeRequest(val *NestedDeviceTypeRequest) *NullableNestedDeviceTypeRequest { + return &NullableNestedDeviceTypeRequest{value: val, isSet: true} +} + +func (v NullableNestedDeviceTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedDeviceTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_fhrp_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_fhrp_group.go new file mode 100644 index 00000000..87f8fc78 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_fhrp_group.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedFHRPGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedFHRPGroup{} + +// NestedFHRPGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedFHRPGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Protocol FHRPGroupProtocol `json:"protocol"` + GroupId int32 `json:"group_id"` + AdditionalProperties map[string]interface{} +} + +type _NestedFHRPGroup NestedFHRPGroup + +// NewNestedFHRPGroup instantiates a new NestedFHRPGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedFHRPGroup(id int32, url string, display string, protocol FHRPGroupProtocol, groupId int32) *NestedFHRPGroup { + this := NestedFHRPGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Protocol = protocol + this.GroupId = groupId + return &this +} + +// NewNestedFHRPGroupWithDefaults instantiates a new NestedFHRPGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedFHRPGroupWithDefaults() *NestedFHRPGroup { + this := NestedFHRPGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedFHRPGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedFHRPGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedFHRPGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedFHRPGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedFHRPGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedFHRPGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedFHRPGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedFHRPGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedFHRPGroup) SetDisplay(v string) { + o.Display = v +} + +// GetProtocol returns the Protocol field value +func (o *NestedFHRPGroup) GetProtocol() FHRPGroupProtocol { + if o == nil { + var ret FHRPGroupProtocol + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *NestedFHRPGroup) GetProtocolOk() (*FHRPGroupProtocol, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *NestedFHRPGroup) SetProtocol(v FHRPGroupProtocol) { + o.Protocol = v +} + +// GetGroupId returns the GroupId field value +func (o *NestedFHRPGroup) GetGroupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *NestedFHRPGroup) GetGroupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *NestedFHRPGroup) SetGroupId(v int32) { + o.GroupId = v +} + +func (o NestedFHRPGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedFHRPGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["protocol"] = o.Protocol + toSerialize["group_id"] = o.GroupId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedFHRPGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "protocol", + "group_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedFHRPGroup := _NestedFHRPGroup{} + + err = json.Unmarshal(data, &varNestedFHRPGroup) + + if err != nil { + return err + } + + *o = NestedFHRPGroup(varNestedFHRPGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "protocol") + delete(additionalProperties, "group_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedFHRPGroup struct { + value *NestedFHRPGroup + isSet bool +} + +func (v NullableNestedFHRPGroup) Get() *NestedFHRPGroup { + return v.value +} + +func (v *NullableNestedFHRPGroup) Set(val *NestedFHRPGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedFHRPGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedFHRPGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedFHRPGroup(val *NestedFHRPGroup) *NullableNestedFHRPGroup { + return &NullableNestedFHRPGroup{value: val, isSet: true} +} + +func (v NullableNestedFHRPGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedFHRPGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_fhrp_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_fhrp_group_request.go new file mode 100644 index 00000000..ec439d98 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_fhrp_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedFHRPGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedFHRPGroupRequest{} + +// NestedFHRPGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedFHRPGroupRequest struct { + Protocol FHRPGroupProtocol `json:"protocol"` + GroupId int32 `json:"group_id"` + AdditionalProperties map[string]interface{} +} + +type _NestedFHRPGroupRequest NestedFHRPGroupRequest + +// NewNestedFHRPGroupRequest instantiates a new NestedFHRPGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedFHRPGroupRequest(protocol FHRPGroupProtocol, groupId int32) *NestedFHRPGroupRequest { + this := NestedFHRPGroupRequest{} + this.Protocol = protocol + this.GroupId = groupId + return &this +} + +// NewNestedFHRPGroupRequestWithDefaults instantiates a new NestedFHRPGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedFHRPGroupRequestWithDefaults() *NestedFHRPGroupRequest { + this := NestedFHRPGroupRequest{} + return &this +} + +// GetProtocol returns the Protocol field value +func (o *NestedFHRPGroupRequest) GetProtocol() FHRPGroupProtocol { + if o == nil { + var ret FHRPGroupProtocol + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *NestedFHRPGroupRequest) GetProtocolOk() (*FHRPGroupProtocol, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *NestedFHRPGroupRequest) SetProtocol(v FHRPGroupProtocol) { + o.Protocol = v +} + +// GetGroupId returns the GroupId field value +func (o *NestedFHRPGroupRequest) GetGroupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *NestedFHRPGroupRequest) GetGroupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *NestedFHRPGroupRequest) SetGroupId(v int32) { + o.GroupId = v +} + +func (o NestedFHRPGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedFHRPGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["protocol"] = o.Protocol + toSerialize["group_id"] = o.GroupId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedFHRPGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "protocol", + "group_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedFHRPGroupRequest := _NestedFHRPGroupRequest{} + + err = json.Unmarshal(data, &varNestedFHRPGroupRequest) + + if err != nil { + return err + } + + *o = NestedFHRPGroupRequest(varNestedFHRPGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "protocol") + delete(additionalProperties, "group_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedFHRPGroupRequest struct { + value *NestedFHRPGroupRequest + isSet bool +} + +func (v NullableNestedFHRPGroupRequest) Get() *NestedFHRPGroupRequest { + return v.value +} + +func (v *NullableNestedFHRPGroupRequest) Set(val *NestedFHRPGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedFHRPGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedFHRPGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedFHRPGroupRequest(val *NestedFHRPGroupRequest) *NullableNestedFHRPGroupRequest { + return &NullableNestedFHRPGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedFHRPGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedFHRPGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ike_policy.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ike_policy.go new file mode 100644 index 00000000..c3e43438 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ike_policy.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIKEPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIKEPolicy{} + +// NestedIKEPolicy Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIKEPolicy struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedIKEPolicy NestedIKEPolicy + +// NewNestedIKEPolicy instantiates a new NestedIKEPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIKEPolicy(id int32, url string, display string, name string) *NestedIKEPolicy { + this := NestedIKEPolicy{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedIKEPolicyWithDefaults instantiates a new NestedIKEPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIKEPolicyWithDefaults() *NestedIKEPolicy { + this := NestedIKEPolicy{} + return &this +} + +// GetId returns the Id field value +func (o *NestedIKEPolicy) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedIKEPolicy) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedIKEPolicy) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedIKEPolicy) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedIKEPolicy) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedIKEPolicy) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedIKEPolicy) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedIKEPolicy) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedIKEPolicy) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedIKEPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedIKEPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedIKEPolicy) SetName(v string) { + o.Name = v +} + +func (o NestedIKEPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIKEPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIKEPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIKEPolicy := _NestedIKEPolicy{} + + err = json.Unmarshal(data, &varNestedIKEPolicy) + + if err != nil { + return err + } + + *o = NestedIKEPolicy(varNestedIKEPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIKEPolicy struct { + value *NestedIKEPolicy + isSet bool +} + +func (v NullableNestedIKEPolicy) Get() *NestedIKEPolicy { + return v.value +} + +func (v *NullableNestedIKEPolicy) Set(val *NestedIKEPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIKEPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIKEPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIKEPolicy(val *NestedIKEPolicy) *NullableNestedIKEPolicy { + return &NullableNestedIKEPolicy{value: val, isSet: true} +} + +func (v NullableNestedIKEPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIKEPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ike_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ike_policy_request.go new file mode 100644 index 00000000..52c3e7e1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ike_policy_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIKEPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIKEPolicyRequest{} + +// NestedIKEPolicyRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIKEPolicyRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedIKEPolicyRequest NestedIKEPolicyRequest + +// NewNestedIKEPolicyRequest instantiates a new NestedIKEPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIKEPolicyRequest(name string) *NestedIKEPolicyRequest { + this := NestedIKEPolicyRequest{} + this.Name = name + return &this +} + +// NewNestedIKEPolicyRequestWithDefaults instantiates a new NestedIKEPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIKEPolicyRequestWithDefaults() *NestedIKEPolicyRequest { + this := NestedIKEPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedIKEPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedIKEPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedIKEPolicyRequest) SetName(v string) { + o.Name = v +} + +func (o NestedIKEPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIKEPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIKEPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIKEPolicyRequest := _NestedIKEPolicyRequest{} + + err = json.Unmarshal(data, &varNestedIKEPolicyRequest) + + if err != nil { + return err + } + + *o = NestedIKEPolicyRequest(varNestedIKEPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIKEPolicyRequest struct { + value *NestedIKEPolicyRequest + isSet bool +} + +func (v NullableNestedIKEPolicyRequest) Get() *NestedIKEPolicyRequest { + return v.value +} + +func (v *NullableNestedIKEPolicyRequest) Set(val *NestedIKEPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIKEPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIKEPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIKEPolicyRequest(val *NestedIKEPolicyRequest) *NullableNestedIKEPolicyRequest { + return &NullableNestedIKEPolicyRequest{value: val, isSet: true} +} + +func (v NullableNestedIKEPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIKEPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface.go new file mode 100644 index 00000000..1f46e0cd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface.go @@ -0,0 +1,359 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedInterface type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedInterface{} + +// NestedInterface Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedInterface struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Name string `json:"name"` + Cable NullableInt32 `json:"cable,omitempty"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _NestedInterface NestedInterface + +// NewNestedInterface instantiates a new NestedInterface object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedInterface(id int32, url string, display string, device NestedDevice, name string, occupied bool) *NestedInterface { + this := NestedInterface{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Occupied = occupied + return &this +} + +// NewNestedInterfaceWithDefaults instantiates a new NestedInterface object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedInterfaceWithDefaults() *NestedInterface { + this := NestedInterface{} + return &this +} + +// GetId returns the Id field value +func (o *NestedInterface) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedInterface) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedInterface) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedInterface) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedInterface) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedInterface) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedInterface) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedInterface) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedInterface) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *NestedInterface) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *NestedInterface) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *NestedInterface) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetName returns the Name field value +func (o *NestedInterface) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedInterface) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedInterface) SetName(v string) { + o.Name = v +} + +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedInterface) GetCable() int32 { + if o == nil || IsNil(o.Cable.Get()) { + var ret int32 + return ret + } + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedInterface) GetCableOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// HasCable returns a boolean if a field has been set. +func (o *NestedInterface) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableInt32 and assigns it to the Cable field. +func (o *NestedInterface) SetCable(v int32) { + o.Cable.Set(&v) +} + +// SetCableNil sets the value for Cable to be an explicit nil +func (o *NestedInterface) SetCableNil() { + o.Cable.Set(nil) +} + +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *NestedInterface) UnsetCable() { + o.Cable.Unset() +} + +// GetOccupied returns the Occupied field value +func (o *NestedInterface) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *NestedInterface) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *NestedInterface) SetOccupied(v bool) { + o.Occupied = v +} + +func (o NestedInterface) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedInterface) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedInterface) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedInterface := _NestedInterface{} + + err = json.Unmarshal(data, &varNestedInterface) + + if err != nil { + return err + } + + *o = NestedInterface(varNestedInterface) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "cable") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedInterface struct { + value *NestedInterface + isSet bool +} + +func (v NullableNestedInterface) Get() *NestedInterface { + return v.value +} + +func (v *NullableNestedInterface) Set(val *NestedInterface) { + v.value = val + v.isSet = true +} + +func (v NullableNestedInterface) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedInterface) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedInterface(val *NestedInterface) *NullableNestedInterface { + return &NullableNestedInterface{value: val, isSet: true} +} + +func (v NullableNestedInterface) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedInterface) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_request.go new file mode 100644 index 00000000..7475d7ea --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_request.go @@ -0,0 +1,214 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedInterfaceRequest{} + +// NestedInterfaceRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedInterfaceRequest struct { + Name string `json:"name"` + Cable NullableInt32 `json:"cable,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedInterfaceRequest NestedInterfaceRequest + +// NewNestedInterfaceRequest instantiates a new NestedInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedInterfaceRequest(name string) *NestedInterfaceRequest { + this := NestedInterfaceRequest{} + this.Name = name + return &this +} + +// NewNestedInterfaceRequestWithDefaults instantiates a new NestedInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedInterfaceRequestWithDefaults() *NestedInterfaceRequest { + this := NestedInterfaceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedInterfaceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedInterfaceRequest) SetName(v string) { + o.Name = v +} + +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedInterfaceRequest) GetCable() int32 { + if o == nil || IsNil(o.Cable.Get()) { + var ret int32 + return ret + } + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedInterfaceRequest) GetCableOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// HasCable returns a boolean if a field has been set. +func (o *NestedInterfaceRequest) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableInt32 and assigns it to the Cable field. +func (o *NestedInterfaceRequest) SetCable(v int32) { + o.Cable.Set(&v) +} + +// SetCableNil sets the value for Cable to be an explicit nil +func (o *NestedInterfaceRequest) SetCableNil() { + o.Cable.Set(nil) +} + +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *NestedInterfaceRequest) UnsetCable() { + o.Cable.Unset() +} + +func (o NestedInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedInterfaceRequest := _NestedInterfaceRequest{} + + err = json.Unmarshal(data, &varNestedInterfaceRequest) + + if err != nil { + return err + } + + *o = NestedInterfaceRequest(varNestedInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "cable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedInterfaceRequest struct { + value *NestedInterfaceRequest + isSet bool +} + +func (v NullableNestedInterfaceRequest) Get() *NestedInterfaceRequest { + return v.value +} + +func (v *NullableNestedInterfaceRequest) Set(val *NestedInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedInterfaceRequest(val *NestedInterfaceRequest) *NullableNestedInterfaceRequest { + return &NullableNestedInterfaceRequest{value: val, isSet: true} +} + +func (v NullableNestedInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_template.go new file mode 100644 index 00000000..3342c8ff --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_template.go @@ -0,0 +1,254 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedInterfaceTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedInterfaceTemplate{} + +// NestedInterfaceTemplate Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedInterfaceTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedInterfaceTemplate NestedInterfaceTemplate + +// NewNestedInterfaceTemplate instantiates a new NestedInterfaceTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedInterfaceTemplate(id int32, url string, display string, name string) *NestedInterfaceTemplate { + this := NestedInterfaceTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedInterfaceTemplateWithDefaults instantiates a new NestedInterfaceTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedInterfaceTemplateWithDefaults() *NestedInterfaceTemplate { + this := NestedInterfaceTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *NestedInterfaceTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedInterfaceTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedInterfaceTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedInterfaceTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedInterfaceTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedInterfaceTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedInterfaceTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedInterfaceTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedInterfaceTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedInterfaceTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedInterfaceTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedInterfaceTemplate) SetName(v string) { + o.Name = v +} + +func (o NestedInterfaceTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedInterfaceTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedInterfaceTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedInterfaceTemplate := _NestedInterfaceTemplate{} + + err = json.Unmarshal(data, &varNestedInterfaceTemplate) + + if err != nil { + return err + } + + *o = NestedInterfaceTemplate(varNestedInterfaceTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedInterfaceTemplate struct { + value *NestedInterfaceTemplate + isSet bool +} + +func (v NullableNestedInterfaceTemplate) Get() *NestedInterfaceTemplate { + return v.value +} + +func (v *NullableNestedInterfaceTemplate) Set(val *NestedInterfaceTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableNestedInterfaceTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedInterfaceTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedInterfaceTemplate(val *NestedInterfaceTemplate) *NullableNestedInterfaceTemplate { + return &NullableNestedInterfaceTemplate{value: val, isSet: true} +} + +func (v NullableNestedInterfaceTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedInterfaceTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_template_request.go new file mode 100644 index 00000000..1e1cd69e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_interface_template_request.go @@ -0,0 +1,167 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedInterfaceTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedInterfaceTemplateRequest{} + +// NestedInterfaceTemplateRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedInterfaceTemplateRequest struct { + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedInterfaceTemplateRequest NestedInterfaceTemplateRequest + +// NewNestedInterfaceTemplateRequest instantiates a new NestedInterfaceTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedInterfaceTemplateRequest(name string) *NestedInterfaceTemplateRequest { + this := NestedInterfaceTemplateRequest{} + this.Name = name + return &this +} + +// NewNestedInterfaceTemplateRequestWithDefaults instantiates a new NestedInterfaceTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedInterfaceTemplateRequestWithDefaults() *NestedInterfaceTemplateRequest { + this := NestedInterfaceTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedInterfaceTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedInterfaceTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedInterfaceTemplateRequest) SetName(v string) { + o.Name = v +} + +func (o NestedInterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedInterfaceTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedInterfaceTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedInterfaceTemplateRequest := _NestedInterfaceTemplateRequest{} + + err = json.Unmarshal(data, &varNestedInterfaceTemplateRequest) + + if err != nil { + return err + } + + *o = NestedInterfaceTemplateRequest(varNestedInterfaceTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedInterfaceTemplateRequest struct { + value *NestedInterfaceTemplateRequest + isSet bool +} + +func (v NullableNestedInterfaceTemplateRequest) Get() *NestedInterfaceTemplateRequest { + return v.value +} + +func (v *NullableNestedInterfaceTemplateRequest) Set(val *NestedInterfaceTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedInterfaceTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedInterfaceTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedInterfaceTemplateRequest(val *NestedInterfaceTemplateRequest) *NullableNestedInterfaceTemplateRequest { + return &NullableNestedInterfaceTemplateRequest{value: val, isSet: true} +} + +func (v NullableNestedInterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedInterfaceTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_inventory_item_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_inventory_item_role.go new file mode 100644 index 00000000..6858fbef --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_inventory_item_role.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedInventoryItemRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedInventoryItemRole{} + +// NestedInventoryItemRole Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedInventoryItemRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedInventoryItemRole NestedInventoryItemRole + +// NewNestedInventoryItemRole instantiates a new NestedInventoryItemRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedInventoryItemRole(id int32, url string, display string, name string, slug string) *NestedInventoryItemRole { + this := NestedInventoryItemRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedInventoryItemRoleWithDefaults instantiates a new NestedInventoryItemRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedInventoryItemRoleWithDefaults() *NestedInventoryItemRole { + this := NestedInventoryItemRole{} + return &this +} + +// GetId returns the Id field value +func (o *NestedInventoryItemRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedInventoryItemRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedInventoryItemRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedInventoryItemRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedInventoryItemRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedInventoryItemRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedInventoryItemRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedInventoryItemRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedInventoryItemRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedInventoryItemRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedInventoryItemRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedInventoryItemRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedInventoryItemRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedInventoryItemRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedInventoryItemRole) SetSlug(v string) { + o.Slug = v +} + +func (o NestedInventoryItemRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedInventoryItemRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedInventoryItemRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedInventoryItemRole := _NestedInventoryItemRole{} + + err = json.Unmarshal(data, &varNestedInventoryItemRole) + + if err != nil { + return err + } + + *o = NestedInventoryItemRole(varNestedInventoryItemRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedInventoryItemRole struct { + value *NestedInventoryItemRole + isSet bool +} + +func (v NullableNestedInventoryItemRole) Get() *NestedInventoryItemRole { + return v.value +} + +func (v *NullableNestedInventoryItemRole) Set(val *NestedInventoryItemRole) { + v.value = val + v.isSet = true +} + +func (v NullableNestedInventoryItemRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedInventoryItemRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedInventoryItemRole(val *NestedInventoryItemRole) *NullableNestedInventoryItemRole { + return &NullableNestedInventoryItemRole{value: val, isSet: true} +} + +func (v NullableNestedInventoryItemRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedInventoryItemRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_inventory_item_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_inventory_item_role_request.go new file mode 100644 index 00000000..d900580c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_inventory_item_role_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedInventoryItemRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedInventoryItemRoleRequest{} + +// NestedInventoryItemRoleRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedInventoryItemRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedInventoryItemRoleRequest NestedInventoryItemRoleRequest + +// NewNestedInventoryItemRoleRequest instantiates a new NestedInventoryItemRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedInventoryItemRoleRequest(name string, slug string) *NestedInventoryItemRoleRequest { + this := NestedInventoryItemRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedInventoryItemRoleRequestWithDefaults instantiates a new NestedInventoryItemRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedInventoryItemRoleRequestWithDefaults() *NestedInventoryItemRoleRequest { + this := NestedInventoryItemRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedInventoryItemRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedInventoryItemRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedInventoryItemRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedInventoryItemRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedInventoryItemRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedInventoryItemRoleRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedInventoryItemRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedInventoryItemRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedInventoryItemRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedInventoryItemRoleRequest := _NestedInventoryItemRoleRequest{} + + err = json.Unmarshal(data, &varNestedInventoryItemRoleRequest) + + if err != nil { + return err + } + + *o = NestedInventoryItemRoleRequest(varNestedInventoryItemRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedInventoryItemRoleRequest struct { + value *NestedInventoryItemRoleRequest + isSet bool +} + +func (v NullableNestedInventoryItemRoleRequest) Get() *NestedInventoryItemRoleRequest { + return v.value +} + +func (v *NullableNestedInventoryItemRoleRequest) Set(val *NestedInventoryItemRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedInventoryItemRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedInventoryItemRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedInventoryItemRoleRequest(val *NestedInventoryItemRoleRequest) *NullableNestedInventoryItemRoleRequest { + return &NullableNestedInventoryItemRoleRequest{value: val, isSet: true} +} + +func (v NullableNestedInventoryItemRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedInventoryItemRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_address.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_address.go new file mode 100644 index 00000000..f12acc96 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_address.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIPAddress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIPAddress{} + +// NestedIPAddress Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIPAddress struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Family int32 `json:"family"` + Address string `json:"address"` + AdditionalProperties map[string]interface{} +} + +type _NestedIPAddress NestedIPAddress + +// NewNestedIPAddress instantiates a new NestedIPAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIPAddress(id int32, url string, display string, family int32, address string) *NestedIPAddress { + this := NestedIPAddress{} + this.Id = id + this.Url = url + this.Display = display + this.Family = family + this.Address = address + return &this +} + +// NewNestedIPAddressWithDefaults instantiates a new NestedIPAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIPAddressWithDefaults() *NestedIPAddress { + this := NestedIPAddress{} + return &this +} + +// GetId returns the Id field value +func (o *NestedIPAddress) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedIPAddress) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedIPAddress) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedIPAddress) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedIPAddress) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedIPAddress) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedIPAddress) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedIPAddress) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedIPAddress) SetDisplay(v string) { + o.Display = v +} + +// GetFamily returns the Family field value +func (o *NestedIPAddress) GetFamily() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *NestedIPAddress) GetFamilyOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *NestedIPAddress) SetFamily(v int32) { + o.Family = v +} + +// GetAddress returns the Address field value +func (o *NestedIPAddress) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *NestedIPAddress) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *NestedIPAddress) SetAddress(v string) { + o.Address = v +} + +func (o NestedIPAddress) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIPAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["family"] = o.Family + toSerialize["address"] = o.Address + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIPAddress) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "family", + "address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIPAddress := _NestedIPAddress{} + + err = json.Unmarshal(data, &varNestedIPAddress) + + if err != nil { + return err + } + + *o = NestedIPAddress(varNestedIPAddress) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "family") + delete(additionalProperties, "address") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIPAddress struct { + value *NestedIPAddress + isSet bool +} + +func (v NullableNestedIPAddress) Get() *NestedIPAddress { + return v.value +} + +func (v *NullableNestedIPAddress) Set(val *NestedIPAddress) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIPAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIPAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIPAddress(val *NestedIPAddress) *NullableNestedIPAddress { + return &NullableNestedIPAddress{value: val, isSet: true} +} + +func (v NullableNestedIPAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIPAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_address_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_address_request.go new file mode 100644 index 00000000..ccc04feb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_address_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIPAddressRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIPAddressRequest{} + +// NestedIPAddressRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIPAddressRequest struct { + Address string `json:"address"` + AdditionalProperties map[string]interface{} +} + +type _NestedIPAddressRequest NestedIPAddressRequest + +// NewNestedIPAddressRequest instantiates a new NestedIPAddressRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIPAddressRequest(address string) *NestedIPAddressRequest { + this := NestedIPAddressRequest{} + this.Address = address + return &this +} + +// NewNestedIPAddressRequestWithDefaults instantiates a new NestedIPAddressRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIPAddressRequestWithDefaults() *NestedIPAddressRequest { + this := NestedIPAddressRequest{} + return &this +} + +// GetAddress returns the Address field value +func (o *NestedIPAddressRequest) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *NestedIPAddressRequest) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *NestedIPAddressRequest) SetAddress(v string) { + o.Address = v +} + +func (o NestedIPAddressRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIPAddressRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIPAddressRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIPAddressRequest := _NestedIPAddressRequest{} + + err = json.Unmarshal(data, &varNestedIPAddressRequest) + + if err != nil { + return err + } + + *o = NestedIPAddressRequest(varNestedIPAddressRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "address") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIPAddressRequest struct { + value *NestedIPAddressRequest + isSet bool +} + +func (v NullableNestedIPAddressRequest) Get() *NestedIPAddressRequest { + return v.value +} + +func (v *NullableNestedIPAddressRequest) Set(val *NestedIPAddressRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIPAddressRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIPAddressRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIPAddressRequest(val *NestedIPAddressRequest) *NullableNestedIPAddressRequest { + return &NullableNestedIPAddressRequest{value: val, isSet: true} +} + +func (v NullableNestedIPAddressRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIPAddressRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_policy.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_policy.go new file mode 100644 index 00000000..aa833968 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_policy.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIPSecPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIPSecPolicy{} + +// NestedIPSecPolicy Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIPSecPolicy struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedIPSecPolicy NestedIPSecPolicy + +// NewNestedIPSecPolicy instantiates a new NestedIPSecPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIPSecPolicy(id int32, url string, display string, name string) *NestedIPSecPolicy { + this := NestedIPSecPolicy{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedIPSecPolicyWithDefaults instantiates a new NestedIPSecPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIPSecPolicyWithDefaults() *NestedIPSecPolicy { + this := NestedIPSecPolicy{} + return &this +} + +// GetId returns the Id field value +func (o *NestedIPSecPolicy) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecPolicy) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedIPSecPolicy) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedIPSecPolicy) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecPolicy) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedIPSecPolicy) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedIPSecPolicy) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecPolicy) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedIPSecPolicy) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedIPSecPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedIPSecPolicy) SetName(v string) { + o.Name = v +} + +func (o NestedIPSecPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIPSecPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIPSecPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIPSecPolicy := _NestedIPSecPolicy{} + + err = json.Unmarshal(data, &varNestedIPSecPolicy) + + if err != nil { + return err + } + + *o = NestedIPSecPolicy(varNestedIPSecPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIPSecPolicy struct { + value *NestedIPSecPolicy + isSet bool +} + +func (v NullableNestedIPSecPolicy) Get() *NestedIPSecPolicy { + return v.value +} + +func (v *NullableNestedIPSecPolicy) Set(val *NestedIPSecPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIPSecPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIPSecPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIPSecPolicy(val *NestedIPSecPolicy) *NullableNestedIPSecPolicy { + return &NullableNestedIPSecPolicy{value: val, isSet: true} +} + +func (v NullableNestedIPSecPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIPSecPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_policy_request.go new file mode 100644 index 00000000..f13b0b3d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_policy_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIPSecPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIPSecPolicyRequest{} + +// NestedIPSecPolicyRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIPSecPolicyRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedIPSecPolicyRequest NestedIPSecPolicyRequest + +// NewNestedIPSecPolicyRequest instantiates a new NestedIPSecPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIPSecPolicyRequest(name string) *NestedIPSecPolicyRequest { + this := NestedIPSecPolicyRequest{} + this.Name = name + return &this +} + +// NewNestedIPSecPolicyRequestWithDefaults instantiates a new NestedIPSecPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIPSecPolicyRequestWithDefaults() *NestedIPSecPolicyRequest { + this := NestedIPSecPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedIPSecPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedIPSecPolicyRequest) SetName(v string) { + o.Name = v +} + +func (o NestedIPSecPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIPSecPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIPSecPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIPSecPolicyRequest := _NestedIPSecPolicyRequest{} + + err = json.Unmarshal(data, &varNestedIPSecPolicyRequest) + + if err != nil { + return err + } + + *o = NestedIPSecPolicyRequest(varNestedIPSecPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIPSecPolicyRequest struct { + value *NestedIPSecPolicyRequest + isSet bool +} + +func (v NullableNestedIPSecPolicyRequest) Get() *NestedIPSecPolicyRequest { + return v.value +} + +func (v *NullableNestedIPSecPolicyRequest) Set(val *NestedIPSecPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIPSecPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIPSecPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIPSecPolicyRequest(val *NestedIPSecPolicyRequest) *NullableNestedIPSecPolicyRequest { + return &NullableNestedIPSecPolicyRequest{value: val, isSet: true} +} + +func (v NullableNestedIPSecPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIPSecPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_profile.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_profile.go new file mode 100644 index 00000000..db050baf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_profile.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIPSecProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIPSecProfile{} + +// NestedIPSecProfile Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIPSecProfile struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedIPSecProfile NestedIPSecProfile + +// NewNestedIPSecProfile instantiates a new NestedIPSecProfile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIPSecProfile(id int32, url string, display string, name string) *NestedIPSecProfile { + this := NestedIPSecProfile{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedIPSecProfileWithDefaults instantiates a new NestedIPSecProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIPSecProfileWithDefaults() *NestedIPSecProfile { + this := NestedIPSecProfile{} + return &this +} + +// GetId returns the Id field value +func (o *NestedIPSecProfile) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecProfile) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedIPSecProfile) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedIPSecProfile) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecProfile) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedIPSecProfile) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedIPSecProfile) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecProfile) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedIPSecProfile) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedIPSecProfile) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecProfile) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedIPSecProfile) SetName(v string) { + o.Name = v +} + +func (o NestedIPSecProfile) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIPSecProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIPSecProfile) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIPSecProfile := _NestedIPSecProfile{} + + err = json.Unmarshal(data, &varNestedIPSecProfile) + + if err != nil { + return err + } + + *o = NestedIPSecProfile(varNestedIPSecProfile) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIPSecProfile struct { + value *NestedIPSecProfile + isSet bool +} + +func (v NullableNestedIPSecProfile) Get() *NestedIPSecProfile { + return v.value +} + +func (v *NullableNestedIPSecProfile) Set(val *NestedIPSecProfile) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIPSecProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIPSecProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIPSecProfile(val *NestedIPSecProfile) *NullableNestedIPSecProfile { + return &NullableNestedIPSecProfile{value: val, isSet: true} +} + +func (v NullableNestedIPSecProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIPSecProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_profile_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_profile_request.go new file mode 100644 index 00000000..e87428e5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_ip_sec_profile_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedIPSecProfileRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedIPSecProfileRequest{} + +// NestedIPSecProfileRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedIPSecProfileRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedIPSecProfileRequest NestedIPSecProfileRequest + +// NewNestedIPSecProfileRequest instantiates a new NestedIPSecProfileRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedIPSecProfileRequest(name string) *NestedIPSecProfileRequest { + this := NestedIPSecProfileRequest{} + this.Name = name + return &this +} + +// NewNestedIPSecProfileRequestWithDefaults instantiates a new NestedIPSecProfileRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedIPSecProfileRequestWithDefaults() *NestedIPSecProfileRequest { + this := NestedIPSecProfileRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedIPSecProfileRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedIPSecProfileRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedIPSecProfileRequest) SetName(v string) { + o.Name = v +} + +func (o NestedIPSecProfileRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedIPSecProfileRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedIPSecProfileRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedIPSecProfileRequest := _NestedIPSecProfileRequest{} + + err = json.Unmarshal(data, &varNestedIPSecProfileRequest) + + if err != nil { + return err + } + + *o = NestedIPSecProfileRequest(varNestedIPSecProfileRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedIPSecProfileRequest struct { + value *NestedIPSecProfileRequest + isSet bool +} + +func (v NullableNestedIPSecProfileRequest) Get() *NestedIPSecProfileRequest { + return v.value +} + +func (v *NullableNestedIPSecProfileRequest) Set(val *NestedIPSecProfileRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedIPSecProfileRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedIPSecProfileRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedIPSecProfileRequest(val *NestedIPSecProfileRequest) *NullableNestedIPSecProfileRequest { + return &NullableNestedIPSecProfileRequest{value: val, isSet: true} +} + +func (v NullableNestedIPSecProfileRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedIPSecProfileRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn.go new file mode 100644 index 00000000..40373d3c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn.go @@ -0,0 +1,359 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedL2VPN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedL2VPN{} + +// NestedL2VPN Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedL2VPN struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Identifier NullableInt64 `json:"identifier,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Type L2VPNTypeValue `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _NestedL2VPN NestedL2VPN + +// NewNestedL2VPN instantiates a new NestedL2VPN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedL2VPN(id int32, url string, display string, name string, slug string, type_ L2VPNTypeValue) *NestedL2VPN { + this := NestedL2VPN{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Type = type_ + return &this +} + +// NewNestedL2VPNWithDefaults instantiates a new NestedL2VPN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedL2VPNWithDefaults() *NestedL2VPN { + this := NestedL2VPN{} + return &this +} + +// GetId returns the Id field value +func (o *NestedL2VPN) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPN) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedL2VPN) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedL2VPN) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPN) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedL2VPN) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedL2VPN) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPN) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedL2VPN) SetDisplay(v string) { + o.Display = v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedL2VPN) GetIdentifier() int64 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int64 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedL2VPN) GetIdentifierOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *NestedL2VPN) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt64 and assigns it to the Identifier field. +func (o *NestedL2VPN) SetIdentifier(v int64) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *NestedL2VPN) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *NestedL2VPN) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetName returns the Name field value +func (o *NestedL2VPN) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPN) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedL2VPN) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedL2VPN) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPN) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedL2VPN) SetSlug(v string) { + o.Slug = v +} + +// GetType returns the Type field value +func (o *NestedL2VPN) GetType() L2VPNTypeValue { + if o == nil { + var ret L2VPNTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPN) GetTypeOk() (*L2VPNTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NestedL2VPN) SetType(v L2VPNTypeValue) { + o.Type = v +} + +func (o NestedL2VPN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedL2VPN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedL2VPN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedL2VPN := _NestedL2VPN{} + + err = json.Unmarshal(data, &varNestedL2VPN) + + if err != nil { + return err + } + + *o = NestedL2VPN(varNestedL2VPN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "identifier") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedL2VPN struct { + value *NestedL2VPN + isSet bool +} + +func (v NullableNestedL2VPN) Get() *NestedL2VPN { + return v.value +} + +func (v *NullableNestedL2VPN) Set(val *NestedL2VPN) { + v.value = val + v.isSet = true +} + +func (v NullableNestedL2VPN) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedL2VPN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedL2VPN(val *NestedL2VPN) *NullableNestedL2VPN { + return &NullableNestedL2VPN{value: val, isSet: true} +} + +func (v NullableNestedL2VPN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedL2VPN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_request.go new file mode 100644 index 00000000..280591e7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_request.go @@ -0,0 +1,272 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedL2VPNRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedL2VPNRequest{} + +// NestedL2VPNRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedL2VPNRequest struct { + Identifier NullableInt64 `json:"identifier,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Type L2VPNTypeValue `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _NestedL2VPNRequest NestedL2VPNRequest + +// NewNestedL2VPNRequest instantiates a new NestedL2VPNRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedL2VPNRequest(name string, slug string, type_ L2VPNTypeValue) *NestedL2VPNRequest { + this := NestedL2VPNRequest{} + this.Name = name + this.Slug = slug + this.Type = type_ + return &this +} + +// NewNestedL2VPNRequestWithDefaults instantiates a new NestedL2VPNRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedL2VPNRequestWithDefaults() *NestedL2VPNRequest { + this := NestedL2VPNRequest{} + return &this +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedL2VPNRequest) GetIdentifier() int64 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int64 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedL2VPNRequest) GetIdentifierOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *NestedL2VPNRequest) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt64 and assigns it to the Identifier field. +func (o *NestedL2VPNRequest) SetIdentifier(v int64) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *NestedL2VPNRequest) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *NestedL2VPNRequest) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetName returns the Name field value +func (o *NestedL2VPNRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedL2VPNRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedL2VPNRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedL2VPNRequest) SetSlug(v string) { + o.Slug = v +} + +// GetType returns the Type field value +func (o *NestedL2VPNRequest) GetType() L2VPNTypeValue { + if o == nil { + var ret L2VPNTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNRequest) GetTypeOk() (*L2VPNTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NestedL2VPNRequest) SetType(v L2VPNTypeValue) { + o.Type = v +} + +func (o NestedL2VPNRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedL2VPNRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedL2VPNRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedL2VPNRequest := _NestedL2VPNRequest{} + + err = json.Unmarshal(data, &varNestedL2VPNRequest) + + if err != nil { + return err + } + + *o = NestedL2VPNRequest(varNestedL2VPNRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "identifier") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedL2VPNRequest struct { + value *NestedL2VPNRequest + isSet bool +} + +func (v NullableNestedL2VPNRequest) Get() *NestedL2VPNRequest { + return v.value +} + +func (v *NullableNestedL2VPNRequest) Set(val *NestedL2VPNRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedL2VPNRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedL2VPNRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedL2VPNRequest(val *NestedL2VPNRequest) *NullableNestedL2VPNRequest { + return &NullableNestedL2VPNRequest{value: val, isSet: true} +} + +func (v NullableNestedL2VPNRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedL2VPNRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_termination.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_termination.go new file mode 100644 index 00000000..5c4e4b5c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_termination.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedL2VPNTermination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedL2VPNTermination{} + +// NestedL2VPNTermination Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedL2VPNTermination struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + L2vpn NestedL2VPN `json:"l2vpn"` + AdditionalProperties map[string]interface{} +} + +type _NestedL2VPNTermination NestedL2VPNTermination + +// NewNestedL2VPNTermination instantiates a new NestedL2VPNTermination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedL2VPNTermination(id int32, url string, display string, l2vpn NestedL2VPN) *NestedL2VPNTermination { + this := NestedL2VPNTermination{} + this.Id = id + this.Url = url + this.Display = display + this.L2vpn = l2vpn + return &this +} + +// NewNestedL2VPNTerminationWithDefaults instantiates a new NestedL2VPNTermination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedL2VPNTerminationWithDefaults() *NestedL2VPNTermination { + this := NestedL2VPNTermination{} + return &this +} + +// GetId returns the Id field value +func (o *NestedL2VPNTermination) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNTermination) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedL2VPNTermination) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedL2VPNTermination) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNTermination) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedL2VPNTermination) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedL2VPNTermination) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNTermination) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedL2VPNTermination) SetDisplay(v string) { + o.Display = v +} + +// GetL2vpn returns the L2vpn field value +func (o *NestedL2VPNTermination) GetL2vpn() NestedL2VPN { + if o == nil { + var ret NestedL2VPN + return ret + } + + return o.L2vpn +} + +// GetL2vpnOk returns a tuple with the L2vpn field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNTermination) GetL2vpnOk() (*NestedL2VPN, bool) { + if o == nil { + return nil, false + } + return &o.L2vpn, true +} + +// SetL2vpn sets field value +func (o *NestedL2VPNTermination) SetL2vpn(v NestedL2VPN) { + o.L2vpn = v +} + +func (o NestedL2VPNTermination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedL2VPNTermination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["l2vpn"] = o.L2vpn + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedL2VPNTermination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "l2vpn", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedL2VPNTermination := _NestedL2VPNTermination{} + + err = json.Unmarshal(data, &varNestedL2VPNTermination) + + if err != nil { + return err + } + + *o = NestedL2VPNTermination(varNestedL2VPNTermination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "l2vpn") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedL2VPNTermination struct { + value *NestedL2VPNTermination + isSet bool +} + +func (v NullableNestedL2VPNTermination) Get() *NestedL2VPNTermination { + return v.value +} + +func (v *NullableNestedL2VPNTermination) Set(val *NestedL2VPNTermination) { + v.value = val + v.isSet = true +} + +func (v NullableNestedL2VPNTermination) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedL2VPNTermination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedL2VPNTermination(val *NestedL2VPNTermination) *NullableNestedL2VPNTermination { + return &NullableNestedL2VPNTermination{value: val, isSet: true} +} + +func (v NullableNestedL2VPNTermination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedL2VPNTermination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_termination_request.go new file mode 100644 index 00000000..7d85ec4b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_l2_vpn_termination_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedL2VPNTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedL2VPNTerminationRequest{} + +// NestedL2VPNTerminationRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedL2VPNTerminationRequest struct { + L2vpn NestedL2VPNRequest `json:"l2vpn"` + AdditionalProperties map[string]interface{} +} + +type _NestedL2VPNTerminationRequest NestedL2VPNTerminationRequest + +// NewNestedL2VPNTerminationRequest instantiates a new NestedL2VPNTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedL2VPNTerminationRequest(l2vpn NestedL2VPNRequest) *NestedL2VPNTerminationRequest { + this := NestedL2VPNTerminationRequest{} + this.L2vpn = l2vpn + return &this +} + +// NewNestedL2VPNTerminationRequestWithDefaults instantiates a new NestedL2VPNTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedL2VPNTerminationRequestWithDefaults() *NestedL2VPNTerminationRequest { + this := NestedL2VPNTerminationRequest{} + return &this +} + +// GetL2vpn returns the L2vpn field value +func (o *NestedL2VPNTerminationRequest) GetL2vpn() NestedL2VPNRequest { + if o == nil { + var ret NestedL2VPNRequest + return ret + } + + return o.L2vpn +} + +// GetL2vpnOk returns a tuple with the L2vpn field value +// and a boolean to check if the value has been set. +func (o *NestedL2VPNTerminationRequest) GetL2vpnOk() (*NestedL2VPNRequest, bool) { + if o == nil { + return nil, false + } + return &o.L2vpn, true +} + +// SetL2vpn sets field value +func (o *NestedL2VPNTerminationRequest) SetL2vpn(v NestedL2VPNRequest) { + o.L2vpn = v +} + +func (o NestedL2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedL2VPNTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["l2vpn"] = o.L2vpn + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedL2VPNTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "l2vpn", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedL2VPNTerminationRequest := _NestedL2VPNTerminationRequest{} + + err = json.Unmarshal(data, &varNestedL2VPNTerminationRequest) + + if err != nil { + return err + } + + *o = NestedL2VPNTerminationRequest(varNestedL2VPNTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "l2vpn") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedL2VPNTerminationRequest struct { + value *NestedL2VPNTerminationRequest + isSet bool +} + +func (v NullableNestedL2VPNTerminationRequest) Get() *NestedL2VPNTerminationRequest { + return v.value +} + +func (v *NullableNestedL2VPNTerminationRequest) Set(val *NestedL2VPNTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedL2VPNTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedL2VPNTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedL2VPNTerminationRequest(val *NestedL2VPNTerminationRequest) *NullableNestedL2VPNTerminationRequest { + return &NullableNestedL2VPNTerminationRequest{value: val, isSet: true} +} + +func (v NullableNestedL2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedL2VPNTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_location.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_location.go new file mode 100644 index 00000000..66982b9a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_location.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedLocation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedLocation{} + +// NestedLocation Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedLocation struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _NestedLocation NestedLocation + +// NewNestedLocation instantiates a new NestedLocation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedLocation(id int32, url string, display string, name string, slug string, depth int32) *NestedLocation { + this := NestedLocation{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Depth = depth + return &this +} + +// NewNestedLocationWithDefaults instantiates a new NestedLocation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedLocationWithDefaults() *NestedLocation { + this := NestedLocation{} + return &this +} + +// GetId returns the Id field value +func (o *NestedLocation) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedLocation) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedLocation) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedLocation) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedLocation) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedLocation) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedLocation) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedLocation) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedLocation) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedLocation) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedLocation) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedLocation) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedLocation) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedLocation) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedLocation) SetSlug(v string) { + o.Slug = v +} + +// GetDepth returns the Depth field value +func (o *NestedLocation) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *NestedLocation) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *NestedLocation) SetDepth(v int32) { + o.Depth = v +} + +func (o NestedLocation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedLocation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedLocation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedLocation := _NestedLocation{} + + err = json.Unmarshal(data, &varNestedLocation) + + if err != nil { + return err + } + + *o = NestedLocation(varNestedLocation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedLocation struct { + value *NestedLocation + isSet bool +} + +func (v NullableNestedLocation) Get() *NestedLocation { + return v.value +} + +func (v *NullableNestedLocation) Set(val *NestedLocation) { + v.value = val + v.isSet = true +} + +func (v NullableNestedLocation) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedLocation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedLocation(val *NestedLocation) *NullableNestedLocation { + return &NullableNestedLocation{value: val, isSet: true} +} + +func (v NullableNestedLocation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedLocation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_location_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_location_request.go new file mode 100644 index 00000000..638da3eb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_location_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedLocationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedLocationRequest{} + +// NestedLocationRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedLocationRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedLocationRequest NestedLocationRequest + +// NewNestedLocationRequest instantiates a new NestedLocationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedLocationRequest(name string, slug string) *NestedLocationRequest { + this := NestedLocationRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedLocationRequestWithDefaults instantiates a new NestedLocationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedLocationRequestWithDefaults() *NestedLocationRequest { + this := NestedLocationRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedLocationRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedLocationRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedLocationRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedLocationRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedLocationRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedLocationRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedLocationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedLocationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedLocationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedLocationRequest := _NestedLocationRequest{} + + err = json.Unmarshal(data, &varNestedLocationRequest) + + if err != nil { + return err + } + + *o = NestedLocationRequest(varNestedLocationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedLocationRequest struct { + value *NestedLocationRequest + isSet bool +} + +func (v NullableNestedLocationRequest) Get() *NestedLocationRequest { + return v.value +} + +func (v *NullableNestedLocationRequest) Set(val *NestedLocationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedLocationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedLocationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedLocationRequest(val *NestedLocationRequest) *NullableNestedLocationRequest { + return &NullableNestedLocationRequest{value: val, isSet: true} +} + +func (v NullableNestedLocationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedLocationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_manufacturer.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_manufacturer.go new file mode 100644 index 00000000..6b5d4f90 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_manufacturer.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedManufacturer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedManufacturer{} + +// NestedManufacturer Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedManufacturer struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedManufacturer NestedManufacturer + +// NewNestedManufacturer instantiates a new NestedManufacturer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedManufacturer(id int32, url string, display string, name string, slug string) *NestedManufacturer { + this := NestedManufacturer{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedManufacturerWithDefaults instantiates a new NestedManufacturer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedManufacturerWithDefaults() *NestedManufacturer { + this := NestedManufacturer{} + return &this +} + +// GetId returns the Id field value +func (o *NestedManufacturer) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedManufacturer) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedManufacturer) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedManufacturer) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedManufacturer) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedManufacturer) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedManufacturer) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedManufacturer) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedManufacturer) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedManufacturer) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedManufacturer) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedManufacturer) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedManufacturer) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedManufacturer) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedManufacturer) SetSlug(v string) { + o.Slug = v +} + +func (o NestedManufacturer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedManufacturer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedManufacturer) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedManufacturer := _NestedManufacturer{} + + err = json.Unmarshal(data, &varNestedManufacturer) + + if err != nil { + return err + } + + *o = NestedManufacturer(varNestedManufacturer) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedManufacturer struct { + value *NestedManufacturer + isSet bool +} + +func (v NullableNestedManufacturer) Get() *NestedManufacturer { + return v.value +} + +func (v *NullableNestedManufacturer) Set(val *NestedManufacturer) { + v.value = val + v.isSet = true +} + +func (v NullableNestedManufacturer) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedManufacturer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedManufacturer(val *NestedManufacturer) *NullableNestedManufacturer { + return &NullableNestedManufacturer{value: val, isSet: true} +} + +func (v NullableNestedManufacturer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedManufacturer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_manufacturer_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_manufacturer_request.go new file mode 100644 index 00000000..72f598fb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_manufacturer_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedManufacturerRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedManufacturerRequest{} + +// NestedManufacturerRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedManufacturerRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedManufacturerRequest NestedManufacturerRequest + +// NewNestedManufacturerRequest instantiates a new NestedManufacturerRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedManufacturerRequest(name string, slug string) *NestedManufacturerRequest { + this := NestedManufacturerRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedManufacturerRequestWithDefaults instantiates a new NestedManufacturerRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedManufacturerRequestWithDefaults() *NestedManufacturerRequest { + this := NestedManufacturerRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedManufacturerRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedManufacturerRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedManufacturerRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedManufacturerRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedManufacturerRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedManufacturerRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedManufacturerRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedManufacturerRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedManufacturerRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedManufacturerRequest := _NestedManufacturerRequest{} + + err = json.Unmarshal(data, &varNestedManufacturerRequest) + + if err != nil { + return err + } + + *o = NestedManufacturerRequest(varNestedManufacturerRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedManufacturerRequest struct { + value *NestedManufacturerRequest + isSet bool +} + +func (v NullableNestedManufacturerRequest) Get() *NestedManufacturerRequest { + return v.value +} + +func (v *NullableNestedManufacturerRequest) Set(val *NestedManufacturerRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedManufacturerRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedManufacturerRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedManufacturerRequest(val *NestedManufacturerRequest) *NullableNestedManufacturerRequest { + return &NullableNestedManufacturerRequest{value: val, isSet: true} +} + +func (v NullableNestedManufacturerRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedManufacturerRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module.go new file mode 100644 index 00000000..657920c2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedModule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedModule{} + +// NestedModule Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedModule struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + ModuleBay ModuleNestedModuleBay `json:"module_bay"` + ModuleType NestedModuleType `json:"module_type"` + AdditionalProperties map[string]interface{} +} + +type _NestedModule NestedModule + +// NewNestedModule instantiates a new NestedModule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedModule(id int32, url string, display string, device NestedDevice, moduleBay ModuleNestedModuleBay, moduleType NestedModuleType) *NestedModule { + this := NestedModule{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.ModuleBay = moduleBay + this.ModuleType = moduleType + return &this +} + +// NewNestedModuleWithDefaults instantiates a new NestedModule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedModuleWithDefaults() *NestedModule { + this := NestedModule{} + return &this +} + +// GetId returns the Id field value +func (o *NestedModule) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedModule) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedModule) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedModule) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedModule) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedModule) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedModule) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedModule) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedModule) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *NestedModule) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *NestedModule) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *NestedModule) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModuleBay returns the ModuleBay field value +func (o *NestedModule) GetModuleBay() ModuleNestedModuleBay { + if o == nil { + var ret ModuleNestedModuleBay + return ret + } + + return o.ModuleBay +} + +// GetModuleBayOk returns a tuple with the ModuleBay field value +// and a boolean to check if the value has been set. +func (o *NestedModule) GetModuleBayOk() (*ModuleNestedModuleBay, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBay, true +} + +// SetModuleBay sets field value +func (o *NestedModule) SetModuleBay(v ModuleNestedModuleBay) { + o.ModuleBay = v +} + +// GetModuleType returns the ModuleType field value +func (o *NestedModule) GetModuleType() NestedModuleType { + if o == nil { + var ret NestedModuleType + return ret + } + + return o.ModuleType +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value +// and a boolean to check if the value has been set. +func (o *NestedModule) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return &o.ModuleType, true +} + +// SetModuleType sets field value +func (o *NestedModule) SetModuleType(v NestedModuleType) { + o.ModuleType = v +} + +func (o NestedModule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedModule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + toSerialize["module_bay"] = o.ModuleBay + toSerialize["module_type"] = o.ModuleType + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedModule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "module_bay", + "module_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedModule := _NestedModule{} + + err = json.Unmarshal(data, &varNestedModule) + + if err != nil { + return err + } + + *o = NestedModule(varNestedModule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module_bay") + delete(additionalProperties, "module_type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedModule struct { + value *NestedModule + isSet bool +} + +func (v NullableNestedModule) Get() *NestedModule { + return v.value +} + +func (v *NullableNestedModule) Set(val *NestedModule) { + v.value = val + v.isSet = true +} + +func (v NullableNestedModule) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedModule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedModule(val *NestedModule) *NullableNestedModule { + return &NullableNestedModule{value: val, isSet: true} +} + +func (v NullableNestedModule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedModule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_bay.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_bay.go new file mode 100644 index 00000000..95eb47d9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_bay.go @@ -0,0 +1,284 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedModuleBay type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedModuleBay{} + +// NestedModuleBay Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedModuleBay struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Module NullableNestedModule `json:"module"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedModuleBay NestedModuleBay + +// NewNestedModuleBay instantiates a new NestedModuleBay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedModuleBay(id int32, url string, display string, module NullableNestedModule, name string) *NestedModuleBay { + this := NestedModuleBay{} + this.Id = id + this.Url = url + this.Display = display + this.Module = module + this.Name = name + return &this +} + +// NewNestedModuleBayWithDefaults instantiates a new NestedModuleBay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedModuleBayWithDefaults() *NestedModuleBay { + this := NestedModuleBay{} + return &this +} + +// GetId returns the Id field value +func (o *NestedModuleBay) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedModuleBay) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedModuleBay) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedModuleBay) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedModuleBay) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedModuleBay) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedModuleBay) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedModuleBay) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedModuleBay) SetDisplay(v string) { + o.Display = v +} + +// GetModule returns the Module field value +// If the value is explicit nil, the zero value for NestedModule will be returned +func (o *NestedModuleBay) GetModule() NestedModule { + if o == nil || o.Module.Get() == nil { + var ret NestedModule + return ret + } + + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedModuleBay) GetModuleOk() (*NestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// SetModule sets field value +func (o *NestedModuleBay) SetModule(v NestedModule) { + o.Module.Set(&v) +} + +// GetName returns the Name field value +func (o *NestedModuleBay) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedModuleBay) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedModuleBay) SetName(v string) { + o.Name = v +} + +func (o NestedModuleBay) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedModuleBay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["module"] = o.Module.Get() + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedModuleBay) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "module", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedModuleBay := _NestedModuleBay{} + + err = json.Unmarshal(data, &varNestedModuleBay) + + if err != nil { + return err + } + + *o = NestedModuleBay(varNestedModuleBay) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedModuleBay struct { + value *NestedModuleBay + isSet bool +} + +func (v NullableNestedModuleBay) Get() *NestedModuleBay { + return v.value +} + +func (v *NullableNestedModuleBay) Set(val *NestedModuleBay) { + v.value = val + v.isSet = true +} + +func (v NullableNestedModuleBay) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedModuleBay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedModuleBay(val *NestedModuleBay) *NullableNestedModuleBay { + return &NullableNestedModuleBay{value: val, isSet: true} +} + +func (v NullableNestedModuleBay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedModuleBay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_bay_request.go new file mode 100644 index 00000000..ec43a3f7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_bay_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedModuleBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedModuleBayRequest{} + +// NestedModuleBayRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedModuleBayRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedModuleBayRequest NestedModuleBayRequest + +// NewNestedModuleBayRequest instantiates a new NestedModuleBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedModuleBayRequest(name string) *NestedModuleBayRequest { + this := NestedModuleBayRequest{} + this.Name = name + return &this +} + +// NewNestedModuleBayRequestWithDefaults instantiates a new NestedModuleBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedModuleBayRequestWithDefaults() *NestedModuleBayRequest { + this := NestedModuleBayRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedModuleBayRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedModuleBayRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedModuleBayRequest) SetName(v string) { + o.Name = v +} + +func (o NestedModuleBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedModuleBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedModuleBayRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedModuleBayRequest := _NestedModuleBayRequest{} + + err = json.Unmarshal(data, &varNestedModuleBayRequest) + + if err != nil { + return err + } + + *o = NestedModuleBayRequest(varNestedModuleBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedModuleBayRequest struct { + value *NestedModuleBayRequest + isSet bool +} + +func (v NullableNestedModuleBayRequest) Get() *NestedModuleBayRequest { + return v.value +} + +func (v *NullableNestedModuleBayRequest) Set(val *NestedModuleBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedModuleBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedModuleBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedModuleBayRequest(val *NestedModuleBayRequest) *NullableNestedModuleBayRequest { + return &NullableNestedModuleBayRequest{value: val, isSet: true} +} + +func (v NullableNestedModuleBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedModuleBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_type.go new file mode 100644 index 00000000..1c3b19a6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_type.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedModuleType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedModuleType{} + +// NestedModuleType Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedModuleType struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Manufacturer NestedManufacturer `json:"manufacturer"` + Model string `json:"model"` + AdditionalProperties map[string]interface{} +} + +type _NestedModuleType NestedModuleType + +// NewNestedModuleType instantiates a new NestedModuleType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedModuleType(id int32, url string, display string, manufacturer NestedManufacturer, model string) *NestedModuleType { + this := NestedModuleType{} + this.Id = id + this.Url = url + this.Display = display + this.Manufacturer = manufacturer + this.Model = model + return &this +} + +// NewNestedModuleTypeWithDefaults instantiates a new NestedModuleType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedModuleTypeWithDefaults() *NestedModuleType { + this := NestedModuleType{} + return &this +} + +// GetId returns the Id field value +func (o *NestedModuleType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedModuleType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedModuleType) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedModuleType) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedModuleType) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedModuleType) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedModuleType) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedModuleType) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedModuleType) SetDisplay(v string) { + o.Display = v +} + +// GetManufacturer returns the Manufacturer field value +func (o *NestedModuleType) GetManufacturer() NestedManufacturer { + if o == nil { + var ret NestedManufacturer + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *NestedModuleType) GetManufacturerOk() (*NestedManufacturer, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *NestedModuleType) SetManufacturer(v NestedManufacturer) { + o.Manufacturer = v +} + +// GetModel returns the Model field value +func (o *NestedModuleType) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *NestedModuleType) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *NestedModuleType) SetModel(v string) { + o.Model = v +} + +func (o NestedModuleType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedModuleType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["manufacturer"] = o.Manufacturer + toSerialize["model"] = o.Model + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedModuleType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "manufacturer", + "model", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedModuleType := _NestedModuleType{} + + err = json.Unmarshal(data, &varNestedModuleType) + + if err != nil { + return err + } + + *o = NestedModuleType(varNestedModuleType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedModuleType struct { + value *NestedModuleType + isSet bool +} + +func (v NullableNestedModuleType) Get() *NestedModuleType { + return v.value +} + +func (v *NullableNestedModuleType) Set(val *NestedModuleType) { + v.value = val + v.isSet = true +} + +func (v NullableNestedModuleType) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedModuleType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedModuleType(val *NestedModuleType) *NullableNestedModuleType { + return &NullableNestedModuleType{value: val, isSet: true} +} + +func (v NullableNestedModuleType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedModuleType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_type_request.go new file mode 100644 index 00000000..902448aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_module_type_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedModuleTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedModuleTypeRequest{} + +// NestedModuleTypeRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedModuleTypeRequest struct { + Model string `json:"model"` + AdditionalProperties map[string]interface{} +} + +type _NestedModuleTypeRequest NestedModuleTypeRequest + +// NewNestedModuleTypeRequest instantiates a new NestedModuleTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedModuleTypeRequest(model string) *NestedModuleTypeRequest { + this := NestedModuleTypeRequest{} + this.Model = model + return &this +} + +// NewNestedModuleTypeRequestWithDefaults instantiates a new NestedModuleTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedModuleTypeRequestWithDefaults() *NestedModuleTypeRequest { + this := NestedModuleTypeRequest{} + return &this +} + +// GetModel returns the Model field value +func (o *NestedModuleTypeRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *NestedModuleTypeRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *NestedModuleTypeRequest) SetModel(v string) { + o.Model = v +} + +func (o NestedModuleTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedModuleTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["model"] = o.Model + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedModuleTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "model", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedModuleTypeRequest := _NestedModuleTypeRequest{} + + err = json.Unmarshal(data, &varNestedModuleTypeRequest) + + if err != nil { + return err + } + + *o = NestedModuleTypeRequest(varNestedModuleTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedModuleTypeRequest struct { + value *NestedModuleTypeRequest + isSet bool +} + +func (v NullableNestedModuleTypeRequest) Get() *NestedModuleTypeRequest { + return v.value +} + +func (v *NullableNestedModuleTypeRequest) Set(val *NestedModuleTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedModuleTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedModuleTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedModuleTypeRequest(val *NestedModuleTypeRequest) *NullableNestedModuleTypeRequest { + return &NullableNestedModuleTypeRequest{value: val, isSet: true} +} + +func (v NullableNestedModuleTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedModuleTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_platform.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_platform.go new file mode 100644 index 00000000..4a2b9b5e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_platform.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPlatform type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPlatform{} + +// NestedPlatform Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPlatform struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedPlatform NestedPlatform + +// NewNestedPlatform instantiates a new NestedPlatform object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPlatform(id int32, url string, display string, name string, slug string) *NestedPlatform { + this := NestedPlatform{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedPlatformWithDefaults instantiates a new NestedPlatform object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPlatformWithDefaults() *NestedPlatform { + this := NestedPlatform{} + return &this +} + +// GetId returns the Id field value +func (o *NestedPlatform) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedPlatform) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedPlatform) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedPlatform) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedPlatform) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedPlatform) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedPlatform) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedPlatform) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedPlatform) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedPlatform) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPlatform) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPlatform) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedPlatform) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedPlatform) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedPlatform) SetSlug(v string) { + o.Slug = v +} + +func (o NestedPlatform) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPlatform) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPlatform) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPlatform := _NestedPlatform{} + + err = json.Unmarshal(data, &varNestedPlatform) + + if err != nil { + return err + } + + *o = NestedPlatform(varNestedPlatform) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPlatform struct { + value *NestedPlatform + isSet bool +} + +func (v NullableNestedPlatform) Get() *NestedPlatform { + return v.value +} + +func (v *NullableNestedPlatform) Set(val *NestedPlatform) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPlatform) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPlatform) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPlatform(val *NestedPlatform) *NullableNestedPlatform { + return &NullableNestedPlatform{value: val, isSet: true} +} + +func (v NullableNestedPlatform) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPlatform) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_platform_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_platform_request.go new file mode 100644 index 00000000..13b05131 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_platform_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPlatformRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPlatformRequest{} + +// NestedPlatformRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPlatformRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedPlatformRequest NestedPlatformRequest + +// NewNestedPlatformRequest instantiates a new NestedPlatformRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPlatformRequest(name string, slug string) *NestedPlatformRequest { + this := NestedPlatformRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedPlatformRequestWithDefaults instantiates a new NestedPlatformRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPlatformRequestWithDefaults() *NestedPlatformRequest { + this := NestedPlatformRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedPlatformRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPlatformRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPlatformRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedPlatformRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedPlatformRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedPlatformRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedPlatformRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPlatformRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPlatformRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPlatformRequest := _NestedPlatformRequest{} + + err = json.Unmarshal(data, &varNestedPlatformRequest) + + if err != nil { + return err + } + + *o = NestedPlatformRequest(varNestedPlatformRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPlatformRequest struct { + value *NestedPlatformRequest + isSet bool +} + +func (v NullableNestedPlatformRequest) Get() *NestedPlatformRequest { + return v.value +} + +func (v *NullableNestedPlatformRequest) Set(val *NestedPlatformRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPlatformRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPlatformRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPlatformRequest(val *NestedPlatformRequest) *NullableNestedPlatformRequest { + return &NullableNestedPlatformRequest{value: val, isSet: true} +} + +func (v NullableNestedPlatformRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPlatformRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_panel.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_panel.go new file mode 100644 index 00000000..f54a598e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_panel.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPowerPanel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPowerPanel{} + +// NestedPowerPanel Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPowerPanel struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedPowerPanel NestedPowerPanel + +// NewNestedPowerPanel instantiates a new NestedPowerPanel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPowerPanel(id int32, url string, display string, name string) *NestedPowerPanel { + this := NestedPowerPanel{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedPowerPanelWithDefaults instantiates a new NestedPowerPanel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPowerPanelWithDefaults() *NestedPowerPanel { + this := NestedPowerPanel{} + return &this +} + +// GetId returns the Id field value +func (o *NestedPowerPanel) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPanel) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedPowerPanel) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedPowerPanel) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPanel) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedPowerPanel) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedPowerPanel) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPanel) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedPowerPanel) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedPowerPanel) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPanel) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPowerPanel) SetName(v string) { + o.Name = v +} + +func (o NestedPowerPanel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPowerPanel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPowerPanel) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPowerPanel := _NestedPowerPanel{} + + err = json.Unmarshal(data, &varNestedPowerPanel) + + if err != nil { + return err + } + + *o = NestedPowerPanel(varNestedPowerPanel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPowerPanel struct { + value *NestedPowerPanel + isSet bool +} + +func (v NullableNestedPowerPanel) Get() *NestedPowerPanel { + return v.value +} + +func (v *NullableNestedPowerPanel) Set(val *NestedPowerPanel) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPowerPanel) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPowerPanel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPowerPanel(val *NestedPowerPanel) *NullableNestedPowerPanel { + return &NullableNestedPowerPanel{value: val, isSet: true} +} + +func (v NullableNestedPowerPanel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPowerPanel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_panel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_panel_request.go new file mode 100644 index 00000000..c27adde0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_panel_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPowerPanelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPowerPanelRequest{} + +// NestedPowerPanelRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPowerPanelRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedPowerPanelRequest NestedPowerPanelRequest + +// NewNestedPowerPanelRequest instantiates a new NestedPowerPanelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPowerPanelRequest(name string) *NestedPowerPanelRequest { + this := NestedPowerPanelRequest{} + this.Name = name + return &this +} + +// NewNestedPowerPanelRequestWithDefaults instantiates a new NestedPowerPanelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPowerPanelRequestWithDefaults() *NestedPowerPanelRequest { + this := NestedPowerPanelRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedPowerPanelRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPanelRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPowerPanelRequest) SetName(v string) { + o.Name = v +} + +func (o NestedPowerPanelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPowerPanelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPowerPanelRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPowerPanelRequest := _NestedPowerPanelRequest{} + + err = json.Unmarshal(data, &varNestedPowerPanelRequest) + + if err != nil { + return err + } + + *o = NestedPowerPanelRequest(varNestedPowerPanelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPowerPanelRequest struct { + value *NestedPowerPanelRequest + isSet bool +} + +func (v NullableNestedPowerPanelRequest) Get() *NestedPowerPanelRequest { + return v.value +} + +func (v *NullableNestedPowerPanelRequest) Set(val *NestedPowerPanelRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPowerPanelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPowerPanelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPowerPanelRequest(val *NestedPowerPanelRequest) *NullableNestedPowerPanelRequest { + return &NullableNestedPowerPanelRequest{value: val, isSet: true} +} + +func (v NullableNestedPowerPanelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPowerPanelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port.go new file mode 100644 index 00000000..d89e7d31 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port.go @@ -0,0 +1,359 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPowerPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPowerPort{} + +// NestedPowerPort Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPowerPort struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Name string `json:"name"` + Cable NullableInt32 `json:"cable,omitempty"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _NestedPowerPort NestedPowerPort + +// NewNestedPowerPort instantiates a new NestedPowerPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPowerPort(id int32, url string, display string, device NestedDevice, name string, occupied bool) *NestedPowerPort { + this := NestedPowerPort{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Occupied = occupied + return &this +} + +// NewNestedPowerPortWithDefaults instantiates a new NestedPowerPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPowerPortWithDefaults() *NestedPowerPort { + this := NestedPowerPort{} + return &this +} + +// GetId returns the Id field value +func (o *NestedPowerPort) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPort) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedPowerPort) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedPowerPort) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPort) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedPowerPort) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedPowerPort) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPort) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedPowerPort) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *NestedPowerPort) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPort) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *NestedPowerPort) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetName returns the Name field value +func (o *NestedPowerPort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPowerPort) SetName(v string) { + o.Name = v +} + +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedPowerPort) GetCable() int32 { + if o == nil || IsNil(o.Cable.Get()) { + var ret int32 + return ret + } + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedPowerPort) GetCableOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// HasCable returns a boolean if a field has been set. +func (o *NestedPowerPort) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableInt32 and assigns it to the Cable field. +func (o *NestedPowerPort) SetCable(v int32) { + o.Cable.Set(&v) +} + +// SetCableNil sets the value for Cable to be an explicit nil +func (o *NestedPowerPort) SetCableNil() { + o.Cable.Set(nil) +} + +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *NestedPowerPort) UnsetCable() { + o.Cable.Unset() +} + +// GetOccupied returns the Occupied field value +func (o *NestedPowerPort) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPort) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *NestedPowerPort) SetOccupied(v bool) { + o.Occupied = v +} + +func (o NestedPowerPort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPowerPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPowerPort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPowerPort := _NestedPowerPort{} + + err = json.Unmarshal(data, &varNestedPowerPort) + + if err != nil { + return err + } + + *o = NestedPowerPort(varNestedPowerPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "cable") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPowerPort struct { + value *NestedPowerPort + isSet bool +} + +func (v NullableNestedPowerPort) Get() *NestedPowerPort { + return v.value +} + +func (v *NullableNestedPowerPort) Set(val *NestedPowerPort) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPowerPort) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPowerPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPowerPort(val *NestedPowerPort) *NullableNestedPowerPort { + return &NullableNestedPowerPort{value: val, isSet: true} +} + +func (v NullableNestedPowerPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPowerPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_request.go new file mode 100644 index 00000000..9cc727ff --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_request.go @@ -0,0 +1,214 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPowerPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPowerPortRequest{} + +// NestedPowerPortRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPowerPortRequest struct { + Name string `json:"name"` + Cable NullableInt32 `json:"cable,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedPowerPortRequest NestedPowerPortRequest + +// NewNestedPowerPortRequest instantiates a new NestedPowerPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPowerPortRequest(name string) *NestedPowerPortRequest { + this := NestedPowerPortRequest{} + this.Name = name + return &this +} + +// NewNestedPowerPortRequestWithDefaults instantiates a new NestedPowerPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPowerPortRequestWithDefaults() *NestedPowerPortRequest { + this := NestedPowerPortRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedPowerPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPowerPortRequest) SetName(v string) { + o.Name = v +} + +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedPowerPortRequest) GetCable() int32 { + if o == nil || IsNil(o.Cable.Get()) { + var ret int32 + return ret + } + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedPowerPortRequest) GetCableOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// HasCable returns a boolean if a field has been set. +func (o *NestedPowerPortRequest) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableInt32 and assigns it to the Cable field. +func (o *NestedPowerPortRequest) SetCable(v int32) { + o.Cable.Set(&v) +} + +// SetCableNil sets the value for Cable to be an explicit nil +func (o *NestedPowerPortRequest) SetCableNil() { + o.Cable.Set(nil) +} + +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *NestedPowerPortRequest) UnsetCable() { + o.Cable.Unset() +} + +func (o NestedPowerPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPowerPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPowerPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPowerPortRequest := _NestedPowerPortRequest{} + + err = json.Unmarshal(data, &varNestedPowerPortRequest) + + if err != nil { + return err + } + + *o = NestedPowerPortRequest(varNestedPowerPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "cable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPowerPortRequest struct { + value *NestedPowerPortRequest + isSet bool +} + +func (v NullableNestedPowerPortRequest) Get() *NestedPowerPortRequest { + return v.value +} + +func (v *NullableNestedPowerPortRequest) Set(val *NestedPowerPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPowerPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPowerPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPowerPortRequest(val *NestedPowerPortRequest) *NullableNestedPowerPortRequest { + return &NullableNestedPowerPortRequest{value: val, isSet: true} +} + +func (v NullableNestedPowerPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPowerPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_template.go new file mode 100644 index 00000000..c8bb54e8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_template.go @@ -0,0 +1,254 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPowerPortTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPowerPortTemplate{} + +// NestedPowerPortTemplate Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPowerPortTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedPowerPortTemplate NestedPowerPortTemplate + +// NewNestedPowerPortTemplate instantiates a new NestedPowerPortTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPowerPortTemplate(id int32, url string, display string, name string) *NestedPowerPortTemplate { + this := NestedPowerPortTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedPowerPortTemplateWithDefaults instantiates a new NestedPowerPortTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPowerPortTemplateWithDefaults() *NestedPowerPortTemplate { + this := NestedPowerPortTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *NestedPowerPortTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPortTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedPowerPortTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedPowerPortTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPortTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedPowerPortTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedPowerPortTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPortTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedPowerPortTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedPowerPortTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPortTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPowerPortTemplate) SetName(v string) { + o.Name = v +} + +func (o NestedPowerPortTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPowerPortTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPowerPortTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPowerPortTemplate := _NestedPowerPortTemplate{} + + err = json.Unmarshal(data, &varNestedPowerPortTemplate) + + if err != nil { + return err + } + + *o = NestedPowerPortTemplate(varNestedPowerPortTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPowerPortTemplate struct { + value *NestedPowerPortTemplate + isSet bool +} + +func (v NullableNestedPowerPortTemplate) Get() *NestedPowerPortTemplate { + return v.value +} + +func (v *NullableNestedPowerPortTemplate) Set(val *NestedPowerPortTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPowerPortTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPowerPortTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPowerPortTemplate(val *NestedPowerPortTemplate) *NullableNestedPowerPortTemplate { + return &NullableNestedPowerPortTemplate{value: val, isSet: true} +} + +func (v NullableNestedPowerPortTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPowerPortTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_template_request.go new file mode 100644 index 00000000..c298e347 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_power_port_template_request.go @@ -0,0 +1,167 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedPowerPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedPowerPortTemplateRequest{} + +// NestedPowerPortTemplateRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedPowerPortTemplateRequest struct { + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedPowerPortTemplateRequest NestedPowerPortTemplateRequest + +// NewNestedPowerPortTemplateRequest instantiates a new NestedPowerPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedPowerPortTemplateRequest(name string) *NestedPowerPortTemplateRequest { + this := NestedPowerPortTemplateRequest{} + this.Name = name + return &this +} + +// NewNestedPowerPortTemplateRequestWithDefaults instantiates a new NestedPowerPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedPowerPortTemplateRequestWithDefaults() *NestedPowerPortTemplateRequest { + this := NestedPowerPortTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedPowerPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedPowerPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedPowerPortTemplateRequest) SetName(v string) { + o.Name = v +} + +func (o NestedPowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedPowerPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedPowerPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedPowerPortTemplateRequest := _NestedPowerPortTemplateRequest{} + + err = json.Unmarshal(data, &varNestedPowerPortTemplateRequest) + + if err != nil { + return err + } + + *o = NestedPowerPortTemplateRequest(varNestedPowerPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedPowerPortTemplateRequest struct { + value *NestedPowerPortTemplateRequest + isSet bool +} + +func (v NullableNestedPowerPortTemplateRequest) Get() *NestedPowerPortTemplateRequest { + return v.value +} + +func (v *NullableNestedPowerPortTemplateRequest) Set(val *NestedPowerPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedPowerPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedPowerPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedPowerPortTemplateRequest(val *NestedPowerPortTemplateRequest) *NullableNestedPowerPortTemplateRequest { + return &NullableNestedPowerPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableNestedPowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedPowerPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider.go new file mode 100644 index 00000000..567fc39d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider.go @@ -0,0 +1,283 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedProvider{} + +// NestedProvider Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedProvider struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Full name of the provider + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedProvider NestedProvider + +// NewNestedProvider instantiates a new NestedProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedProvider(id int32, url string, display string, name string, slug string) *NestedProvider { + this := NestedProvider{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedProviderWithDefaults instantiates a new NestedProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedProviderWithDefaults() *NestedProvider { + this := NestedProvider{} + return &this +} + +// GetId returns the Id field value +func (o *NestedProvider) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedProvider) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedProvider) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedProvider) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedProvider) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedProvider) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedProvider) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedProvider) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedProvider) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedProvider) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedProvider) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedProvider) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedProvider) SetSlug(v string) { + o.Slug = v +} + +func (o NestedProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedProvider := _NestedProvider{} + + err = json.Unmarshal(data, &varNestedProvider) + + if err != nil { + return err + } + + *o = NestedProvider(varNestedProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedProvider struct { + value *NestedProvider + isSet bool +} + +func (v NullableNestedProvider) Get() *NestedProvider { + return v.value +} + +func (v *NullableNestedProvider) Set(val *NestedProvider) { + v.value = val + v.isSet = true +} + +func (v NullableNestedProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedProvider(val *NestedProvider) *NullableNestedProvider { + return &NullableNestedProvider{value: val, isSet: true} +} + +func (v NullableNestedProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_account.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_account.go new file mode 100644 index 00000000..71ba4fae --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_account.go @@ -0,0 +1,290 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedProviderAccount type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedProviderAccount{} + +// NestedProviderAccount Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedProviderAccount struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name *string `json:"name,omitempty"` + Account string `json:"account"` + AdditionalProperties map[string]interface{} +} + +type _NestedProviderAccount NestedProviderAccount + +// NewNestedProviderAccount instantiates a new NestedProviderAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedProviderAccount(id int32, url string, display string, account string) *NestedProviderAccount { + this := NestedProviderAccount{} + this.Id = id + this.Url = url + this.Display = display + this.Account = account + return &this +} + +// NewNestedProviderAccountWithDefaults instantiates a new NestedProviderAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedProviderAccountWithDefaults() *NestedProviderAccount { + this := NestedProviderAccount{} + return &this +} + +// GetId returns the Id field value +func (o *NestedProviderAccount) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedProviderAccount) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedProviderAccount) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedProviderAccount) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedProviderAccount) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedProviderAccount) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedProviderAccount) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedProviderAccount) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedProviderAccount) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *NestedProviderAccount) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedProviderAccount) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *NestedProviderAccount) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *NestedProviderAccount) SetName(v string) { + o.Name = &v +} + +// GetAccount returns the Account field value +func (o *NestedProviderAccount) GetAccount() string { + if o == nil { + var ret string + return ret + } + + return o.Account +} + +// GetAccountOk returns a tuple with the Account field value +// and a boolean to check if the value has been set. +func (o *NestedProviderAccount) GetAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Account, true +} + +// SetAccount sets field value +func (o *NestedProviderAccount) SetAccount(v string) { + o.Account = v +} + +func (o NestedProviderAccount) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedProviderAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["account"] = o.Account + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedProviderAccount) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "account", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedProviderAccount := _NestedProviderAccount{} + + err = json.Unmarshal(data, &varNestedProviderAccount) + + if err != nil { + return err + } + + *o = NestedProviderAccount(varNestedProviderAccount) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "account") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedProviderAccount struct { + value *NestedProviderAccount + isSet bool +} + +func (v NullableNestedProviderAccount) Get() *NestedProviderAccount { + return v.value +} + +func (v *NullableNestedProviderAccount) Set(val *NestedProviderAccount) { + v.value = val + v.isSet = true +} + +func (v NullableNestedProviderAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedProviderAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedProviderAccount(val *NestedProviderAccount) *NullableNestedProviderAccount { + return &NullableNestedProviderAccount{value: val, isSet: true} +} + +func (v NullableNestedProviderAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedProviderAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_account_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_account_request.go new file mode 100644 index 00000000..ac97f0d4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_account_request.go @@ -0,0 +1,203 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedProviderAccountRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedProviderAccountRequest{} + +// NestedProviderAccountRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedProviderAccountRequest struct { + Name *string `json:"name,omitempty"` + Account string `json:"account"` + AdditionalProperties map[string]interface{} +} + +type _NestedProviderAccountRequest NestedProviderAccountRequest + +// NewNestedProviderAccountRequest instantiates a new NestedProviderAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedProviderAccountRequest(account string) *NestedProviderAccountRequest { + this := NestedProviderAccountRequest{} + this.Account = account + return &this +} + +// NewNestedProviderAccountRequestWithDefaults instantiates a new NestedProviderAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedProviderAccountRequestWithDefaults() *NestedProviderAccountRequest { + this := NestedProviderAccountRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *NestedProviderAccountRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedProviderAccountRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *NestedProviderAccountRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *NestedProviderAccountRequest) SetName(v string) { + o.Name = &v +} + +// GetAccount returns the Account field value +func (o *NestedProviderAccountRequest) GetAccount() string { + if o == nil { + var ret string + return ret + } + + return o.Account +} + +// GetAccountOk returns a tuple with the Account field value +// and a boolean to check if the value has been set. +func (o *NestedProviderAccountRequest) GetAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Account, true +} + +// SetAccount sets field value +func (o *NestedProviderAccountRequest) SetAccount(v string) { + o.Account = v +} + +func (o NestedProviderAccountRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedProviderAccountRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["account"] = o.Account + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedProviderAccountRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "account", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedProviderAccountRequest := _NestedProviderAccountRequest{} + + err = json.Unmarshal(data, &varNestedProviderAccountRequest) + + if err != nil { + return err + } + + *o = NestedProviderAccountRequest(varNestedProviderAccountRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "account") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedProviderAccountRequest struct { + value *NestedProviderAccountRequest + isSet bool +} + +func (v NullableNestedProviderAccountRequest) Get() *NestedProviderAccountRequest { + return v.value +} + +func (v *NullableNestedProviderAccountRequest) Set(val *NestedProviderAccountRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedProviderAccountRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedProviderAccountRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedProviderAccountRequest(val *NestedProviderAccountRequest) *NullableNestedProviderAccountRequest { + return &NullableNestedProviderAccountRequest{value: val, isSet: true} +} + +func (v NullableNestedProviderAccountRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedProviderAccountRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_network.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_network.go new file mode 100644 index 00000000..5534074c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_network.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedProviderNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedProviderNetwork{} + +// NestedProviderNetwork Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedProviderNetwork struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedProviderNetwork NestedProviderNetwork + +// NewNestedProviderNetwork instantiates a new NestedProviderNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedProviderNetwork(id int32, url string, display string, name string) *NestedProviderNetwork { + this := NestedProviderNetwork{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedProviderNetworkWithDefaults instantiates a new NestedProviderNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedProviderNetworkWithDefaults() *NestedProviderNetwork { + this := NestedProviderNetwork{} + return &this +} + +// GetId returns the Id field value +func (o *NestedProviderNetwork) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedProviderNetwork) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedProviderNetwork) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedProviderNetwork) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedProviderNetwork) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedProviderNetwork) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedProviderNetwork) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedProviderNetwork) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedProviderNetwork) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedProviderNetwork) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedProviderNetwork) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedProviderNetwork) SetName(v string) { + o.Name = v +} + +func (o NestedProviderNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedProviderNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedProviderNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedProviderNetwork := _NestedProviderNetwork{} + + err = json.Unmarshal(data, &varNestedProviderNetwork) + + if err != nil { + return err + } + + *o = NestedProviderNetwork(varNestedProviderNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedProviderNetwork struct { + value *NestedProviderNetwork + isSet bool +} + +func (v NullableNestedProviderNetwork) Get() *NestedProviderNetwork { + return v.value +} + +func (v *NullableNestedProviderNetwork) Set(val *NestedProviderNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableNestedProviderNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedProviderNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedProviderNetwork(val *NestedProviderNetwork) *NullableNestedProviderNetwork { + return &NullableNestedProviderNetwork{value: val, isSet: true} +} + +func (v NullableNestedProviderNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedProviderNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_network_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_network_request.go new file mode 100644 index 00000000..ada386d7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_network_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedProviderNetworkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedProviderNetworkRequest{} + +// NestedProviderNetworkRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedProviderNetworkRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedProviderNetworkRequest NestedProviderNetworkRequest + +// NewNestedProviderNetworkRequest instantiates a new NestedProviderNetworkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedProviderNetworkRequest(name string) *NestedProviderNetworkRequest { + this := NestedProviderNetworkRequest{} + this.Name = name + return &this +} + +// NewNestedProviderNetworkRequestWithDefaults instantiates a new NestedProviderNetworkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedProviderNetworkRequestWithDefaults() *NestedProviderNetworkRequest { + this := NestedProviderNetworkRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedProviderNetworkRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedProviderNetworkRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedProviderNetworkRequest) SetName(v string) { + o.Name = v +} + +func (o NestedProviderNetworkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedProviderNetworkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedProviderNetworkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedProviderNetworkRequest := _NestedProviderNetworkRequest{} + + err = json.Unmarshal(data, &varNestedProviderNetworkRequest) + + if err != nil { + return err + } + + *o = NestedProviderNetworkRequest(varNestedProviderNetworkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedProviderNetworkRequest struct { + value *NestedProviderNetworkRequest + isSet bool +} + +func (v NullableNestedProviderNetworkRequest) Get() *NestedProviderNetworkRequest { + return v.value +} + +func (v *NullableNestedProviderNetworkRequest) Set(val *NestedProviderNetworkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedProviderNetworkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedProviderNetworkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedProviderNetworkRequest(val *NestedProviderNetworkRequest) *NullableNestedProviderNetworkRequest { + return &NullableNestedProviderNetworkRequest{value: val, isSet: true} +} + +func (v NullableNestedProviderNetworkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedProviderNetworkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_request.go new file mode 100644 index 00000000..d05d9931 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_provider_request.go @@ -0,0 +1,196 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedProviderRequest{} + +// NestedProviderRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedProviderRequest struct { + // Full name of the provider + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedProviderRequest NestedProviderRequest + +// NewNestedProviderRequest instantiates a new NestedProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedProviderRequest(name string, slug string) *NestedProviderRequest { + this := NestedProviderRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedProviderRequestWithDefaults instantiates a new NestedProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedProviderRequestWithDefaults() *NestedProviderRequest { + this := NestedProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedProviderRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedProviderRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedProviderRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedProviderRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedProviderRequest := _NestedProviderRequest{} + + err = json.Unmarshal(data, &varNestedProviderRequest) + + if err != nil { + return err + } + + *o = NestedProviderRequest(varNestedProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedProviderRequest struct { + value *NestedProviderRequest + isSet bool +} + +func (v NullableNestedProviderRequest) Get() *NestedProviderRequest { + return v.value +} + +func (v *NullableNestedProviderRequest) Set(val *NestedProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedProviderRequest(val *NestedProviderRequest) *NullableNestedProviderRequest { + return &NullableNestedProviderRequest{value: val, isSet: true} +} + +func (v NullableNestedProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack.go new file mode 100644 index 00000000..3f790e28 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRack type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRack{} + +// NestedRack Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRack struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedRack NestedRack + +// NewNestedRack instantiates a new NestedRack object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRack(id int32, url string, display string, name string) *NestedRack { + this := NestedRack{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedRackWithDefaults instantiates a new NestedRack object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRackWithDefaults() *NestedRack { + this := NestedRack{} + return &this +} + +// GetId returns the Id field value +func (o *NestedRack) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedRack) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedRack) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedRack) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedRack) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedRack) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedRack) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedRack) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedRack) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedRack) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRack) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRack) SetName(v string) { + o.Name = v +} + +func (o NestedRack) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRack) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRack) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRack := _NestedRack{} + + err = json.Unmarshal(data, &varNestedRack) + + if err != nil { + return err + } + + *o = NestedRack(varNestedRack) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRack struct { + value *NestedRack + isSet bool +} + +func (v NullableNestedRack) Get() *NestedRack { + return v.value +} + +func (v *NullableNestedRack) Set(val *NestedRack) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRack) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRack) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRack(val *NestedRack) *NullableNestedRack { + return &NullableNestedRack{value: val, isSet: true} +} + +func (v NullableNestedRack) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRack) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_request.go new file mode 100644 index 00000000..06a56c7d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRackRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRackRequest{} + +// NestedRackRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRackRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedRackRequest NestedRackRequest + +// NewNestedRackRequest instantiates a new NestedRackRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRackRequest(name string) *NestedRackRequest { + this := NestedRackRequest{} + this.Name = name + return &this +} + +// NewNestedRackRequestWithDefaults instantiates a new NestedRackRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRackRequestWithDefaults() *NestedRackRequest { + this := NestedRackRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedRackRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRackRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRackRequest) SetName(v string) { + o.Name = v +} + +func (o NestedRackRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRackRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRackRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRackRequest := _NestedRackRequest{} + + err = json.Unmarshal(data, &varNestedRackRequest) + + if err != nil { + return err + } + + *o = NestedRackRequest(varNestedRackRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRackRequest struct { + value *NestedRackRequest + isSet bool +} + +func (v NullableNestedRackRequest) Get() *NestedRackRequest { + return v.value +} + +func (v *NullableNestedRackRequest) Set(val *NestedRackRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRackRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRackRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRackRequest(val *NestedRackRequest) *NullableNestedRackRequest { + return &NullableNestedRackRequest{value: val, isSet: true} +} + +func (v NullableNestedRackRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRackRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_role.go new file mode 100644 index 00000000..9f993872 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_role.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRackRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRackRole{} + +// NestedRackRole Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRackRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedRackRole NestedRackRole + +// NewNestedRackRole instantiates a new NestedRackRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRackRole(id int32, url string, display string, name string, slug string) *NestedRackRole { + this := NestedRackRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedRackRoleWithDefaults instantiates a new NestedRackRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRackRoleWithDefaults() *NestedRackRole { + this := NestedRackRole{} + return &this +} + +// GetId returns the Id field value +func (o *NestedRackRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedRackRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedRackRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedRackRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedRackRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedRackRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedRackRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedRackRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedRackRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedRackRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRackRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRackRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRackRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRackRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRackRole) SetSlug(v string) { + o.Slug = v +} + +func (o NestedRackRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRackRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRackRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRackRole := _NestedRackRole{} + + err = json.Unmarshal(data, &varNestedRackRole) + + if err != nil { + return err + } + + *o = NestedRackRole(varNestedRackRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRackRole struct { + value *NestedRackRole + isSet bool +} + +func (v NullableNestedRackRole) Get() *NestedRackRole { + return v.value +} + +func (v *NullableNestedRackRole) Set(val *NestedRackRole) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRackRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRackRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRackRole(val *NestedRackRole) *NullableNestedRackRole { + return &NullableNestedRackRole{value: val, isSet: true} +} + +func (v NullableNestedRackRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRackRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_role_request.go new file mode 100644 index 00000000..10e6fa29 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rack_role_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRackRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRackRoleRequest{} + +// NestedRackRoleRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRackRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedRackRoleRequest NestedRackRoleRequest + +// NewNestedRackRoleRequest instantiates a new NestedRackRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRackRoleRequest(name string, slug string) *NestedRackRoleRequest { + this := NestedRackRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedRackRoleRequestWithDefaults instantiates a new NestedRackRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRackRoleRequestWithDefaults() *NestedRackRoleRequest { + this := NestedRackRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedRackRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRackRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRackRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRackRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRackRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRackRoleRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedRackRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRackRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRackRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRackRoleRequest := _NestedRackRoleRequest{} + + err = json.Unmarshal(data, &varNestedRackRoleRequest) + + if err != nil { + return err + } + + *o = NestedRackRoleRequest(varNestedRackRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRackRoleRequest struct { + value *NestedRackRoleRequest + isSet bool +} + +func (v NullableNestedRackRoleRequest) Get() *NestedRackRoleRequest { + return v.value +} + +func (v *NullableNestedRackRoleRequest) Set(val *NestedRackRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRackRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRackRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRackRoleRequest(val *NestedRackRoleRequest) *NullableNestedRackRoleRequest { + return &NullableNestedRackRoleRequest{value: val, isSet: true} +} + +func (v NullableNestedRackRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRackRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rear_port_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rear_port_template.go new file mode 100644 index 00000000..96445006 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rear_port_template.go @@ -0,0 +1,254 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRearPortTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRearPortTemplate{} + +// NestedRearPortTemplate Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRearPortTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedRearPortTemplate NestedRearPortTemplate + +// NewNestedRearPortTemplate instantiates a new NestedRearPortTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRearPortTemplate(id int32, url string, display string, name string) *NestedRearPortTemplate { + this := NestedRearPortTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedRearPortTemplateWithDefaults instantiates a new NestedRearPortTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRearPortTemplateWithDefaults() *NestedRearPortTemplate { + this := NestedRearPortTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *NestedRearPortTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedRearPortTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedRearPortTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedRearPortTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedRearPortTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedRearPortTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedRearPortTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedRearPortTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedRearPortTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedRearPortTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRearPortTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRearPortTemplate) SetName(v string) { + o.Name = v +} + +func (o NestedRearPortTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRearPortTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRearPortTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRearPortTemplate := _NestedRearPortTemplate{} + + err = json.Unmarshal(data, &varNestedRearPortTemplate) + + if err != nil { + return err + } + + *o = NestedRearPortTemplate(varNestedRearPortTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRearPortTemplate struct { + value *NestedRearPortTemplate + isSet bool +} + +func (v NullableNestedRearPortTemplate) Get() *NestedRearPortTemplate { + return v.value +} + +func (v *NullableNestedRearPortTemplate) Set(val *NestedRearPortTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRearPortTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRearPortTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRearPortTemplate(val *NestedRearPortTemplate) *NullableNestedRearPortTemplate { + return &NullableNestedRearPortTemplate{value: val, isSet: true} +} + +func (v NullableNestedRearPortTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRearPortTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rear_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rear_port_template_request.go new file mode 100644 index 00000000..93cd3196 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rear_port_template_request.go @@ -0,0 +1,167 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRearPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRearPortTemplateRequest{} + +// NestedRearPortTemplateRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRearPortTemplateRequest struct { + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedRearPortTemplateRequest NestedRearPortTemplateRequest + +// NewNestedRearPortTemplateRequest instantiates a new NestedRearPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRearPortTemplateRequest(name string) *NestedRearPortTemplateRequest { + this := NestedRearPortTemplateRequest{} + this.Name = name + return &this +} + +// NewNestedRearPortTemplateRequestWithDefaults instantiates a new NestedRearPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRearPortTemplateRequestWithDefaults() *NestedRearPortTemplateRequest { + this := NestedRearPortTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedRearPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRearPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRearPortTemplateRequest) SetName(v string) { + o.Name = v +} + +func (o NestedRearPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRearPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRearPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRearPortTemplateRequest := _NestedRearPortTemplateRequest{} + + err = json.Unmarshal(data, &varNestedRearPortTemplateRequest) + + if err != nil { + return err + } + + *o = NestedRearPortTemplateRequest(varNestedRearPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRearPortTemplateRequest struct { + value *NestedRearPortTemplateRequest + isSet bool +} + +func (v NullableNestedRearPortTemplateRequest) Get() *NestedRearPortTemplateRequest { + return v.value +} + +func (v *NullableNestedRearPortTemplateRequest) Set(val *NestedRearPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRearPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRearPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRearPortTemplateRequest(val *NestedRearPortTemplateRequest) *NullableNestedRearPortTemplateRequest { + return &NullableNestedRearPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableNestedRearPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRearPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_region.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_region.go new file mode 100644 index 00000000..4da42dd9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_region.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRegion type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRegion{} + +// NestedRegion Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRegion struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _NestedRegion NestedRegion + +// NewNestedRegion instantiates a new NestedRegion object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRegion(id int32, url string, display string, name string, slug string, depth int32) *NestedRegion { + this := NestedRegion{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Depth = depth + return &this +} + +// NewNestedRegionWithDefaults instantiates a new NestedRegion object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRegionWithDefaults() *NestedRegion { + this := NestedRegion{} + return &this +} + +// GetId returns the Id field value +func (o *NestedRegion) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedRegion) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedRegion) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedRegion) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedRegion) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedRegion) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedRegion) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedRegion) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedRegion) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedRegion) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRegion) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRegion) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRegion) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRegion) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRegion) SetSlug(v string) { + o.Slug = v +} + +// GetDepth returns the Depth field value +func (o *NestedRegion) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *NestedRegion) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *NestedRegion) SetDepth(v int32) { + o.Depth = v +} + +func (o NestedRegion) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRegion) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRegion) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRegion := _NestedRegion{} + + err = json.Unmarshal(data, &varNestedRegion) + + if err != nil { + return err + } + + *o = NestedRegion(varNestedRegion) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRegion struct { + value *NestedRegion + isSet bool +} + +func (v NullableNestedRegion) Get() *NestedRegion { + return v.value +} + +func (v *NullableNestedRegion) Set(val *NestedRegion) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRegion) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRegion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRegion(val *NestedRegion) *NullableNestedRegion { + return &NullableNestedRegion{value: val, isSet: true} +} + +func (v NullableNestedRegion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRegion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_region_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_region_request.go new file mode 100644 index 00000000..ec894a2b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_region_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRegionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRegionRequest{} + +// NestedRegionRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRegionRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedRegionRequest NestedRegionRequest + +// NewNestedRegionRequest instantiates a new NestedRegionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRegionRequest(name string, slug string) *NestedRegionRequest { + this := NestedRegionRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedRegionRequestWithDefaults instantiates a new NestedRegionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRegionRequestWithDefaults() *NestedRegionRequest { + this := NestedRegionRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedRegionRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRegionRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRegionRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRegionRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRegionRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRegionRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedRegionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRegionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRegionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRegionRequest := _NestedRegionRequest{} + + err = json.Unmarshal(data, &varNestedRegionRequest) + + if err != nil { + return err + } + + *o = NestedRegionRequest(varNestedRegionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRegionRequest struct { + value *NestedRegionRequest + isSet bool +} + +func (v NullableNestedRegionRequest) Get() *NestedRegionRequest { + return v.value +} + +func (v *NullableNestedRegionRequest) Set(val *NestedRegionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRegionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRegionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRegionRequest(val *NestedRegionRequest) *NullableNestedRegionRequest { + return &NullableNestedRegionRequest{value: val, isSet: true} +} + +func (v NullableNestedRegionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRegionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rir.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rir.go new file mode 100644 index 00000000..6325b4a1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rir.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRIR type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRIR{} + +// NestedRIR Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRIR struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedRIR NestedRIR + +// NewNestedRIR instantiates a new NestedRIR object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRIR(id int32, url string, display string, name string, slug string) *NestedRIR { + this := NestedRIR{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedRIRWithDefaults instantiates a new NestedRIR object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRIRWithDefaults() *NestedRIR { + this := NestedRIR{} + return &this +} + +// GetId returns the Id field value +func (o *NestedRIR) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedRIR) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedRIR) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedRIR) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedRIR) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedRIR) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedRIR) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedRIR) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedRIR) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedRIR) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRIR) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRIR) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRIR) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRIR) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRIR) SetSlug(v string) { + o.Slug = v +} + +func (o NestedRIR) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRIR) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRIR) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRIR := _NestedRIR{} + + err = json.Unmarshal(data, &varNestedRIR) + + if err != nil { + return err + } + + *o = NestedRIR(varNestedRIR) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRIR struct { + value *NestedRIR + isSet bool +} + +func (v NullableNestedRIR) Get() *NestedRIR { + return v.value +} + +func (v *NullableNestedRIR) Set(val *NestedRIR) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRIR) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRIR) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRIR(val *NestedRIR) *NullableNestedRIR { + return &NullableNestedRIR{value: val, isSet: true} +} + +func (v NullableNestedRIR) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRIR) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rir_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rir_request.go new file mode 100644 index 00000000..b5bf08d3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_rir_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRIRRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRIRRequest{} + +// NestedRIRRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRIRRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedRIRRequest NestedRIRRequest + +// NewNestedRIRRequest instantiates a new NestedRIRRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRIRRequest(name string, slug string) *NestedRIRRequest { + this := NestedRIRRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedRIRRequestWithDefaults instantiates a new NestedRIRRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRIRRequestWithDefaults() *NestedRIRRequest { + this := NestedRIRRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedRIRRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRIRRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRIRRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRIRRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRIRRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRIRRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedRIRRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRIRRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRIRRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRIRRequest := _NestedRIRRequest{} + + err = json.Unmarshal(data, &varNestedRIRRequest) + + if err != nil { + return err + } + + *o = NestedRIRRequest(varNestedRIRRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRIRRequest struct { + value *NestedRIRRequest + isSet bool +} + +func (v NullableNestedRIRRequest) Get() *NestedRIRRequest { + return v.value +} + +func (v *NullableNestedRIRRequest) Set(val *NestedRIRRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRIRRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRIRRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRIRRequest(val *NestedRIRRequest) *NullableNestedRIRRequest { + return &NullableNestedRIRRequest{value: val, isSet: true} +} + +func (v NullableNestedRIRRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRIRRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_role.go new file mode 100644 index 00000000..00e325ca --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_role.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRole{} + +// NestedRole Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedRole NestedRole + +// NewNestedRole instantiates a new NestedRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRole(id int32, url string, display string, name string, slug string) *NestedRole { + this := NestedRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedRoleWithDefaults instantiates a new NestedRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRoleWithDefaults() *NestedRole { + this := NestedRole{} + return &this +} + +// GetId returns the Id field value +func (o *NestedRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRole) SetSlug(v string) { + o.Slug = v +} + +func (o NestedRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRole := _NestedRole{} + + err = json.Unmarshal(data, &varNestedRole) + + if err != nil { + return err + } + + *o = NestedRole(varNestedRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRole struct { + value *NestedRole + isSet bool +} + +func (v NullableNestedRole) Get() *NestedRole { + return v.value +} + +func (v *NullableNestedRole) Set(val *NestedRole) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRole(val *NestedRole) *NullableNestedRole { + return &NullableNestedRole{value: val, isSet: true} +} + +func (v NullableNestedRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_role_request.go new file mode 100644 index 00000000..0f55fdad --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_role_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedRoleRequest{} + +// NestedRoleRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedRoleRequest NestedRoleRequest + +// NewNestedRoleRequest instantiates a new NestedRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedRoleRequest(name string, slug string) *NestedRoleRequest { + this := NestedRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedRoleRequestWithDefaults instantiates a new NestedRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedRoleRequestWithDefaults() *NestedRoleRequest { + this := NestedRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedRoleRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedRoleRequest := _NestedRoleRequest{} + + err = json.Unmarshal(data, &varNestedRoleRequest) + + if err != nil { + return err + } + + *o = NestedRoleRequest(varNestedRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedRoleRequest struct { + value *NestedRoleRequest + isSet bool +} + +func (v NullableNestedRoleRequest) Get() *NestedRoleRequest { + return v.value +} + +func (v *NullableNestedRoleRequest) Set(val *NestedRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedRoleRequest(val *NestedRoleRequest) *NullableNestedRoleRequest { + return &NullableNestedRoleRequest{value: val, isSet: true} +} + +func (v NullableNestedRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site.go new file mode 100644 index 00000000..68eec421 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site.go @@ -0,0 +1,283 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedSite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedSite{} + +// NestedSite Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedSite struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Full name of the site + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedSite NestedSite + +// NewNestedSite instantiates a new NestedSite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedSite(id int32, url string, display string, name string, slug string) *NestedSite { + this := NestedSite{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedSiteWithDefaults instantiates a new NestedSite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedSiteWithDefaults() *NestedSite { + this := NestedSite{} + return &this +} + +// GetId returns the Id field value +func (o *NestedSite) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedSite) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedSite) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedSite) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedSite) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedSite) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedSite) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedSite) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedSite) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedSite) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedSite) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedSite) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedSite) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedSite) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedSite) SetSlug(v string) { + o.Slug = v +} + +func (o NestedSite) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedSite) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedSite) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedSite := _NestedSite{} + + err = json.Unmarshal(data, &varNestedSite) + + if err != nil { + return err + } + + *o = NestedSite(varNestedSite) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedSite struct { + value *NestedSite + isSet bool +} + +func (v NullableNestedSite) Get() *NestedSite { + return v.value +} + +func (v *NullableNestedSite) Set(val *NestedSite) { + v.value = val + v.isSet = true +} + +func (v NullableNestedSite) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedSite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedSite(val *NestedSite) *NullableNestedSite { + return &NullableNestedSite{value: val, isSet: true} +} + +func (v NullableNestedSite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedSite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_group.go new file mode 100644 index 00000000..bdee1443 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_group.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedSiteGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedSiteGroup{} + +// NestedSiteGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedSiteGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _NestedSiteGroup NestedSiteGroup + +// NewNestedSiteGroup instantiates a new NestedSiteGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedSiteGroup(id int32, url string, display string, name string, slug string, depth int32) *NestedSiteGroup { + this := NestedSiteGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Depth = depth + return &this +} + +// NewNestedSiteGroupWithDefaults instantiates a new NestedSiteGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedSiteGroupWithDefaults() *NestedSiteGroup { + this := NestedSiteGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedSiteGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedSiteGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedSiteGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedSiteGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedSiteGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedSiteGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedSiteGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedSiteGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedSiteGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedSiteGroup) SetSlug(v string) { + o.Slug = v +} + +// GetDepth returns the Depth field value +func (o *NestedSiteGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *NestedSiteGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o NestedSiteGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedSiteGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedSiteGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedSiteGroup := _NestedSiteGroup{} + + err = json.Unmarshal(data, &varNestedSiteGroup) + + if err != nil { + return err + } + + *o = NestedSiteGroup(varNestedSiteGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedSiteGroup struct { + value *NestedSiteGroup + isSet bool +} + +func (v NullableNestedSiteGroup) Get() *NestedSiteGroup { + return v.value +} + +func (v *NullableNestedSiteGroup) Set(val *NestedSiteGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedSiteGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedSiteGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedSiteGroup(val *NestedSiteGroup) *NullableNestedSiteGroup { + return &NullableNestedSiteGroup{value: val, isSet: true} +} + +func (v NullableNestedSiteGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedSiteGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_group_request.go new file mode 100644 index 00000000..809f64c6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedSiteGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedSiteGroupRequest{} + +// NestedSiteGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedSiteGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedSiteGroupRequest NestedSiteGroupRequest + +// NewNestedSiteGroupRequest instantiates a new NestedSiteGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedSiteGroupRequest(name string, slug string) *NestedSiteGroupRequest { + this := NestedSiteGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedSiteGroupRequestWithDefaults instantiates a new NestedSiteGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedSiteGroupRequestWithDefaults() *NestedSiteGroupRequest { + this := NestedSiteGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedSiteGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedSiteGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedSiteGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedSiteGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedSiteGroupRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedSiteGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedSiteGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedSiteGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedSiteGroupRequest := _NestedSiteGroupRequest{} + + err = json.Unmarshal(data, &varNestedSiteGroupRequest) + + if err != nil { + return err + } + + *o = NestedSiteGroupRequest(varNestedSiteGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedSiteGroupRequest struct { + value *NestedSiteGroupRequest + isSet bool +} + +func (v NullableNestedSiteGroupRequest) Get() *NestedSiteGroupRequest { + return v.value +} + +func (v *NullableNestedSiteGroupRequest) Set(val *NestedSiteGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedSiteGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedSiteGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedSiteGroupRequest(val *NestedSiteGroupRequest) *NullableNestedSiteGroupRequest { + return &NullableNestedSiteGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedSiteGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedSiteGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_request.go new file mode 100644 index 00000000..407498ed --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_site_request.go @@ -0,0 +1,196 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedSiteRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedSiteRequest{} + +// NestedSiteRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedSiteRequest struct { + // Full name of the site + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedSiteRequest NestedSiteRequest + +// NewNestedSiteRequest instantiates a new NestedSiteRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedSiteRequest(name string, slug string) *NestedSiteRequest { + this := NestedSiteRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedSiteRequestWithDefaults instantiates a new NestedSiteRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedSiteRequestWithDefaults() *NestedSiteRequest { + this := NestedSiteRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedSiteRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedSiteRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedSiteRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedSiteRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedSiteRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedSiteRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedSiteRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedSiteRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedSiteRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedSiteRequest := _NestedSiteRequest{} + + err = json.Unmarshal(data, &varNestedSiteRequest) + + if err != nil { + return err + } + + *o = NestedSiteRequest(varNestedSiteRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedSiteRequest struct { + value *NestedSiteRequest + isSet bool +} + +func (v NullableNestedSiteRequest) Get() *NestedSiteRequest { + return v.value +} + +func (v *NullableNestedSiteRequest) Set(val *NestedSiteRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedSiteRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedSiteRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedSiteRequest(val *NestedSiteRequest) *NullableNestedSiteRequest { + return &NullableNestedSiteRequest{value: val, isSet: true} +} + +func (v NullableNestedSiteRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedSiteRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tag.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tag.go new file mode 100644 index 00000000..3103c3db --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tag.go @@ -0,0 +1,319 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTag type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTag{} + +// NestedTag Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTag struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedTag NestedTag + +// NewNestedTag instantiates a new NestedTag object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTag(id int32, url string, display string, name string, slug string) *NestedTag { + this := NestedTag{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedTagWithDefaults instantiates a new NestedTag object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTagWithDefaults() *NestedTag { + this := NestedTag{} + return &this +} + +// GetId returns the Id field value +func (o *NestedTag) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedTag) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedTag) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedTag) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedTag) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedTag) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedTag) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedTag) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedTag) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedTag) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTag) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTag) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTag) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTag) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTag) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *NestedTag) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedTag) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *NestedTag) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *NestedTag) SetColor(v string) { + o.Color = &v +} + +func (o NestedTag) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTag) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTag) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTag := _NestedTag{} + + err = json.Unmarshal(data, &varNestedTag) + + if err != nil { + return err + } + + *o = NestedTag(varNestedTag) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTag struct { + value *NestedTag + isSet bool +} + +func (v NullableNestedTag) Get() *NestedTag { + return v.value +} + +func (v *NullableNestedTag) Set(val *NestedTag) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTag) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTag) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTag(val *NestedTag) *NullableNestedTag { + return &NullableNestedTag{value: val, isSet: true} +} + +func (v NullableNestedTag) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTag) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tag_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tag_request.go new file mode 100644 index 00000000..f39f300b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tag_request.go @@ -0,0 +1,232 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTagRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTagRequest{} + +// NestedTagRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTagRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedTagRequest NestedTagRequest + +// NewNestedTagRequest instantiates a new NestedTagRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTagRequest(name string, slug string) *NestedTagRequest { + this := NestedTagRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedTagRequestWithDefaults instantiates a new NestedTagRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTagRequestWithDefaults() *NestedTagRequest { + this := NestedTagRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedTagRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTagRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTagRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTagRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTagRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTagRequest) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *NestedTagRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedTagRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *NestedTagRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *NestedTagRequest) SetColor(v string) { + o.Color = &v +} + +func (o NestedTagRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTagRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTagRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTagRequest := _NestedTagRequest{} + + err = json.Unmarshal(data, &varNestedTagRequest) + + if err != nil { + return err + } + + *o = NestedTagRequest(varNestedTagRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTagRequest struct { + value *NestedTagRequest + isSet bool +} + +func (v NullableNestedTagRequest) Get() *NestedTagRequest { + return v.value +} + +func (v *NullableNestedTagRequest) Set(val *NestedTagRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTagRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTagRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTagRequest(val *NestedTagRequest) *NullableNestedTagRequest { + return &NullableNestedTagRequest{value: val, isSet: true} +} + +func (v NullableNestedTagRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTagRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant.go new file mode 100644 index 00000000..2fa9510f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTenant type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTenant{} + +// NestedTenant Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTenant struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedTenant NestedTenant + +// NewNestedTenant instantiates a new NestedTenant object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTenant(id int32, url string, display string, name string, slug string) *NestedTenant { + this := NestedTenant{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedTenantWithDefaults instantiates a new NestedTenant object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTenantWithDefaults() *NestedTenant { + this := NestedTenant{} + return &this +} + +// GetId returns the Id field value +func (o *NestedTenant) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedTenant) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedTenant) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedTenant) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedTenant) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedTenant) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedTenant) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedTenant) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedTenant) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedTenant) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTenant) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTenant) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTenant) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTenant) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTenant) SetSlug(v string) { + o.Slug = v +} + +func (o NestedTenant) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTenant) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTenant) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTenant := _NestedTenant{} + + err = json.Unmarshal(data, &varNestedTenant) + + if err != nil { + return err + } + + *o = NestedTenant(varNestedTenant) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTenant struct { + value *NestedTenant + isSet bool +} + +func (v NullableNestedTenant) Get() *NestedTenant { + return v.value +} + +func (v *NullableNestedTenant) Set(val *NestedTenant) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTenant) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTenant) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTenant(val *NestedTenant) *NullableNestedTenant { + return &NullableNestedTenant{value: val, isSet: true} +} + +func (v NullableNestedTenant) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTenant) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_group.go new file mode 100644 index 00000000..075f5100 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_group.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTenantGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTenantGroup{} + +// NestedTenantGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTenantGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _NestedTenantGroup NestedTenantGroup + +// NewNestedTenantGroup instantiates a new NestedTenantGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTenantGroup(id int32, url string, display string, name string, slug string, depth int32) *NestedTenantGroup { + this := NestedTenantGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Depth = depth + return &this +} + +// NewNestedTenantGroupWithDefaults instantiates a new NestedTenantGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTenantGroupWithDefaults() *NestedTenantGroup { + this := NestedTenantGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedTenantGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedTenantGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedTenantGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedTenantGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedTenantGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedTenantGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedTenantGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTenantGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTenantGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTenantGroup) SetSlug(v string) { + o.Slug = v +} + +// GetDepth returns the Depth field value +func (o *NestedTenantGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *NestedTenantGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o NestedTenantGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTenantGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTenantGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTenantGroup := _NestedTenantGroup{} + + err = json.Unmarshal(data, &varNestedTenantGroup) + + if err != nil { + return err + } + + *o = NestedTenantGroup(varNestedTenantGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTenantGroup struct { + value *NestedTenantGroup + isSet bool +} + +func (v NullableNestedTenantGroup) Get() *NestedTenantGroup { + return v.value +} + +func (v *NullableNestedTenantGroup) Set(val *NestedTenantGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTenantGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTenantGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTenantGroup(val *NestedTenantGroup) *NullableNestedTenantGroup { + return &NullableNestedTenantGroup{value: val, isSet: true} +} + +func (v NullableNestedTenantGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTenantGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_group_request.go new file mode 100644 index 00000000..6fdd62cc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTenantGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTenantGroupRequest{} + +// NestedTenantGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTenantGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedTenantGroupRequest NestedTenantGroupRequest + +// NewNestedTenantGroupRequest instantiates a new NestedTenantGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTenantGroupRequest(name string, slug string) *NestedTenantGroupRequest { + this := NestedTenantGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedTenantGroupRequestWithDefaults instantiates a new NestedTenantGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTenantGroupRequestWithDefaults() *NestedTenantGroupRequest { + this := NestedTenantGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedTenantGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTenantGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTenantGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTenantGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTenantGroupRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedTenantGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTenantGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTenantGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTenantGroupRequest := _NestedTenantGroupRequest{} + + err = json.Unmarshal(data, &varNestedTenantGroupRequest) + + if err != nil { + return err + } + + *o = NestedTenantGroupRequest(varNestedTenantGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTenantGroupRequest struct { + value *NestedTenantGroupRequest + isSet bool +} + +func (v NullableNestedTenantGroupRequest) Get() *NestedTenantGroupRequest { + return v.value +} + +func (v *NullableNestedTenantGroupRequest) Set(val *NestedTenantGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTenantGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTenantGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTenantGroupRequest(val *NestedTenantGroupRequest) *NullableNestedTenantGroupRequest { + return &NullableNestedTenantGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedTenantGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTenantGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_request.go new file mode 100644 index 00000000..03d814b6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tenant_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTenantRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTenantRequest{} + +// NestedTenantRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTenantRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedTenantRequest NestedTenantRequest + +// NewNestedTenantRequest instantiates a new NestedTenantRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTenantRequest(name string, slug string) *NestedTenantRequest { + this := NestedTenantRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedTenantRequestWithDefaults instantiates a new NestedTenantRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTenantRequestWithDefaults() *NestedTenantRequest { + this := NestedTenantRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedTenantRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTenantRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTenantRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTenantRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTenantRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTenantRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedTenantRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTenantRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTenantRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTenantRequest := _NestedTenantRequest{} + + err = json.Unmarshal(data, &varNestedTenantRequest) + + if err != nil { + return err + } + + *o = NestedTenantRequest(varNestedTenantRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTenantRequest struct { + value *NestedTenantRequest + isSet bool +} + +func (v NullableNestedTenantRequest) Get() *NestedTenantRequest { + return v.value +} + +func (v *NullableNestedTenantRequest) Set(val *NestedTenantRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTenantRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTenantRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTenantRequest(val *NestedTenantRequest) *NullableNestedTenantRequest { + return &NullableNestedTenantRequest{value: val, isSet: true} +} + +func (v NullableNestedTenantRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTenantRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel.go new file mode 100644 index 00000000..f3d1755b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTunnel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTunnel{} + +// NestedTunnel Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTunnel struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedTunnel NestedTunnel + +// NewNestedTunnel instantiates a new NestedTunnel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTunnel(id int32, url string, display string, name string) *NestedTunnel { + this := NestedTunnel{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedTunnelWithDefaults instantiates a new NestedTunnel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTunnelWithDefaults() *NestedTunnel { + this := NestedTunnel{} + return &this +} + +// GetId returns the Id field value +func (o *NestedTunnel) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedTunnel) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedTunnel) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedTunnel) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedTunnel) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedTunnel) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedTunnel) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedTunnel) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedTunnel) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedTunnel) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTunnel) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTunnel) SetName(v string) { + o.Name = v +} + +func (o NestedTunnel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTunnel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTunnel) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTunnel := _NestedTunnel{} + + err = json.Unmarshal(data, &varNestedTunnel) + + if err != nil { + return err + } + + *o = NestedTunnel(varNestedTunnel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTunnel struct { + value *NestedTunnel + isSet bool +} + +func (v NullableNestedTunnel) Get() *NestedTunnel { + return v.value +} + +func (v *NullableNestedTunnel) Set(val *NestedTunnel) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTunnel) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTunnel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTunnel(val *NestedTunnel) *NullableNestedTunnel { + return &NullableNestedTunnel{value: val, isSet: true} +} + +func (v NullableNestedTunnel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTunnel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_group.go new file mode 100644 index 00000000..6bab14f3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_group.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTunnelGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTunnelGroup{} + +// NestedTunnelGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTunnelGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedTunnelGroup NestedTunnelGroup + +// NewNestedTunnelGroup instantiates a new NestedTunnelGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTunnelGroup(id int32, url string, display string, name string, slug string) *NestedTunnelGroup { + this := NestedTunnelGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedTunnelGroupWithDefaults instantiates a new NestedTunnelGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTunnelGroupWithDefaults() *NestedTunnelGroup { + this := NestedTunnelGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedTunnelGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedTunnelGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedTunnelGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedTunnelGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedTunnelGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedTunnelGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedTunnelGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTunnelGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTunnelGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTunnelGroup) SetSlug(v string) { + o.Slug = v +} + +func (o NestedTunnelGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTunnelGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTunnelGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTunnelGroup := _NestedTunnelGroup{} + + err = json.Unmarshal(data, &varNestedTunnelGroup) + + if err != nil { + return err + } + + *o = NestedTunnelGroup(varNestedTunnelGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTunnelGroup struct { + value *NestedTunnelGroup + isSet bool +} + +func (v NullableNestedTunnelGroup) Get() *NestedTunnelGroup { + return v.value +} + +func (v *NullableNestedTunnelGroup) Set(val *NestedTunnelGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTunnelGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTunnelGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTunnelGroup(val *NestedTunnelGroup) *NullableNestedTunnelGroup { + return &NullableNestedTunnelGroup{value: val, isSet: true} +} + +func (v NullableNestedTunnelGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTunnelGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_group_request.go new file mode 100644 index 00000000..1cd80a26 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTunnelGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTunnelGroupRequest{} + +// NestedTunnelGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTunnelGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedTunnelGroupRequest NestedTunnelGroupRequest + +// NewNestedTunnelGroupRequest instantiates a new NestedTunnelGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTunnelGroupRequest(name string, slug string) *NestedTunnelGroupRequest { + this := NestedTunnelGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedTunnelGroupRequestWithDefaults instantiates a new NestedTunnelGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTunnelGroupRequestWithDefaults() *NestedTunnelGroupRequest { + this := NestedTunnelGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedTunnelGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTunnelGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedTunnelGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedTunnelGroupRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedTunnelGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTunnelGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTunnelGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTunnelGroupRequest := _NestedTunnelGroupRequest{} + + err = json.Unmarshal(data, &varNestedTunnelGroupRequest) + + if err != nil { + return err + } + + *o = NestedTunnelGroupRequest(varNestedTunnelGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTunnelGroupRequest struct { + value *NestedTunnelGroupRequest + isSet bool +} + +func (v NullableNestedTunnelGroupRequest) Get() *NestedTunnelGroupRequest { + return v.value +} + +func (v *NullableNestedTunnelGroupRequest) Set(val *NestedTunnelGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTunnelGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTunnelGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTunnelGroupRequest(val *NestedTunnelGroupRequest) *NullableNestedTunnelGroupRequest { + return &NullableNestedTunnelGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedTunnelGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTunnelGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_request.go new file mode 100644 index 00000000..0ed457ba --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_tunnel_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedTunnelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedTunnelRequest{} + +// NestedTunnelRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedTunnelRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedTunnelRequest NestedTunnelRequest + +// NewNestedTunnelRequest instantiates a new NestedTunnelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedTunnelRequest(name string) *NestedTunnelRequest { + this := NestedTunnelRequest{} + this.Name = name + return &this +} + +// NewNestedTunnelRequestWithDefaults instantiates a new NestedTunnelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedTunnelRequestWithDefaults() *NestedTunnelRequest { + this := NestedTunnelRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedTunnelRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedTunnelRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedTunnelRequest) SetName(v string) { + o.Name = v +} + +func (o NestedTunnelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedTunnelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedTunnelRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedTunnelRequest := _NestedTunnelRequest{} + + err = json.Unmarshal(data, &varNestedTunnelRequest) + + if err != nil { + return err + } + + *o = NestedTunnelRequest(varNestedTunnelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedTunnelRequest struct { + value *NestedTunnelRequest + isSet bool +} + +func (v NullableNestedTunnelRequest) Get() *NestedTunnelRequest { + return v.value +} + +func (v *NullableNestedTunnelRequest) Set(val *NestedTunnelRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedTunnelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedTunnelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedTunnelRequest(val *NestedTunnelRequest) *NullableNestedTunnelRequest { + return &NullableNestedTunnelRequest{value: val, isSet: true} +} + +func (v NullableNestedTunnelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedTunnelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_user.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_user.go new file mode 100644 index 00000000..fdce1e72 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_user.go @@ -0,0 +1,254 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedUser{} + +// NestedUser Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedUser struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _NestedUser NestedUser + +// NewNestedUser instantiates a new NestedUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedUser(id int32, url string, display string, username string) *NestedUser { + this := NestedUser{} + this.Id = id + this.Url = url + this.Display = display + this.Username = username + return &this +} + +// NewNestedUserWithDefaults instantiates a new NestedUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedUserWithDefaults() *NestedUser { + this := NestedUser{} + return &this +} + +// GetId returns the Id field value +func (o *NestedUser) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedUser) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedUser) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedUser) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedUser) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedUser) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedUser) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedUser) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedUser) SetDisplay(v string) { + o.Display = v +} + +// GetUsername returns the Username field value +func (o *NestedUser) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *NestedUser) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *NestedUser) SetUsername(v string) { + o.Username = v +} + +func (o NestedUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedUser := _NestedUser{} + + err = json.Unmarshal(data, &varNestedUser) + + if err != nil { + return err + } + + *o = NestedUser(varNestedUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedUser struct { + value *NestedUser + isSet bool +} + +func (v NullableNestedUser) Get() *NestedUser { + return v.value +} + +func (v *NullableNestedUser) Set(val *NestedUser) { + v.value = val + v.isSet = true +} + +func (v NullableNestedUser) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedUser(val *NestedUser) *NullableNestedUser { + return &NullableNestedUser{value: val, isSet: true} +} + +func (v NullableNestedUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_user_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_user_request.go new file mode 100644 index 00000000..1ebc21dd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_user_request.go @@ -0,0 +1,167 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedUserRequest{} + +// NestedUserRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedUserRequest struct { + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _NestedUserRequest NestedUserRequest + +// NewNestedUserRequest instantiates a new NestedUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedUserRequest(username string) *NestedUserRequest { + this := NestedUserRequest{} + this.Username = username + return &this +} + +// NewNestedUserRequestWithDefaults instantiates a new NestedUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedUserRequestWithDefaults() *NestedUserRequest { + this := NestedUserRequest{} + return &this +} + +// GetUsername returns the Username field value +func (o *NestedUserRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *NestedUserRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *NestedUserRequest) SetUsername(v string) { + o.Username = v +} + +func (o NestedUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedUserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedUserRequest := _NestedUserRequest{} + + err = json.Unmarshal(data, &varNestedUserRequest) + + if err != nil { + return err + } + + *o = NestedUserRequest(varNestedUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedUserRequest struct { + value *NestedUserRequest + isSet bool +} + +func (v NullableNestedUserRequest) Get() *NestedUserRequest { + return v.value +} + +func (v *NullableNestedUserRequest) Set(val *NestedUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedUserRequest(val *NestedUserRequest) *NullableNestedUserRequest { + return &NullableNestedUserRequest{value: val, isSet: true} +} + +func (v NullableNestedUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_chassis.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_chassis.go new file mode 100644 index 00000000..2c8fbb20 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_chassis.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVirtualChassis type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVirtualChassis{} + +// NestedVirtualChassis Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVirtualChassis struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Master NestedDevice `json:"master"` + AdditionalProperties map[string]interface{} +} + +type _NestedVirtualChassis NestedVirtualChassis + +// NewNestedVirtualChassis instantiates a new NestedVirtualChassis object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVirtualChassis(id int32, url string, display string, name string, master NestedDevice) *NestedVirtualChassis { + this := NestedVirtualChassis{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Master = master + return &this +} + +// NewNestedVirtualChassisWithDefaults instantiates a new NestedVirtualChassis object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVirtualChassisWithDefaults() *NestedVirtualChassis { + this := NestedVirtualChassis{} + return &this +} + +// GetId returns the Id field value +func (o *NestedVirtualChassis) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualChassis) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedVirtualChassis) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedVirtualChassis) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualChassis) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedVirtualChassis) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedVirtualChassis) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualChassis) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedVirtualChassis) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedVirtualChassis) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualChassis) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVirtualChassis) SetName(v string) { + o.Name = v +} + +// GetMaster returns the Master field value +func (o *NestedVirtualChassis) GetMaster() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Master +} + +// GetMasterOk returns a tuple with the Master field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualChassis) GetMasterOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Master, true +} + +// SetMaster sets field value +func (o *NestedVirtualChassis) SetMaster(v NestedDevice) { + o.Master = v +} + +func (o NestedVirtualChassis) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVirtualChassis) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["master"] = o.Master + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVirtualChassis) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "master", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVirtualChassis := _NestedVirtualChassis{} + + err = json.Unmarshal(data, &varNestedVirtualChassis) + + if err != nil { + return err + } + + *o = NestedVirtualChassis(varNestedVirtualChassis) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "master") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVirtualChassis struct { + value *NestedVirtualChassis + isSet bool +} + +func (v NullableNestedVirtualChassis) Get() *NestedVirtualChassis { + return v.value +} + +func (v *NullableNestedVirtualChassis) Set(val *NestedVirtualChassis) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVirtualChassis) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVirtualChassis) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVirtualChassis(val *NestedVirtualChassis) *NullableNestedVirtualChassis { + return &NullableNestedVirtualChassis{value: val, isSet: true} +} + +func (v NullableNestedVirtualChassis) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVirtualChassis) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_chassis_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_chassis_request.go new file mode 100644 index 00000000..588677e1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_chassis_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVirtualChassisRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVirtualChassisRequest{} + +// NestedVirtualChassisRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVirtualChassisRequest struct { + Name string `json:"name"` + Master NestedDeviceRequest `json:"master"` + AdditionalProperties map[string]interface{} +} + +type _NestedVirtualChassisRequest NestedVirtualChassisRequest + +// NewNestedVirtualChassisRequest instantiates a new NestedVirtualChassisRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVirtualChassisRequest(name string, master NestedDeviceRequest) *NestedVirtualChassisRequest { + this := NestedVirtualChassisRequest{} + this.Name = name + this.Master = master + return &this +} + +// NewNestedVirtualChassisRequestWithDefaults instantiates a new NestedVirtualChassisRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVirtualChassisRequestWithDefaults() *NestedVirtualChassisRequest { + this := NestedVirtualChassisRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedVirtualChassisRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualChassisRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVirtualChassisRequest) SetName(v string) { + o.Name = v +} + +// GetMaster returns the Master field value +func (o *NestedVirtualChassisRequest) GetMaster() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Master +} + +// GetMasterOk returns a tuple with the Master field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualChassisRequest) GetMasterOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Master, true +} + +// SetMaster sets field value +func (o *NestedVirtualChassisRequest) SetMaster(v NestedDeviceRequest) { + o.Master = v +} + +func (o NestedVirtualChassisRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVirtualChassisRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["master"] = o.Master + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVirtualChassisRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "master", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVirtualChassisRequest := _NestedVirtualChassisRequest{} + + err = json.Unmarshal(data, &varNestedVirtualChassisRequest) + + if err != nil { + return err + } + + *o = NestedVirtualChassisRequest(varNestedVirtualChassisRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "master") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVirtualChassisRequest struct { + value *NestedVirtualChassisRequest + isSet bool +} + +func (v NullableNestedVirtualChassisRequest) Get() *NestedVirtualChassisRequest { + return v.value +} + +func (v *NullableNestedVirtualChassisRequest) Set(val *NestedVirtualChassisRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVirtualChassisRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVirtualChassisRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVirtualChassisRequest(val *NestedVirtualChassisRequest) *NullableNestedVirtualChassisRequest { + return &NullableNestedVirtualChassisRequest{value: val, isSet: true} +} + +func (v NullableNestedVirtualChassisRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVirtualChassisRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_machine.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_machine.go new file mode 100644 index 00000000..942c522a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_machine.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVirtualMachine type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVirtualMachine{} + +// NestedVirtualMachine Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVirtualMachine struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedVirtualMachine NestedVirtualMachine + +// NewNestedVirtualMachine instantiates a new NestedVirtualMachine object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVirtualMachine(id int32, url string, display string, name string) *NestedVirtualMachine { + this := NestedVirtualMachine{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedVirtualMachineWithDefaults instantiates a new NestedVirtualMachine object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVirtualMachineWithDefaults() *NestedVirtualMachine { + this := NestedVirtualMachine{} + return &this +} + +// GetId returns the Id field value +func (o *NestedVirtualMachine) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualMachine) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedVirtualMachine) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedVirtualMachine) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualMachine) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedVirtualMachine) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedVirtualMachine) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualMachine) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedVirtualMachine) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedVirtualMachine) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualMachine) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVirtualMachine) SetName(v string) { + o.Name = v +} + +func (o NestedVirtualMachine) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVirtualMachine) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVirtualMachine) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVirtualMachine := _NestedVirtualMachine{} + + err = json.Unmarshal(data, &varNestedVirtualMachine) + + if err != nil { + return err + } + + *o = NestedVirtualMachine(varNestedVirtualMachine) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVirtualMachine struct { + value *NestedVirtualMachine + isSet bool +} + +func (v NullableNestedVirtualMachine) Get() *NestedVirtualMachine { + return v.value +} + +func (v *NullableNestedVirtualMachine) Set(val *NestedVirtualMachine) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVirtualMachine) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVirtualMachine) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVirtualMachine(val *NestedVirtualMachine) *NullableNestedVirtualMachine { + return &NullableNestedVirtualMachine{value: val, isSet: true} +} + +func (v NullableNestedVirtualMachine) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVirtualMachine) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_machine_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_machine_request.go new file mode 100644 index 00000000..cacf1b02 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_virtual_machine_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVirtualMachineRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVirtualMachineRequest{} + +// NestedVirtualMachineRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVirtualMachineRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedVirtualMachineRequest NestedVirtualMachineRequest + +// NewNestedVirtualMachineRequest instantiates a new NestedVirtualMachineRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVirtualMachineRequest(name string) *NestedVirtualMachineRequest { + this := NestedVirtualMachineRequest{} + this.Name = name + return &this +} + +// NewNestedVirtualMachineRequestWithDefaults instantiates a new NestedVirtualMachineRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVirtualMachineRequestWithDefaults() *NestedVirtualMachineRequest { + this := NestedVirtualMachineRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedVirtualMachineRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVirtualMachineRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVirtualMachineRequest) SetName(v string) { + o.Name = v +} + +func (o NestedVirtualMachineRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVirtualMachineRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVirtualMachineRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVirtualMachineRequest := _NestedVirtualMachineRequest{} + + err = json.Unmarshal(data, &varNestedVirtualMachineRequest) + + if err != nil { + return err + } + + *o = NestedVirtualMachineRequest(varNestedVirtualMachineRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVirtualMachineRequest struct { + value *NestedVirtualMachineRequest + isSet bool +} + +func (v NullableNestedVirtualMachineRequest) Get() *NestedVirtualMachineRequest { + return v.value +} + +func (v *NullableNestedVirtualMachineRequest) Set(val *NestedVirtualMachineRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVirtualMachineRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVirtualMachineRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVirtualMachineRequest(val *NestedVirtualMachineRequest) *NullableNestedVirtualMachineRequest { + return &NullableNestedVirtualMachineRequest{value: val, isSet: true} +} + +func (v NullableNestedVirtualMachineRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVirtualMachineRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan.go new file mode 100644 index 00000000..0f5aeed8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan.go @@ -0,0 +1,283 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVLAN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVLAN{} + +// NestedVLAN Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVLAN struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Numeric VLAN ID (1-4094) + Vid int32 `json:"vid"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedVLAN NestedVLAN + +// NewNestedVLAN instantiates a new NestedVLAN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVLAN(id int32, url string, display string, vid int32, name string) *NestedVLAN { + this := NestedVLAN{} + this.Id = id + this.Url = url + this.Display = display + this.Vid = vid + this.Name = name + return &this +} + +// NewNestedVLANWithDefaults instantiates a new NestedVLAN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVLANWithDefaults() *NestedVLAN { + this := NestedVLAN{} + return &this +} + +// GetId returns the Id field value +func (o *NestedVLAN) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedVLAN) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedVLAN) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedVLAN) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedVLAN) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedVLAN) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedVLAN) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedVLAN) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedVLAN) SetDisplay(v string) { + o.Display = v +} + +// GetVid returns the Vid field value +func (o *NestedVLAN) GetVid() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Vid +} + +// GetVidOk returns a tuple with the Vid field value +// and a boolean to check if the value has been set. +func (o *NestedVLAN) GetVidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Vid, true +} + +// SetVid sets field value +func (o *NestedVLAN) SetVid(v int32) { + o.Vid = v +} + +// GetName returns the Name field value +func (o *NestedVLAN) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVLAN) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVLAN) SetName(v string) { + o.Name = v +} + +func (o NestedVLAN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVLAN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["vid"] = o.Vid + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVLAN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "vid", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVLAN := _NestedVLAN{} + + err = json.Unmarshal(data, &varNestedVLAN) + + if err != nil { + return err + } + + *o = NestedVLAN(varNestedVLAN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "vid") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVLAN struct { + value *NestedVLAN + isSet bool +} + +func (v NullableNestedVLAN) Get() *NestedVLAN { + return v.value +} + +func (v *NullableNestedVLAN) Set(val *NestedVLAN) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVLAN) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVLAN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVLAN(val *NestedVLAN) *NullableNestedVLAN { + return &NullableNestedVLAN{value: val, isSet: true} +} + +func (v NullableNestedVLAN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVLAN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_group.go new file mode 100644 index 00000000..082c2850 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_group.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVLANGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVLANGroup{} + +// NestedVLANGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVLANGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedVLANGroup NestedVLANGroup + +// NewNestedVLANGroup instantiates a new NestedVLANGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVLANGroup(id int32, url string, display string, name string, slug string) *NestedVLANGroup { + this := NestedVLANGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedVLANGroupWithDefaults instantiates a new NestedVLANGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVLANGroupWithDefaults() *NestedVLANGroup { + this := NestedVLANGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedVLANGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedVLANGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedVLANGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedVLANGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedVLANGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedVLANGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedVLANGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedVLANGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedVLANGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedVLANGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVLANGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVLANGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedVLANGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedVLANGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedVLANGroup) SetSlug(v string) { + o.Slug = v +} + +func (o NestedVLANGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVLANGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVLANGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVLANGroup := _NestedVLANGroup{} + + err = json.Unmarshal(data, &varNestedVLANGroup) + + if err != nil { + return err + } + + *o = NestedVLANGroup(varNestedVLANGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVLANGroup struct { + value *NestedVLANGroup + isSet bool +} + +func (v NullableNestedVLANGroup) Get() *NestedVLANGroup { + return v.value +} + +func (v *NullableNestedVLANGroup) Set(val *NestedVLANGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVLANGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVLANGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVLANGroup(val *NestedVLANGroup) *NullableNestedVLANGroup { + return &NullableNestedVLANGroup{value: val, isSet: true} +} + +func (v NullableNestedVLANGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVLANGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_group_request.go new file mode 100644 index 00000000..77f60a7c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVLANGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVLANGroupRequest{} + +// NestedVLANGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVLANGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedVLANGroupRequest NestedVLANGroupRequest + +// NewNestedVLANGroupRequest instantiates a new NestedVLANGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVLANGroupRequest(name string, slug string) *NestedVLANGroupRequest { + this := NestedVLANGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedVLANGroupRequestWithDefaults instantiates a new NestedVLANGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVLANGroupRequestWithDefaults() *NestedVLANGroupRequest { + this := NestedVLANGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedVLANGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVLANGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVLANGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedVLANGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedVLANGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedVLANGroupRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedVLANGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVLANGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVLANGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVLANGroupRequest := _NestedVLANGroupRequest{} + + err = json.Unmarshal(data, &varNestedVLANGroupRequest) + + if err != nil { + return err + } + + *o = NestedVLANGroupRequest(varNestedVLANGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVLANGroupRequest struct { + value *NestedVLANGroupRequest + isSet bool +} + +func (v NullableNestedVLANGroupRequest) Get() *NestedVLANGroupRequest { + return v.value +} + +func (v *NullableNestedVLANGroupRequest) Set(val *NestedVLANGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVLANGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVLANGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVLANGroupRequest(val *NestedVLANGroupRequest) *NullableNestedVLANGroupRequest { + return &NullableNestedVLANGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedVLANGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVLANGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_request.go new file mode 100644 index 00000000..c915f897 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vlan_request.go @@ -0,0 +1,196 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVLANRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVLANRequest{} + +// NestedVLANRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVLANRequest struct { + // Numeric VLAN ID (1-4094) + Vid int32 `json:"vid"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedVLANRequest NestedVLANRequest + +// NewNestedVLANRequest instantiates a new NestedVLANRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVLANRequest(vid int32, name string) *NestedVLANRequest { + this := NestedVLANRequest{} + this.Vid = vid + this.Name = name + return &this +} + +// NewNestedVLANRequestWithDefaults instantiates a new NestedVLANRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVLANRequestWithDefaults() *NestedVLANRequest { + this := NestedVLANRequest{} + return &this +} + +// GetVid returns the Vid field value +func (o *NestedVLANRequest) GetVid() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Vid +} + +// GetVidOk returns a tuple with the Vid field value +// and a boolean to check if the value has been set. +func (o *NestedVLANRequest) GetVidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Vid, true +} + +// SetVid sets field value +func (o *NestedVLANRequest) SetVid(v int32) { + o.Vid = v +} + +// GetName returns the Name field value +func (o *NestedVLANRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVLANRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVLANRequest) SetName(v string) { + o.Name = v +} + +func (o NestedVLANRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVLANRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["vid"] = o.Vid + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVLANRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "vid", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVLANRequest := _NestedVLANRequest{} + + err = json.Unmarshal(data, &varNestedVLANRequest) + + if err != nil { + return err + } + + *o = NestedVLANRequest(varNestedVLANRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "vid") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVLANRequest struct { + value *NestedVLANRequest + isSet bool +} + +func (v NullableNestedVLANRequest) Get() *NestedVLANRequest { + return v.value +} + +func (v *NullableNestedVLANRequest) Set(val *NestedVLANRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVLANRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVLANRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVLANRequest(val *NestedVLANRequest) *NullableNestedVLANRequest { + return &NullableNestedVLANRequest{value: val, isSet: true} +} + +func (v NullableNestedVLANRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVLANRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vm_interface.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vm_interface.go new file mode 100644 index 00000000..aede561d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vm_interface.go @@ -0,0 +1,282 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVMInterface type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVMInterface{} + +// NestedVMInterface Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVMInterface struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + VirtualMachine NestedVirtualMachine `json:"virtual_machine"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedVMInterface NestedVMInterface + +// NewNestedVMInterface instantiates a new NestedVMInterface object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVMInterface(id int32, url string, display string, virtualMachine NestedVirtualMachine, name string) *NestedVMInterface { + this := NestedVMInterface{} + this.Id = id + this.Url = url + this.Display = display + this.VirtualMachine = virtualMachine + this.Name = name + return &this +} + +// NewNestedVMInterfaceWithDefaults instantiates a new NestedVMInterface object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVMInterfaceWithDefaults() *NestedVMInterface { + this := NestedVMInterface{} + return &this +} + +// GetId returns the Id field value +func (o *NestedVMInterface) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedVMInterface) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedVMInterface) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedVMInterface) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedVMInterface) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedVMInterface) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedVMInterface) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedVMInterface) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedVMInterface) SetDisplay(v string) { + o.Display = v +} + +// GetVirtualMachine returns the VirtualMachine field value +func (o *NestedVMInterface) GetVirtualMachine() NestedVirtualMachine { + if o == nil { + var ret NestedVirtualMachine + return ret + } + + return o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value +// and a boolean to check if the value has been set. +func (o *NestedVMInterface) GetVirtualMachineOk() (*NestedVirtualMachine, bool) { + if o == nil { + return nil, false + } + return &o.VirtualMachine, true +} + +// SetVirtualMachine sets field value +func (o *NestedVMInterface) SetVirtualMachine(v NestedVirtualMachine) { + o.VirtualMachine = v +} + +// GetName returns the Name field value +func (o *NestedVMInterface) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVMInterface) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVMInterface) SetName(v string) { + o.Name = v +} + +func (o NestedVMInterface) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVMInterface) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["virtual_machine"] = o.VirtualMachine + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVMInterface) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "virtual_machine", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVMInterface := _NestedVMInterface{} + + err = json.Unmarshal(data, &varNestedVMInterface) + + if err != nil { + return err + } + + *o = NestedVMInterface(varNestedVMInterface) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVMInterface struct { + value *NestedVMInterface + isSet bool +} + +func (v NullableNestedVMInterface) Get() *NestedVMInterface { + return v.value +} + +func (v *NullableNestedVMInterface) Set(val *NestedVMInterface) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVMInterface) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVMInterface) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVMInterface(val *NestedVMInterface) *NullableNestedVMInterface { + return &NullableNestedVMInterface{value: val, isSet: true} +} + +func (v NullableNestedVMInterface) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVMInterface) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vm_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vm_interface_request.go new file mode 100644 index 00000000..1dad51c3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vm_interface_request.go @@ -0,0 +1,166 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVMInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVMInterfaceRequest{} + +// NestedVMInterfaceRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVMInterfaceRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _NestedVMInterfaceRequest NestedVMInterfaceRequest + +// NewNestedVMInterfaceRequest instantiates a new NestedVMInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVMInterfaceRequest(name string) *NestedVMInterfaceRequest { + this := NestedVMInterfaceRequest{} + this.Name = name + return &this +} + +// NewNestedVMInterfaceRequestWithDefaults instantiates a new NestedVMInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVMInterfaceRequestWithDefaults() *NestedVMInterfaceRequest { + this := NestedVMInterfaceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedVMInterfaceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVMInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVMInterfaceRequest) SetName(v string) { + o.Name = v +} + +func (o NestedVMInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVMInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVMInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVMInterfaceRequest := _NestedVMInterfaceRequest{} + + err = json.Unmarshal(data, &varNestedVMInterfaceRequest) + + if err != nil { + return err + } + + *o = NestedVMInterfaceRequest(varNestedVMInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVMInterfaceRequest struct { + value *NestedVMInterfaceRequest + isSet bool +} + +func (v NullableNestedVMInterfaceRequest) Get() *NestedVMInterfaceRequest { + return v.value +} + +func (v *NullableNestedVMInterfaceRequest) Set(val *NestedVMInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVMInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVMInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVMInterfaceRequest(val *NestedVMInterfaceRequest) *NullableNestedVMInterfaceRequest { + return &NullableNestedVMInterfaceRequest{value: val, isSet: true} +} + +func (v NullableNestedVMInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVMInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vrf.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vrf.go new file mode 100644 index 00000000..3b8566fa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vrf.go @@ -0,0 +1,302 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVRF type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVRF{} + +// NestedVRF Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVRF struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + // Unique route distinguisher (as defined in RFC 4364) + Rd NullableString `json:"rd,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedVRF NestedVRF + +// NewNestedVRF instantiates a new NestedVRF object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVRF(id int32, url string, display string, name string) *NestedVRF { + this := NestedVRF{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + return &this +} + +// NewNestedVRFWithDefaults instantiates a new NestedVRF object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVRFWithDefaults() *NestedVRF { + this := NestedVRF{} + return &this +} + +// GetId returns the Id field value +func (o *NestedVRF) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedVRF) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedVRF) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedVRF) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedVRF) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedVRF) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedVRF) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedVRF) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedVRF) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedVRF) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVRF) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVRF) SetName(v string) { + o.Name = v +} + +// GetRd returns the Rd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedVRF) GetRd() string { + if o == nil || IsNil(o.Rd.Get()) { + var ret string + return ret + } + return *o.Rd.Get() +} + +// GetRdOk returns a tuple with the Rd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedVRF) GetRdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rd.Get(), o.Rd.IsSet() +} + +// HasRd returns a boolean if a field has been set. +func (o *NestedVRF) HasRd() bool { + if o != nil && o.Rd.IsSet() { + return true + } + + return false +} + +// SetRd gets a reference to the given NullableString and assigns it to the Rd field. +func (o *NestedVRF) SetRd(v string) { + o.Rd.Set(&v) +} + +// SetRdNil sets the value for Rd to be an explicit nil +func (o *NestedVRF) SetRdNil() { + o.Rd.Set(nil) +} + +// UnsetRd ensures that no value is present for Rd, not even an explicit nil +func (o *NestedVRF) UnsetRd() { + o.Rd.Unset() +} + +func (o NestedVRF) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVRF) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if o.Rd.IsSet() { + toSerialize["rd"] = o.Rd.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVRF) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVRF := _NestedVRF{} + + err = json.Unmarshal(data, &varNestedVRF) + + if err != nil { + return err + } + + *o = NestedVRF(varNestedVRF) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "rd") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVRF struct { + value *NestedVRF + isSet bool +} + +func (v NullableNestedVRF) Get() *NestedVRF { + return v.value +} + +func (v *NullableNestedVRF) Set(val *NestedVRF) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVRF) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVRF) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVRF(val *NestedVRF) *NullableNestedVRF { + return &NullableNestedVRF{value: val, isSet: true} +} + +func (v NullableNestedVRF) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVRF) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vrf_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vrf_request.go new file mode 100644 index 00000000..aec01187 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_vrf_request.go @@ -0,0 +1,215 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedVRFRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedVRFRequest{} + +// NestedVRFRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedVRFRequest struct { + Name string `json:"name"` + // Unique route distinguisher (as defined in RFC 4364) + Rd NullableString `json:"rd,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedVRFRequest NestedVRFRequest + +// NewNestedVRFRequest instantiates a new NestedVRFRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedVRFRequest(name string) *NestedVRFRequest { + this := NestedVRFRequest{} + this.Name = name + return &this +} + +// NewNestedVRFRequestWithDefaults instantiates a new NestedVRFRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedVRFRequestWithDefaults() *NestedVRFRequest { + this := NestedVRFRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedVRFRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedVRFRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedVRFRequest) SetName(v string) { + o.Name = v +} + +// GetRd returns the Rd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NestedVRFRequest) GetRd() string { + if o == nil || IsNil(o.Rd.Get()) { + var ret string + return ret + } + return *o.Rd.Get() +} + +// GetRdOk returns a tuple with the Rd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NestedVRFRequest) GetRdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rd.Get(), o.Rd.IsSet() +} + +// HasRd returns a boolean if a field has been set. +func (o *NestedVRFRequest) HasRd() bool { + if o != nil && o.Rd.IsSet() { + return true + } + + return false +} + +// SetRd gets a reference to the given NullableString and assigns it to the Rd field. +func (o *NestedVRFRequest) SetRd(v string) { + o.Rd.Set(&v) +} + +// SetRdNil sets the value for Rd to be an explicit nil +func (o *NestedVRFRequest) SetRdNil() { + o.Rd.Set(nil) +} + +// UnsetRd ensures that no value is present for Rd, not even an explicit nil +func (o *NestedVRFRequest) UnsetRd() { + o.Rd.Unset() +} + +func (o NestedVRFRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedVRFRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Rd.IsSet() { + toSerialize["rd"] = o.Rd.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedVRFRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedVRFRequest := _NestedVRFRequest{} + + err = json.Unmarshal(data, &varNestedVRFRequest) + + if err != nil { + return err + } + + *o = NestedVRFRequest(varNestedVRFRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "rd") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedVRFRequest struct { + value *NestedVRFRequest + isSet bool +} + +func (v NullableNestedVRFRequest) Get() *NestedVRFRequest { + return v.value +} + +func (v *NullableNestedVRFRequest) Set(val *NestedVRFRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedVRFRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedVRFRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedVRFRequest(val *NestedVRFRequest) *NullableNestedVRFRequest { + return &NullableNestedVRFRequest{value: val, isSet: true} +} + +func (v NullableNestedVRFRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedVRFRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_lan_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_lan_group.go new file mode 100644 index 00000000..992cec3b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_lan_group.go @@ -0,0 +1,311 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedWirelessLANGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedWirelessLANGroup{} + +// NestedWirelessLANGroup Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedWirelessLANGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _NestedWirelessLANGroup NestedWirelessLANGroup + +// NewNestedWirelessLANGroup instantiates a new NestedWirelessLANGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedWirelessLANGroup(id int32, url string, display string, name string, slug string, depth int32) *NestedWirelessLANGroup { + this := NestedWirelessLANGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Depth = depth + return &this +} + +// NewNestedWirelessLANGroupWithDefaults instantiates a new NestedWirelessLANGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedWirelessLANGroupWithDefaults() *NestedWirelessLANGroup { + this := NestedWirelessLANGroup{} + return &this +} + +// GetId returns the Id field value +func (o *NestedWirelessLANGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedWirelessLANGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedWirelessLANGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedWirelessLANGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedWirelessLANGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedWirelessLANGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *NestedWirelessLANGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedWirelessLANGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedWirelessLANGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedWirelessLANGroup) SetSlug(v string) { + o.Slug = v +} + +// GetDepth returns the Depth field value +func (o *NestedWirelessLANGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *NestedWirelessLANGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o NestedWirelessLANGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedWirelessLANGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedWirelessLANGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedWirelessLANGroup := _NestedWirelessLANGroup{} + + err = json.Unmarshal(data, &varNestedWirelessLANGroup) + + if err != nil { + return err + } + + *o = NestedWirelessLANGroup(varNestedWirelessLANGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedWirelessLANGroup struct { + value *NestedWirelessLANGroup + isSet bool +} + +func (v NullableNestedWirelessLANGroup) Get() *NestedWirelessLANGroup { + return v.value +} + +func (v *NullableNestedWirelessLANGroup) Set(val *NestedWirelessLANGroup) { + v.value = val + v.isSet = true +} + +func (v NullableNestedWirelessLANGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedWirelessLANGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedWirelessLANGroup(val *NestedWirelessLANGroup) *NullableNestedWirelessLANGroup { + return &NullableNestedWirelessLANGroup{value: val, isSet: true} +} + +func (v NullableNestedWirelessLANGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedWirelessLANGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_lan_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_lan_group_request.go new file mode 100644 index 00000000..3a4656e9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_lan_group_request.go @@ -0,0 +1,195 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedWirelessLANGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedWirelessLANGroupRequest{} + +// NestedWirelessLANGroupRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedWirelessLANGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _NestedWirelessLANGroupRequest NestedWirelessLANGroupRequest + +// NewNestedWirelessLANGroupRequest instantiates a new NestedWirelessLANGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedWirelessLANGroupRequest(name string, slug string) *NestedWirelessLANGroupRequest { + this := NestedWirelessLANGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewNestedWirelessLANGroupRequestWithDefaults instantiates a new NestedWirelessLANGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedWirelessLANGroupRequestWithDefaults() *NestedWirelessLANGroupRequest { + this := NestedWirelessLANGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NestedWirelessLANGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NestedWirelessLANGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *NestedWirelessLANGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLANGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *NestedWirelessLANGroupRequest) SetSlug(v string) { + o.Slug = v +} + +func (o NestedWirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedWirelessLANGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedWirelessLANGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedWirelessLANGroupRequest := _NestedWirelessLANGroupRequest{} + + err = json.Unmarshal(data, &varNestedWirelessLANGroupRequest) + + if err != nil { + return err + } + + *o = NestedWirelessLANGroupRequest(varNestedWirelessLANGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedWirelessLANGroupRequest struct { + value *NestedWirelessLANGroupRequest + isSet bool +} + +func (v NullableNestedWirelessLANGroupRequest) Get() *NestedWirelessLANGroupRequest { + return v.value +} + +func (v *NullableNestedWirelessLANGroupRequest) Set(val *NestedWirelessLANGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedWirelessLANGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedWirelessLANGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedWirelessLANGroupRequest(val *NestedWirelessLANGroupRequest) *NullableNestedWirelessLANGroupRequest { + return &NullableNestedWirelessLANGroupRequest{value: val, isSet: true} +} + +func (v NullableNestedWirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedWirelessLANGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_link.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_link.go new file mode 100644 index 00000000..793ae0a1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_link.go @@ -0,0 +1,261 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedWirelessLink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedWirelessLink{} + +// NestedWirelessLink Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedWirelessLink struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Ssid *string `json:"ssid,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedWirelessLink NestedWirelessLink + +// NewNestedWirelessLink instantiates a new NestedWirelessLink object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedWirelessLink(id int32, url string, display string) *NestedWirelessLink { + this := NestedWirelessLink{} + this.Id = id + this.Url = url + this.Display = display + return &this +} + +// NewNestedWirelessLinkWithDefaults instantiates a new NestedWirelessLink object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedWirelessLinkWithDefaults() *NestedWirelessLink { + this := NestedWirelessLink{} + return &this +} + +// GetId returns the Id field value +func (o *NestedWirelessLink) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLink) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedWirelessLink) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedWirelessLink) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLink) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedWirelessLink) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedWirelessLink) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedWirelessLink) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedWirelessLink) SetDisplay(v string) { + o.Display = v +} + +// GetSsid returns the Ssid field value if set, zero value otherwise. +func (o *NestedWirelessLink) GetSsid() string { + if o == nil || IsNil(o.Ssid) { + var ret string + return ret + } + return *o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedWirelessLink) GetSsidOk() (*string, bool) { + if o == nil || IsNil(o.Ssid) { + return nil, false + } + return o.Ssid, true +} + +// HasSsid returns a boolean if a field has been set. +func (o *NestedWirelessLink) HasSsid() bool { + if o != nil && !IsNil(o.Ssid) { + return true + } + + return false +} + +// SetSsid gets a reference to the given string and assigns it to the Ssid field. +func (o *NestedWirelessLink) SetSsid(v string) { + o.Ssid = &v +} + +func (o NestedWirelessLink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedWirelessLink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if !IsNil(o.Ssid) { + toSerialize["ssid"] = o.Ssid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedWirelessLink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedWirelessLink := _NestedWirelessLink{} + + err = json.Unmarshal(data, &varNestedWirelessLink) + + if err != nil { + return err + } + + *o = NestedWirelessLink(varNestedWirelessLink) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "ssid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedWirelessLink struct { + value *NestedWirelessLink + isSet bool +} + +func (v NullableNestedWirelessLink) Get() *NestedWirelessLink { + return v.value +} + +func (v *NullableNestedWirelessLink) Set(val *NestedWirelessLink) { + v.value = val + v.isSet = true +} + +func (v NullableNestedWirelessLink) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedWirelessLink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedWirelessLink(val *NestedWirelessLink) *NullableNestedWirelessLink { + return &NullableNestedWirelessLink{value: val, isSet: true} +} + +func (v NullableNestedWirelessLink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedWirelessLink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_link_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_link_request.go new file mode 100644 index 00000000..46de1385 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_nested_wireless_link_request.go @@ -0,0 +1,153 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the NestedWirelessLinkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedWirelessLinkRequest{} + +// NestedWirelessLinkRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedWirelessLinkRequest struct { + Ssid *string `json:"ssid,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NestedWirelessLinkRequest NestedWirelessLinkRequest + +// NewNestedWirelessLinkRequest instantiates a new NestedWirelessLinkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedWirelessLinkRequest() *NestedWirelessLinkRequest { + this := NestedWirelessLinkRequest{} + return &this +} + +// NewNestedWirelessLinkRequestWithDefaults instantiates a new NestedWirelessLinkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedWirelessLinkRequestWithDefaults() *NestedWirelessLinkRequest { + this := NestedWirelessLinkRequest{} + return &this +} + +// GetSsid returns the Ssid field value if set, zero value otherwise. +func (o *NestedWirelessLinkRequest) GetSsid() string { + if o == nil || IsNil(o.Ssid) { + var ret string + return ret + } + return *o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NestedWirelessLinkRequest) GetSsidOk() (*string, bool) { + if o == nil || IsNil(o.Ssid) { + return nil, false + } + return o.Ssid, true +} + +// HasSsid returns a boolean if a field has been set. +func (o *NestedWirelessLinkRequest) HasSsid() bool { + if o != nil && !IsNil(o.Ssid) { + return true + } + + return false +} + +// SetSsid gets a reference to the given string and assigns it to the Ssid field. +func (o *NestedWirelessLinkRequest) SetSsid(v string) { + o.Ssid = &v +} + +func (o NestedWirelessLinkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedWirelessLinkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ssid) { + toSerialize["ssid"] = o.Ssid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedWirelessLinkRequest) UnmarshalJSON(data []byte) (err error) { + varNestedWirelessLinkRequest := _NestedWirelessLinkRequest{} + + err = json.Unmarshal(data, &varNestedWirelessLinkRequest) + + if err != nil { + return err + } + + *o = NestedWirelessLinkRequest(varNestedWirelessLinkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "ssid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedWirelessLinkRequest struct { + value *NestedWirelessLinkRequest + isSet bool +} + +func (v NullableNestedWirelessLinkRequest) Get() *NestedWirelessLinkRequest { + return v.value +} + +func (v *NullableNestedWirelessLinkRequest) Set(val *NestedWirelessLinkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNestedWirelessLinkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedWirelessLinkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedWirelessLinkRequest(val *NestedWirelessLinkRequest) *NullableNestedWirelessLinkRequest { + return &NullableNestedWirelessLinkRequest{value: val, isSet: true} +} + +func (v NullableNestedWirelessLinkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedWirelessLinkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_object_change.go b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change.go new file mode 100644 index 00000000..90f1b952 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change.go @@ -0,0 +1,527 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ObjectChange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ObjectChange{} + +// ObjectChange struct for ObjectChange +type ObjectChange struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Time time.Time `json:"time"` + User NestedUser `json:"user"` + UserName string `json:"user_name"` + RequestId string `json:"request_id"` + Action ObjectChangeAction `json:"action"` + ChangedObjectType string `json:"changed_object_type"` + ChangedObjectId int64 `json:"changed_object_id"` + ChangedObject interface{} `json:"changed_object"` + PrechangeData interface{} `json:"prechange_data"` + PostchangeData interface{} `json:"postchange_data"` + AdditionalProperties map[string]interface{} +} + +type _ObjectChange ObjectChange + +// NewObjectChange instantiates a new ObjectChange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewObjectChange(id int32, url string, display string, time time.Time, user NestedUser, userName string, requestId string, action ObjectChangeAction, changedObjectType string, changedObjectId int64, changedObject interface{}, prechangeData interface{}, postchangeData interface{}) *ObjectChange { + this := ObjectChange{} + this.Id = id + this.Url = url + this.Display = display + this.Time = time + this.User = user + this.UserName = userName + this.RequestId = requestId + this.Action = action + this.ChangedObjectType = changedObjectType + this.ChangedObjectId = changedObjectId + this.ChangedObject = changedObject + this.PrechangeData = prechangeData + this.PostchangeData = postchangeData + return &this +} + +// NewObjectChangeWithDefaults instantiates a new ObjectChange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewObjectChangeWithDefaults() *ObjectChange { + this := ObjectChange{} + return &this +} + +// GetId returns the Id field value +func (o *ObjectChange) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ObjectChange) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ObjectChange) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ObjectChange) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ObjectChange) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ObjectChange) SetDisplay(v string) { + o.Display = v +} + +// GetTime returns the Time field value +func (o *ObjectChange) GetTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Time +} + +// GetTimeOk returns a tuple with the Time field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Time, true +} + +// SetTime sets field value +func (o *ObjectChange) SetTime(v time.Time) { + o.Time = v +} + +// GetUser returns the User field value +func (o *ObjectChange) GetUser() NestedUser { + if o == nil { + var ret NestedUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetUserOk() (*NestedUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *ObjectChange) SetUser(v NestedUser) { + o.User = v +} + +// GetUserName returns the UserName field value +func (o *ObjectChange) GetUserName() string { + if o == nil { + var ret string + return ret + } + + return o.UserName +} + +// GetUserNameOk returns a tuple with the UserName field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetUserNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserName, true +} + +// SetUserName sets field value +func (o *ObjectChange) SetUserName(v string) { + o.UserName = v +} + +// GetRequestId returns the RequestId field value +func (o *ObjectChange) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *ObjectChange) SetRequestId(v string) { + o.RequestId = v +} + +// GetAction returns the Action field value +func (o *ObjectChange) GetAction() ObjectChangeAction { + if o == nil { + var ret ObjectChangeAction + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetActionOk() (*ObjectChangeAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *ObjectChange) SetAction(v ObjectChangeAction) { + o.Action = v +} + +// GetChangedObjectType returns the ChangedObjectType field value +func (o *ObjectChange) GetChangedObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ChangedObjectType +} + +// GetChangedObjectTypeOk returns a tuple with the ChangedObjectType field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetChangedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChangedObjectType, true +} + +// SetChangedObjectType sets field value +func (o *ObjectChange) SetChangedObjectType(v string) { + o.ChangedObjectType = v +} + +// GetChangedObjectId returns the ChangedObjectId field value +func (o *ObjectChange) GetChangedObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ChangedObjectId +} + +// GetChangedObjectIdOk returns a tuple with the ChangedObjectId field value +// and a boolean to check if the value has been set. +func (o *ObjectChange) GetChangedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ChangedObjectId, true +} + +// SetChangedObjectId sets field value +func (o *ObjectChange) SetChangedObjectId(v int64) { + o.ChangedObjectId = v +} + +// GetChangedObject returns the ChangedObject field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ObjectChange) GetChangedObject() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.ChangedObject +} + +// GetChangedObjectOk returns a tuple with the ChangedObject field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ObjectChange) GetChangedObjectOk() (*interface{}, bool) { + if o == nil || IsNil(o.ChangedObject) { + return nil, false + } + return &o.ChangedObject, true +} + +// SetChangedObject sets field value +func (o *ObjectChange) SetChangedObject(v interface{}) { + o.ChangedObject = v +} + +// GetPrechangeData returns the PrechangeData field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ObjectChange) GetPrechangeData() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.PrechangeData +} + +// GetPrechangeDataOk returns a tuple with the PrechangeData field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ObjectChange) GetPrechangeDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.PrechangeData) { + return nil, false + } + return &o.PrechangeData, true +} + +// SetPrechangeData sets field value +func (o *ObjectChange) SetPrechangeData(v interface{}) { + o.PrechangeData = v +} + +// GetPostchangeData returns the PostchangeData field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ObjectChange) GetPostchangeData() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.PostchangeData +} + +// GetPostchangeDataOk returns a tuple with the PostchangeData field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ObjectChange) GetPostchangeDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.PostchangeData) { + return nil, false + } + return &o.PostchangeData, true +} + +// SetPostchangeData sets field value +func (o *ObjectChange) SetPostchangeData(v interface{}) { + o.PostchangeData = v +} + +func (o ObjectChange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ObjectChange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["time"] = o.Time + toSerialize["user"] = o.User + toSerialize["user_name"] = o.UserName + toSerialize["request_id"] = o.RequestId + toSerialize["action"] = o.Action + toSerialize["changed_object_type"] = o.ChangedObjectType + toSerialize["changed_object_id"] = o.ChangedObjectId + if o.ChangedObject != nil { + toSerialize["changed_object"] = o.ChangedObject + } + if o.PrechangeData != nil { + toSerialize["prechange_data"] = o.PrechangeData + } + if o.PostchangeData != nil { + toSerialize["postchange_data"] = o.PostchangeData + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ObjectChange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "time", + "user", + "user_name", + "request_id", + "action", + "changed_object_type", + "changed_object_id", + "changed_object", + "prechange_data", + "postchange_data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varObjectChange := _ObjectChange{} + + err = json.Unmarshal(data, &varObjectChange) + + if err != nil { + return err + } + + *o = ObjectChange(varObjectChange) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "time") + delete(additionalProperties, "user") + delete(additionalProperties, "user_name") + delete(additionalProperties, "request_id") + delete(additionalProperties, "action") + delete(additionalProperties, "changed_object_type") + delete(additionalProperties, "changed_object_id") + delete(additionalProperties, "changed_object") + delete(additionalProperties, "prechange_data") + delete(additionalProperties, "postchange_data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableObjectChange struct { + value *ObjectChange + isSet bool +} + +func (v NullableObjectChange) Get() *ObjectChange { + return v.value +} + +func (v *NullableObjectChange) Set(val *ObjectChange) { + v.value = val + v.isSet = true +} + +func (v NullableObjectChange) IsSet() bool { + return v.isSet +} + +func (v *NullableObjectChange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableObjectChange(val *ObjectChange) *NullableObjectChange { + return &NullableObjectChange{value: val, isSet: true} +} + +func (v NullableObjectChange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableObjectChange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action.go b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action.go new file mode 100644 index 00000000..d5efbd3d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ObjectChangeAction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ObjectChangeAction{} + +// ObjectChangeAction struct for ObjectChangeAction +type ObjectChangeAction struct { + Value *ObjectChangeActionValue `json:"value,omitempty"` + Label *ObjectChangeActionLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ObjectChangeAction ObjectChangeAction + +// NewObjectChangeAction instantiates a new ObjectChangeAction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewObjectChangeAction() *ObjectChangeAction { + this := ObjectChangeAction{} + return &this +} + +// NewObjectChangeActionWithDefaults instantiates a new ObjectChangeAction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewObjectChangeActionWithDefaults() *ObjectChangeAction { + this := ObjectChangeAction{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ObjectChangeAction) GetValue() ObjectChangeActionValue { + if o == nil || IsNil(o.Value) { + var ret ObjectChangeActionValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectChangeAction) GetValueOk() (*ObjectChangeActionValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ObjectChangeAction) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given ObjectChangeActionValue and assigns it to the Value field. +func (o *ObjectChangeAction) SetValue(v ObjectChangeActionValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ObjectChangeAction) GetLabel() ObjectChangeActionLabel { + if o == nil || IsNil(o.Label) { + var ret ObjectChangeActionLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectChangeAction) GetLabelOk() (*ObjectChangeActionLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ObjectChangeAction) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given ObjectChangeActionLabel and assigns it to the Label field. +func (o *ObjectChangeAction) SetLabel(v ObjectChangeActionLabel) { + o.Label = &v +} + +func (o ObjectChangeAction) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ObjectChangeAction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ObjectChangeAction) UnmarshalJSON(data []byte) (err error) { + varObjectChangeAction := _ObjectChangeAction{} + + err = json.Unmarshal(data, &varObjectChangeAction) + + if err != nil { + return err + } + + *o = ObjectChangeAction(varObjectChangeAction) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableObjectChangeAction struct { + value *ObjectChangeAction + isSet bool +} + +func (v NullableObjectChangeAction) Get() *ObjectChangeAction { + return v.value +} + +func (v *NullableObjectChangeAction) Set(val *ObjectChangeAction) { + v.value = val + v.isSet = true +} + +func (v NullableObjectChangeAction) IsSet() bool { + return v.isSet +} + +func (v *NullableObjectChangeAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableObjectChangeAction(val *ObjectChangeAction) *NullableObjectChangeAction { + return &NullableObjectChangeAction{value: val, isSet: true} +} + +func (v NullableObjectChangeAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableObjectChangeAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action_label.go new file mode 100644 index 00000000..12d8083d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ObjectChangeActionLabel the model 'ObjectChangeActionLabel' +type ObjectChangeActionLabel string + +// List of ObjectChange_action_label +const ( + OBJECTCHANGEACTIONLABEL_CREATED ObjectChangeActionLabel = "Created" + OBJECTCHANGEACTIONLABEL_UPDATED ObjectChangeActionLabel = "Updated" + OBJECTCHANGEACTIONLABEL_DELETED ObjectChangeActionLabel = "Deleted" +) + +// All allowed values of ObjectChangeActionLabel enum +var AllowedObjectChangeActionLabelEnumValues = []ObjectChangeActionLabel{ + "Created", + "Updated", + "Deleted", +} + +func (v *ObjectChangeActionLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ObjectChangeActionLabel(value) + for _, existing := range AllowedObjectChangeActionLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ObjectChangeActionLabel", value) +} + +// NewObjectChangeActionLabelFromValue returns a pointer to a valid ObjectChangeActionLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewObjectChangeActionLabelFromValue(v string) (*ObjectChangeActionLabel, error) { + ev := ObjectChangeActionLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ObjectChangeActionLabel: valid values are %v", v, AllowedObjectChangeActionLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ObjectChangeActionLabel) IsValid() bool { + for _, existing := range AllowedObjectChangeActionLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObjectChange_action_label value +func (v ObjectChangeActionLabel) Ptr() *ObjectChangeActionLabel { + return &v +} + +type NullableObjectChangeActionLabel struct { + value *ObjectChangeActionLabel + isSet bool +} + +func (v NullableObjectChangeActionLabel) Get() *ObjectChangeActionLabel { + return v.value +} + +func (v *NullableObjectChangeActionLabel) Set(val *ObjectChangeActionLabel) { + v.value = val + v.isSet = true +} + +func (v NullableObjectChangeActionLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableObjectChangeActionLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableObjectChangeActionLabel(val *ObjectChangeActionLabel) *NullableObjectChangeActionLabel { + return &NullableObjectChangeActionLabel{value: val, isSet: true} +} + +func (v NullableObjectChangeActionLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableObjectChangeActionLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action_value.go new file mode 100644 index 00000000..2376c0ac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_object_change_action_value.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ObjectChangeActionValue * `create` - Created * `update` - Updated * `delete` - Deleted +type ObjectChangeActionValue string + +// List of ObjectChange_action_value +const ( + OBJECTCHANGEACTIONVALUE_CREATE ObjectChangeActionValue = "create" + OBJECTCHANGEACTIONVALUE_UPDATE ObjectChangeActionValue = "update" + OBJECTCHANGEACTIONVALUE_DELETE ObjectChangeActionValue = "delete" +) + +// All allowed values of ObjectChangeActionValue enum +var AllowedObjectChangeActionValueEnumValues = []ObjectChangeActionValue{ + "create", + "update", + "delete", +} + +func (v *ObjectChangeActionValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ObjectChangeActionValue(value) + for _, existing := range AllowedObjectChangeActionValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ObjectChangeActionValue", value) +} + +// NewObjectChangeActionValueFromValue returns a pointer to a valid ObjectChangeActionValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewObjectChangeActionValueFromValue(v string) (*ObjectChangeActionValue, error) { + ev := ObjectChangeActionValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ObjectChangeActionValue: valid values are %v", v, AllowedObjectChangeActionValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ObjectChangeActionValue) IsValid() bool { + for _, existing := range AllowedObjectChangeActionValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObjectChange_action_value value +func (v ObjectChangeActionValue) Ptr() *ObjectChangeActionValue { + return &v +} + +type NullableObjectChangeActionValue struct { + value *ObjectChangeActionValue + isSet bool +} + +func (v NullableObjectChangeActionValue) Get() *ObjectChangeActionValue { + return v.value +} + +func (v *NullableObjectChangeActionValue) Set(val *ObjectChangeActionValue) { + v.value = val + v.isSet = true +} + +func (v NullableObjectChangeActionValue) IsSet() bool { + return v.isSet +} + +func (v *NullableObjectChangeActionValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableObjectChangeActionValue(val *ObjectChangeActionValue) *NullableObjectChangeActionValue { + return &NullableObjectChangeActionValue{value: val, isSet: true} +} + +func (v NullableObjectChangeActionValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableObjectChangeActionValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_object_permission.go b/vendor/github.com/netbox-community/go-netbox/v3/model_object_permission.go new file mode 100644 index 00000000..6a8add2a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_object_permission.go @@ -0,0 +1,499 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ObjectPermission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ObjectPermission{} + +// ObjectPermission Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ObjectPermission struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ObjectTypes []string `json:"object_types"` + Groups []int32 `json:"groups,omitempty"` + Users []int32 `json:"users,omitempty"` + // The list of actions granted by this permission + Actions []string `json:"actions"` + // Queryset filter matching the applicable objects of the selected type(s) + Constraints interface{} `json:"constraints,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ObjectPermission ObjectPermission + +// NewObjectPermission instantiates a new ObjectPermission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewObjectPermission(id int32, url string, display string, name string, objectTypes []string, actions []string) *ObjectPermission { + this := ObjectPermission{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.ObjectTypes = objectTypes + this.Actions = actions + return &this +} + +// NewObjectPermissionWithDefaults instantiates a new ObjectPermission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewObjectPermissionWithDefaults() *ObjectPermission { + this := ObjectPermission{} + return &this +} + +// GetId returns the Id field value +func (o *ObjectPermission) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ObjectPermission) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ObjectPermission) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ObjectPermission) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ObjectPermission) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ObjectPermission) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ObjectPermission) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ObjectPermission) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ObjectPermission) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ObjectPermission) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ObjectPermission) SetDescription(v string) { + o.Description = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *ObjectPermission) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *ObjectPermission) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *ObjectPermission) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetObjectTypes returns the ObjectTypes field value +func (o *ObjectPermission) GetObjectTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ObjectTypes +} + +// GetObjectTypesOk returns a tuple with the ObjectTypes field value +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetObjectTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ObjectTypes, true +} + +// SetObjectTypes sets field value +func (o *ObjectPermission) SetObjectTypes(v []string) { + o.ObjectTypes = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *ObjectPermission) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *ObjectPermission) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *ObjectPermission) SetGroups(v []int32) { + o.Groups = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *ObjectPermission) GetUsers() []int32 { + if o == nil || IsNil(o.Users) { + var ret []int32 + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetUsersOk() ([]int32, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *ObjectPermission) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []int32 and assigns it to the Users field. +func (o *ObjectPermission) SetUsers(v []int32) { + o.Users = v +} + +// GetActions returns the Actions field value +func (o *ObjectPermission) GetActions() []string { + if o == nil { + var ret []string + return ret + } + + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value +// and a boolean to check if the value has been set. +func (o *ObjectPermission) GetActionsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Actions, true +} + +// SetActions sets field value +func (o *ObjectPermission) SetActions(v []string) { + o.Actions = v +} + +// GetConstraints returns the Constraints field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ObjectPermission) GetConstraints() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Constraints +} + +// GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ObjectPermission) GetConstraintsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Constraints) { + return nil, false + } + return &o.Constraints, true +} + +// HasConstraints returns a boolean if a field has been set. +func (o *ObjectPermission) HasConstraints() bool { + if o != nil && IsNil(o.Constraints) { + return true + } + + return false +} + +// SetConstraints gets a reference to the given interface{} and assigns it to the Constraints field. +func (o *ObjectPermission) SetConstraints(v interface{}) { + o.Constraints = v +} + +func (o ObjectPermission) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ObjectPermission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["object_types"] = o.ObjectTypes + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + toSerialize["actions"] = o.Actions + if o.Constraints != nil { + toSerialize["constraints"] = o.Constraints + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ObjectPermission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "object_types", + "actions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varObjectPermission := _ObjectPermission{} + + err = json.Unmarshal(data, &varObjectPermission) + + if err != nil { + return err + } + + *o = ObjectPermission(varObjectPermission) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "enabled") + delete(additionalProperties, "object_types") + delete(additionalProperties, "groups") + delete(additionalProperties, "users") + delete(additionalProperties, "actions") + delete(additionalProperties, "constraints") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableObjectPermission struct { + value *ObjectPermission + isSet bool +} + +func (v NullableObjectPermission) Get() *ObjectPermission { + return v.value +} + +func (v *NullableObjectPermission) Set(val *ObjectPermission) { + v.value = val + v.isSet = true +} + +func (v NullableObjectPermission) IsSet() bool { + return v.isSet +} + +func (v *NullableObjectPermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableObjectPermission(val *ObjectPermission) *NullableObjectPermission { + return &NullableObjectPermission{value: val, isSet: true} +} + +func (v NullableObjectPermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableObjectPermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_object_permission_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_object_permission_request.go new file mode 100644 index 00000000..b3b3a4a1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_object_permission_request.go @@ -0,0 +1,412 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ObjectPermissionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ObjectPermissionRequest{} + +// ObjectPermissionRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type ObjectPermissionRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ObjectTypes []string `json:"object_types"` + Groups []int32 `json:"groups,omitempty"` + Users []int32 `json:"users,omitempty"` + // The list of actions granted by this permission + Actions []string `json:"actions"` + // Queryset filter matching the applicable objects of the selected type(s) + Constraints interface{} `json:"constraints,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ObjectPermissionRequest ObjectPermissionRequest + +// NewObjectPermissionRequest instantiates a new ObjectPermissionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewObjectPermissionRequest(name string, objectTypes []string, actions []string) *ObjectPermissionRequest { + this := ObjectPermissionRequest{} + this.Name = name + this.ObjectTypes = objectTypes + this.Actions = actions + return &this +} + +// NewObjectPermissionRequestWithDefaults instantiates a new ObjectPermissionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewObjectPermissionRequestWithDefaults() *ObjectPermissionRequest { + this := ObjectPermissionRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ObjectPermissionRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ObjectPermissionRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ObjectPermissionRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ObjectPermissionRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermissionRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ObjectPermissionRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ObjectPermissionRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *ObjectPermissionRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermissionRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *ObjectPermissionRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *ObjectPermissionRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetObjectTypes returns the ObjectTypes field value +func (o *ObjectPermissionRequest) GetObjectTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ObjectTypes +} + +// GetObjectTypesOk returns a tuple with the ObjectTypes field value +// and a boolean to check if the value has been set. +func (o *ObjectPermissionRequest) GetObjectTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ObjectTypes, true +} + +// SetObjectTypes sets field value +func (o *ObjectPermissionRequest) SetObjectTypes(v []string) { + o.ObjectTypes = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *ObjectPermissionRequest) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermissionRequest) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *ObjectPermissionRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *ObjectPermissionRequest) SetGroups(v []int32) { + o.Groups = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *ObjectPermissionRequest) GetUsers() []int32 { + if o == nil || IsNil(o.Users) { + var ret []int32 + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObjectPermissionRequest) GetUsersOk() ([]int32, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *ObjectPermissionRequest) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []int32 and assigns it to the Users field. +func (o *ObjectPermissionRequest) SetUsers(v []int32) { + o.Users = v +} + +// GetActions returns the Actions field value +func (o *ObjectPermissionRequest) GetActions() []string { + if o == nil { + var ret []string + return ret + } + + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value +// and a boolean to check if the value has been set. +func (o *ObjectPermissionRequest) GetActionsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Actions, true +} + +// SetActions sets field value +func (o *ObjectPermissionRequest) SetActions(v []string) { + o.Actions = v +} + +// GetConstraints returns the Constraints field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ObjectPermissionRequest) GetConstraints() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Constraints +} + +// GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ObjectPermissionRequest) GetConstraintsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Constraints) { + return nil, false + } + return &o.Constraints, true +} + +// HasConstraints returns a boolean if a field has been set. +func (o *ObjectPermissionRequest) HasConstraints() bool { + if o != nil && IsNil(o.Constraints) { + return true + } + + return false +} + +// SetConstraints gets a reference to the given interface{} and assigns it to the Constraints field. +func (o *ObjectPermissionRequest) SetConstraints(v interface{}) { + o.Constraints = v +} + +func (o ObjectPermissionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ObjectPermissionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["object_types"] = o.ObjectTypes + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + toSerialize["actions"] = o.Actions + if o.Constraints != nil { + toSerialize["constraints"] = o.Constraints + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ObjectPermissionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "object_types", + "actions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varObjectPermissionRequest := _ObjectPermissionRequest{} + + err = json.Unmarshal(data, &varObjectPermissionRequest) + + if err != nil { + return err + } + + *o = ObjectPermissionRequest(varObjectPermissionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "enabled") + delete(additionalProperties, "object_types") + delete(additionalProperties, "groups") + delete(additionalProperties, "users") + delete(additionalProperties, "actions") + delete(additionalProperties, "constraints") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableObjectPermissionRequest struct { + value *ObjectPermissionRequest + isSet bool +} + +func (v NullableObjectPermissionRequest) Get() *ObjectPermissionRequest { + return v.value +} + +func (v *NullableObjectPermissionRequest) Set(val *ObjectPermissionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableObjectPermissionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableObjectPermissionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableObjectPermissionRequest(val *ObjectPermissionRequest) *NullableObjectPermissionRequest { + return &NullableObjectPermissionRequest{value: val, isSet: true} +} + +func (v NullableObjectPermissionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableObjectPermissionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_aggregate_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_aggregate_list.go new file mode 100644 index 00000000..ecdda4b4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_aggregate_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedAggregateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAggregateList{} + +// PaginatedAggregateList struct for PaginatedAggregateList +type PaginatedAggregateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Aggregate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAggregateList PaginatedAggregateList + +// NewPaginatedAggregateList instantiates a new PaginatedAggregateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAggregateList() *PaginatedAggregateList { + this := PaginatedAggregateList{} + return &this +} + +// NewPaginatedAggregateListWithDefaults instantiates a new PaginatedAggregateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAggregateListWithDefaults() *PaginatedAggregateList { + this := PaginatedAggregateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedAggregateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedAggregateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedAggregateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedAggregateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedAggregateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedAggregateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedAggregateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedAggregateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedAggregateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedAggregateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedAggregateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedAggregateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedAggregateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedAggregateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedAggregateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedAggregateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedAggregateList) GetResults() []Aggregate { + if o == nil || IsNil(o.Results) { + var ret []Aggregate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedAggregateList) GetResultsOk() ([]Aggregate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedAggregateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Aggregate and assigns it to the Results field. +func (o *PaginatedAggregateList) SetResults(v []Aggregate) { + o.Results = v +} + +func (o PaginatedAggregateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAggregateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAggregateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedAggregateList := _PaginatedAggregateList{} + + err = json.Unmarshal(data, &varPaginatedAggregateList) + + if err != nil { + return err + } + + *o = PaginatedAggregateList(varPaginatedAggregateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAggregateList struct { + value *PaginatedAggregateList + isSet bool +} + +func (v NullablePaginatedAggregateList) Get() *PaginatedAggregateList { + return v.value +} + +func (v *NullablePaginatedAggregateList) Set(val *PaginatedAggregateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAggregateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAggregateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAggregateList(val *PaginatedAggregateList) *NullablePaginatedAggregateList { + return &NullablePaginatedAggregateList{value: val, isSet: true} +} + +func (v NullablePaginatedAggregateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAggregateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_asn_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_asn_list.go new file mode 100644 index 00000000..41d19df4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_asn_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedASNList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedASNList{} + +// PaginatedASNList struct for PaginatedASNList +type PaginatedASNList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ASN `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedASNList PaginatedASNList + +// NewPaginatedASNList instantiates a new PaginatedASNList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedASNList() *PaginatedASNList { + this := PaginatedASNList{} + return &this +} + +// NewPaginatedASNListWithDefaults instantiates a new PaginatedASNList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedASNListWithDefaults() *PaginatedASNList { + this := PaginatedASNList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedASNList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedASNList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedASNList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedASNList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedASNList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedASNList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedASNList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedASNList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedASNList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedASNList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedASNList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedASNList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedASNList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedASNList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedASNList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedASNList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedASNList) GetResults() []ASN { + if o == nil || IsNil(o.Results) { + var ret []ASN + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedASNList) GetResultsOk() ([]ASN, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedASNList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ASN and assigns it to the Results field. +func (o *PaginatedASNList) SetResults(v []ASN) { + o.Results = v +} + +func (o PaginatedASNList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedASNList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedASNList) UnmarshalJSON(data []byte) (err error) { + varPaginatedASNList := _PaginatedASNList{} + + err = json.Unmarshal(data, &varPaginatedASNList) + + if err != nil { + return err + } + + *o = PaginatedASNList(varPaginatedASNList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedASNList struct { + value *PaginatedASNList + isSet bool +} + +func (v NullablePaginatedASNList) Get() *PaginatedASNList { + return v.value +} + +func (v *NullablePaginatedASNList) Set(val *PaginatedASNList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedASNList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedASNList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedASNList(val *PaginatedASNList) *NullablePaginatedASNList { + return &NullablePaginatedASNList{value: val, isSet: true} +} + +func (v NullablePaginatedASNList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedASNList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_asn_range_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_asn_range_list.go new file mode 100644 index 00000000..cf2f1b64 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_asn_range_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedASNRangeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedASNRangeList{} + +// PaginatedASNRangeList struct for PaginatedASNRangeList +type PaginatedASNRangeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ASNRange `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedASNRangeList PaginatedASNRangeList + +// NewPaginatedASNRangeList instantiates a new PaginatedASNRangeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedASNRangeList() *PaginatedASNRangeList { + this := PaginatedASNRangeList{} + return &this +} + +// NewPaginatedASNRangeListWithDefaults instantiates a new PaginatedASNRangeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedASNRangeListWithDefaults() *PaginatedASNRangeList { + this := PaginatedASNRangeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedASNRangeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedASNRangeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedASNRangeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedASNRangeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedASNRangeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedASNRangeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedASNRangeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedASNRangeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedASNRangeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedASNRangeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedASNRangeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedASNRangeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedASNRangeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedASNRangeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedASNRangeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedASNRangeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedASNRangeList) GetResults() []ASNRange { + if o == nil || IsNil(o.Results) { + var ret []ASNRange + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedASNRangeList) GetResultsOk() ([]ASNRange, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedASNRangeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ASNRange and assigns it to the Results field. +func (o *PaginatedASNRangeList) SetResults(v []ASNRange) { + o.Results = v +} + +func (o PaginatedASNRangeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedASNRangeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedASNRangeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedASNRangeList := _PaginatedASNRangeList{} + + err = json.Unmarshal(data, &varPaginatedASNRangeList) + + if err != nil { + return err + } + + *o = PaginatedASNRangeList(varPaginatedASNRangeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedASNRangeList struct { + value *PaginatedASNRangeList + isSet bool +} + +func (v NullablePaginatedASNRangeList) Get() *PaginatedASNRangeList { + return v.value +} + +func (v *NullablePaginatedASNRangeList) Set(val *PaginatedASNRangeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedASNRangeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedASNRangeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedASNRangeList(val *PaginatedASNRangeList) *NullablePaginatedASNRangeList { + return &NullablePaginatedASNRangeList{value: val, isSet: true} +} + +func (v NullablePaginatedASNRangeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedASNRangeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_bookmark_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_bookmark_list.go new file mode 100644 index 00000000..971e1016 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_bookmark_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedBookmarkList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedBookmarkList{} + +// PaginatedBookmarkList struct for PaginatedBookmarkList +type PaginatedBookmarkList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Bookmark `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedBookmarkList PaginatedBookmarkList + +// NewPaginatedBookmarkList instantiates a new PaginatedBookmarkList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedBookmarkList() *PaginatedBookmarkList { + this := PaginatedBookmarkList{} + return &this +} + +// NewPaginatedBookmarkListWithDefaults instantiates a new PaginatedBookmarkList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedBookmarkListWithDefaults() *PaginatedBookmarkList { + this := PaginatedBookmarkList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedBookmarkList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedBookmarkList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedBookmarkList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedBookmarkList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedBookmarkList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedBookmarkList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedBookmarkList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedBookmarkList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedBookmarkList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedBookmarkList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedBookmarkList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedBookmarkList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedBookmarkList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedBookmarkList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedBookmarkList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedBookmarkList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedBookmarkList) GetResults() []Bookmark { + if o == nil || IsNil(o.Results) { + var ret []Bookmark + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedBookmarkList) GetResultsOk() ([]Bookmark, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedBookmarkList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Bookmark and assigns it to the Results field. +func (o *PaginatedBookmarkList) SetResults(v []Bookmark) { + o.Results = v +} + +func (o PaginatedBookmarkList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedBookmarkList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedBookmarkList) UnmarshalJSON(data []byte) (err error) { + varPaginatedBookmarkList := _PaginatedBookmarkList{} + + err = json.Unmarshal(data, &varPaginatedBookmarkList) + + if err != nil { + return err + } + + *o = PaginatedBookmarkList(varPaginatedBookmarkList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedBookmarkList struct { + value *PaginatedBookmarkList + isSet bool +} + +func (v NullablePaginatedBookmarkList) Get() *PaginatedBookmarkList { + return v.value +} + +func (v *NullablePaginatedBookmarkList) Set(val *PaginatedBookmarkList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedBookmarkList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedBookmarkList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedBookmarkList(val *PaginatedBookmarkList) *NullablePaginatedBookmarkList { + return &NullablePaginatedBookmarkList{value: val, isSet: true} +} + +func (v NullablePaginatedBookmarkList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedBookmarkList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cable_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cable_list.go new file mode 100644 index 00000000..a2560bbd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cable_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCableList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCableList{} + +// PaginatedCableList struct for PaginatedCableList +type PaginatedCableList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Cable `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCableList PaginatedCableList + +// NewPaginatedCableList instantiates a new PaginatedCableList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCableList() *PaginatedCableList { + this := PaginatedCableList{} + return &this +} + +// NewPaginatedCableListWithDefaults instantiates a new PaginatedCableList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCableListWithDefaults() *PaginatedCableList { + this := PaginatedCableList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCableList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCableList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCableList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCableList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCableList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCableList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCableList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCableList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCableList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCableList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCableList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCableList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCableList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCableList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCableList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCableList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCableList) GetResults() []Cable { + if o == nil || IsNil(o.Results) { + var ret []Cable + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCableList) GetResultsOk() ([]Cable, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCableList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Cable and assigns it to the Results field. +func (o *PaginatedCableList) SetResults(v []Cable) { + o.Results = v +} + +func (o PaginatedCableList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCableList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCableList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCableList := _PaginatedCableList{} + + err = json.Unmarshal(data, &varPaginatedCableList) + + if err != nil { + return err + } + + *o = PaginatedCableList(varPaginatedCableList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCableList struct { + value *PaginatedCableList + isSet bool +} + +func (v NullablePaginatedCableList) Get() *PaginatedCableList { + return v.value +} + +func (v *NullablePaginatedCableList) Set(val *PaginatedCableList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCableList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCableList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCableList(val *PaginatedCableList) *NullablePaginatedCableList { + return &NullablePaginatedCableList{value: val, isSet: true} +} + +func (v NullablePaginatedCableList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCableList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cable_termination_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cable_termination_list.go new file mode 100644 index 00000000..9003c612 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cable_termination_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCableTerminationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCableTerminationList{} + +// PaginatedCableTerminationList struct for PaginatedCableTerminationList +type PaginatedCableTerminationList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []CableTermination `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCableTerminationList PaginatedCableTerminationList + +// NewPaginatedCableTerminationList instantiates a new PaginatedCableTerminationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCableTerminationList() *PaginatedCableTerminationList { + this := PaginatedCableTerminationList{} + return &this +} + +// NewPaginatedCableTerminationListWithDefaults instantiates a new PaginatedCableTerminationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCableTerminationListWithDefaults() *PaginatedCableTerminationList { + this := PaginatedCableTerminationList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCableTerminationList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCableTerminationList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCableTerminationList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCableTerminationList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCableTerminationList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCableTerminationList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCableTerminationList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCableTerminationList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCableTerminationList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCableTerminationList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCableTerminationList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCableTerminationList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCableTerminationList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCableTerminationList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCableTerminationList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCableTerminationList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCableTerminationList) GetResults() []CableTermination { + if o == nil || IsNil(o.Results) { + var ret []CableTermination + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCableTerminationList) GetResultsOk() ([]CableTermination, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCableTerminationList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []CableTermination and assigns it to the Results field. +func (o *PaginatedCableTerminationList) SetResults(v []CableTermination) { + o.Results = v +} + +func (o PaginatedCableTerminationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCableTerminationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCableTerminationList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCableTerminationList := _PaginatedCableTerminationList{} + + err = json.Unmarshal(data, &varPaginatedCableTerminationList) + + if err != nil { + return err + } + + *o = PaginatedCableTerminationList(varPaginatedCableTerminationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCableTerminationList struct { + value *PaginatedCableTerminationList + isSet bool +} + +func (v NullablePaginatedCableTerminationList) Get() *PaginatedCableTerminationList { + return v.value +} + +func (v *NullablePaginatedCableTerminationList) Set(val *PaginatedCableTerminationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCableTerminationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCableTerminationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCableTerminationList(val *PaginatedCableTerminationList) *NullablePaginatedCableTerminationList { + return &NullablePaginatedCableTerminationList{value: val, isSet: true} +} + +func (v NullablePaginatedCableTerminationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCableTerminationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_list.go new file mode 100644 index 00000000..79cb1d20 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCircuitList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCircuitList{} + +// PaginatedCircuitList struct for PaginatedCircuitList +type PaginatedCircuitList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Circuit `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCircuitList PaginatedCircuitList + +// NewPaginatedCircuitList instantiates a new PaginatedCircuitList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCircuitList() *PaginatedCircuitList { + this := PaginatedCircuitList{} + return &this +} + +// NewPaginatedCircuitListWithDefaults instantiates a new PaginatedCircuitList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCircuitListWithDefaults() *PaginatedCircuitList { + this := PaginatedCircuitList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCircuitList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCircuitList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCircuitList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCircuitList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCircuitList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCircuitList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCircuitList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCircuitList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCircuitList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCircuitList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCircuitList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCircuitList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCircuitList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCircuitList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCircuitList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCircuitList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCircuitList) GetResults() []Circuit { + if o == nil || IsNil(o.Results) { + var ret []Circuit + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCircuitList) GetResultsOk() ([]Circuit, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCircuitList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Circuit and assigns it to the Results field. +func (o *PaginatedCircuitList) SetResults(v []Circuit) { + o.Results = v +} + +func (o PaginatedCircuitList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCircuitList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCircuitList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCircuitList := _PaginatedCircuitList{} + + err = json.Unmarshal(data, &varPaginatedCircuitList) + + if err != nil { + return err + } + + *o = PaginatedCircuitList(varPaginatedCircuitList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCircuitList struct { + value *PaginatedCircuitList + isSet bool +} + +func (v NullablePaginatedCircuitList) Get() *PaginatedCircuitList { + return v.value +} + +func (v *NullablePaginatedCircuitList) Set(val *PaginatedCircuitList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCircuitList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCircuitList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCircuitList(val *PaginatedCircuitList) *NullablePaginatedCircuitList { + return &NullablePaginatedCircuitList{value: val, isSet: true} +} + +func (v NullablePaginatedCircuitList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCircuitList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_termination_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_termination_list.go new file mode 100644 index 00000000..e70e3f83 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_termination_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCircuitTerminationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCircuitTerminationList{} + +// PaginatedCircuitTerminationList struct for PaginatedCircuitTerminationList +type PaginatedCircuitTerminationList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []CircuitTermination `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCircuitTerminationList PaginatedCircuitTerminationList + +// NewPaginatedCircuitTerminationList instantiates a new PaginatedCircuitTerminationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCircuitTerminationList() *PaginatedCircuitTerminationList { + this := PaginatedCircuitTerminationList{} + return &this +} + +// NewPaginatedCircuitTerminationListWithDefaults instantiates a new PaginatedCircuitTerminationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCircuitTerminationListWithDefaults() *PaginatedCircuitTerminationList { + this := PaginatedCircuitTerminationList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCircuitTerminationList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCircuitTerminationList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCircuitTerminationList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCircuitTerminationList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCircuitTerminationList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCircuitTerminationList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCircuitTerminationList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCircuitTerminationList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCircuitTerminationList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCircuitTerminationList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCircuitTerminationList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCircuitTerminationList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCircuitTerminationList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCircuitTerminationList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCircuitTerminationList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCircuitTerminationList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCircuitTerminationList) GetResults() []CircuitTermination { + if o == nil || IsNil(o.Results) { + var ret []CircuitTermination + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCircuitTerminationList) GetResultsOk() ([]CircuitTermination, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCircuitTerminationList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []CircuitTermination and assigns it to the Results field. +func (o *PaginatedCircuitTerminationList) SetResults(v []CircuitTermination) { + o.Results = v +} + +func (o PaginatedCircuitTerminationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCircuitTerminationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCircuitTerminationList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCircuitTerminationList := _PaginatedCircuitTerminationList{} + + err = json.Unmarshal(data, &varPaginatedCircuitTerminationList) + + if err != nil { + return err + } + + *o = PaginatedCircuitTerminationList(varPaginatedCircuitTerminationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCircuitTerminationList struct { + value *PaginatedCircuitTerminationList + isSet bool +} + +func (v NullablePaginatedCircuitTerminationList) Get() *PaginatedCircuitTerminationList { + return v.value +} + +func (v *NullablePaginatedCircuitTerminationList) Set(val *PaginatedCircuitTerminationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCircuitTerminationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCircuitTerminationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCircuitTerminationList(val *PaginatedCircuitTerminationList) *NullablePaginatedCircuitTerminationList { + return &NullablePaginatedCircuitTerminationList{value: val, isSet: true} +} + +func (v NullablePaginatedCircuitTerminationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCircuitTerminationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_type_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_type_list.go new file mode 100644 index 00000000..8e0e3501 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_circuit_type_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCircuitTypeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCircuitTypeList{} + +// PaginatedCircuitTypeList struct for PaginatedCircuitTypeList +type PaginatedCircuitTypeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []CircuitType `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCircuitTypeList PaginatedCircuitTypeList + +// NewPaginatedCircuitTypeList instantiates a new PaginatedCircuitTypeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCircuitTypeList() *PaginatedCircuitTypeList { + this := PaginatedCircuitTypeList{} + return &this +} + +// NewPaginatedCircuitTypeListWithDefaults instantiates a new PaginatedCircuitTypeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCircuitTypeListWithDefaults() *PaginatedCircuitTypeList { + this := PaginatedCircuitTypeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCircuitTypeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCircuitTypeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCircuitTypeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCircuitTypeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCircuitTypeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCircuitTypeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCircuitTypeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCircuitTypeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCircuitTypeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCircuitTypeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCircuitTypeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCircuitTypeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCircuitTypeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCircuitTypeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCircuitTypeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCircuitTypeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCircuitTypeList) GetResults() []CircuitType { + if o == nil || IsNil(o.Results) { + var ret []CircuitType + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCircuitTypeList) GetResultsOk() ([]CircuitType, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCircuitTypeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []CircuitType and assigns it to the Results field. +func (o *PaginatedCircuitTypeList) SetResults(v []CircuitType) { + o.Results = v +} + +func (o PaginatedCircuitTypeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCircuitTypeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCircuitTypeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCircuitTypeList := _PaginatedCircuitTypeList{} + + err = json.Unmarshal(data, &varPaginatedCircuitTypeList) + + if err != nil { + return err + } + + *o = PaginatedCircuitTypeList(varPaginatedCircuitTypeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCircuitTypeList struct { + value *PaginatedCircuitTypeList + isSet bool +} + +func (v NullablePaginatedCircuitTypeList) Get() *PaginatedCircuitTypeList { + return v.value +} + +func (v *NullablePaginatedCircuitTypeList) Set(val *PaginatedCircuitTypeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCircuitTypeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCircuitTypeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCircuitTypeList(val *PaginatedCircuitTypeList) *NullablePaginatedCircuitTypeList { + return &NullablePaginatedCircuitTypeList{value: val, isSet: true} +} + +func (v NullablePaginatedCircuitTypeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCircuitTypeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_group_list.go new file mode 100644 index 00000000..e84fe97d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedClusterGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedClusterGroupList{} + +// PaginatedClusterGroupList struct for PaginatedClusterGroupList +type PaginatedClusterGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ClusterGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedClusterGroupList PaginatedClusterGroupList + +// NewPaginatedClusterGroupList instantiates a new PaginatedClusterGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedClusterGroupList() *PaginatedClusterGroupList { + this := PaginatedClusterGroupList{} + return &this +} + +// NewPaginatedClusterGroupListWithDefaults instantiates a new PaginatedClusterGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedClusterGroupListWithDefaults() *PaginatedClusterGroupList { + this := PaginatedClusterGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedClusterGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedClusterGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedClusterGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedClusterGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedClusterGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedClusterGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedClusterGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedClusterGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedClusterGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedClusterGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedClusterGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedClusterGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedClusterGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedClusterGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedClusterGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedClusterGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedClusterGroupList) GetResults() []ClusterGroup { + if o == nil || IsNil(o.Results) { + var ret []ClusterGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedClusterGroupList) GetResultsOk() ([]ClusterGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedClusterGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ClusterGroup and assigns it to the Results field. +func (o *PaginatedClusterGroupList) SetResults(v []ClusterGroup) { + o.Results = v +} + +func (o PaginatedClusterGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedClusterGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedClusterGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedClusterGroupList := _PaginatedClusterGroupList{} + + err = json.Unmarshal(data, &varPaginatedClusterGroupList) + + if err != nil { + return err + } + + *o = PaginatedClusterGroupList(varPaginatedClusterGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedClusterGroupList struct { + value *PaginatedClusterGroupList + isSet bool +} + +func (v NullablePaginatedClusterGroupList) Get() *PaginatedClusterGroupList { + return v.value +} + +func (v *NullablePaginatedClusterGroupList) Set(val *PaginatedClusterGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedClusterGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedClusterGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedClusterGroupList(val *PaginatedClusterGroupList) *NullablePaginatedClusterGroupList { + return &NullablePaginatedClusterGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedClusterGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedClusterGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_list.go new file mode 100644 index 00000000..c6155a23 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedClusterList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedClusterList{} + +// PaginatedClusterList struct for PaginatedClusterList +type PaginatedClusterList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Cluster `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedClusterList PaginatedClusterList + +// NewPaginatedClusterList instantiates a new PaginatedClusterList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedClusterList() *PaginatedClusterList { + this := PaginatedClusterList{} + return &this +} + +// NewPaginatedClusterListWithDefaults instantiates a new PaginatedClusterList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedClusterListWithDefaults() *PaginatedClusterList { + this := PaginatedClusterList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedClusterList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedClusterList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedClusterList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedClusterList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedClusterList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedClusterList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedClusterList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedClusterList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedClusterList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedClusterList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedClusterList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedClusterList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedClusterList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedClusterList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedClusterList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedClusterList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedClusterList) GetResults() []Cluster { + if o == nil || IsNil(o.Results) { + var ret []Cluster + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedClusterList) GetResultsOk() ([]Cluster, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedClusterList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Cluster and assigns it to the Results field. +func (o *PaginatedClusterList) SetResults(v []Cluster) { + o.Results = v +} + +func (o PaginatedClusterList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedClusterList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedClusterList) UnmarshalJSON(data []byte) (err error) { + varPaginatedClusterList := _PaginatedClusterList{} + + err = json.Unmarshal(data, &varPaginatedClusterList) + + if err != nil { + return err + } + + *o = PaginatedClusterList(varPaginatedClusterList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedClusterList struct { + value *PaginatedClusterList + isSet bool +} + +func (v NullablePaginatedClusterList) Get() *PaginatedClusterList { + return v.value +} + +func (v *NullablePaginatedClusterList) Set(val *PaginatedClusterList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedClusterList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedClusterList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedClusterList(val *PaginatedClusterList) *NullablePaginatedClusterList { + return &NullablePaginatedClusterList{value: val, isSet: true} +} + +func (v NullablePaginatedClusterList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedClusterList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_type_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_type_list.go new file mode 100644 index 00000000..41094266 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_cluster_type_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedClusterTypeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedClusterTypeList{} + +// PaginatedClusterTypeList struct for PaginatedClusterTypeList +type PaginatedClusterTypeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ClusterType `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedClusterTypeList PaginatedClusterTypeList + +// NewPaginatedClusterTypeList instantiates a new PaginatedClusterTypeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedClusterTypeList() *PaginatedClusterTypeList { + this := PaginatedClusterTypeList{} + return &this +} + +// NewPaginatedClusterTypeListWithDefaults instantiates a new PaginatedClusterTypeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedClusterTypeListWithDefaults() *PaginatedClusterTypeList { + this := PaginatedClusterTypeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedClusterTypeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedClusterTypeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedClusterTypeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedClusterTypeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedClusterTypeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedClusterTypeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedClusterTypeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedClusterTypeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedClusterTypeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedClusterTypeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedClusterTypeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedClusterTypeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedClusterTypeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedClusterTypeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedClusterTypeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedClusterTypeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedClusterTypeList) GetResults() []ClusterType { + if o == nil || IsNil(o.Results) { + var ret []ClusterType + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedClusterTypeList) GetResultsOk() ([]ClusterType, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedClusterTypeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ClusterType and assigns it to the Results field. +func (o *PaginatedClusterTypeList) SetResults(v []ClusterType) { + o.Results = v +} + +func (o PaginatedClusterTypeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedClusterTypeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedClusterTypeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedClusterTypeList := _PaginatedClusterTypeList{} + + err = json.Unmarshal(data, &varPaginatedClusterTypeList) + + if err != nil { + return err + } + + *o = PaginatedClusterTypeList(varPaginatedClusterTypeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedClusterTypeList struct { + value *PaginatedClusterTypeList + isSet bool +} + +func (v NullablePaginatedClusterTypeList) Get() *PaginatedClusterTypeList { + return v.value +} + +func (v *NullablePaginatedClusterTypeList) Set(val *PaginatedClusterTypeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedClusterTypeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedClusterTypeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedClusterTypeList(val *PaginatedClusterTypeList) *NullablePaginatedClusterTypeList { + return &NullablePaginatedClusterTypeList{value: val, isSet: true} +} + +func (v NullablePaginatedClusterTypeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedClusterTypeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_config_context_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_config_context_list.go new file mode 100644 index 00000000..7cf94fee --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_config_context_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedConfigContextList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConfigContextList{} + +// PaginatedConfigContextList struct for PaginatedConfigContextList +type PaginatedConfigContextList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ConfigContext `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConfigContextList PaginatedConfigContextList + +// NewPaginatedConfigContextList instantiates a new PaginatedConfigContextList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConfigContextList() *PaginatedConfigContextList { + this := PaginatedConfigContextList{} + return &this +} + +// NewPaginatedConfigContextListWithDefaults instantiates a new PaginatedConfigContextList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConfigContextListWithDefaults() *PaginatedConfigContextList { + this := PaginatedConfigContextList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedConfigContextList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConfigContextList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedConfigContextList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedConfigContextList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConfigContextList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConfigContextList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedConfigContextList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedConfigContextList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedConfigContextList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedConfigContextList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConfigContextList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConfigContextList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedConfigContextList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedConfigContextList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedConfigContextList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedConfigContextList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedConfigContextList) GetResults() []ConfigContext { + if o == nil || IsNil(o.Results) { + var ret []ConfigContext + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConfigContextList) GetResultsOk() ([]ConfigContext, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedConfigContextList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ConfigContext and assigns it to the Results field. +func (o *PaginatedConfigContextList) SetResults(v []ConfigContext) { + o.Results = v +} + +func (o PaginatedConfigContextList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConfigContextList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConfigContextList) UnmarshalJSON(data []byte) (err error) { + varPaginatedConfigContextList := _PaginatedConfigContextList{} + + err = json.Unmarshal(data, &varPaginatedConfigContextList) + + if err != nil { + return err + } + + *o = PaginatedConfigContextList(varPaginatedConfigContextList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConfigContextList struct { + value *PaginatedConfigContextList + isSet bool +} + +func (v NullablePaginatedConfigContextList) Get() *PaginatedConfigContextList { + return v.value +} + +func (v *NullablePaginatedConfigContextList) Set(val *PaginatedConfigContextList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConfigContextList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConfigContextList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConfigContextList(val *PaginatedConfigContextList) *NullablePaginatedConfigContextList { + return &NullablePaginatedConfigContextList{value: val, isSet: true} +} + +func (v NullablePaginatedConfigContextList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConfigContextList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_config_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_config_template_list.go new file mode 100644 index 00000000..39eded72 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_config_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedConfigTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConfigTemplateList{} + +// PaginatedConfigTemplateList struct for PaginatedConfigTemplateList +type PaginatedConfigTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ConfigTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConfigTemplateList PaginatedConfigTemplateList + +// NewPaginatedConfigTemplateList instantiates a new PaginatedConfigTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConfigTemplateList() *PaginatedConfigTemplateList { + this := PaginatedConfigTemplateList{} + return &this +} + +// NewPaginatedConfigTemplateListWithDefaults instantiates a new PaginatedConfigTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConfigTemplateListWithDefaults() *PaginatedConfigTemplateList { + this := PaginatedConfigTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedConfigTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConfigTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedConfigTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedConfigTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConfigTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConfigTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedConfigTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedConfigTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedConfigTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedConfigTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConfigTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConfigTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedConfigTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedConfigTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedConfigTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedConfigTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedConfigTemplateList) GetResults() []ConfigTemplate { + if o == nil || IsNil(o.Results) { + var ret []ConfigTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConfigTemplateList) GetResultsOk() ([]ConfigTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedConfigTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ConfigTemplate and assigns it to the Results field. +func (o *PaginatedConfigTemplateList) SetResults(v []ConfigTemplate) { + o.Results = v +} + +func (o PaginatedConfigTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConfigTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConfigTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedConfigTemplateList := _PaginatedConfigTemplateList{} + + err = json.Unmarshal(data, &varPaginatedConfigTemplateList) + + if err != nil { + return err + } + + *o = PaginatedConfigTemplateList(varPaginatedConfigTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConfigTemplateList struct { + value *PaginatedConfigTemplateList + isSet bool +} + +func (v NullablePaginatedConfigTemplateList) Get() *PaginatedConfigTemplateList { + return v.value +} + +func (v *NullablePaginatedConfigTemplateList) Set(val *PaginatedConfigTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConfigTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConfigTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConfigTemplateList(val *PaginatedConfigTemplateList) *NullablePaginatedConfigTemplateList { + return &NullablePaginatedConfigTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedConfigTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConfigTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_port_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_port_list.go new file mode 100644 index 00000000..c9e69a69 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_port_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedConsolePortList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConsolePortList{} + +// PaginatedConsolePortList struct for PaginatedConsolePortList +type PaginatedConsolePortList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ConsolePort `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConsolePortList PaginatedConsolePortList + +// NewPaginatedConsolePortList instantiates a new PaginatedConsolePortList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConsolePortList() *PaginatedConsolePortList { + this := PaginatedConsolePortList{} + return &this +} + +// NewPaginatedConsolePortListWithDefaults instantiates a new PaginatedConsolePortList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConsolePortListWithDefaults() *PaginatedConsolePortList { + this := PaginatedConsolePortList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedConsolePortList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsolePortList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedConsolePortList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedConsolePortList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsolePortList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsolePortList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedConsolePortList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedConsolePortList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedConsolePortList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedConsolePortList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsolePortList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsolePortList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedConsolePortList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedConsolePortList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedConsolePortList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedConsolePortList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedConsolePortList) GetResults() []ConsolePort { + if o == nil || IsNil(o.Results) { + var ret []ConsolePort + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsolePortList) GetResultsOk() ([]ConsolePort, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedConsolePortList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ConsolePort and assigns it to the Results field. +func (o *PaginatedConsolePortList) SetResults(v []ConsolePort) { + o.Results = v +} + +func (o PaginatedConsolePortList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConsolePortList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConsolePortList) UnmarshalJSON(data []byte) (err error) { + varPaginatedConsolePortList := _PaginatedConsolePortList{} + + err = json.Unmarshal(data, &varPaginatedConsolePortList) + + if err != nil { + return err + } + + *o = PaginatedConsolePortList(varPaginatedConsolePortList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConsolePortList struct { + value *PaginatedConsolePortList + isSet bool +} + +func (v NullablePaginatedConsolePortList) Get() *PaginatedConsolePortList { + return v.value +} + +func (v *NullablePaginatedConsolePortList) Set(val *PaginatedConsolePortList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConsolePortList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConsolePortList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConsolePortList(val *PaginatedConsolePortList) *NullablePaginatedConsolePortList { + return &NullablePaginatedConsolePortList{value: val, isSet: true} +} + +func (v NullablePaginatedConsolePortList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConsolePortList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_port_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_port_template_list.go new file mode 100644 index 00000000..598d0754 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_port_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedConsolePortTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConsolePortTemplateList{} + +// PaginatedConsolePortTemplateList struct for PaginatedConsolePortTemplateList +type PaginatedConsolePortTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ConsolePortTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConsolePortTemplateList PaginatedConsolePortTemplateList + +// NewPaginatedConsolePortTemplateList instantiates a new PaginatedConsolePortTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConsolePortTemplateList() *PaginatedConsolePortTemplateList { + this := PaginatedConsolePortTemplateList{} + return &this +} + +// NewPaginatedConsolePortTemplateListWithDefaults instantiates a new PaginatedConsolePortTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConsolePortTemplateListWithDefaults() *PaginatedConsolePortTemplateList { + this := PaginatedConsolePortTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedConsolePortTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsolePortTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedConsolePortTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedConsolePortTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsolePortTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsolePortTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedConsolePortTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedConsolePortTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedConsolePortTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedConsolePortTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsolePortTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsolePortTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedConsolePortTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedConsolePortTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedConsolePortTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedConsolePortTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedConsolePortTemplateList) GetResults() []ConsolePortTemplate { + if o == nil || IsNil(o.Results) { + var ret []ConsolePortTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsolePortTemplateList) GetResultsOk() ([]ConsolePortTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedConsolePortTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ConsolePortTemplate and assigns it to the Results field. +func (o *PaginatedConsolePortTemplateList) SetResults(v []ConsolePortTemplate) { + o.Results = v +} + +func (o PaginatedConsolePortTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConsolePortTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConsolePortTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedConsolePortTemplateList := _PaginatedConsolePortTemplateList{} + + err = json.Unmarshal(data, &varPaginatedConsolePortTemplateList) + + if err != nil { + return err + } + + *o = PaginatedConsolePortTemplateList(varPaginatedConsolePortTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConsolePortTemplateList struct { + value *PaginatedConsolePortTemplateList + isSet bool +} + +func (v NullablePaginatedConsolePortTemplateList) Get() *PaginatedConsolePortTemplateList { + return v.value +} + +func (v *NullablePaginatedConsolePortTemplateList) Set(val *PaginatedConsolePortTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConsolePortTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConsolePortTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConsolePortTemplateList(val *PaginatedConsolePortTemplateList) *NullablePaginatedConsolePortTemplateList { + return &NullablePaginatedConsolePortTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedConsolePortTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConsolePortTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_server_port_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_server_port_list.go new file mode 100644 index 00000000..cabc261e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_server_port_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedConsoleServerPortList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConsoleServerPortList{} + +// PaginatedConsoleServerPortList struct for PaginatedConsoleServerPortList +type PaginatedConsoleServerPortList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ConsoleServerPort `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConsoleServerPortList PaginatedConsoleServerPortList + +// NewPaginatedConsoleServerPortList instantiates a new PaginatedConsoleServerPortList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConsoleServerPortList() *PaginatedConsoleServerPortList { + this := PaginatedConsoleServerPortList{} + return &this +} + +// NewPaginatedConsoleServerPortListWithDefaults instantiates a new PaginatedConsoleServerPortList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConsoleServerPortListWithDefaults() *PaginatedConsoleServerPortList { + this := PaginatedConsoleServerPortList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedConsoleServerPortList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsoleServerPortList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedConsoleServerPortList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsoleServerPortList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsoleServerPortList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedConsoleServerPortList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedConsoleServerPortList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedConsoleServerPortList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsoleServerPortList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsoleServerPortList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedConsoleServerPortList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedConsoleServerPortList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedConsoleServerPortList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedConsoleServerPortList) GetResults() []ConsoleServerPort { + if o == nil || IsNil(o.Results) { + var ret []ConsoleServerPort + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsoleServerPortList) GetResultsOk() ([]ConsoleServerPort, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ConsoleServerPort and assigns it to the Results field. +func (o *PaginatedConsoleServerPortList) SetResults(v []ConsoleServerPort) { + o.Results = v +} + +func (o PaginatedConsoleServerPortList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConsoleServerPortList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConsoleServerPortList) UnmarshalJSON(data []byte) (err error) { + varPaginatedConsoleServerPortList := _PaginatedConsoleServerPortList{} + + err = json.Unmarshal(data, &varPaginatedConsoleServerPortList) + + if err != nil { + return err + } + + *o = PaginatedConsoleServerPortList(varPaginatedConsoleServerPortList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConsoleServerPortList struct { + value *PaginatedConsoleServerPortList + isSet bool +} + +func (v NullablePaginatedConsoleServerPortList) Get() *PaginatedConsoleServerPortList { + return v.value +} + +func (v *NullablePaginatedConsoleServerPortList) Set(val *PaginatedConsoleServerPortList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConsoleServerPortList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConsoleServerPortList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConsoleServerPortList(val *PaginatedConsoleServerPortList) *NullablePaginatedConsoleServerPortList { + return &NullablePaginatedConsoleServerPortList{value: val, isSet: true} +} + +func (v NullablePaginatedConsoleServerPortList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConsoleServerPortList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_server_port_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_server_port_template_list.go new file mode 100644 index 00000000..99e0effb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_console_server_port_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedConsoleServerPortTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConsoleServerPortTemplateList{} + +// PaginatedConsoleServerPortTemplateList struct for PaginatedConsoleServerPortTemplateList +type PaginatedConsoleServerPortTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ConsoleServerPortTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConsoleServerPortTemplateList PaginatedConsoleServerPortTemplateList + +// NewPaginatedConsoleServerPortTemplateList instantiates a new PaginatedConsoleServerPortTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConsoleServerPortTemplateList() *PaginatedConsoleServerPortTemplateList { + this := PaginatedConsoleServerPortTemplateList{} + return &this +} + +// NewPaginatedConsoleServerPortTemplateListWithDefaults instantiates a new PaginatedConsoleServerPortTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConsoleServerPortTemplateListWithDefaults() *PaginatedConsoleServerPortTemplateList { + this := PaginatedConsoleServerPortTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedConsoleServerPortTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsoleServerPortTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedConsoleServerPortTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsoleServerPortTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsoleServerPortTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedConsoleServerPortTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedConsoleServerPortTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedConsoleServerPortTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedConsoleServerPortTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedConsoleServerPortTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedConsoleServerPortTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedConsoleServerPortTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedConsoleServerPortTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedConsoleServerPortTemplateList) GetResults() []ConsoleServerPortTemplate { + if o == nil || IsNil(o.Results) { + var ret []ConsoleServerPortTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedConsoleServerPortTemplateList) GetResultsOk() ([]ConsoleServerPortTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedConsoleServerPortTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ConsoleServerPortTemplate and assigns it to the Results field. +func (o *PaginatedConsoleServerPortTemplateList) SetResults(v []ConsoleServerPortTemplate) { + o.Results = v +} + +func (o PaginatedConsoleServerPortTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConsoleServerPortTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConsoleServerPortTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedConsoleServerPortTemplateList := _PaginatedConsoleServerPortTemplateList{} + + err = json.Unmarshal(data, &varPaginatedConsoleServerPortTemplateList) + + if err != nil { + return err + } + + *o = PaginatedConsoleServerPortTemplateList(varPaginatedConsoleServerPortTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConsoleServerPortTemplateList struct { + value *PaginatedConsoleServerPortTemplateList + isSet bool +} + +func (v NullablePaginatedConsoleServerPortTemplateList) Get() *PaginatedConsoleServerPortTemplateList { + return v.value +} + +func (v *NullablePaginatedConsoleServerPortTemplateList) Set(val *PaginatedConsoleServerPortTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConsoleServerPortTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConsoleServerPortTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConsoleServerPortTemplateList(val *PaginatedConsoleServerPortTemplateList) *NullablePaginatedConsoleServerPortTemplateList { + return &NullablePaginatedConsoleServerPortTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedConsoleServerPortTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConsoleServerPortTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_assignment_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_assignment_list.go new file mode 100644 index 00000000..aa4c6876 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_assignment_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedContactAssignmentList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedContactAssignmentList{} + +// PaginatedContactAssignmentList struct for PaginatedContactAssignmentList +type PaginatedContactAssignmentList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ContactAssignment `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedContactAssignmentList PaginatedContactAssignmentList + +// NewPaginatedContactAssignmentList instantiates a new PaginatedContactAssignmentList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedContactAssignmentList() *PaginatedContactAssignmentList { + this := PaginatedContactAssignmentList{} + return &this +} + +// NewPaginatedContactAssignmentListWithDefaults instantiates a new PaginatedContactAssignmentList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedContactAssignmentListWithDefaults() *PaginatedContactAssignmentList { + this := PaginatedContactAssignmentList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedContactAssignmentList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactAssignmentList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedContactAssignmentList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedContactAssignmentList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactAssignmentList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactAssignmentList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedContactAssignmentList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedContactAssignmentList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedContactAssignmentList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedContactAssignmentList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactAssignmentList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactAssignmentList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedContactAssignmentList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedContactAssignmentList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedContactAssignmentList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedContactAssignmentList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedContactAssignmentList) GetResults() []ContactAssignment { + if o == nil || IsNil(o.Results) { + var ret []ContactAssignment + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactAssignmentList) GetResultsOk() ([]ContactAssignment, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedContactAssignmentList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ContactAssignment and assigns it to the Results field. +func (o *PaginatedContactAssignmentList) SetResults(v []ContactAssignment) { + o.Results = v +} + +func (o PaginatedContactAssignmentList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedContactAssignmentList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedContactAssignmentList) UnmarshalJSON(data []byte) (err error) { + varPaginatedContactAssignmentList := _PaginatedContactAssignmentList{} + + err = json.Unmarshal(data, &varPaginatedContactAssignmentList) + + if err != nil { + return err + } + + *o = PaginatedContactAssignmentList(varPaginatedContactAssignmentList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedContactAssignmentList struct { + value *PaginatedContactAssignmentList + isSet bool +} + +func (v NullablePaginatedContactAssignmentList) Get() *PaginatedContactAssignmentList { + return v.value +} + +func (v *NullablePaginatedContactAssignmentList) Set(val *PaginatedContactAssignmentList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedContactAssignmentList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedContactAssignmentList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedContactAssignmentList(val *PaginatedContactAssignmentList) *NullablePaginatedContactAssignmentList { + return &NullablePaginatedContactAssignmentList{value: val, isSet: true} +} + +func (v NullablePaginatedContactAssignmentList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedContactAssignmentList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_group_list.go new file mode 100644 index 00000000..4f920548 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedContactGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedContactGroupList{} + +// PaginatedContactGroupList struct for PaginatedContactGroupList +type PaginatedContactGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ContactGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedContactGroupList PaginatedContactGroupList + +// NewPaginatedContactGroupList instantiates a new PaginatedContactGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedContactGroupList() *PaginatedContactGroupList { + this := PaginatedContactGroupList{} + return &this +} + +// NewPaginatedContactGroupListWithDefaults instantiates a new PaginatedContactGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedContactGroupListWithDefaults() *PaginatedContactGroupList { + this := PaginatedContactGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedContactGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedContactGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedContactGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedContactGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedContactGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedContactGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedContactGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedContactGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedContactGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedContactGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedContactGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedContactGroupList) GetResults() []ContactGroup { + if o == nil || IsNil(o.Results) { + var ret []ContactGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactGroupList) GetResultsOk() ([]ContactGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedContactGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ContactGroup and assigns it to the Results field. +func (o *PaginatedContactGroupList) SetResults(v []ContactGroup) { + o.Results = v +} + +func (o PaginatedContactGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedContactGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedContactGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedContactGroupList := _PaginatedContactGroupList{} + + err = json.Unmarshal(data, &varPaginatedContactGroupList) + + if err != nil { + return err + } + + *o = PaginatedContactGroupList(varPaginatedContactGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedContactGroupList struct { + value *PaginatedContactGroupList + isSet bool +} + +func (v NullablePaginatedContactGroupList) Get() *PaginatedContactGroupList { + return v.value +} + +func (v *NullablePaginatedContactGroupList) Set(val *PaginatedContactGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedContactGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedContactGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedContactGroupList(val *PaginatedContactGroupList) *NullablePaginatedContactGroupList { + return &NullablePaginatedContactGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedContactGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedContactGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_list.go new file mode 100644 index 00000000..6222b1da --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedContactList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedContactList{} + +// PaginatedContactList struct for PaginatedContactList +type PaginatedContactList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Contact `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedContactList PaginatedContactList + +// NewPaginatedContactList instantiates a new PaginatedContactList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedContactList() *PaginatedContactList { + this := PaginatedContactList{} + return &this +} + +// NewPaginatedContactListWithDefaults instantiates a new PaginatedContactList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedContactListWithDefaults() *PaginatedContactList { + this := PaginatedContactList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedContactList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedContactList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedContactList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedContactList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedContactList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedContactList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedContactList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedContactList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedContactList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedContactList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedContactList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedContactList) GetResults() []Contact { + if o == nil || IsNil(o.Results) { + var ret []Contact + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactList) GetResultsOk() ([]Contact, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedContactList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Contact and assigns it to the Results field. +func (o *PaginatedContactList) SetResults(v []Contact) { + o.Results = v +} + +func (o PaginatedContactList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedContactList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedContactList) UnmarshalJSON(data []byte) (err error) { + varPaginatedContactList := _PaginatedContactList{} + + err = json.Unmarshal(data, &varPaginatedContactList) + + if err != nil { + return err + } + + *o = PaginatedContactList(varPaginatedContactList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedContactList struct { + value *PaginatedContactList + isSet bool +} + +func (v NullablePaginatedContactList) Get() *PaginatedContactList { + return v.value +} + +func (v *NullablePaginatedContactList) Set(val *PaginatedContactList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedContactList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedContactList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedContactList(val *PaginatedContactList) *NullablePaginatedContactList { + return &NullablePaginatedContactList{value: val, isSet: true} +} + +func (v NullablePaginatedContactList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedContactList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_role_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_role_list.go new file mode 100644 index 00000000..b5928909 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_contact_role_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedContactRoleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedContactRoleList{} + +// PaginatedContactRoleList struct for PaginatedContactRoleList +type PaginatedContactRoleList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ContactRole `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedContactRoleList PaginatedContactRoleList + +// NewPaginatedContactRoleList instantiates a new PaginatedContactRoleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedContactRoleList() *PaginatedContactRoleList { + this := PaginatedContactRoleList{} + return &this +} + +// NewPaginatedContactRoleListWithDefaults instantiates a new PaginatedContactRoleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedContactRoleListWithDefaults() *PaginatedContactRoleList { + this := PaginatedContactRoleList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedContactRoleList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactRoleList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedContactRoleList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedContactRoleList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactRoleList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactRoleList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedContactRoleList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedContactRoleList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedContactRoleList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedContactRoleList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContactRoleList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContactRoleList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedContactRoleList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedContactRoleList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedContactRoleList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedContactRoleList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedContactRoleList) GetResults() []ContactRole { + if o == nil || IsNil(o.Results) { + var ret []ContactRole + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContactRoleList) GetResultsOk() ([]ContactRole, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedContactRoleList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ContactRole and assigns it to the Results field. +func (o *PaginatedContactRoleList) SetResults(v []ContactRole) { + o.Results = v +} + +func (o PaginatedContactRoleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedContactRoleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedContactRoleList) UnmarshalJSON(data []byte) (err error) { + varPaginatedContactRoleList := _PaginatedContactRoleList{} + + err = json.Unmarshal(data, &varPaginatedContactRoleList) + + if err != nil { + return err + } + + *o = PaginatedContactRoleList(varPaginatedContactRoleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedContactRoleList struct { + value *PaginatedContactRoleList + isSet bool +} + +func (v NullablePaginatedContactRoleList) Get() *PaginatedContactRoleList { + return v.value +} + +func (v *NullablePaginatedContactRoleList) Set(val *PaginatedContactRoleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedContactRoleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedContactRoleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedContactRoleList(val *PaginatedContactRoleList) *NullablePaginatedContactRoleList { + return &NullablePaginatedContactRoleList{value: val, isSet: true} +} + +func (v NullablePaginatedContactRoleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedContactRoleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_content_type_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_content_type_list.go new file mode 100644 index 00000000..b15e4e0c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_content_type_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedContentTypeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedContentTypeList{} + +// PaginatedContentTypeList struct for PaginatedContentTypeList +type PaginatedContentTypeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ContentType `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedContentTypeList PaginatedContentTypeList + +// NewPaginatedContentTypeList instantiates a new PaginatedContentTypeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedContentTypeList() *PaginatedContentTypeList { + this := PaginatedContentTypeList{} + return &this +} + +// NewPaginatedContentTypeListWithDefaults instantiates a new PaginatedContentTypeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedContentTypeListWithDefaults() *PaginatedContentTypeList { + this := PaginatedContentTypeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedContentTypeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContentTypeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedContentTypeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedContentTypeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContentTypeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContentTypeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedContentTypeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedContentTypeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedContentTypeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedContentTypeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedContentTypeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedContentTypeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedContentTypeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedContentTypeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedContentTypeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedContentTypeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedContentTypeList) GetResults() []ContentType { + if o == nil || IsNil(o.Results) { + var ret []ContentType + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedContentTypeList) GetResultsOk() ([]ContentType, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedContentTypeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ContentType and assigns it to the Results field. +func (o *PaginatedContentTypeList) SetResults(v []ContentType) { + o.Results = v +} + +func (o PaginatedContentTypeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedContentTypeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedContentTypeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedContentTypeList := _PaginatedContentTypeList{} + + err = json.Unmarshal(data, &varPaginatedContentTypeList) + + if err != nil { + return err + } + + *o = PaginatedContentTypeList(varPaginatedContentTypeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedContentTypeList struct { + value *PaginatedContentTypeList + isSet bool +} + +func (v NullablePaginatedContentTypeList) Get() *PaginatedContentTypeList { + return v.value +} + +func (v *NullablePaginatedContentTypeList) Set(val *PaginatedContentTypeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedContentTypeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedContentTypeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedContentTypeList(val *PaginatedContentTypeList) *NullablePaginatedContentTypeList { + return &NullablePaginatedContentTypeList{value: val, isSet: true} +} + +func (v NullablePaginatedContentTypeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedContentTypeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_field_choice_set_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_field_choice_set_list.go new file mode 100644 index 00000000..ffa087c7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_field_choice_set_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCustomFieldChoiceSetList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCustomFieldChoiceSetList{} + +// PaginatedCustomFieldChoiceSetList struct for PaginatedCustomFieldChoiceSetList +type PaginatedCustomFieldChoiceSetList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []CustomFieldChoiceSet `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCustomFieldChoiceSetList PaginatedCustomFieldChoiceSetList + +// NewPaginatedCustomFieldChoiceSetList instantiates a new PaginatedCustomFieldChoiceSetList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCustomFieldChoiceSetList() *PaginatedCustomFieldChoiceSetList { + this := PaginatedCustomFieldChoiceSetList{} + return &this +} + +// NewPaginatedCustomFieldChoiceSetListWithDefaults instantiates a new PaginatedCustomFieldChoiceSetList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCustomFieldChoiceSetListWithDefaults() *PaginatedCustomFieldChoiceSetList { + this := PaginatedCustomFieldChoiceSetList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCustomFieldChoiceSetList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCustomFieldChoiceSetList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCustomFieldChoiceSetList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCustomFieldChoiceSetList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCustomFieldChoiceSetList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCustomFieldChoiceSetList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCustomFieldChoiceSetList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCustomFieldChoiceSetList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCustomFieldChoiceSetList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCustomFieldChoiceSetList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCustomFieldChoiceSetList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCustomFieldChoiceSetList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCustomFieldChoiceSetList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCustomFieldChoiceSetList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCustomFieldChoiceSetList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCustomFieldChoiceSetList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCustomFieldChoiceSetList) GetResults() []CustomFieldChoiceSet { + if o == nil || IsNil(o.Results) { + var ret []CustomFieldChoiceSet + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCustomFieldChoiceSetList) GetResultsOk() ([]CustomFieldChoiceSet, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCustomFieldChoiceSetList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []CustomFieldChoiceSet and assigns it to the Results field. +func (o *PaginatedCustomFieldChoiceSetList) SetResults(v []CustomFieldChoiceSet) { + o.Results = v +} + +func (o PaginatedCustomFieldChoiceSetList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCustomFieldChoiceSetList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCustomFieldChoiceSetList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCustomFieldChoiceSetList := _PaginatedCustomFieldChoiceSetList{} + + err = json.Unmarshal(data, &varPaginatedCustomFieldChoiceSetList) + + if err != nil { + return err + } + + *o = PaginatedCustomFieldChoiceSetList(varPaginatedCustomFieldChoiceSetList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCustomFieldChoiceSetList struct { + value *PaginatedCustomFieldChoiceSetList + isSet bool +} + +func (v NullablePaginatedCustomFieldChoiceSetList) Get() *PaginatedCustomFieldChoiceSetList { + return v.value +} + +func (v *NullablePaginatedCustomFieldChoiceSetList) Set(val *PaginatedCustomFieldChoiceSetList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCustomFieldChoiceSetList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCustomFieldChoiceSetList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCustomFieldChoiceSetList(val *PaginatedCustomFieldChoiceSetList) *NullablePaginatedCustomFieldChoiceSetList { + return &NullablePaginatedCustomFieldChoiceSetList{value: val, isSet: true} +} + +func (v NullablePaginatedCustomFieldChoiceSetList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCustomFieldChoiceSetList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_field_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_field_list.go new file mode 100644 index 00000000..28510d56 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_field_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCustomFieldList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCustomFieldList{} + +// PaginatedCustomFieldList struct for PaginatedCustomFieldList +type PaginatedCustomFieldList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []CustomField `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCustomFieldList PaginatedCustomFieldList + +// NewPaginatedCustomFieldList instantiates a new PaginatedCustomFieldList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCustomFieldList() *PaginatedCustomFieldList { + this := PaginatedCustomFieldList{} + return &this +} + +// NewPaginatedCustomFieldListWithDefaults instantiates a new PaginatedCustomFieldList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCustomFieldListWithDefaults() *PaginatedCustomFieldList { + this := PaginatedCustomFieldList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCustomFieldList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCustomFieldList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCustomFieldList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCustomFieldList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCustomFieldList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCustomFieldList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCustomFieldList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCustomFieldList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCustomFieldList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCustomFieldList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCustomFieldList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCustomFieldList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCustomFieldList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCustomFieldList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCustomFieldList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCustomFieldList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCustomFieldList) GetResults() []CustomField { + if o == nil || IsNil(o.Results) { + var ret []CustomField + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCustomFieldList) GetResultsOk() ([]CustomField, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCustomFieldList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []CustomField and assigns it to the Results field. +func (o *PaginatedCustomFieldList) SetResults(v []CustomField) { + o.Results = v +} + +func (o PaginatedCustomFieldList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCustomFieldList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCustomFieldList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCustomFieldList := _PaginatedCustomFieldList{} + + err = json.Unmarshal(data, &varPaginatedCustomFieldList) + + if err != nil { + return err + } + + *o = PaginatedCustomFieldList(varPaginatedCustomFieldList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCustomFieldList struct { + value *PaginatedCustomFieldList + isSet bool +} + +func (v NullablePaginatedCustomFieldList) Get() *PaginatedCustomFieldList { + return v.value +} + +func (v *NullablePaginatedCustomFieldList) Set(val *PaginatedCustomFieldList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCustomFieldList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCustomFieldList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCustomFieldList(val *PaginatedCustomFieldList) *NullablePaginatedCustomFieldList { + return &NullablePaginatedCustomFieldList{value: val, isSet: true} +} + +func (v NullablePaginatedCustomFieldList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCustomFieldList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_link_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_link_list.go new file mode 100644 index 00000000..132c5802 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_custom_link_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedCustomLinkList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCustomLinkList{} + +// PaginatedCustomLinkList struct for PaginatedCustomLinkList +type PaginatedCustomLinkList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []CustomLink `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCustomLinkList PaginatedCustomLinkList + +// NewPaginatedCustomLinkList instantiates a new PaginatedCustomLinkList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCustomLinkList() *PaginatedCustomLinkList { + this := PaginatedCustomLinkList{} + return &this +} + +// NewPaginatedCustomLinkListWithDefaults instantiates a new PaginatedCustomLinkList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCustomLinkListWithDefaults() *PaginatedCustomLinkList { + this := PaginatedCustomLinkList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedCustomLinkList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCustomLinkList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedCustomLinkList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedCustomLinkList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCustomLinkList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCustomLinkList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedCustomLinkList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedCustomLinkList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedCustomLinkList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedCustomLinkList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedCustomLinkList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedCustomLinkList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedCustomLinkList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedCustomLinkList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedCustomLinkList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedCustomLinkList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedCustomLinkList) GetResults() []CustomLink { + if o == nil || IsNil(o.Results) { + var ret []CustomLink + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedCustomLinkList) GetResultsOk() ([]CustomLink, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedCustomLinkList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []CustomLink and assigns it to the Results field. +func (o *PaginatedCustomLinkList) SetResults(v []CustomLink) { + o.Results = v +} + +func (o PaginatedCustomLinkList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCustomLinkList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCustomLinkList) UnmarshalJSON(data []byte) (err error) { + varPaginatedCustomLinkList := _PaginatedCustomLinkList{} + + err = json.Unmarshal(data, &varPaginatedCustomLinkList) + + if err != nil { + return err + } + + *o = PaginatedCustomLinkList(varPaginatedCustomLinkList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCustomLinkList struct { + value *PaginatedCustomLinkList + isSet bool +} + +func (v NullablePaginatedCustomLinkList) Get() *PaginatedCustomLinkList { + return v.value +} + +func (v *NullablePaginatedCustomLinkList) Set(val *PaginatedCustomLinkList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCustomLinkList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCustomLinkList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCustomLinkList(val *PaginatedCustomLinkList) *NullablePaginatedCustomLinkList { + return &NullablePaginatedCustomLinkList{value: val, isSet: true} +} + +func (v NullablePaginatedCustomLinkList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCustomLinkList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_data_file_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_data_file_list.go new file mode 100644 index 00000000..fe1ad6d2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_data_file_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedDataFileList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDataFileList{} + +// PaginatedDataFileList struct for PaginatedDataFileList +type PaginatedDataFileList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []DataFile `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDataFileList PaginatedDataFileList + +// NewPaginatedDataFileList instantiates a new PaginatedDataFileList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDataFileList() *PaginatedDataFileList { + this := PaginatedDataFileList{} + return &this +} + +// NewPaginatedDataFileListWithDefaults instantiates a new PaginatedDataFileList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDataFileListWithDefaults() *PaginatedDataFileList { + this := PaginatedDataFileList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedDataFileList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDataFileList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedDataFileList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedDataFileList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDataFileList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDataFileList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedDataFileList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedDataFileList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedDataFileList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedDataFileList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDataFileList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDataFileList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedDataFileList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedDataFileList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedDataFileList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedDataFileList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedDataFileList) GetResults() []DataFile { + if o == nil || IsNil(o.Results) { + var ret []DataFile + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDataFileList) GetResultsOk() ([]DataFile, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedDataFileList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []DataFile and assigns it to the Results field. +func (o *PaginatedDataFileList) SetResults(v []DataFile) { + o.Results = v +} + +func (o PaginatedDataFileList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDataFileList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDataFileList) UnmarshalJSON(data []byte) (err error) { + varPaginatedDataFileList := _PaginatedDataFileList{} + + err = json.Unmarshal(data, &varPaginatedDataFileList) + + if err != nil { + return err + } + + *o = PaginatedDataFileList(varPaginatedDataFileList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDataFileList struct { + value *PaginatedDataFileList + isSet bool +} + +func (v NullablePaginatedDataFileList) Get() *PaginatedDataFileList { + return v.value +} + +func (v *NullablePaginatedDataFileList) Set(val *PaginatedDataFileList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDataFileList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDataFileList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDataFileList(val *PaginatedDataFileList) *NullablePaginatedDataFileList { + return &NullablePaginatedDataFileList{value: val, isSet: true} +} + +func (v NullablePaginatedDataFileList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDataFileList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_data_source_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_data_source_list.go new file mode 100644 index 00000000..e4738f3f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_data_source_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedDataSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDataSourceList{} + +// PaginatedDataSourceList struct for PaginatedDataSourceList +type PaginatedDataSourceList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []DataSource `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDataSourceList PaginatedDataSourceList + +// NewPaginatedDataSourceList instantiates a new PaginatedDataSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDataSourceList() *PaginatedDataSourceList { + this := PaginatedDataSourceList{} + return &this +} + +// NewPaginatedDataSourceListWithDefaults instantiates a new PaginatedDataSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDataSourceListWithDefaults() *PaginatedDataSourceList { + this := PaginatedDataSourceList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedDataSourceList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDataSourceList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedDataSourceList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedDataSourceList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDataSourceList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDataSourceList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedDataSourceList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedDataSourceList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedDataSourceList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedDataSourceList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDataSourceList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDataSourceList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedDataSourceList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedDataSourceList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedDataSourceList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedDataSourceList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedDataSourceList) GetResults() []DataSource { + if o == nil || IsNil(o.Results) { + var ret []DataSource + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDataSourceList) GetResultsOk() ([]DataSource, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedDataSourceList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []DataSource and assigns it to the Results field. +func (o *PaginatedDataSourceList) SetResults(v []DataSource) { + o.Results = v +} + +func (o PaginatedDataSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDataSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDataSourceList) UnmarshalJSON(data []byte) (err error) { + varPaginatedDataSourceList := _PaginatedDataSourceList{} + + err = json.Unmarshal(data, &varPaginatedDataSourceList) + + if err != nil { + return err + } + + *o = PaginatedDataSourceList(varPaginatedDataSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDataSourceList struct { + value *PaginatedDataSourceList + isSet bool +} + +func (v NullablePaginatedDataSourceList) Get() *PaginatedDataSourceList { + return v.value +} + +func (v *NullablePaginatedDataSourceList) Set(val *PaginatedDataSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDataSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDataSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDataSourceList(val *PaginatedDataSourceList) *NullablePaginatedDataSourceList { + return &NullablePaginatedDataSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedDataSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDataSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_bay_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_bay_list.go new file mode 100644 index 00000000..9e4a9796 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_bay_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedDeviceBayList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDeviceBayList{} + +// PaginatedDeviceBayList struct for PaginatedDeviceBayList +type PaginatedDeviceBayList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []DeviceBay `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDeviceBayList PaginatedDeviceBayList + +// NewPaginatedDeviceBayList instantiates a new PaginatedDeviceBayList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDeviceBayList() *PaginatedDeviceBayList { + this := PaginatedDeviceBayList{} + return &this +} + +// NewPaginatedDeviceBayListWithDefaults instantiates a new PaginatedDeviceBayList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDeviceBayListWithDefaults() *PaginatedDeviceBayList { + this := PaginatedDeviceBayList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedDeviceBayList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceBayList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedDeviceBayList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedDeviceBayList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceBayList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceBayList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedDeviceBayList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedDeviceBayList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedDeviceBayList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedDeviceBayList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceBayList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceBayList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedDeviceBayList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedDeviceBayList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedDeviceBayList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedDeviceBayList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedDeviceBayList) GetResults() []DeviceBay { + if o == nil || IsNil(o.Results) { + var ret []DeviceBay + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceBayList) GetResultsOk() ([]DeviceBay, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedDeviceBayList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []DeviceBay and assigns it to the Results field. +func (o *PaginatedDeviceBayList) SetResults(v []DeviceBay) { + o.Results = v +} + +func (o PaginatedDeviceBayList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDeviceBayList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDeviceBayList) UnmarshalJSON(data []byte) (err error) { + varPaginatedDeviceBayList := _PaginatedDeviceBayList{} + + err = json.Unmarshal(data, &varPaginatedDeviceBayList) + + if err != nil { + return err + } + + *o = PaginatedDeviceBayList(varPaginatedDeviceBayList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDeviceBayList struct { + value *PaginatedDeviceBayList + isSet bool +} + +func (v NullablePaginatedDeviceBayList) Get() *PaginatedDeviceBayList { + return v.value +} + +func (v *NullablePaginatedDeviceBayList) Set(val *PaginatedDeviceBayList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDeviceBayList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDeviceBayList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDeviceBayList(val *PaginatedDeviceBayList) *NullablePaginatedDeviceBayList { + return &NullablePaginatedDeviceBayList{value: val, isSet: true} +} + +func (v NullablePaginatedDeviceBayList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDeviceBayList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_bay_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_bay_template_list.go new file mode 100644 index 00000000..7a2e401b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_bay_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedDeviceBayTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDeviceBayTemplateList{} + +// PaginatedDeviceBayTemplateList struct for PaginatedDeviceBayTemplateList +type PaginatedDeviceBayTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []DeviceBayTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDeviceBayTemplateList PaginatedDeviceBayTemplateList + +// NewPaginatedDeviceBayTemplateList instantiates a new PaginatedDeviceBayTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDeviceBayTemplateList() *PaginatedDeviceBayTemplateList { + this := PaginatedDeviceBayTemplateList{} + return &this +} + +// NewPaginatedDeviceBayTemplateListWithDefaults instantiates a new PaginatedDeviceBayTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDeviceBayTemplateListWithDefaults() *PaginatedDeviceBayTemplateList { + this := PaginatedDeviceBayTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedDeviceBayTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceBayTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedDeviceBayTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedDeviceBayTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceBayTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceBayTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedDeviceBayTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedDeviceBayTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedDeviceBayTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedDeviceBayTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceBayTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceBayTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedDeviceBayTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedDeviceBayTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedDeviceBayTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedDeviceBayTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedDeviceBayTemplateList) GetResults() []DeviceBayTemplate { + if o == nil || IsNil(o.Results) { + var ret []DeviceBayTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceBayTemplateList) GetResultsOk() ([]DeviceBayTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedDeviceBayTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []DeviceBayTemplate and assigns it to the Results field. +func (o *PaginatedDeviceBayTemplateList) SetResults(v []DeviceBayTemplate) { + o.Results = v +} + +func (o PaginatedDeviceBayTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDeviceBayTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDeviceBayTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedDeviceBayTemplateList := _PaginatedDeviceBayTemplateList{} + + err = json.Unmarshal(data, &varPaginatedDeviceBayTemplateList) + + if err != nil { + return err + } + + *o = PaginatedDeviceBayTemplateList(varPaginatedDeviceBayTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDeviceBayTemplateList struct { + value *PaginatedDeviceBayTemplateList + isSet bool +} + +func (v NullablePaginatedDeviceBayTemplateList) Get() *PaginatedDeviceBayTemplateList { + return v.value +} + +func (v *NullablePaginatedDeviceBayTemplateList) Set(val *PaginatedDeviceBayTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDeviceBayTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDeviceBayTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDeviceBayTemplateList(val *PaginatedDeviceBayTemplateList) *NullablePaginatedDeviceBayTemplateList { + return &NullablePaginatedDeviceBayTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedDeviceBayTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDeviceBayTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_role_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_role_list.go new file mode 100644 index 00000000..c1375369 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_role_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedDeviceRoleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDeviceRoleList{} + +// PaginatedDeviceRoleList struct for PaginatedDeviceRoleList +type PaginatedDeviceRoleList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []DeviceRole `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDeviceRoleList PaginatedDeviceRoleList + +// NewPaginatedDeviceRoleList instantiates a new PaginatedDeviceRoleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDeviceRoleList() *PaginatedDeviceRoleList { + this := PaginatedDeviceRoleList{} + return &this +} + +// NewPaginatedDeviceRoleListWithDefaults instantiates a new PaginatedDeviceRoleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDeviceRoleListWithDefaults() *PaginatedDeviceRoleList { + this := PaginatedDeviceRoleList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedDeviceRoleList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceRoleList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedDeviceRoleList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedDeviceRoleList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceRoleList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceRoleList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedDeviceRoleList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedDeviceRoleList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedDeviceRoleList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedDeviceRoleList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceRoleList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceRoleList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedDeviceRoleList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedDeviceRoleList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedDeviceRoleList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedDeviceRoleList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedDeviceRoleList) GetResults() []DeviceRole { + if o == nil || IsNil(o.Results) { + var ret []DeviceRole + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceRoleList) GetResultsOk() ([]DeviceRole, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedDeviceRoleList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []DeviceRole and assigns it to the Results field. +func (o *PaginatedDeviceRoleList) SetResults(v []DeviceRole) { + o.Results = v +} + +func (o PaginatedDeviceRoleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDeviceRoleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDeviceRoleList) UnmarshalJSON(data []byte) (err error) { + varPaginatedDeviceRoleList := _PaginatedDeviceRoleList{} + + err = json.Unmarshal(data, &varPaginatedDeviceRoleList) + + if err != nil { + return err + } + + *o = PaginatedDeviceRoleList(varPaginatedDeviceRoleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDeviceRoleList struct { + value *PaginatedDeviceRoleList + isSet bool +} + +func (v NullablePaginatedDeviceRoleList) Get() *PaginatedDeviceRoleList { + return v.value +} + +func (v *NullablePaginatedDeviceRoleList) Set(val *PaginatedDeviceRoleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDeviceRoleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDeviceRoleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDeviceRoleList(val *PaginatedDeviceRoleList) *NullablePaginatedDeviceRoleList { + return &NullablePaginatedDeviceRoleList{value: val, isSet: true} +} + +func (v NullablePaginatedDeviceRoleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDeviceRoleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_type_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_type_list.go new file mode 100644 index 00000000..71de9ea3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_type_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedDeviceTypeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDeviceTypeList{} + +// PaginatedDeviceTypeList struct for PaginatedDeviceTypeList +type PaginatedDeviceTypeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []DeviceType `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDeviceTypeList PaginatedDeviceTypeList + +// NewPaginatedDeviceTypeList instantiates a new PaginatedDeviceTypeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDeviceTypeList() *PaginatedDeviceTypeList { + this := PaginatedDeviceTypeList{} + return &this +} + +// NewPaginatedDeviceTypeListWithDefaults instantiates a new PaginatedDeviceTypeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDeviceTypeListWithDefaults() *PaginatedDeviceTypeList { + this := PaginatedDeviceTypeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedDeviceTypeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceTypeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedDeviceTypeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedDeviceTypeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceTypeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceTypeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedDeviceTypeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedDeviceTypeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedDeviceTypeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedDeviceTypeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceTypeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceTypeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedDeviceTypeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedDeviceTypeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedDeviceTypeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedDeviceTypeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedDeviceTypeList) GetResults() []DeviceType { + if o == nil || IsNil(o.Results) { + var ret []DeviceType + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceTypeList) GetResultsOk() ([]DeviceType, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedDeviceTypeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []DeviceType and assigns it to the Results field. +func (o *PaginatedDeviceTypeList) SetResults(v []DeviceType) { + o.Results = v +} + +func (o PaginatedDeviceTypeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDeviceTypeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDeviceTypeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedDeviceTypeList := _PaginatedDeviceTypeList{} + + err = json.Unmarshal(data, &varPaginatedDeviceTypeList) + + if err != nil { + return err + } + + *o = PaginatedDeviceTypeList(varPaginatedDeviceTypeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDeviceTypeList struct { + value *PaginatedDeviceTypeList + isSet bool +} + +func (v NullablePaginatedDeviceTypeList) Get() *PaginatedDeviceTypeList { + return v.value +} + +func (v *NullablePaginatedDeviceTypeList) Set(val *PaginatedDeviceTypeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDeviceTypeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDeviceTypeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDeviceTypeList(val *PaginatedDeviceTypeList) *NullablePaginatedDeviceTypeList { + return &NullablePaginatedDeviceTypeList{value: val, isSet: true} +} + +func (v NullablePaginatedDeviceTypeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDeviceTypeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_with_config_context_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_with_config_context_list.go new file mode 100644 index 00000000..e627b1e1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_device_with_config_context_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedDeviceWithConfigContextList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDeviceWithConfigContextList{} + +// PaginatedDeviceWithConfigContextList struct for PaginatedDeviceWithConfigContextList +type PaginatedDeviceWithConfigContextList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []DeviceWithConfigContext `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDeviceWithConfigContextList PaginatedDeviceWithConfigContextList + +// NewPaginatedDeviceWithConfigContextList instantiates a new PaginatedDeviceWithConfigContextList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDeviceWithConfigContextList() *PaginatedDeviceWithConfigContextList { + this := PaginatedDeviceWithConfigContextList{} + return &this +} + +// NewPaginatedDeviceWithConfigContextListWithDefaults instantiates a new PaginatedDeviceWithConfigContextList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDeviceWithConfigContextListWithDefaults() *PaginatedDeviceWithConfigContextList { + this := PaginatedDeviceWithConfigContextList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedDeviceWithConfigContextList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceWithConfigContextList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedDeviceWithConfigContextList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedDeviceWithConfigContextList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceWithConfigContextList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceWithConfigContextList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedDeviceWithConfigContextList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedDeviceWithConfigContextList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedDeviceWithConfigContextList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedDeviceWithConfigContextList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedDeviceWithConfigContextList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedDeviceWithConfigContextList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedDeviceWithConfigContextList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedDeviceWithConfigContextList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedDeviceWithConfigContextList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedDeviceWithConfigContextList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedDeviceWithConfigContextList) GetResults() []DeviceWithConfigContext { + if o == nil || IsNil(o.Results) { + var ret []DeviceWithConfigContext + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceWithConfigContextList) GetResultsOk() ([]DeviceWithConfigContext, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedDeviceWithConfigContextList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []DeviceWithConfigContext and assigns it to the Results field. +func (o *PaginatedDeviceWithConfigContextList) SetResults(v []DeviceWithConfigContext) { + o.Results = v +} + +func (o PaginatedDeviceWithConfigContextList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDeviceWithConfigContextList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDeviceWithConfigContextList) UnmarshalJSON(data []byte) (err error) { + varPaginatedDeviceWithConfigContextList := _PaginatedDeviceWithConfigContextList{} + + err = json.Unmarshal(data, &varPaginatedDeviceWithConfigContextList) + + if err != nil { + return err + } + + *o = PaginatedDeviceWithConfigContextList(varPaginatedDeviceWithConfigContextList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDeviceWithConfigContextList struct { + value *PaginatedDeviceWithConfigContextList + isSet bool +} + +func (v NullablePaginatedDeviceWithConfigContextList) Get() *PaginatedDeviceWithConfigContextList { + return v.value +} + +func (v *NullablePaginatedDeviceWithConfigContextList) Set(val *PaginatedDeviceWithConfigContextList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDeviceWithConfigContextList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDeviceWithConfigContextList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDeviceWithConfigContextList(val *PaginatedDeviceWithConfigContextList) *NullablePaginatedDeviceWithConfigContextList { + return &NullablePaginatedDeviceWithConfigContextList{value: val, isSet: true} +} + +func (v NullablePaginatedDeviceWithConfigContextList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDeviceWithConfigContextList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_event_rule_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_event_rule_list.go new file mode 100644 index 00000000..f9c8b367 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_event_rule_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedEventRuleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEventRuleList{} + +// PaginatedEventRuleList struct for PaginatedEventRuleList +type PaginatedEventRuleList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []EventRule `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEventRuleList PaginatedEventRuleList + +// NewPaginatedEventRuleList instantiates a new PaginatedEventRuleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEventRuleList() *PaginatedEventRuleList { + this := PaginatedEventRuleList{} + return &this +} + +// NewPaginatedEventRuleListWithDefaults instantiates a new PaginatedEventRuleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEventRuleListWithDefaults() *PaginatedEventRuleList { + this := PaginatedEventRuleList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedEventRuleList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedEventRuleList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedEventRuleList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedEventRuleList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedEventRuleList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedEventRuleList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedEventRuleList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedEventRuleList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedEventRuleList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedEventRuleList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedEventRuleList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedEventRuleList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedEventRuleList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedEventRuleList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedEventRuleList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedEventRuleList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedEventRuleList) GetResults() []EventRule { + if o == nil || IsNil(o.Results) { + var ret []EventRule + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedEventRuleList) GetResultsOk() ([]EventRule, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedEventRuleList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []EventRule and assigns it to the Results field. +func (o *PaginatedEventRuleList) SetResults(v []EventRule) { + o.Results = v +} + +func (o PaginatedEventRuleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEventRuleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEventRuleList) UnmarshalJSON(data []byte) (err error) { + varPaginatedEventRuleList := _PaginatedEventRuleList{} + + err = json.Unmarshal(data, &varPaginatedEventRuleList) + + if err != nil { + return err + } + + *o = PaginatedEventRuleList(varPaginatedEventRuleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEventRuleList struct { + value *PaginatedEventRuleList + isSet bool +} + +func (v NullablePaginatedEventRuleList) Get() *PaginatedEventRuleList { + return v.value +} + +func (v *NullablePaginatedEventRuleList) Set(val *PaginatedEventRuleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEventRuleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEventRuleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEventRuleList(val *PaginatedEventRuleList) *NullablePaginatedEventRuleList { + return &NullablePaginatedEventRuleList{value: val, isSet: true} +} + +func (v NullablePaginatedEventRuleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEventRuleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_export_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_export_template_list.go new file mode 100644 index 00000000..41c05b0e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_export_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedExportTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedExportTemplateList{} + +// PaginatedExportTemplateList struct for PaginatedExportTemplateList +type PaginatedExportTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ExportTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedExportTemplateList PaginatedExportTemplateList + +// NewPaginatedExportTemplateList instantiates a new PaginatedExportTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedExportTemplateList() *PaginatedExportTemplateList { + this := PaginatedExportTemplateList{} + return &this +} + +// NewPaginatedExportTemplateListWithDefaults instantiates a new PaginatedExportTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedExportTemplateListWithDefaults() *PaginatedExportTemplateList { + this := PaginatedExportTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedExportTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedExportTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedExportTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedExportTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedExportTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedExportTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedExportTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedExportTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedExportTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedExportTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedExportTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedExportTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedExportTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedExportTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedExportTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedExportTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedExportTemplateList) GetResults() []ExportTemplate { + if o == nil || IsNil(o.Results) { + var ret []ExportTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedExportTemplateList) GetResultsOk() ([]ExportTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedExportTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ExportTemplate and assigns it to the Results field. +func (o *PaginatedExportTemplateList) SetResults(v []ExportTemplate) { + o.Results = v +} + +func (o PaginatedExportTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedExportTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedExportTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedExportTemplateList := _PaginatedExportTemplateList{} + + err = json.Unmarshal(data, &varPaginatedExportTemplateList) + + if err != nil { + return err + } + + *o = PaginatedExportTemplateList(varPaginatedExportTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedExportTemplateList struct { + value *PaginatedExportTemplateList + isSet bool +} + +func (v NullablePaginatedExportTemplateList) Get() *PaginatedExportTemplateList { + return v.value +} + +func (v *NullablePaginatedExportTemplateList) Set(val *PaginatedExportTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedExportTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedExportTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedExportTemplateList(val *PaginatedExportTemplateList) *NullablePaginatedExportTemplateList { + return &NullablePaginatedExportTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedExportTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedExportTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_fhrp_group_assignment_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_fhrp_group_assignment_list.go new file mode 100644 index 00000000..180ae237 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_fhrp_group_assignment_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedFHRPGroupAssignmentList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedFHRPGroupAssignmentList{} + +// PaginatedFHRPGroupAssignmentList struct for PaginatedFHRPGroupAssignmentList +type PaginatedFHRPGroupAssignmentList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []FHRPGroupAssignment `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedFHRPGroupAssignmentList PaginatedFHRPGroupAssignmentList + +// NewPaginatedFHRPGroupAssignmentList instantiates a new PaginatedFHRPGroupAssignmentList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedFHRPGroupAssignmentList() *PaginatedFHRPGroupAssignmentList { + this := PaginatedFHRPGroupAssignmentList{} + return &this +} + +// NewPaginatedFHRPGroupAssignmentListWithDefaults instantiates a new PaginatedFHRPGroupAssignmentList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedFHRPGroupAssignmentListWithDefaults() *PaginatedFHRPGroupAssignmentList { + this := PaginatedFHRPGroupAssignmentList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedFHRPGroupAssignmentList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFHRPGroupAssignmentList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupAssignmentList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedFHRPGroupAssignmentList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFHRPGroupAssignmentList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFHRPGroupAssignmentList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupAssignmentList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedFHRPGroupAssignmentList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedFHRPGroupAssignmentList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedFHRPGroupAssignmentList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFHRPGroupAssignmentList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFHRPGroupAssignmentList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupAssignmentList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedFHRPGroupAssignmentList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedFHRPGroupAssignmentList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedFHRPGroupAssignmentList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedFHRPGroupAssignmentList) GetResults() []FHRPGroupAssignment { + if o == nil || IsNil(o.Results) { + var ret []FHRPGroupAssignment + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFHRPGroupAssignmentList) GetResultsOk() ([]FHRPGroupAssignment, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupAssignmentList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []FHRPGroupAssignment and assigns it to the Results field. +func (o *PaginatedFHRPGroupAssignmentList) SetResults(v []FHRPGroupAssignment) { + o.Results = v +} + +func (o PaginatedFHRPGroupAssignmentList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedFHRPGroupAssignmentList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedFHRPGroupAssignmentList) UnmarshalJSON(data []byte) (err error) { + varPaginatedFHRPGroupAssignmentList := _PaginatedFHRPGroupAssignmentList{} + + err = json.Unmarshal(data, &varPaginatedFHRPGroupAssignmentList) + + if err != nil { + return err + } + + *o = PaginatedFHRPGroupAssignmentList(varPaginatedFHRPGroupAssignmentList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedFHRPGroupAssignmentList struct { + value *PaginatedFHRPGroupAssignmentList + isSet bool +} + +func (v NullablePaginatedFHRPGroupAssignmentList) Get() *PaginatedFHRPGroupAssignmentList { + return v.value +} + +func (v *NullablePaginatedFHRPGroupAssignmentList) Set(val *PaginatedFHRPGroupAssignmentList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedFHRPGroupAssignmentList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedFHRPGroupAssignmentList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedFHRPGroupAssignmentList(val *PaginatedFHRPGroupAssignmentList) *NullablePaginatedFHRPGroupAssignmentList { + return &NullablePaginatedFHRPGroupAssignmentList{value: val, isSet: true} +} + +func (v NullablePaginatedFHRPGroupAssignmentList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedFHRPGroupAssignmentList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_fhrp_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_fhrp_group_list.go new file mode 100644 index 00000000..ad8af576 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_fhrp_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedFHRPGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedFHRPGroupList{} + +// PaginatedFHRPGroupList struct for PaginatedFHRPGroupList +type PaginatedFHRPGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []FHRPGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedFHRPGroupList PaginatedFHRPGroupList + +// NewPaginatedFHRPGroupList instantiates a new PaginatedFHRPGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedFHRPGroupList() *PaginatedFHRPGroupList { + this := PaginatedFHRPGroupList{} + return &this +} + +// NewPaginatedFHRPGroupListWithDefaults instantiates a new PaginatedFHRPGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedFHRPGroupListWithDefaults() *PaginatedFHRPGroupList { + this := PaginatedFHRPGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedFHRPGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFHRPGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedFHRPGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFHRPGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFHRPGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedFHRPGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedFHRPGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedFHRPGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFHRPGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFHRPGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedFHRPGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedFHRPGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedFHRPGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedFHRPGroupList) GetResults() []FHRPGroup { + if o == nil || IsNil(o.Results) { + var ret []FHRPGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFHRPGroupList) GetResultsOk() ([]FHRPGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedFHRPGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []FHRPGroup and assigns it to the Results field. +func (o *PaginatedFHRPGroupList) SetResults(v []FHRPGroup) { + o.Results = v +} + +func (o PaginatedFHRPGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedFHRPGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedFHRPGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedFHRPGroupList := _PaginatedFHRPGroupList{} + + err = json.Unmarshal(data, &varPaginatedFHRPGroupList) + + if err != nil { + return err + } + + *o = PaginatedFHRPGroupList(varPaginatedFHRPGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedFHRPGroupList struct { + value *PaginatedFHRPGroupList + isSet bool +} + +func (v NullablePaginatedFHRPGroupList) Get() *PaginatedFHRPGroupList { + return v.value +} + +func (v *NullablePaginatedFHRPGroupList) Set(val *PaginatedFHRPGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedFHRPGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedFHRPGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedFHRPGroupList(val *PaginatedFHRPGroupList) *NullablePaginatedFHRPGroupList { + return &NullablePaginatedFHRPGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedFHRPGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedFHRPGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_front_port_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_front_port_list.go new file mode 100644 index 00000000..57444a50 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_front_port_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedFrontPortList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedFrontPortList{} + +// PaginatedFrontPortList struct for PaginatedFrontPortList +type PaginatedFrontPortList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []FrontPort `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedFrontPortList PaginatedFrontPortList + +// NewPaginatedFrontPortList instantiates a new PaginatedFrontPortList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedFrontPortList() *PaginatedFrontPortList { + this := PaginatedFrontPortList{} + return &this +} + +// NewPaginatedFrontPortListWithDefaults instantiates a new PaginatedFrontPortList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedFrontPortListWithDefaults() *PaginatedFrontPortList { + this := PaginatedFrontPortList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedFrontPortList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFrontPortList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedFrontPortList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedFrontPortList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFrontPortList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFrontPortList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedFrontPortList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedFrontPortList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedFrontPortList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedFrontPortList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFrontPortList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFrontPortList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedFrontPortList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedFrontPortList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedFrontPortList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedFrontPortList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedFrontPortList) GetResults() []FrontPort { + if o == nil || IsNil(o.Results) { + var ret []FrontPort + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFrontPortList) GetResultsOk() ([]FrontPort, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedFrontPortList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []FrontPort and assigns it to the Results field. +func (o *PaginatedFrontPortList) SetResults(v []FrontPort) { + o.Results = v +} + +func (o PaginatedFrontPortList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedFrontPortList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedFrontPortList) UnmarshalJSON(data []byte) (err error) { + varPaginatedFrontPortList := _PaginatedFrontPortList{} + + err = json.Unmarshal(data, &varPaginatedFrontPortList) + + if err != nil { + return err + } + + *o = PaginatedFrontPortList(varPaginatedFrontPortList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedFrontPortList struct { + value *PaginatedFrontPortList + isSet bool +} + +func (v NullablePaginatedFrontPortList) Get() *PaginatedFrontPortList { + return v.value +} + +func (v *NullablePaginatedFrontPortList) Set(val *PaginatedFrontPortList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedFrontPortList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedFrontPortList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedFrontPortList(val *PaginatedFrontPortList) *NullablePaginatedFrontPortList { + return &NullablePaginatedFrontPortList{value: val, isSet: true} +} + +func (v NullablePaginatedFrontPortList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedFrontPortList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_front_port_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_front_port_template_list.go new file mode 100644 index 00000000..e914e8aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_front_port_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedFrontPortTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedFrontPortTemplateList{} + +// PaginatedFrontPortTemplateList struct for PaginatedFrontPortTemplateList +type PaginatedFrontPortTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []FrontPortTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedFrontPortTemplateList PaginatedFrontPortTemplateList + +// NewPaginatedFrontPortTemplateList instantiates a new PaginatedFrontPortTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedFrontPortTemplateList() *PaginatedFrontPortTemplateList { + this := PaginatedFrontPortTemplateList{} + return &this +} + +// NewPaginatedFrontPortTemplateListWithDefaults instantiates a new PaginatedFrontPortTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedFrontPortTemplateListWithDefaults() *PaginatedFrontPortTemplateList { + this := PaginatedFrontPortTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedFrontPortTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFrontPortTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedFrontPortTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedFrontPortTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFrontPortTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFrontPortTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedFrontPortTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedFrontPortTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedFrontPortTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedFrontPortTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedFrontPortTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedFrontPortTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedFrontPortTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedFrontPortTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedFrontPortTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedFrontPortTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedFrontPortTemplateList) GetResults() []FrontPortTemplate { + if o == nil || IsNil(o.Results) { + var ret []FrontPortTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedFrontPortTemplateList) GetResultsOk() ([]FrontPortTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedFrontPortTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []FrontPortTemplate and assigns it to the Results field. +func (o *PaginatedFrontPortTemplateList) SetResults(v []FrontPortTemplate) { + o.Results = v +} + +func (o PaginatedFrontPortTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedFrontPortTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedFrontPortTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedFrontPortTemplateList := _PaginatedFrontPortTemplateList{} + + err = json.Unmarshal(data, &varPaginatedFrontPortTemplateList) + + if err != nil { + return err + } + + *o = PaginatedFrontPortTemplateList(varPaginatedFrontPortTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedFrontPortTemplateList struct { + value *PaginatedFrontPortTemplateList + isSet bool +} + +func (v NullablePaginatedFrontPortTemplateList) Get() *PaginatedFrontPortTemplateList { + return v.value +} + +func (v *NullablePaginatedFrontPortTemplateList) Set(val *PaginatedFrontPortTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedFrontPortTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedFrontPortTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedFrontPortTemplateList(val *PaginatedFrontPortTemplateList) *NullablePaginatedFrontPortTemplateList { + return &NullablePaginatedFrontPortTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedFrontPortTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedFrontPortTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_group_list.go new file mode 100644 index 00000000..b04cdc05 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupList{} + +// PaginatedGroupList struct for PaginatedGroupList +type PaginatedGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Group `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupList PaginatedGroupList + +// NewPaginatedGroupList instantiates a new PaginatedGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupList() *PaginatedGroupList { + this := PaginatedGroupList{} + return &this +} + +// NewPaginatedGroupListWithDefaults instantiates a new PaginatedGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupListWithDefaults() *PaginatedGroupList { + this := PaginatedGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedGroupList) GetResults() []Group { + if o == nil || IsNil(o.Results) { + var ret []Group + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedGroupList) GetResultsOk() ([]Group, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Group and assigns it to the Results field. +func (o *PaginatedGroupList) SetResults(v []Group) { + o.Results = v +} + +func (o PaginatedGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedGroupList := _PaginatedGroupList{} + + err = json.Unmarshal(data, &varPaginatedGroupList) + + if err != nil { + return err + } + + *o = PaginatedGroupList(varPaginatedGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupList struct { + value *PaginatedGroupList + isSet bool +} + +func (v NullablePaginatedGroupList) Get() *PaginatedGroupList { + return v.value +} + +func (v *NullablePaginatedGroupList) Set(val *PaginatedGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupList(val *PaginatedGroupList) *NullablePaginatedGroupList { + return &NullablePaginatedGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ike_policy_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ike_policy_list.go new file mode 100644 index 00000000..23d91869 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ike_policy_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedIKEPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIKEPolicyList{} + +// PaginatedIKEPolicyList struct for PaginatedIKEPolicyList +type PaginatedIKEPolicyList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []IKEPolicy `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIKEPolicyList PaginatedIKEPolicyList + +// NewPaginatedIKEPolicyList instantiates a new PaginatedIKEPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIKEPolicyList() *PaginatedIKEPolicyList { + this := PaginatedIKEPolicyList{} + return &this +} + +// NewPaginatedIKEPolicyListWithDefaults instantiates a new PaginatedIKEPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIKEPolicyListWithDefaults() *PaginatedIKEPolicyList { + this := PaginatedIKEPolicyList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedIKEPolicyList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIKEPolicyList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedIKEPolicyList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedIKEPolicyList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIKEPolicyList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIKEPolicyList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedIKEPolicyList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedIKEPolicyList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedIKEPolicyList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedIKEPolicyList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIKEPolicyList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIKEPolicyList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedIKEPolicyList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedIKEPolicyList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedIKEPolicyList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedIKEPolicyList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedIKEPolicyList) GetResults() []IKEPolicy { + if o == nil || IsNil(o.Results) { + var ret []IKEPolicy + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIKEPolicyList) GetResultsOk() ([]IKEPolicy, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedIKEPolicyList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []IKEPolicy and assigns it to the Results field. +func (o *PaginatedIKEPolicyList) SetResults(v []IKEPolicy) { + o.Results = v +} + +func (o PaginatedIKEPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIKEPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIKEPolicyList) UnmarshalJSON(data []byte) (err error) { + varPaginatedIKEPolicyList := _PaginatedIKEPolicyList{} + + err = json.Unmarshal(data, &varPaginatedIKEPolicyList) + + if err != nil { + return err + } + + *o = PaginatedIKEPolicyList(varPaginatedIKEPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIKEPolicyList struct { + value *PaginatedIKEPolicyList + isSet bool +} + +func (v NullablePaginatedIKEPolicyList) Get() *PaginatedIKEPolicyList { + return v.value +} + +func (v *NullablePaginatedIKEPolicyList) Set(val *PaginatedIKEPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIKEPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIKEPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIKEPolicyList(val *PaginatedIKEPolicyList) *NullablePaginatedIKEPolicyList { + return &NullablePaginatedIKEPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedIKEPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIKEPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ike_proposal_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ike_proposal_list.go new file mode 100644 index 00000000..95dc9026 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ike_proposal_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedIKEProposalList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIKEProposalList{} + +// PaginatedIKEProposalList struct for PaginatedIKEProposalList +type PaginatedIKEProposalList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []IKEProposal `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIKEProposalList PaginatedIKEProposalList + +// NewPaginatedIKEProposalList instantiates a new PaginatedIKEProposalList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIKEProposalList() *PaginatedIKEProposalList { + this := PaginatedIKEProposalList{} + return &this +} + +// NewPaginatedIKEProposalListWithDefaults instantiates a new PaginatedIKEProposalList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIKEProposalListWithDefaults() *PaginatedIKEProposalList { + this := PaginatedIKEProposalList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedIKEProposalList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIKEProposalList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedIKEProposalList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedIKEProposalList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIKEProposalList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIKEProposalList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedIKEProposalList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedIKEProposalList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedIKEProposalList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedIKEProposalList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIKEProposalList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIKEProposalList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedIKEProposalList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedIKEProposalList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedIKEProposalList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedIKEProposalList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedIKEProposalList) GetResults() []IKEProposal { + if o == nil || IsNil(o.Results) { + var ret []IKEProposal + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIKEProposalList) GetResultsOk() ([]IKEProposal, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedIKEProposalList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []IKEProposal and assigns it to the Results field. +func (o *PaginatedIKEProposalList) SetResults(v []IKEProposal) { + o.Results = v +} + +func (o PaginatedIKEProposalList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIKEProposalList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIKEProposalList) UnmarshalJSON(data []byte) (err error) { + varPaginatedIKEProposalList := _PaginatedIKEProposalList{} + + err = json.Unmarshal(data, &varPaginatedIKEProposalList) + + if err != nil { + return err + } + + *o = PaginatedIKEProposalList(varPaginatedIKEProposalList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIKEProposalList struct { + value *PaginatedIKEProposalList + isSet bool +} + +func (v NullablePaginatedIKEProposalList) Get() *PaginatedIKEProposalList { + return v.value +} + +func (v *NullablePaginatedIKEProposalList) Set(val *PaginatedIKEProposalList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIKEProposalList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIKEProposalList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIKEProposalList(val *PaginatedIKEProposalList) *NullablePaginatedIKEProposalList { + return &NullablePaginatedIKEProposalList{value: val, isSet: true} +} + +func (v NullablePaginatedIKEProposalList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIKEProposalList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_image_attachment_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_image_attachment_list.go new file mode 100644 index 00000000..5d84f484 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_image_attachment_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedImageAttachmentList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedImageAttachmentList{} + +// PaginatedImageAttachmentList struct for PaginatedImageAttachmentList +type PaginatedImageAttachmentList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ImageAttachment `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedImageAttachmentList PaginatedImageAttachmentList + +// NewPaginatedImageAttachmentList instantiates a new PaginatedImageAttachmentList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedImageAttachmentList() *PaginatedImageAttachmentList { + this := PaginatedImageAttachmentList{} + return &this +} + +// NewPaginatedImageAttachmentListWithDefaults instantiates a new PaginatedImageAttachmentList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedImageAttachmentListWithDefaults() *PaginatedImageAttachmentList { + this := PaginatedImageAttachmentList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedImageAttachmentList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedImageAttachmentList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedImageAttachmentList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedImageAttachmentList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedImageAttachmentList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedImageAttachmentList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedImageAttachmentList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedImageAttachmentList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedImageAttachmentList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedImageAttachmentList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedImageAttachmentList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedImageAttachmentList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedImageAttachmentList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedImageAttachmentList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedImageAttachmentList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedImageAttachmentList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedImageAttachmentList) GetResults() []ImageAttachment { + if o == nil || IsNil(o.Results) { + var ret []ImageAttachment + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedImageAttachmentList) GetResultsOk() ([]ImageAttachment, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedImageAttachmentList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ImageAttachment and assigns it to the Results field. +func (o *PaginatedImageAttachmentList) SetResults(v []ImageAttachment) { + o.Results = v +} + +func (o PaginatedImageAttachmentList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedImageAttachmentList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedImageAttachmentList) UnmarshalJSON(data []byte) (err error) { + varPaginatedImageAttachmentList := _PaginatedImageAttachmentList{} + + err = json.Unmarshal(data, &varPaginatedImageAttachmentList) + + if err != nil { + return err + } + + *o = PaginatedImageAttachmentList(varPaginatedImageAttachmentList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedImageAttachmentList struct { + value *PaginatedImageAttachmentList + isSet bool +} + +func (v NullablePaginatedImageAttachmentList) Get() *PaginatedImageAttachmentList { + return v.value +} + +func (v *NullablePaginatedImageAttachmentList) Set(val *PaginatedImageAttachmentList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedImageAttachmentList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedImageAttachmentList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedImageAttachmentList(val *PaginatedImageAttachmentList) *NullablePaginatedImageAttachmentList { + return &NullablePaginatedImageAttachmentList{value: val, isSet: true} +} + +func (v NullablePaginatedImageAttachmentList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedImageAttachmentList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_interface_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_interface_list.go new file mode 100644 index 00000000..7764d8ce --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_interface_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedInterfaceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInterfaceList{} + +// PaginatedInterfaceList struct for PaginatedInterfaceList +type PaginatedInterfaceList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Interface `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInterfaceList PaginatedInterfaceList + +// NewPaginatedInterfaceList instantiates a new PaginatedInterfaceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInterfaceList() *PaginatedInterfaceList { + this := PaginatedInterfaceList{} + return &this +} + +// NewPaginatedInterfaceListWithDefaults instantiates a new PaginatedInterfaceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInterfaceListWithDefaults() *PaginatedInterfaceList { + this := PaginatedInterfaceList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedInterfaceList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInterfaceList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedInterfaceList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedInterfaceList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInterfaceList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInterfaceList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedInterfaceList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedInterfaceList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedInterfaceList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedInterfaceList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInterfaceList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInterfaceList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedInterfaceList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedInterfaceList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedInterfaceList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedInterfaceList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedInterfaceList) GetResults() []Interface { + if o == nil || IsNil(o.Results) { + var ret []Interface + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInterfaceList) GetResultsOk() ([]Interface, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedInterfaceList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Interface and assigns it to the Results field. +func (o *PaginatedInterfaceList) SetResults(v []Interface) { + o.Results = v +} + +func (o PaginatedInterfaceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInterfaceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInterfaceList) UnmarshalJSON(data []byte) (err error) { + varPaginatedInterfaceList := _PaginatedInterfaceList{} + + err = json.Unmarshal(data, &varPaginatedInterfaceList) + + if err != nil { + return err + } + + *o = PaginatedInterfaceList(varPaginatedInterfaceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInterfaceList struct { + value *PaginatedInterfaceList + isSet bool +} + +func (v NullablePaginatedInterfaceList) Get() *PaginatedInterfaceList { + return v.value +} + +func (v *NullablePaginatedInterfaceList) Set(val *PaginatedInterfaceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInterfaceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInterfaceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInterfaceList(val *PaginatedInterfaceList) *NullablePaginatedInterfaceList { + return &NullablePaginatedInterfaceList{value: val, isSet: true} +} + +func (v NullablePaginatedInterfaceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInterfaceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_interface_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_interface_template_list.go new file mode 100644 index 00000000..984ead5d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_interface_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedInterfaceTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInterfaceTemplateList{} + +// PaginatedInterfaceTemplateList struct for PaginatedInterfaceTemplateList +type PaginatedInterfaceTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []InterfaceTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInterfaceTemplateList PaginatedInterfaceTemplateList + +// NewPaginatedInterfaceTemplateList instantiates a new PaginatedInterfaceTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInterfaceTemplateList() *PaginatedInterfaceTemplateList { + this := PaginatedInterfaceTemplateList{} + return &this +} + +// NewPaginatedInterfaceTemplateListWithDefaults instantiates a new PaginatedInterfaceTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInterfaceTemplateListWithDefaults() *PaginatedInterfaceTemplateList { + this := PaginatedInterfaceTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedInterfaceTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInterfaceTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedInterfaceTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedInterfaceTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInterfaceTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInterfaceTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedInterfaceTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedInterfaceTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedInterfaceTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedInterfaceTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInterfaceTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInterfaceTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedInterfaceTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedInterfaceTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedInterfaceTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedInterfaceTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedInterfaceTemplateList) GetResults() []InterfaceTemplate { + if o == nil || IsNil(o.Results) { + var ret []InterfaceTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInterfaceTemplateList) GetResultsOk() ([]InterfaceTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedInterfaceTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []InterfaceTemplate and assigns it to the Results field. +func (o *PaginatedInterfaceTemplateList) SetResults(v []InterfaceTemplate) { + o.Results = v +} + +func (o PaginatedInterfaceTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInterfaceTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInterfaceTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedInterfaceTemplateList := _PaginatedInterfaceTemplateList{} + + err = json.Unmarshal(data, &varPaginatedInterfaceTemplateList) + + if err != nil { + return err + } + + *o = PaginatedInterfaceTemplateList(varPaginatedInterfaceTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInterfaceTemplateList struct { + value *PaginatedInterfaceTemplateList + isSet bool +} + +func (v NullablePaginatedInterfaceTemplateList) Get() *PaginatedInterfaceTemplateList { + return v.value +} + +func (v *NullablePaginatedInterfaceTemplateList) Set(val *PaginatedInterfaceTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInterfaceTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInterfaceTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInterfaceTemplateList(val *PaginatedInterfaceTemplateList) *NullablePaginatedInterfaceTemplateList { + return &NullablePaginatedInterfaceTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedInterfaceTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInterfaceTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_list.go new file mode 100644 index 00000000..5dc5754f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedInventoryItemList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInventoryItemList{} + +// PaginatedInventoryItemList struct for PaginatedInventoryItemList +type PaginatedInventoryItemList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []InventoryItem `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInventoryItemList PaginatedInventoryItemList + +// NewPaginatedInventoryItemList instantiates a new PaginatedInventoryItemList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInventoryItemList() *PaginatedInventoryItemList { + this := PaginatedInventoryItemList{} + return &this +} + +// NewPaginatedInventoryItemListWithDefaults instantiates a new PaginatedInventoryItemList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInventoryItemListWithDefaults() *PaginatedInventoryItemList { + this := PaginatedInventoryItemList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedInventoryItemList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInventoryItemList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedInventoryItemList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedInventoryItemList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInventoryItemList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInventoryItemList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedInventoryItemList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedInventoryItemList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedInventoryItemList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedInventoryItemList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInventoryItemList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInventoryItemList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedInventoryItemList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedInventoryItemList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedInventoryItemList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedInventoryItemList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedInventoryItemList) GetResults() []InventoryItem { + if o == nil || IsNil(o.Results) { + var ret []InventoryItem + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInventoryItemList) GetResultsOk() ([]InventoryItem, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedInventoryItemList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []InventoryItem and assigns it to the Results field. +func (o *PaginatedInventoryItemList) SetResults(v []InventoryItem) { + o.Results = v +} + +func (o PaginatedInventoryItemList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInventoryItemList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInventoryItemList) UnmarshalJSON(data []byte) (err error) { + varPaginatedInventoryItemList := _PaginatedInventoryItemList{} + + err = json.Unmarshal(data, &varPaginatedInventoryItemList) + + if err != nil { + return err + } + + *o = PaginatedInventoryItemList(varPaginatedInventoryItemList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInventoryItemList struct { + value *PaginatedInventoryItemList + isSet bool +} + +func (v NullablePaginatedInventoryItemList) Get() *PaginatedInventoryItemList { + return v.value +} + +func (v *NullablePaginatedInventoryItemList) Set(val *PaginatedInventoryItemList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInventoryItemList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInventoryItemList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInventoryItemList(val *PaginatedInventoryItemList) *NullablePaginatedInventoryItemList { + return &NullablePaginatedInventoryItemList{value: val, isSet: true} +} + +func (v NullablePaginatedInventoryItemList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInventoryItemList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_role_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_role_list.go new file mode 100644 index 00000000..5110819a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_role_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedInventoryItemRoleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInventoryItemRoleList{} + +// PaginatedInventoryItemRoleList struct for PaginatedInventoryItemRoleList +type PaginatedInventoryItemRoleList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []InventoryItemRole `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInventoryItemRoleList PaginatedInventoryItemRoleList + +// NewPaginatedInventoryItemRoleList instantiates a new PaginatedInventoryItemRoleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInventoryItemRoleList() *PaginatedInventoryItemRoleList { + this := PaginatedInventoryItemRoleList{} + return &this +} + +// NewPaginatedInventoryItemRoleListWithDefaults instantiates a new PaginatedInventoryItemRoleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInventoryItemRoleListWithDefaults() *PaginatedInventoryItemRoleList { + this := PaginatedInventoryItemRoleList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedInventoryItemRoleList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInventoryItemRoleList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedInventoryItemRoleList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedInventoryItemRoleList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInventoryItemRoleList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInventoryItemRoleList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedInventoryItemRoleList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedInventoryItemRoleList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedInventoryItemRoleList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedInventoryItemRoleList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInventoryItemRoleList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInventoryItemRoleList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedInventoryItemRoleList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedInventoryItemRoleList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedInventoryItemRoleList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedInventoryItemRoleList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedInventoryItemRoleList) GetResults() []InventoryItemRole { + if o == nil || IsNil(o.Results) { + var ret []InventoryItemRole + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInventoryItemRoleList) GetResultsOk() ([]InventoryItemRole, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedInventoryItemRoleList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []InventoryItemRole and assigns it to the Results field. +func (o *PaginatedInventoryItemRoleList) SetResults(v []InventoryItemRole) { + o.Results = v +} + +func (o PaginatedInventoryItemRoleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInventoryItemRoleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInventoryItemRoleList) UnmarshalJSON(data []byte) (err error) { + varPaginatedInventoryItemRoleList := _PaginatedInventoryItemRoleList{} + + err = json.Unmarshal(data, &varPaginatedInventoryItemRoleList) + + if err != nil { + return err + } + + *o = PaginatedInventoryItemRoleList(varPaginatedInventoryItemRoleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInventoryItemRoleList struct { + value *PaginatedInventoryItemRoleList + isSet bool +} + +func (v NullablePaginatedInventoryItemRoleList) Get() *PaginatedInventoryItemRoleList { + return v.value +} + +func (v *NullablePaginatedInventoryItemRoleList) Set(val *PaginatedInventoryItemRoleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInventoryItemRoleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInventoryItemRoleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInventoryItemRoleList(val *PaginatedInventoryItemRoleList) *NullablePaginatedInventoryItemRoleList { + return &NullablePaginatedInventoryItemRoleList{value: val, isSet: true} +} + +func (v NullablePaginatedInventoryItemRoleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInventoryItemRoleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_template_list.go new file mode 100644 index 00000000..ae36aba8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_inventory_item_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedInventoryItemTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInventoryItemTemplateList{} + +// PaginatedInventoryItemTemplateList struct for PaginatedInventoryItemTemplateList +type PaginatedInventoryItemTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []InventoryItemTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInventoryItemTemplateList PaginatedInventoryItemTemplateList + +// NewPaginatedInventoryItemTemplateList instantiates a new PaginatedInventoryItemTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInventoryItemTemplateList() *PaginatedInventoryItemTemplateList { + this := PaginatedInventoryItemTemplateList{} + return &this +} + +// NewPaginatedInventoryItemTemplateListWithDefaults instantiates a new PaginatedInventoryItemTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInventoryItemTemplateListWithDefaults() *PaginatedInventoryItemTemplateList { + this := PaginatedInventoryItemTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedInventoryItemTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInventoryItemTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedInventoryItemTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedInventoryItemTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInventoryItemTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInventoryItemTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedInventoryItemTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedInventoryItemTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedInventoryItemTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedInventoryItemTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedInventoryItemTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedInventoryItemTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedInventoryItemTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedInventoryItemTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedInventoryItemTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedInventoryItemTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedInventoryItemTemplateList) GetResults() []InventoryItemTemplate { + if o == nil || IsNil(o.Results) { + var ret []InventoryItemTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedInventoryItemTemplateList) GetResultsOk() ([]InventoryItemTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedInventoryItemTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []InventoryItemTemplate and assigns it to the Results field. +func (o *PaginatedInventoryItemTemplateList) SetResults(v []InventoryItemTemplate) { + o.Results = v +} + +func (o PaginatedInventoryItemTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInventoryItemTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInventoryItemTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedInventoryItemTemplateList := _PaginatedInventoryItemTemplateList{} + + err = json.Unmarshal(data, &varPaginatedInventoryItemTemplateList) + + if err != nil { + return err + } + + *o = PaginatedInventoryItemTemplateList(varPaginatedInventoryItemTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInventoryItemTemplateList struct { + value *PaginatedInventoryItemTemplateList + isSet bool +} + +func (v NullablePaginatedInventoryItemTemplateList) Get() *PaginatedInventoryItemTemplateList { + return v.value +} + +func (v *NullablePaginatedInventoryItemTemplateList) Set(val *PaginatedInventoryItemTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInventoryItemTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInventoryItemTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInventoryItemTemplateList(val *PaginatedInventoryItemTemplateList) *NullablePaginatedInventoryItemTemplateList { + return &NullablePaginatedInventoryItemTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedInventoryItemTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInventoryItemTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_address_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_address_list.go new file mode 100644 index 00000000..d1a48293 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_address_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedIPAddressList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIPAddressList{} + +// PaginatedIPAddressList struct for PaginatedIPAddressList +type PaginatedIPAddressList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []IPAddress `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIPAddressList PaginatedIPAddressList + +// NewPaginatedIPAddressList instantiates a new PaginatedIPAddressList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIPAddressList() *PaginatedIPAddressList { + this := PaginatedIPAddressList{} + return &this +} + +// NewPaginatedIPAddressListWithDefaults instantiates a new PaginatedIPAddressList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIPAddressListWithDefaults() *PaginatedIPAddressList { + this := PaginatedIPAddressList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedIPAddressList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPAddressList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedIPAddressList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedIPAddressList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPAddressList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPAddressList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedIPAddressList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedIPAddressList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedIPAddressList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedIPAddressList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPAddressList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPAddressList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedIPAddressList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedIPAddressList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedIPAddressList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedIPAddressList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedIPAddressList) GetResults() []IPAddress { + if o == nil || IsNil(o.Results) { + var ret []IPAddress + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPAddressList) GetResultsOk() ([]IPAddress, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedIPAddressList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []IPAddress and assigns it to the Results field. +func (o *PaginatedIPAddressList) SetResults(v []IPAddress) { + o.Results = v +} + +func (o PaginatedIPAddressList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIPAddressList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIPAddressList) UnmarshalJSON(data []byte) (err error) { + varPaginatedIPAddressList := _PaginatedIPAddressList{} + + err = json.Unmarshal(data, &varPaginatedIPAddressList) + + if err != nil { + return err + } + + *o = PaginatedIPAddressList(varPaginatedIPAddressList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIPAddressList struct { + value *PaginatedIPAddressList + isSet bool +} + +func (v NullablePaginatedIPAddressList) Get() *PaginatedIPAddressList { + return v.value +} + +func (v *NullablePaginatedIPAddressList) Set(val *PaginatedIPAddressList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIPAddressList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIPAddressList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIPAddressList(val *PaginatedIPAddressList) *NullablePaginatedIPAddressList { + return &NullablePaginatedIPAddressList{value: val, isSet: true} +} + +func (v NullablePaginatedIPAddressList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIPAddressList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_range_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_range_list.go new file mode 100644 index 00000000..b05fa173 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_range_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedIPRangeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIPRangeList{} + +// PaginatedIPRangeList struct for PaginatedIPRangeList +type PaginatedIPRangeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []IPRange `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIPRangeList PaginatedIPRangeList + +// NewPaginatedIPRangeList instantiates a new PaginatedIPRangeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIPRangeList() *PaginatedIPRangeList { + this := PaginatedIPRangeList{} + return &this +} + +// NewPaginatedIPRangeListWithDefaults instantiates a new PaginatedIPRangeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIPRangeListWithDefaults() *PaginatedIPRangeList { + this := PaginatedIPRangeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedIPRangeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPRangeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedIPRangeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedIPRangeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPRangeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPRangeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedIPRangeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedIPRangeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedIPRangeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedIPRangeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPRangeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPRangeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedIPRangeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedIPRangeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedIPRangeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedIPRangeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedIPRangeList) GetResults() []IPRange { + if o == nil || IsNil(o.Results) { + var ret []IPRange + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPRangeList) GetResultsOk() ([]IPRange, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedIPRangeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []IPRange and assigns it to the Results field. +func (o *PaginatedIPRangeList) SetResults(v []IPRange) { + o.Results = v +} + +func (o PaginatedIPRangeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIPRangeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIPRangeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedIPRangeList := _PaginatedIPRangeList{} + + err = json.Unmarshal(data, &varPaginatedIPRangeList) + + if err != nil { + return err + } + + *o = PaginatedIPRangeList(varPaginatedIPRangeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIPRangeList struct { + value *PaginatedIPRangeList + isSet bool +} + +func (v NullablePaginatedIPRangeList) Get() *PaginatedIPRangeList { + return v.value +} + +func (v *NullablePaginatedIPRangeList) Set(val *PaginatedIPRangeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIPRangeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIPRangeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIPRangeList(val *PaginatedIPRangeList) *NullablePaginatedIPRangeList { + return &NullablePaginatedIPRangeList{value: val, isSet: true} +} + +func (v NullablePaginatedIPRangeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIPRangeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_policy_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_policy_list.go new file mode 100644 index 00000000..0dcf2d80 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_policy_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedIPSecPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIPSecPolicyList{} + +// PaginatedIPSecPolicyList struct for PaginatedIPSecPolicyList +type PaginatedIPSecPolicyList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []IPSecPolicy `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIPSecPolicyList PaginatedIPSecPolicyList + +// NewPaginatedIPSecPolicyList instantiates a new PaginatedIPSecPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIPSecPolicyList() *PaginatedIPSecPolicyList { + this := PaginatedIPSecPolicyList{} + return &this +} + +// NewPaginatedIPSecPolicyListWithDefaults instantiates a new PaginatedIPSecPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIPSecPolicyListWithDefaults() *PaginatedIPSecPolicyList { + this := PaginatedIPSecPolicyList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedIPSecPolicyList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPSecPolicyList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedIPSecPolicyList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedIPSecPolicyList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPSecPolicyList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPSecPolicyList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedIPSecPolicyList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedIPSecPolicyList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedIPSecPolicyList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedIPSecPolicyList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPSecPolicyList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPSecPolicyList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedIPSecPolicyList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedIPSecPolicyList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedIPSecPolicyList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedIPSecPolicyList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedIPSecPolicyList) GetResults() []IPSecPolicy { + if o == nil || IsNil(o.Results) { + var ret []IPSecPolicy + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPSecPolicyList) GetResultsOk() ([]IPSecPolicy, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedIPSecPolicyList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []IPSecPolicy and assigns it to the Results field. +func (o *PaginatedIPSecPolicyList) SetResults(v []IPSecPolicy) { + o.Results = v +} + +func (o PaginatedIPSecPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIPSecPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIPSecPolicyList) UnmarshalJSON(data []byte) (err error) { + varPaginatedIPSecPolicyList := _PaginatedIPSecPolicyList{} + + err = json.Unmarshal(data, &varPaginatedIPSecPolicyList) + + if err != nil { + return err + } + + *o = PaginatedIPSecPolicyList(varPaginatedIPSecPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIPSecPolicyList struct { + value *PaginatedIPSecPolicyList + isSet bool +} + +func (v NullablePaginatedIPSecPolicyList) Get() *PaginatedIPSecPolicyList { + return v.value +} + +func (v *NullablePaginatedIPSecPolicyList) Set(val *PaginatedIPSecPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIPSecPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIPSecPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIPSecPolicyList(val *PaginatedIPSecPolicyList) *NullablePaginatedIPSecPolicyList { + return &NullablePaginatedIPSecPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedIPSecPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIPSecPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_profile_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_profile_list.go new file mode 100644 index 00000000..3ebcfd7f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_profile_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedIPSecProfileList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIPSecProfileList{} + +// PaginatedIPSecProfileList struct for PaginatedIPSecProfileList +type PaginatedIPSecProfileList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []IPSecProfile `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIPSecProfileList PaginatedIPSecProfileList + +// NewPaginatedIPSecProfileList instantiates a new PaginatedIPSecProfileList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIPSecProfileList() *PaginatedIPSecProfileList { + this := PaginatedIPSecProfileList{} + return &this +} + +// NewPaginatedIPSecProfileListWithDefaults instantiates a new PaginatedIPSecProfileList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIPSecProfileListWithDefaults() *PaginatedIPSecProfileList { + this := PaginatedIPSecProfileList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedIPSecProfileList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPSecProfileList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedIPSecProfileList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedIPSecProfileList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPSecProfileList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPSecProfileList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedIPSecProfileList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedIPSecProfileList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedIPSecProfileList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedIPSecProfileList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPSecProfileList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPSecProfileList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedIPSecProfileList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedIPSecProfileList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedIPSecProfileList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedIPSecProfileList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedIPSecProfileList) GetResults() []IPSecProfile { + if o == nil || IsNil(o.Results) { + var ret []IPSecProfile + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPSecProfileList) GetResultsOk() ([]IPSecProfile, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedIPSecProfileList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []IPSecProfile and assigns it to the Results field. +func (o *PaginatedIPSecProfileList) SetResults(v []IPSecProfile) { + o.Results = v +} + +func (o PaginatedIPSecProfileList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIPSecProfileList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIPSecProfileList) UnmarshalJSON(data []byte) (err error) { + varPaginatedIPSecProfileList := _PaginatedIPSecProfileList{} + + err = json.Unmarshal(data, &varPaginatedIPSecProfileList) + + if err != nil { + return err + } + + *o = PaginatedIPSecProfileList(varPaginatedIPSecProfileList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIPSecProfileList struct { + value *PaginatedIPSecProfileList + isSet bool +} + +func (v NullablePaginatedIPSecProfileList) Get() *PaginatedIPSecProfileList { + return v.value +} + +func (v *NullablePaginatedIPSecProfileList) Set(val *PaginatedIPSecProfileList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIPSecProfileList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIPSecProfileList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIPSecProfileList(val *PaginatedIPSecProfileList) *NullablePaginatedIPSecProfileList { + return &NullablePaginatedIPSecProfileList{value: val, isSet: true} +} + +func (v NullablePaginatedIPSecProfileList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIPSecProfileList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_proposal_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_proposal_list.go new file mode 100644 index 00000000..291bc0b8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_ip_sec_proposal_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedIPSecProposalList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIPSecProposalList{} + +// PaginatedIPSecProposalList struct for PaginatedIPSecProposalList +type PaginatedIPSecProposalList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []IPSecProposal `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIPSecProposalList PaginatedIPSecProposalList + +// NewPaginatedIPSecProposalList instantiates a new PaginatedIPSecProposalList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIPSecProposalList() *PaginatedIPSecProposalList { + this := PaginatedIPSecProposalList{} + return &this +} + +// NewPaginatedIPSecProposalListWithDefaults instantiates a new PaginatedIPSecProposalList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIPSecProposalListWithDefaults() *PaginatedIPSecProposalList { + this := PaginatedIPSecProposalList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedIPSecProposalList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPSecProposalList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedIPSecProposalList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedIPSecProposalList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPSecProposalList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPSecProposalList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedIPSecProposalList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedIPSecProposalList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedIPSecProposalList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedIPSecProposalList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedIPSecProposalList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedIPSecProposalList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedIPSecProposalList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedIPSecProposalList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedIPSecProposalList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedIPSecProposalList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedIPSecProposalList) GetResults() []IPSecProposal { + if o == nil || IsNil(o.Results) { + var ret []IPSecProposal + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedIPSecProposalList) GetResultsOk() ([]IPSecProposal, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedIPSecProposalList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []IPSecProposal and assigns it to the Results field. +func (o *PaginatedIPSecProposalList) SetResults(v []IPSecProposal) { + o.Results = v +} + +func (o PaginatedIPSecProposalList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIPSecProposalList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIPSecProposalList) UnmarshalJSON(data []byte) (err error) { + varPaginatedIPSecProposalList := _PaginatedIPSecProposalList{} + + err = json.Unmarshal(data, &varPaginatedIPSecProposalList) + + if err != nil { + return err + } + + *o = PaginatedIPSecProposalList(varPaginatedIPSecProposalList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIPSecProposalList struct { + value *PaginatedIPSecProposalList + isSet bool +} + +func (v NullablePaginatedIPSecProposalList) Get() *PaginatedIPSecProposalList { + return v.value +} + +func (v *NullablePaginatedIPSecProposalList) Set(val *PaginatedIPSecProposalList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIPSecProposalList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIPSecProposalList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIPSecProposalList(val *PaginatedIPSecProposalList) *NullablePaginatedIPSecProposalList { + return &NullablePaginatedIPSecProposalList{value: val, isSet: true} +} + +func (v NullablePaginatedIPSecProposalList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIPSecProposalList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_job_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_job_list.go new file mode 100644 index 00000000..45acdc9d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_job_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedJobList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedJobList{} + +// PaginatedJobList struct for PaginatedJobList +type PaginatedJobList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Job `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedJobList PaginatedJobList + +// NewPaginatedJobList instantiates a new PaginatedJobList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedJobList() *PaginatedJobList { + this := PaginatedJobList{} + return &this +} + +// NewPaginatedJobListWithDefaults instantiates a new PaginatedJobList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedJobListWithDefaults() *PaginatedJobList { + this := PaginatedJobList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedJobList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedJobList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedJobList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedJobList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedJobList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedJobList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedJobList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedJobList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedJobList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedJobList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedJobList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedJobList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedJobList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedJobList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedJobList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedJobList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedJobList) GetResults() []Job { + if o == nil || IsNil(o.Results) { + var ret []Job + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedJobList) GetResultsOk() ([]Job, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedJobList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Job and assigns it to the Results field. +func (o *PaginatedJobList) SetResults(v []Job) { + o.Results = v +} + +func (o PaginatedJobList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedJobList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedJobList) UnmarshalJSON(data []byte) (err error) { + varPaginatedJobList := _PaginatedJobList{} + + err = json.Unmarshal(data, &varPaginatedJobList) + + if err != nil { + return err + } + + *o = PaginatedJobList(varPaginatedJobList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedJobList struct { + value *PaginatedJobList + isSet bool +} + +func (v NullablePaginatedJobList) Get() *PaginatedJobList { + return v.value +} + +func (v *NullablePaginatedJobList) Set(val *PaginatedJobList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedJobList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedJobList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedJobList(val *PaginatedJobList) *NullablePaginatedJobList { + return &NullablePaginatedJobList{value: val, isSet: true} +} + +func (v NullablePaginatedJobList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedJobList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_journal_entry_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_journal_entry_list.go new file mode 100644 index 00000000..ca2f6229 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_journal_entry_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedJournalEntryList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedJournalEntryList{} + +// PaginatedJournalEntryList struct for PaginatedJournalEntryList +type PaginatedJournalEntryList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []JournalEntry `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedJournalEntryList PaginatedJournalEntryList + +// NewPaginatedJournalEntryList instantiates a new PaginatedJournalEntryList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedJournalEntryList() *PaginatedJournalEntryList { + this := PaginatedJournalEntryList{} + return &this +} + +// NewPaginatedJournalEntryListWithDefaults instantiates a new PaginatedJournalEntryList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedJournalEntryListWithDefaults() *PaginatedJournalEntryList { + this := PaginatedJournalEntryList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedJournalEntryList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedJournalEntryList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedJournalEntryList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedJournalEntryList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedJournalEntryList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedJournalEntryList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedJournalEntryList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedJournalEntryList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedJournalEntryList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedJournalEntryList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedJournalEntryList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedJournalEntryList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedJournalEntryList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedJournalEntryList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedJournalEntryList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedJournalEntryList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedJournalEntryList) GetResults() []JournalEntry { + if o == nil || IsNil(o.Results) { + var ret []JournalEntry + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedJournalEntryList) GetResultsOk() ([]JournalEntry, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedJournalEntryList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []JournalEntry and assigns it to the Results field. +func (o *PaginatedJournalEntryList) SetResults(v []JournalEntry) { + o.Results = v +} + +func (o PaginatedJournalEntryList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedJournalEntryList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedJournalEntryList) UnmarshalJSON(data []byte) (err error) { + varPaginatedJournalEntryList := _PaginatedJournalEntryList{} + + err = json.Unmarshal(data, &varPaginatedJournalEntryList) + + if err != nil { + return err + } + + *o = PaginatedJournalEntryList(varPaginatedJournalEntryList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedJournalEntryList struct { + value *PaginatedJournalEntryList + isSet bool +} + +func (v NullablePaginatedJournalEntryList) Get() *PaginatedJournalEntryList { + return v.value +} + +func (v *NullablePaginatedJournalEntryList) Set(val *PaginatedJournalEntryList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedJournalEntryList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedJournalEntryList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedJournalEntryList(val *PaginatedJournalEntryList) *NullablePaginatedJournalEntryList { + return &NullablePaginatedJournalEntryList{value: val, isSet: true} +} + +func (v NullablePaginatedJournalEntryList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedJournalEntryList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_l2_vpn_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_l2_vpn_list.go new file mode 100644 index 00000000..cf8b23b0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_l2_vpn_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedL2VPNList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedL2VPNList{} + +// PaginatedL2VPNList struct for PaginatedL2VPNList +type PaginatedL2VPNList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []L2VPN `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedL2VPNList PaginatedL2VPNList + +// NewPaginatedL2VPNList instantiates a new PaginatedL2VPNList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedL2VPNList() *PaginatedL2VPNList { + this := PaginatedL2VPNList{} + return &this +} + +// NewPaginatedL2VPNListWithDefaults instantiates a new PaginatedL2VPNList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedL2VPNListWithDefaults() *PaginatedL2VPNList { + this := PaginatedL2VPNList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedL2VPNList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedL2VPNList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedL2VPNList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedL2VPNList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedL2VPNList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedL2VPNList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedL2VPNList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedL2VPNList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedL2VPNList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedL2VPNList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedL2VPNList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedL2VPNList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedL2VPNList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedL2VPNList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedL2VPNList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedL2VPNList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedL2VPNList) GetResults() []L2VPN { + if o == nil || IsNil(o.Results) { + var ret []L2VPN + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedL2VPNList) GetResultsOk() ([]L2VPN, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedL2VPNList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []L2VPN and assigns it to the Results field. +func (o *PaginatedL2VPNList) SetResults(v []L2VPN) { + o.Results = v +} + +func (o PaginatedL2VPNList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedL2VPNList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedL2VPNList) UnmarshalJSON(data []byte) (err error) { + varPaginatedL2VPNList := _PaginatedL2VPNList{} + + err = json.Unmarshal(data, &varPaginatedL2VPNList) + + if err != nil { + return err + } + + *o = PaginatedL2VPNList(varPaginatedL2VPNList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedL2VPNList struct { + value *PaginatedL2VPNList + isSet bool +} + +func (v NullablePaginatedL2VPNList) Get() *PaginatedL2VPNList { + return v.value +} + +func (v *NullablePaginatedL2VPNList) Set(val *PaginatedL2VPNList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedL2VPNList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedL2VPNList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedL2VPNList(val *PaginatedL2VPNList) *NullablePaginatedL2VPNList { + return &NullablePaginatedL2VPNList{value: val, isSet: true} +} + +func (v NullablePaginatedL2VPNList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedL2VPNList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_l2_vpn_termination_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_l2_vpn_termination_list.go new file mode 100644 index 00000000..fe9a1efc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_l2_vpn_termination_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedL2VPNTerminationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedL2VPNTerminationList{} + +// PaginatedL2VPNTerminationList struct for PaginatedL2VPNTerminationList +type PaginatedL2VPNTerminationList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []L2VPNTermination `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedL2VPNTerminationList PaginatedL2VPNTerminationList + +// NewPaginatedL2VPNTerminationList instantiates a new PaginatedL2VPNTerminationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedL2VPNTerminationList() *PaginatedL2VPNTerminationList { + this := PaginatedL2VPNTerminationList{} + return &this +} + +// NewPaginatedL2VPNTerminationListWithDefaults instantiates a new PaginatedL2VPNTerminationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedL2VPNTerminationListWithDefaults() *PaginatedL2VPNTerminationList { + this := PaginatedL2VPNTerminationList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedL2VPNTerminationList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedL2VPNTerminationList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedL2VPNTerminationList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedL2VPNTerminationList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedL2VPNTerminationList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedL2VPNTerminationList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedL2VPNTerminationList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedL2VPNTerminationList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedL2VPNTerminationList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedL2VPNTerminationList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedL2VPNTerminationList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedL2VPNTerminationList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedL2VPNTerminationList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedL2VPNTerminationList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedL2VPNTerminationList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedL2VPNTerminationList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedL2VPNTerminationList) GetResults() []L2VPNTermination { + if o == nil || IsNil(o.Results) { + var ret []L2VPNTermination + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedL2VPNTerminationList) GetResultsOk() ([]L2VPNTermination, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedL2VPNTerminationList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []L2VPNTermination and assigns it to the Results field. +func (o *PaginatedL2VPNTerminationList) SetResults(v []L2VPNTermination) { + o.Results = v +} + +func (o PaginatedL2VPNTerminationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedL2VPNTerminationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedL2VPNTerminationList) UnmarshalJSON(data []byte) (err error) { + varPaginatedL2VPNTerminationList := _PaginatedL2VPNTerminationList{} + + err = json.Unmarshal(data, &varPaginatedL2VPNTerminationList) + + if err != nil { + return err + } + + *o = PaginatedL2VPNTerminationList(varPaginatedL2VPNTerminationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedL2VPNTerminationList struct { + value *PaginatedL2VPNTerminationList + isSet bool +} + +func (v NullablePaginatedL2VPNTerminationList) Get() *PaginatedL2VPNTerminationList { + return v.value +} + +func (v *NullablePaginatedL2VPNTerminationList) Set(val *PaginatedL2VPNTerminationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedL2VPNTerminationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedL2VPNTerminationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedL2VPNTerminationList(val *PaginatedL2VPNTerminationList) *NullablePaginatedL2VPNTerminationList { + return &NullablePaginatedL2VPNTerminationList{value: val, isSet: true} +} + +func (v NullablePaginatedL2VPNTerminationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedL2VPNTerminationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_location_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_location_list.go new file mode 100644 index 00000000..b22c8263 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_location_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedLocationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLocationList{} + +// PaginatedLocationList struct for PaginatedLocationList +type PaginatedLocationList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Location `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLocationList PaginatedLocationList + +// NewPaginatedLocationList instantiates a new PaginatedLocationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLocationList() *PaginatedLocationList { + this := PaginatedLocationList{} + return &this +} + +// NewPaginatedLocationListWithDefaults instantiates a new PaginatedLocationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLocationListWithDefaults() *PaginatedLocationList { + this := PaginatedLocationList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedLocationList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedLocationList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedLocationList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedLocationList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedLocationList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedLocationList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedLocationList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedLocationList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedLocationList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedLocationList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedLocationList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedLocationList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedLocationList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedLocationList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedLocationList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedLocationList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedLocationList) GetResults() []Location { + if o == nil || IsNil(o.Results) { + var ret []Location + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedLocationList) GetResultsOk() ([]Location, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedLocationList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Location and assigns it to the Results field. +func (o *PaginatedLocationList) SetResults(v []Location) { + o.Results = v +} + +func (o PaginatedLocationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLocationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLocationList) UnmarshalJSON(data []byte) (err error) { + varPaginatedLocationList := _PaginatedLocationList{} + + err = json.Unmarshal(data, &varPaginatedLocationList) + + if err != nil { + return err + } + + *o = PaginatedLocationList(varPaginatedLocationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLocationList struct { + value *PaginatedLocationList + isSet bool +} + +func (v NullablePaginatedLocationList) Get() *PaginatedLocationList { + return v.value +} + +func (v *NullablePaginatedLocationList) Set(val *PaginatedLocationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLocationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLocationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLocationList(val *PaginatedLocationList) *NullablePaginatedLocationList { + return &NullablePaginatedLocationList{value: val, isSet: true} +} + +func (v NullablePaginatedLocationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLocationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_manufacturer_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_manufacturer_list.go new file mode 100644 index 00000000..618b2782 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_manufacturer_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedManufacturerList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedManufacturerList{} + +// PaginatedManufacturerList struct for PaginatedManufacturerList +type PaginatedManufacturerList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Manufacturer `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedManufacturerList PaginatedManufacturerList + +// NewPaginatedManufacturerList instantiates a new PaginatedManufacturerList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedManufacturerList() *PaginatedManufacturerList { + this := PaginatedManufacturerList{} + return &this +} + +// NewPaginatedManufacturerListWithDefaults instantiates a new PaginatedManufacturerList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedManufacturerListWithDefaults() *PaginatedManufacturerList { + this := PaginatedManufacturerList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedManufacturerList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedManufacturerList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedManufacturerList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedManufacturerList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedManufacturerList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedManufacturerList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedManufacturerList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedManufacturerList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedManufacturerList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedManufacturerList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedManufacturerList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedManufacturerList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedManufacturerList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedManufacturerList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedManufacturerList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedManufacturerList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedManufacturerList) GetResults() []Manufacturer { + if o == nil || IsNil(o.Results) { + var ret []Manufacturer + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedManufacturerList) GetResultsOk() ([]Manufacturer, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedManufacturerList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Manufacturer and assigns it to the Results field. +func (o *PaginatedManufacturerList) SetResults(v []Manufacturer) { + o.Results = v +} + +func (o PaginatedManufacturerList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedManufacturerList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedManufacturerList) UnmarshalJSON(data []byte) (err error) { + varPaginatedManufacturerList := _PaginatedManufacturerList{} + + err = json.Unmarshal(data, &varPaginatedManufacturerList) + + if err != nil { + return err + } + + *o = PaginatedManufacturerList(varPaginatedManufacturerList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedManufacturerList struct { + value *PaginatedManufacturerList + isSet bool +} + +func (v NullablePaginatedManufacturerList) Get() *PaginatedManufacturerList { + return v.value +} + +func (v *NullablePaginatedManufacturerList) Set(val *PaginatedManufacturerList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedManufacturerList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedManufacturerList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedManufacturerList(val *PaginatedManufacturerList) *NullablePaginatedManufacturerList { + return &NullablePaginatedManufacturerList{value: val, isSet: true} +} + +func (v NullablePaginatedManufacturerList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedManufacturerList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_bay_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_bay_list.go new file mode 100644 index 00000000..37dbd2e1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_bay_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedModuleBayList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedModuleBayList{} + +// PaginatedModuleBayList struct for PaginatedModuleBayList +type PaginatedModuleBayList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ModuleBay `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedModuleBayList PaginatedModuleBayList + +// NewPaginatedModuleBayList instantiates a new PaginatedModuleBayList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedModuleBayList() *PaginatedModuleBayList { + this := PaginatedModuleBayList{} + return &this +} + +// NewPaginatedModuleBayListWithDefaults instantiates a new PaginatedModuleBayList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedModuleBayListWithDefaults() *PaginatedModuleBayList { + this := PaginatedModuleBayList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedModuleBayList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleBayList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedModuleBayList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedModuleBayList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleBayList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleBayList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedModuleBayList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedModuleBayList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedModuleBayList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedModuleBayList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleBayList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleBayList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedModuleBayList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedModuleBayList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedModuleBayList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedModuleBayList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedModuleBayList) GetResults() []ModuleBay { + if o == nil || IsNil(o.Results) { + var ret []ModuleBay + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleBayList) GetResultsOk() ([]ModuleBay, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedModuleBayList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ModuleBay and assigns it to the Results field. +func (o *PaginatedModuleBayList) SetResults(v []ModuleBay) { + o.Results = v +} + +func (o PaginatedModuleBayList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedModuleBayList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedModuleBayList) UnmarshalJSON(data []byte) (err error) { + varPaginatedModuleBayList := _PaginatedModuleBayList{} + + err = json.Unmarshal(data, &varPaginatedModuleBayList) + + if err != nil { + return err + } + + *o = PaginatedModuleBayList(varPaginatedModuleBayList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedModuleBayList struct { + value *PaginatedModuleBayList + isSet bool +} + +func (v NullablePaginatedModuleBayList) Get() *PaginatedModuleBayList { + return v.value +} + +func (v *NullablePaginatedModuleBayList) Set(val *PaginatedModuleBayList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedModuleBayList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedModuleBayList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedModuleBayList(val *PaginatedModuleBayList) *NullablePaginatedModuleBayList { + return &NullablePaginatedModuleBayList{value: val, isSet: true} +} + +func (v NullablePaginatedModuleBayList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedModuleBayList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_bay_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_bay_template_list.go new file mode 100644 index 00000000..49710c0a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_bay_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedModuleBayTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedModuleBayTemplateList{} + +// PaginatedModuleBayTemplateList struct for PaginatedModuleBayTemplateList +type PaginatedModuleBayTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ModuleBayTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedModuleBayTemplateList PaginatedModuleBayTemplateList + +// NewPaginatedModuleBayTemplateList instantiates a new PaginatedModuleBayTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedModuleBayTemplateList() *PaginatedModuleBayTemplateList { + this := PaginatedModuleBayTemplateList{} + return &this +} + +// NewPaginatedModuleBayTemplateListWithDefaults instantiates a new PaginatedModuleBayTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedModuleBayTemplateListWithDefaults() *PaginatedModuleBayTemplateList { + this := PaginatedModuleBayTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedModuleBayTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleBayTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedModuleBayTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedModuleBayTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleBayTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleBayTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedModuleBayTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedModuleBayTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedModuleBayTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedModuleBayTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleBayTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleBayTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedModuleBayTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedModuleBayTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedModuleBayTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedModuleBayTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedModuleBayTemplateList) GetResults() []ModuleBayTemplate { + if o == nil || IsNil(o.Results) { + var ret []ModuleBayTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleBayTemplateList) GetResultsOk() ([]ModuleBayTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedModuleBayTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ModuleBayTemplate and assigns it to the Results field. +func (o *PaginatedModuleBayTemplateList) SetResults(v []ModuleBayTemplate) { + o.Results = v +} + +func (o PaginatedModuleBayTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedModuleBayTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedModuleBayTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedModuleBayTemplateList := _PaginatedModuleBayTemplateList{} + + err = json.Unmarshal(data, &varPaginatedModuleBayTemplateList) + + if err != nil { + return err + } + + *o = PaginatedModuleBayTemplateList(varPaginatedModuleBayTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedModuleBayTemplateList struct { + value *PaginatedModuleBayTemplateList + isSet bool +} + +func (v NullablePaginatedModuleBayTemplateList) Get() *PaginatedModuleBayTemplateList { + return v.value +} + +func (v *NullablePaginatedModuleBayTemplateList) Set(val *PaginatedModuleBayTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedModuleBayTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedModuleBayTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedModuleBayTemplateList(val *PaginatedModuleBayTemplateList) *NullablePaginatedModuleBayTemplateList { + return &NullablePaginatedModuleBayTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedModuleBayTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedModuleBayTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_list.go new file mode 100644 index 00000000..cc0e9332 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedModuleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedModuleList{} + +// PaginatedModuleList struct for PaginatedModuleList +type PaginatedModuleList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Module `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedModuleList PaginatedModuleList + +// NewPaginatedModuleList instantiates a new PaginatedModuleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedModuleList() *PaginatedModuleList { + this := PaginatedModuleList{} + return &this +} + +// NewPaginatedModuleListWithDefaults instantiates a new PaginatedModuleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedModuleListWithDefaults() *PaginatedModuleList { + this := PaginatedModuleList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedModuleList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedModuleList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedModuleList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedModuleList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedModuleList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedModuleList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedModuleList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedModuleList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedModuleList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedModuleList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedModuleList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedModuleList) GetResults() []Module { + if o == nil || IsNil(o.Results) { + var ret []Module + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleList) GetResultsOk() ([]Module, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedModuleList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Module and assigns it to the Results field. +func (o *PaginatedModuleList) SetResults(v []Module) { + o.Results = v +} + +func (o PaginatedModuleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedModuleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedModuleList) UnmarshalJSON(data []byte) (err error) { + varPaginatedModuleList := _PaginatedModuleList{} + + err = json.Unmarshal(data, &varPaginatedModuleList) + + if err != nil { + return err + } + + *o = PaginatedModuleList(varPaginatedModuleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedModuleList struct { + value *PaginatedModuleList + isSet bool +} + +func (v NullablePaginatedModuleList) Get() *PaginatedModuleList { + return v.value +} + +func (v *NullablePaginatedModuleList) Set(val *PaginatedModuleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedModuleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedModuleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedModuleList(val *PaginatedModuleList) *NullablePaginatedModuleList { + return &NullablePaginatedModuleList{value: val, isSet: true} +} + +func (v NullablePaginatedModuleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedModuleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_type_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_type_list.go new file mode 100644 index 00000000..72cf89dd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_module_type_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedModuleTypeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedModuleTypeList{} + +// PaginatedModuleTypeList struct for PaginatedModuleTypeList +type PaginatedModuleTypeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ModuleType `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedModuleTypeList PaginatedModuleTypeList + +// NewPaginatedModuleTypeList instantiates a new PaginatedModuleTypeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedModuleTypeList() *PaginatedModuleTypeList { + this := PaginatedModuleTypeList{} + return &this +} + +// NewPaginatedModuleTypeListWithDefaults instantiates a new PaginatedModuleTypeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedModuleTypeListWithDefaults() *PaginatedModuleTypeList { + this := PaginatedModuleTypeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedModuleTypeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleTypeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedModuleTypeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedModuleTypeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleTypeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleTypeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedModuleTypeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedModuleTypeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedModuleTypeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedModuleTypeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedModuleTypeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedModuleTypeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedModuleTypeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedModuleTypeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedModuleTypeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedModuleTypeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedModuleTypeList) GetResults() []ModuleType { + if o == nil || IsNil(o.Results) { + var ret []ModuleType + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedModuleTypeList) GetResultsOk() ([]ModuleType, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedModuleTypeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ModuleType and assigns it to the Results field. +func (o *PaginatedModuleTypeList) SetResults(v []ModuleType) { + o.Results = v +} + +func (o PaginatedModuleTypeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedModuleTypeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedModuleTypeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedModuleTypeList := _PaginatedModuleTypeList{} + + err = json.Unmarshal(data, &varPaginatedModuleTypeList) + + if err != nil { + return err + } + + *o = PaginatedModuleTypeList(varPaginatedModuleTypeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedModuleTypeList struct { + value *PaginatedModuleTypeList + isSet bool +} + +func (v NullablePaginatedModuleTypeList) Get() *PaginatedModuleTypeList { + return v.value +} + +func (v *NullablePaginatedModuleTypeList) Set(val *PaginatedModuleTypeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedModuleTypeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedModuleTypeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedModuleTypeList(val *PaginatedModuleTypeList) *NullablePaginatedModuleTypeList { + return &NullablePaginatedModuleTypeList{value: val, isSet: true} +} + +func (v NullablePaginatedModuleTypeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedModuleTypeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_object_change_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_object_change_list.go new file mode 100644 index 00000000..e45b113f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_object_change_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedObjectChangeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedObjectChangeList{} + +// PaginatedObjectChangeList struct for PaginatedObjectChangeList +type PaginatedObjectChangeList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ObjectChange `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedObjectChangeList PaginatedObjectChangeList + +// NewPaginatedObjectChangeList instantiates a new PaginatedObjectChangeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedObjectChangeList() *PaginatedObjectChangeList { + this := PaginatedObjectChangeList{} + return &this +} + +// NewPaginatedObjectChangeListWithDefaults instantiates a new PaginatedObjectChangeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedObjectChangeListWithDefaults() *PaginatedObjectChangeList { + this := PaginatedObjectChangeList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedObjectChangeList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedObjectChangeList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedObjectChangeList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedObjectChangeList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedObjectChangeList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedObjectChangeList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedObjectChangeList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedObjectChangeList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedObjectChangeList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedObjectChangeList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedObjectChangeList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedObjectChangeList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedObjectChangeList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedObjectChangeList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedObjectChangeList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedObjectChangeList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedObjectChangeList) GetResults() []ObjectChange { + if o == nil || IsNil(o.Results) { + var ret []ObjectChange + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedObjectChangeList) GetResultsOk() ([]ObjectChange, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedObjectChangeList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ObjectChange and assigns it to the Results field. +func (o *PaginatedObjectChangeList) SetResults(v []ObjectChange) { + o.Results = v +} + +func (o PaginatedObjectChangeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedObjectChangeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedObjectChangeList) UnmarshalJSON(data []byte) (err error) { + varPaginatedObjectChangeList := _PaginatedObjectChangeList{} + + err = json.Unmarshal(data, &varPaginatedObjectChangeList) + + if err != nil { + return err + } + + *o = PaginatedObjectChangeList(varPaginatedObjectChangeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedObjectChangeList struct { + value *PaginatedObjectChangeList + isSet bool +} + +func (v NullablePaginatedObjectChangeList) Get() *PaginatedObjectChangeList { + return v.value +} + +func (v *NullablePaginatedObjectChangeList) Set(val *PaginatedObjectChangeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedObjectChangeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedObjectChangeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedObjectChangeList(val *PaginatedObjectChangeList) *NullablePaginatedObjectChangeList { + return &NullablePaginatedObjectChangeList{value: val, isSet: true} +} + +func (v NullablePaginatedObjectChangeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedObjectChangeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_object_permission_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_object_permission_list.go new file mode 100644 index 00000000..6200ec26 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_object_permission_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedObjectPermissionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedObjectPermissionList{} + +// PaginatedObjectPermissionList struct for PaginatedObjectPermissionList +type PaginatedObjectPermissionList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ObjectPermission `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedObjectPermissionList PaginatedObjectPermissionList + +// NewPaginatedObjectPermissionList instantiates a new PaginatedObjectPermissionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedObjectPermissionList() *PaginatedObjectPermissionList { + this := PaginatedObjectPermissionList{} + return &this +} + +// NewPaginatedObjectPermissionListWithDefaults instantiates a new PaginatedObjectPermissionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedObjectPermissionListWithDefaults() *PaginatedObjectPermissionList { + this := PaginatedObjectPermissionList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedObjectPermissionList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedObjectPermissionList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedObjectPermissionList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedObjectPermissionList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedObjectPermissionList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedObjectPermissionList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedObjectPermissionList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedObjectPermissionList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedObjectPermissionList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedObjectPermissionList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedObjectPermissionList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedObjectPermissionList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedObjectPermissionList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedObjectPermissionList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedObjectPermissionList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedObjectPermissionList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedObjectPermissionList) GetResults() []ObjectPermission { + if o == nil || IsNil(o.Results) { + var ret []ObjectPermission + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedObjectPermissionList) GetResultsOk() ([]ObjectPermission, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedObjectPermissionList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ObjectPermission and assigns it to the Results field. +func (o *PaginatedObjectPermissionList) SetResults(v []ObjectPermission) { + o.Results = v +} + +func (o PaginatedObjectPermissionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedObjectPermissionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedObjectPermissionList) UnmarshalJSON(data []byte) (err error) { + varPaginatedObjectPermissionList := _PaginatedObjectPermissionList{} + + err = json.Unmarshal(data, &varPaginatedObjectPermissionList) + + if err != nil { + return err + } + + *o = PaginatedObjectPermissionList(varPaginatedObjectPermissionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedObjectPermissionList struct { + value *PaginatedObjectPermissionList + isSet bool +} + +func (v NullablePaginatedObjectPermissionList) Get() *PaginatedObjectPermissionList { + return v.value +} + +func (v *NullablePaginatedObjectPermissionList) Set(val *PaginatedObjectPermissionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedObjectPermissionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedObjectPermissionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedObjectPermissionList(val *PaginatedObjectPermissionList) *NullablePaginatedObjectPermissionList { + return &NullablePaginatedObjectPermissionList{value: val, isSet: true} +} + +func (v NullablePaginatedObjectPermissionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedObjectPermissionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_platform_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_platform_list.go new file mode 100644 index 00000000..86f948de --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_platform_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPlatformList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPlatformList{} + +// PaginatedPlatformList struct for PaginatedPlatformList +type PaginatedPlatformList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Platform `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPlatformList PaginatedPlatformList + +// NewPaginatedPlatformList instantiates a new PaginatedPlatformList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPlatformList() *PaginatedPlatformList { + this := PaginatedPlatformList{} + return &this +} + +// NewPaginatedPlatformListWithDefaults instantiates a new PaginatedPlatformList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPlatformListWithDefaults() *PaginatedPlatformList { + this := PaginatedPlatformList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPlatformList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPlatformList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPlatformList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPlatformList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPlatformList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPlatformList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPlatformList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPlatformList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPlatformList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPlatformList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPlatformList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPlatformList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPlatformList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPlatformList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPlatformList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPlatformList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPlatformList) GetResults() []Platform { + if o == nil || IsNil(o.Results) { + var ret []Platform + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPlatformList) GetResultsOk() ([]Platform, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPlatformList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Platform and assigns it to the Results field. +func (o *PaginatedPlatformList) SetResults(v []Platform) { + o.Results = v +} + +func (o PaginatedPlatformList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPlatformList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPlatformList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPlatformList := _PaginatedPlatformList{} + + err = json.Unmarshal(data, &varPaginatedPlatformList) + + if err != nil { + return err + } + + *o = PaginatedPlatformList(varPaginatedPlatformList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPlatformList struct { + value *PaginatedPlatformList + isSet bool +} + +func (v NullablePaginatedPlatformList) Get() *PaginatedPlatformList { + return v.value +} + +func (v *NullablePaginatedPlatformList) Set(val *PaginatedPlatformList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPlatformList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPlatformList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPlatformList(val *PaginatedPlatformList) *NullablePaginatedPlatformList { + return &NullablePaginatedPlatformList{value: val, isSet: true} +} + +func (v NullablePaginatedPlatformList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPlatformList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_feed_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_feed_list.go new file mode 100644 index 00000000..10a311b6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_feed_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPowerFeedList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPowerFeedList{} + +// PaginatedPowerFeedList struct for PaginatedPowerFeedList +type PaginatedPowerFeedList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []PowerFeed `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPowerFeedList PaginatedPowerFeedList + +// NewPaginatedPowerFeedList instantiates a new PaginatedPowerFeedList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPowerFeedList() *PaginatedPowerFeedList { + this := PaginatedPowerFeedList{} + return &this +} + +// NewPaginatedPowerFeedListWithDefaults instantiates a new PaginatedPowerFeedList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPowerFeedListWithDefaults() *PaginatedPowerFeedList { + this := PaginatedPowerFeedList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPowerFeedList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerFeedList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPowerFeedList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPowerFeedList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerFeedList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerFeedList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPowerFeedList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPowerFeedList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPowerFeedList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPowerFeedList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerFeedList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerFeedList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPowerFeedList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPowerFeedList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPowerFeedList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPowerFeedList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPowerFeedList) GetResults() []PowerFeed { + if o == nil || IsNil(o.Results) { + var ret []PowerFeed + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerFeedList) GetResultsOk() ([]PowerFeed, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPowerFeedList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []PowerFeed and assigns it to the Results field. +func (o *PaginatedPowerFeedList) SetResults(v []PowerFeed) { + o.Results = v +} + +func (o PaginatedPowerFeedList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPowerFeedList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPowerFeedList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPowerFeedList := _PaginatedPowerFeedList{} + + err = json.Unmarshal(data, &varPaginatedPowerFeedList) + + if err != nil { + return err + } + + *o = PaginatedPowerFeedList(varPaginatedPowerFeedList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPowerFeedList struct { + value *PaginatedPowerFeedList + isSet bool +} + +func (v NullablePaginatedPowerFeedList) Get() *PaginatedPowerFeedList { + return v.value +} + +func (v *NullablePaginatedPowerFeedList) Set(val *PaginatedPowerFeedList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPowerFeedList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPowerFeedList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPowerFeedList(val *PaginatedPowerFeedList) *NullablePaginatedPowerFeedList { + return &NullablePaginatedPowerFeedList{value: val, isSet: true} +} + +func (v NullablePaginatedPowerFeedList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPowerFeedList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_outlet_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_outlet_list.go new file mode 100644 index 00000000..81216aad --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_outlet_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPowerOutletList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPowerOutletList{} + +// PaginatedPowerOutletList struct for PaginatedPowerOutletList +type PaginatedPowerOutletList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []PowerOutlet `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPowerOutletList PaginatedPowerOutletList + +// NewPaginatedPowerOutletList instantiates a new PaginatedPowerOutletList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPowerOutletList() *PaginatedPowerOutletList { + this := PaginatedPowerOutletList{} + return &this +} + +// NewPaginatedPowerOutletListWithDefaults instantiates a new PaginatedPowerOutletList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPowerOutletListWithDefaults() *PaginatedPowerOutletList { + this := PaginatedPowerOutletList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPowerOutletList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerOutletList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPowerOutletList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPowerOutletList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerOutletList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerOutletList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPowerOutletList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPowerOutletList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPowerOutletList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPowerOutletList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerOutletList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerOutletList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPowerOutletList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPowerOutletList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPowerOutletList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPowerOutletList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPowerOutletList) GetResults() []PowerOutlet { + if o == nil || IsNil(o.Results) { + var ret []PowerOutlet + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerOutletList) GetResultsOk() ([]PowerOutlet, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPowerOutletList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []PowerOutlet and assigns it to the Results field. +func (o *PaginatedPowerOutletList) SetResults(v []PowerOutlet) { + o.Results = v +} + +func (o PaginatedPowerOutletList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPowerOutletList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPowerOutletList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPowerOutletList := _PaginatedPowerOutletList{} + + err = json.Unmarshal(data, &varPaginatedPowerOutletList) + + if err != nil { + return err + } + + *o = PaginatedPowerOutletList(varPaginatedPowerOutletList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPowerOutletList struct { + value *PaginatedPowerOutletList + isSet bool +} + +func (v NullablePaginatedPowerOutletList) Get() *PaginatedPowerOutletList { + return v.value +} + +func (v *NullablePaginatedPowerOutletList) Set(val *PaginatedPowerOutletList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPowerOutletList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPowerOutletList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPowerOutletList(val *PaginatedPowerOutletList) *NullablePaginatedPowerOutletList { + return &NullablePaginatedPowerOutletList{value: val, isSet: true} +} + +func (v NullablePaginatedPowerOutletList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPowerOutletList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_outlet_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_outlet_template_list.go new file mode 100644 index 00000000..ca548e98 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_outlet_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPowerOutletTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPowerOutletTemplateList{} + +// PaginatedPowerOutletTemplateList struct for PaginatedPowerOutletTemplateList +type PaginatedPowerOutletTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []PowerOutletTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPowerOutletTemplateList PaginatedPowerOutletTemplateList + +// NewPaginatedPowerOutletTemplateList instantiates a new PaginatedPowerOutletTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPowerOutletTemplateList() *PaginatedPowerOutletTemplateList { + this := PaginatedPowerOutletTemplateList{} + return &this +} + +// NewPaginatedPowerOutletTemplateListWithDefaults instantiates a new PaginatedPowerOutletTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPowerOutletTemplateListWithDefaults() *PaginatedPowerOutletTemplateList { + this := PaginatedPowerOutletTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPowerOutletTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerOutletTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPowerOutletTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPowerOutletTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerOutletTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerOutletTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPowerOutletTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPowerOutletTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPowerOutletTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPowerOutletTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerOutletTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerOutletTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPowerOutletTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPowerOutletTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPowerOutletTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPowerOutletTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPowerOutletTemplateList) GetResults() []PowerOutletTemplate { + if o == nil || IsNil(o.Results) { + var ret []PowerOutletTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerOutletTemplateList) GetResultsOk() ([]PowerOutletTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPowerOutletTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []PowerOutletTemplate and assigns it to the Results field. +func (o *PaginatedPowerOutletTemplateList) SetResults(v []PowerOutletTemplate) { + o.Results = v +} + +func (o PaginatedPowerOutletTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPowerOutletTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPowerOutletTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPowerOutletTemplateList := _PaginatedPowerOutletTemplateList{} + + err = json.Unmarshal(data, &varPaginatedPowerOutletTemplateList) + + if err != nil { + return err + } + + *o = PaginatedPowerOutletTemplateList(varPaginatedPowerOutletTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPowerOutletTemplateList struct { + value *PaginatedPowerOutletTemplateList + isSet bool +} + +func (v NullablePaginatedPowerOutletTemplateList) Get() *PaginatedPowerOutletTemplateList { + return v.value +} + +func (v *NullablePaginatedPowerOutletTemplateList) Set(val *PaginatedPowerOutletTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPowerOutletTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPowerOutletTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPowerOutletTemplateList(val *PaginatedPowerOutletTemplateList) *NullablePaginatedPowerOutletTemplateList { + return &NullablePaginatedPowerOutletTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedPowerOutletTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPowerOutletTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_panel_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_panel_list.go new file mode 100644 index 00000000..9b870cba --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_panel_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPowerPanelList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPowerPanelList{} + +// PaginatedPowerPanelList struct for PaginatedPowerPanelList +type PaginatedPowerPanelList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []PowerPanel `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPowerPanelList PaginatedPowerPanelList + +// NewPaginatedPowerPanelList instantiates a new PaginatedPowerPanelList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPowerPanelList() *PaginatedPowerPanelList { + this := PaginatedPowerPanelList{} + return &this +} + +// NewPaginatedPowerPanelListWithDefaults instantiates a new PaginatedPowerPanelList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPowerPanelListWithDefaults() *PaginatedPowerPanelList { + this := PaginatedPowerPanelList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPowerPanelList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerPanelList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPowerPanelList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPowerPanelList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerPanelList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerPanelList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPowerPanelList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPowerPanelList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPowerPanelList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPowerPanelList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerPanelList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerPanelList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPowerPanelList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPowerPanelList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPowerPanelList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPowerPanelList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPowerPanelList) GetResults() []PowerPanel { + if o == nil || IsNil(o.Results) { + var ret []PowerPanel + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerPanelList) GetResultsOk() ([]PowerPanel, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPowerPanelList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []PowerPanel and assigns it to the Results field. +func (o *PaginatedPowerPanelList) SetResults(v []PowerPanel) { + o.Results = v +} + +func (o PaginatedPowerPanelList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPowerPanelList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPowerPanelList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPowerPanelList := _PaginatedPowerPanelList{} + + err = json.Unmarshal(data, &varPaginatedPowerPanelList) + + if err != nil { + return err + } + + *o = PaginatedPowerPanelList(varPaginatedPowerPanelList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPowerPanelList struct { + value *PaginatedPowerPanelList + isSet bool +} + +func (v NullablePaginatedPowerPanelList) Get() *PaginatedPowerPanelList { + return v.value +} + +func (v *NullablePaginatedPowerPanelList) Set(val *PaginatedPowerPanelList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPowerPanelList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPowerPanelList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPowerPanelList(val *PaginatedPowerPanelList) *NullablePaginatedPowerPanelList { + return &NullablePaginatedPowerPanelList{value: val, isSet: true} +} + +func (v NullablePaginatedPowerPanelList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPowerPanelList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_port_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_port_list.go new file mode 100644 index 00000000..727b3517 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_port_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPowerPortList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPowerPortList{} + +// PaginatedPowerPortList struct for PaginatedPowerPortList +type PaginatedPowerPortList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []PowerPort `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPowerPortList PaginatedPowerPortList + +// NewPaginatedPowerPortList instantiates a new PaginatedPowerPortList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPowerPortList() *PaginatedPowerPortList { + this := PaginatedPowerPortList{} + return &this +} + +// NewPaginatedPowerPortListWithDefaults instantiates a new PaginatedPowerPortList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPowerPortListWithDefaults() *PaginatedPowerPortList { + this := PaginatedPowerPortList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPowerPortList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerPortList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPowerPortList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPowerPortList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerPortList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerPortList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPowerPortList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPowerPortList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPowerPortList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPowerPortList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerPortList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerPortList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPowerPortList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPowerPortList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPowerPortList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPowerPortList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPowerPortList) GetResults() []PowerPort { + if o == nil || IsNil(o.Results) { + var ret []PowerPort + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerPortList) GetResultsOk() ([]PowerPort, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPowerPortList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []PowerPort and assigns it to the Results field. +func (o *PaginatedPowerPortList) SetResults(v []PowerPort) { + o.Results = v +} + +func (o PaginatedPowerPortList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPowerPortList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPowerPortList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPowerPortList := _PaginatedPowerPortList{} + + err = json.Unmarshal(data, &varPaginatedPowerPortList) + + if err != nil { + return err + } + + *o = PaginatedPowerPortList(varPaginatedPowerPortList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPowerPortList struct { + value *PaginatedPowerPortList + isSet bool +} + +func (v NullablePaginatedPowerPortList) Get() *PaginatedPowerPortList { + return v.value +} + +func (v *NullablePaginatedPowerPortList) Set(val *PaginatedPowerPortList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPowerPortList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPowerPortList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPowerPortList(val *PaginatedPowerPortList) *NullablePaginatedPowerPortList { + return &NullablePaginatedPowerPortList{value: val, isSet: true} +} + +func (v NullablePaginatedPowerPortList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPowerPortList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_port_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_port_template_list.go new file mode 100644 index 00000000..fa8e92af --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_power_port_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPowerPortTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPowerPortTemplateList{} + +// PaginatedPowerPortTemplateList struct for PaginatedPowerPortTemplateList +type PaginatedPowerPortTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []PowerPortTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPowerPortTemplateList PaginatedPowerPortTemplateList + +// NewPaginatedPowerPortTemplateList instantiates a new PaginatedPowerPortTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPowerPortTemplateList() *PaginatedPowerPortTemplateList { + this := PaginatedPowerPortTemplateList{} + return &this +} + +// NewPaginatedPowerPortTemplateListWithDefaults instantiates a new PaginatedPowerPortTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPowerPortTemplateListWithDefaults() *PaginatedPowerPortTemplateList { + this := PaginatedPowerPortTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPowerPortTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerPortTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPowerPortTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPowerPortTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerPortTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerPortTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPowerPortTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPowerPortTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPowerPortTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPowerPortTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPowerPortTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPowerPortTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPowerPortTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPowerPortTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPowerPortTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPowerPortTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPowerPortTemplateList) GetResults() []PowerPortTemplate { + if o == nil || IsNil(o.Results) { + var ret []PowerPortTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPowerPortTemplateList) GetResultsOk() ([]PowerPortTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPowerPortTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []PowerPortTemplate and assigns it to the Results field. +func (o *PaginatedPowerPortTemplateList) SetResults(v []PowerPortTemplate) { + o.Results = v +} + +func (o PaginatedPowerPortTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPowerPortTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPowerPortTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPowerPortTemplateList := _PaginatedPowerPortTemplateList{} + + err = json.Unmarshal(data, &varPaginatedPowerPortTemplateList) + + if err != nil { + return err + } + + *o = PaginatedPowerPortTemplateList(varPaginatedPowerPortTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPowerPortTemplateList struct { + value *PaginatedPowerPortTemplateList + isSet bool +} + +func (v NullablePaginatedPowerPortTemplateList) Get() *PaginatedPowerPortTemplateList { + return v.value +} + +func (v *NullablePaginatedPowerPortTemplateList) Set(val *PaginatedPowerPortTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPowerPortTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPowerPortTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPowerPortTemplateList(val *PaginatedPowerPortTemplateList) *NullablePaginatedPowerPortTemplateList { + return &NullablePaginatedPowerPortTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedPowerPortTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPowerPortTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_prefix_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_prefix_list.go new file mode 100644 index 00000000..cbd7a317 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_prefix_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedPrefixList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPrefixList{} + +// PaginatedPrefixList struct for PaginatedPrefixList +type PaginatedPrefixList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Prefix `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPrefixList PaginatedPrefixList + +// NewPaginatedPrefixList instantiates a new PaginatedPrefixList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPrefixList() *PaginatedPrefixList { + this := PaginatedPrefixList{} + return &this +} + +// NewPaginatedPrefixListWithDefaults instantiates a new PaginatedPrefixList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPrefixListWithDefaults() *PaginatedPrefixList { + this := PaginatedPrefixList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedPrefixList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPrefixList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedPrefixList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedPrefixList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPrefixList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPrefixList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedPrefixList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedPrefixList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedPrefixList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedPrefixList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedPrefixList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedPrefixList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedPrefixList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedPrefixList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedPrefixList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedPrefixList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedPrefixList) GetResults() []Prefix { + if o == nil || IsNil(o.Results) { + var ret []Prefix + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedPrefixList) GetResultsOk() ([]Prefix, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedPrefixList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Prefix and assigns it to the Results field. +func (o *PaginatedPrefixList) SetResults(v []Prefix) { + o.Results = v +} + +func (o PaginatedPrefixList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPrefixList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPrefixList) UnmarshalJSON(data []byte) (err error) { + varPaginatedPrefixList := _PaginatedPrefixList{} + + err = json.Unmarshal(data, &varPaginatedPrefixList) + + if err != nil { + return err + } + + *o = PaginatedPrefixList(varPaginatedPrefixList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPrefixList struct { + value *PaginatedPrefixList + isSet bool +} + +func (v NullablePaginatedPrefixList) Get() *PaginatedPrefixList { + return v.value +} + +func (v *NullablePaginatedPrefixList) Set(val *PaginatedPrefixList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPrefixList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPrefixList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPrefixList(val *PaginatedPrefixList) *NullablePaginatedPrefixList { + return &NullablePaginatedPrefixList{value: val, isSet: true} +} + +func (v NullablePaginatedPrefixList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPrefixList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_account_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_account_list.go new file mode 100644 index 00000000..8f852413 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_account_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedProviderAccountList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedProviderAccountList{} + +// PaginatedProviderAccountList struct for PaginatedProviderAccountList +type PaginatedProviderAccountList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ProviderAccount `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedProviderAccountList PaginatedProviderAccountList + +// NewPaginatedProviderAccountList instantiates a new PaginatedProviderAccountList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedProviderAccountList() *PaginatedProviderAccountList { + this := PaginatedProviderAccountList{} + return &this +} + +// NewPaginatedProviderAccountListWithDefaults instantiates a new PaginatedProviderAccountList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedProviderAccountListWithDefaults() *PaginatedProviderAccountList { + this := PaginatedProviderAccountList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedProviderAccountList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedProviderAccountList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedProviderAccountList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedProviderAccountList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedProviderAccountList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedProviderAccountList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedProviderAccountList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedProviderAccountList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedProviderAccountList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedProviderAccountList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedProviderAccountList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedProviderAccountList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedProviderAccountList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedProviderAccountList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedProviderAccountList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedProviderAccountList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedProviderAccountList) GetResults() []ProviderAccount { + if o == nil || IsNil(o.Results) { + var ret []ProviderAccount + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedProviderAccountList) GetResultsOk() ([]ProviderAccount, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedProviderAccountList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ProviderAccount and assigns it to the Results field. +func (o *PaginatedProviderAccountList) SetResults(v []ProviderAccount) { + o.Results = v +} + +func (o PaginatedProviderAccountList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedProviderAccountList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedProviderAccountList) UnmarshalJSON(data []byte) (err error) { + varPaginatedProviderAccountList := _PaginatedProviderAccountList{} + + err = json.Unmarshal(data, &varPaginatedProviderAccountList) + + if err != nil { + return err + } + + *o = PaginatedProviderAccountList(varPaginatedProviderAccountList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedProviderAccountList struct { + value *PaginatedProviderAccountList + isSet bool +} + +func (v NullablePaginatedProviderAccountList) Get() *PaginatedProviderAccountList { + return v.value +} + +func (v *NullablePaginatedProviderAccountList) Set(val *PaginatedProviderAccountList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedProviderAccountList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedProviderAccountList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedProviderAccountList(val *PaginatedProviderAccountList) *NullablePaginatedProviderAccountList { + return &NullablePaginatedProviderAccountList{value: val, isSet: true} +} + +func (v NullablePaginatedProviderAccountList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedProviderAccountList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_list.go new file mode 100644 index 00000000..b9edcf3b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedProviderList{} + +// PaginatedProviderList struct for PaginatedProviderList +type PaginatedProviderList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Provider `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedProviderList PaginatedProviderList + +// NewPaginatedProviderList instantiates a new PaginatedProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedProviderList() *PaginatedProviderList { + this := PaginatedProviderList{} + return &this +} + +// NewPaginatedProviderListWithDefaults instantiates a new PaginatedProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedProviderListWithDefaults() *PaginatedProviderList { + this := PaginatedProviderList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedProviderList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedProviderList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedProviderList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedProviderList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedProviderList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedProviderList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedProviderList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedProviderList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedProviderList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedProviderList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedProviderList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedProviderList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedProviderList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedProviderList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedProviderList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedProviderList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedProviderList) GetResults() []Provider { + if o == nil || IsNil(o.Results) { + var ret []Provider + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedProviderList) GetResultsOk() ([]Provider, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedProviderList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Provider and assigns it to the Results field. +func (o *PaginatedProviderList) SetResults(v []Provider) { + o.Results = v +} + +func (o PaginatedProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedProviderList) UnmarshalJSON(data []byte) (err error) { + varPaginatedProviderList := _PaginatedProviderList{} + + err = json.Unmarshal(data, &varPaginatedProviderList) + + if err != nil { + return err + } + + *o = PaginatedProviderList(varPaginatedProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedProviderList struct { + value *PaginatedProviderList + isSet bool +} + +func (v NullablePaginatedProviderList) Get() *PaginatedProviderList { + return v.value +} + +func (v *NullablePaginatedProviderList) Set(val *PaginatedProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedProviderList(val *PaginatedProviderList) *NullablePaginatedProviderList { + return &NullablePaginatedProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_network_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_network_list.go new file mode 100644 index 00000000..7357e686 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_provider_network_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedProviderNetworkList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedProviderNetworkList{} + +// PaginatedProviderNetworkList struct for PaginatedProviderNetworkList +type PaginatedProviderNetworkList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ProviderNetwork `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedProviderNetworkList PaginatedProviderNetworkList + +// NewPaginatedProviderNetworkList instantiates a new PaginatedProviderNetworkList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedProviderNetworkList() *PaginatedProviderNetworkList { + this := PaginatedProviderNetworkList{} + return &this +} + +// NewPaginatedProviderNetworkListWithDefaults instantiates a new PaginatedProviderNetworkList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedProviderNetworkListWithDefaults() *PaginatedProviderNetworkList { + this := PaginatedProviderNetworkList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedProviderNetworkList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedProviderNetworkList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedProviderNetworkList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedProviderNetworkList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedProviderNetworkList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedProviderNetworkList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedProviderNetworkList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedProviderNetworkList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedProviderNetworkList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedProviderNetworkList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedProviderNetworkList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedProviderNetworkList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedProviderNetworkList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedProviderNetworkList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedProviderNetworkList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedProviderNetworkList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedProviderNetworkList) GetResults() []ProviderNetwork { + if o == nil || IsNil(o.Results) { + var ret []ProviderNetwork + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedProviderNetworkList) GetResultsOk() ([]ProviderNetwork, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedProviderNetworkList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ProviderNetwork and assigns it to the Results field. +func (o *PaginatedProviderNetworkList) SetResults(v []ProviderNetwork) { + o.Results = v +} + +func (o PaginatedProviderNetworkList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedProviderNetworkList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedProviderNetworkList) UnmarshalJSON(data []byte) (err error) { + varPaginatedProviderNetworkList := _PaginatedProviderNetworkList{} + + err = json.Unmarshal(data, &varPaginatedProviderNetworkList) + + if err != nil { + return err + } + + *o = PaginatedProviderNetworkList(varPaginatedProviderNetworkList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedProviderNetworkList struct { + value *PaginatedProviderNetworkList + isSet bool +} + +func (v NullablePaginatedProviderNetworkList) Get() *PaginatedProviderNetworkList { + return v.value +} + +func (v *NullablePaginatedProviderNetworkList) Set(val *PaginatedProviderNetworkList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedProviderNetworkList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedProviderNetworkList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedProviderNetworkList(val *PaginatedProviderNetworkList) *NullablePaginatedProviderNetworkList { + return &NullablePaginatedProviderNetworkList{value: val, isSet: true} +} + +func (v NullablePaginatedProviderNetworkList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedProviderNetworkList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_list.go new file mode 100644 index 00000000..d57cd59d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRackList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRackList{} + +// PaginatedRackList struct for PaginatedRackList +type PaginatedRackList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Rack `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRackList PaginatedRackList + +// NewPaginatedRackList instantiates a new PaginatedRackList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRackList() *PaginatedRackList { + this := PaginatedRackList{} + return &this +} + +// NewPaginatedRackListWithDefaults instantiates a new PaginatedRackList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRackListWithDefaults() *PaginatedRackList { + this := PaginatedRackList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRackList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRackList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRackList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRackList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRackList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRackList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRackList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRackList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRackList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRackList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRackList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRackList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRackList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRackList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRackList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRackList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRackList) GetResults() []Rack { + if o == nil || IsNil(o.Results) { + var ret []Rack + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRackList) GetResultsOk() ([]Rack, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRackList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Rack and assigns it to the Results field. +func (o *PaginatedRackList) SetResults(v []Rack) { + o.Results = v +} + +func (o PaginatedRackList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRackList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRackList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRackList := _PaginatedRackList{} + + err = json.Unmarshal(data, &varPaginatedRackList) + + if err != nil { + return err + } + + *o = PaginatedRackList(varPaginatedRackList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRackList struct { + value *PaginatedRackList + isSet bool +} + +func (v NullablePaginatedRackList) Get() *PaginatedRackList { + return v.value +} + +func (v *NullablePaginatedRackList) Set(val *PaginatedRackList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRackList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRackList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRackList(val *PaginatedRackList) *NullablePaginatedRackList { + return &NullablePaginatedRackList{value: val, isSet: true} +} + +func (v NullablePaginatedRackList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRackList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_reservation_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_reservation_list.go new file mode 100644 index 00000000..213175e4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_reservation_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRackReservationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRackReservationList{} + +// PaginatedRackReservationList struct for PaginatedRackReservationList +type PaginatedRackReservationList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []RackReservation `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRackReservationList PaginatedRackReservationList + +// NewPaginatedRackReservationList instantiates a new PaginatedRackReservationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRackReservationList() *PaginatedRackReservationList { + this := PaginatedRackReservationList{} + return &this +} + +// NewPaginatedRackReservationListWithDefaults instantiates a new PaginatedRackReservationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRackReservationListWithDefaults() *PaginatedRackReservationList { + this := PaginatedRackReservationList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRackReservationList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRackReservationList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRackReservationList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRackReservationList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRackReservationList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRackReservationList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRackReservationList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRackReservationList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRackReservationList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRackReservationList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRackReservationList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRackReservationList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRackReservationList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRackReservationList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRackReservationList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRackReservationList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRackReservationList) GetResults() []RackReservation { + if o == nil || IsNil(o.Results) { + var ret []RackReservation + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRackReservationList) GetResultsOk() ([]RackReservation, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRackReservationList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []RackReservation and assigns it to the Results field. +func (o *PaginatedRackReservationList) SetResults(v []RackReservation) { + o.Results = v +} + +func (o PaginatedRackReservationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRackReservationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRackReservationList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRackReservationList := _PaginatedRackReservationList{} + + err = json.Unmarshal(data, &varPaginatedRackReservationList) + + if err != nil { + return err + } + + *o = PaginatedRackReservationList(varPaginatedRackReservationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRackReservationList struct { + value *PaginatedRackReservationList + isSet bool +} + +func (v NullablePaginatedRackReservationList) Get() *PaginatedRackReservationList { + return v.value +} + +func (v *NullablePaginatedRackReservationList) Set(val *PaginatedRackReservationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRackReservationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRackReservationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRackReservationList(val *PaginatedRackReservationList) *NullablePaginatedRackReservationList { + return &NullablePaginatedRackReservationList{value: val, isSet: true} +} + +func (v NullablePaginatedRackReservationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRackReservationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_role_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_role_list.go new file mode 100644 index 00000000..b9490a7d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rack_role_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRackRoleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRackRoleList{} + +// PaginatedRackRoleList struct for PaginatedRackRoleList +type PaginatedRackRoleList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []RackRole `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRackRoleList PaginatedRackRoleList + +// NewPaginatedRackRoleList instantiates a new PaginatedRackRoleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRackRoleList() *PaginatedRackRoleList { + this := PaginatedRackRoleList{} + return &this +} + +// NewPaginatedRackRoleListWithDefaults instantiates a new PaginatedRackRoleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRackRoleListWithDefaults() *PaginatedRackRoleList { + this := PaginatedRackRoleList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRackRoleList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRackRoleList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRackRoleList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRackRoleList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRackRoleList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRackRoleList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRackRoleList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRackRoleList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRackRoleList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRackRoleList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRackRoleList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRackRoleList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRackRoleList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRackRoleList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRackRoleList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRackRoleList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRackRoleList) GetResults() []RackRole { + if o == nil || IsNil(o.Results) { + var ret []RackRole + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRackRoleList) GetResultsOk() ([]RackRole, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRackRoleList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []RackRole and assigns it to the Results field. +func (o *PaginatedRackRoleList) SetResults(v []RackRole) { + o.Results = v +} + +func (o PaginatedRackRoleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRackRoleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRackRoleList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRackRoleList := _PaginatedRackRoleList{} + + err = json.Unmarshal(data, &varPaginatedRackRoleList) + + if err != nil { + return err + } + + *o = PaginatedRackRoleList(varPaginatedRackRoleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRackRoleList struct { + value *PaginatedRackRoleList + isSet bool +} + +func (v NullablePaginatedRackRoleList) Get() *PaginatedRackRoleList { + return v.value +} + +func (v *NullablePaginatedRackRoleList) Set(val *PaginatedRackRoleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRackRoleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRackRoleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRackRoleList(val *PaginatedRackRoleList) *NullablePaginatedRackRoleList { + return &NullablePaginatedRackRoleList{value: val, isSet: true} +} + +func (v NullablePaginatedRackRoleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRackRoleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rear_port_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rear_port_list.go new file mode 100644 index 00000000..31a4f94c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rear_port_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRearPortList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRearPortList{} + +// PaginatedRearPortList struct for PaginatedRearPortList +type PaginatedRearPortList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []RearPort `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRearPortList PaginatedRearPortList + +// NewPaginatedRearPortList instantiates a new PaginatedRearPortList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRearPortList() *PaginatedRearPortList { + this := PaginatedRearPortList{} + return &this +} + +// NewPaginatedRearPortListWithDefaults instantiates a new PaginatedRearPortList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRearPortListWithDefaults() *PaginatedRearPortList { + this := PaginatedRearPortList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRearPortList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRearPortList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRearPortList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRearPortList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRearPortList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRearPortList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRearPortList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRearPortList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRearPortList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRearPortList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRearPortList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRearPortList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRearPortList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRearPortList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRearPortList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRearPortList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRearPortList) GetResults() []RearPort { + if o == nil || IsNil(o.Results) { + var ret []RearPort + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRearPortList) GetResultsOk() ([]RearPort, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRearPortList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []RearPort and assigns it to the Results field. +func (o *PaginatedRearPortList) SetResults(v []RearPort) { + o.Results = v +} + +func (o PaginatedRearPortList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRearPortList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRearPortList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRearPortList := _PaginatedRearPortList{} + + err = json.Unmarshal(data, &varPaginatedRearPortList) + + if err != nil { + return err + } + + *o = PaginatedRearPortList(varPaginatedRearPortList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRearPortList struct { + value *PaginatedRearPortList + isSet bool +} + +func (v NullablePaginatedRearPortList) Get() *PaginatedRearPortList { + return v.value +} + +func (v *NullablePaginatedRearPortList) Set(val *PaginatedRearPortList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRearPortList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRearPortList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRearPortList(val *PaginatedRearPortList) *NullablePaginatedRearPortList { + return &NullablePaginatedRearPortList{value: val, isSet: true} +} + +func (v NullablePaginatedRearPortList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRearPortList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rear_port_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rear_port_template_list.go new file mode 100644 index 00000000..bcd42519 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rear_port_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRearPortTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRearPortTemplateList{} + +// PaginatedRearPortTemplateList struct for PaginatedRearPortTemplateList +type PaginatedRearPortTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []RearPortTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRearPortTemplateList PaginatedRearPortTemplateList + +// NewPaginatedRearPortTemplateList instantiates a new PaginatedRearPortTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRearPortTemplateList() *PaginatedRearPortTemplateList { + this := PaginatedRearPortTemplateList{} + return &this +} + +// NewPaginatedRearPortTemplateListWithDefaults instantiates a new PaginatedRearPortTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRearPortTemplateListWithDefaults() *PaginatedRearPortTemplateList { + this := PaginatedRearPortTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRearPortTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRearPortTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRearPortTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRearPortTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRearPortTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRearPortTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRearPortTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRearPortTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRearPortTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRearPortTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRearPortTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRearPortTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRearPortTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRearPortTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRearPortTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRearPortTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRearPortTemplateList) GetResults() []RearPortTemplate { + if o == nil || IsNil(o.Results) { + var ret []RearPortTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRearPortTemplateList) GetResultsOk() ([]RearPortTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRearPortTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []RearPortTemplate and assigns it to the Results field. +func (o *PaginatedRearPortTemplateList) SetResults(v []RearPortTemplate) { + o.Results = v +} + +func (o PaginatedRearPortTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRearPortTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRearPortTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRearPortTemplateList := _PaginatedRearPortTemplateList{} + + err = json.Unmarshal(data, &varPaginatedRearPortTemplateList) + + if err != nil { + return err + } + + *o = PaginatedRearPortTemplateList(varPaginatedRearPortTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRearPortTemplateList struct { + value *PaginatedRearPortTemplateList + isSet bool +} + +func (v NullablePaginatedRearPortTemplateList) Get() *PaginatedRearPortTemplateList { + return v.value +} + +func (v *NullablePaginatedRearPortTemplateList) Set(val *PaginatedRearPortTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRearPortTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRearPortTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRearPortTemplateList(val *PaginatedRearPortTemplateList) *NullablePaginatedRearPortTemplateList { + return &NullablePaginatedRearPortTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedRearPortTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRearPortTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_region_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_region_list.go new file mode 100644 index 00000000..e37c60b6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_region_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRegionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRegionList{} + +// PaginatedRegionList struct for PaginatedRegionList +type PaginatedRegionList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Region `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRegionList PaginatedRegionList + +// NewPaginatedRegionList instantiates a new PaginatedRegionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRegionList() *PaginatedRegionList { + this := PaginatedRegionList{} + return &this +} + +// NewPaginatedRegionListWithDefaults instantiates a new PaginatedRegionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRegionListWithDefaults() *PaginatedRegionList { + this := PaginatedRegionList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRegionList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRegionList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRegionList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRegionList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRegionList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRegionList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRegionList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRegionList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRegionList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRegionList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRegionList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRegionList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRegionList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRegionList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRegionList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRegionList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRegionList) GetResults() []Region { + if o == nil || IsNil(o.Results) { + var ret []Region + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRegionList) GetResultsOk() ([]Region, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRegionList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Region and assigns it to the Results field. +func (o *PaginatedRegionList) SetResults(v []Region) { + o.Results = v +} + +func (o PaginatedRegionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRegionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRegionList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRegionList := _PaginatedRegionList{} + + err = json.Unmarshal(data, &varPaginatedRegionList) + + if err != nil { + return err + } + + *o = PaginatedRegionList(varPaginatedRegionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRegionList struct { + value *PaginatedRegionList + isSet bool +} + +func (v NullablePaginatedRegionList) Get() *PaginatedRegionList { + return v.value +} + +func (v *NullablePaginatedRegionList) Set(val *PaginatedRegionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRegionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRegionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRegionList(val *PaginatedRegionList) *NullablePaginatedRegionList { + return &NullablePaginatedRegionList{value: val, isSet: true} +} + +func (v NullablePaginatedRegionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRegionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rir_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rir_list.go new file mode 100644 index 00000000..dfc227b9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_rir_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRIRList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRIRList{} + +// PaginatedRIRList struct for PaginatedRIRList +type PaginatedRIRList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []RIR `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRIRList PaginatedRIRList + +// NewPaginatedRIRList instantiates a new PaginatedRIRList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRIRList() *PaginatedRIRList { + this := PaginatedRIRList{} + return &this +} + +// NewPaginatedRIRListWithDefaults instantiates a new PaginatedRIRList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRIRListWithDefaults() *PaginatedRIRList { + this := PaginatedRIRList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRIRList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRIRList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRIRList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRIRList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRIRList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRIRList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRIRList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRIRList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRIRList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRIRList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRIRList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRIRList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRIRList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRIRList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRIRList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRIRList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRIRList) GetResults() []RIR { + if o == nil || IsNil(o.Results) { + var ret []RIR + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRIRList) GetResultsOk() ([]RIR, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRIRList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []RIR and assigns it to the Results field. +func (o *PaginatedRIRList) SetResults(v []RIR) { + o.Results = v +} + +func (o PaginatedRIRList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRIRList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRIRList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRIRList := _PaginatedRIRList{} + + err = json.Unmarshal(data, &varPaginatedRIRList) + + if err != nil { + return err + } + + *o = PaginatedRIRList(varPaginatedRIRList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRIRList struct { + value *PaginatedRIRList + isSet bool +} + +func (v NullablePaginatedRIRList) Get() *PaginatedRIRList { + return v.value +} + +func (v *NullablePaginatedRIRList) Set(val *PaginatedRIRList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRIRList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRIRList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRIRList(val *PaginatedRIRList) *NullablePaginatedRIRList { + return &NullablePaginatedRIRList{value: val, isSet: true} +} + +func (v NullablePaginatedRIRList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRIRList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_role_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_role_list.go new file mode 100644 index 00000000..849230e6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_role_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRoleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRoleList{} + +// PaginatedRoleList struct for PaginatedRoleList +type PaginatedRoleList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Role `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRoleList PaginatedRoleList + +// NewPaginatedRoleList instantiates a new PaginatedRoleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRoleList() *PaginatedRoleList { + this := PaginatedRoleList{} + return &this +} + +// NewPaginatedRoleListWithDefaults instantiates a new PaginatedRoleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRoleListWithDefaults() *PaginatedRoleList { + this := PaginatedRoleList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRoleList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRoleList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRoleList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRoleList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRoleList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRoleList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRoleList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRoleList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRoleList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRoleList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRoleList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRoleList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRoleList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRoleList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRoleList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRoleList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRoleList) GetResults() []Role { + if o == nil || IsNil(o.Results) { + var ret []Role + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRoleList) GetResultsOk() ([]Role, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRoleList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Role and assigns it to the Results field. +func (o *PaginatedRoleList) SetResults(v []Role) { + o.Results = v +} + +func (o PaginatedRoleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRoleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRoleList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRoleList := _PaginatedRoleList{} + + err = json.Unmarshal(data, &varPaginatedRoleList) + + if err != nil { + return err + } + + *o = PaginatedRoleList(varPaginatedRoleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRoleList struct { + value *PaginatedRoleList + isSet bool +} + +func (v NullablePaginatedRoleList) Get() *PaginatedRoleList { + return v.value +} + +func (v *NullablePaginatedRoleList) Set(val *PaginatedRoleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRoleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRoleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRoleList(val *PaginatedRoleList) *NullablePaginatedRoleList { + return &NullablePaginatedRoleList{value: val, isSet: true} +} + +func (v NullablePaginatedRoleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRoleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_route_target_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_route_target_list.go new file mode 100644 index 00000000..fd707ad0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_route_target_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedRouteTargetList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRouteTargetList{} + +// PaginatedRouteTargetList struct for PaginatedRouteTargetList +type PaginatedRouteTargetList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []RouteTarget `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRouteTargetList PaginatedRouteTargetList + +// NewPaginatedRouteTargetList instantiates a new PaginatedRouteTargetList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRouteTargetList() *PaginatedRouteTargetList { + this := PaginatedRouteTargetList{} + return &this +} + +// NewPaginatedRouteTargetListWithDefaults instantiates a new PaginatedRouteTargetList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRouteTargetListWithDefaults() *PaginatedRouteTargetList { + this := PaginatedRouteTargetList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedRouteTargetList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRouteTargetList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedRouteTargetList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedRouteTargetList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRouteTargetList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRouteTargetList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedRouteTargetList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedRouteTargetList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedRouteTargetList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedRouteTargetList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedRouteTargetList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedRouteTargetList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedRouteTargetList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedRouteTargetList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedRouteTargetList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedRouteTargetList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedRouteTargetList) GetResults() []RouteTarget { + if o == nil || IsNil(o.Results) { + var ret []RouteTarget + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedRouteTargetList) GetResultsOk() ([]RouteTarget, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedRouteTargetList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []RouteTarget and assigns it to the Results field. +func (o *PaginatedRouteTargetList) SetResults(v []RouteTarget) { + o.Results = v +} + +func (o PaginatedRouteTargetList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRouteTargetList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRouteTargetList) UnmarshalJSON(data []byte) (err error) { + varPaginatedRouteTargetList := _PaginatedRouteTargetList{} + + err = json.Unmarshal(data, &varPaginatedRouteTargetList) + + if err != nil { + return err + } + + *o = PaginatedRouteTargetList(varPaginatedRouteTargetList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRouteTargetList struct { + value *PaginatedRouteTargetList + isSet bool +} + +func (v NullablePaginatedRouteTargetList) Get() *PaginatedRouteTargetList { + return v.value +} + +func (v *NullablePaginatedRouteTargetList) Set(val *PaginatedRouteTargetList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRouteTargetList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRouteTargetList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRouteTargetList(val *PaginatedRouteTargetList) *NullablePaginatedRouteTargetList { + return &NullablePaginatedRouteTargetList{value: val, isSet: true} +} + +func (v NullablePaginatedRouteTargetList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRouteTargetList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_saved_filter_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_saved_filter_list.go new file mode 100644 index 00000000..28796fa6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_saved_filter_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedSavedFilterList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSavedFilterList{} + +// PaginatedSavedFilterList struct for PaginatedSavedFilterList +type PaginatedSavedFilterList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []SavedFilter `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSavedFilterList PaginatedSavedFilterList + +// NewPaginatedSavedFilterList instantiates a new PaginatedSavedFilterList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSavedFilterList() *PaginatedSavedFilterList { + this := PaginatedSavedFilterList{} + return &this +} + +// NewPaginatedSavedFilterListWithDefaults instantiates a new PaginatedSavedFilterList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSavedFilterListWithDefaults() *PaginatedSavedFilterList { + this := PaginatedSavedFilterList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedSavedFilterList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedSavedFilterList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedSavedFilterList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedSavedFilterList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedSavedFilterList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedSavedFilterList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedSavedFilterList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedSavedFilterList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedSavedFilterList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedSavedFilterList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedSavedFilterList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedSavedFilterList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedSavedFilterList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedSavedFilterList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedSavedFilterList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedSavedFilterList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedSavedFilterList) GetResults() []SavedFilter { + if o == nil || IsNil(o.Results) { + var ret []SavedFilter + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedSavedFilterList) GetResultsOk() ([]SavedFilter, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedSavedFilterList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []SavedFilter and assigns it to the Results field. +func (o *PaginatedSavedFilterList) SetResults(v []SavedFilter) { + o.Results = v +} + +func (o PaginatedSavedFilterList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSavedFilterList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSavedFilterList) UnmarshalJSON(data []byte) (err error) { + varPaginatedSavedFilterList := _PaginatedSavedFilterList{} + + err = json.Unmarshal(data, &varPaginatedSavedFilterList) + + if err != nil { + return err + } + + *o = PaginatedSavedFilterList(varPaginatedSavedFilterList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSavedFilterList struct { + value *PaginatedSavedFilterList + isSet bool +} + +func (v NullablePaginatedSavedFilterList) Get() *PaginatedSavedFilterList { + return v.value +} + +func (v *NullablePaginatedSavedFilterList) Set(val *PaginatedSavedFilterList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSavedFilterList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSavedFilterList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSavedFilterList(val *PaginatedSavedFilterList) *NullablePaginatedSavedFilterList { + return &NullablePaginatedSavedFilterList{value: val, isSet: true} +} + +func (v NullablePaginatedSavedFilterList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSavedFilterList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_service_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_service_list.go new file mode 100644 index 00000000..4e104585 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_service_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedServiceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedServiceList{} + +// PaginatedServiceList struct for PaginatedServiceList +type PaginatedServiceList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Service `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedServiceList PaginatedServiceList + +// NewPaginatedServiceList instantiates a new PaginatedServiceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedServiceList() *PaginatedServiceList { + this := PaginatedServiceList{} + return &this +} + +// NewPaginatedServiceListWithDefaults instantiates a new PaginatedServiceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedServiceListWithDefaults() *PaginatedServiceList { + this := PaginatedServiceList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedServiceList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedServiceList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedServiceList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedServiceList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedServiceList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedServiceList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedServiceList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedServiceList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedServiceList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedServiceList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedServiceList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedServiceList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedServiceList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedServiceList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedServiceList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedServiceList) GetResults() []Service { + if o == nil || IsNil(o.Results) { + var ret []Service + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceList) GetResultsOk() ([]Service, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedServiceList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Service and assigns it to the Results field. +func (o *PaginatedServiceList) SetResults(v []Service) { + o.Results = v +} + +func (o PaginatedServiceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedServiceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedServiceList) UnmarshalJSON(data []byte) (err error) { + varPaginatedServiceList := _PaginatedServiceList{} + + err = json.Unmarshal(data, &varPaginatedServiceList) + + if err != nil { + return err + } + + *o = PaginatedServiceList(varPaginatedServiceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedServiceList struct { + value *PaginatedServiceList + isSet bool +} + +func (v NullablePaginatedServiceList) Get() *PaginatedServiceList { + return v.value +} + +func (v *NullablePaginatedServiceList) Set(val *PaginatedServiceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedServiceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedServiceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedServiceList(val *PaginatedServiceList) *NullablePaginatedServiceList { + return &NullablePaginatedServiceList{value: val, isSet: true} +} + +func (v NullablePaginatedServiceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedServiceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_service_template_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_service_template_list.go new file mode 100644 index 00000000..b0c5ee84 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_service_template_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedServiceTemplateList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedServiceTemplateList{} + +// PaginatedServiceTemplateList struct for PaginatedServiceTemplateList +type PaginatedServiceTemplateList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []ServiceTemplate `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedServiceTemplateList PaginatedServiceTemplateList + +// NewPaginatedServiceTemplateList instantiates a new PaginatedServiceTemplateList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedServiceTemplateList() *PaginatedServiceTemplateList { + this := PaginatedServiceTemplateList{} + return &this +} + +// NewPaginatedServiceTemplateListWithDefaults instantiates a new PaginatedServiceTemplateList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedServiceTemplateListWithDefaults() *PaginatedServiceTemplateList { + this := PaginatedServiceTemplateList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedServiceTemplateList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceTemplateList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedServiceTemplateList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedServiceTemplateList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedServiceTemplateList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedServiceTemplateList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedServiceTemplateList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedServiceTemplateList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedServiceTemplateList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedServiceTemplateList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedServiceTemplateList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedServiceTemplateList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedServiceTemplateList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedServiceTemplateList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedServiceTemplateList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedServiceTemplateList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedServiceTemplateList) GetResults() []ServiceTemplate { + if o == nil || IsNil(o.Results) { + var ret []ServiceTemplate + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceTemplateList) GetResultsOk() ([]ServiceTemplate, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedServiceTemplateList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ServiceTemplate and assigns it to the Results field. +func (o *PaginatedServiceTemplateList) SetResults(v []ServiceTemplate) { + o.Results = v +} + +func (o PaginatedServiceTemplateList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedServiceTemplateList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedServiceTemplateList) UnmarshalJSON(data []byte) (err error) { + varPaginatedServiceTemplateList := _PaginatedServiceTemplateList{} + + err = json.Unmarshal(data, &varPaginatedServiceTemplateList) + + if err != nil { + return err + } + + *o = PaginatedServiceTemplateList(varPaginatedServiceTemplateList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedServiceTemplateList struct { + value *PaginatedServiceTemplateList + isSet bool +} + +func (v NullablePaginatedServiceTemplateList) Get() *PaginatedServiceTemplateList { + return v.value +} + +func (v *NullablePaginatedServiceTemplateList) Set(val *PaginatedServiceTemplateList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedServiceTemplateList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedServiceTemplateList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedServiceTemplateList(val *PaginatedServiceTemplateList) *NullablePaginatedServiceTemplateList { + return &NullablePaginatedServiceTemplateList{value: val, isSet: true} +} + +func (v NullablePaginatedServiceTemplateList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedServiceTemplateList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_site_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_site_group_list.go new file mode 100644 index 00000000..ea1d0157 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_site_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedSiteGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSiteGroupList{} + +// PaginatedSiteGroupList struct for PaginatedSiteGroupList +type PaginatedSiteGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []SiteGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSiteGroupList PaginatedSiteGroupList + +// NewPaginatedSiteGroupList instantiates a new PaginatedSiteGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSiteGroupList() *PaginatedSiteGroupList { + this := PaginatedSiteGroupList{} + return &this +} + +// NewPaginatedSiteGroupListWithDefaults instantiates a new PaginatedSiteGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSiteGroupListWithDefaults() *PaginatedSiteGroupList { + this := PaginatedSiteGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedSiteGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedSiteGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedSiteGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedSiteGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedSiteGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedSiteGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedSiteGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedSiteGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedSiteGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedSiteGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedSiteGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedSiteGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedSiteGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedSiteGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedSiteGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedSiteGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedSiteGroupList) GetResults() []SiteGroup { + if o == nil || IsNil(o.Results) { + var ret []SiteGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedSiteGroupList) GetResultsOk() ([]SiteGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedSiteGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []SiteGroup and assigns it to the Results field. +func (o *PaginatedSiteGroupList) SetResults(v []SiteGroup) { + o.Results = v +} + +func (o PaginatedSiteGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSiteGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSiteGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedSiteGroupList := _PaginatedSiteGroupList{} + + err = json.Unmarshal(data, &varPaginatedSiteGroupList) + + if err != nil { + return err + } + + *o = PaginatedSiteGroupList(varPaginatedSiteGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSiteGroupList struct { + value *PaginatedSiteGroupList + isSet bool +} + +func (v NullablePaginatedSiteGroupList) Get() *PaginatedSiteGroupList { + return v.value +} + +func (v *NullablePaginatedSiteGroupList) Set(val *PaginatedSiteGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSiteGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSiteGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSiteGroupList(val *PaginatedSiteGroupList) *NullablePaginatedSiteGroupList { + return &NullablePaginatedSiteGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedSiteGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSiteGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_site_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_site_list.go new file mode 100644 index 00000000..bf1ee903 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_site_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedSiteList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSiteList{} + +// PaginatedSiteList struct for PaginatedSiteList +type PaginatedSiteList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Site `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSiteList PaginatedSiteList + +// NewPaginatedSiteList instantiates a new PaginatedSiteList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSiteList() *PaginatedSiteList { + this := PaginatedSiteList{} + return &this +} + +// NewPaginatedSiteListWithDefaults instantiates a new PaginatedSiteList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSiteListWithDefaults() *PaginatedSiteList { + this := PaginatedSiteList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedSiteList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedSiteList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedSiteList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedSiteList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedSiteList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedSiteList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedSiteList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedSiteList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedSiteList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedSiteList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedSiteList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedSiteList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedSiteList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedSiteList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedSiteList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedSiteList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedSiteList) GetResults() []Site { + if o == nil || IsNil(o.Results) { + var ret []Site + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedSiteList) GetResultsOk() ([]Site, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedSiteList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Site and assigns it to the Results field. +func (o *PaginatedSiteList) SetResults(v []Site) { + o.Results = v +} + +func (o PaginatedSiteList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSiteList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSiteList) UnmarshalJSON(data []byte) (err error) { + varPaginatedSiteList := _PaginatedSiteList{} + + err = json.Unmarshal(data, &varPaginatedSiteList) + + if err != nil { + return err + } + + *o = PaginatedSiteList(varPaginatedSiteList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSiteList struct { + value *PaginatedSiteList + isSet bool +} + +func (v NullablePaginatedSiteList) Get() *PaginatedSiteList { + return v.value +} + +func (v *NullablePaginatedSiteList) Set(val *PaginatedSiteList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSiteList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSiteList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSiteList(val *PaginatedSiteList) *NullablePaginatedSiteList { + return &NullablePaginatedSiteList{value: val, isSet: true} +} + +func (v NullablePaginatedSiteList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSiteList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tag_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tag_list.go new file mode 100644 index 00000000..72553e77 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tag_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedTagList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTagList{} + +// PaginatedTagList struct for PaginatedTagList +type PaginatedTagList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Tag `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTagList PaginatedTagList + +// NewPaginatedTagList instantiates a new PaginatedTagList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTagList() *PaginatedTagList { + this := PaginatedTagList{} + return &this +} + +// NewPaginatedTagListWithDefaults instantiates a new PaginatedTagList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTagListWithDefaults() *PaginatedTagList { + this := PaginatedTagList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedTagList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTagList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedTagList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedTagList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTagList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTagList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedTagList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedTagList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedTagList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedTagList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTagList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTagList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedTagList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedTagList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedTagList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedTagList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedTagList) GetResults() []Tag { + if o == nil || IsNil(o.Results) { + var ret []Tag + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTagList) GetResultsOk() ([]Tag, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedTagList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Tag and assigns it to the Results field. +func (o *PaginatedTagList) SetResults(v []Tag) { + o.Results = v +} + +func (o PaginatedTagList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTagList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTagList) UnmarshalJSON(data []byte) (err error) { + varPaginatedTagList := _PaginatedTagList{} + + err = json.Unmarshal(data, &varPaginatedTagList) + + if err != nil { + return err + } + + *o = PaginatedTagList(varPaginatedTagList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTagList struct { + value *PaginatedTagList + isSet bool +} + +func (v NullablePaginatedTagList) Get() *PaginatedTagList { + return v.value +} + +func (v *NullablePaginatedTagList) Set(val *PaginatedTagList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTagList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTagList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTagList(val *PaginatedTagList) *NullablePaginatedTagList { + return &NullablePaginatedTagList{value: val, isSet: true} +} + +func (v NullablePaginatedTagList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTagList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tenant_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tenant_group_list.go new file mode 100644 index 00000000..c95fe47c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tenant_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedTenantGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTenantGroupList{} + +// PaginatedTenantGroupList struct for PaginatedTenantGroupList +type PaginatedTenantGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []TenantGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTenantGroupList PaginatedTenantGroupList + +// NewPaginatedTenantGroupList instantiates a new PaginatedTenantGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTenantGroupList() *PaginatedTenantGroupList { + this := PaginatedTenantGroupList{} + return &this +} + +// NewPaginatedTenantGroupListWithDefaults instantiates a new PaginatedTenantGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTenantGroupListWithDefaults() *PaginatedTenantGroupList { + this := PaginatedTenantGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedTenantGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTenantGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedTenantGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedTenantGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTenantGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTenantGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedTenantGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedTenantGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedTenantGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedTenantGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTenantGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTenantGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedTenantGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedTenantGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedTenantGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedTenantGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedTenantGroupList) GetResults() []TenantGroup { + if o == nil || IsNil(o.Results) { + var ret []TenantGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTenantGroupList) GetResultsOk() ([]TenantGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedTenantGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []TenantGroup and assigns it to the Results field. +func (o *PaginatedTenantGroupList) SetResults(v []TenantGroup) { + o.Results = v +} + +func (o PaginatedTenantGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTenantGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTenantGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedTenantGroupList := _PaginatedTenantGroupList{} + + err = json.Unmarshal(data, &varPaginatedTenantGroupList) + + if err != nil { + return err + } + + *o = PaginatedTenantGroupList(varPaginatedTenantGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTenantGroupList struct { + value *PaginatedTenantGroupList + isSet bool +} + +func (v NullablePaginatedTenantGroupList) Get() *PaginatedTenantGroupList { + return v.value +} + +func (v *NullablePaginatedTenantGroupList) Set(val *PaginatedTenantGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTenantGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTenantGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTenantGroupList(val *PaginatedTenantGroupList) *NullablePaginatedTenantGroupList { + return &NullablePaginatedTenantGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedTenantGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTenantGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tenant_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tenant_list.go new file mode 100644 index 00000000..31798d2e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tenant_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedTenantList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTenantList{} + +// PaginatedTenantList struct for PaginatedTenantList +type PaginatedTenantList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Tenant `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTenantList PaginatedTenantList + +// NewPaginatedTenantList instantiates a new PaginatedTenantList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTenantList() *PaginatedTenantList { + this := PaginatedTenantList{} + return &this +} + +// NewPaginatedTenantListWithDefaults instantiates a new PaginatedTenantList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTenantListWithDefaults() *PaginatedTenantList { + this := PaginatedTenantList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedTenantList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTenantList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedTenantList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedTenantList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTenantList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTenantList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedTenantList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedTenantList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedTenantList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedTenantList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTenantList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTenantList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedTenantList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedTenantList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedTenantList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedTenantList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedTenantList) GetResults() []Tenant { + if o == nil || IsNil(o.Results) { + var ret []Tenant + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTenantList) GetResultsOk() ([]Tenant, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedTenantList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Tenant and assigns it to the Results field. +func (o *PaginatedTenantList) SetResults(v []Tenant) { + o.Results = v +} + +func (o PaginatedTenantList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTenantList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTenantList) UnmarshalJSON(data []byte) (err error) { + varPaginatedTenantList := _PaginatedTenantList{} + + err = json.Unmarshal(data, &varPaginatedTenantList) + + if err != nil { + return err + } + + *o = PaginatedTenantList(varPaginatedTenantList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTenantList struct { + value *PaginatedTenantList + isSet bool +} + +func (v NullablePaginatedTenantList) Get() *PaginatedTenantList { + return v.value +} + +func (v *NullablePaginatedTenantList) Set(val *PaginatedTenantList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTenantList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTenantList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTenantList(val *PaginatedTenantList) *NullablePaginatedTenantList { + return &NullablePaginatedTenantList{value: val, isSet: true} +} + +func (v NullablePaginatedTenantList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTenantList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_token_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_token_list.go new file mode 100644 index 00000000..0a93e3dd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_token_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedTokenList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTokenList{} + +// PaginatedTokenList struct for PaginatedTokenList +type PaginatedTokenList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Token `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTokenList PaginatedTokenList + +// NewPaginatedTokenList instantiates a new PaginatedTokenList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTokenList() *PaginatedTokenList { + this := PaginatedTokenList{} + return &this +} + +// NewPaginatedTokenListWithDefaults instantiates a new PaginatedTokenList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTokenListWithDefaults() *PaginatedTokenList { + this := PaginatedTokenList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedTokenList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTokenList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedTokenList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedTokenList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTokenList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTokenList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedTokenList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedTokenList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedTokenList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedTokenList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTokenList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTokenList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedTokenList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedTokenList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedTokenList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedTokenList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedTokenList) GetResults() []Token { + if o == nil || IsNil(o.Results) { + var ret []Token + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTokenList) GetResultsOk() ([]Token, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedTokenList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Token and assigns it to the Results field. +func (o *PaginatedTokenList) SetResults(v []Token) { + o.Results = v +} + +func (o PaginatedTokenList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTokenList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTokenList) UnmarshalJSON(data []byte) (err error) { + varPaginatedTokenList := _PaginatedTokenList{} + + err = json.Unmarshal(data, &varPaginatedTokenList) + + if err != nil { + return err + } + + *o = PaginatedTokenList(varPaginatedTokenList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTokenList struct { + value *PaginatedTokenList + isSet bool +} + +func (v NullablePaginatedTokenList) Get() *PaginatedTokenList { + return v.value +} + +func (v *NullablePaginatedTokenList) Set(val *PaginatedTokenList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTokenList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTokenList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTokenList(val *PaginatedTokenList) *NullablePaginatedTokenList { + return &NullablePaginatedTokenList{value: val, isSet: true} +} + +func (v NullablePaginatedTokenList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTokenList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_group_list.go new file mode 100644 index 00000000..526f5fdf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedTunnelGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTunnelGroupList{} + +// PaginatedTunnelGroupList struct for PaginatedTunnelGroupList +type PaginatedTunnelGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []TunnelGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTunnelGroupList PaginatedTunnelGroupList + +// NewPaginatedTunnelGroupList instantiates a new PaginatedTunnelGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTunnelGroupList() *PaginatedTunnelGroupList { + this := PaginatedTunnelGroupList{} + return &this +} + +// NewPaginatedTunnelGroupListWithDefaults instantiates a new PaginatedTunnelGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTunnelGroupListWithDefaults() *PaginatedTunnelGroupList { + this := PaginatedTunnelGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedTunnelGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTunnelGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedTunnelGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedTunnelGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTunnelGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTunnelGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedTunnelGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedTunnelGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedTunnelGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedTunnelGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTunnelGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTunnelGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedTunnelGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedTunnelGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedTunnelGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedTunnelGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedTunnelGroupList) GetResults() []TunnelGroup { + if o == nil || IsNil(o.Results) { + var ret []TunnelGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTunnelGroupList) GetResultsOk() ([]TunnelGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedTunnelGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []TunnelGroup and assigns it to the Results field. +func (o *PaginatedTunnelGroupList) SetResults(v []TunnelGroup) { + o.Results = v +} + +func (o PaginatedTunnelGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTunnelGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTunnelGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedTunnelGroupList := _PaginatedTunnelGroupList{} + + err = json.Unmarshal(data, &varPaginatedTunnelGroupList) + + if err != nil { + return err + } + + *o = PaginatedTunnelGroupList(varPaginatedTunnelGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTunnelGroupList struct { + value *PaginatedTunnelGroupList + isSet bool +} + +func (v NullablePaginatedTunnelGroupList) Get() *PaginatedTunnelGroupList { + return v.value +} + +func (v *NullablePaginatedTunnelGroupList) Set(val *PaginatedTunnelGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTunnelGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTunnelGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTunnelGroupList(val *PaginatedTunnelGroupList) *NullablePaginatedTunnelGroupList { + return &NullablePaginatedTunnelGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedTunnelGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTunnelGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_list.go new file mode 100644 index 00000000..05a32e76 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedTunnelList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTunnelList{} + +// PaginatedTunnelList struct for PaginatedTunnelList +type PaginatedTunnelList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Tunnel `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTunnelList PaginatedTunnelList + +// NewPaginatedTunnelList instantiates a new PaginatedTunnelList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTunnelList() *PaginatedTunnelList { + this := PaginatedTunnelList{} + return &this +} + +// NewPaginatedTunnelListWithDefaults instantiates a new PaginatedTunnelList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTunnelListWithDefaults() *PaginatedTunnelList { + this := PaginatedTunnelList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedTunnelList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTunnelList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedTunnelList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedTunnelList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTunnelList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTunnelList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedTunnelList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedTunnelList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedTunnelList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedTunnelList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTunnelList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTunnelList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedTunnelList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedTunnelList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedTunnelList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedTunnelList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedTunnelList) GetResults() []Tunnel { + if o == nil || IsNil(o.Results) { + var ret []Tunnel + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTunnelList) GetResultsOk() ([]Tunnel, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedTunnelList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Tunnel and assigns it to the Results field. +func (o *PaginatedTunnelList) SetResults(v []Tunnel) { + o.Results = v +} + +func (o PaginatedTunnelList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTunnelList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTunnelList) UnmarshalJSON(data []byte) (err error) { + varPaginatedTunnelList := _PaginatedTunnelList{} + + err = json.Unmarshal(data, &varPaginatedTunnelList) + + if err != nil { + return err + } + + *o = PaginatedTunnelList(varPaginatedTunnelList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTunnelList struct { + value *PaginatedTunnelList + isSet bool +} + +func (v NullablePaginatedTunnelList) Get() *PaginatedTunnelList { + return v.value +} + +func (v *NullablePaginatedTunnelList) Set(val *PaginatedTunnelList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTunnelList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTunnelList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTunnelList(val *PaginatedTunnelList) *NullablePaginatedTunnelList { + return &NullablePaginatedTunnelList{value: val, isSet: true} +} + +func (v NullablePaginatedTunnelList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTunnelList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_termination_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_termination_list.go new file mode 100644 index 00000000..0c729ea5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_tunnel_termination_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedTunnelTerminationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTunnelTerminationList{} + +// PaginatedTunnelTerminationList struct for PaginatedTunnelTerminationList +type PaginatedTunnelTerminationList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []TunnelTermination `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTunnelTerminationList PaginatedTunnelTerminationList + +// NewPaginatedTunnelTerminationList instantiates a new PaginatedTunnelTerminationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTunnelTerminationList() *PaginatedTunnelTerminationList { + this := PaginatedTunnelTerminationList{} + return &this +} + +// NewPaginatedTunnelTerminationListWithDefaults instantiates a new PaginatedTunnelTerminationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTunnelTerminationListWithDefaults() *PaginatedTunnelTerminationList { + this := PaginatedTunnelTerminationList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedTunnelTerminationList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTunnelTerminationList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedTunnelTerminationList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedTunnelTerminationList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTunnelTerminationList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTunnelTerminationList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedTunnelTerminationList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedTunnelTerminationList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedTunnelTerminationList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedTunnelTerminationList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedTunnelTerminationList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedTunnelTerminationList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedTunnelTerminationList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedTunnelTerminationList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedTunnelTerminationList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedTunnelTerminationList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedTunnelTerminationList) GetResults() []TunnelTermination { + if o == nil || IsNil(o.Results) { + var ret []TunnelTermination + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedTunnelTerminationList) GetResultsOk() ([]TunnelTermination, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedTunnelTerminationList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []TunnelTermination and assigns it to the Results field. +func (o *PaginatedTunnelTerminationList) SetResults(v []TunnelTermination) { + o.Results = v +} + +func (o PaginatedTunnelTerminationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTunnelTerminationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTunnelTerminationList) UnmarshalJSON(data []byte) (err error) { + varPaginatedTunnelTerminationList := _PaginatedTunnelTerminationList{} + + err = json.Unmarshal(data, &varPaginatedTunnelTerminationList) + + if err != nil { + return err + } + + *o = PaginatedTunnelTerminationList(varPaginatedTunnelTerminationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTunnelTerminationList struct { + value *PaginatedTunnelTerminationList + isSet bool +} + +func (v NullablePaginatedTunnelTerminationList) Get() *PaginatedTunnelTerminationList { + return v.value +} + +func (v *NullablePaginatedTunnelTerminationList) Set(val *PaginatedTunnelTerminationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTunnelTerminationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTunnelTerminationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTunnelTerminationList(val *PaginatedTunnelTerminationList) *NullablePaginatedTunnelTerminationList { + return &NullablePaginatedTunnelTerminationList{value: val, isSet: true} +} + +func (v NullablePaginatedTunnelTerminationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTunnelTerminationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_user_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_user_list.go new file mode 100644 index 00000000..3ad816ca --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_user_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedUserList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserList{} + +// PaginatedUserList struct for PaginatedUserList +type PaginatedUserList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []User `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserList PaginatedUserList + +// NewPaginatedUserList instantiates a new PaginatedUserList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserList() *PaginatedUserList { + this := PaginatedUserList{} + return &this +} + +// NewPaginatedUserListWithDefaults instantiates a new PaginatedUserList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserListWithDefaults() *PaginatedUserList { + this := PaginatedUserList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedUserList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedUserList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedUserList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedUserList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedUserList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedUserList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedUserList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedUserList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedUserList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedUserList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedUserList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedUserList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedUserList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedUserList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedUserList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedUserList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedUserList) GetResults() []User { + if o == nil || IsNil(o.Results) { + var ret []User + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedUserList) GetResultsOk() ([]User, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedUserList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []User and assigns it to the Results field. +func (o *PaginatedUserList) SetResults(v []User) { + o.Results = v +} + +func (o PaginatedUserList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserList) UnmarshalJSON(data []byte) (err error) { + varPaginatedUserList := _PaginatedUserList{} + + err = json.Unmarshal(data, &varPaginatedUserList) + + if err != nil { + return err + } + + *o = PaginatedUserList(varPaginatedUserList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserList struct { + value *PaginatedUserList + isSet bool +} + +func (v NullablePaginatedUserList) Get() *PaginatedUserList { + return v.value +} + +func (v *NullablePaginatedUserList) Set(val *PaginatedUserList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserList(val *PaginatedUserList) *NullablePaginatedUserList { + return &NullablePaginatedUserList{value: val, isSet: true} +} + +func (v NullablePaginatedUserList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_chassis_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_chassis_list.go new file mode 100644 index 00000000..ec724a4a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_chassis_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVirtualChassisList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVirtualChassisList{} + +// PaginatedVirtualChassisList struct for PaginatedVirtualChassisList +type PaginatedVirtualChassisList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VirtualChassis `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVirtualChassisList PaginatedVirtualChassisList + +// NewPaginatedVirtualChassisList instantiates a new PaginatedVirtualChassisList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVirtualChassisList() *PaginatedVirtualChassisList { + this := PaginatedVirtualChassisList{} + return &this +} + +// NewPaginatedVirtualChassisListWithDefaults instantiates a new PaginatedVirtualChassisList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVirtualChassisListWithDefaults() *PaginatedVirtualChassisList { + this := PaginatedVirtualChassisList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVirtualChassisList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualChassisList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVirtualChassisList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVirtualChassisList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualChassisList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualChassisList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVirtualChassisList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVirtualChassisList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVirtualChassisList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVirtualChassisList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualChassisList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualChassisList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVirtualChassisList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVirtualChassisList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVirtualChassisList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVirtualChassisList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVirtualChassisList) GetResults() []VirtualChassis { + if o == nil || IsNil(o.Results) { + var ret []VirtualChassis + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualChassisList) GetResultsOk() ([]VirtualChassis, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVirtualChassisList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VirtualChassis and assigns it to the Results field. +func (o *PaginatedVirtualChassisList) SetResults(v []VirtualChassis) { + o.Results = v +} + +func (o PaginatedVirtualChassisList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVirtualChassisList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVirtualChassisList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVirtualChassisList := _PaginatedVirtualChassisList{} + + err = json.Unmarshal(data, &varPaginatedVirtualChassisList) + + if err != nil { + return err + } + + *o = PaginatedVirtualChassisList(varPaginatedVirtualChassisList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVirtualChassisList struct { + value *PaginatedVirtualChassisList + isSet bool +} + +func (v NullablePaginatedVirtualChassisList) Get() *PaginatedVirtualChassisList { + return v.value +} + +func (v *NullablePaginatedVirtualChassisList) Set(val *PaginatedVirtualChassisList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVirtualChassisList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVirtualChassisList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVirtualChassisList(val *PaginatedVirtualChassisList) *NullablePaginatedVirtualChassisList { + return &NullablePaginatedVirtualChassisList{value: val, isSet: true} +} + +func (v NullablePaginatedVirtualChassisList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVirtualChassisList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_device_context_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_device_context_list.go new file mode 100644 index 00000000..2f61fe95 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_device_context_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVirtualDeviceContextList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVirtualDeviceContextList{} + +// PaginatedVirtualDeviceContextList struct for PaginatedVirtualDeviceContextList +type PaginatedVirtualDeviceContextList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VirtualDeviceContext `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVirtualDeviceContextList PaginatedVirtualDeviceContextList + +// NewPaginatedVirtualDeviceContextList instantiates a new PaginatedVirtualDeviceContextList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVirtualDeviceContextList() *PaginatedVirtualDeviceContextList { + this := PaginatedVirtualDeviceContextList{} + return &this +} + +// NewPaginatedVirtualDeviceContextListWithDefaults instantiates a new PaginatedVirtualDeviceContextList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVirtualDeviceContextListWithDefaults() *PaginatedVirtualDeviceContextList { + this := PaginatedVirtualDeviceContextList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVirtualDeviceContextList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualDeviceContextList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVirtualDeviceContextList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVirtualDeviceContextList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualDeviceContextList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualDeviceContextList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVirtualDeviceContextList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVirtualDeviceContextList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVirtualDeviceContextList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVirtualDeviceContextList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualDeviceContextList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualDeviceContextList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVirtualDeviceContextList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVirtualDeviceContextList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVirtualDeviceContextList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVirtualDeviceContextList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVirtualDeviceContextList) GetResults() []VirtualDeviceContext { + if o == nil || IsNil(o.Results) { + var ret []VirtualDeviceContext + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualDeviceContextList) GetResultsOk() ([]VirtualDeviceContext, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVirtualDeviceContextList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VirtualDeviceContext and assigns it to the Results field. +func (o *PaginatedVirtualDeviceContextList) SetResults(v []VirtualDeviceContext) { + o.Results = v +} + +func (o PaginatedVirtualDeviceContextList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVirtualDeviceContextList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVirtualDeviceContextList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVirtualDeviceContextList := _PaginatedVirtualDeviceContextList{} + + err = json.Unmarshal(data, &varPaginatedVirtualDeviceContextList) + + if err != nil { + return err + } + + *o = PaginatedVirtualDeviceContextList(varPaginatedVirtualDeviceContextList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVirtualDeviceContextList struct { + value *PaginatedVirtualDeviceContextList + isSet bool +} + +func (v NullablePaginatedVirtualDeviceContextList) Get() *PaginatedVirtualDeviceContextList { + return v.value +} + +func (v *NullablePaginatedVirtualDeviceContextList) Set(val *PaginatedVirtualDeviceContextList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVirtualDeviceContextList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVirtualDeviceContextList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVirtualDeviceContextList(val *PaginatedVirtualDeviceContextList) *NullablePaginatedVirtualDeviceContextList { + return &NullablePaginatedVirtualDeviceContextList{value: val, isSet: true} +} + +func (v NullablePaginatedVirtualDeviceContextList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVirtualDeviceContextList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_disk_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_disk_list.go new file mode 100644 index 00000000..6150d7fd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_disk_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVirtualDiskList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVirtualDiskList{} + +// PaginatedVirtualDiskList struct for PaginatedVirtualDiskList +type PaginatedVirtualDiskList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VirtualDisk `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVirtualDiskList PaginatedVirtualDiskList + +// NewPaginatedVirtualDiskList instantiates a new PaginatedVirtualDiskList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVirtualDiskList() *PaginatedVirtualDiskList { + this := PaginatedVirtualDiskList{} + return &this +} + +// NewPaginatedVirtualDiskListWithDefaults instantiates a new PaginatedVirtualDiskList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVirtualDiskListWithDefaults() *PaginatedVirtualDiskList { + this := PaginatedVirtualDiskList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVirtualDiskList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualDiskList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVirtualDiskList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVirtualDiskList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualDiskList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualDiskList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVirtualDiskList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVirtualDiskList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVirtualDiskList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVirtualDiskList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualDiskList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualDiskList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVirtualDiskList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVirtualDiskList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVirtualDiskList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVirtualDiskList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVirtualDiskList) GetResults() []VirtualDisk { + if o == nil || IsNil(o.Results) { + var ret []VirtualDisk + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualDiskList) GetResultsOk() ([]VirtualDisk, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVirtualDiskList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VirtualDisk and assigns it to the Results field. +func (o *PaginatedVirtualDiskList) SetResults(v []VirtualDisk) { + o.Results = v +} + +func (o PaginatedVirtualDiskList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVirtualDiskList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVirtualDiskList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVirtualDiskList := _PaginatedVirtualDiskList{} + + err = json.Unmarshal(data, &varPaginatedVirtualDiskList) + + if err != nil { + return err + } + + *o = PaginatedVirtualDiskList(varPaginatedVirtualDiskList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVirtualDiskList struct { + value *PaginatedVirtualDiskList + isSet bool +} + +func (v NullablePaginatedVirtualDiskList) Get() *PaginatedVirtualDiskList { + return v.value +} + +func (v *NullablePaginatedVirtualDiskList) Set(val *PaginatedVirtualDiskList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVirtualDiskList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVirtualDiskList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVirtualDiskList(val *PaginatedVirtualDiskList) *NullablePaginatedVirtualDiskList { + return &NullablePaginatedVirtualDiskList{value: val, isSet: true} +} + +func (v NullablePaginatedVirtualDiskList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVirtualDiskList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_machine_with_config_context_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_machine_with_config_context_list.go new file mode 100644 index 00000000..c20dc4df --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_virtual_machine_with_config_context_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVirtualMachineWithConfigContextList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVirtualMachineWithConfigContextList{} + +// PaginatedVirtualMachineWithConfigContextList struct for PaginatedVirtualMachineWithConfigContextList +type PaginatedVirtualMachineWithConfigContextList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VirtualMachineWithConfigContext `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVirtualMachineWithConfigContextList PaginatedVirtualMachineWithConfigContextList + +// NewPaginatedVirtualMachineWithConfigContextList instantiates a new PaginatedVirtualMachineWithConfigContextList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVirtualMachineWithConfigContextList() *PaginatedVirtualMachineWithConfigContextList { + this := PaginatedVirtualMachineWithConfigContextList{} + return &this +} + +// NewPaginatedVirtualMachineWithConfigContextListWithDefaults instantiates a new PaginatedVirtualMachineWithConfigContextList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVirtualMachineWithConfigContextListWithDefaults() *PaginatedVirtualMachineWithConfigContextList { + this := PaginatedVirtualMachineWithConfigContextList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVirtualMachineWithConfigContextList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualMachineWithConfigContextList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVirtualMachineWithConfigContextList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVirtualMachineWithConfigContextList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualMachineWithConfigContextList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualMachineWithConfigContextList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVirtualMachineWithConfigContextList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVirtualMachineWithConfigContextList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVirtualMachineWithConfigContextList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVirtualMachineWithConfigContextList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVirtualMachineWithConfigContextList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVirtualMachineWithConfigContextList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVirtualMachineWithConfigContextList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVirtualMachineWithConfigContextList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVirtualMachineWithConfigContextList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVirtualMachineWithConfigContextList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVirtualMachineWithConfigContextList) GetResults() []VirtualMachineWithConfigContext { + if o == nil || IsNil(o.Results) { + var ret []VirtualMachineWithConfigContext + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVirtualMachineWithConfigContextList) GetResultsOk() ([]VirtualMachineWithConfigContext, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVirtualMachineWithConfigContextList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VirtualMachineWithConfigContext and assigns it to the Results field. +func (o *PaginatedVirtualMachineWithConfigContextList) SetResults(v []VirtualMachineWithConfigContext) { + o.Results = v +} + +func (o PaginatedVirtualMachineWithConfigContextList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVirtualMachineWithConfigContextList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVirtualMachineWithConfigContextList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVirtualMachineWithConfigContextList := _PaginatedVirtualMachineWithConfigContextList{} + + err = json.Unmarshal(data, &varPaginatedVirtualMachineWithConfigContextList) + + if err != nil { + return err + } + + *o = PaginatedVirtualMachineWithConfigContextList(varPaginatedVirtualMachineWithConfigContextList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVirtualMachineWithConfigContextList struct { + value *PaginatedVirtualMachineWithConfigContextList + isSet bool +} + +func (v NullablePaginatedVirtualMachineWithConfigContextList) Get() *PaginatedVirtualMachineWithConfigContextList { + return v.value +} + +func (v *NullablePaginatedVirtualMachineWithConfigContextList) Set(val *PaginatedVirtualMachineWithConfigContextList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVirtualMachineWithConfigContextList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVirtualMachineWithConfigContextList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVirtualMachineWithConfigContextList(val *PaginatedVirtualMachineWithConfigContextList) *NullablePaginatedVirtualMachineWithConfigContextList { + return &NullablePaginatedVirtualMachineWithConfigContextList{value: val, isSet: true} +} + +func (v NullablePaginatedVirtualMachineWithConfigContextList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVirtualMachineWithConfigContextList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vlan_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vlan_group_list.go new file mode 100644 index 00000000..19a0f9a2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vlan_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVLANGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVLANGroupList{} + +// PaginatedVLANGroupList struct for PaginatedVLANGroupList +type PaginatedVLANGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VLANGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVLANGroupList PaginatedVLANGroupList + +// NewPaginatedVLANGroupList instantiates a new PaginatedVLANGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVLANGroupList() *PaginatedVLANGroupList { + this := PaginatedVLANGroupList{} + return &this +} + +// NewPaginatedVLANGroupListWithDefaults instantiates a new PaginatedVLANGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVLANGroupListWithDefaults() *PaginatedVLANGroupList { + this := PaginatedVLANGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVLANGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVLANGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVLANGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVLANGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVLANGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVLANGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVLANGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVLANGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVLANGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVLANGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVLANGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVLANGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVLANGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVLANGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVLANGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVLANGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVLANGroupList) GetResults() []VLANGroup { + if o == nil || IsNil(o.Results) { + var ret []VLANGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVLANGroupList) GetResultsOk() ([]VLANGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVLANGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VLANGroup and assigns it to the Results field. +func (o *PaginatedVLANGroupList) SetResults(v []VLANGroup) { + o.Results = v +} + +func (o PaginatedVLANGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVLANGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVLANGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVLANGroupList := _PaginatedVLANGroupList{} + + err = json.Unmarshal(data, &varPaginatedVLANGroupList) + + if err != nil { + return err + } + + *o = PaginatedVLANGroupList(varPaginatedVLANGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVLANGroupList struct { + value *PaginatedVLANGroupList + isSet bool +} + +func (v NullablePaginatedVLANGroupList) Get() *PaginatedVLANGroupList { + return v.value +} + +func (v *NullablePaginatedVLANGroupList) Set(val *PaginatedVLANGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVLANGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVLANGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVLANGroupList(val *PaginatedVLANGroupList) *NullablePaginatedVLANGroupList { + return &NullablePaginatedVLANGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedVLANGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVLANGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vlan_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vlan_list.go new file mode 100644 index 00000000..75ab45cf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vlan_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVLANList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVLANList{} + +// PaginatedVLANList struct for PaginatedVLANList +type PaginatedVLANList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VLAN `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVLANList PaginatedVLANList + +// NewPaginatedVLANList instantiates a new PaginatedVLANList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVLANList() *PaginatedVLANList { + this := PaginatedVLANList{} + return &this +} + +// NewPaginatedVLANListWithDefaults instantiates a new PaginatedVLANList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVLANListWithDefaults() *PaginatedVLANList { + this := PaginatedVLANList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVLANList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVLANList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVLANList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVLANList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVLANList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVLANList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVLANList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVLANList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVLANList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVLANList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVLANList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVLANList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVLANList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVLANList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVLANList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVLANList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVLANList) GetResults() []VLAN { + if o == nil || IsNil(o.Results) { + var ret []VLAN + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVLANList) GetResultsOk() ([]VLAN, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVLANList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VLAN and assigns it to the Results field. +func (o *PaginatedVLANList) SetResults(v []VLAN) { + o.Results = v +} + +func (o PaginatedVLANList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVLANList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVLANList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVLANList := _PaginatedVLANList{} + + err = json.Unmarshal(data, &varPaginatedVLANList) + + if err != nil { + return err + } + + *o = PaginatedVLANList(varPaginatedVLANList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVLANList struct { + value *PaginatedVLANList + isSet bool +} + +func (v NullablePaginatedVLANList) Get() *PaginatedVLANList { + return v.value +} + +func (v *NullablePaginatedVLANList) Set(val *PaginatedVLANList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVLANList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVLANList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVLANList(val *PaginatedVLANList) *NullablePaginatedVLANList { + return &NullablePaginatedVLANList{value: val, isSet: true} +} + +func (v NullablePaginatedVLANList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVLANList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vm_interface_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vm_interface_list.go new file mode 100644 index 00000000..5b92056d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vm_interface_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVMInterfaceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVMInterfaceList{} + +// PaginatedVMInterfaceList struct for PaginatedVMInterfaceList +type PaginatedVMInterfaceList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VMInterface `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVMInterfaceList PaginatedVMInterfaceList + +// NewPaginatedVMInterfaceList instantiates a new PaginatedVMInterfaceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVMInterfaceList() *PaginatedVMInterfaceList { + this := PaginatedVMInterfaceList{} + return &this +} + +// NewPaginatedVMInterfaceListWithDefaults instantiates a new PaginatedVMInterfaceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVMInterfaceListWithDefaults() *PaginatedVMInterfaceList { + this := PaginatedVMInterfaceList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVMInterfaceList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVMInterfaceList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVMInterfaceList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVMInterfaceList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVMInterfaceList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVMInterfaceList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVMInterfaceList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVMInterfaceList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVMInterfaceList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVMInterfaceList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVMInterfaceList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVMInterfaceList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVMInterfaceList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVMInterfaceList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVMInterfaceList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVMInterfaceList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVMInterfaceList) GetResults() []VMInterface { + if o == nil || IsNil(o.Results) { + var ret []VMInterface + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVMInterfaceList) GetResultsOk() ([]VMInterface, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVMInterfaceList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VMInterface and assigns it to the Results field. +func (o *PaginatedVMInterfaceList) SetResults(v []VMInterface) { + o.Results = v +} + +func (o PaginatedVMInterfaceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVMInterfaceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVMInterfaceList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVMInterfaceList := _PaginatedVMInterfaceList{} + + err = json.Unmarshal(data, &varPaginatedVMInterfaceList) + + if err != nil { + return err + } + + *o = PaginatedVMInterfaceList(varPaginatedVMInterfaceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVMInterfaceList struct { + value *PaginatedVMInterfaceList + isSet bool +} + +func (v NullablePaginatedVMInterfaceList) Get() *PaginatedVMInterfaceList { + return v.value +} + +func (v *NullablePaginatedVMInterfaceList) Set(val *PaginatedVMInterfaceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVMInterfaceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVMInterfaceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVMInterfaceList(val *PaginatedVMInterfaceList) *NullablePaginatedVMInterfaceList { + return &NullablePaginatedVMInterfaceList{value: val, isSet: true} +} + +func (v NullablePaginatedVMInterfaceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVMInterfaceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vrf_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vrf_list.go new file mode 100644 index 00000000..3c63042b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_vrf_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedVRFList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedVRFList{} + +// PaginatedVRFList struct for PaginatedVRFList +type PaginatedVRFList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []VRF `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedVRFList PaginatedVRFList + +// NewPaginatedVRFList instantiates a new PaginatedVRFList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedVRFList() *PaginatedVRFList { + this := PaginatedVRFList{} + return &this +} + +// NewPaginatedVRFListWithDefaults instantiates a new PaginatedVRFList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedVRFListWithDefaults() *PaginatedVRFList { + this := PaginatedVRFList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedVRFList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVRFList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedVRFList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedVRFList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVRFList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVRFList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedVRFList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedVRFList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedVRFList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedVRFList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedVRFList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedVRFList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedVRFList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedVRFList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedVRFList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedVRFList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedVRFList) GetResults() []VRF { + if o == nil || IsNil(o.Results) { + var ret []VRF + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedVRFList) GetResultsOk() ([]VRF, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedVRFList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []VRF and assigns it to the Results field. +func (o *PaginatedVRFList) SetResults(v []VRF) { + o.Results = v +} + +func (o PaginatedVRFList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedVRFList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedVRFList) UnmarshalJSON(data []byte) (err error) { + varPaginatedVRFList := _PaginatedVRFList{} + + err = json.Unmarshal(data, &varPaginatedVRFList) + + if err != nil { + return err + } + + *o = PaginatedVRFList(varPaginatedVRFList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedVRFList struct { + value *PaginatedVRFList + isSet bool +} + +func (v NullablePaginatedVRFList) Get() *PaginatedVRFList { + return v.value +} + +func (v *NullablePaginatedVRFList) Set(val *PaginatedVRFList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedVRFList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedVRFList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedVRFList(val *PaginatedVRFList) *NullablePaginatedVRFList { + return &NullablePaginatedVRFList{value: val, isSet: true} +} + +func (v NullablePaginatedVRFList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedVRFList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_webhook_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_webhook_list.go new file mode 100644 index 00000000..3b8bc05a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_webhook_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedWebhookList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedWebhookList{} + +// PaginatedWebhookList struct for PaginatedWebhookList +type PaginatedWebhookList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []Webhook `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedWebhookList PaginatedWebhookList + +// NewPaginatedWebhookList instantiates a new PaginatedWebhookList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedWebhookList() *PaginatedWebhookList { + this := PaginatedWebhookList{} + return &this +} + +// NewPaginatedWebhookListWithDefaults instantiates a new PaginatedWebhookList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedWebhookListWithDefaults() *PaginatedWebhookList { + this := PaginatedWebhookList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedWebhookList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWebhookList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedWebhookList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedWebhookList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWebhookList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWebhookList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedWebhookList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedWebhookList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedWebhookList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedWebhookList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWebhookList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWebhookList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedWebhookList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedWebhookList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedWebhookList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedWebhookList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedWebhookList) GetResults() []Webhook { + if o == nil || IsNil(o.Results) { + var ret []Webhook + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWebhookList) GetResultsOk() ([]Webhook, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedWebhookList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []Webhook and assigns it to the Results field. +func (o *PaginatedWebhookList) SetResults(v []Webhook) { + o.Results = v +} + +func (o PaginatedWebhookList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedWebhookList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedWebhookList) UnmarshalJSON(data []byte) (err error) { + varPaginatedWebhookList := _PaginatedWebhookList{} + + err = json.Unmarshal(data, &varPaginatedWebhookList) + + if err != nil { + return err + } + + *o = PaginatedWebhookList(varPaginatedWebhookList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedWebhookList struct { + value *PaginatedWebhookList + isSet bool +} + +func (v NullablePaginatedWebhookList) Get() *PaginatedWebhookList { + return v.value +} + +func (v *NullablePaginatedWebhookList) Set(val *PaginatedWebhookList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedWebhookList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedWebhookList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedWebhookList(val *PaginatedWebhookList) *NullablePaginatedWebhookList { + return &NullablePaginatedWebhookList{value: val, isSet: true} +} + +func (v NullablePaginatedWebhookList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedWebhookList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_lan_group_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_lan_group_list.go new file mode 100644 index 00000000..4788c3e7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_lan_group_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedWirelessLANGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedWirelessLANGroupList{} + +// PaginatedWirelessLANGroupList struct for PaginatedWirelessLANGroupList +type PaginatedWirelessLANGroupList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []WirelessLANGroup `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedWirelessLANGroupList PaginatedWirelessLANGroupList + +// NewPaginatedWirelessLANGroupList instantiates a new PaginatedWirelessLANGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedWirelessLANGroupList() *PaginatedWirelessLANGroupList { + this := PaginatedWirelessLANGroupList{} + return &this +} + +// NewPaginatedWirelessLANGroupListWithDefaults instantiates a new PaginatedWirelessLANGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedWirelessLANGroupListWithDefaults() *PaginatedWirelessLANGroupList { + this := PaginatedWirelessLANGroupList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedWirelessLANGroupList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWirelessLANGroupList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedWirelessLANGroupList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedWirelessLANGroupList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWirelessLANGroupList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWirelessLANGroupList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedWirelessLANGroupList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedWirelessLANGroupList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedWirelessLANGroupList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedWirelessLANGroupList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWirelessLANGroupList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWirelessLANGroupList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedWirelessLANGroupList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedWirelessLANGroupList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedWirelessLANGroupList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedWirelessLANGroupList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedWirelessLANGroupList) GetResults() []WirelessLANGroup { + if o == nil || IsNil(o.Results) { + var ret []WirelessLANGroup + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWirelessLANGroupList) GetResultsOk() ([]WirelessLANGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedWirelessLANGroupList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []WirelessLANGroup and assigns it to the Results field. +func (o *PaginatedWirelessLANGroupList) SetResults(v []WirelessLANGroup) { + o.Results = v +} + +func (o PaginatedWirelessLANGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedWirelessLANGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedWirelessLANGroupList) UnmarshalJSON(data []byte) (err error) { + varPaginatedWirelessLANGroupList := _PaginatedWirelessLANGroupList{} + + err = json.Unmarshal(data, &varPaginatedWirelessLANGroupList) + + if err != nil { + return err + } + + *o = PaginatedWirelessLANGroupList(varPaginatedWirelessLANGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedWirelessLANGroupList struct { + value *PaginatedWirelessLANGroupList + isSet bool +} + +func (v NullablePaginatedWirelessLANGroupList) Get() *PaginatedWirelessLANGroupList { + return v.value +} + +func (v *NullablePaginatedWirelessLANGroupList) Set(val *PaginatedWirelessLANGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedWirelessLANGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedWirelessLANGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedWirelessLANGroupList(val *PaginatedWirelessLANGroupList) *NullablePaginatedWirelessLANGroupList { + return &NullablePaginatedWirelessLANGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedWirelessLANGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedWirelessLANGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_lan_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_lan_list.go new file mode 100644 index 00000000..f4efa527 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_lan_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedWirelessLANList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedWirelessLANList{} + +// PaginatedWirelessLANList struct for PaginatedWirelessLANList +type PaginatedWirelessLANList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []WirelessLAN `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedWirelessLANList PaginatedWirelessLANList + +// NewPaginatedWirelessLANList instantiates a new PaginatedWirelessLANList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedWirelessLANList() *PaginatedWirelessLANList { + this := PaginatedWirelessLANList{} + return &this +} + +// NewPaginatedWirelessLANListWithDefaults instantiates a new PaginatedWirelessLANList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedWirelessLANListWithDefaults() *PaginatedWirelessLANList { + this := PaginatedWirelessLANList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedWirelessLANList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWirelessLANList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedWirelessLANList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedWirelessLANList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWirelessLANList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWirelessLANList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedWirelessLANList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedWirelessLANList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedWirelessLANList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedWirelessLANList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWirelessLANList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWirelessLANList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedWirelessLANList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedWirelessLANList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedWirelessLANList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedWirelessLANList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedWirelessLANList) GetResults() []WirelessLAN { + if o == nil || IsNil(o.Results) { + var ret []WirelessLAN + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWirelessLANList) GetResultsOk() ([]WirelessLAN, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedWirelessLANList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []WirelessLAN and assigns it to the Results field. +func (o *PaginatedWirelessLANList) SetResults(v []WirelessLAN) { + o.Results = v +} + +func (o PaginatedWirelessLANList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedWirelessLANList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedWirelessLANList) UnmarshalJSON(data []byte) (err error) { + varPaginatedWirelessLANList := _PaginatedWirelessLANList{} + + err = json.Unmarshal(data, &varPaginatedWirelessLANList) + + if err != nil { + return err + } + + *o = PaginatedWirelessLANList(varPaginatedWirelessLANList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedWirelessLANList struct { + value *PaginatedWirelessLANList + isSet bool +} + +func (v NullablePaginatedWirelessLANList) Get() *PaginatedWirelessLANList { + return v.value +} + +func (v *NullablePaginatedWirelessLANList) Set(val *PaginatedWirelessLANList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedWirelessLANList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedWirelessLANList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedWirelessLANList(val *PaginatedWirelessLANList) *NullablePaginatedWirelessLANList { + return &NullablePaginatedWirelessLANList{value: val, isSet: true} +} + +func (v NullablePaginatedWirelessLANList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedWirelessLANList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_link_list.go b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_link_list.go new file mode 100644 index 00000000..7b80cdba --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_paginated_wireless_link_list.go @@ -0,0 +1,286 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PaginatedWirelessLinkList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedWirelessLinkList{} + +// PaginatedWirelessLinkList struct for PaginatedWirelessLinkList +type PaginatedWirelessLinkList struct { + Count *int32 `json:"count,omitempty"` + Next NullableString `json:"next,omitempty"` + Previous NullableString `json:"previous,omitempty"` + Results []WirelessLink `json:"results,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedWirelessLinkList PaginatedWirelessLinkList + +// NewPaginatedWirelessLinkList instantiates a new PaginatedWirelessLinkList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedWirelessLinkList() *PaginatedWirelessLinkList { + this := PaginatedWirelessLinkList{} + return &this +} + +// NewPaginatedWirelessLinkListWithDefaults instantiates a new PaginatedWirelessLinkList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedWirelessLinkListWithDefaults() *PaginatedWirelessLinkList { + this := PaginatedWirelessLinkList{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PaginatedWirelessLinkList) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWirelessLinkList) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PaginatedWirelessLinkList) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PaginatedWirelessLinkList) SetCount(v int32) { + o.Count = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWirelessLinkList) GetNext() string { + if o == nil || IsNil(o.Next.Get()) { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWirelessLinkList) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *PaginatedWirelessLinkList) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableString and assigns it to the Next field. +func (o *PaginatedWirelessLinkList) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil +func (o *PaginatedWirelessLinkList) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *PaginatedWirelessLinkList) UnsetNext() { + o.Next.Unset() +} + +// GetPrevious returns the Previous field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaginatedWirelessLinkList) GetPrevious() string { + if o == nil || IsNil(o.Previous.Get()) { + var ret string + return ret + } + return *o.Previous.Get() +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaginatedWirelessLinkList) GetPreviousOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Previous.Get(), o.Previous.IsSet() +} + +// HasPrevious returns a boolean if a field has been set. +func (o *PaginatedWirelessLinkList) HasPrevious() bool { + if o != nil && o.Previous.IsSet() { + return true + } + + return false +} + +// SetPrevious gets a reference to the given NullableString and assigns it to the Previous field. +func (o *PaginatedWirelessLinkList) SetPrevious(v string) { + o.Previous.Set(&v) +} + +// SetPreviousNil sets the value for Previous to be an explicit nil +func (o *PaginatedWirelessLinkList) SetPreviousNil() { + o.Previous.Set(nil) +} + +// UnsetPrevious ensures that no value is present for Previous, not even an explicit nil +func (o *PaginatedWirelessLinkList) UnsetPrevious() { + o.Previous.Unset() +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *PaginatedWirelessLinkList) GetResults() []WirelessLink { + if o == nil || IsNil(o.Results) { + var ret []WirelessLink + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedWirelessLinkList) GetResultsOk() ([]WirelessLink, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedWirelessLinkList) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []WirelessLink and assigns it to the Results field. +func (o *PaginatedWirelessLinkList) SetResults(v []WirelessLink) { + o.Results = v +} + +func (o PaginatedWirelessLinkList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedWirelessLinkList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Previous.IsSet() { + toSerialize["previous"] = o.Previous.Get() + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedWirelessLinkList) UnmarshalJSON(data []byte) (err error) { + varPaginatedWirelessLinkList := _PaginatedWirelessLinkList{} + + err = json.Unmarshal(data, &varPaginatedWirelessLinkList) + + if err != nil { + return err + } + + *o = PaginatedWirelessLinkList(varPaginatedWirelessLinkList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedWirelessLinkList struct { + value *PaginatedWirelessLinkList + isSet bool +} + +func (v NullablePaginatedWirelessLinkList) Get() *PaginatedWirelessLinkList { + return v.value +} + +func (v *NullablePaginatedWirelessLinkList) Set(val *PaginatedWirelessLinkList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedWirelessLinkList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedWirelessLinkList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedWirelessLinkList(val *PaginatedWirelessLinkList) *NullablePaginatedWirelessLinkList { + return &NullablePaginatedWirelessLinkList{value: val, isSet: true} +} + +func (v NullablePaginatedWirelessLinkList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedWirelessLinkList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_parent_child_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_parent_child_status.go new file mode 100644 index 00000000..81d87156 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_parent_child_status.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ParentChildStatus Parent devices house child devices in device bays. Leave blank if this device type is neither a parent nor a child. * `parent` - Parent * `child` - Child +type ParentChildStatus string + +// List of Parent_child_status +const ( + PARENTCHILDSTATUS_PARENT ParentChildStatus = "parent" + PARENTCHILDSTATUS_CHILD ParentChildStatus = "child" + PARENTCHILDSTATUS_EMPTY ParentChildStatus = "" +) + +// All allowed values of ParentChildStatus enum +var AllowedParentChildStatusEnumValues = []ParentChildStatus{ + "parent", + "child", + "", +} + +func (v *ParentChildStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ParentChildStatus(value) + for _, existing := range AllowedParentChildStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ParentChildStatus", value) +} + +// NewParentChildStatusFromValue returns a pointer to a valid ParentChildStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewParentChildStatusFromValue(v string) (*ParentChildStatus, error) { + ev := ParentChildStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ParentChildStatus: valid values are %v", v, AllowedParentChildStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ParentChildStatus) IsValid() bool { + for _, existing := range AllowedParentChildStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Parent_child_status value +func (v ParentChildStatus) Ptr() *ParentChildStatus { + return &v +} + +type NullableParentChildStatus struct { + value *ParentChildStatus + isSet bool +} + +func (v NullableParentChildStatus) Get() *ParentChildStatus { + return v.value +} + +func (v *NullableParentChildStatus) Set(val *ParentChildStatus) { + v.value = val + v.isSet = true +} + +func (v NullableParentChildStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableParentChildStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParentChildStatus(val *ParentChildStatus) *NullableParentChildStatus { + return &NullableParentChildStatus{value: val, isSet: true} +} + +func (v NullableParentChildStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParentChildStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cable_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cable_termination_request.go new file mode 100644 index 00000000..9bc077b5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cable_termination_request.go @@ -0,0 +1,264 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedCableTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedCableTerminationRequest{} + +// PatchedCableTerminationRequest Adds support for custom fields and tags. +type PatchedCableTerminationRequest struct { + Cable *int32 `json:"cable,omitempty"` + CableEnd *End `json:"cable_end,omitempty"` + TerminationType *string `json:"termination_type,omitempty"` + TerminationId *int64 `json:"termination_id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedCableTerminationRequest PatchedCableTerminationRequest + +// NewPatchedCableTerminationRequest instantiates a new PatchedCableTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedCableTerminationRequest() *PatchedCableTerminationRequest { + this := PatchedCableTerminationRequest{} + return &this +} + +// NewPatchedCableTerminationRequestWithDefaults instantiates a new PatchedCableTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedCableTerminationRequestWithDefaults() *PatchedCableTerminationRequest { + this := PatchedCableTerminationRequest{} + return &this +} + +// GetCable returns the Cable field value if set, zero value otherwise. +func (o *PatchedCableTerminationRequest) GetCable() int32 { + if o == nil || IsNil(o.Cable) { + var ret int32 + return ret + } + return *o.Cable +} + +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCableTerminationRequest) GetCableOk() (*int32, bool) { + if o == nil || IsNil(o.Cable) { + return nil, false + } + return o.Cable, true +} + +// HasCable returns a boolean if a field has been set. +func (o *PatchedCableTerminationRequest) HasCable() bool { + if o != nil && !IsNil(o.Cable) { + return true + } + + return false +} + +// SetCable gets a reference to the given int32 and assigns it to the Cable field. +func (o *PatchedCableTerminationRequest) SetCable(v int32) { + o.Cable = &v +} + +// GetCableEnd returns the CableEnd field value if set, zero value otherwise. +func (o *PatchedCableTerminationRequest) GetCableEnd() End { + if o == nil || IsNil(o.CableEnd) { + var ret End + return ret + } + return *o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCableTerminationRequest) GetCableEndOk() (*End, bool) { + if o == nil || IsNil(o.CableEnd) { + return nil, false + } + return o.CableEnd, true +} + +// HasCableEnd returns a boolean if a field has been set. +func (o *PatchedCableTerminationRequest) HasCableEnd() bool { + if o != nil && !IsNil(o.CableEnd) { + return true + } + + return false +} + +// SetCableEnd gets a reference to the given End and assigns it to the CableEnd field. +func (o *PatchedCableTerminationRequest) SetCableEnd(v End) { + o.CableEnd = &v +} + +// GetTerminationType returns the TerminationType field value if set, zero value otherwise. +func (o *PatchedCableTerminationRequest) GetTerminationType() string { + if o == nil || IsNil(o.TerminationType) { + var ret string + return ret + } + return *o.TerminationType +} + +// GetTerminationTypeOk returns a tuple with the TerminationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCableTerminationRequest) GetTerminationTypeOk() (*string, bool) { + if o == nil || IsNil(o.TerminationType) { + return nil, false + } + return o.TerminationType, true +} + +// HasTerminationType returns a boolean if a field has been set. +func (o *PatchedCableTerminationRequest) HasTerminationType() bool { + if o != nil && !IsNil(o.TerminationType) { + return true + } + + return false +} + +// SetTerminationType gets a reference to the given string and assigns it to the TerminationType field. +func (o *PatchedCableTerminationRequest) SetTerminationType(v string) { + o.TerminationType = &v +} + +// GetTerminationId returns the TerminationId field value if set, zero value otherwise. +func (o *PatchedCableTerminationRequest) GetTerminationId() int64 { + if o == nil || IsNil(o.TerminationId) { + var ret int64 + return ret + } + return *o.TerminationId +} + +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCableTerminationRequest) GetTerminationIdOk() (*int64, bool) { + if o == nil || IsNil(o.TerminationId) { + return nil, false + } + return o.TerminationId, true +} + +// HasTerminationId returns a boolean if a field has been set. +func (o *PatchedCableTerminationRequest) HasTerminationId() bool { + if o != nil && !IsNil(o.TerminationId) { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given int64 and assigns it to the TerminationId field. +func (o *PatchedCableTerminationRequest) SetTerminationId(v int64) { + o.TerminationId = &v +} + +func (o PatchedCableTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedCableTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Cable) { + toSerialize["cable"] = o.Cable + } + if !IsNil(o.CableEnd) { + toSerialize["cable_end"] = o.CableEnd + } + if !IsNil(o.TerminationType) { + toSerialize["termination_type"] = o.TerminationType + } + if !IsNil(o.TerminationId) { + toSerialize["termination_id"] = o.TerminationId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedCableTerminationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedCableTerminationRequest := _PatchedCableTerminationRequest{} + + err = json.Unmarshal(data, &varPatchedCableTerminationRequest) + + if err != nil { + return err + } + + *o = PatchedCableTerminationRequest(varPatchedCableTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "termination_type") + delete(additionalProperties, "termination_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedCableTerminationRequest struct { + value *PatchedCableTerminationRequest + isSet bool +} + +func (v NullablePatchedCableTerminationRequest) Get() *PatchedCableTerminationRequest { + return v.value +} + +func (v *NullablePatchedCableTerminationRequest) Set(val *PatchedCableTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedCableTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedCableTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedCableTerminationRequest(val *PatchedCableTerminationRequest) *NullablePatchedCableTerminationRequest { + return &NullablePatchedCableTerminationRequest{value: val, isSet: true} +} + +func (v NullablePatchedCableTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedCableTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_circuit_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_circuit_type_request.go new file mode 100644 index 00000000..65c1379b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_circuit_type_request.go @@ -0,0 +1,338 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedCircuitTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedCircuitTypeRequest{} + +// PatchedCircuitTypeRequest Adds support for custom fields and tags. +type PatchedCircuitTypeRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedCircuitTypeRequest PatchedCircuitTypeRequest + +// NewPatchedCircuitTypeRequest instantiates a new PatchedCircuitTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedCircuitTypeRequest() *PatchedCircuitTypeRequest { + this := PatchedCircuitTypeRequest{} + return &this +} + +// NewPatchedCircuitTypeRequestWithDefaults instantiates a new PatchedCircuitTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedCircuitTypeRequestWithDefaults() *PatchedCircuitTypeRequest { + this := PatchedCircuitTypeRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedCircuitTypeRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCircuitTypeRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedCircuitTypeRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedCircuitTypeRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedCircuitTypeRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCircuitTypeRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedCircuitTypeRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedCircuitTypeRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedCircuitTypeRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCircuitTypeRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedCircuitTypeRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedCircuitTypeRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedCircuitTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCircuitTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedCircuitTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedCircuitTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedCircuitTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCircuitTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedCircuitTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedCircuitTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedCircuitTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCircuitTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedCircuitTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedCircuitTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedCircuitTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedCircuitTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedCircuitTypeRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedCircuitTypeRequest := _PatchedCircuitTypeRequest{} + + err = json.Unmarshal(data, &varPatchedCircuitTypeRequest) + + if err != nil { + return err + } + + *o = PatchedCircuitTypeRequest(varPatchedCircuitTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedCircuitTypeRequest struct { + value *PatchedCircuitTypeRequest + isSet bool +} + +func (v NullablePatchedCircuitTypeRequest) Get() *PatchedCircuitTypeRequest { + return v.value +} + +func (v *NullablePatchedCircuitTypeRequest) Set(val *PatchedCircuitTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedCircuitTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedCircuitTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedCircuitTypeRequest(val *PatchedCircuitTypeRequest) *NullablePatchedCircuitTypeRequest { + return &NullablePatchedCircuitTypeRequest{value: val, isSet: true} +} + +func (v NullablePatchedCircuitTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedCircuitTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cluster_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cluster_group_request.go new file mode 100644 index 00000000..ed619728 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cluster_group_request.go @@ -0,0 +1,301 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedClusterGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedClusterGroupRequest{} + +// PatchedClusterGroupRequest Adds support for custom fields and tags. +type PatchedClusterGroupRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedClusterGroupRequest PatchedClusterGroupRequest + +// NewPatchedClusterGroupRequest instantiates a new PatchedClusterGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedClusterGroupRequest() *PatchedClusterGroupRequest { + this := PatchedClusterGroupRequest{} + return &this +} + +// NewPatchedClusterGroupRequestWithDefaults instantiates a new PatchedClusterGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedClusterGroupRequestWithDefaults() *PatchedClusterGroupRequest { + this := PatchedClusterGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedClusterGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedClusterGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedClusterGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedClusterGroupRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterGroupRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedClusterGroupRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedClusterGroupRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedClusterGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedClusterGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedClusterGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedClusterGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedClusterGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedClusterGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedClusterGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedClusterGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedClusterGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedClusterGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedClusterGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedClusterGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedClusterGroupRequest := _PatchedClusterGroupRequest{} + + err = json.Unmarshal(data, &varPatchedClusterGroupRequest) + + if err != nil { + return err + } + + *o = PatchedClusterGroupRequest(varPatchedClusterGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedClusterGroupRequest struct { + value *PatchedClusterGroupRequest + isSet bool +} + +func (v NullablePatchedClusterGroupRequest) Get() *PatchedClusterGroupRequest { + return v.value +} + +func (v *NullablePatchedClusterGroupRequest) Set(val *PatchedClusterGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedClusterGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedClusterGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedClusterGroupRequest(val *PatchedClusterGroupRequest) *NullablePatchedClusterGroupRequest { + return &NullablePatchedClusterGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedClusterGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedClusterGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cluster_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cluster_type_request.go new file mode 100644 index 00000000..107d7c13 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_cluster_type_request.go @@ -0,0 +1,301 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedClusterTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedClusterTypeRequest{} + +// PatchedClusterTypeRequest Adds support for custom fields and tags. +type PatchedClusterTypeRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedClusterTypeRequest PatchedClusterTypeRequest + +// NewPatchedClusterTypeRequest instantiates a new PatchedClusterTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedClusterTypeRequest() *PatchedClusterTypeRequest { + this := PatchedClusterTypeRequest{} + return &this +} + +// NewPatchedClusterTypeRequestWithDefaults instantiates a new PatchedClusterTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedClusterTypeRequestWithDefaults() *PatchedClusterTypeRequest { + this := PatchedClusterTypeRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedClusterTypeRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterTypeRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedClusterTypeRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedClusterTypeRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedClusterTypeRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterTypeRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedClusterTypeRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedClusterTypeRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedClusterTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedClusterTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedClusterTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedClusterTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedClusterTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedClusterTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedClusterTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedClusterTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedClusterTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedClusterTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedClusterTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedClusterTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedClusterTypeRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedClusterTypeRequest := _PatchedClusterTypeRequest{} + + err = json.Unmarshal(data, &varPatchedClusterTypeRequest) + + if err != nil { + return err + } + + *o = PatchedClusterTypeRequest(varPatchedClusterTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedClusterTypeRequest struct { + value *PatchedClusterTypeRequest + isSet bool +} + +func (v NullablePatchedClusterTypeRequest) Get() *PatchedClusterTypeRequest { + return v.value +} + +func (v *NullablePatchedClusterTypeRequest) Set(val *PatchedClusterTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedClusterTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedClusterTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedClusterTypeRequest(val *PatchedClusterTypeRequest) *NullablePatchedClusterTypeRequest { + return &NullablePatchedClusterTypeRequest{value: val, isSet: true} +} + +func (v NullablePatchedClusterTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedClusterTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_contact_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_contact_role_request.go new file mode 100644 index 00000000..6e56cc14 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_contact_role_request.go @@ -0,0 +1,301 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedContactRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedContactRoleRequest{} + +// PatchedContactRoleRequest Adds support for custom fields and tags. +type PatchedContactRoleRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedContactRoleRequest PatchedContactRoleRequest + +// NewPatchedContactRoleRequest instantiates a new PatchedContactRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedContactRoleRequest() *PatchedContactRoleRequest { + this := PatchedContactRoleRequest{} + return &this +} + +// NewPatchedContactRoleRequestWithDefaults instantiates a new PatchedContactRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedContactRoleRequestWithDefaults() *PatchedContactRoleRequest { + this := PatchedContactRoleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedContactRoleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedContactRoleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedContactRoleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedContactRoleRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedContactRoleRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedContactRoleRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedContactRoleRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedContactRoleRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedContactRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedContactRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedContactRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedContactRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedContactRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedContactRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedContactRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedContactRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedContactRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedContactRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedContactRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedContactRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedContactRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedContactRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedContactRoleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedContactRoleRequest := _PatchedContactRoleRequest{} + + err = json.Unmarshal(data, &varPatchedContactRoleRequest) + + if err != nil { + return err + } + + *o = PatchedContactRoleRequest(varPatchedContactRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedContactRoleRequest struct { + value *PatchedContactRoleRequest + isSet bool +} + +func (v NullablePatchedContactRoleRequest) Get() *PatchedContactRoleRequest { + return v.value +} + +func (v *NullablePatchedContactRoleRequest) Set(val *PatchedContactRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedContactRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedContactRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedContactRoleRequest(val *PatchedContactRoleRequest) *NullablePatchedContactRoleRequest { + return &NullablePatchedContactRoleRequest{value: val, isSet: true} +} + +func (v NullablePatchedContactRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedContactRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_custom_link_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_custom_link_request.go new file mode 100644 index 00000000..b2a7215e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_custom_link_request.go @@ -0,0 +1,453 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedCustomLinkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedCustomLinkRequest{} + +// PatchedCustomLinkRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedCustomLinkRequest struct { + ContentTypes []string `json:"content_types,omitempty"` + Name *string `json:"name,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + // Jinja2 template code for link text + LinkText *string `json:"link_text,omitempty"` + // Jinja2 template code for link URL + LinkUrl *string `json:"link_url,omitempty"` + Weight *int32 `json:"weight,omitempty"` + // Links with the same group will appear as a dropdown menu + GroupName *string `json:"group_name,omitempty"` + ButtonClass *CustomLinkButtonClass `json:"button_class,omitempty"` + // Force link to open in a new window + NewWindow *bool `json:"new_window,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedCustomLinkRequest PatchedCustomLinkRequest + +// NewPatchedCustomLinkRequest instantiates a new PatchedCustomLinkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedCustomLinkRequest() *PatchedCustomLinkRequest { + this := PatchedCustomLinkRequest{} + return &this +} + +// NewPatchedCustomLinkRequestWithDefaults instantiates a new PatchedCustomLinkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedCustomLinkRequestWithDefaults() *PatchedCustomLinkRequest { + this := PatchedCustomLinkRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetContentTypes() []string { + if o == nil || IsNil(o.ContentTypes) { + var ret []string + return ret + } + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ContentTypes) { + return nil, false + } + return o.ContentTypes, true +} + +// HasContentTypes returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasContentTypes() bool { + if o != nil && !IsNil(o.ContentTypes) { + return true + } + + return false +} + +// SetContentTypes gets a reference to the given []string and assigns it to the ContentTypes field. +func (o *PatchedCustomLinkRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedCustomLinkRequest) SetName(v string) { + o.Name = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedCustomLinkRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetLinkText returns the LinkText field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetLinkText() string { + if o == nil || IsNil(o.LinkText) { + var ret string + return ret + } + return *o.LinkText +} + +// GetLinkTextOk returns a tuple with the LinkText field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetLinkTextOk() (*string, bool) { + if o == nil || IsNil(o.LinkText) { + return nil, false + } + return o.LinkText, true +} + +// HasLinkText returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasLinkText() bool { + if o != nil && !IsNil(o.LinkText) { + return true + } + + return false +} + +// SetLinkText gets a reference to the given string and assigns it to the LinkText field. +func (o *PatchedCustomLinkRequest) SetLinkText(v string) { + o.LinkText = &v +} + +// GetLinkUrl returns the LinkUrl field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetLinkUrl() string { + if o == nil || IsNil(o.LinkUrl) { + var ret string + return ret + } + return *o.LinkUrl +} + +// GetLinkUrlOk returns a tuple with the LinkUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetLinkUrlOk() (*string, bool) { + if o == nil || IsNil(o.LinkUrl) { + return nil, false + } + return o.LinkUrl, true +} + +// HasLinkUrl returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasLinkUrl() bool { + if o != nil && !IsNil(o.LinkUrl) { + return true + } + + return false +} + +// SetLinkUrl gets a reference to the given string and assigns it to the LinkUrl field. +func (o *PatchedCustomLinkRequest) SetLinkUrl(v string) { + o.LinkUrl = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *PatchedCustomLinkRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *PatchedCustomLinkRequest) SetGroupName(v string) { + o.GroupName = &v +} + +// GetButtonClass returns the ButtonClass field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetButtonClass() CustomLinkButtonClass { + if o == nil || IsNil(o.ButtonClass) { + var ret CustomLinkButtonClass + return ret + } + return *o.ButtonClass +} + +// GetButtonClassOk returns a tuple with the ButtonClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetButtonClassOk() (*CustomLinkButtonClass, bool) { + if o == nil || IsNil(o.ButtonClass) { + return nil, false + } + return o.ButtonClass, true +} + +// HasButtonClass returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasButtonClass() bool { + if o != nil && !IsNil(o.ButtonClass) { + return true + } + + return false +} + +// SetButtonClass gets a reference to the given CustomLinkButtonClass and assigns it to the ButtonClass field. +func (o *PatchedCustomLinkRequest) SetButtonClass(v CustomLinkButtonClass) { + o.ButtonClass = &v +} + +// GetNewWindow returns the NewWindow field value if set, zero value otherwise. +func (o *PatchedCustomLinkRequest) GetNewWindow() bool { + if o == nil || IsNil(o.NewWindow) { + var ret bool + return ret + } + return *o.NewWindow +} + +// GetNewWindowOk returns a tuple with the NewWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCustomLinkRequest) GetNewWindowOk() (*bool, bool) { + if o == nil || IsNil(o.NewWindow) { + return nil, false + } + return o.NewWindow, true +} + +// HasNewWindow returns a boolean if a field has been set. +func (o *PatchedCustomLinkRequest) HasNewWindow() bool { + if o != nil && !IsNil(o.NewWindow) { + return true + } + + return false +} + +// SetNewWindow gets a reference to the given bool and assigns it to the NewWindow field. +func (o *PatchedCustomLinkRequest) SetNewWindow(v bool) { + o.NewWindow = &v +} + +func (o PatchedCustomLinkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedCustomLinkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContentTypes) { + toSerialize["content_types"] = o.ContentTypes + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.LinkText) { + toSerialize["link_text"] = o.LinkText + } + if !IsNil(o.LinkUrl) { + toSerialize["link_url"] = o.LinkUrl + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.GroupName) { + toSerialize["group_name"] = o.GroupName + } + if !IsNil(o.ButtonClass) { + toSerialize["button_class"] = o.ButtonClass + } + if !IsNil(o.NewWindow) { + toSerialize["new_window"] = o.NewWindow + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedCustomLinkRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedCustomLinkRequest := _PatchedCustomLinkRequest{} + + err = json.Unmarshal(data, &varPatchedCustomLinkRequest) + + if err != nil { + return err + } + + *o = PatchedCustomLinkRequest(varPatchedCustomLinkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "link_text") + delete(additionalProperties, "link_url") + delete(additionalProperties, "weight") + delete(additionalProperties, "group_name") + delete(additionalProperties, "button_class") + delete(additionalProperties, "new_window") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedCustomLinkRequest struct { + value *PatchedCustomLinkRequest + isSet bool +} + +func (v NullablePatchedCustomLinkRequest) Get() *PatchedCustomLinkRequest { + return v.value +} + +func (v *NullablePatchedCustomLinkRequest) Set(val *PatchedCustomLinkRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedCustomLinkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedCustomLinkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedCustomLinkRequest(val *PatchedCustomLinkRequest) *NullablePatchedCustomLinkRequest { + return &NullablePatchedCustomLinkRequest{value: val, isSet: true} +} + +func (v NullablePatchedCustomLinkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedCustomLinkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_dashboard_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_dashboard_request.go new file mode 100644 index 00000000..09fb6adc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_dashboard_request.go @@ -0,0 +1,192 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedDashboardRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDashboardRequest{} + +// PatchedDashboardRequest struct for PatchedDashboardRequest +type PatchedDashboardRequest struct { + Layout interface{} `json:"layout,omitempty"` + Config interface{} `json:"config,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDashboardRequest PatchedDashboardRequest + +// NewPatchedDashboardRequest instantiates a new PatchedDashboardRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDashboardRequest() *PatchedDashboardRequest { + this := PatchedDashboardRequest{} + return &this +} + +// NewPatchedDashboardRequestWithDefaults instantiates a new PatchedDashboardRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDashboardRequestWithDefaults() *PatchedDashboardRequest { + this := PatchedDashboardRequest{} + return &this +} + +// GetLayout returns the Layout field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedDashboardRequest) GetLayout() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedDashboardRequest) GetLayoutOk() (*interface{}, bool) { + if o == nil || IsNil(o.Layout) { + return nil, false + } + return &o.Layout, true +} + +// HasLayout returns a boolean if a field has been set. +func (o *PatchedDashboardRequest) HasLayout() bool { + if o != nil && IsNil(o.Layout) { + return true + } + + return false +} + +// SetLayout gets a reference to the given interface{} and assigns it to the Layout field. +func (o *PatchedDashboardRequest) SetLayout(v interface{}) { + o.Layout = v +} + +// GetConfig returns the Config field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedDashboardRequest) GetConfig() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedDashboardRequest) GetConfigOk() (*interface{}, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return &o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *PatchedDashboardRequest) HasConfig() bool { + if o != nil && IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given interface{} and assigns it to the Config field. +func (o *PatchedDashboardRequest) SetConfig(v interface{}) { + o.Config = v +} + +func (o PatchedDashboardRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDashboardRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Layout != nil { + toSerialize["layout"] = o.Layout + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDashboardRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDashboardRequest := _PatchedDashboardRequest{} + + err = json.Unmarshal(data, &varPatchedDashboardRequest) + + if err != nil { + return err + } + + *o = PatchedDashboardRequest(varPatchedDashboardRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "layout") + delete(additionalProperties, "config") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDashboardRequest struct { + value *PatchedDashboardRequest + isSet bool +} + +func (v NullablePatchedDashboardRequest) Get() *PatchedDashboardRequest { + return v.value +} + +func (v *NullablePatchedDashboardRequest) Set(val *PatchedDashboardRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDashboardRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDashboardRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDashboardRequest(val *PatchedDashboardRequest) *NullablePatchedDashboardRequest { + return &NullablePatchedDashboardRequest{value: val, isSet: true} +} + +func (v NullablePatchedDashboardRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDashboardRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_fhrp_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_fhrp_group_request.go new file mode 100644 index 00000000..9bedc8c7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_fhrp_group_request.go @@ -0,0 +1,449 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedFHRPGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedFHRPGroupRequest{} + +// PatchedFHRPGroupRequest Adds support for custom fields and tags. +type PatchedFHRPGroupRequest struct { + Name *string `json:"name,omitempty"` + Protocol *FHRPGroupProtocol `json:"protocol,omitempty"` + GroupId *int32 `json:"group_id,omitempty"` + AuthType *AuthenticationType `json:"auth_type,omitempty"` + AuthKey *string `json:"auth_key,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedFHRPGroupRequest PatchedFHRPGroupRequest + +// NewPatchedFHRPGroupRequest instantiates a new PatchedFHRPGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedFHRPGroupRequest() *PatchedFHRPGroupRequest { + this := PatchedFHRPGroupRequest{} + return &this +} + +// NewPatchedFHRPGroupRequestWithDefaults instantiates a new PatchedFHRPGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedFHRPGroupRequestWithDefaults() *PatchedFHRPGroupRequest { + this := PatchedFHRPGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedFHRPGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetProtocol() FHRPGroupProtocol { + if o == nil || IsNil(o.Protocol) { + var ret FHRPGroupProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetProtocolOk() (*FHRPGroupProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given FHRPGroupProtocol and assigns it to the Protocol field. +func (o *PatchedFHRPGroupRequest) SetProtocol(v FHRPGroupProtocol) { + o.Protocol = &v +} + +// GetGroupId returns the GroupId field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetGroupId() int32 { + if o == nil || IsNil(o.GroupId) { + var ret int32 + return ret + } + return *o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetGroupIdOk() (*int32, bool) { + if o == nil || IsNil(o.GroupId) { + return nil, false + } + return o.GroupId, true +} + +// HasGroupId returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasGroupId() bool { + if o != nil && !IsNil(o.GroupId) { + return true + } + + return false +} + +// SetGroupId gets a reference to the given int32 and assigns it to the GroupId field. +func (o *PatchedFHRPGroupRequest) SetGroupId(v int32) { + o.GroupId = &v +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetAuthType() AuthenticationType { + if o == nil || IsNil(o.AuthType) { + var ret AuthenticationType + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetAuthTypeOk() (*AuthenticationType, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthenticationType and assigns it to the AuthType field. +func (o *PatchedFHRPGroupRequest) SetAuthType(v AuthenticationType) { + o.AuthType = &v +} + +// GetAuthKey returns the AuthKey field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetAuthKey() string { + if o == nil || IsNil(o.AuthKey) { + var ret string + return ret + } + return *o.AuthKey +} + +// GetAuthKeyOk returns a tuple with the AuthKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetAuthKeyOk() (*string, bool) { + if o == nil || IsNil(o.AuthKey) { + return nil, false + } + return o.AuthKey, true +} + +// HasAuthKey returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasAuthKey() bool { + if o != nil && !IsNil(o.AuthKey) { + return true + } + + return false +} + +// SetAuthKey gets a reference to the given string and assigns it to the AuthKey field. +func (o *PatchedFHRPGroupRequest) SetAuthKey(v string) { + o.AuthKey = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedFHRPGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedFHRPGroupRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedFHRPGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedFHRPGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFHRPGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedFHRPGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedFHRPGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedFHRPGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedFHRPGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.GroupId) { + toSerialize["group_id"] = o.GroupId + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthKey) { + toSerialize["auth_key"] = o.AuthKey + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedFHRPGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedFHRPGroupRequest := _PatchedFHRPGroupRequest{} + + err = json.Unmarshal(data, &varPatchedFHRPGroupRequest) + + if err != nil { + return err + } + + *o = PatchedFHRPGroupRequest(varPatchedFHRPGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "protocol") + delete(additionalProperties, "group_id") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_key") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedFHRPGroupRequest struct { + value *PatchedFHRPGroupRequest + isSet bool +} + +func (v NullablePatchedFHRPGroupRequest) Get() *PatchedFHRPGroupRequest { + return v.value +} + +func (v *NullablePatchedFHRPGroupRequest) Set(val *PatchedFHRPGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedFHRPGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedFHRPGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedFHRPGroupRequest(val *PatchedFHRPGroupRequest) *NullablePatchedFHRPGroupRequest { + return &NullablePatchedFHRPGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedFHRPGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedFHRPGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_group_request.go new file mode 100644 index 00000000..95afade5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_group_request.go @@ -0,0 +1,153 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupRequest{} + +// PatchedGroupRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedGroupRequest struct { + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupRequest PatchedGroupRequest + +// NewPatchedGroupRequest instantiates a new PatchedGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupRequest() *PatchedGroupRequest { + this := PatchedGroupRequest{} + return &this +} + +// NewPatchedGroupRequestWithDefaults instantiates a new PatchedGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupRequestWithDefaults() *PatchedGroupRequest { + this := PatchedGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedGroupRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupRequest := _PatchedGroupRequest{} + + err = json.Unmarshal(data, &varPatchedGroupRequest) + + if err != nil { + return err + } + + *o = PatchedGroupRequest(varPatchedGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupRequest struct { + value *PatchedGroupRequest + isSet bool +} + +func (v NullablePatchedGroupRequest) Get() *PatchedGroupRequest { + return v.value +} + +func (v *NullablePatchedGroupRequest) Set(val *PatchedGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupRequest(val *PatchedGroupRequest) *NullablePatchedGroupRequest { + return &NullablePatchedGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_image_attachment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_image_attachment_request.go new file mode 100644 index 00000000..10c4ed2e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_image_attachment_request.go @@ -0,0 +1,339 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "os" +) + +// checks if the PatchedImageAttachmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedImageAttachmentRequest{} + +// PatchedImageAttachmentRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedImageAttachmentRequest struct { + ContentType *string `json:"content_type,omitempty"` + ObjectId *int64 `json:"object_id,omitempty"` + Name *string `json:"name,omitempty"` + Image **os.File `json:"image,omitempty"` + ImageHeight *int32 `json:"image_height,omitempty"` + ImageWidth *int32 `json:"image_width,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedImageAttachmentRequest PatchedImageAttachmentRequest + +// NewPatchedImageAttachmentRequest instantiates a new PatchedImageAttachmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedImageAttachmentRequest() *PatchedImageAttachmentRequest { + this := PatchedImageAttachmentRequest{} + return &this +} + +// NewPatchedImageAttachmentRequestWithDefaults instantiates a new PatchedImageAttachmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedImageAttachmentRequestWithDefaults() *PatchedImageAttachmentRequest { + this := PatchedImageAttachmentRequest{} + return &this +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *PatchedImageAttachmentRequest) GetContentType() string { + if o == nil || IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedImageAttachmentRequest) GetContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *PatchedImageAttachmentRequest) HasContentType() bool { + if o != nil && !IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *PatchedImageAttachmentRequest) SetContentType(v string) { + o.ContentType = &v +} + +// GetObjectId returns the ObjectId field value if set, zero value otherwise. +func (o *PatchedImageAttachmentRequest) GetObjectId() int64 { + if o == nil || IsNil(o.ObjectId) { + var ret int64 + return ret + } + return *o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedImageAttachmentRequest) GetObjectIdOk() (*int64, bool) { + if o == nil || IsNil(o.ObjectId) { + return nil, false + } + return o.ObjectId, true +} + +// HasObjectId returns a boolean if a field has been set. +func (o *PatchedImageAttachmentRequest) HasObjectId() bool { + if o != nil && !IsNil(o.ObjectId) { + return true + } + + return false +} + +// SetObjectId gets a reference to the given int64 and assigns it to the ObjectId field. +func (o *PatchedImageAttachmentRequest) SetObjectId(v int64) { + o.ObjectId = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedImageAttachmentRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedImageAttachmentRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedImageAttachmentRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedImageAttachmentRequest) SetName(v string) { + o.Name = &v +} + +// GetImage returns the Image field value if set, zero value otherwise. +func (o *PatchedImageAttachmentRequest) GetImage() *os.File { + if o == nil || IsNil(o.Image) { + var ret *os.File + return ret + } + return *o.Image +} + +// GetImageOk returns a tuple with the Image field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedImageAttachmentRequest) GetImageOk() (**os.File, bool) { + if o == nil || IsNil(o.Image) { + return nil, false + } + return o.Image, true +} + +// HasImage returns a boolean if a field has been set. +func (o *PatchedImageAttachmentRequest) HasImage() bool { + if o != nil && !IsNil(o.Image) { + return true + } + + return false +} + +// SetImage gets a reference to the given *os.File and assigns it to the Image field. +func (o *PatchedImageAttachmentRequest) SetImage(v *os.File) { + o.Image = &v +} + +// GetImageHeight returns the ImageHeight field value if set, zero value otherwise. +func (o *PatchedImageAttachmentRequest) GetImageHeight() int32 { + if o == nil || IsNil(o.ImageHeight) { + var ret int32 + return ret + } + return *o.ImageHeight +} + +// GetImageHeightOk returns a tuple with the ImageHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedImageAttachmentRequest) GetImageHeightOk() (*int32, bool) { + if o == nil || IsNil(o.ImageHeight) { + return nil, false + } + return o.ImageHeight, true +} + +// HasImageHeight returns a boolean if a field has been set. +func (o *PatchedImageAttachmentRequest) HasImageHeight() bool { + if o != nil && !IsNil(o.ImageHeight) { + return true + } + + return false +} + +// SetImageHeight gets a reference to the given int32 and assigns it to the ImageHeight field. +func (o *PatchedImageAttachmentRequest) SetImageHeight(v int32) { + o.ImageHeight = &v +} + +// GetImageWidth returns the ImageWidth field value if set, zero value otherwise. +func (o *PatchedImageAttachmentRequest) GetImageWidth() int32 { + if o == nil || IsNil(o.ImageWidth) { + var ret int32 + return ret + } + return *o.ImageWidth +} + +// GetImageWidthOk returns a tuple with the ImageWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedImageAttachmentRequest) GetImageWidthOk() (*int32, bool) { + if o == nil || IsNil(o.ImageWidth) { + return nil, false + } + return o.ImageWidth, true +} + +// HasImageWidth returns a boolean if a field has been set. +func (o *PatchedImageAttachmentRequest) HasImageWidth() bool { + if o != nil && !IsNil(o.ImageWidth) { + return true + } + + return false +} + +// SetImageWidth gets a reference to the given int32 and assigns it to the ImageWidth field. +func (o *PatchedImageAttachmentRequest) SetImageWidth(v int32) { + o.ImageWidth = &v +} + +func (o PatchedImageAttachmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedImageAttachmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContentType) { + toSerialize["content_type"] = o.ContentType + } + if !IsNil(o.ObjectId) { + toSerialize["object_id"] = o.ObjectId + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Image) { + toSerialize["image"] = o.Image + } + if !IsNil(o.ImageHeight) { + toSerialize["image_height"] = o.ImageHeight + } + if !IsNil(o.ImageWidth) { + toSerialize["image_width"] = o.ImageWidth + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedImageAttachmentRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedImageAttachmentRequest := _PatchedImageAttachmentRequest{} + + err = json.Unmarshal(data, &varPatchedImageAttachmentRequest) + + if err != nil { + return err + } + + *o = PatchedImageAttachmentRequest(varPatchedImageAttachmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "name") + delete(additionalProperties, "image") + delete(additionalProperties, "image_height") + delete(additionalProperties, "image_width") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedImageAttachmentRequest struct { + value *PatchedImageAttachmentRequest + isSet bool +} + +func (v NullablePatchedImageAttachmentRequest) Get() *PatchedImageAttachmentRequest { + return v.value +} + +func (v *NullablePatchedImageAttachmentRequest) Set(val *PatchedImageAttachmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedImageAttachmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedImageAttachmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedImageAttachmentRequest(val *PatchedImageAttachmentRequest) *NullablePatchedImageAttachmentRequest { + return &NullablePatchedImageAttachmentRequest{value: val, isSet: true} +} + +func (v NullablePatchedImageAttachmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedImageAttachmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_inventory_item_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_inventory_item_role_request.go new file mode 100644 index 00000000..2f05e671 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_inventory_item_role_request.go @@ -0,0 +1,338 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedInventoryItemRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedInventoryItemRoleRequest{} + +// PatchedInventoryItemRoleRequest Adds support for custom fields and tags. +type PatchedInventoryItemRoleRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedInventoryItemRoleRequest PatchedInventoryItemRoleRequest + +// NewPatchedInventoryItemRoleRequest instantiates a new PatchedInventoryItemRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedInventoryItemRoleRequest() *PatchedInventoryItemRoleRequest { + this := PatchedInventoryItemRoleRequest{} + return &this +} + +// NewPatchedInventoryItemRoleRequestWithDefaults instantiates a new PatchedInventoryItemRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedInventoryItemRoleRequestWithDefaults() *PatchedInventoryItemRoleRequest { + this := PatchedInventoryItemRoleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedInventoryItemRoleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInventoryItemRoleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedInventoryItemRoleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedInventoryItemRoleRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedInventoryItemRoleRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInventoryItemRoleRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedInventoryItemRoleRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedInventoryItemRoleRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedInventoryItemRoleRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInventoryItemRoleRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedInventoryItemRoleRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedInventoryItemRoleRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedInventoryItemRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInventoryItemRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedInventoryItemRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedInventoryItemRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedInventoryItemRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInventoryItemRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedInventoryItemRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedInventoryItemRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedInventoryItemRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInventoryItemRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedInventoryItemRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedInventoryItemRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedInventoryItemRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedInventoryItemRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedInventoryItemRoleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedInventoryItemRoleRequest := _PatchedInventoryItemRoleRequest{} + + err = json.Unmarshal(data, &varPatchedInventoryItemRoleRequest) + + if err != nil { + return err + } + + *o = PatchedInventoryItemRoleRequest(varPatchedInventoryItemRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedInventoryItemRoleRequest struct { + value *PatchedInventoryItemRoleRequest + isSet bool +} + +func (v NullablePatchedInventoryItemRoleRequest) Get() *PatchedInventoryItemRoleRequest { + return v.value +} + +func (v *NullablePatchedInventoryItemRoleRequest) Set(val *PatchedInventoryItemRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedInventoryItemRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedInventoryItemRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedInventoryItemRoleRequest(val *PatchedInventoryItemRoleRequest) *NullablePatchedInventoryItemRoleRequest { + return &NullablePatchedInventoryItemRoleRequest{value: val, isSet: true} +} + +func (v NullablePatchedInventoryItemRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedInventoryItemRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_manufacturer_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_manufacturer_request.go new file mode 100644 index 00000000..eca6fff6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_manufacturer_request.go @@ -0,0 +1,301 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedManufacturerRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedManufacturerRequest{} + +// PatchedManufacturerRequest Adds support for custom fields and tags. +type PatchedManufacturerRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedManufacturerRequest PatchedManufacturerRequest + +// NewPatchedManufacturerRequest instantiates a new PatchedManufacturerRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedManufacturerRequest() *PatchedManufacturerRequest { + this := PatchedManufacturerRequest{} + return &this +} + +// NewPatchedManufacturerRequestWithDefaults instantiates a new PatchedManufacturerRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedManufacturerRequestWithDefaults() *PatchedManufacturerRequest { + this := PatchedManufacturerRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedManufacturerRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedManufacturerRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedManufacturerRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedManufacturerRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedManufacturerRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedManufacturerRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedManufacturerRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedManufacturerRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedManufacturerRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedManufacturerRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedManufacturerRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedManufacturerRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedManufacturerRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedManufacturerRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedManufacturerRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedManufacturerRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedManufacturerRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedManufacturerRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedManufacturerRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedManufacturerRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedManufacturerRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedManufacturerRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedManufacturerRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedManufacturerRequest := _PatchedManufacturerRequest{} + + err = json.Unmarshal(data, &varPatchedManufacturerRequest) + + if err != nil { + return err + } + + *o = PatchedManufacturerRequest(varPatchedManufacturerRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedManufacturerRequest struct { + value *PatchedManufacturerRequest + isSet bool +} + +func (v NullablePatchedManufacturerRequest) Get() *PatchedManufacturerRequest { + return v.value +} + +func (v *NullablePatchedManufacturerRequest) Set(val *PatchedManufacturerRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedManufacturerRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedManufacturerRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedManufacturerRequest(val *PatchedManufacturerRequest) *NullablePatchedManufacturerRequest { + return &NullablePatchedManufacturerRequest{value: val, isSet: true} +} + +func (v NullablePatchedManufacturerRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedManufacturerRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_rack_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_rack_role_request.go new file mode 100644 index 00000000..3d3e45c2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_rack_role_request.go @@ -0,0 +1,338 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedRackRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRackRoleRequest{} + +// PatchedRackRoleRequest Adds support for custom fields and tags. +type PatchedRackRoleRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRackRoleRequest PatchedRackRoleRequest + +// NewPatchedRackRoleRequest instantiates a new PatchedRackRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRackRoleRequest() *PatchedRackRoleRequest { + this := PatchedRackRoleRequest{} + return &this +} + +// NewPatchedRackRoleRequestWithDefaults instantiates a new PatchedRackRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRackRoleRequestWithDefaults() *PatchedRackRoleRequest { + this := PatchedRackRoleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRackRoleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRackRoleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRackRoleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRackRoleRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedRackRoleRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRackRoleRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedRackRoleRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedRackRoleRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedRackRoleRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRackRoleRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedRackRoleRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedRackRoleRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedRackRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRackRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedRackRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedRackRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedRackRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRackRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedRackRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedRackRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedRackRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRackRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedRackRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedRackRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedRackRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRackRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRackRoleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRackRoleRequest := _PatchedRackRoleRequest{} + + err = json.Unmarshal(data, &varPatchedRackRoleRequest) + + if err != nil { + return err + } + + *o = PatchedRackRoleRequest(varPatchedRackRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRackRoleRequest struct { + value *PatchedRackRoleRequest + isSet bool +} + +func (v NullablePatchedRackRoleRequest) Get() *PatchedRackRoleRequest { + return v.value +} + +func (v *NullablePatchedRackRoleRequest) Set(val *PatchedRackRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRackRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRackRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRackRoleRequest(val *PatchedRackRoleRequest) *NullablePatchedRackRoleRequest { + return &NullablePatchedRackRoleRequest{value: val, isSet: true} +} + +func (v NullablePatchedRackRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRackRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_rir_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_rir_request.go new file mode 100644 index 00000000..2a65b7f7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_rir_request.go @@ -0,0 +1,339 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedRIRRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRIRRequest{} + +// PatchedRIRRequest Adds support for custom fields and tags. +type PatchedRIRRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + // IP space managed by this RIR is considered private + IsPrivate *bool `json:"is_private,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRIRRequest PatchedRIRRequest + +// NewPatchedRIRRequest instantiates a new PatchedRIRRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRIRRequest() *PatchedRIRRequest { + this := PatchedRIRRequest{} + return &this +} + +// NewPatchedRIRRequestWithDefaults instantiates a new PatchedRIRRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRIRRequestWithDefaults() *PatchedRIRRequest { + this := PatchedRIRRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRIRRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRIRRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRIRRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRIRRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedRIRRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRIRRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedRIRRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedRIRRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetIsPrivate returns the IsPrivate field value if set, zero value otherwise. +func (o *PatchedRIRRequest) GetIsPrivate() bool { + if o == nil || IsNil(o.IsPrivate) { + var ret bool + return ret + } + return *o.IsPrivate +} + +// GetIsPrivateOk returns a tuple with the IsPrivate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRIRRequest) GetIsPrivateOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrivate) { + return nil, false + } + return o.IsPrivate, true +} + +// HasIsPrivate returns a boolean if a field has been set. +func (o *PatchedRIRRequest) HasIsPrivate() bool { + if o != nil && !IsNil(o.IsPrivate) { + return true + } + + return false +} + +// SetIsPrivate gets a reference to the given bool and assigns it to the IsPrivate field. +func (o *PatchedRIRRequest) SetIsPrivate(v bool) { + o.IsPrivate = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedRIRRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRIRRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedRIRRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedRIRRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedRIRRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRIRRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedRIRRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedRIRRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedRIRRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRIRRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedRIRRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedRIRRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedRIRRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRIRRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.IsPrivate) { + toSerialize["is_private"] = o.IsPrivate + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRIRRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRIRRequest := _PatchedRIRRequest{} + + err = json.Unmarshal(data, &varPatchedRIRRequest) + + if err != nil { + return err + } + + *o = PatchedRIRRequest(varPatchedRIRRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "is_private") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRIRRequest struct { + value *PatchedRIRRequest + isSet bool +} + +func (v NullablePatchedRIRRequest) Get() *PatchedRIRRequest { + return v.value +} + +func (v *NullablePatchedRIRRequest) Set(val *PatchedRIRRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRIRRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRIRRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRIRRequest(val *PatchedRIRRequest) *NullablePatchedRIRRequest { + return &NullablePatchedRIRRequest{value: val, isSet: true} +} + +func (v NullablePatchedRIRRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRIRRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_role_request.go new file mode 100644 index 00000000..67ad0688 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_role_request.go @@ -0,0 +1,338 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRoleRequest{} + +// PatchedRoleRequest Adds support for custom fields and tags. +type PatchedRoleRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Weight *int32 `json:"weight,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRoleRequest PatchedRoleRequest + +// NewPatchedRoleRequest instantiates a new PatchedRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRoleRequest() *PatchedRoleRequest { + this := PatchedRoleRequest{} + return &this +} + +// NewPatchedRoleRequestWithDefaults instantiates a new PatchedRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRoleRequestWithDefaults() *PatchedRoleRequest { + this := PatchedRoleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRoleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRoleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRoleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRoleRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedRoleRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRoleRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedRoleRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedRoleRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *PatchedRoleRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRoleRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedRoleRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *PatchedRoleRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRoleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRoleRequest := _PatchedRoleRequest{} + + err = json.Unmarshal(data, &varPatchedRoleRequest) + + if err != nil { + return err + } + + *o = PatchedRoleRequest(varPatchedRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "weight") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRoleRequest struct { + value *PatchedRoleRequest + isSet bool +} + +func (v NullablePatchedRoleRequest) Get() *PatchedRoleRequest { + return v.value +} + +func (v *NullablePatchedRoleRequest) Set(val *PatchedRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRoleRequest(val *PatchedRoleRequest) *NullablePatchedRoleRequest { + return &NullablePatchedRoleRequest{value: val, isSet: true} +} + +func (v NullablePatchedRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_saved_filter_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_saved_filter_request.go new file mode 100644 index 00000000..9e3d168c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_saved_filter_request.go @@ -0,0 +1,461 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedSavedFilterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSavedFilterRequest{} + +// PatchedSavedFilterRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedSavedFilterRequest struct { + ContentTypes []string `json:"content_types,omitempty"` + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Description *string `json:"description,omitempty"` + User NullableInt32 `json:"user,omitempty"` + Weight *int32 `json:"weight,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Shared *bool `json:"shared,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSavedFilterRequest PatchedSavedFilterRequest + +// NewPatchedSavedFilterRequest instantiates a new PatchedSavedFilterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSavedFilterRequest() *PatchedSavedFilterRequest { + this := PatchedSavedFilterRequest{} + return &this +} + +// NewPatchedSavedFilterRequestWithDefaults instantiates a new PatchedSavedFilterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSavedFilterRequestWithDefaults() *PatchedSavedFilterRequest { + this := PatchedSavedFilterRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value if set, zero value otherwise. +func (o *PatchedSavedFilterRequest) GetContentTypes() []string { + if o == nil || IsNil(o.ContentTypes) { + var ret []string + return ret + } + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSavedFilterRequest) GetContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ContentTypes) { + return nil, false + } + return o.ContentTypes, true +} + +// HasContentTypes returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasContentTypes() bool { + if o != nil && !IsNil(o.ContentTypes) { + return true + } + + return false +} + +// SetContentTypes gets a reference to the given []string and assigns it to the ContentTypes field. +func (o *PatchedSavedFilterRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSavedFilterRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSavedFilterRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSavedFilterRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedSavedFilterRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSavedFilterRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedSavedFilterRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedSavedFilterRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSavedFilterRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedSavedFilterRequest) SetDescription(v string) { + o.Description = &v +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSavedFilterRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSavedFilterRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *PatchedSavedFilterRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *PatchedSavedFilterRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *PatchedSavedFilterRequest) UnsetUser() { + o.User.Unset() +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *PatchedSavedFilterRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSavedFilterRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *PatchedSavedFilterRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedSavedFilterRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSavedFilterRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedSavedFilterRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetShared returns the Shared field value if set, zero value otherwise. +func (o *PatchedSavedFilterRequest) GetShared() bool { + if o == nil || IsNil(o.Shared) { + var ret bool + return ret + } + return *o.Shared +} + +// GetSharedOk returns a tuple with the Shared field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSavedFilterRequest) GetSharedOk() (*bool, bool) { + if o == nil || IsNil(o.Shared) { + return nil, false + } + return o.Shared, true +} + +// HasShared returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasShared() bool { + if o != nil && !IsNil(o.Shared) { + return true + } + + return false +} + +// SetShared gets a reference to the given bool and assigns it to the Shared field. +func (o *PatchedSavedFilterRequest) SetShared(v bool) { + o.Shared = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSavedFilterRequest) GetParameters() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSavedFilterRequest) GetParametersOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PatchedSavedFilterRequest) HasParameters() bool { + if o != nil && IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given interface{} and assigns it to the Parameters field. +func (o *PatchedSavedFilterRequest) SetParameters(v interface{}) { + o.Parameters = v +} + +func (o PatchedSavedFilterRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSavedFilterRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContentTypes) { + toSerialize["content_types"] = o.ContentTypes + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Shared) { + toSerialize["shared"] = o.Shared + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSavedFilterRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSavedFilterRequest := _PatchedSavedFilterRequest{} + + err = json.Unmarshal(data, &varPatchedSavedFilterRequest) + + if err != nil { + return err + } + + *o = PatchedSavedFilterRequest(varPatchedSavedFilterRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "user") + delete(additionalProperties, "weight") + delete(additionalProperties, "enabled") + delete(additionalProperties, "shared") + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSavedFilterRequest struct { + value *PatchedSavedFilterRequest + isSet bool +} + +func (v NullablePatchedSavedFilterRequest) Get() *PatchedSavedFilterRequest { + return v.value +} + +func (v *NullablePatchedSavedFilterRequest) Set(val *PatchedSavedFilterRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSavedFilterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSavedFilterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSavedFilterRequest(val *PatchedSavedFilterRequest) *NullablePatchedSavedFilterRequest { + return &NullablePatchedSavedFilterRequest{value: val, isSet: true} +} + +func (v NullablePatchedSavedFilterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSavedFilterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_tag_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_tag_request.go new file mode 100644 index 00000000..d352919b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_tag_request.go @@ -0,0 +1,301 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedTagRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedTagRequest{} + +// PatchedTagRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedTagRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + ObjectTypes []string `json:"object_types,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedTagRequest PatchedTagRequest + +// NewPatchedTagRequest instantiates a new PatchedTagRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedTagRequest() *PatchedTagRequest { + this := PatchedTagRequest{} + return &this +} + +// NewPatchedTagRequestWithDefaults instantiates a new PatchedTagRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedTagRequestWithDefaults() *PatchedTagRequest { + this := PatchedTagRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedTagRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTagRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedTagRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedTagRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedTagRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTagRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedTagRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedTagRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedTagRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTagRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedTagRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedTagRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedTagRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTagRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedTagRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedTagRequest) SetDescription(v string) { + o.Description = &v +} + +// GetObjectTypes returns the ObjectTypes field value if set, zero value otherwise. +func (o *PatchedTagRequest) GetObjectTypes() []string { + if o == nil || IsNil(o.ObjectTypes) { + var ret []string + return ret + } + return o.ObjectTypes +} + +// GetObjectTypesOk returns a tuple with the ObjectTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTagRequest) GetObjectTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ObjectTypes) { + return nil, false + } + return o.ObjectTypes, true +} + +// HasObjectTypes returns a boolean if a field has been set. +func (o *PatchedTagRequest) HasObjectTypes() bool { + if o != nil && !IsNil(o.ObjectTypes) { + return true + } + + return false +} + +// SetObjectTypes gets a reference to the given []string and assigns it to the ObjectTypes field. +func (o *PatchedTagRequest) SetObjectTypes(v []string) { + o.ObjectTypes = v +} + +func (o PatchedTagRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedTagRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.ObjectTypes) { + toSerialize["object_types"] = o.ObjectTypes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedTagRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedTagRequest := _PatchedTagRequest{} + + err = json.Unmarshal(data, &varPatchedTagRequest) + + if err != nil { + return err + } + + *o = PatchedTagRequest(varPatchedTagRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "object_types") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedTagRequest struct { + value *PatchedTagRequest + isSet bool +} + +func (v NullablePatchedTagRequest) Get() *PatchedTagRequest { + return v.value +} + +func (v *NullablePatchedTagRequest) Set(val *PatchedTagRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedTagRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedTagRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedTagRequest(val *PatchedTagRequest) *NullablePatchedTagRequest { + return &NullablePatchedTagRequest{value: val, isSet: true} +} + +func (v NullablePatchedTagRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedTagRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_tunnel_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_tunnel_group_request.go new file mode 100644 index 00000000..d1c294f4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_tunnel_group_request.go @@ -0,0 +1,301 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedTunnelGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedTunnelGroupRequest{} + +// PatchedTunnelGroupRequest Adds support for custom fields and tags. +type PatchedTunnelGroupRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedTunnelGroupRequest PatchedTunnelGroupRequest + +// NewPatchedTunnelGroupRequest instantiates a new PatchedTunnelGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedTunnelGroupRequest() *PatchedTunnelGroupRequest { + this := PatchedTunnelGroupRequest{} + return &this +} + +// NewPatchedTunnelGroupRequestWithDefaults instantiates a new PatchedTunnelGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedTunnelGroupRequestWithDefaults() *PatchedTunnelGroupRequest { + this := PatchedTunnelGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedTunnelGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTunnelGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedTunnelGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedTunnelGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedTunnelGroupRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTunnelGroupRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedTunnelGroupRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedTunnelGroupRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedTunnelGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTunnelGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedTunnelGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedTunnelGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedTunnelGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTunnelGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedTunnelGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedTunnelGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedTunnelGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTunnelGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedTunnelGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedTunnelGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedTunnelGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedTunnelGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedTunnelGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedTunnelGroupRequest := _PatchedTunnelGroupRequest{} + + err = json.Unmarshal(data, &varPatchedTunnelGroupRequest) + + if err != nil { + return err + } + + *o = PatchedTunnelGroupRequest(varPatchedTunnelGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedTunnelGroupRequest struct { + value *PatchedTunnelGroupRequest + isSet bool +} + +func (v NullablePatchedTunnelGroupRequest) Get() *PatchedTunnelGroupRequest { + return v.value +} + +func (v *NullablePatchedTunnelGroupRequest) Set(val *PatchedTunnelGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedTunnelGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedTunnelGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedTunnelGroupRequest(val *PatchedTunnelGroupRequest) *NullablePatchedTunnelGroupRequest { + return &NullablePatchedTunnelGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedTunnelGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedTunnelGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_vlan_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_vlan_group_request.go new file mode 100644 index 00000000..fe75558d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_vlan_group_request.go @@ -0,0 +1,473 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedVLANGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedVLANGroupRequest{} + +// PatchedVLANGroupRequest Adds support for custom fields and tags. +type PatchedVLANGroupRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + ScopeType NullableString `json:"scope_type,omitempty"` + ScopeId NullableInt32 `json:"scope_id,omitempty"` + // Lowest permissible ID of a child VLAN + MinVid *int32 `json:"min_vid,omitempty"` + // Highest permissible ID of a child VLAN + MaxVid *int32 `json:"max_vid,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedVLANGroupRequest PatchedVLANGroupRequest + +// NewPatchedVLANGroupRequest instantiates a new PatchedVLANGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedVLANGroupRequest() *PatchedVLANGroupRequest { + this := PatchedVLANGroupRequest{} + return &this +} + +// NewPatchedVLANGroupRequestWithDefaults instantiates a new PatchedVLANGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedVLANGroupRequestWithDefaults() *PatchedVLANGroupRequest { + this := PatchedVLANGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedVLANGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedVLANGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedVLANGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedVLANGroupRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedVLANGroupRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedVLANGroupRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetScopeType returns the ScopeType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedVLANGroupRequest) GetScopeType() string { + if o == nil || IsNil(o.ScopeType.Get()) { + var ret string + return ret + } + return *o.ScopeType.Get() +} + +// GetScopeTypeOk returns a tuple with the ScopeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedVLANGroupRequest) GetScopeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ScopeType.Get(), o.ScopeType.IsSet() +} + +// HasScopeType returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasScopeType() bool { + if o != nil && o.ScopeType.IsSet() { + return true + } + + return false +} + +// SetScopeType gets a reference to the given NullableString and assigns it to the ScopeType field. +func (o *PatchedVLANGroupRequest) SetScopeType(v string) { + o.ScopeType.Set(&v) +} + +// SetScopeTypeNil sets the value for ScopeType to be an explicit nil +func (o *PatchedVLANGroupRequest) SetScopeTypeNil() { + o.ScopeType.Set(nil) +} + +// UnsetScopeType ensures that no value is present for ScopeType, not even an explicit nil +func (o *PatchedVLANGroupRequest) UnsetScopeType() { + o.ScopeType.Unset() +} + +// GetScopeId returns the ScopeId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedVLANGroupRequest) GetScopeId() int32 { + if o == nil || IsNil(o.ScopeId.Get()) { + var ret int32 + return ret + } + return *o.ScopeId.Get() +} + +// GetScopeIdOk returns a tuple with the ScopeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedVLANGroupRequest) GetScopeIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ScopeId.Get(), o.ScopeId.IsSet() +} + +// HasScopeId returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasScopeId() bool { + if o != nil && o.ScopeId.IsSet() { + return true + } + + return false +} + +// SetScopeId gets a reference to the given NullableInt32 and assigns it to the ScopeId field. +func (o *PatchedVLANGroupRequest) SetScopeId(v int32) { + o.ScopeId.Set(&v) +} + +// SetScopeIdNil sets the value for ScopeId to be an explicit nil +func (o *PatchedVLANGroupRequest) SetScopeIdNil() { + o.ScopeId.Set(nil) +} + +// UnsetScopeId ensures that no value is present for ScopeId, not even an explicit nil +func (o *PatchedVLANGroupRequest) UnsetScopeId() { + o.ScopeId.Unset() +} + +// GetMinVid returns the MinVid field value if set, zero value otherwise. +func (o *PatchedVLANGroupRequest) GetMinVid() int32 { + if o == nil || IsNil(o.MinVid) { + var ret int32 + return ret + } + return *o.MinVid +} + +// GetMinVidOk returns a tuple with the MinVid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedVLANGroupRequest) GetMinVidOk() (*int32, bool) { + if o == nil || IsNil(o.MinVid) { + return nil, false + } + return o.MinVid, true +} + +// HasMinVid returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasMinVid() bool { + if o != nil && !IsNil(o.MinVid) { + return true + } + + return false +} + +// SetMinVid gets a reference to the given int32 and assigns it to the MinVid field. +func (o *PatchedVLANGroupRequest) SetMinVid(v int32) { + o.MinVid = &v +} + +// GetMaxVid returns the MaxVid field value if set, zero value otherwise. +func (o *PatchedVLANGroupRequest) GetMaxVid() int32 { + if o == nil || IsNil(o.MaxVid) { + var ret int32 + return ret + } + return *o.MaxVid +} + +// GetMaxVidOk returns a tuple with the MaxVid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedVLANGroupRequest) GetMaxVidOk() (*int32, bool) { + if o == nil || IsNil(o.MaxVid) { + return nil, false + } + return o.MaxVid, true +} + +// HasMaxVid returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasMaxVid() bool { + if o != nil && !IsNil(o.MaxVid) { + return true + } + + return false +} + +// SetMaxVid gets a reference to the given int32 and assigns it to the MaxVid field. +func (o *PatchedVLANGroupRequest) SetMaxVid(v int32) { + o.MaxVid = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedVLANGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedVLANGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedVLANGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedVLANGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedVLANGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedVLANGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedVLANGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedVLANGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedVLANGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedVLANGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedVLANGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedVLANGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.ScopeType.IsSet() { + toSerialize["scope_type"] = o.ScopeType.Get() + } + if o.ScopeId.IsSet() { + toSerialize["scope_id"] = o.ScopeId.Get() + } + if !IsNil(o.MinVid) { + toSerialize["min_vid"] = o.MinVid + } + if !IsNil(o.MaxVid) { + toSerialize["max_vid"] = o.MaxVid + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedVLANGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedVLANGroupRequest := _PatchedVLANGroupRequest{} + + err = json.Unmarshal(data, &varPatchedVLANGroupRequest) + + if err != nil { + return err + } + + *o = PatchedVLANGroupRequest(varPatchedVLANGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "scope_type") + delete(additionalProperties, "scope_id") + delete(additionalProperties, "min_vid") + delete(additionalProperties, "max_vid") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedVLANGroupRequest struct { + value *PatchedVLANGroupRequest + isSet bool +} + +func (v NullablePatchedVLANGroupRequest) Get() *PatchedVLANGroupRequest { + return v.value +} + +func (v *NullablePatchedVLANGroupRequest) Set(val *PatchedVLANGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedVLANGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedVLANGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedVLANGroupRequest(val *PatchedVLANGroupRequest) *NullablePatchedVLANGroupRequest { + return &NullablePatchedVLANGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedVLANGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedVLANGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_webhook_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_webhook_request.go new file mode 100644 index 00000000..e5edb65b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_webhook_request.go @@ -0,0 +1,578 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWebhookRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWebhookRequest{} + +// PatchedWebhookRequest Adds support for custom fields and tags. +type PatchedWebhookRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + // This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body. + PayloadUrl *string `json:"payload_url,omitempty"` + HttpMethod *PatchedWebhookRequestHttpMethod `json:"http_method,omitempty"` + // The complete list of official content types is available here. + HttpContentType *string `json:"http_content_type,omitempty"` + // User-supplied HTTP headers to be sent with the request in addition to the HTTP content type. Headers should be defined in the format Name: Value. Jinja2 template processing is supported with the same context as the request body (below). + AdditionalHeaders *string `json:"additional_headers,omitempty"` + // Jinja2 template for a custom request body. If blank, a JSON object representing the change will be included. Available context data includes: event, model, timestamp, username, request_id, and data. + BodyTemplate *string `json:"body_template,omitempty"` + // When provided, the request will include a X-Hook-Signature header containing a HMAC hex digest of the payload body using the secret as the key. The secret is not transmitted in the request. + Secret *string `json:"secret,omitempty"` + // Enable SSL certificate verification. Disable with caution! + SslVerification *bool `json:"ssl_verification,omitempty"` + // The specific CA certificate file to use for SSL verification. Leave blank to use the system defaults. + CaFilePath NullableString `json:"ca_file_path,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWebhookRequest PatchedWebhookRequest + +// NewPatchedWebhookRequest instantiates a new PatchedWebhookRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWebhookRequest() *PatchedWebhookRequest { + this := PatchedWebhookRequest{} + return &this +} + +// NewPatchedWebhookRequestWithDefaults instantiates a new PatchedWebhookRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWebhookRequestWithDefaults() *PatchedWebhookRequest { + this := PatchedWebhookRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWebhookRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWebhookRequest) SetDescription(v string) { + o.Description = &v +} + +// GetPayloadUrl returns the PayloadUrl field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetPayloadUrl() string { + if o == nil || IsNil(o.PayloadUrl) { + var ret string + return ret + } + return *o.PayloadUrl +} + +// GetPayloadUrlOk returns a tuple with the PayloadUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetPayloadUrlOk() (*string, bool) { + if o == nil || IsNil(o.PayloadUrl) { + return nil, false + } + return o.PayloadUrl, true +} + +// HasPayloadUrl returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasPayloadUrl() bool { + if o != nil && !IsNil(o.PayloadUrl) { + return true + } + + return false +} + +// SetPayloadUrl gets a reference to the given string and assigns it to the PayloadUrl field. +func (o *PatchedWebhookRequest) SetPayloadUrl(v string) { + o.PayloadUrl = &v +} + +// GetHttpMethod returns the HttpMethod field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetHttpMethod() PatchedWebhookRequestHttpMethod { + if o == nil || IsNil(o.HttpMethod) { + var ret PatchedWebhookRequestHttpMethod + return ret + } + return *o.HttpMethod +} + +// GetHttpMethodOk returns a tuple with the HttpMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetHttpMethodOk() (*PatchedWebhookRequestHttpMethod, bool) { + if o == nil || IsNil(o.HttpMethod) { + return nil, false + } + return o.HttpMethod, true +} + +// HasHttpMethod returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasHttpMethod() bool { + if o != nil && !IsNil(o.HttpMethod) { + return true + } + + return false +} + +// SetHttpMethod gets a reference to the given PatchedWebhookRequestHttpMethod and assigns it to the HttpMethod field. +func (o *PatchedWebhookRequest) SetHttpMethod(v PatchedWebhookRequestHttpMethod) { + o.HttpMethod = &v +} + +// GetHttpContentType returns the HttpContentType field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetHttpContentType() string { + if o == nil || IsNil(o.HttpContentType) { + var ret string + return ret + } + return *o.HttpContentType +} + +// GetHttpContentTypeOk returns a tuple with the HttpContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetHttpContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.HttpContentType) { + return nil, false + } + return o.HttpContentType, true +} + +// HasHttpContentType returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasHttpContentType() bool { + if o != nil && !IsNil(o.HttpContentType) { + return true + } + + return false +} + +// SetHttpContentType gets a reference to the given string and assigns it to the HttpContentType field. +func (o *PatchedWebhookRequest) SetHttpContentType(v string) { + o.HttpContentType = &v +} + +// GetAdditionalHeaders returns the AdditionalHeaders field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetAdditionalHeaders() string { + if o == nil || IsNil(o.AdditionalHeaders) { + var ret string + return ret + } + return *o.AdditionalHeaders +} + +// GetAdditionalHeadersOk returns a tuple with the AdditionalHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetAdditionalHeadersOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalHeaders) { + return nil, false + } + return o.AdditionalHeaders, true +} + +// HasAdditionalHeaders returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasAdditionalHeaders() bool { + if o != nil && !IsNil(o.AdditionalHeaders) { + return true + } + + return false +} + +// SetAdditionalHeaders gets a reference to the given string and assigns it to the AdditionalHeaders field. +func (o *PatchedWebhookRequest) SetAdditionalHeaders(v string) { + o.AdditionalHeaders = &v +} + +// GetBodyTemplate returns the BodyTemplate field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetBodyTemplate() string { + if o == nil || IsNil(o.BodyTemplate) { + var ret string + return ret + } + return *o.BodyTemplate +} + +// GetBodyTemplateOk returns a tuple with the BodyTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetBodyTemplateOk() (*string, bool) { + if o == nil || IsNil(o.BodyTemplate) { + return nil, false + } + return o.BodyTemplate, true +} + +// HasBodyTemplate returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasBodyTemplate() bool { + if o != nil && !IsNil(o.BodyTemplate) { + return true + } + + return false +} + +// SetBodyTemplate gets a reference to the given string and assigns it to the BodyTemplate field. +func (o *PatchedWebhookRequest) SetBodyTemplate(v string) { + o.BodyTemplate = &v +} + +// GetSecret returns the Secret field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetSecret() string { + if o == nil || IsNil(o.Secret) { + var ret string + return ret + } + return *o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetSecretOk() (*string, bool) { + if o == nil || IsNil(o.Secret) { + return nil, false + } + return o.Secret, true +} + +// HasSecret returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasSecret() bool { + if o != nil && !IsNil(o.Secret) { + return true + } + + return false +} + +// SetSecret gets a reference to the given string and assigns it to the Secret field. +func (o *PatchedWebhookRequest) SetSecret(v string) { + o.Secret = &v +} + +// GetSslVerification returns the SslVerification field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetSslVerification() bool { + if o == nil || IsNil(o.SslVerification) { + var ret bool + return ret + } + return *o.SslVerification +} + +// GetSslVerificationOk returns a tuple with the SslVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetSslVerificationOk() (*bool, bool) { + if o == nil || IsNil(o.SslVerification) { + return nil, false + } + return o.SslVerification, true +} + +// HasSslVerification returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasSslVerification() bool { + if o != nil && !IsNil(o.SslVerification) { + return true + } + + return false +} + +// SetSslVerification gets a reference to the given bool and assigns it to the SslVerification field. +func (o *PatchedWebhookRequest) SetSslVerification(v bool) { + o.SslVerification = &v +} + +// GetCaFilePath returns the CaFilePath field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWebhookRequest) GetCaFilePath() string { + if o == nil || IsNil(o.CaFilePath.Get()) { + var ret string + return ret + } + return *o.CaFilePath.Get() +} + +// GetCaFilePathOk returns a tuple with the CaFilePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWebhookRequest) GetCaFilePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CaFilePath.Get(), o.CaFilePath.IsSet() +} + +// HasCaFilePath returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasCaFilePath() bool { + if o != nil && o.CaFilePath.IsSet() { + return true + } + + return false +} + +// SetCaFilePath gets a reference to the given NullableString and assigns it to the CaFilePath field. +func (o *PatchedWebhookRequest) SetCaFilePath(v string) { + o.CaFilePath.Set(&v) +} + +// SetCaFilePathNil sets the value for CaFilePath to be an explicit nil +func (o *PatchedWebhookRequest) SetCaFilePathNil() { + o.CaFilePath.Set(nil) +} + +// UnsetCaFilePath ensures that no value is present for CaFilePath, not even an explicit nil +func (o *PatchedWebhookRequest) UnsetCaFilePath() { + o.CaFilePath.Unset() +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWebhookRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWebhookRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebhookRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWebhookRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWebhookRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o PatchedWebhookRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWebhookRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PayloadUrl) { + toSerialize["payload_url"] = o.PayloadUrl + } + if !IsNil(o.HttpMethod) { + toSerialize["http_method"] = o.HttpMethod + } + if !IsNil(o.HttpContentType) { + toSerialize["http_content_type"] = o.HttpContentType + } + if !IsNil(o.AdditionalHeaders) { + toSerialize["additional_headers"] = o.AdditionalHeaders + } + if !IsNil(o.BodyTemplate) { + toSerialize["body_template"] = o.BodyTemplate + } + if !IsNil(o.Secret) { + toSerialize["secret"] = o.Secret + } + if !IsNil(o.SslVerification) { + toSerialize["ssl_verification"] = o.SslVerification + } + if o.CaFilePath.IsSet() { + toSerialize["ca_file_path"] = o.CaFilePath.Get() + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWebhookRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWebhookRequest := _PatchedWebhookRequest{} + + err = json.Unmarshal(data, &varPatchedWebhookRequest) + + if err != nil { + return err + } + + *o = PatchedWebhookRequest(varPatchedWebhookRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "payload_url") + delete(additionalProperties, "http_method") + delete(additionalProperties, "http_content_type") + delete(additionalProperties, "additional_headers") + delete(additionalProperties, "body_template") + delete(additionalProperties, "secret") + delete(additionalProperties, "ssl_verification") + delete(additionalProperties, "ca_file_path") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWebhookRequest struct { + value *PatchedWebhookRequest + isSet bool +} + +func (v NullablePatchedWebhookRequest) Get() *PatchedWebhookRequest { + return v.value +} + +func (v *NullablePatchedWebhookRequest) Set(val *PatchedWebhookRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWebhookRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWebhookRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWebhookRequest(val *PatchedWebhookRequest) *NullablePatchedWebhookRequest { + return &NullablePatchedWebhookRequest{value: val, isSet: true} +} + +func (v NullablePatchedWebhookRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWebhookRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_webhook_request_http_method.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_webhook_request_http_method.go new file mode 100644 index 00000000..8b91b0cd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_webhook_request_http_method.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWebhookRequestHttpMethod * `GET` - GET * `POST` - POST * `PUT` - PUT * `PATCH` - PATCH * `DELETE` - DELETE +type PatchedWebhookRequestHttpMethod string + +// List of PatchedWebhookRequest_http_method +const ( + PATCHEDWEBHOOKREQUESTHTTPMETHOD_GET PatchedWebhookRequestHttpMethod = "GET" + PATCHEDWEBHOOKREQUESTHTTPMETHOD_POST PatchedWebhookRequestHttpMethod = "POST" + PATCHEDWEBHOOKREQUESTHTTPMETHOD_PUT PatchedWebhookRequestHttpMethod = "PUT" + PATCHEDWEBHOOKREQUESTHTTPMETHOD_PATCH PatchedWebhookRequestHttpMethod = "PATCH" + PATCHEDWEBHOOKREQUESTHTTPMETHOD_DELETE PatchedWebhookRequestHttpMethod = "DELETE" +) + +// All allowed values of PatchedWebhookRequestHttpMethod enum +var AllowedPatchedWebhookRequestHttpMethodEnumValues = []PatchedWebhookRequestHttpMethod{ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", +} + +func (v *PatchedWebhookRequestHttpMethod) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWebhookRequestHttpMethod(value) + for _, existing := range AllowedPatchedWebhookRequestHttpMethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWebhookRequestHttpMethod", value) +} + +// NewPatchedWebhookRequestHttpMethodFromValue returns a pointer to a valid PatchedWebhookRequestHttpMethod +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWebhookRequestHttpMethodFromValue(v string) (*PatchedWebhookRequestHttpMethod, error) { + ev := PatchedWebhookRequestHttpMethod(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWebhookRequestHttpMethod: valid values are %v", v, AllowedPatchedWebhookRequestHttpMethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWebhookRequestHttpMethod) IsValid() bool { + for _, existing := range AllowedPatchedWebhookRequestHttpMethodEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWebhookRequest_http_method value +func (v PatchedWebhookRequestHttpMethod) Ptr() *PatchedWebhookRequestHttpMethod { + return &v +} + +type NullablePatchedWebhookRequestHttpMethod struct { + value *PatchedWebhookRequestHttpMethod + isSet bool +} + +func (v NullablePatchedWebhookRequestHttpMethod) Get() *PatchedWebhookRequestHttpMethod { + return v.value +} + +func (v *NullablePatchedWebhookRequestHttpMethod) Set(val *PatchedWebhookRequestHttpMethod) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWebhookRequestHttpMethod) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWebhookRequestHttpMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWebhookRequestHttpMethod(val *PatchedWebhookRequestHttpMethod) *NullablePatchedWebhookRequestHttpMethod { + return &NullablePatchedWebhookRequestHttpMethod{value: val, isSet: true} +} + +func (v NullablePatchedWebhookRequestHttpMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWebhookRequestHttpMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_aggregate_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_aggregate_request.go new file mode 100644 index 00000000..b5f9fd46 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_aggregate_request.go @@ -0,0 +1,435 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableAggregateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableAggregateRequest{} + +// PatchedWritableAggregateRequest Adds support for custom fields and tags. +type PatchedWritableAggregateRequest struct { + Prefix *string `json:"prefix,omitempty"` + // Regional Internet Registry responsible for this IP space + Rir *int32 `json:"rir,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + DateAdded NullableString `json:"date_added,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableAggregateRequest PatchedWritableAggregateRequest + +// NewPatchedWritableAggregateRequest instantiates a new PatchedWritableAggregateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableAggregateRequest() *PatchedWritableAggregateRequest { + this := PatchedWritableAggregateRequest{} + return &this +} + +// NewPatchedWritableAggregateRequestWithDefaults instantiates a new PatchedWritableAggregateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableAggregateRequestWithDefaults() *PatchedWritableAggregateRequest { + this := PatchedWritableAggregateRequest{} + return &this +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *PatchedWritableAggregateRequest) GetPrefix() string { + if o == nil || IsNil(o.Prefix) { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableAggregateRequest) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *PatchedWritableAggregateRequest) SetPrefix(v string) { + o.Prefix = &v +} + +// GetRir returns the Rir field value if set, zero value otherwise. +func (o *PatchedWritableAggregateRequest) GetRir() int32 { + if o == nil || IsNil(o.Rir) { + var ret int32 + return ret + } + return *o.Rir +} + +// GetRirOk returns a tuple with the Rir field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableAggregateRequest) GetRirOk() (*int32, bool) { + if o == nil || IsNil(o.Rir) { + return nil, false + } + return o.Rir, true +} + +// HasRir returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasRir() bool { + if o != nil && !IsNil(o.Rir) { + return true + } + + return false +} + +// SetRir gets a reference to the given int32 and assigns it to the Rir field. +func (o *PatchedWritableAggregateRequest) SetRir(v int32) { + o.Rir = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableAggregateRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableAggregateRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableAggregateRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableAggregateRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableAggregateRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDateAdded returns the DateAdded field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableAggregateRequest) GetDateAdded() string { + if o == nil || IsNil(o.DateAdded.Get()) { + var ret string + return ret + } + return *o.DateAdded.Get() +} + +// GetDateAddedOk returns a tuple with the DateAdded field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableAggregateRequest) GetDateAddedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DateAdded.Get(), o.DateAdded.IsSet() +} + +// HasDateAdded returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasDateAdded() bool { + if o != nil && o.DateAdded.IsSet() { + return true + } + + return false +} + +// SetDateAdded gets a reference to the given NullableString and assigns it to the DateAdded field. +func (o *PatchedWritableAggregateRequest) SetDateAdded(v string) { + o.DateAdded.Set(&v) +} + +// SetDateAddedNil sets the value for DateAdded to be an explicit nil +func (o *PatchedWritableAggregateRequest) SetDateAddedNil() { + o.DateAdded.Set(nil) +} + +// UnsetDateAdded ensures that no value is present for DateAdded, not even an explicit nil +func (o *PatchedWritableAggregateRequest) UnsetDateAdded() { + o.DateAdded.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableAggregateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableAggregateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableAggregateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableAggregateRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableAggregateRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableAggregateRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableAggregateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableAggregateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableAggregateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableAggregateRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableAggregateRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableAggregateRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableAggregateRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableAggregateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableAggregateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.Rir) { + toSerialize["rir"] = o.Rir + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.DateAdded.IsSet() { + toSerialize["date_added"] = o.DateAdded.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableAggregateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableAggregateRequest := _PatchedWritableAggregateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableAggregateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableAggregateRequest(varPatchedWritableAggregateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "date_added") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableAggregateRequest struct { + value *PatchedWritableAggregateRequest + isSet bool +} + +func (v NullablePatchedWritableAggregateRequest) Get() *PatchedWritableAggregateRequest { + return v.value +} + +func (v *NullablePatchedWritableAggregateRequest) Set(val *PatchedWritableAggregateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableAggregateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableAggregateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableAggregateRequest(val *PatchedWritableAggregateRequest) *NullablePatchedWritableAggregateRequest { + return &NullablePatchedWritableAggregateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableAggregateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableAggregateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_asn_range_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_asn_range_request.go new file mode 100644 index 00000000..06137b5f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_asn_range_request.go @@ -0,0 +1,460 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableASNRangeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableASNRangeRequest{} + +// PatchedWritableASNRangeRequest Adds support for custom fields and tags. +type PatchedWritableASNRangeRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Rir *int32 `json:"rir,omitempty"` + Start *int64 `json:"start,omitempty"` + End *int64 `json:"end,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableASNRangeRequest PatchedWritableASNRangeRequest + +// NewPatchedWritableASNRangeRequest instantiates a new PatchedWritableASNRangeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableASNRangeRequest() *PatchedWritableASNRangeRequest { + this := PatchedWritableASNRangeRequest{} + return &this +} + +// NewPatchedWritableASNRangeRequestWithDefaults instantiates a new PatchedWritableASNRangeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableASNRangeRequestWithDefaults() *PatchedWritableASNRangeRequest { + this := PatchedWritableASNRangeRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableASNRangeRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableASNRangeRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetRir returns the Rir field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetRir() int32 { + if o == nil || IsNil(o.Rir) { + var ret int32 + return ret + } + return *o.Rir +} + +// GetRirOk returns a tuple with the Rir field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetRirOk() (*int32, bool) { + if o == nil || IsNil(o.Rir) { + return nil, false + } + return o.Rir, true +} + +// HasRir returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasRir() bool { + if o != nil && !IsNil(o.Rir) { + return true + } + + return false +} + +// SetRir gets a reference to the given int32 and assigns it to the Rir field. +func (o *PatchedWritableASNRangeRequest) SetRir(v int32) { + o.Rir = &v +} + +// GetStart returns the Start field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetStart() int64 { + if o == nil || IsNil(o.Start) { + var ret int64 + return ret + } + return *o.Start +} + +// GetStartOk returns a tuple with the Start field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetStartOk() (*int64, bool) { + if o == nil || IsNil(o.Start) { + return nil, false + } + return o.Start, true +} + +// HasStart returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasStart() bool { + if o != nil && !IsNil(o.Start) { + return true + } + + return false +} + +// SetStart gets a reference to the given int64 and assigns it to the Start field. +func (o *PatchedWritableASNRangeRequest) SetStart(v int64) { + o.Start = &v +} + +// GetEnd returns the End field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetEnd() int64 { + if o == nil || IsNil(o.End) { + var ret int64 + return ret + } + return *o.End +} + +// GetEndOk returns a tuple with the End field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetEndOk() (*int64, bool) { + if o == nil || IsNil(o.End) { + return nil, false + } + return o.End, true +} + +// HasEnd returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasEnd() bool { + if o != nil && !IsNil(o.End) { + return true + } + + return false +} + +// SetEnd gets a reference to the given int64 and assigns it to the End field. +func (o *PatchedWritableASNRangeRequest) SetEnd(v int64) { + o.End = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableASNRangeRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableASNRangeRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableASNRangeRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableASNRangeRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableASNRangeRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableASNRangeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableASNRangeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableASNRangeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRangeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableASNRangeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableASNRangeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableASNRangeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableASNRangeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Rir) { + toSerialize["rir"] = o.Rir + } + if !IsNil(o.Start) { + toSerialize["start"] = o.Start + } + if !IsNil(o.End) { + toSerialize["end"] = o.End + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableASNRangeRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableASNRangeRequest := _PatchedWritableASNRangeRequest{} + + err = json.Unmarshal(data, &varPatchedWritableASNRangeRequest) + + if err != nil { + return err + } + + *o = PatchedWritableASNRangeRequest(varPatchedWritableASNRangeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "rir") + delete(additionalProperties, "start") + delete(additionalProperties, "end") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableASNRangeRequest struct { + value *PatchedWritableASNRangeRequest + isSet bool +} + +func (v NullablePatchedWritableASNRangeRequest) Get() *PatchedWritableASNRangeRequest { + return v.value +} + +func (v *NullablePatchedWritableASNRangeRequest) Set(val *PatchedWritableASNRangeRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableASNRangeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableASNRangeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableASNRangeRequest(val *PatchedWritableASNRangeRequest) *NullablePatchedWritableASNRangeRequest { + return &NullablePatchedWritableASNRangeRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableASNRangeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableASNRangeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_asn_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_asn_request.go new file mode 100644 index 00000000..b16b26b7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_asn_request.go @@ -0,0 +1,388 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableASNRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableASNRequest{} + +// PatchedWritableASNRequest Adds support for custom fields and tags. +type PatchedWritableASNRequest struct { + // 16- or 32-bit autonomous system number + Asn *int64 `json:"asn,omitempty"` + // Regional Internet Registry responsible for this AS number space + Rir *int32 `json:"rir,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableASNRequest PatchedWritableASNRequest + +// NewPatchedWritableASNRequest instantiates a new PatchedWritableASNRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableASNRequest() *PatchedWritableASNRequest { + this := PatchedWritableASNRequest{} + return &this +} + +// NewPatchedWritableASNRequestWithDefaults instantiates a new PatchedWritableASNRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableASNRequestWithDefaults() *PatchedWritableASNRequest { + this := PatchedWritableASNRequest{} + return &this +} + +// GetAsn returns the Asn field value if set, zero value otherwise. +func (o *PatchedWritableASNRequest) GetAsn() int64 { + if o == nil || IsNil(o.Asn) { + var ret int64 + return ret + } + return *o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRequest) GetAsnOk() (*int64, bool) { + if o == nil || IsNil(o.Asn) { + return nil, false + } + return o.Asn, true +} + +// HasAsn returns a boolean if a field has been set. +func (o *PatchedWritableASNRequest) HasAsn() bool { + if o != nil && !IsNil(o.Asn) { + return true + } + + return false +} + +// SetAsn gets a reference to the given int64 and assigns it to the Asn field. +func (o *PatchedWritableASNRequest) SetAsn(v int64) { + o.Asn = &v +} + +// GetRir returns the Rir field value if set, zero value otherwise. +func (o *PatchedWritableASNRequest) GetRir() int32 { + if o == nil || IsNil(o.Rir) { + var ret int32 + return ret + } + return *o.Rir +} + +// GetRirOk returns a tuple with the Rir field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRequest) GetRirOk() (*int32, bool) { + if o == nil || IsNil(o.Rir) { + return nil, false + } + return o.Rir, true +} + +// HasRir returns a boolean if a field has been set. +func (o *PatchedWritableASNRequest) HasRir() bool { + if o != nil && !IsNil(o.Rir) { + return true + } + + return false +} + +// SetRir gets a reference to the given int32 and assigns it to the Rir field. +func (o *PatchedWritableASNRequest) SetRir(v int32) { + o.Rir = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableASNRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableASNRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableASNRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableASNRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableASNRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableASNRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableASNRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableASNRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableASNRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableASNRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableASNRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableASNRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableASNRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableASNRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableASNRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableASNRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableASNRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableASNRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableASNRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableASNRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableASNRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Asn) { + toSerialize["asn"] = o.Asn + } + if !IsNil(o.Rir) { + toSerialize["rir"] = o.Rir + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableASNRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableASNRequest := _PatchedWritableASNRequest{} + + err = json.Unmarshal(data, &varPatchedWritableASNRequest) + + if err != nil { + return err + } + + *o = PatchedWritableASNRequest(varPatchedWritableASNRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "asn") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableASNRequest struct { + value *PatchedWritableASNRequest + isSet bool +} + +func (v NullablePatchedWritableASNRequest) Get() *PatchedWritableASNRequest { + return v.value +} + +func (v *NullablePatchedWritableASNRequest) Set(val *PatchedWritableASNRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableASNRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableASNRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableASNRequest(val *PatchedWritableASNRequest) *NullablePatchedWritableASNRequest { + return &NullablePatchedWritableASNRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableASNRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableASNRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_bookmark_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_bookmark_request.go new file mode 100644 index 00000000..2fa96a47 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_bookmark_request.go @@ -0,0 +1,227 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableBookmarkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableBookmarkRequest{} + +// PatchedWritableBookmarkRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableBookmarkRequest struct { + ObjectType *string `json:"object_type,omitempty"` + ObjectId *int64 `json:"object_id,omitempty"` + User *int32 `json:"user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableBookmarkRequest PatchedWritableBookmarkRequest + +// NewPatchedWritableBookmarkRequest instantiates a new PatchedWritableBookmarkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableBookmarkRequest() *PatchedWritableBookmarkRequest { + this := PatchedWritableBookmarkRequest{} + return &this +} + +// NewPatchedWritableBookmarkRequestWithDefaults instantiates a new PatchedWritableBookmarkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableBookmarkRequestWithDefaults() *PatchedWritableBookmarkRequest { + this := PatchedWritableBookmarkRequest{} + return &this +} + +// GetObjectType returns the ObjectType field value if set, zero value otherwise. +func (o *PatchedWritableBookmarkRequest) GetObjectType() string { + if o == nil || IsNil(o.ObjectType) { + var ret string + return ret + } + return *o.ObjectType +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableBookmarkRequest) GetObjectTypeOk() (*string, bool) { + if o == nil || IsNil(o.ObjectType) { + return nil, false + } + return o.ObjectType, true +} + +// HasObjectType returns a boolean if a field has been set. +func (o *PatchedWritableBookmarkRequest) HasObjectType() bool { + if o != nil && !IsNil(o.ObjectType) { + return true + } + + return false +} + +// SetObjectType gets a reference to the given string and assigns it to the ObjectType field. +func (o *PatchedWritableBookmarkRequest) SetObjectType(v string) { + o.ObjectType = &v +} + +// GetObjectId returns the ObjectId field value if set, zero value otherwise. +func (o *PatchedWritableBookmarkRequest) GetObjectId() int64 { + if o == nil || IsNil(o.ObjectId) { + var ret int64 + return ret + } + return *o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableBookmarkRequest) GetObjectIdOk() (*int64, bool) { + if o == nil || IsNil(o.ObjectId) { + return nil, false + } + return o.ObjectId, true +} + +// HasObjectId returns a boolean if a field has been set. +func (o *PatchedWritableBookmarkRequest) HasObjectId() bool { + if o != nil && !IsNil(o.ObjectId) { + return true + } + + return false +} + +// SetObjectId gets a reference to the given int64 and assigns it to the ObjectId field. +func (o *PatchedWritableBookmarkRequest) SetObjectId(v int64) { + o.ObjectId = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedWritableBookmarkRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableBookmarkRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedWritableBookmarkRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedWritableBookmarkRequest) SetUser(v int32) { + o.User = &v +} + +func (o PatchedWritableBookmarkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableBookmarkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ObjectType) { + toSerialize["object_type"] = o.ObjectType + } + if !IsNil(o.ObjectId) { + toSerialize["object_id"] = o.ObjectId + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableBookmarkRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableBookmarkRequest := _PatchedWritableBookmarkRequest{} + + err = json.Unmarshal(data, &varPatchedWritableBookmarkRequest) + + if err != nil { + return err + } + + *o = PatchedWritableBookmarkRequest(varPatchedWritableBookmarkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableBookmarkRequest struct { + value *PatchedWritableBookmarkRequest + isSet bool +} + +func (v NullablePatchedWritableBookmarkRequest) Get() *PatchedWritableBookmarkRequest { + return v.value +} + +func (v *NullablePatchedWritableBookmarkRequest) Set(val *PatchedWritableBookmarkRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableBookmarkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableBookmarkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableBookmarkRequest(val *PatchedWritableBookmarkRequest) *NullablePatchedWritableBookmarkRequest { + return &NullablePatchedWritableBookmarkRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableBookmarkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableBookmarkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_cable_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_cable_request.go new file mode 100644 index 00000000..d419e34f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_cable_request.go @@ -0,0 +1,619 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableCableRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableCableRequest{} + +// PatchedWritableCableRequest Adds support for custom fields and tags. +type PatchedWritableCableRequest struct { + Type *CableType `json:"type,omitempty"` + ATerminations []GenericObjectRequest `json:"a_terminations,omitempty"` + BTerminations []GenericObjectRequest `json:"b_terminations,omitempty"` + Status *CableStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Label *string `json:"label,omitempty"` + Color *string `json:"color,omitempty"` + Length NullableFloat64 `json:"length,omitempty"` + LengthUnit *CableLengthUnitValue `json:"length_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableCableRequest PatchedWritableCableRequest + +// NewPatchedWritableCableRequest instantiates a new PatchedWritableCableRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableCableRequest() *PatchedWritableCableRequest { + this := PatchedWritableCableRequest{} + return &this +} + +// NewPatchedWritableCableRequestWithDefaults instantiates a new PatchedWritableCableRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableCableRequestWithDefaults() *PatchedWritableCableRequest { + this := PatchedWritableCableRequest{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetType() CableType { + if o == nil || IsNil(o.Type) { + var ret CableType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetTypeOk() (*CableType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given CableType and assigns it to the Type field. +func (o *PatchedWritableCableRequest) SetType(v CableType) { + o.Type = &v +} + +// GetATerminations returns the ATerminations field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetATerminations() []GenericObjectRequest { + if o == nil || IsNil(o.ATerminations) { + var ret []GenericObjectRequest + return ret + } + return o.ATerminations +} + +// GetATerminationsOk returns a tuple with the ATerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetATerminationsOk() ([]GenericObjectRequest, bool) { + if o == nil || IsNil(o.ATerminations) { + return nil, false + } + return o.ATerminations, true +} + +// HasATerminations returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasATerminations() bool { + if o != nil && !IsNil(o.ATerminations) { + return true + } + + return false +} + +// SetATerminations gets a reference to the given []GenericObjectRequest and assigns it to the ATerminations field. +func (o *PatchedWritableCableRequest) SetATerminations(v []GenericObjectRequest) { + o.ATerminations = v +} + +// GetBTerminations returns the BTerminations field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetBTerminations() []GenericObjectRequest { + if o == nil || IsNil(o.BTerminations) { + var ret []GenericObjectRequest + return ret + } + return o.BTerminations +} + +// GetBTerminationsOk returns a tuple with the BTerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetBTerminationsOk() ([]GenericObjectRequest, bool) { + if o == nil || IsNil(o.BTerminations) { + return nil, false + } + return o.BTerminations, true +} + +// HasBTerminations returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasBTerminations() bool { + if o != nil && !IsNil(o.BTerminations) { + return true + } + + return false +} + +// SetBTerminations gets a reference to the given []GenericObjectRequest and assigns it to the BTerminations field. +func (o *PatchedWritableCableRequest) SetBTerminations(v []GenericObjectRequest) { + o.BTerminations = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetStatus() CableStatusValue { + if o == nil || IsNil(o.Status) { + var ret CableStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetStatusOk() (*CableStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatusValue and assigns it to the Status field. +func (o *PatchedWritableCableRequest) SetStatus(v CableStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCableRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCableRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableCableRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableCableRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableCableRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableCableRequest) SetLabel(v string) { + o.Label = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedWritableCableRequest) SetColor(v string) { + o.Color = &v +} + +// GetLength returns the Length field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCableRequest) GetLength() float64 { + if o == nil || IsNil(o.Length.Get()) { + var ret float64 + return ret + } + return *o.Length.Get() +} + +// GetLengthOk returns a tuple with the Length field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCableRequest) GetLengthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Length.Get(), o.Length.IsSet() +} + +// HasLength returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasLength() bool { + if o != nil && o.Length.IsSet() { + return true + } + + return false +} + +// SetLength gets a reference to the given NullableFloat64 and assigns it to the Length field. +func (o *PatchedWritableCableRequest) SetLength(v float64) { + o.Length.Set(&v) +} + +// SetLengthNil sets the value for Length to be an explicit nil +func (o *PatchedWritableCableRequest) SetLengthNil() { + o.Length.Set(nil) +} + +// UnsetLength ensures that no value is present for Length, not even an explicit nil +func (o *PatchedWritableCableRequest) UnsetLength() { + o.Length.Unset() +} + +// GetLengthUnit returns the LengthUnit field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetLengthUnit() CableLengthUnitValue { + if o == nil || IsNil(o.LengthUnit) { + var ret CableLengthUnitValue + return ret + } + return *o.LengthUnit +} + +// GetLengthUnitOk returns a tuple with the LengthUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetLengthUnitOk() (*CableLengthUnitValue, bool) { + if o == nil || IsNil(o.LengthUnit) { + return nil, false + } + return o.LengthUnit, true +} + +// HasLengthUnit returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasLengthUnit() bool { + if o != nil && !IsNil(o.LengthUnit) { + return true + } + + return false +} + +// SetLengthUnit gets a reference to the given CableLengthUnitValue and assigns it to the LengthUnit field. +func (o *PatchedWritableCableRequest) SetLengthUnit(v CableLengthUnitValue) { + o.LengthUnit = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableCableRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableCableRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableCableRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableCableRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCableRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableCableRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableCableRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableCableRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableCableRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ATerminations) { + toSerialize["a_terminations"] = o.ATerminations + } + if !IsNil(o.BTerminations) { + toSerialize["b_terminations"] = o.BTerminations + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if o.Length.IsSet() { + toSerialize["length"] = o.Length.Get() + } + if !IsNil(o.LengthUnit) { + toSerialize["length_unit"] = o.LengthUnit + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableCableRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableCableRequest := _PatchedWritableCableRequest{} + + err = json.Unmarshal(data, &varPatchedWritableCableRequest) + + if err != nil { + return err + } + + *o = PatchedWritableCableRequest(varPatchedWritableCableRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "a_terminations") + delete(additionalProperties, "b_terminations") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "label") + delete(additionalProperties, "color") + delete(additionalProperties, "length") + delete(additionalProperties, "length_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableCableRequest struct { + value *PatchedWritableCableRequest + isSet bool +} + +func (v NullablePatchedWritableCableRequest) Get() *PatchedWritableCableRequest { + return v.value +} + +func (v *NullablePatchedWritableCableRequest) Set(val *PatchedWritableCableRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCableRequest(val *PatchedWritableCableRequest) *NullablePatchedWritableCableRequest { + return &NullablePatchedWritableCableRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableCableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_circuit_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_circuit_request.go new file mode 100644 index 00000000..8ad838a0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_circuit_request.go @@ -0,0 +1,654 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableCircuitRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableCircuitRequest{} + +// PatchedWritableCircuitRequest Adds support for custom fields and tags. +type PatchedWritableCircuitRequest struct { + // Unique circuit ID + Cid *string `json:"cid,omitempty"` + Provider *int32 `json:"provider,omitempty"` + ProviderAccount NullableInt32 `json:"provider_account,omitempty"` + Type *int32 `json:"type,omitempty"` + Status *CircuitStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + InstallDate NullableString `json:"install_date,omitempty"` + TerminationDate NullableString `json:"termination_date,omitempty"` + // Committed rate + CommitRate NullableInt32 `json:"commit_rate,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableCircuitRequest PatchedWritableCircuitRequest + +// NewPatchedWritableCircuitRequest instantiates a new PatchedWritableCircuitRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableCircuitRequest() *PatchedWritableCircuitRequest { + this := PatchedWritableCircuitRequest{} + return &this +} + +// NewPatchedWritableCircuitRequestWithDefaults instantiates a new PatchedWritableCircuitRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableCircuitRequestWithDefaults() *PatchedWritableCircuitRequest { + this := PatchedWritableCircuitRequest{} + return &this +} + +// GetCid returns the Cid field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetCid() string { + if o == nil || IsNil(o.Cid) { + var ret string + return ret + } + return *o.Cid +} + +// GetCidOk returns a tuple with the Cid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetCidOk() (*string, bool) { + if o == nil || IsNil(o.Cid) { + return nil, false + } + return o.Cid, true +} + +// HasCid returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasCid() bool { + if o != nil && !IsNil(o.Cid) { + return true + } + + return false +} + +// SetCid gets a reference to the given string and assigns it to the Cid field. +func (o *PatchedWritableCircuitRequest) SetCid(v string) { + o.Cid = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetProvider() int32 { + if o == nil || IsNil(o.Provider) { + var ret int32 + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetProviderOk() (*int32, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given int32 and assigns it to the Provider field. +func (o *PatchedWritableCircuitRequest) SetProvider(v int32) { + o.Provider = &v +} + +// GetProviderAccount returns the ProviderAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitRequest) GetProviderAccount() int32 { + if o == nil || IsNil(o.ProviderAccount.Get()) { + var ret int32 + return ret + } + return *o.ProviderAccount.Get() +} + +// GetProviderAccountOk returns a tuple with the ProviderAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitRequest) GetProviderAccountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ProviderAccount.Get(), o.ProviderAccount.IsSet() +} + +// HasProviderAccount returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasProviderAccount() bool { + if o != nil && o.ProviderAccount.IsSet() { + return true + } + + return false +} + +// SetProviderAccount gets a reference to the given NullableInt32 and assigns it to the ProviderAccount field. +func (o *PatchedWritableCircuitRequest) SetProviderAccount(v int32) { + o.ProviderAccount.Set(&v) +} + +// SetProviderAccountNil sets the value for ProviderAccount to be an explicit nil +func (o *PatchedWritableCircuitRequest) SetProviderAccountNil() { + o.ProviderAccount.Set(nil) +} + +// UnsetProviderAccount ensures that no value is present for ProviderAccount, not even an explicit nil +func (o *PatchedWritableCircuitRequest) UnsetProviderAccount() { + o.ProviderAccount.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetType() int32 { + if o == nil || IsNil(o.Type) { + var ret int32 + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetTypeOk() (*int32, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given int32 and assigns it to the Type field. +func (o *PatchedWritableCircuitRequest) SetType(v int32) { + o.Type = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetStatus() CircuitStatusValue { + if o == nil || IsNil(o.Status) { + var ret CircuitStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetStatusOk() (*CircuitStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CircuitStatusValue and assigns it to the Status field. +func (o *PatchedWritableCircuitRequest) SetStatus(v CircuitStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableCircuitRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableCircuitRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableCircuitRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetInstallDate returns the InstallDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitRequest) GetInstallDate() string { + if o == nil || IsNil(o.InstallDate.Get()) { + var ret string + return ret + } + return *o.InstallDate.Get() +} + +// GetInstallDateOk returns a tuple with the InstallDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitRequest) GetInstallDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.InstallDate.Get(), o.InstallDate.IsSet() +} + +// HasInstallDate returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasInstallDate() bool { + if o != nil && o.InstallDate.IsSet() { + return true + } + + return false +} + +// SetInstallDate gets a reference to the given NullableString and assigns it to the InstallDate field. +func (o *PatchedWritableCircuitRequest) SetInstallDate(v string) { + o.InstallDate.Set(&v) +} + +// SetInstallDateNil sets the value for InstallDate to be an explicit nil +func (o *PatchedWritableCircuitRequest) SetInstallDateNil() { + o.InstallDate.Set(nil) +} + +// UnsetInstallDate ensures that no value is present for InstallDate, not even an explicit nil +func (o *PatchedWritableCircuitRequest) UnsetInstallDate() { + o.InstallDate.Unset() +} + +// GetTerminationDate returns the TerminationDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitRequest) GetTerminationDate() string { + if o == nil || IsNil(o.TerminationDate.Get()) { + var ret string + return ret + } + return *o.TerminationDate.Get() +} + +// GetTerminationDateOk returns a tuple with the TerminationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitRequest) GetTerminationDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TerminationDate.Get(), o.TerminationDate.IsSet() +} + +// HasTerminationDate returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasTerminationDate() bool { + if o != nil && o.TerminationDate.IsSet() { + return true + } + + return false +} + +// SetTerminationDate gets a reference to the given NullableString and assigns it to the TerminationDate field. +func (o *PatchedWritableCircuitRequest) SetTerminationDate(v string) { + o.TerminationDate.Set(&v) +} + +// SetTerminationDateNil sets the value for TerminationDate to be an explicit nil +func (o *PatchedWritableCircuitRequest) SetTerminationDateNil() { + o.TerminationDate.Set(nil) +} + +// UnsetTerminationDate ensures that no value is present for TerminationDate, not even an explicit nil +func (o *PatchedWritableCircuitRequest) UnsetTerminationDate() { + o.TerminationDate.Unset() +} + +// GetCommitRate returns the CommitRate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitRequest) GetCommitRate() int32 { + if o == nil || IsNil(o.CommitRate.Get()) { + var ret int32 + return ret + } + return *o.CommitRate.Get() +} + +// GetCommitRateOk returns a tuple with the CommitRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitRequest) GetCommitRateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CommitRate.Get(), o.CommitRate.IsSet() +} + +// HasCommitRate returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasCommitRate() bool { + if o != nil && o.CommitRate.IsSet() { + return true + } + + return false +} + +// SetCommitRate gets a reference to the given NullableInt32 and assigns it to the CommitRate field. +func (o *PatchedWritableCircuitRequest) SetCommitRate(v int32) { + o.CommitRate.Set(&v) +} + +// SetCommitRateNil sets the value for CommitRate to be an explicit nil +func (o *PatchedWritableCircuitRequest) SetCommitRateNil() { + o.CommitRate.Set(nil) +} + +// UnsetCommitRate ensures that no value is present for CommitRate, not even an explicit nil +func (o *PatchedWritableCircuitRequest) UnsetCommitRate() { + o.CommitRate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableCircuitRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableCircuitRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableCircuitRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableCircuitRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableCircuitRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableCircuitRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableCircuitRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableCircuitRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Cid) { + toSerialize["cid"] = o.Cid + } + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if o.ProviderAccount.IsSet() { + toSerialize["provider_account"] = o.ProviderAccount.Get() + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.InstallDate.IsSet() { + toSerialize["install_date"] = o.InstallDate.Get() + } + if o.TerminationDate.IsSet() { + toSerialize["termination_date"] = o.TerminationDate.Get() + } + if o.CommitRate.IsSet() { + toSerialize["commit_rate"] = o.CommitRate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableCircuitRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableCircuitRequest := _PatchedWritableCircuitRequest{} + + err = json.Unmarshal(data, &varPatchedWritableCircuitRequest) + + if err != nil { + return err + } + + *o = PatchedWritableCircuitRequest(varPatchedWritableCircuitRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cid") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_account") + delete(additionalProperties, "type") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "install_date") + delete(additionalProperties, "termination_date") + delete(additionalProperties, "commit_rate") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableCircuitRequest struct { + value *PatchedWritableCircuitRequest + isSet bool +} + +func (v NullablePatchedWritableCircuitRequest) Get() *PatchedWritableCircuitRequest { + return v.value +} + +func (v *NullablePatchedWritableCircuitRequest) Set(val *PatchedWritableCircuitRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCircuitRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCircuitRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCircuitRequest(val *PatchedWritableCircuitRequest) *NullablePatchedWritableCircuitRequest { + return &NullablePatchedWritableCircuitRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableCircuitRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCircuitRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_circuit_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_circuit_termination_request.go new file mode 100644 index 00000000..f6ba1700 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_circuit_termination_request.go @@ -0,0 +1,609 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableCircuitTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableCircuitTerminationRequest{} + +// PatchedWritableCircuitTerminationRequest Adds support for custom fields and tags. +type PatchedWritableCircuitTerminationRequest struct { + Circuit *int32 `json:"circuit,omitempty"` + TermSide *Termination `json:"term_side,omitempty"` + Site NullableInt32 `json:"site,omitempty"` + ProviderNetwork NullableInt32 `json:"provider_network,omitempty"` + // Physical circuit speed + PortSpeed NullableInt32 `json:"port_speed,omitempty"` + // Upstream speed, if different from port speed + UpstreamSpeed NullableInt32 `json:"upstream_speed,omitempty"` + // ID of the local cross-connect + XconnectId *string `json:"xconnect_id,omitempty"` + // Patch panel ID and port number(s) + PpInfo *string `json:"pp_info,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableCircuitTerminationRequest PatchedWritableCircuitTerminationRequest + +// NewPatchedWritableCircuitTerminationRequest instantiates a new PatchedWritableCircuitTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableCircuitTerminationRequest() *PatchedWritableCircuitTerminationRequest { + this := PatchedWritableCircuitTerminationRequest{} + return &this +} + +// NewPatchedWritableCircuitTerminationRequestWithDefaults instantiates a new PatchedWritableCircuitTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableCircuitTerminationRequestWithDefaults() *PatchedWritableCircuitTerminationRequest { + this := PatchedWritableCircuitTerminationRequest{} + return &this +} + +// GetCircuit returns the Circuit field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetCircuit() int32 { + if o == nil || IsNil(o.Circuit) { + var ret int32 + return ret + } + return *o.Circuit +} + +// GetCircuitOk returns a tuple with the Circuit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetCircuitOk() (*int32, bool) { + if o == nil || IsNil(o.Circuit) { + return nil, false + } + return o.Circuit, true +} + +// HasCircuit returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasCircuit() bool { + if o != nil && !IsNil(o.Circuit) { + return true + } + + return false +} + +// SetCircuit gets a reference to the given int32 and assigns it to the Circuit field. +func (o *PatchedWritableCircuitTerminationRequest) SetCircuit(v int32) { + o.Circuit = &v +} + +// GetTermSide returns the TermSide field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetTermSide() Termination { + if o == nil || IsNil(o.TermSide) { + var ret Termination + return ret + } + return *o.TermSide +} + +// GetTermSideOk returns a tuple with the TermSide field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetTermSideOk() (*Termination, bool) { + if o == nil || IsNil(o.TermSide) { + return nil, false + } + return o.TermSide, true +} + +// HasTermSide returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasTermSide() bool { + if o != nil && !IsNil(o.TermSide) { + return true + } + + return false +} + +// SetTermSide gets a reference to the given Termination and assigns it to the TermSide field. +func (o *PatchedWritableCircuitTerminationRequest) SetTermSide(v Termination) { + o.TermSide = &v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitTerminationRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitTerminationRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *PatchedWritableCircuitTerminationRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) UnsetSite() { + o.Site.Unset() +} + +// GetProviderNetwork returns the ProviderNetwork field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitTerminationRequest) GetProviderNetwork() int32 { + if o == nil || IsNil(o.ProviderNetwork.Get()) { + var ret int32 + return ret + } + return *o.ProviderNetwork.Get() +} + +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitTerminationRequest) GetProviderNetworkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() +} + +// HasProviderNetwork returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasProviderNetwork() bool { + if o != nil && o.ProviderNetwork.IsSet() { + return true + } + + return false +} + +// SetProviderNetwork gets a reference to the given NullableInt32 and assigns it to the ProviderNetwork field. +func (o *PatchedWritableCircuitTerminationRequest) SetProviderNetwork(v int32) { + o.ProviderNetwork.Set(&v) +} + +// SetProviderNetworkNil sets the value for ProviderNetwork to be an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) SetProviderNetworkNil() { + o.ProviderNetwork.Set(nil) +} + +// UnsetProviderNetwork ensures that no value is present for ProviderNetwork, not even an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) UnsetProviderNetwork() { + o.ProviderNetwork.Unset() +} + +// GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitTerminationRequest) GetPortSpeed() int32 { + if o == nil || IsNil(o.PortSpeed.Get()) { + var ret int32 + return ret + } + return *o.PortSpeed.Get() +} + +// GetPortSpeedOk returns a tuple with the PortSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitTerminationRequest) GetPortSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PortSpeed.Get(), o.PortSpeed.IsSet() +} + +// HasPortSpeed returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasPortSpeed() bool { + if o != nil && o.PortSpeed.IsSet() { + return true + } + + return false +} + +// SetPortSpeed gets a reference to the given NullableInt32 and assigns it to the PortSpeed field. +func (o *PatchedWritableCircuitTerminationRequest) SetPortSpeed(v int32) { + o.PortSpeed.Set(&v) +} + +// SetPortSpeedNil sets the value for PortSpeed to be an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) SetPortSpeedNil() { + o.PortSpeed.Set(nil) +} + +// UnsetPortSpeed ensures that no value is present for PortSpeed, not even an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) UnsetPortSpeed() { + o.PortSpeed.Unset() +} + +// GetUpstreamSpeed returns the UpstreamSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCircuitTerminationRequest) GetUpstreamSpeed() int32 { + if o == nil || IsNil(o.UpstreamSpeed.Get()) { + var ret int32 + return ret + } + return *o.UpstreamSpeed.Get() +} + +// GetUpstreamSpeedOk returns a tuple with the UpstreamSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCircuitTerminationRequest) GetUpstreamSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UpstreamSpeed.Get(), o.UpstreamSpeed.IsSet() +} + +// HasUpstreamSpeed returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasUpstreamSpeed() bool { + if o != nil && o.UpstreamSpeed.IsSet() { + return true + } + + return false +} + +// SetUpstreamSpeed gets a reference to the given NullableInt32 and assigns it to the UpstreamSpeed field. +func (o *PatchedWritableCircuitTerminationRequest) SetUpstreamSpeed(v int32) { + o.UpstreamSpeed.Set(&v) +} + +// SetUpstreamSpeedNil sets the value for UpstreamSpeed to be an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) SetUpstreamSpeedNil() { + o.UpstreamSpeed.Set(nil) +} + +// UnsetUpstreamSpeed ensures that no value is present for UpstreamSpeed, not even an explicit nil +func (o *PatchedWritableCircuitTerminationRequest) UnsetUpstreamSpeed() { + o.UpstreamSpeed.Unset() +} + +// GetXconnectId returns the XconnectId field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetXconnectId() string { + if o == nil || IsNil(o.XconnectId) { + var ret string + return ret + } + return *o.XconnectId +} + +// GetXconnectIdOk returns a tuple with the XconnectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetXconnectIdOk() (*string, bool) { + if o == nil || IsNil(o.XconnectId) { + return nil, false + } + return o.XconnectId, true +} + +// HasXconnectId returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasXconnectId() bool { + if o != nil && !IsNil(o.XconnectId) { + return true + } + + return false +} + +// SetXconnectId gets a reference to the given string and assigns it to the XconnectId field. +func (o *PatchedWritableCircuitTerminationRequest) SetXconnectId(v string) { + o.XconnectId = &v +} + +// GetPpInfo returns the PpInfo field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetPpInfo() string { + if o == nil || IsNil(o.PpInfo) { + var ret string + return ret + } + return *o.PpInfo +} + +// GetPpInfoOk returns a tuple with the PpInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetPpInfoOk() (*string, bool) { + if o == nil || IsNil(o.PpInfo) { + return nil, false + } + return o.PpInfo, true +} + +// HasPpInfo returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasPpInfo() bool { + if o != nil && !IsNil(o.PpInfo) { + return true + } + + return false +} + +// SetPpInfo gets a reference to the given string and assigns it to the PpInfo field. +func (o *PatchedWritableCircuitTerminationRequest) SetPpInfo(v string) { + o.PpInfo = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableCircuitTerminationRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritableCircuitTerminationRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableCircuitTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableCircuitTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCircuitTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableCircuitTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableCircuitTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableCircuitTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableCircuitTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Circuit) { + toSerialize["circuit"] = o.Circuit + } + if !IsNil(o.TermSide) { + toSerialize["term_side"] = o.TermSide + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.ProviderNetwork.IsSet() { + toSerialize["provider_network"] = o.ProviderNetwork.Get() + } + if o.PortSpeed.IsSet() { + toSerialize["port_speed"] = o.PortSpeed.Get() + } + if o.UpstreamSpeed.IsSet() { + toSerialize["upstream_speed"] = o.UpstreamSpeed.Get() + } + if !IsNil(o.XconnectId) { + toSerialize["xconnect_id"] = o.XconnectId + } + if !IsNil(o.PpInfo) { + toSerialize["pp_info"] = o.PpInfo + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableCircuitTerminationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableCircuitTerminationRequest := _PatchedWritableCircuitTerminationRequest{} + + err = json.Unmarshal(data, &varPatchedWritableCircuitTerminationRequest) + + if err != nil { + return err + } + + *o = PatchedWritableCircuitTerminationRequest(varPatchedWritableCircuitTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "circuit") + delete(additionalProperties, "term_side") + delete(additionalProperties, "site") + delete(additionalProperties, "provider_network") + delete(additionalProperties, "port_speed") + delete(additionalProperties, "upstream_speed") + delete(additionalProperties, "xconnect_id") + delete(additionalProperties, "pp_info") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableCircuitTerminationRequest struct { + value *PatchedWritableCircuitTerminationRequest + isSet bool +} + +func (v NullablePatchedWritableCircuitTerminationRequest) Get() *PatchedWritableCircuitTerminationRequest { + return v.value +} + +func (v *NullablePatchedWritableCircuitTerminationRequest) Set(val *PatchedWritableCircuitTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCircuitTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCircuitTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCircuitTerminationRequest(val *PatchedWritableCircuitTerminationRequest) *NullablePatchedWritableCircuitTerminationRequest { + return &NullablePatchedWritableCircuitTerminationRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableCircuitTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCircuitTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_cluster_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_cluster_request.go new file mode 100644 index 00000000..4efb8d7d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_cluster_request.go @@ -0,0 +1,519 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableClusterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableClusterRequest{} + +// PatchedWritableClusterRequest Adds support for custom fields and tags. +type PatchedWritableClusterRequest struct { + Name *string `json:"name,omitempty"` + Type *int32 `json:"type,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Status *ClusterStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Site NullableInt32 `json:"site,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableClusterRequest PatchedWritableClusterRequest + +// NewPatchedWritableClusterRequest instantiates a new PatchedWritableClusterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableClusterRequest() *PatchedWritableClusterRequest { + this := PatchedWritableClusterRequest{} + return &this +} + +// NewPatchedWritableClusterRequestWithDefaults instantiates a new PatchedWritableClusterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableClusterRequestWithDefaults() *PatchedWritableClusterRequest { + this := PatchedWritableClusterRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableClusterRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableClusterRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableClusterRequest) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableClusterRequest) GetType() int32 { + if o == nil || IsNil(o.Type) { + var ret int32 + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableClusterRequest) GetTypeOk() (*int32, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given int32 and assigns it to the Type field. +func (o *PatchedWritableClusterRequest) SetType(v int32) { + o.Type = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableClusterRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableClusterRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *PatchedWritableClusterRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedWritableClusterRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedWritableClusterRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableClusterRequest) GetStatus() ClusterStatusValue { + if o == nil || IsNil(o.Status) { + var ret ClusterStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableClusterRequest) GetStatusOk() (*ClusterStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ClusterStatusValue and assigns it to the Status field. +func (o *PatchedWritableClusterRequest) SetStatus(v ClusterStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableClusterRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableClusterRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableClusterRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableClusterRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableClusterRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableClusterRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableClusterRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *PatchedWritableClusterRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *PatchedWritableClusterRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *PatchedWritableClusterRequest) UnsetSite() { + o.Site.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableClusterRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableClusterRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableClusterRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableClusterRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableClusterRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableClusterRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableClusterRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableClusterRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableClusterRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableClusterRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableClusterRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableClusterRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableClusterRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableClusterRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableClusterRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableClusterRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableClusterRequest := _PatchedWritableClusterRequest{} + + err = json.Unmarshal(data, &varPatchedWritableClusterRequest) + + if err != nil { + return err + } + + *o = PatchedWritableClusterRequest(varPatchedWritableClusterRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "site") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableClusterRequest struct { + value *PatchedWritableClusterRequest + isSet bool +} + +func (v NullablePatchedWritableClusterRequest) Get() *PatchedWritableClusterRequest { + return v.value +} + +func (v *NullablePatchedWritableClusterRequest) Set(val *PatchedWritableClusterRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableClusterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableClusterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableClusterRequest(val *PatchedWritableClusterRequest) *NullablePatchedWritableClusterRequest { + return &NullablePatchedWritableClusterRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableClusterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableClusterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_config_context_request.go new file mode 100644 index 00000000..e8412605 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_config_context_request.go @@ -0,0 +1,832 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableConfigContextRequest{} + +// PatchedWritableConfigContextRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableConfigContextRequest struct { + Name *string `json:"name,omitempty"` + Weight *int32 `json:"weight,omitempty"` + Description *string `json:"description,omitempty"` + IsActive *bool `json:"is_active,omitempty"` + Regions []int32 `json:"regions,omitempty"` + SiteGroups []int32 `json:"site_groups,omitempty"` + Sites []int32 `json:"sites,omitempty"` + Locations []int32 `json:"locations,omitempty"` + DeviceTypes []int32 `json:"device_types,omitempty"` + Roles []int32 `json:"roles,omitempty"` + Platforms []int32 `json:"platforms,omitempty"` + ClusterTypes []int32 `json:"cluster_types,omitempty"` + ClusterGroups []int32 `json:"cluster_groups,omitempty"` + Clusters []int32 `json:"clusters,omitempty"` + TenantGroups []int32 `json:"tenant_groups,omitempty"` + Tenants []int32 `json:"tenants,omitempty"` + Tags []string `json:"tags,omitempty"` + // Remote data source + DataSource NullableInt32 `json:"data_source,omitempty"` + Data interface{} `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableConfigContextRequest PatchedWritableConfigContextRequest + +// NewPatchedWritableConfigContextRequest instantiates a new PatchedWritableConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableConfigContextRequest() *PatchedWritableConfigContextRequest { + this := PatchedWritableConfigContextRequest{} + return &this +} + +// NewPatchedWritableConfigContextRequestWithDefaults instantiates a new PatchedWritableConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableConfigContextRequestWithDefaults() *PatchedWritableConfigContextRequest { + this := PatchedWritableConfigContextRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableConfigContextRequest) SetName(v string) { + o.Name = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *PatchedWritableConfigContextRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *PatchedWritableConfigContextRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetRegions() []int32 { + if o == nil || IsNil(o.Regions) { + var ret []int32 + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetRegionsOk() ([]int32, bool) { + if o == nil || IsNil(o.Regions) { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasRegions() bool { + if o != nil && !IsNil(o.Regions) { + return true + } + + return false +} + +// SetRegions gets a reference to the given []int32 and assigns it to the Regions field. +func (o *PatchedWritableConfigContextRequest) SetRegions(v []int32) { + o.Regions = v +} + +// GetSiteGroups returns the SiteGroups field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetSiteGroups() []int32 { + if o == nil || IsNil(o.SiteGroups) { + var ret []int32 + return ret + } + return o.SiteGroups +} + +// GetSiteGroupsOk returns a tuple with the SiteGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetSiteGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.SiteGroups) { + return nil, false + } + return o.SiteGroups, true +} + +// HasSiteGroups returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasSiteGroups() bool { + if o != nil && !IsNil(o.SiteGroups) { + return true + } + + return false +} + +// SetSiteGroups gets a reference to the given []int32 and assigns it to the SiteGroups field. +func (o *PatchedWritableConfigContextRequest) SetSiteGroups(v []int32) { + o.SiteGroups = v +} + +// GetSites returns the Sites field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetSites() []int32 { + if o == nil || IsNil(o.Sites) { + var ret []int32 + return ret + } + return o.Sites +} + +// GetSitesOk returns a tuple with the Sites field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetSitesOk() ([]int32, bool) { + if o == nil || IsNil(o.Sites) { + return nil, false + } + return o.Sites, true +} + +// HasSites returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasSites() bool { + if o != nil && !IsNil(o.Sites) { + return true + } + + return false +} + +// SetSites gets a reference to the given []int32 and assigns it to the Sites field. +func (o *PatchedWritableConfigContextRequest) SetSites(v []int32) { + o.Sites = v +} + +// GetLocations returns the Locations field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetLocations() []int32 { + if o == nil || IsNil(o.Locations) { + var ret []int32 + return ret + } + return o.Locations +} + +// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetLocationsOk() ([]int32, bool) { + if o == nil || IsNil(o.Locations) { + return nil, false + } + return o.Locations, true +} + +// HasLocations returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasLocations() bool { + if o != nil && !IsNil(o.Locations) { + return true + } + + return false +} + +// SetLocations gets a reference to the given []int32 and assigns it to the Locations field. +func (o *PatchedWritableConfigContextRequest) SetLocations(v []int32) { + o.Locations = v +} + +// GetDeviceTypes returns the DeviceTypes field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetDeviceTypes() []int32 { + if o == nil || IsNil(o.DeviceTypes) { + var ret []int32 + return ret + } + return o.DeviceTypes +} + +// GetDeviceTypesOk returns a tuple with the DeviceTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetDeviceTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.DeviceTypes) { + return nil, false + } + return o.DeviceTypes, true +} + +// HasDeviceTypes returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasDeviceTypes() bool { + if o != nil && !IsNil(o.DeviceTypes) { + return true + } + + return false +} + +// SetDeviceTypes gets a reference to the given []int32 and assigns it to the DeviceTypes field. +func (o *PatchedWritableConfigContextRequest) SetDeviceTypes(v []int32) { + o.DeviceTypes = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetRoles() []int32 { + if o == nil || IsNil(o.Roles) { + var ret []int32 + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetRolesOk() ([]int32, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []int32 and assigns it to the Roles field. +func (o *PatchedWritableConfigContextRequest) SetRoles(v []int32) { + o.Roles = v +} + +// GetPlatforms returns the Platforms field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetPlatforms() []int32 { + if o == nil || IsNil(o.Platforms) { + var ret []int32 + return ret + } + return o.Platforms +} + +// GetPlatformsOk returns a tuple with the Platforms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetPlatformsOk() ([]int32, bool) { + if o == nil || IsNil(o.Platforms) { + return nil, false + } + return o.Platforms, true +} + +// HasPlatforms returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasPlatforms() bool { + if o != nil && !IsNil(o.Platforms) { + return true + } + + return false +} + +// SetPlatforms gets a reference to the given []int32 and assigns it to the Platforms field. +func (o *PatchedWritableConfigContextRequest) SetPlatforms(v []int32) { + o.Platforms = v +} + +// GetClusterTypes returns the ClusterTypes field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetClusterTypes() []int32 { + if o == nil || IsNil(o.ClusterTypes) { + var ret []int32 + return ret + } + return o.ClusterTypes +} + +// GetClusterTypesOk returns a tuple with the ClusterTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetClusterTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterTypes) { + return nil, false + } + return o.ClusterTypes, true +} + +// HasClusterTypes returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasClusterTypes() bool { + if o != nil && !IsNil(o.ClusterTypes) { + return true + } + + return false +} + +// SetClusterTypes gets a reference to the given []int32 and assigns it to the ClusterTypes field. +func (o *PatchedWritableConfigContextRequest) SetClusterTypes(v []int32) { + o.ClusterTypes = v +} + +// GetClusterGroups returns the ClusterGroups field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetClusterGroups() []int32 { + if o == nil || IsNil(o.ClusterGroups) { + var ret []int32 + return ret + } + return o.ClusterGroups +} + +// GetClusterGroupsOk returns a tuple with the ClusterGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetClusterGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterGroups) { + return nil, false + } + return o.ClusterGroups, true +} + +// HasClusterGroups returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasClusterGroups() bool { + if o != nil && !IsNil(o.ClusterGroups) { + return true + } + + return false +} + +// SetClusterGroups gets a reference to the given []int32 and assigns it to the ClusterGroups field. +func (o *PatchedWritableConfigContextRequest) SetClusterGroups(v []int32) { + o.ClusterGroups = v +} + +// GetClusters returns the Clusters field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetClusters() []int32 { + if o == nil || IsNil(o.Clusters) { + var ret []int32 + return ret + } + return o.Clusters +} + +// GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetClustersOk() ([]int32, bool) { + if o == nil || IsNil(o.Clusters) { + return nil, false + } + return o.Clusters, true +} + +// HasClusters returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasClusters() bool { + if o != nil && !IsNil(o.Clusters) { + return true + } + + return false +} + +// SetClusters gets a reference to the given []int32 and assigns it to the Clusters field. +func (o *PatchedWritableConfigContextRequest) SetClusters(v []int32) { + o.Clusters = v +} + +// GetTenantGroups returns the TenantGroups field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetTenantGroups() []int32 { + if o == nil || IsNil(o.TenantGroups) { + var ret []int32 + return ret + } + return o.TenantGroups +} + +// GetTenantGroupsOk returns a tuple with the TenantGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetTenantGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.TenantGroups) { + return nil, false + } + return o.TenantGroups, true +} + +// HasTenantGroups returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasTenantGroups() bool { + if o != nil && !IsNil(o.TenantGroups) { + return true + } + + return false +} + +// SetTenantGroups gets a reference to the given []int32 and assigns it to the TenantGroups field. +func (o *PatchedWritableConfigContextRequest) SetTenantGroups(v []int32) { + o.TenantGroups = v +} + +// GetTenants returns the Tenants field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetTenants() []int32 { + if o == nil || IsNil(o.Tenants) { + var ret []int32 + return ret + } + return o.Tenants +} + +// GetTenantsOk returns a tuple with the Tenants field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetTenantsOk() ([]int32, bool) { + if o == nil || IsNil(o.Tenants) { + return nil, false + } + return o.Tenants, true +} + +// HasTenants returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasTenants() bool { + if o != nil && !IsNil(o.Tenants) { + return true + } + + return false +} + +// SetTenants gets a reference to the given []int32 and assigns it to the Tenants field. +func (o *PatchedWritableConfigContextRequest) SetTenants(v []int32) { + o.Tenants = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableConfigContextRequest) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigContextRequest) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *PatchedWritableConfigContextRequest) SetTags(v []string) { + o.Tags = v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConfigContextRequest) GetDataSource() int32 { + if o == nil || IsNil(o.DataSource.Get()) { + var ret int32 + return ret + } + return *o.DataSource.Get() +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConfigContextRequest) GetDataSourceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataSource.Get(), o.DataSource.IsSet() +} + +// HasDataSource returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasDataSource() bool { + if o != nil && o.DataSource.IsSet() { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NullableInt32 and assigns it to the DataSource field. +func (o *PatchedWritableConfigContextRequest) SetDataSource(v int32) { + o.DataSource.Set(&v) +} + +// SetDataSourceNil sets the value for DataSource to be an explicit nil +func (o *PatchedWritableConfigContextRequest) SetDataSourceNil() { + o.DataSource.Set(nil) +} + +// UnsetDataSource ensures that no value is present for DataSource, not even an explicit nil +func (o *PatchedWritableConfigContextRequest) UnsetDataSource() { + o.DataSource.Unset() +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConfigContextRequest) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConfigContextRequest) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *PatchedWritableConfigContextRequest) HasData() bool { + if o != nil && IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *PatchedWritableConfigContextRequest) SetData(v interface{}) { + o.Data = v +} + +func (o PatchedWritableConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.Regions) { + toSerialize["regions"] = o.Regions + } + if !IsNil(o.SiteGroups) { + toSerialize["site_groups"] = o.SiteGroups + } + if !IsNil(o.Sites) { + toSerialize["sites"] = o.Sites + } + if !IsNil(o.Locations) { + toSerialize["locations"] = o.Locations + } + if !IsNil(o.DeviceTypes) { + toSerialize["device_types"] = o.DeviceTypes + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Platforms) { + toSerialize["platforms"] = o.Platforms + } + if !IsNil(o.ClusterTypes) { + toSerialize["cluster_types"] = o.ClusterTypes + } + if !IsNil(o.ClusterGroups) { + toSerialize["cluster_groups"] = o.ClusterGroups + } + if !IsNil(o.Clusters) { + toSerialize["clusters"] = o.Clusters + } + if !IsNil(o.TenantGroups) { + toSerialize["tenant_groups"] = o.TenantGroups + } + if !IsNil(o.Tenants) { + toSerialize["tenants"] = o.Tenants + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if o.DataSource.IsSet() { + toSerialize["data_source"] = o.DataSource.Get() + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableConfigContextRequest := _PatchedWritableConfigContextRequest{} + + err = json.Unmarshal(data, &varPatchedWritableConfigContextRequest) + + if err != nil { + return err + } + + *o = PatchedWritableConfigContextRequest(varPatchedWritableConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "weight") + delete(additionalProperties, "description") + delete(additionalProperties, "is_active") + delete(additionalProperties, "regions") + delete(additionalProperties, "site_groups") + delete(additionalProperties, "sites") + delete(additionalProperties, "locations") + delete(additionalProperties, "device_types") + delete(additionalProperties, "roles") + delete(additionalProperties, "platforms") + delete(additionalProperties, "cluster_types") + delete(additionalProperties, "cluster_groups") + delete(additionalProperties, "clusters") + delete(additionalProperties, "tenant_groups") + delete(additionalProperties, "tenants") + delete(additionalProperties, "tags") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableConfigContextRequest struct { + value *PatchedWritableConfigContextRequest + isSet bool +} + +func (v NullablePatchedWritableConfigContextRequest) Get() *PatchedWritableConfigContextRequest { + return v.value +} + +func (v *NullablePatchedWritableConfigContextRequest) Set(val *PatchedWritableConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConfigContextRequest(val *PatchedWritableConfigContextRequest) *NullablePatchedWritableConfigContextRequest { + return &NullablePatchedWritableConfigContextRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_config_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_config_template_request.go new file mode 100644 index 00000000..08136f37 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_config_template_request.go @@ -0,0 +1,401 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableConfigTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableConfigTemplateRequest{} + +// PatchedWritableConfigTemplateRequest Introduces support for Tag assignment. Adds `tags` serialization, and handles tag assignment on create() and update(). +type PatchedWritableConfigTemplateRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + // Any additional parameters to pass when constructing the Jinja2 environment. + EnvironmentParams interface{} `json:"environment_params,omitempty"` + // Jinja2 template code. + TemplateCode *string `json:"template_code,omitempty"` + // Remote data source + DataSource NullableInt32 `json:"data_source,omitempty"` + DataFile NullableInt32 `json:"data_file,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableConfigTemplateRequest PatchedWritableConfigTemplateRequest + +// NewPatchedWritableConfigTemplateRequest instantiates a new PatchedWritableConfigTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableConfigTemplateRequest() *PatchedWritableConfigTemplateRequest { + this := PatchedWritableConfigTemplateRequest{} + return &this +} + +// NewPatchedWritableConfigTemplateRequestWithDefaults instantiates a new PatchedWritableConfigTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableConfigTemplateRequestWithDefaults() *PatchedWritableConfigTemplateRequest { + this := PatchedWritableConfigTemplateRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableConfigTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableConfigTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableConfigTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableConfigTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableConfigTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableConfigTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEnvironmentParams returns the EnvironmentParams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConfigTemplateRequest) GetEnvironmentParams() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.EnvironmentParams +} + +// GetEnvironmentParamsOk returns a tuple with the EnvironmentParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConfigTemplateRequest) GetEnvironmentParamsOk() (*interface{}, bool) { + if o == nil || IsNil(o.EnvironmentParams) { + return nil, false + } + return &o.EnvironmentParams, true +} + +// HasEnvironmentParams returns a boolean if a field has been set. +func (o *PatchedWritableConfigTemplateRequest) HasEnvironmentParams() bool { + if o != nil && IsNil(o.EnvironmentParams) { + return true + } + + return false +} + +// SetEnvironmentParams gets a reference to the given interface{} and assigns it to the EnvironmentParams field. +func (o *PatchedWritableConfigTemplateRequest) SetEnvironmentParams(v interface{}) { + o.EnvironmentParams = v +} + +// GetTemplateCode returns the TemplateCode field value if set, zero value otherwise. +func (o *PatchedWritableConfigTemplateRequest) GetTemplateCode() string { + if o == nil || IsNil(o.TemplateCode) { + var ret string + return ret + } + return *o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigTemplateRequest) GetTemplateCodeOk() (*string, bool) { + if o == nil || IsNil(o.TemplateCode) { + return nil, false + } + return o.TemplateCode, true +} + +// HasTemplateCode returns a boolean if a field has been set. +func (o *PatchedWritableConfigTemplateRequest) HasTemplateCode() bool { + if o != nil && !IsNil(o.TemplateCode) { + return true + } + + return false +} + +// SetTemplateCode gets a reference to the given string and assigns it to the TemplateCode field. +func (o *PatchedWritableConfigTemplateRequest) SetTemplateCode(v string) { + o.TemplateCode = &v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConfigTemplateRequest) GetDataSource() int32 { + if o == nil || IsNil(o.DataSource.Get()) { + var ret int32 + return ret + } + return *o.DataSource.Get() +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConfigTemplateRequest) GetDataSourceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataSource.Get(), o.DataSource.IsSet() +} + +// HasDataSource returns a boolean if a field has been set. +func (o *PatchedWritableConfigTemplateRequest) HasDataSource() bool { + if o != nil && o.DataSource.IsSet() { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NullableInt32 and assigns it to the DataSource field. +func (o *PatchedWritableConfigTemplateRequest) SetDataSource(v int32) { + o.DataSource.Set(&v) +} + +// SetDataSourceNil sets the value for DataSource to be an explicit nil +func (o *PatchedWritableConfigTemplateRequest) SetDataSourceNil() { + o.DataSource.Set(nil) +} + +// UnsetDataSource ensures that no value is present for DataSource, not even an explicit nil +func (o *PatchedWritableConfigTemplateRequest) UnsetDataSource() { + o.DataSource.Unset() +} + +// GetDataFile returns the DataFile field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConfigTemplateRequest) GetDataFile() int32 { + if o == nil || IsNil(o.DataFile.Get()) { + var ret int32 + return ret + } + return *o.DataFile.Get() +} + +// GetDataFileOk returns a tuple with the DataFile field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConfigTemplateRequest) GetDataFileOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataFile.Get(), o.DataFile.IsSet() +} + +// HasDataFile returns a boolean if a field has been set. +func (o *PatchedWritableConfigTemplateRequest) HasDataFile() bool { + if o != nil && o.DataFile.IsSet() { + return true + } + + return false +} + +// SetDataFile gets a reference to the given NullableInt32 and assigns it to the DataFile field. +func (o *PatchedWritableConfigTemplateRequest) SetDataFile(v int32) { + o.DataFile.Set(&v) +} + +// SetDataFileNil sets the value for DataFile to be an explicit nil +func (o *PatchedWritableConfigTemplateRequest) SetDataFileNil() { + o.DataFile.Set(nil) +} + +// UnsetDataFile ensures that no value is present for DataFile, not even an explicit nil +func (o *PatchedWritableConfigTemplateRequest) UnsetDataFile() { + o.DataFile.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableConfigTemplateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConfigTemplateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableConfigTemplateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableConfigTemplateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o PatchedWritableConfigTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableConfigTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.EnvironmentParams != nil { + toSerialize["environment_params"] = o.EnvironmentParams + } + if !IsNil(o.TemplateCode) { + toSerialize["template_code"] = o.TemplateCode + } + if o.DataSource.IsSet() { + toSerialize["data_source"] = o.DataSource.Get() + } + if o.DataFile.IsSet() { + toSerialize["data_file"] = o.DataFile.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableConfigTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableConfigTemplateRequest := _PatchedWritableConfigTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableConfigTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableConfigTemplateRequest(varPatchedWritableConfigTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "environment_params") + delete(additionalProperties, "template_code") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data_file") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableConfigTemplateRequest struct { + value *PatchedWritableConfigTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableConfigTemplateRequest) Get() *PatchedWritableConfigTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableConfigTemplateRequest) Set(val *PatchedWritableConfigTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConfigTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConfigTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConfigTemplateRequest(val *PatchedWritableConfigTemplateRequest) *NullablePatchedWritableConfigTemplateRequest { + return &NullablePatchedWritableConfigTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableConfigTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConfigTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request.go new file mode 100644 index 00000000..7f81e011 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request.go @@ -0,0 +1,510 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableConsolePortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableConsolePortRequest{} + +// PatchedWritableConsolePortRequest Adds support for custom fields and tags. +type PatchedWritableConsolePortRequest struct { + Device *int32 `json:"device,omitempty"` + Module NullableInt32 `json:"module,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritableConsolePortRequestType `json:"type,omitempty"` + Speed NullablePatchedWritableConsolePortRequestSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableConsolePortRequest PatchedWritableConsolePortRequest + +// NewPatchedWritableConsolePortRequest instantiates a new PatchedWritableConsolePortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableConsolePortRequest() *PatchedWritableConsolePortRequest { + this := PatchedWritableConsolePortRequest{} + return &this +} + +// NewPatchedWritableConsolePortRequestWithDefaults instantiates a new PatchedWritableConsolePortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableConsolePortRequestWithDefaults() *PatchedWritableConsolePortRequest { + this := PatchedWritableConsolePortRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableConsolePortRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsolePortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsolePortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *PatchedWritableConsolePortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PatchedWritableConsolePortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PatchedWritableConsolePortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableConsolePortRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableConsolePortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetType() PatchedWritableConsolePortRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableConsolePortRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetTypeOk() (*PatchedWritableConsolePortRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableConsolePortRequestType and assigns it to the Type field. +func (o *PatchedWritableConsolePortRequest) SetType(v PatchedWritableConsolePortRequestType) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsolePortRequest) GetSpeed() PatchedWritableConsolePortRequestSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret PatchedWritableConsolePortRequestSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsolePortRequest) GetSpeedOk() (*PatchedWritableConsolePortRequestSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullablePatchedWritableConsolePortRequestSpeed and assigns it to the Speed field. +func (o *PatchedWritableConsolePortRequest) SetSpeed(v PatchedWritableConsolePortRequestSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *PatchedWritableConsolePortRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *PatchedWritableConsolePortRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableConsolePortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritableConsolePortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableConsolePortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableConsolePortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableConsolePortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableConsolePortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableConsolePortRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableConsolePortRequest := _PatchedWritableConsolePortRequest{} + + err = json.Unmarshal(data, &varPatchedWritableConsolePortRequest) + + if err != nil { + return err + } + + *o = PatchedWritableConsolePortRequest(varPatchedWritableConsolePortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableConsolePortRequest struct { + value *PatchedWritableConsolePortRequest + isSet bool +} + +func (v NullablePatchedWritableConsolePortRequest) Get() *PatchedWritableConsolePortRequest { + return v.value +} + +func (v *NullablePatchedWritableConsolePortRequest) Set(val *PatchedWritableConsolePortRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConsolePortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConsolePortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConsolePortRequest(val *PatchedWritableConsolePortRequest) *NullablePatchedWritableConsolePortRequest { + return &NullablePatchedWritableConsolePortRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableConsolePortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConsolePortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request_speed.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request_speed.go new file mode 100644 index 00000000..a628c19a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request_speed.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableConsolePortRequestSpeed Port speed in bits per second * `1200` - 1200 bps * `2400` - 2400 bps * `4800` - 4800 bps * `9600` - 9600 bps * `19200` - 19.2 kbps * `38400` - 38.4 kbps * `57600` - 57.6 kbps * `115200` - 115.2 kbps +type PatchedWritableConsolePortRequestSpeed int32 + +// List of PatchedWritableConsolePortRequest_speed +const ( + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__1200 PatchedWritableConsolePortRequestSpeed = 1200 + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__2400 PatchedWritableConsolePortRequestSpeed = 2400 + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__4800 PatchedWritableConsolePortRequestSpeed = 4800 + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__9600 PatchedWritableConsolePortRequestSpeed = 9600 + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__19200 PatchedWritableConsolePortRequestSpeed = 19200 + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__38400 PatchedWritableConsolePortRequestSpeed = 38400 + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__57600 PatchedWritableConsolePortRequestSpeed = 57600 + PATCHEDWRITABLECONSOLEPORTREQUESTSPEED__115200 PatchedWritableConsolePortRequestSpeed = 115200 +) + +// All allowed values of PatchedWritableConsolePortRequestSpeed enum +var AllowedPatchedWritableConsolePortRequestSpeedEnumValues = []PatchedWritableConsolePortRequestSpeed{ + 1200, + 2400, + 4800, + 9600, + 19200, + 38400, + 57600, + 115200, +} + +func (v *PatchedWritableConsolePortRequestSpeed) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableConsolePortRequestSpeed(value) + for _, existing := range AllowedPatchedWritableConsolePortRequestSpeedEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableConsolePortRequestSpeed", value) +} + +// NewPatchedWritableConsolePortRequestSpeedFromValue returns a pointer to a valid PatchedWritableConsolePortRequestSpeed +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableConsolePortRequestSpeedFromValue(v int32) (*PatchedWritableConsolePortRequestSpeed, error) { + ev := PatchedWritableConsolePortRequestSpeed(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableConsolePortRequestSpeed: valid values are %v", v, AllowedPatchedWritableConsolePortRequestSpeedEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableConsolePortRequestSpeed) IsValid() bool { + for _, existing := range AllowedPatchedWritableConsolePortRequestSpeedEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableConsolePortRequest_speed value +func (v PatchedWritableConsolePortRequestSpeed) Ptr() *PatchedWritableConsolePortRequestSpeed { + return &v +} + +type NullablePatchedWritableConsolePortRequestSpeed struct { + value *PatchedWritableConsolePortRequestSpeed + isSet bool +} + +func (v NullablePatchedWritableConsolePortRequestSpeed) Get() *PatchedWritableConsolePortRequestSpeed { + return v.value +} + +func (v *NullablePatchedWritableConsolePortRequestSpeed) Set(val *PatchedWritableConsolePortRequestSpeed) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConsolePortRequestSpeed) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConsolePortRequestSpeed) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConsolePortRequestSpeed(val *PatchedWritableConsolePortRequestSpeed) *NullablePatchedWritableConsolePortRequestSpeed { + return &NullablePatchedWritableConsolePortRequestSpeed{value: val, isSet: true} +} + +func (v NullablePatchedWritableConsolePortRequestSpeed) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConsolePortRequestSpeed) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request_type.go new file mode 100644 index 00000000..019b0962 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_request_type.go @@ -0,0 +1,138 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableConsolePortRequestType Physical port type * `de-9` - DE-9 * `db-25` - DB-25 * `rj-11` - RJ-11 * `rj-12` - RJ-12 * `rj-45` - RJ-45 * `mini-din-8` - Mini-DIN 8 * `usb-a` - USB Type A * `usb-b` - USB Type B * `usb-c` - USB Type C * `usb-mini-a` - USB Mini A * `usb-mini-b` - USB Mini B * `usb-micro-a` - USB Micro A * `usb-micro-b` - USB Micro B * `usb-micro-ab` - USB Micro AB * `other` - Other +type PatchedWritableConsolePortRequestType string + +// List of PatchedWritableConsolePortRequest_type +const ( + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_DE_9 PatchedWritableConsolePortRequestType = "de-9" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_DB_25 PatchedWritableConsolePortRequestType = "db-25" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_RJ_11 PatchedWritableConsolePortRequestType = "rj-11" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_RJ_12 PatchedWritableConsolePortRequestType = "rj-12" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_RJ_45 PatchedWritableConsolePortRequestType = "rj-45" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_MINI_DIN_8 PatchedWritableConsolePortRequestType = "mini-din-8" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_A PatchedWritableConsolePortRequestType = "usb-a" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_B PatchedWritableConsolePortRequestType = "usb-b" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_C PatchedWritableConsolePortRequestType = "usb-c" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_MINI_A PatchedWritableConsolePortRequestType = "usb-mini-a" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_MINI_B PatchedWritableConsolePortRequestType = "usb-mini-b" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_MICRO_A PatchedWritableConsolePortRequestType = "usb-micro-a" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_MICRO_B PatchedWritableConsolePortRequestType = "usb-micro-b" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_USB_MICRO_AB PatchedWritableConsolePortRequestType = "usb-micro-ab" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_OTHER PatchedWritableConsolePortRequestType = "other" + PATCHEDWRITABLECONSOLEPORTREQUESTTYPE_EMPTY PatchedWritableConsolePortRequestType = "" +) + +// All allowed values of PatchedWritableConsolePortRequestType enum +var AllowedPatchedWritableConsolePortRequestTypeEnumValues = []PatchedWritableConsolePortRequestType{ + "de-9", + "db-25", + "rj-11", + "rj-12", + "rj-45", + "mini-din-8", + "usb-a", + "usb-b", + "usb-c", + "usb-mini-a", + "usb-mini-b", + "usb-micro-a", + "usb-micro-b", + "usb-micro-ab", + "other", + "", +} + +func (v *PatchedWritableConsolePortRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableConsolePortRequestType(value) + for _, existing := range AllowedPatchedWritableConsolePortRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableConsolePortRequestType", value) +} + +// NewPatchedWritableConsolePortRequestTypeFromValue returns a pointer to a valid PatchedWritableConsolePortRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableConsolePortRequestTypeFromValue(v string) (*PatchedWritableConsolePortRequestType, error) { + ev := PatchedWritableConsolePortRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableConsolePortRequestType: valid values are %v", v, AllowedPatchedWritableConsolePortRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableConsolePortRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritableConsolePortRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableConsolePortRequest_type value +func (v PatchedWritableConsolePortRequestType) Ptr() *PatchedWritableConsolePortRequestType { + return &v +} + +type NullablePatchedWritableConsolePortRequestType struct { + value *PatchedWritableConsolePortRequestType + isSet bool +} + +func (v NullablePatchedWritableConsolePortRequestType) Get() *PatchedWritableConsolePortRequestType { + return v.value +} + +func (v *NullablePatchedWritableConsolePortRequestType) Set(val *PatchedWritableConsolePortRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConsolePortRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConsolePortRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConsolePortRequestType(val *PatchedWritableConsolePortRequestType) *NullablePatchedWritableConsolePortRequestType { + return &NullablePatchedWritableConsolePortRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritableConsolePortRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConsolePortRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_template_request.go new file mode 100644 index 00000000..be5f8e86 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_port_template_request.go @@ -0,0 +1,362 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableConsolePortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableConsolePortTemplateRequest{} + +// PatchedWritableConsolePortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableConsolePortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableConsolePortTemplateRequest PatchedWritableConsolePortTemplateRequest + +// NewPatchedWritableConsolePortTemplateRequest instantiates a new PatchedWritableConsolePortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableConsolePortTemplateRequest() *PatchedWritableConsolePortTemplateRequest { + this := PatchedWritableConsolePortTemplateRequest{} + return &this +} + +// NewPatchedWritableConsolePortTemplateRequestWithDefaults instantiates a new PatchedWritableConsolePortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableConsolePortTemplateRequestWithDefaults() *PatchedWritableConsolePortTemplateRequest { + this := PatchedWritableConsolePortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsolePortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsolePortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *PatchedWritableConsolePortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PatchedWritableConsolePortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PatchedWritableConsolePortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsolePortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsolePortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *PatchedWritableConsolePortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PatchedWritableConsolePortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PatchedWritableConsolePortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableConsolePortTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableConsolePortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortTemplateRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortTemplateRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *PatchedWritableConsolePortTemplateRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableConsolePortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsolePortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableConsolePortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableConsolePortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritableConsolePortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableConsolePortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableConsolePortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableConsolePortTemplateRequest := _PatchedWritableConsolePortTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableConsolePortTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableConsolePortTemplateRequest(varPatchedWritableConsolePortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableConsolePortTemplateRequest struct { + value *PatchedWritableConsolePortTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableConsolePortTemplateRequest) Get() *PatchedWritableConsolePortTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableConsolePortTemplateRequest) Set(val *PatchedWritableConsolePortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConsolePortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConsolePortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConsolePortTemplateRequest(val *PatchedWritableConsolePortTemplateRequest) *NullablePatchedWritableConsolePortTemplateRequest { + return &NullablePatchedWritableConsolePortTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableConsolePortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConsolePortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_server_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_server_port_request.go new file mode 100644 index 00000000..94004680 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_server_port_request.go @@ -0,0 +1,510 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableConsoleServerPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableConsoleServerPortRequest{} + +// PatchedWritableConsoleServerPortRequest Adds support for custom fields and tags. +type PatchedWritableConsoleServerPortRequest struct { + Device *int32 `json:"device,omitempty"` + Module NullableInt32 `json:"module,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritableConsolePortRequestType `json:"type,omitempty"` + Speed NullablePatchedWritableConsolePortRequestSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableConsoleServerPortRequest PatchedWritableConsoleServerPortRequest + +// NewPatchedWritableConsoleServerPortRequest instantiates a new PatchedWritableConsoleServerPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableConsoleServerPortRequest() *PatchedWritableConsoleServerPortRequest { + this := PatchedWritableConsoleServerPortRequest{} + return &this +} + +// NewPatchedWritableConsoleServerPortRequestWithDefaults instantiates a new PatchedWritableConsoleServerPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableConsoleServerPortRequestWithDefaults() *PatchedWritableConsoleServerPortRequest { + this := PatchedWritableConsoleServerPortRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableConsoleServerPortRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsoleServerPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsoleServerPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *PatchedWritableConsoleServerPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PatchedWritableConsoleServerPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PatchedWritableConsoleServerPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableConsoleServerPortRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableConsoleServerPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetType() PatchedWritableConsolePortRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableConsolePortRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetTypeOk() (*PatchedWritableConsolePortRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableConsolePortRequestType and assigns it to the Type field. +func (o *PatchedWritableConsoleServerPortRequest) SetType(v PatchedWritableConsolePortRequestType) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsoleServerPortRequest) GetSpeed() PatchedWritableConsolePortRequestSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret PatchedWritableConsolePortRequestSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsoleServerPortRequest) GetSpeedOk() (*PatchedWritableConsolePortRequestSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullablePatchedWritableConsolePortRequestSpeed and assigns it to the Speed field. +func (o *PatchedWritableConsoleServerPortRequest) SetSpeed(v PatchedWritableConsolePortRequestSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *PatchedWritableConsoleServerPortRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *PatchedWritableConsoleServerPortRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableConsoleServerPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritableConsoleServerPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableConsoleServerPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableConsoleServerPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableConsoleServerPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableConsoleServerPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableConsoleServerPortRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableConsoleServerPortRequest := _PatchedWritableConsoleServerPortRequest{} + + err = json.Unmarshal(data, &varPatchedWritableConsoleServerPortRequest) + + if err != nil { + return err + } + + *o = PatchedWritableConsoleServerPortRequest(varPatchedWritableConsoleServerPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableConsoleServerPortRequest struct { + value *PatchedWritableConsoleServerPortRequest + isSet bool +} + +func (v NullablePatchedWritableConsoleServerPortRequest) Get() *PatchedWritableConsoleServerPortRequest { + return v.value +} + +func (v *NullablePatchedWritableConsoleServerPortRequest) Set(val *PatchedWritableConsoleServerPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConsoleServerPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConsoleServerPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConsoleServerPortRequest(val *PatchedWritableConsoleServerPortRequest) *NullablePatchedWritableConsoleServerPortRequest { + return &NullablePatchedWritableConsoleServerPortRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableConsoleServerPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConsoleServerPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_server_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_server_port_template_request.go new file mode 100644 index 00000000..a4d6ec4e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_console_server_port_template_request.go @@ -0,0 +1,362 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableConsoleServerPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableConsoleServerPortTemplateRequest{} + +// PatchedWritableConsoleServerPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableConsoleServerPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableConsoleServerPortTemplateRequest PatchedWritableConsoleServerPortTemplateRequest + +// NewPatchedWritableConsoleServerPortTemplateRequest instantiates a new PatchedWritableConsoleServerPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableConsoleServerPortTemplateRequest() *PatchedWritableConsoleServerPortTemplateRequest { + this := PatchedWritableConsoleServerPortTemplateRequest{} + return &this +} + +// NewPatchedWritableConsoleServerPortTemplateRequestWithDefaults instantiates a new PatchedWritableConsoleServerPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableConsoleServerPortTemplateRequestWithDefaults() *PatchedWritableConsoleServerPortTemplateRequest { + this := PatchedWritableConsoleServerPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PatchedWritableConsoleServerPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PatchedWritableConsoleServerPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableConsoleServerPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableConsoleServerPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritableConsoleServerPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableConsoleServerPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableConsoleServerPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableConsoleServerPortTemplateRequest := _PatchedWritableConsoleServerPortTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableConsoleServerPortTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableConsoleServerPortTemplateRequest(varPatchedWritableConsoleServerPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableConsoleServerPortTemplateRequest struct { + value *PatchedWritableConsoleServerPortTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableConsoleServerPortTemplateRequest) Get() *PatchedWritableConsoleServerPortTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableConsoleServerPortTemplateRequest) Set(val *PatchedWritableConsoleServerPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableConsoleServerPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableConsoleServerPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableConsoleServerPortTemplateRequest(val *PatchedWritableConsoleServerPortTemplateRequest) *NullablePatchedWritableConsoleServerPortTemplateRequest { + return &NullablePatchedWritableConsoleServerPortTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableConsoleServerPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableConsoleServerPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_assignment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_assignment_request.go new file mode 100644 index 00000000..ada2b5c9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_assignment_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableContactAssignmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableContactAssignmentRequest{} + +// PatchedWritableContactAssignmentRequest Adds support for custom fields and tags. +type PatchedWritableContactAssignmentRequest struct { + ContentType *string `json:"content_type,omitempty"` + ObjectId *int64 `json:"object_id,omitempty"` + Contact *int32 `json:"contact,omitempty"` + Role *int32 `json:"role,omitempty"` + Priority *ContactAssignmentPriorityValue `json:"priority,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableContactAssignmentRequest PatchedWritableContactAssignmentRequest + +// NewPatchedWritableContactAssignmentRequest instantiates a new PatchedWritableContactAssignmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableContactAssignmentRequest() *PatchedWritableContactAssignmentRequest { + this := PatchedWritableContactAssignmentRequest{} + return &this +} + +// NewPatchedWritableContactAssignmentRequestWithDefaults instantiates a new PatchedWritableContactAssignmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableContactAssignmentRequestWithDefaults() *PatchedWritableContactAssignmentRequest { + this := PatchedWritableContactAssignmentRequest{} + return &this +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *PatchedWritableContactAssignmentRequest) GetContentType() string { + if o == nil || IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactAssignmentRequest) GetContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *PatchedWritableContactAssignmentRequest) HasContentType() bool { + if o != nil && !IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *PatchedWritableContactAssignmentRequest) SetContentType(v string) { + o.ContentType = &v +} + +// GetObjectId returns the ObjectId field value if set, zero value otherwise. +func (o *PatchedWritableContactAssignmentRequest) GetObjectId() int64 { + if o == nil || IsNil(o.ObjectId) { + var ret int64 + return ret + } + return *o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactAssignmentRequest) GetObjectIdOk() (*int64, bool) { + if o == nil || IsNil(o.ObjectId) { + return nil, false + } + return o.ObjectId, true +} + +// HasObjectId returns a boolean if a field has been set. +func (o *PatchedWritableContactAssignmentRequest) HasObjectId() bool { + if o != nil && !IsNil(o.ObjectId) { + return true + } + + return false +} + +// SetObjectId gets a reference to the given int64 and assigns it to the ObjectId field. +func (o *PatchedWritableContactAssignmentRequest) SetObjectId(v int64) { + o.ObjectId = &v +} + +// GetContact returns the Contact field value if set, zero value otherwise. +func (o *PatchedWritableContactAssignmentRequest) GetContact() int32 { + if o == nil || IsNil(o.Contact) { + var ret int32 + return ret + } + return *o.Contact +} + +// GetContactOk returns a tuple with the Contact field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactAssignmentRequest) GetContactOk() (*int32, bool) { + if o == nil || IsNil(o.Contact) { + return nil, false + } + return o.Contact, true +} + +// HasContact returns a boolean if a field has been set. +func (o *PatchedWritableContactAssignmentRequest) HasContact() bool { + if o != nil && !IsNil(o.Contact) { + return true + } + + return false +} + +// SetContact gets a reference to the given int32 and assigns it to the Contact field. +func (o *PatchedWritableContactAssignmentRequest) SetContact(v int32) { + o.Contact = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *PatchedWritableContactAssignmentRequest) GetRole() int32 { + if o == nil || IsNil(o.Role) { + var ret int32 + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactAssignmentRequest) GetRoleOk() (*int32, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableContactAssignmentRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given int32 and assigns it to the Role field. +func (o *PatchedWritableContactAssignmentRequest) SetRole(v int32) { + o.Role = &v +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *PatchedWritableContactAssignmentRequest) GetPriority() ContactAssignmentPriorityValue { + if o == nil || IsNil(o.Priority) { + var ret ContactAssignmentPriorityValue + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactAssignmentRequest) GetPriorityOk() (*ContactAssignmentPriorityValue, bool) { + if o == nil || IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *PatchedWritableContactAssignmentRequest) HasPriority() bool { + if o != nil && !IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given ContactAssignmentPriorityValue and assigns it to the Priority field. +func (o *PatchedWritableContactAssignmentRequest) SetPriority(v ContactAssignmentPriorityValue) { + o.Priority = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableContactAssignmentRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactAssignmentRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableContactAssignmentRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableContactAssignmentRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableContactAssignmentRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactAssignmentRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableContactAssignmentRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableContactAssignmentRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableContactAssignmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableContactAssignmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContentType) { + toSerialize["content_type"] = o.ContentType + } + if !IsNil(o.ObjectId) { + toSerialize["object_id"] = o.ObjectId + } + if !IsNil(o.Contact) { + toSerialize["contact"] = o.Contact + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableContactAssignmentRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableContactAssignmentRequest := _PatchedWritableContactAssignmentRequest{} + + err = json.Unmarshal(data, &varPatchedWritableContactAssignmentRequest) + + if err != nil { + return err + } + + *o = PatchedWritableContactAssignmentRequest(varPatchedWritableContactAssignmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "contact") + delete(additionalProperties, "role") + delete(additionalProperties, "priority") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableContactAssignmentRequest struct { + value *PatchedWritableContactAssignmentRequest + isSet bool +} + +func (v NullablePatchedWritableContactAssignmentRequest) Get() *PatchedWritableContactAssignmentRequest { + return v.value +} + +func (v *NullablePatchedWritableContactAssignmentRequest) Set(val *PatchedWritableContactAssignmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableContactAssignmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableContactAssignmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableContactAssignmentRequest(val *PatchedWritableContactAssignmentRequest) *NullablePatchedWritableContactAssignmentRequest { + return &NullablePatchedWritableContactAssignmentRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableContactAssignmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableContactAssignmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_group_request.go new file mode 100644 index 00000000..564b1002 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_group_request.go @@ -0,0 +1,349 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableContactGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableContactGroupRequest{} + +// PatchedWritableContactGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type PatchedWritableContactGroupRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableContactGroupRequest PatchedWritableContactGroupRequest + +// NewPatchedWritableContactGroupRequest instantiates a new PatchedWritableContactGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableContactGroupRequest() *PatchedWritableContactGroupRequest { + this := PatchedWritableContactGroupRequest{} + return &this +} + +// NewPatchedWritableContactGroupRequestWithDefaults instantiates a new PatchedWritableContactGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableContactGroupRequestWithDefaults() *PatchedWritableContactGroupRequest { + this := PatchedWritableContactGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableContactGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableContactGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableContactGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableContactGroupRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactGroupRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableContactGroupRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableContactGroupRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableContactGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableContactGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableContactGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableContactGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableContactGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableContactGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableContactGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableContactGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableContactGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableContactGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableContactGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableContactGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableContactGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableContactGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableContactGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableContactGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableContactGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableContactGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableContactGroupRequest := _PatchedWritableContactGroupRequest{} + + err = json.Unmarshal(data, &varPatchedWritableContactGroupRequest) + + if err != nil { + return err + } + + *o = PatchedWritableContactGroupRequest(varPatchedWritableContactGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableContactGroupRequest struct { + value *PatchedWritableContactGroupRequest + isSet bool +} + +func (v NullablePatchedWritableContactGroupRequest) Get() *PatchedWritableContactGroupRequest { + return v.value +} + +func (v *NullablePatchedWritableContactGroupRequest) Set(val *PatchedWritableContactGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableContactGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableContactGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableContactGroupRequest(val *PatchedWritableContactGroupRequest) *NullablePatchedWritableContactGroupRequest { + return &NullablePatchedWritableContactGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableContactGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableContactGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_request.go new file mode 100644 index 00000000..79f6f4d4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_contact_request.go @@ -0,0 +1,534 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableContactRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableContactRequest{} + +// PatchedWritableContactRequest Adds support for custom fields and tags. +type PatchedWritableContactRequest struct { + Group NullableInt32 `json:"group,omitempty"` + Name *string `json:"name,omitempty"` + Title *string `json:"title,omitempty"` + Phone *string `json:"phone,omitempty"` + Email *string `json:"email,omitempty"` + Address *string `json:"address,omitempty"` + Link *string `json:"link,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableContactRequest PatchedWritableContactRequest + +// NewPatchedWritableContactRequest instantiates a new PatchedWritableContactRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableContactRequest() *PatchedWritableContactRequest { + this := PatchedWritableContactRequest{} + return &this +} + +// NewPatchedWritableContactRequestWithDefaults instantiates a new PatchedWritableContactRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableContactRequestWithDefaults() *PatchedWritableContactRequest { + this := PatchedWritableContactRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableContactRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableContactRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *PatchedWritableContactRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedWritableContactRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedWritableContactRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableContactRequest) SetName(v string) { + o.Name = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *PatchedWritableContactRequest) SetTitle(v string) { + o.Title = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetPhone() string { + if o == nil || IsNil(o.Phone) { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetPhoneOk() (*string, bool) { + if o == nil || IsNil(o.Phone) { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasPhone() bool { + if o != nil && !IsNil(o.Phone) { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *PatchedWritableContactRequest) SetPhone(v string) { + o.Phone = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *PatchedWritableContactRequest) SetEmail(v string) { + o.Email = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *PatchedWritableContactRequest) SetAddress(v string) { + o.Address = &v +} + +// GetLink returns the Link field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetLink() string { + if o == nil || IsNil(o.Link) { + var ret string + return ret + } + return *o.Link +} + +// GetLinkOk returns a tuple with the Link field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetLinkOk() (*string, bool) { + if o == nil || IsNil(o.Link) { + return nil, false + } + return o.Link, true +} + +// HasLink returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasLink() bool { + if o != nil && !IsNil(o.Link) { + return true + } + + return false +} + +// SetLink gets a reference to the given string and assigns it to the Link field. +func (o *PatchedWritableContactRequest) SetLink(v string) { + o.Link = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableContactRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableContactRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableContactRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableContactRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableContactRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableContactRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableContactRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableContactRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableContactRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.Phone) { + toSerialize["phone"] = o.Phone + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Link) { + toSerialize["link"] = o.Link + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableContactRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableContactRequest := _PatchedWritableContactRequest{} + + err = json.Unmarshal(data, &varPatchedWritableContactRequest) + + if err != nil { + return err + } + + *o = PatchedWritableContactRequest(varPatchedWritableContactRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "name") + delete(additionalProperties, "title") + delete(additionalProperties, "phone") + delete(additionalProperties, "email") + delete(additionalProperties, "address") + delete(additionalProperties, "link") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableContactRequest struct { + value *PatchedWritableContactRequest + isSet bool +} + +func (v NullablePatchedWritableContactRequest) Get() *PatchedWritableContactRequest { + return v.value +} + +func (v *NullablePatchedWritableContactRequest) Set(val *PatchedWritableContactRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableContactRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableContactRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableContactRequest(val *PatchedWritableContactRequest) *NullablePatchedWritableContactRequest { + return &NullablePatchedWritableContactRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableContactRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableContactRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_choice_set_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_choice_set_request.go new file mode 100644 index 00000000..a70596d6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_choice_set_request.go @@ -0,0 +1,303 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableCustomFieldChoiceSetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableCustomFieldChoiceSetRequest{} + +// PatchedWritableCustomFieldChoiceSetRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableCustomFieldChoiceSetRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseChoices *PatchedWritableCustomFieldChoiceSetRequestBaseChoices `json:"base_choices,omitempty"` + ExtraChoices [][]string `json:"extra_choices,omitempty"` + // Choices are automatically ordered alphabetically + OrderAlphabetically *bool `json:"order_alphabetically,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableCustomFieldChoiceSetRequest PatchedWritableCustomFieldChoiceSetRequest + +// NewPatchedWritableCustomFieldChoiceSetRequest instantiates a new PatchedWritableCustomFieldChoiceSetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableCustomFieldChoiceSetRequest() *PatchedWritableCustomFieldChoiceSetRequest { + this := PatchedWritableCustomFieldChoiceSetRequest{} + return &this +} + +// NewPatchedWritableCustomFieldChoiceSetRequestWithDefaults instantiates a new PatchedWritableCustomFieldChoiceSetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableCustomFieldChoiceSetRequestWithDefaults() *PatchedWritableCustomFieldChoiceSetRequest { + this := PatchedWritableCustomFieldChoiceSetRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableCustomFieldChoiceSetRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableCustomFieldChoiceSetRequest) SetDescription(v string) { + o.Description = &v +} + +// GetBaseChoices returns the BaseChoices field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetBaseChoices() PatchedWritableCustomFieldChoiceSetRequestBaseChoices { + if o == nil || IsNil(o.BaseChoices) { + var ret PatchedWritableCustomFieldChoiceSetRequestBaseChoices + return ret + } + return *o.BaseChoices +} + +// GetBaseChoicesOk returns a tuple with the BaseChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetBaseChoicesOk() (*PatchedWritableCustomFieldChoiceSetRequestBaseChoices, bool) { + if o == nil || IsNil(o.BaseChoices) { + return nil, false + } + return o.BaseChoices, true +} + +// HasBaseChoices returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) HasBaseChoices() bool { + if o != nil && !IsNil(o.BaseChoices) { + return true + } + + return false +} + +// SetBaseChoices gets a reference to the given PatchedWritableCustomFieldChoiceSetRequestBaseChoices and assigns it to the BaseChoices field. +func (o *PatchedWritableCustomFieldChoiceSetRequest) SetBaseChoices(v PatchedWritableCustomFieldChoiceSetRequestBaseChoices) { + o.BaseChoices = &v +} + +// GetExtraChoices returns the ExtraChoices field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetExtraChoices() [][]string { + if o == nil { + var ret [][]string + return ret + } + return o.ExtraChoices +} + +// GetExtraChoicesOk returns a tuple with the ExtraChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetExtraChoicesOk() ([][]string, bool) { + if o == nil || IsNil(o.ExtraChoices) { + return nil, false + } + return o.ExtraChoices, true +} + +// HasExtraChoices returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) HasExtraChoices() bool { + if o != nil && IsNil(o.ExtraChoices) { + return true + } + + return false +} + +// SetExtraChoices gets a reference to the given [][]string and assigns it to the ExtraChoices field. +func (o *PatchedWritableCustomFieldChoiceSetRequest) SetExtraChoices(v [][]string) { + o.ExtraChoices = v +} + +// GetOrderAlphabetically returns the OrderAlphabetically field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetOrderAlphabetically() bool { + if o == nil || IsNil(o.OrderAlphabetically) { + var ret bool + return ret + } + return *o.OrderAlphabetically +} + +// GetOrderAlphabeticallyOk returns a tuple with the OrderAlphabetically field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) GetOrderAlphabeticallyOk() (*bool, bool) { + if o == nil || IsNil(o.OrderAlphabetically) { + return nil, false + } + return o.OrderAlphabetically, true +} + +// HasOrderAlphabetically returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldChoiceSetRequest) HasOrderAlphabetically() bool { + if o != nil && !IsNil(o.OrderAlphabetically) { + return true + } + + return false +} + +// SetOrderAlphabetically gets a reference to the given bool and assigns it to the OrderAlphabetically field. +func (o *PatchedWritableCustomFieldChoiceSetRequest) SetOrderAlphabetically(v bool) { + o.OrderAlphabetically = &v +} + +func (o PatchedWritableCustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableCustomFieldChoiceSetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.BaseChoices) { + toSerialize["base_choices"] = o.BaseChoices + } + if o.ExtraChoices != nil { + toSerialize["extra_choices"] = o.ExtraChoices + } + if !IsNil(o.OrderAlphabetically) { + toSerialize["order_alphabetically"] = o.OrderAlphabetically + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableCustomFieldChoiceSetRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableCustomFieldChoiceSetRequest := _PatchedWritableCustomFieldChoiceSetRequest{} + + err = json.Unmarshal(data, &varPatchedWritableCustomFieldChoiceSetRequest) + + if err != nil { + return err + } + + *o = PatchedWritableCustomFieldChoiceSetRequest(varPatchedWritableCustomFieldChoiceSetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "base_choices") + delete(additionalProperties, "extra_choices") + delete(additionalProperties, "order_alphabetically") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableCustomFieldChoiceSetRequest struct { + value *PatchedWritableCustomFieldChoiceSetRequest + isSet bool +} + +func (v NullablePatchedWritableCustomFieldChoiceSetRequest) Get() *PatchedWritableCustomFieldChoiceSetRequest { + return v.value +} + +func (v *NullablePatchedWritableCustomFieldChoiceSetRequest) Set(val *PatchedWritableCustomFieldChoiceSetRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCustomFieldChoiceSetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCustomFieldChoiceSetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCustomFieldChoiceSetRequest(val *PatchedWritableCustomFieldChoiceSetRequest) *NullablePatchedWritableCustomFieldChoiceSetRequest { + return &NullablePatchedWritableCustomFieldChoiceSetRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableCustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCustomFieldChoiceSetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_choice_set_request_base_choices.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_choice_set_request_base_choices.go new file mode 100644 index 00000000..d16f6fb6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_choice_set_request_base_choices.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableCustomFieldChoiceSetRequestBaseChoices Base set of predefined choices (optional) * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes) +type PatchedWritableCustomFieldChoiceSetRequestBaseChoices string + +// List of PatchedWritableCustomFieldChoiceSetRequest_base_choices +const ( + PATCHEDWRITABLECUSTOMFIELDCHOICESETREQUESTBASECHOICES_IATA PatchedWritableCustomFieldChoiceSetRequestBaseChoices = "IATA" + PATCHEDWRITABLECUSTOMFIELDCHOICESETREQUESTBASECHOICES_ISO_3166 PatchedWritableCustomFieldChoiceSetRequestBaseChoices = "ISO_3166" + PATCHEDWRITABLECUSTOMFIELDCHOICESETREQUESTBASECHOICES_UN_LOCODE PatchedWritableCustomFieldChoiceSetRequestBaseChoices = "UN_LOCODE" + PATCHEDWRITABLECUSTOMFIELDCHOICESETREQUESTBASECHOICES_EMPTY PatchedWritableCustomFieldChoiceSetRequestBaseChoices = "" +) + +// All allowed values of PatchedWritableCustomFieldChoiceSetRequestBaseChoices enum +var AllowedPatchedWritableCustomFieldChoiceSetRequestBaseChoicesEnumValues = []PatchedWritableCustomFieldChoiceSetRequestBaseChoices{ + "IATA", + "ISO_3166", + "UN_LOCODE", + "", +} + +func (v *PatchedWritableCustomFieldChoiceSetRequestBaseChoices) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableCustomFieldChoiceSetRequestBaseChoices(value) + for _, existing := range AllowedPatchedWritableCustomFieldChoiceSetRequestBaseChoicesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableCustomFieldChoiceSetRequestBaseChoices", value) +} + +// NewPatchedWritableCustomFieldChoiceSetRequestBaseChoicesFromValue returns a pointer to a valid PatchedWritableCustomFieldChoiceSetRequestBaseChoices +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableCustomFieldChoiceSetRequestBaseChoicesFromValue(v string) (*PatchedWritableCustomFieldChoiceSetRequestBaseChoices, error) { + ev := PatchedWritableCustomFieldChoiceSetRequestBaseChoices(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableCustomFieldChoiceSetRequestBaseChoices: valid values are %v", v, AllowedPatchedWritableCustomFieldChoiceSetRequestBaseChoicesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableCustomFieldChoiceSetRequestBaseChoices) IsValid() bool { + for _, existing := range AllowedPatchedWritableCustomFieldChoiceSetRequestBaseChoicesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableCustomFieldChoiceSetRequest_base_choices value +func (v PatchedWritableCustomFieldChoiceSetRequestBaseChoices) Ptr() *PatchedWritableCustomFieldChoiceSetRequestBaseChoices { + return &v +} + +type NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices struct { + value *PatchedWritableCustomFieldChoiceSetRequestBaseChoices + isSet bool +} + +func (v NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices) Get() *PatchedWritableCustomFieldChoiceSetRequestBaseChoices { + return v.value +} + +func (v *NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices) Set(val *PatchedWritableCustomFieldChoiceSetRequestBaseChoices) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices(val *PatchedWritableCustomFieldChoiceSetRequestBaseChoices) *NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices { + return &NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices{value: val, isSet: true} +} + +func (v NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCustomFieldChoiceSetRequestBaseChoices) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request.go new file mode 100644 index 00000000..632e8930 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request.go @@ -0,0 +1,875 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableCustomFieldRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableCustomFieldRequest{} + +// PatchedWritableCustomFieldRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableCustomFieldRequest struct { + ContentTypes []string `json:"content_types,omitempty"` + Type *PatchedWritableCustomFieldRequestType `json:"type,omitempty"` + ObjectType NullableString `json:"object_type,omitempty"` + // Internal field name + Name *string `json:"name,omitempty"` + // Name of the field as displayed to users (if not provided, 'the field's name will be used) + Label *string `json:"label,omitempty"` + // Custom fields within the same group will be displayed together + GroupName *string `json:"group_name,omitempty"` + Description *string `json:"description,omitempty"` + // If true, this field is required when creating new objects or editing an existing object. + Required *bool `json:"required,omitempty"` + // Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored. + SearchWeight *int32 `json:"search_weight,omitempty"` + FilterLogic *PatchedWritableCustomFieldRequestFilterLogic `json:"filter_logic,omitempty"` + UiVisible *PatchedWritableCustomFieldRequestUiVisible `json:"ui_visible,omitempty"` + UiEditable *PatchedWritableCustomFieldRequestUiEditable `json:"ui_editable,omitempty"` + // Replicate this value when cloning objects + IsCloneable *bool `json:"is_cloneable,omitempty"` + // Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. \"Foo\"). + Default interface{} `json:"default,omitempty"` + // Fields with higher weights appear lower in a form. + Weight *int32 `json:"weight,omitempty"` + // Minimum allowed value (for numeric fields) + ValidationMinimum NullableInt64 `json:"validation_minimum,omitempty"` + // Maximum allowed value (for numeric fields) + ValidationMaximum NullableInt64 `json:"validation_maximum,omitempty"` + // Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, ^[A-Z]{3}$ will limit values to exactly three uppercase letters. + ValidationRegex *string `json:"validation_regex,omitempty"` + ChoiceSet NullableInt32 `json:"choice_set,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableCustomFieldRequest PatchedWritableCustomFieldRequest + +// NewPatchedWritableCustomFieldRequest instantiates a new PatchedWritableCustomFieldRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableCustomFieldRequest() *PatchedWritableCustomFieldRequest { + this := PatchedWritableCustomFieldRequest{} + return &this +} + +// NewPatchedWritableCustomFieldRequestWithDefaults instantiates a new PatchedWritableCustomFieldRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableCustomFieldRequestWithDefaults() *PatchedWritableCustomFieldRequest { + this := PatchedWritableCustomFieldRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetContentTypes() []string { + if o == nil || IsNil(o.ContentTypes) { + var ret []string + return ret + } + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ContentTypes) { + return nil, false + } + return o.ContentTypes, true +} + +// HasContentTypes returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasContentTypes() bool { + if o != nil && !IsNil(o.ContentTypes) { + return true + } + + return false +} + +// SetContentTypes gets a reference to the given []string and assigns it to the ContentTypes field. +func (o *PatchedWritableCustomFieldRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetType() PatchedWritableCustomFieldRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableCustomFieldRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetTypeOk() (*PatchedWritableCustomFieldRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableCustomFieldRequestType and assigns it to the Type field. +func (o *PatchedWritableCustomFieldRequest) SetType(v PatchedWritableCustomFieldRequestType) { + o.Type = &v +} + +// GetObjectType returns the ObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCustomFieldRequest) GetObjectType() string { + if o == nil || IsNil(o.ObjectType.Get()) { + var ret string + return ret + } + return *o.ObjectType.Get() +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCustomFieldRequest) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectType.Get(), o.ObjectType.IsSet() +} + +// HasObjectType returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasObjectType() bool { + if o != nil && o.ObjectType.IsSet() { + return true + } + + return false +} + +// SetObjectType gets a reference to the given NullableString and assigns it to the ObjectType field. +func (o *PatchedWritableCustomFieldRequest) SetObjectType(v string) { + o.ObjectType.Set(&v) +} + +// SetObjectTypeNil sets the value for ObjectType to be an explicit nil +func (o *PatchedWritableCustomFieldRequest) SetObjectTypeNil() { + o.ObjectType.Set(nil) +} + +// UnsetObjectType ensures that no value is present for ObjectType, not even an explicit nil +func (o *PatchedWritableCustomFieldRequest) UnsetObjectType() { + o.ObjectType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableCustomFieldRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableCustomFieldRequest) SetLabel(v string) { + o.Label = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *PatchedWritableCustomFieldRequest) SetGroupName(v string) { + o.GroupName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableCustomFieldRequest) SetDescription(v string) { + o.Description = &v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *PatchedWritableCustomFieldRequest) SetRequired(v bool) { + o.Required = &v +} + +// GetSearchWeight returns the SearchWeight field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetSearchWeight() int32 { + if o == nil || IsNil(o.SearchWeight) { + var ret int32 + return ret + } + return *o.SearchWeight +} + +// GetSearchWeightOk returns a tuple with the SearchWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetSearchWeightOk() (*int32, bool) { + if o == nil || IsNil(o.SearchWeight) { + return nil, false + } + return o.SearchWeight, true +} + +// HasSearchWeight returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasSearchWeight() bool { + if o != nil && !IsNil(o.SearchWeight) { + return true + } + + return false +} + +// SetSearchWeight gets a reference to the given int32 and assigns it to the SearchWeight field. +func (o *PatchedWritableCustomFieldRequest) SetSearchWeight(v int32) { + o.SearchWeight = &v +} + +// GetFilterLogic returns the FilterLogic field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetFilterLogic() PatchedWritableCustomFieldRequestFilterLogic { + if o == nil || IsNil(o.FilterLogic) { + var ret PatchedWritableCustomFieldRequestFilterLogic + return ret + } + return *o.FilterLogic +} + +// GetFilterLogicOk returns a tuple with the FilterLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetFilterLogicOk() (*PatchedWritableCustomFieldRequestFilterLogic, bool) { + if o == nil || IsNil(o.FilterLogic) { + return nil, false + } + return o.FilterLogic, true +} + +// HasFilterLogic returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasFilterLogic() bool { + if o != nil && !IsNil(o.FilterLogic) { + return true + } + + return false +} + +// SetFilterLogic gets a reference to the given PatchedWritableCustomFieldRequestFilterLogic and assigns it to the FilterLogic field. +func (o *PatchedWritableCustomFieldRequest) SetFilterLogic(v PatchedWritableCustomFieldRequestFilterLogic) { + o.FilterLogic = &v +} + +// GetUiVisible returns the UiVisible field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetUiVisible() PatchedWritableCustomFieldRequestUiVisible { + if o == nil || IsNil(o.UiVisible) { + var ret PatchedWritableCustomFieldRequestUiVisible + return ret + } + return *o.UiVisible +} + +// GetUiVisibleOk returns a tuple with the UiVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetUiVisibleOk() (*PatchedWritableCustomFieldRequestUiVisible, bool) { + if o == nil || IsNil(o.UiVisible) { + return nil, false + } + return o.UiVisible, true +} + +// HasUiVisible returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasUiVisible() bool { + if o != nil && !IsNil(o.UiVisible) { + return true + } + + return false +} + +// SetUiVisible gets a reference to the given PatchedWritableCustomFieldRequestUiVisible and assigns it to the UiVisible field. +func (o *PatchedWritableCustomFieldRequest) SetUiVisible(v PatchedWritableCustomFieldRequestUiVisible) { + o.UiVisible = &v +} + +// GetUiEditable returns the UiEditable field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetUiEditable() PatchedWritableCustomFieldRequestUiEditable { + if o == nil || IsNil(o.UiEditable) { + var ret PatchedWritableCustomFieldRequestUiEditable + return ret + } + return *o.UiEditable +} + +// GetUiEditableOk returns a tuple with the UiEditable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetUiEditableOk() (*PatchedWritableCustomFieldRequestUiEditable, bool) { + if o == nil || IsNil(o.UiEditable) { + return nil, false + } + return o.UiEditable, true +} + +// HasUiEditable returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasUiEditable() bool { + if o != nil && !IsNil(o.UiEditable) { + return true + } + + return false +} + +// SetUiEditable gets a reference to the given PatchedWritableCustomFieldRequestUiEditable and assigns it to the UiEditable field. +func (o *PatchedWritableCustomFieldRequest) SetUiEditable(v PatchedWritableCustomFieldRequestUiEditable) { + o.UiEditable = &v +} + +// GetIsCloneable returns the IsCloneable field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetIsCloneable() bool { + if o == nil || IsNil(o.IsCloneable) { + var ret bool + return ret + } + return *o.IsCloneable +} + +// GetIsCloneableOk returns a tuple with the IsCloneable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetIsCloneableOk() (*bool, bool) { + if o == nil || IsNil(o.IsCloneable) { + return nil, false + } + return o.IsCloneable, true +} + +// HasIsCloneable returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasIsCloneable() bool { + if o != nil && !IsNil(o.IsCloneable) { + return true + } + + return false +} + +// SetIsCloneable gets a reference to the given bool and assigns it to the IsCloneable field. +func (o *PatchedWritableCustomFieldRequest) SetIsCloneable(v bool) { + o.IsCloneable = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCustomFieldRequest) GetDefault() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCustomFieldRequest) GetDefaultOk() (*interface{}, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return &o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasDefault() bool { + if o != nil && IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given interface{} and assigns it to the Default field. +func (o *PatchedWritableCustomFieldRequest) SetDefault(v interface{}) { + o.Default = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *PatchedWritableCustomFieldRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetValidationMinimum returns the ValidationMinimum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCustomFieldRequest) GetValidationMinimum() int64 { + if o == nil || IsNil(o.ValidationMinimum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMinimum.Get() +} + +// GetValidationMinimumOk returns a tuple with the ValidationMinimum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCustomFieldRequest) GetValidationMinimumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMinimum.Get(), o.ValidationMinimum.IsSet() +} + +// HasValidationMinimum returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasValidationMinimum() bool { + if o != nil && o.ValidationMinimum.IsSet() { + return true + } + + return false +} + +// SetValidationMinimum gets a reference to the given NullableInt64 and assigns it to the ValidationMinimum field. +func (o *PatchedWritableCustomFieldRequest) SetValidationMinimum(v int64) { + o.ValidationMinimum.Set(&v) +} + +// SetValidationMinimumNil sets the value for ValidationMinimum to be an explicit nil +func (o *PatchedWritableCustomFieldRequest) SetValidationMinimumNil() { + o.ValidationMinimum.Set(nil) +} + +// UnsetValidationMinimum ensures that no value is present for ValidationMinimum, not even an explicit nil +func (o *PatchedWritableCustomFieldRequest) UnsetValidationMinimum() { + o.ValidationMinimum.Unset() +} + +// GetValidationMaximum returns the ValidationMaximum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCustomFieldRequest) GetValidationMaximum() int64 { + if o == nil || IsNil(o.ValidationMaximum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMaximum.Get() +} + +// GetValidationMaximumOk returns a tuple with the ValidationMaximum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCustomFieldRequest) GetValidationMaximumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMaximum.Get(), o.ValidationMaximum.IsSet() +} + +// HasValidationMaximum returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasValidationMaximum() bool { + if o != nil && o.ValidationMaximum.IsSet() { + return true + } + + return false +} + +// SetValidationMaximum gets a reference to the given NullableInt64 and assigns it to the ValidationMaximum field. +func (o *PatchedWritableCustomFieldRequest) SetValidationMaximum(v int64) { + o.ValidationMaximum.Set(&v) +} + +// SetValidationMaximumNil sets the value for ValidationMaximum to be an explicit nil +func (o *PatchedWritableCustomFieldRequest) SetValidationMaximumNil() { + o.ValidationMaximum.Set(nil) +} + +// UnsetValidationMaximum ensures that no value is present for ValidationMaximum, not even an explicit nil +func (o *PatchedWritableCustomFieldRequest) UnsetValidationMaximum() { + o.ValidationMaximum.Unset() +} + +// GetValidationRegex returns the ValidationRegex field value if set, zero value otherwise. +func (o *PatchedWritableCustomFieldRequest) GetValidationRegex() string { + if o == nil || IsNil(o.ValidationRegex) { + var ret string + return ret + } + return *o.ValidationRegex +} + +// GetValidationRegexOk returns a tuple with the ValidationRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableCustomFieldRequest) GetValidationRegexOk() (*string, bool) { + if o == nil || IsNil(o.ValidationRegex) { + return nil, false + } + return o.ValidationRegex, true +} + +// HasValidationRegex returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasValidationRegex() bool { + if o != nil && !IsNil(o.ValidationRegex) { + return true + } + + return false +} + +// SetValidationRegex gets a reference to the given string and assigns it to the ValidationRegex field. +func (o *PatchedWritableCustomFieldRequest) SetValidationRegex(v string) { + o.ValidationRegex = &v +} + +// GetChoiceSet returns the ChoiceSet field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableCustomFieldRequest) GetChoiceSet() int32 { + if o == nil || IsNil(o.ChoiceSet.Get()) { + var ret int32 + return ret + } + return *o.ChoiceSet.Get() +} + +// GetChoiceSetOk returns a tuple with the ChoiceSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableCustomFieldRequest) GetChoiceSetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ChoiceSet.Get(), o.ChoiceSet.IsSet() +} + +// HasChoiceSet returns a boolean if a field has been set. +func (o *PatchedWritableCustomFieldRequest) HasChoiceSet() bool { + if o != nil && o.ChoiceSet.IsSet() { + return true + } + + return false +} + +// SetChoiceSet gets a reference to the given NullableInt32 and assigns it to the ChoiceSet field. +func (o *PatchedWritableCustomFieldRequest) SetChoiceSet(v int32) { + o.ChoiceSet.Set(&v) +} + +// SetChoiceSetNil sets the value for ChoiceSet to be an explicit nil +func (o *PatchedWritableCustomFieldRequest) SetChoiceSetNil() { + o.ChoiceSet.Set(nil) +} + +// UnsetChoiceSet ensures that no value is present for ChoiceSet, not even an explicit nil +func (o *PatchedWritableCustomFieldRequest) UnsetChoiceSet() { + o.ChoiceSet.Unset() +} + +func (o PatchedWritableCustomFieldRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableCustomFieldRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContentTypes) { + toSerialize["content_types"] = o.ContentTypes + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.ObjectType.IsSet() { + toSerialize["object_type"] = o.ObjectType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.GroupName) { + toSerialize["group_name"] = o.GroupName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.SearchWeight) { + toSerialize["search_weight"] = o.SearchWeight + } + if !IsNil(o.FilterLogic) { + toSerialize["filter_logic"] = o.FilterLogic + } + if !IsNil(o.UiVisible) { + toSerialize["ui_visible"] = o.UiVisible + } + if !IsNil(o.UiEditable) { + toSerialize["ui_editable"] = o.UiEditable + } + if !IsNil(o.IsCloneable) { + toSerialize["is_cloneable"] = o.IsCloneable + } + if o.Default != nil { + toSerialize["default"] = o.Default + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if o.ValidationMinimum.IsSet() { + toSerialize["validation_minimum"] = o.ValidationMinimum.Get() + } + if o.ValidationMaximum.IsSet() { + toSerialize["validation_maximum"] = o.ValidationMaximum.Get() + } + if !IsNil(o.ValidationRegex) { + toSerialize["validation_regex"] = o.ValidationRegex + } + if o.ChoiceSet.IsSet() { + toSerialize["choice_set"] = o.ChoiceSet.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableCustomFieldRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableCustomFieldRequest := _PatchedWritableCustomFieldRequest{} + + err = json.Unmarshal(data, &varPatchedWritableCustomFieldRequest) + + if err != nil { + return err + } + + *o = PatchedWritableCustomFieldRequest(varPatchedWritableCustomFieldRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "type") + delete(additionalProperties, "object_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "group_name") + delete(additionalProperties, "description") + delete(additionalProperties, "required") + delete(additionalProperties, "search_weight") + delete(additionalProperties, "filter_logic") + delete(additionalProperties, "ui_visible") + delete(additionalProperties, "ui_editable") + delete(additionalProperties, "is_cloneable") + delete(additionalProperties, "default") + delete(additionalProperties, "weight") + delete(additionalProperties, "validation_minimum") + delete(additionalProperties, "validation_maximum") + delete(additionalProperties, "validation_regex") + delete(additionalProperties, "choice_set") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableCustomFieldRequest struct { + value *PatchedWritableCustomFieldRequest + isSet bool +} + +func (v NullablePatchedWritableCustomFieldRequest) Get() *PatchedWritableCustomFieldRequest { + return v.value +} + +func (v *NullablePatchedWritableCustomFieldRequest) Set(val *PatchedWritableCustomFieldRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCustomFieldRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCustomFieldRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCustomFieldRequest(val *PatchedWritableCustomFieldRequest) *NullablePatchedWritableCustomFieldRequest { + return &NullablePatchedWritableCustomFieldRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableCustomFieldRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCustomFieldRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_filter_logic.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_filter_logic.go new file mode 100644 index 00000000..e578a729 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_filter_logic.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableCustomFieldRequestFilterLogic Loose matches any instance of a given string; exact matches the entire field. * `disabled` - Disabled * `loose` - Loose * `exact` - Exact +type PatchedWritableCustomFieldRequestFilterLogic string + +// List of PatchedWritableCustomFieldRequest_filter_logic +const ( + PATCHEDWRITABLECUSTOMFIELDREQUESTFILTERLOGIC_DISABLED PatchedWritableCustomFieldRequestFilterLogic = "disabled" + PATCHEDWRITABLECUSTOMFIELDREQUESTFILTERLOGIC_LOOSE PatchedWritableCustomFieldRequestFilterLogic = "loose" + PATCHEDWRITABLECUSTOMFIELDREQUESTFILTERLOGIC_EXACT PatchedWritableCustomFieldRequestFilterLogic = "exact" +) + +// All allowed values of PatchedWritableCustomFieldRequestFilterLogic enum +var AllowedPatchedWritableCustomFieldRequestFilterLogicEnumValues = []PatchedWritableCustomFieldRequestFilterLogic{ + "disabled", + "loose", + "exact", +} + +func (v *PatchedWritableCustomFieldRequestFilterLogic) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableCustomFieldRequestFilterLogic(value) + for _, existing := range AllowedPatchedWritableCustomFieldRequestFilterLogicEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableCustomFieldRequestFilterLogic", value) +} + +// NewPatchedWritableCustomFieldRequestFilterLogicFromValue returns a pointer to a valid PatchedWritableCustomFieldRequestFilterLogic +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableCustomFieldRequestFilterLogicFromValue(v string) (*PatchedWritableCustomFieldRequestFilterLogic, error) { + ev := PatchedWritableCustomFieldRequestFilterLogic(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableCustomFieldRequestFilterLogic: valid values are %v", v, AllowedPatchedWritableCustomFieldRequestFilterLogicEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableCustomFieldRequestFilterLogic) IsValid() bool { + for _, existing := range AllowedPatchedWritableCustomFieldRequestFilterLogicEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableCustomFieldRequest_filter_logic value +func (v PatchedWritableCustomFieldRequestFilterLogic) Ptr() *PatchedWritableCustomFieldRequestFilterLogic { + return &v +} + +type NullablePatchedWritableCustomFieldRequestFilterLogic struct { + value *PatchedWritableCustomFieldRequestFilterLogic + isSet bool +} + +func (v NullablePatchedWritableCustomFieldRequestFilterLogic) Get() *PatchedWritableCustomFieldRequestFilterLogic { + return v.value +} + +func (v *NullablePatchedWritableCustomFieldRequestFilterLogic) Set(val *PatchedWritableCustomFieldRequestFilterLogic) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCustomFieldRequestFilterLogic) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCustomFieldRequestFilterLogic) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCustomFieldRequestFilterLogic(val *PatchedWritableCustomFieldRequestFilterLogic) *NullablePatchedWritableCustomFieldRequestFilterLogic { + return &NullablePatchedWritableCustomFieldRequestFilterLogic{value: val, isSet: true} +} + +func (v NullablePatchedWritableCustomFieldRequestFilterLogic) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCustomFieldRequestFilterLogic) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_type.go new file mode 100644 index 00000000..ec78ca2f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_type.go @@ -0,0 +1,132 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableCustomFieldRequestType The type of data this custom field holds * `text` - Text * `longtext` - Text (long) * `integer` - Integer * `decimal` - Decimal * `boolean` - Boolean (true/false) * `date` - Date * `datetime` - Date & time * `url` - URL * `json` - JSON * `select` - Selection * `multiselect` - Multiple selection * `object` - Object * `multiobject` - Multiple objects +type PatchedWritableCustomFieldRequestType string + +// List of PatchedWritableCustomFieldRequest_type +const ( + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_TEXT PatchedWritableCustomFieldRequestType = "text" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_LONGTEXT PatchedWritableCustomFieldRequestType = "longtext" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_INTEGER PatchedWritableCustomFieldRequestType = "integer" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_DECIMAL PatchedWritableCustomFieldRequestType = "decimal" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_BOOLEAN PatchedWritableCustomFieldRequestType = "boolean" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_DATE PatchedWritableCustomFieldRequestType = "date" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_DATETIME PatchedWritableCustomFieldRequestType = "datetime" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_URL PatchedWritableCustomFieldRequestType = "url" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_JSON PatchedWritableCustomFieldRequestType = "json" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_SELECT PatchedWritableCustomFieldRequestType = "select" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_MULTISELECT PatchedWritableCustomFieldRequestType = "multiselect" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_OBJECT PatchedWritableCustomFieldRequestType = "object" + PATCHEDWRITABLECUSTOMFIELDREQUESTTYPE_MULTIOBJECT PatchedWritableCustomFieldRequestType = "multiobject" +) + +// All allowed values of PatchedWritableCustomFieldRequestType enum +var AllowedPatchedWritableCustomFieldRequestTypeEnumValues = []PatchedWritableCustomFieldRequestType{ + "text", + "longtext", + "integer", + "decimal", + "boolean", + "date", + "datetime", + "url", + "json", + "select", + "multiselect", + "object", + "multiobject", +} + +func (v *PatchedWritableCustomFieldRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableCustomFieldRequestType(value) + for _, existing := range AllowedPatchedWritableCustomFieldRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableCustomFieldRequestType", value) +} + +// NewPatchedWritableCustomFieldRequestTypeFromValue returns a pointer to a valid PatchedWritableCustomFieldRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableCustomFieldRequestTypeFromValue(v string) (*PatchedWritableCustomFieldRequestType, error) { + ev := PatchedWritableCustomFieldRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableCustomFieldRequestType: valid values are %v", v, AllowedPatchedWritableCustomFieldRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableCustomFieldRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritableCustomFieldRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableCustomFieldRequest_type value +func (v PatchedWritableCustomFieldRequestType) Ptr() *PatchedWritableCustomFieldRequestType { + return &v +} + +type NullablePatchedWritableCustomFieldRequestType struct { + value *PatchedWritableCustomFieldRequestType + isSet bool +} + +func (v NullablePatchedWritableCustomFieldRequestType) Get() *PatchedWritableCustomFieldRequestType { + return v.value +} + +func (v *NullablePatchedWritableCustomFieldRequestType) Set(val *PatchedWritableCustomFieldRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCustomFieldRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCustomFieldRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCustomFieldRequestType(val *PatchedWritableCustomFieldRequestType) *NullablePatchedWritableCustomFieldRequestType { + return &NullablePatchedWritableCustomFieldRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritableCustomFieldRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCustomFieldRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_ui_editable.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_ui_editable.go new file mode 100644 index 00000000..11651682 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_ui_editable.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableCustomFieldRequestUiEditable Specifies whether the custom field value can be edited in the UI * `yes` - Yes * `no` - No * `hidden` - Hidden +type PatchedWritableCustomFieldRequestUiEditable string + +// List of PatchedWritableCustomFieldRequest_ui_editable +const ( + PATCHEDWRITABLECUSTOMFIELDREQUESTUIEDITABLE_YES PatchedWritableCustomFieldRequestUiEditable = "yes" + PATCHEDWRITABLECUSTOMFIELDREQUESTUIEDITABLE_NO PatchedWritableCustomFieldRequestUiEditable = "no" + PATCHEDWRITABLECUSTOMFIELDREQUESTUIEDITABLE_HIDDEN PatchedWritableCustomFieldRequestUiEditable = "hidden" +) + +// All allowed values of PatchedWritableCustomFieldRequestUiEditable enum +var AllowedPatchedWritableCustomFieldRequestUiEditableEnumValues = []PatchedWritableCustomFieldRequestUiEditable{ + "yes", + "no", + "hidden", +} + +func (v *PatchedWritableCustomFieldRequestUiEditable) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableCustomFieldRequestUiEditable(value) + for _, existing := range AllowedPatchedWritableCustomFieldRequestUiEditableEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableCustomFieldRequestUiEditable", value) +} + +// NewPatchedWritableCustomFieldRequestUiEditableFromValue returns a pointer to a valid PatchedWritableCustomFieldRequestUiEditable +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableCustomFieldRequestUiEditableFromValue(v string) (*PatchedWritableCustomFieldRequestUiEditable, error) { + ev := PatchedWritableCustomFieldRequestUiEditable(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableCustomFieldRequestUiEditable: valid values are %v", v, AllowedPatchedWritableCustomFieldRequestUiEditableEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableCustomFieldRequestUiEditable) IsValid() bool { + for _, existing := range AllowedPatchedWritableCustomFieldRequestUiEditableEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableCustomFieldRequest_ui_editable value +func (v PatchedWritableCustomFieldRequestUiEditable) Ptr() *PatchedWritableCustomFieldRequestUiEditable { + return &v +} + +type NullablePatchedWritableCustomFieldRequestUiEditable struct { + value *PatchedWritableCustomFieldRequestUiEditable + isSet bool +} + +func (v NullablePatchedWritableCustomFieldRequestUiEditable) Get() *PatchedWritableCustomFieldRequestUiEditable { + return v.value +} + +func (v *NullablePatchedWritableCustomFieldRequestUiEditable) Set(val *PatchedWritableCustomFieldRequestUiEditable) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCustomFieldRequestUiEditable) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCustomFieldRequestUiEditable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCustomFieldRequestUiEditable(val *PatchedWritableCustomFieldRequestUiEditable) *NullablePatchedWritableCustomFieldRequestUiEditable { + return &NullablePatchedWritableCustomFieldRequestUiEditable{value: val, isSet: true} +} + +func (v NullablePatchedWritableCustomFieldRequestUiEditable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCustomFieldRequestUiEditable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_ui_visible.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_ui_visible.go new file mode 100644 index 00000000..f7545aea --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_custom_field_request_ui_visible.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableCustomFieldRequestUiVisible Specifies whether the custom field is displayed in the UI * `always` - Always * `if-set` - If set * `hidden` - Hidden +type PatchedWritableCustomFieldRequestUiVisible string + +// List of PatchedWritableCustomFieldRequest_ui_visible +const ( + PATCHEDWRITABLECUSTOMFIELDREQUESTUIVISIBLE_ALWAYS PatchedWritableCustomFieldRequestUiVisible = "always" + PATCHEDWRITABLECUSTOMFIELDREQUESTUIVISIBLE_IF_SET PatchedWritableCustomFieldRequestUiVisible = "if-set" + PATCHEDWRITABLECUSTOMFIELDREQUESTUIVISIBLE_HIDDEN PatchedWritableCustomFieldRequestUiVisible = "hidden" +) + +// All allowed values of PatchedWritableCustomFieldRequestUiVisible enum +var AllowedPatchedWritableCustomFieldRequestUiVisibleEnumValues = []PatchedWritableCustomFieldRequestUiVisible{ + "always", + "if-set", + "hidden", +} + +func (v *PatchedWritableCustomFieldRequestUiVisible) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableCustomFieldRequestUiVisible(value) + for _, existing := range AllowedPatchedWritableCustomFieldRequestUiVisibleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableCustomFieldRequestUiVisible", value) +} + +// NewPatchedWritableCustomFieldRequestUiVisibleFromValue returns a pointer to a valid PatchedWritableCustomFieldRequestUiVisible +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableCustomFieldRequestUiVisibleFromValue(v string) (*PatchedWritableCustomFieldRequestUiVisible, error) { + ev := PatchedWritableCustomFieldRequestUiVisible(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableCustomFieldRequestUiVisible: valid values are %v", v, AllowedPatchedWritableCustomFieldRequestUiVisibleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableCustomFieldRequestUiVisible) IsValid() bool { + for _, existing := range AllowedPatchedWritableCustomFieldRequestUiVisibleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableCustomFieldRequest_ui_visible value +func (v PatchedWritableCustomFieldRequestUiVisible) Ptr() *PatchedWritableCustomFieldRequestUiVisible { + return &v +} + +type NullablePatchedWritableCustomFieldRequestUiVisible struct { + value *PatchedWritableCustomFieldRequestUiVisible + isSet bool +} + +func (v NullablePatchedWritableCustomFieldRequestUiVisible) Get() *PatchedWritableCustomFieldRequestUiVisible { + return v.value +} + +func (v *NullablePatchedWritableCustomFieldRequestUiVisible) Set(val *PatchedWritableCustomFieldRequestUiVisible) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableCustomFieldRequestUiVisible) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableCustomFieldRequestUiVisible) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableCustomFieldRequestUiVisible(val *PatchedWritableCustomFieldRequestUiVisible) *NullablePatchedWritableCustomFieldRequestUiVisible { + return &NullablePatchedWritableCustomFieldRequestUiVisible{value: val, isSet: true} +} + +func (v NullablePatchedWritableCustomFieldRequestUiVisible) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableCustomFieldRequestUiVisible) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_data_source_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_data_source_request.go new file mode 100644 index 00000000..4d229549 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_data_source_request.go @@ -0,0 +1,414 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableDataSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableDataSourceRequest{} + +// PatchedWritableDataSourceRequest Adds support for custom fields and tags. +type PatchedWritableDataSourceRequest struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + SourceUrl *string `json:"source_url,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` + // Patterns (one per line) matching files to ignore when syncing + IgnoreRules *string `json:"ignore_rules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableDataSourceRequest PatchedWritableDataSourceRequest + +// NewPatchedWritableDataSourceRequest instantiates a new PatchedWritableDataSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableDataSourceRequest() *PatchedWritableDataSourceRequest { + this := PatchedWritableDataSourceRequest{} + return &this +} + +// NewPatchedWritableDataSourceRequestWithDefaults instantiates a new PatchedWritableDataSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableDataSourceRequestWithDefaults() *PatchedWritableDataSourceRequest { + this := PatchedWritableDataSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableDataSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDataSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableDataSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableDataSourceRequest) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDataSourceRequest) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PatchedWritableDataSourceRequest) SetType(v string) { + o.Type = &v +} + +// GetSourceUrl returns the SourceUrl field value if set, zero value otherwise. +func (o *PatchedWritableDataSourceRequest) GetSourceUrl() string { + if o == nil || IsNil(o.SourceUrl) { + var ret string + return ret + } + return *o.SourceUrl +} + +// GetSourceUrlOk returns a tuple with the SourceUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDataSourceRequest) GetSourceUrlOk() (*string, bool) { + if o == nil || IsNil(o.SourceUrl) { + return nil, false + } + return o.SourceUrl, true +} + +// HasSourceUrl returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasSourceUrl() bool { + if o != nil && !IsNil(o.SourceUrl) { + return true + } + + return false +} + +// SetSourceUrl gets a reference to the given string and assigns it to the SourceUrl field. +func (o *PatchedWritableDataSourceRequest) SetSourceUrl(v string) { + o.SourceUrl = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedWritableDataSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDataSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedWritableDataSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableDataSourceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDataSourceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableDataSourceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableDataSourceRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDataSourceRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableDataSourceRequest) SetComments(v string) { + o.Comments = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDataSourceRequest) GetParameters() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDataSourceRequest) GetParametersOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasParameters() bool { + if o != nil && IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given interface{} and assigns it to the Parameters field. +func (o *PatchedWritableDataSourceRequest) SetParameters(v interface{}) { + o.Parameters = v +} + +// GetIgnoreRules returns the IgnoreRules field value if set, zero value otherwise. +func (o *PatchedWritableDataSourceRequest) GetIgnoreRules() string { + if o == nil || IsNil(o.IgnoreRules) { + var ret string + return ret + } + return *o.IgnoreRules +} + +// GetIgnoreRulesOk returns a tuple with the IgnoreRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDataSourceRequest) GetIgnoreRulesOk() (*string, bool) { + if o == nil || IsNil(o.IgnoreRules) { + return nil, false + } + return o.IgnoreRules, true +} + +// HasIgnoreRules returns a boolean if a field has been set. +func (o *PatchedWritableDataSourceRequest) HasIgnoreRules() bool { + if o != nil && !IsNil(o.IgnoreRules) { + return true + } + + return false +} + +// SetIgnoreRules gets a reference to the given string and assigns it to the IgnoreRules field. +func (o *PatchedWritableDataSourceRequest) SetIgnoreRules(v string) { + o.IgnoreRules = &v +} + +func (o PatchedWritableDataSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableDataSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.SourceUrl) { + toSerialize["source_url"] = o.SourceUrl + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.IgnoreRules) { + toSerialize["ignore_rules"] = o.IgnoreRules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableDataSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableDataSourceRequest := _PatchedWritableDataSourceRequest{} + + err = json.Unmarshal(data, &varPatchedWritableDataSourceRequest) + + if err != nil { + return err + } + + *o = PatchedWritableDataSourceRequest(varPatchedWritableDataSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "source_url") + delete(additionalProperties, "enabled") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "parameters") + delete(additionalProperties, "ignore_rules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableDataSourceRequest struct { + value *PatchedWritableDataSourceRequest + isSet bool +} + +func (v NullablePatchedWritableDataSourceRequest) Get() *PatchedWritableDataSourceRequest { + return v.value +} + +func (v *NullablePatchedWritableDataSourceRequest) Set(val *PatchedWritableDataSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableDataSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableDataSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableDataSourceRequest(val *PatchedWritableDataSourceRequest) *NullablePatchedWritableDataSourceRequest { + return &NullablePatchedWritableDataSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableDataSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableDataSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_bay_request.go new file mode 100644 index 00000000..a6032e58 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_bay_request.go @@ -0,0 +1,387 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableDeviceBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableDeviceBayRequest{} + +// PatchedWritableDeviceBayRequest Adds support for custom fields and tags. +type PatchedWritableDeviceBayRequest struct { + Device *int32 `json:"device,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + InstalledDevice NullableInt32 `json:"installed_device,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableDeviceBayRequest PatchedWritableDeviceBayRequest + +// NewPatchedWritableDeviceBayRequest instantiates a new PatchedWritableDeviceBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableDeviceBayRequest() *PatchedWritableDeviceBayRequest { + this := PatchedWritableDeviceBayRequest{} + return &this +} + +// NewPatchedWritableDeviceBayRequestWithDefaults instantiates a new PatchedWritableDeviceBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableDeviceBayRequestWithDefaults() *PatchedWritableDeviceBayRequest { + this := PatchedWritableDeviceBayRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableDeviceBayRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableDeviceBayRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableDeviceBayRequest) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableDeviceBayRequest) SetDescription(v string) { + o.Description = &v +} + +// GetInstalledDevice returns the InstalledDevice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceBayRequest) GetInstalledDevice() int32 { + if o == nil || IsNil(o.InstalledDevice.Get()) { + var ret int32 + return ret + } + return *o.InstalledDevice.Get() +} + +// GetInstalledDeviceOk returns a tuple with the InstalledDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceBayRequest) GetInstalledDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.InstalledDevice.Get(), o.InstalledDevice.IsSet() +} + +// HasInstalledDevice returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayRequest) HasInstalledDevice() bool { + if o != nil && o.InstalledDevice.IsSet() { + return true + } + + return false +} + +// SetInstalledDevice gets a reference to the given NullableInt32 and assigns it to the InstalledDevice field. +func (o *PatchedWritableDeviceBayRequest) SetInstalledDevice(v int32) { + o.InstalledDevice.Set(&v) +} + +// SetInstalledDeviceNil sets the value for InstalledDevice to be an explicit nil +func (o *PatchedWritableDeviceBayRequest) SetInstalledDeviceNil() { + o.InstalledDevice.Set(nil) +} + +// UnsetInstalledDevice ensures that no value is present for InstalledDevice, not even an explicit nil +func (o *PatchedWritableDeviceBayRequest) UnsetInstalledDevice() { + o.InstalledDevice.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableDeviceBayRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableDeviceBayRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableDeviceBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableDeviceBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.InstalledDevice.IsSet() { + toSerialize["installed_device"] = o.InstalledDevice.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableDeviceBayRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableDeviceBayRequest := _PatchedWritableDeviceBayRequest{} + + err = json.Unmarshal(data, &varPatchedWritableDeviceBayRequest) + + if err != nil { + return err + } + + *o = PatchedWritableDeviceBayRequest(varPatchedWritableDeviceBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + delete(additionalProperties, "installed_device") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableDeviceBayRequest struct { + value *PatchedWritableDeviceBayRequest + isSet bool +} + +func (v NullablePatchedWritableDeviceBayRequest) Get() *PatchedWritableDeviceBayRequest { + return v.value +} + +func (v *NullablePatchedWritableDeviceBayRequest) Set(val *PatchedWritableDeviceBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableDeviceBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableDeviceBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableDeviceBayRequest(val *PatchedWritableDeviceBayRequest) *NullablePatchedWritableDeviceBayRequest { + return &NullablePatchedWritableDeviceBayRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableDeviceBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableDeviceBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_bay_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_bay_template_request.go new file mode 100644 index 00000000..b1dc1bc5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_bay_template_request.go @@ -0,0 +1,266 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableDeviceBayTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableDeviceBayTemplateRequest{} + +// PatchedWritableDeviceBayTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableDeviceBayTemplateRequest struct { + DeviceType *int32 `json:"device_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableDeviceBayTemplateRequest PatchedWritableDeviceBayTemplateRequest + +// NewPatchedWritableDeviceBayTemplateRequest instantiates a new PatchedWritableDeviceBayTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableDeviceBayTemplateRequest() *PatchedWritableDeviceBayTemplateRequest { + this := PatchedWritableDeviceBayTemplateRequest{} + return &this +} + +// NewPatchedWritableDeviceBayTemplateRequestWithDefaults instantiates a new PatchedWritableDeviceBayTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableDeviceBayTemplateRequestWithDefaults() *PatchedWritableDeviceBayTemplateRequest { + this := PatchedWritableDeviceBayTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType) { + var ret int32 + return ret + } + return *o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil || IsNil(o.DeviceType) { + return nil, false + } + return o.DeviceType, true +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) HasDeviceType() bool { + if o != nil && !IsNil(o.DeviceType) { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given int32 and assigns it to the DeviceType field. +func (o *PatchedWritableDeviceBayTemplateRequest) SetDeviceType(v int32) { + o.DeviceType = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableDeviceBayTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableDeviceBayTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableDeviceBayTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableDeviceBayTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableDeviceBayTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritableDeviceBayTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableDeviceBayTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceType) { + toSerialize["device_type"] = o.DeviceType + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableDeviceBayTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableDeviceBayTemplateRequest := _PatchedWritableDeviceBayTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableDeviceBayTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableDeviceBayTemplateRequest(varPatchedWritableDeviceBayTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableDeviceBayTemplateRequest struct { + value *PatchedWritableDeviceBayTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableDeviceBayTemplateRequest) Get() *PatchedWritableDeviceBayTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableDeviceBayTemplateRequest) Set(val *PatchedWritableDeviceBayTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableDeviceBayTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableDeviceBayTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableDeviceBayTemplateRequest(val *PatchedWritableDeviceBayTemplateRequest) *NullablePatchedWritableDeviceBayTemplateRequest { + return &NullablePatchedWritableDeviceBayTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableDeviceBayTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableDeviceBayTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_role_request.go new file mode 100644 index 00000000..5bab6799 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_role_request.go @@ -0,0 +1,424 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableDeviceRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableDeviceRoleRequest{} + +// PatchedWritableDeviceRoleRequest Adds support for custom fields and tags. +type PatchedWritableDeviceRoleRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Color *string `json:"color,omitempty"` + // Virtual machines may be assigned to this role + VmRole *bool `json:"vm_role,omitempty"` + ConfigTemplate NullableInt32 `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableDeviceRoleRequest PatchedWritableDeviceRoleRequest + +// NewPatchedWritableDeviceRoleRequest instantiates a new PatchedWritableDeviceRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableDeviceRoleRequest() *PatchedWritableDeviceRoleRequest { + this := PatchedWritableDeviceRoleRequest{} + return &this +} + +// NewPatchedWritableDeviceRoleRequestWithDefaults instantiates a new PatchedWritableDeviceRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableDeviceRoleRequestWithDefaults() *PatchedWritableDeviceRoleRequest { + this := PatchedWritableDeviceRoleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableDeviceRoleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceRoleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableDeviceRoleRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableDeviceRoleRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceRoleRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableDeviceRoleRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedWritableDeviceRoleRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceRoleRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedWritableDeviceRoleRequest) SetColor(v string) { + o.Color = &v +} + +// GetVmRole returns the VmRole field value if set, zero value otherwise. +func (o *PatchedWritableDeviceRoleRequest) GetVmRole() bool { + if o == nil || IsNil(o.VmRole) { + var ret bool + return ret + } + return *o.VmRole +} + +// GetVmRoleOk returns a tuple with the VmRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceRoleRequest) GetVmRoleOk() (*bool, bool) { + if o == nil || IsNil(o.VmRole) { + return nil, false + } + return o.VmRole, true +} + +// HasVmRole returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasVmRole() bool { + if o != nil && !IsNil(o.VmRole) { + return true + } + + return false +} + +// SetVmRole gets a reference to the given bool and assigns it to the VmRole field. +func (o *PatchedWritableDeviceRoleRequest) SetVmRole(v bool) { + o.VmRole = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceRoleRequest) GetConfigTemplate() int32 { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret int32 + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceRoleRequest) GetConfigTemplateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableInt32 and assigns it to the ConfigTemplate field. +func (o *PatchedWritableDeviceRoleRequest) SetConfigTemplate(v int32) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *PatchedWritableDeviceRoleRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *PatchedWritableDeviceRoleRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableDeviceRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableDeviceRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableDeviceRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableDeviceRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableDeviceRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableDeviceRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableDeviceRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableDeviceRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableDeviceRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.VmRole) { + toSerialize["vm_role"] = o.VmRole + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableDeviceRoleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableDeviceRoleRequest := _PatchedWritableDeviceRoleRequest{} + + err = json.Unmarshal(data, &varPatchedWritableDeviceRoleRequest) + + if err != nil { + return err + } + + *o = PatchedWritableDeviceRoleRequest(varPatchedWritableDeviceRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "vm_role") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableDeviceRoleRequest struct { + value *PatchedWritableDeviceRoleRequest + isSet bool +} + +func (v NullablePatchedWritableDeviceRoleRequest) Get() *PatchedWritableDeviceRoleRequest { + return v.value +} + +func (v *NullablePatchedWritableDeviceRoleRequest) Set(val *PatchedWritableDeviceRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableDeviceRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableDeviceRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableDeviceRoleRequest(val *PatchedWritableDeviceRoleRequest) *NullablePatchedWritableDeviceRoleRequest { + return &NullablePatchedWritableDeviceRoleRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableDeviceRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableDeviceRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_type_request.go new file mode 100644 index 00000000..c08c212e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_type_request.go @@ -0,0 +1,812 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "os" +) + +// checks if the PatchedWritableDeviceTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableDeviceTypeRequest{} + +// PatchedWritableDeviceTypeRequest Adds support for custom fields and tags. +type PatchedWritableDeviceTypeRequest struct { + Manufacturer *int32 `json:"manufacturer,omitempty"` + DefaultPlatform NullableInt32 `json:"default_platform,omitempty"` + Model *string `json:"model,omitempty"` + Slug *string `json:"slug,omitempty"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + UHeight *float64 `json:"u_height,omitempty"` + // Devices of this type are excluded when calculating rack utilization. + ExcludeFromUtilization *bool `json:"exclude_from_utilization,omitempty"` + // Device consumes both front and rear rack faces. + IsFullDepth *bool `json:"is_full_depth,omitempty"` + SubdeviceRole *ParentChildStatus `json:"subdevice_role,omitempty"` + Airflow *DeviceAirflowValue `json:"airflow,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit *DeviceTypeWeightUnitValue `json:"weight_unit,omitempty"` + FrontImage **os.File `json:"front_image,omitempty"` + RearImage **os.File `json:"rear_image,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableDeviceTypeRequest PatchedWritableDeviceTypeRequest + +// NewPatchedWritableDeviceTypeRequest instantiates a new PatchedWritableDeviceTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableDeviceTypeRequest() *PatchedWritableDeviceTypeRequest { + this := PatchedWritableDeviceTypeRequest{} + var uHeight float64 = 1.0 + this.UHeight = &uHeight + return &this +} + +// NewPatchedWritableDeviceTypeRequestWithDefaults instantiates a new PatchedWritableDeviceTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableDeviceTypeRequestWithDefaults() *PatchedWritableDeviceTypeRequest { + this := PatchedWritableDeviceTypeRequest{} + var uHeight float64 = 1.0 + this.UHeight = &uHeight + return &this +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer) { + var ret int32 + return ret + } + return *o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetManufacturerOk() (*int32, bool) { + if o == nil || IsNil(o.Manufacturer) { + return nil, false + } + return o.Manufacturer, true +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasManufacturer() bool { + if o != nil && !IsNil(o.Manufacturer) { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given int32 and assigns it to the Manufacturer field. +func (o *PatchedWritableDeviceTypeRequest) SetManufacturer(v int32) { + o.Manufacturer = &v +} + +// GetDefaultPlatform returns the DefaultPlatform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceTypeRequest) GetDefaultPlatform() int32 { + if o == nil || IsNil(o.DefaultPlatform.Get()) { + var ret int32 + return ret + } + return *o.DefaultPlatform.Get() +} + +// GetDefaultPlatformOk returns a tuple with the DefaultPlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceTypeRequest) GetDefaultPlatformOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DefaultPlatform.Get(), o.DefaultPlatform.IsSet() +} + +// HasDefaultPlatform returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasDefaultPlatform() bool { + if o != nil && o.DefaultPlatform.IsSet() { + return true + } + + return false +} + +// SetDefaultPlatform gets a reference to the given NullableInt32 and assigns it to the DefaultPlatform field. +func (o *PatchedWritableDeviceTypeRequest) SetDefaultPlatform(v int32) { + o.DefaultPlatform.Set(&v) +} + +// SetDefaultPlatformNil sets the value for DefaultPlatform to be an explicit nil +func (o *PatchedWritableDeviceTypeRequest) SetDefaultPlatformNil() { + o.DefaultPlatform.Set(nil) +} + +// UnsetDefaultPlatform ensures that no value is present for DefaultPlatform, not even an explicit nil +func (o *PatchedWritableDeviceTypeRequest) UnsetDefaultPlatform() { + o.DefaultPlatform.Unset() +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetModel() string { + if o == nil || IsNil(o.Model) { + var ret string + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetModelOk() (*string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given string and assigns it to the Model field. +func (o *PatchedWritableDeviceTypeRequest) SetModel(v string) { + o.Model = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableDeviceTypeRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *PatchedWritableDeviceTypeRequest) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetUHeight() float64 { + if o == nil || IsNil(o.UHeight) { + var ret float64 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetUHeightOk() (*float64, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given float64 and assigns it to the UHeight field. +func (o *PatchedWritableDeviceTypeRequest) SetUHeight(v float64) { + o.UHeight = &v +} + +// GetExcludeFromUtilization returns the ExcludeFromUtilization field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetExcludeFromUtilization() bool { + if o == nil || IsNil(o.ExcludeFromUtilization) { + var ret bool + return ret + } + return *o.ExcludeFromUtilization +} + +// GetExcludeFromUtilizationOk returns a tuple with the ExcludeFromUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetExcludeFromUtilizationOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeFromUtilization) { + return nil, false + } + return o.ExcludeFromUtilization, true +} + +// HasExcludeFromUtilization returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasExcludeFromUtilization() bool { + if o != nil && !IsNil(o.ExcludeFromUtilization) { + return true + } + + return false +} + +// SetExcludeFromUtilization gets a reference to the given bool and assigns it to the ExcludeFromUtilization field. +func (o *PatchedWritableDeviceTypeRequest) SetExcludeFromUtilization(v bool) { + o.ExcludeFromUtilization = &v +} + +// GetIsFullDepth returns the IsFullDepth field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetIsFullDepth() bool { + if o == nil || IsNil(o.IsFullDepth) { + var ret bool + return ret + } + return *o.IsFullDepth +} + +// GetIsFullDepthOk returns a tuple with the IsFullDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetIsFullDepthOk() (*bool, bool) { + if o == nil || IsNil(o.IsFullDepth) { + return nil, false + } + return o.IsFullDepth, true +} + +// HasIsFullDepth returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasIsFullDepth() bool { + if o != nil && !IsNil(o.IsFullDepth) { + return true + } + + return false +} + +// SetIsFullDepth gets a reference to the given bool and assigns it to the IsFullDepth field. +func (o *PatchedWritableDeviceTypeRequest) SetIsFullDepth(v bool) { + o.IsFullDepth = &v +} + +// GetSubdeviceRole returns the SubdeviceRole field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetSubdeviceRole() ParentChildStatus { + if o == nil || IsNil(o.SubdeviceRole) { + var ret ParentChildStatus + return ret + } + return *o.SubdeviceRole +} + +// GetSubdeviceRoleOk returns a tuple with the SubdeviceRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetSubdeviceRoleOk() (*ParentChildStatus, bool) { + if o == nil || IsNil(o.SubdeviceRole) { + return nil, false + } + return o.SubdeviceRole, true +} + +// HasSubdeviceRole returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasSubdeviceRole() bool { + if o != nil && !IsNil(o.SubdeviceRole) { + return true + } + + return false +} + +// SetSubdeviceRole gets a reference to the given ParentChildStatus and assigns it to the SubdeviceRole field. +func (o *PatchedWritableDeviceTypeRequest) SetSubdeviceRole(v ParentChildStatus) { + o.SubdeviceRole = &v +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetAirflow() DeviceAirflowValue { + if o == nil || IsNil(o.Airflow) { + var ret DeviceAirflowValue + return ret + } + return *o.Airflow +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetAirflowOk() (*DeviceAirflowValue, bool) { + if o == nil || IsNil(o.Airflow) { + return nil, false + } + return o.Airflow, true +} + +// HasAirflow returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasAirflow() bool { + if o != nil && !IsNil(o.Airflow) { + return true + } + + return false +} + +// SetAirflow gets a reference to the given DeviceAirflowValue and assigns it to the Airflow field. +func (o *PatchedWritableDeviceTypeRequest) SetAirflow(v DeviceAirflowValue) { + o.Airflow = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceTypeRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceTypeRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *PatchedWritableDeviceTypeRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *PatchedWritableDeviceTypeRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *PatchedWritableDeviceTypeRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetWeightUnit() DeviceTypeWeightUnitValue { + if o == nil || IsNil(o.WeightUnit) { + var ret DeviceTypeWeightUnitValue + return ret + } + return *o.WeightUnit +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetWeightUnitOk() (*DeviceTypeWeightUnitValue, bool) { + if o == nil || IsNil(o.WeightUnit) { + return nil, false + } + return o.WeightUnit, true +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasWeightUnit() bool { + if o != nil && !IsNil(o.WeightUnit) { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given DeviceTypeWeightUnitValue and assigns it to the WeightUnit field. +func (o *PatchedWritableDeviceTypeRequest) SetWeightUnit(v DeviceTypeWeightUnitValue) { + o.WeightUnit = &v +} + +// GetFrontImage returns the FrontImage field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetFrontImage() *os.File { + if o == nil || IsNil(o.FrontImage) { + var ret *os.File + return ret + } + return *o.FrontImage +} + +// GetFrontImageOk returns a tuple with the FrontImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetFrontImageOk() (**os.File, bool) { + if o == nil || IsNil(o.FrontImage) { + return nil, false + } + return o.FrontImage, true +} + +// HasFrontImage returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasFrontImage() bool { + if o != nil && !IsNil(o.FrontImage) { + return true + } + + return false +} + +// SetFrontImage gets a reference to the given *os.File and assigns it to the FrontImage field. +func (o *PatchedWritableDeviceTypeRequest) SetFrontImage(v *os.File) { + o.FrontImage = &v +} + +// GetRearImage returns the RearImage field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetRearImage() *os.File { + if o == nil || IsNil(o.RearImage) { + var ret *os.File + return ret + } + return *o.RearImage +} + +// GetRearImageOk returns a tuple with the RearImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetRearImageOk() (**os.File, bool) { + if o == nil || IsNil(o.RearImage) { + return nil, false + } + return o.RearImage, true +} + +// HasRearImage returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasRearImage() bool { + if o != nil && !IsNil(o.RearImage) { + return true + } + + return false +} + +// SetRearImage gets a reference to the given *os.File and assigns it to the RearImage field. +func (o *PatchedWritableDeviceTypeRequest) SetRearImage(v *os.File) { + o.RearImage = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableDeviceTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableDeviceTypeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableDeviceTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableDeviceTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableDeviceTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableDeviceTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableDeviceTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableDeviceTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Manufacturer) { + toSerialize["manufacturer"] = o.Manufacturer + } + if o.DefaultPlatform.IsSet() { + toSerialize["default_platform"] = o.DefaultPlatform.Get() + } + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.ExcludeFromUtilization) { + toSerialize["exclude_from_utilization"] = o.ExcludeFromUtilization + } + if !IsNil(o.IsFullDepth) { + toSerialize["is_full_depth"] = o.IsFullDepth + } + if !IsNil(o.SubdeviceRole) { + toSerialize["subdevice_role"] = o.SubdeviceRole + } + if !IsNil(o.Airflow) { + toSerialize["airflow"] = o.Airflow + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if !IsNil(o.WeightUnit) { + toSerialize["weight_unit"] = o.WeightUnit + } + if !IsNil(o.FrontImage) { + toSerialize["front_image"] = o.FrontImage + } + if !IsNil(o.RearImage) { + toSerialize["rear_image"] = o.RearImage + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableDeviceTypeRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableDeviceTypeRequest := _PatchedWritableDeviceTypeRequest{} + + err = json.Unmarshal(data, &varPatchedWritableDeviceTypeRequest) + + if err != nil { + return err + } + + *o = PatchedWritableDeviceTypeRequest(varPatchedWritableDeviceTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "default_platform") + delete(additionalProperties, "model") + delete(additionalProperties, "slug") + delete(additionalProperties, "part_number") + delete(additionalProperties, "u_height") + delete(additionalProperties, "exclude_from_utilization") + delete(additionalProperties, "is_full_depth") + delete(additionalProperties, "subdevice_role") + delete(additionalProperties, "airflow") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "front_image") + delete(additionalProperties, "rear_image") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableDeviceTypeRequest struct { + value *PatchedWritableDeviceTypeRequest + isSet bool +} + +func (v NullablePatchedWritableDeviceTypeRequest) Get() *PatchedWritableDeviceTypeRequest { + return v.value +} + +func (v *NullablePatchedWritableDeviceTypeRequest) Set(val *PatchedWritableDeviceTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableDeviceTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableDeviceTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableDeviceTypeRequest(val *PatchedWritableDeviceTypeRequest) *NullablePatchedWritableDeviceTypeRequest { + return &NullablePatchedWritableDeviceTypeRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableDeviceTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableDeviceTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_with_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_with_config_context_request.go new file mode 100644 index 00000000..6f185bcb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_device_with_config_context_request.go @@ -0,0 +1,1384 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableDeviceWithConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableDeviceWithConfigContextRequest{} + +// PatchedWritableDeviceWithConfigContextRequest Adds support for custom fields and tags. +type PatchedWritableDeviceWithConfigContextRequest struct { + Name NullableString `json:"name,omitempty"` + DeviceType *int32 `json:"device_type,omitempty"` + // The function this device serves + Role *int32 `json:"role,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Platform NullableInt32 `json:"platform,omitempty"` + // Chassis serial number, assigned by the manufacturer + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Site *int32 `json:"site,omitempty"` + Location NullableInt32 `json:"location,omitempty"` + Rack NullableInt32 `json:"rack,omitempty"` + Position NullableFloat64 `json:"position,omitempty"` + Face *RackFace `json:"face,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + Status *DeviceStatusValue `json:"status,omitempty"` + Airflow *DeviceAirflowValue `json:"airflow,omitempty"` + PrimaryIp4 NullableInt32 `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableInt32 `json:"primary_ip6,omitempty"` + OobIp NullableInt32 `json:"oob_ip,omitempty"` + Cluster NullableInt32 `json:"cluster,omitempty"` + VirtualChassis NullableInt32 `json:"virtual_chassis,omitempty"` + VcPosition NullableInt32 `json:"vc_position,omitempty"` + // Virtual chassis master election priority + VcPriority NullableInt32 `json:"vc_priority,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ConfigTemplate NullableInt32 `json:"config_template,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableDeviceWithConfigContextRequest PatchedWritableDeviceWithConfigContextRequest + +// NewPatchedWritableDeviceWithConfigContextRequest instantiates a new PatchedWritableDeviceWithConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableDeviceWithConfigContextRequest() *PatchedWritableDeviceWithConfigContextRequest { + this := PatchedWritableDeviceWithConfigContextRequest{} + return &this +} + +// NewPatchedWritableDeviceWithConfigContextRequestWithDefaults instantiates a new PatchedWritableDeviceWithConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableDeviceWithConfigContextRequestWithDefaults() *PatchedWritableDeviceWithConfigContextRequest { + this := PatchedWritableDeviceWithConfigContextRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetName(v string) { + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetName() { + o.Name.Unset() +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType) { + var ret int32 + return ret + } + return *o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil || IsNil(o.DeviceType) { + return nil, false + } + return o.DeviceType, true +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasDeviceType() bool { + if o != nil && !IsNil(o.DeviceType) { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given int32 and assigns it to the DeviceType field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetDeviceType(v int32) { + o.DeviceType = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetRole() int32 { + if o == nil || IsNil(o.Role) { + var ret int32 + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetRoleOk() (*int32, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given int32 and assigns it to the Role field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetRole(v int32) { + o.Role = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPlatform() int32 { + if o == nil || IsNil(o.Platform.Get()) { + var ret int32 + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPlatformOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableInt32 and assigns it to the Platform field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPlatform(v int32) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetPlatform() { + o.Platform.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetSite returns the Site field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetSite() int32 { + if o == nil || IsNil(o.Site) { + var ret int32 + return ret + } + return *o.Site +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetSiteOk() (*int32, bool) { + if o == nil || IsNil(o.Site) { + return nil, false + } + return o.Site, true +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasSite() bool { + if o != nil && !IsNil(o.Site) { + return true + } + + return false +} + +// SetSite gets a reference to the given int32 and assigns it to the Site field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetSite(v int32) { + o.Site = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLocation() int32 { + if o == nil || IsNil(o.Location.Get()) { + var ret int32 + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLocationOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableInt32 and assigns it to the Location field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetLocation(v int32) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetRack() int32 { + if o == nil || IsNil(o.Rack.Get()) { + var ret int32 + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetRackOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableInt32 and assigns it to the Rack field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetRack(v int32) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetRack() { + o.Rack.Unset() +} + +// GetPosition returns the Position field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPosition() float64 { + if o == nil || IsNil(o.Position.Get()) { + var ret float64 + return ret + } + return *o.Position.Get() +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPositionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Position.Get(), o.Position.IsSet() +} + +// HasPosition returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasPosition() bool { + if o != nil && o.Position.IsSet() { + return true + } + + return false +} + +// SetPosition gets a reference to the given NullableFloat64 and assigns it to the Position field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPosition(v float64) { + o.Position.Set(&v) +} + +// SetPositionNil sets the value for Position to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPositionNil() { + o.Position.Set(nil) +} + +// UnsetPosition ensures that no value is present for Position, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetPosition() { + o.Position.Unset() +} + +// GetFace returns the Face field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetFace() RackFace { + if o == nil || IsNil(o.Face) { + var ret RackFace + return ret + } + return *o.Face +} + +// GetFaceOk returns a tuple with the Face field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetFaceOk() (*RackFace, bool) { + if o == nil || IsNil(o.Face) { + return nil, false + } + return o.Face, true +} + +// HasFace returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasFace() bool { + if o != nil && !IsNil(o.Face) { + return true + } + + return false +} + +// SetFace gets a reference to the given RackFace and assigns it to the Face field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetFace(v RackFace) { + o.Face = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetStatus() DeviceStatusValue { + if o == nil || IsNil(o.Status) { + var ret DeviceStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetStatusOk() (*DeviceStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given DeviceStatusValue and assigns it to the Status field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetStatus(v DeviceStatusValue) { + o.Status = &v +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetAirflow() DeviceAirflowValue { + if o == nil || IsNil(o.Airflow) { + var ret DeviceAirflowValue + return ret + } + return *o.Airflow +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetAirflowOk() (*DeviceAirflowValue, bool) { + if o == nil || IsNil(o.Airflow) { + return nil, false + } + return o.Airflow, true +} + +// HasAirflow returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasAirflow() bool { + if o != nil && !IsNil(o.Airflow) { + return true + } + + return false +} + +// SetAirflow gets a reference to the given DeviceAirflowValue and assigns it to the Airflow field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetAirflow(v DeviceAirflowValue) { + o.Airflow = &v +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPrimaryIp4() int32 { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPrimaryIp4Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp4 field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPrimaryIp4(v int32) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPrimaryIp6() int32 { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetPrimaryIp6Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp6 field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPrimaryIp6(v int32) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetOobIp returns the OobIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetOobIp() int32 { + if o == nil || IsNil(o.OobIp.Get()) { + var ret int32 + return ret + } + return *o.OobIp.Get() +} + +// GetOobIpOk returns a tuple with the OobIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetOobIpOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OobIp.Get(), o.OobIp.IsSet() +} + +// HasOobIp returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasOobIp() bool { + if o != nil && o.OobIp.IsSet() { + return true + } + + return false +} + +// SetOobIp gets a reference to the given NullableInt32 and assigns it to the OobIp field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetOobIp(v int32) { + o.OobIp.Set(&v) +} + +// SetOobIpNil sets the value for OobIp to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetOobIpNil() { + o.OobIp.Set(nil) +} + +// UnsetOobIp ensures that no value is present for OobIp, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetOobIp() { + o.OobIp.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetCluster() int32 { + if o == nil || IsNil(o.Cluster.Get()) { + var ret int32 + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetClusterOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableInt32 and assigns it to the Cluster field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetCluster(v int32) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetCluster() { + o.Cluster.Unset() +} + +// GetVirtualChassis returns the VirtualChassis field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetVirtualChassis() int32 { + if o == nil || IsNil(o.VirtualChassis.Get()) { + var ret int32 + return ret + } + return *o.VirtualChassis.Get() +} + +// GetVirtualChassisOk returns a tuple with the VirtualChassis field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetVirtualChassisOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VirtualChassis.Get(), o.VirtualChassis.IsSet() +} + +// HasVirtualChassis returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasVirtualChassis() bool { + if o != nil && o.VirtualChassis.IsSet() { + return true + } + + return false +} + +// SetVirtualChassis gets a reference to the given NullableInt32 and assigns it to the VirtualChassis field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetVirtualChassis(v int32) { + o.VirtualChassis.Set(&v) +} + +// SetVirtualChassisNil sets the value for VirtualChassis to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetVirtualChassisNil() { + o.VirtualChassis.Set(nil) +} + +// UnsetVirtualChassis ensures that no value is present for VirtualChassis, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetVirtualChassis() { + o.VirtualChassis.Unset() +} + +// GetVcPosition returns the VcPosition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetVcPosition() int32 { + if o == nil || IsNil(o.VcPosition.Get()) { + var ret int32 + return ret + } + return *o.VcPosition.Get() +} + +// GetVcPositionOk returns a tuple with the VcPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetVcPositionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPosition.Get(), o.VcPosition.IsSet() +} + +// HasVcPosition returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasVcPosition() bool { + if o != nil && o.VcPosition.IsSet() { + return true + } + + return false +} + +// SetVcPosition gets a reference to the given NullableInt32 and assigns it to the VcPosition field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetVcPosition(v int32) { + o.VcPosition.Set(&v) +} + +// SetVcPositionNil sets the value for VcPosition to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetVcPositionNil() { + o.VcPosition.Set(nil) +} + +// UnsetVcPosition ensures that no value is present for VcPosition, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetVcPosition() { + o.VcPosition.Unset() +} + +// GetVcPriority returns the VcPriority field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetVcPriority() int32 { + if o == nil || IsNil(o.VcPriority.Get()) { + var ret int32 + return ret + } + return *o.VcPriority.Get() +} + +// GetVcPriorityOk returns a tuple with the VcPriority field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetVcPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPriority.Get(), o.VcPriority.IsSet() +} + +// HasVcPriority returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasVcPriority() bool { + if o != nil && o.VcPriority.IsSet() { + return true + } + + return false +} + +// SetVcPriority gets a reference to the given NullableInt32 and assigns it to the VcPriority field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetVcPriority(v int32) { + o.VcPriority.Set(&v) +} + +// SetVcPriorityNil sets the value for VcPriority to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetVcPriorityNil() { + o.VcPriority.Set(nil) +} + +// UnsetVcPriority ensures that no value is present for VcPriority, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetVcPriority() { + o.VcPriority.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetConfigTemplate() int32 { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret int32 + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetConfigTemplateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableInt32 and assigns it to the ConfigTemplate field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetConfigTemplate(v int32) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *PatchedWritableDeviceWithConfigContextRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableDeviceWithConfigContextRequest) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableDeviceWithConfigContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableDeviceWithConfigContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableDeviceWithConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableDeviceWithConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if !IsNil(o.DeviceType) { + toSerialize["device_type"] = o.DeviceType + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Site) { + toSerialize["site"] = o.Site + } + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + if o.Position.IsSet() { + toSerialize["position"] = o.Position.Get() + } + if !IsNil(o.Face) { + toSerialize["face"] = o.Face + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Airflow) { + toSerialize["airflow"] = o.Airflow + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.OobIp.IsSet() { + toSerialize["oob_ip"] = o.OobIp.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.VirtualChassis.IsSet() { + toSerialize["virtual_chassis"] = o.VirtualChassis.Get() + } + if o.VcPosition.IsSet() { + toSerialize["vc_position"] = o.VcPosition.Get() + } + if o.VcPriority.IsSet() { + toSerialize["vc_priority"] = o.VcPriority.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableDeviceWithConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableDeviceWithConfigContextRequest := _PatchedWritableDeviceWithConfigContextRequest{} + + err = json.Unmarshal(data, &varPatchedWritableDeviceWithConfigContextRequest) + + if err != nil { + return err + } + + *o = PatchedWritableDeviceWithConfigContextRequest(varPatchedWritableDeviceWithConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "device_type") + delete(additionalProperties, "role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "rack") + delete(additionalProperties, "position") + delete(additionalProperties, "face") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "status") + delete(additionalProperties, "airflow") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "oob_ip") + delete(additionalProperties, "cluster") + delete(additionalProperties, "virtual_chassis") + delete(additionalProperties, "vc_position") + delete(additionalProperties, "vc_priority") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "config_template") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableDeviceWithConfigContextRequest struct { + value *PatchedWritableDeviceWithConfigContextRequest + isSet bool +} + +func (v NullablePatchedWritableDeviceWithConfigContextRequest) Get() *PatchedWritableDeviceWithConfigContextRequest { + return v.value +} + +func (v *NullablePatchedWritableDeviceWithConfigContextRequest) Set(val *PatchedWritableDeviceWithConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableDeviceWithConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableDeviceWithConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableDeviceWithConfigContextRequest(val *PatchedWritableDeviceWithConfigContextRequest) *NullablePatchedWritableDeviceWithConfigContextRequest { + return &NullablePatchedWritableDeviceWithConfigContextRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableDeviceWithConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableDeviceWithConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_event_rule_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_event_rule_request.go new file mode 100644 index 00000000..6c85400a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_event_rule_request.go @@ -0,0 +1,689 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableEventRuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableEventRuleRequest{} + +// PatchedWritableEventRuleRequest Adds support for custom fields and tags. +type PatchedWritableEventRuleRequest struct { + ContentTypes []string `json:"content_types,omitempty"` + Name *string `json:"name,omitempty"` + // Triggers when a matching object is created. + TypeCreate *bool `json:"type_create,omitempty"` + // Triggers when a matching object is updated. + TypeUpdate *bool `json:"type_update,omitempty"` + // Triggers when a matching object is deleted. + TypeDelete *bool `json:"type_delete,omitempty"` + // Triggers when a job for a matching object is started. + TypeJobStart *bool `json:"type_job_start,omitempty"` + // Triggers when a job for a matching object terminates. + TypeJobEnd *bool `json:"type_job_end,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + // A set of conditions which determine whether the event will be generated. + Conditions interface{} `json:"conditions,omitempty"` + ActionType *EventRuleActionTypeValue `json:"action_type,omitempty"` + ActionObjectType *string `json:"action_object_type,omitempty"` + ActionObjectId NullableInt64 `json:"action_object_id,omitempty"` + Description *string `json:"description,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableEventRuleRequest PatchedWritableEventRuleRequest + +// NewPatchedWritableEventRuleRequest instantiates a new PatchedWritableEventRuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableEventRuleRequest() *PatchedWritableEventRuleRequest { + this := PatchedWritableEventRuleRequest{} + return &this +} + +// NewPatchedWritableEventRuleRequestWithDefaults instantiates a new PatchedWritableEventRuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableEventRuleRequestWithDefaults() *PatchedWritableEventRuleRequest { + this := PatchedWritableEventRuleRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetContentTypes() []string { + if o == nil || IsNil(o.ContentTypes) { + var ret []string + return ret + } + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ContentTypes) { + return nil, false + } + return o.ContentTypes, true +} + +// HasContentTypes returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasContentTypes() bool { + if o != nil && !IsNil(o.ContentTypes) { + return true + } + + return false +} + +// SetContentTypes gets a reference to the given []string and assigns it to the ContentTypes field. +func (o *PatchedWritableEventRuleRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableEventRuleRequest) SetName(v string) { + o.Name = &v +} + +// GetTypeCreate returns the TypeCreate field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetTypeCreate() bool { + if o == nil || IsNil(o.TypeCreate) { + var ret bool + return ret + } + return *o.TypeCreate +} + +// GetTypeCreateOk returns a tuple with the TypeCreate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetTypeCreateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeCreate) { + return nil, false + } + return o.TypeCreate, true +} + +// HasTypeCreate returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasTypeCreate() bool { + if o != nil && !IsNil(o.TypeCreate) { + return true + } + + return false +} + +// SetTypeCreate gets a reference to the given bool and assigns it to the TypeCreate field. +func (o *PatchedWritableEventRuleRequest) SetTypeCreate(v bool) { + o.TypeCreate = &v +} + +// GetTypeUpdate returns the TypeUpdate field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetTypeUpdate() bool { + if o == nil || IsNil(o.TypeUpdate) { + var ret bool + return ret + } + return *o.TypeUpdate +} + +// GetTypeUpdateOk returns a tuple with the TypeUpdate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetTypeUpdateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeUpdate) { + return nil, false + } + return o.TypeUpdate, true +} + +// HasTypeUpdate returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasTypeUpdate() bool { + if o != nil && !IsNil(o.TypeUpdate) { + return true + } + + return false +} + +// SetTypeUpdate gets a reference to the given bool and assigns it to the TypeUpdate field. +func (o *PatchedWritableEventRuleRequest) SetTypeUpdate(v bool) { + o.TypeUpdate = &v +} + +// GetTypeDelete returns the TypeDelete field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetTypeDelete() bool { + if o == nil || IsNil(o.TypeDelete) { + var ret bool + return ret + } + return *o.TypeDelete +} + +// GetTypeDeleteOk returns a tuple with the TypeDelete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetTypeDeleteOk() (*bool, bool) { + if o == nil || IsNil(o.TypeDelete) { + return nil, false + } + return o.TypeDelete, true +} + +// HasTypeDelete returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasTypeDelete() bool { + if o != nil && !IsNil(o.TypeDelete) { + return true + } + + return false +} + +// SetTypeDelete gets a reference to the given bool and assigns it to the TypeDelete field. +func (o *PatchedWritableEventRuleRequest) SetTypeDelete(v bool) { + o.TypeDelete = &v +} + +// GetTypeJobStart returns the TypeJobStart field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetTypeJobStart() bool { + if o == nil || IsNil(o.TypeJobStart) { + var ret bool + return ret + } + return *o.TypeJobStart +} + +// GetTypeJobStartOk returns a tuple with the TypeJobStart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetTypeJobStartOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobStart) { + return nil, false + } + return o.TypeJobStart, true +} + +// HasTypeJobStart returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasTypeJobStart() bool { + if o != nil && !IsNil(o.TypeJobStart) { + return true + } + + return false +} + +// SetTypeJobStart gets a reference to the given bool and assigns it to the TypeJobStart field. +func (o *PatchedWritableEventRuleRequest) SetTypeJobStart(v bool) { + o.TypeJobStart = &v +} + +// GetTypeJobEnd returns the TypeJobEnd field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetTypeJobEnd() bool { + if o == nil || IsNil(o.TypeJobEnd) { + var ret bool + return ret + } + return *o.TypeJobEnd +} + +// GetTypeJobEndOk returns a tuple with the TypeJobEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetTypeJobEndOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobEnd) { + return nil, false + } + return o.TypeJobEnd, true +} + +// HasTypeJobEnd returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasTypeJobEnd() bool { + if o != nil && !IsNil(o.TypeJobEnd) { + return true + } + + return false +} + +// SetTypeJobEnd gets a reference to the given bool and assigns it to the TypeJobEnd field. +func (o *PatchedWritableEventRuleRequest) SetTypeJobEnd(v bool) { + o.TypeJobEnd = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedWritableEventRuleRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableEventRuleRequest) GetConditions() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableEventRuleRequest) GetConditionsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return &o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasConditions() bool { + if o != nil && IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given interface{} and assigns it to the Conditions field. +func (o *PatchedWritableEventRuleRequest) SetConditions(v interface{}) { + o.Conditions = v +} + +// GetActionType returns the ActionType field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetActionType() EventRuleActionTypeValue { + if o == nil || IsNil(o.ActionType) { + var ret EventRuleActionTypeValue + return ret + } + return *o.ActionType +} + +// GetActionTypeOk returns a tuple with the ActionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetActionTypeOk() (*EventRuleActionTypeValue, bool) { + if o == nil || IsNil(o.ActionType) { + return nil, false + } + return o.ActionType, true +} + +// HasActionType returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasActionType() bool { + if o != nil && !IsNil(o.ActionType) { + return true + } + + return false +} + +// SetActionType gets a reference to the given EventRuleActionTypeValue and assigns it to the ActionType field. +func (o *PatchedWritableEventRuleRequest) SetActionType(v EventRuleActionTypeValue) { + o.ActionType = &v +} + +// GetActionObjectType returns the ActionObjectType field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetActionObjectType() string { + if o == nil || IsNil(o.ActionObjectType) { + var ret string + return ret + } + return *o.ActionObjectType +} + +// GetActionObjectTypeOk returns a tuple with the ActionObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetActionObjectTypeOk() (*string, bool) { + if o == nil || IsNil(o.ActionObjectType) { + return nil, false + } + return o.ActionObjectType, true +} + +// HasActionObjectType returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasActionObjectType() bool { + if o != nil && !IsNil(o.ActionObjectType) { + return true + } + + return false +} + +// SetActionObjectType gets a reference to the given string and assigns it to the ActionObjectType field. +func (o *PatchedWritableEventRuleRequest) SetActionObjectType(v string) { + o.ActionObjectType = &v +} + +// GetActionObjectId returns the ActionObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableEventRuleRequest) GetActionObjectId() int64 { + if o == nil || IsNil(o.ActionObjectId.Get()) { + var ret int64 + return ret + } + return *o.ActionObjectId.Get() +} + +// GetActionObjectIdOk returns a tuple with the ActionObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableEventRuleRequest) GetActionObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ActionObjectId.Get(), o.ActionObjectId.IsSet() +} + +// HasActionObjectId returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasActionObjectId() bool { + if o != nil && o.ActionObjectId.IsSet() { + return true + } + + return false +} + +// SetActionObjectId gets a reference to the given NullableInt64 and assigns it to the ActionObjectId field. +func (o *PatchedWritableEventRuleRequest) SetActionObjectId(v int64) { + o.ActionObjectId.Set(&v) +} + +// SetActionObjectIdNil sets the value for ActionObjectId to be an explicit nil +func (o *PatchedWritableEventRuleRequest) SetActionObjectIdNil() { + o.ActionObjectId.Set(nil) +} + +// UnsetActionObjectId ensures that no value is present for ActionObjectId, not even an explicit nil +func (o *PatchedWritableEventRuleRequest) UnsetActionObjectId() { + o.ActionObjectId.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableEventRuleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableEventRuleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableEventRuleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableEventRuleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableEventRuleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableEventRuleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o PatchedWritableEventRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableEventRuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContentTypes) { + toSerialize["content_types"] = o.ContentTypes + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.TypeCreate) { + toSerialize["type_create"] = o.TypeCreate + } + if !IsNil(o.TypeUpdate) { + toSerialize["type_update"] = o.TypeUpdate + } + if !IsNil(o.TypeDelete) { + toSerialize["type_delete"] = o.TypeDelete + } + if !IsNil(o.TypeJobStart) { + toSerialize["type_job_start"] = o.TypeJobStart + } + if !IsNil(o.TypeJobEnd) { + toSerialize["type_job_end"] = o.TypeJobEnd + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Conditions != nil { + toSerialize["conditions"] = o.Conditions + } + if !IsNil(o.ActionType) { + toSerialize["action_type"] = o.ActionType + } + if !IsNil(o.ActionObjectType) { + toSerialize["action_object_type"] = o.ActionObjectType + } + if o.ActionObjectId.IsSet() { + toSerialize["action_object_id"] = o.ActionObjectId.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableEventRuleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableEventRuleRequest := _PatchedWritableEventRuleRequest{} + + err = json.Unmarshal(data, &varPatchedWritableEventRuleRequest) + + if err != nil { + return err + } + + *o = PatchedWritableEventRuleRequest(varPatchedWritableEventRuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "type_create") + delete(additionalProperties, "type_update") + delete(additionalProperties, "type_delete") + delete(additionalProperties, "type_job_start") + delete(additionalProperties, "type_job_end") + delete(additionalProperties, "enabled") + delete(additionalProperties, "conditions") + delete(additionalProperties, "action_type") + delete(additionalProperties, "action_object_type") + delete(additionalProperties, "action_object_id") + delete(additionalProperties, "description") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableEventRuleRequest struct { + value *PatchedWritableEventRuleRequest + isSet bool +} + +func (v NullablePatchedWritableEventRuleRequest) Get() *PatchedWritableEventRuleRequest { + return v.value +} + +func (v *NullablePatchedWritableEventRuleRequest) Set(val *PatchedWritableEventRuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableEventRuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableEventRuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableEventRuleRequest(val *PatchedWritableEventRuleRequest) *NullablePatchedWritableEventRuleRequest { + return &NullablePatchedWritableEventRuleRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableEventRuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableEventRuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_export_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_export_template_request.go new file mode 100644 index 00000000..70ff1e4c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_export_template_request.go @@ -0,0 +1,428 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableExportTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableExportTemplateRequest{} + +// PatchedWritableExportTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableExportTemplateRequest struct { + ContentTypes []string `json:"content_types,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + // Jinja2 template code. The list of objects being exported is passed as a context variable named queryset. + TemplateCode *string `json:"template_code,omitempty"` + // Defaults to text/plain; charset=utf-8 + MimeType *string `json:"mime_type,omitempty"` + // Extension to append to the rendered filename + FileExtension *string `json:"file_extension,omitempty"` + // Download file as attachment + AsAttachment *bool `json:"as_attachment,omitempty"` + // Remote data source + DataSource NullableInt32 `json:"data_source,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableExportTemplateRequest PatchedWritableExportTemplateRequest + +// NewPatchedWritableExportTemplateRequest instantiates a new PatchedWritableExportTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableExportTemplateRequest() *PatchedWritableExportTemplateRequest { + this := PatchedWritableExportTemplateRequest{} + return &this +} + +// NewPatchedWritableExportTemplateRequestWithDefaults instantiates a new PatchedWritableExportTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableExportTemplateRequestWithDefaults() *PatchedWritableExportTemplateRequest { + this := PatchedWritableExportTemplateRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value if set, zero value otherwise. +func (o *PatchedWritableExportTemplateRequest) GetContentTypes() []string { + if o == nil || IsNil(o.ContentTypes) { + var ret []string + return ret + } + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableExportTemplateRequest) GetContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ContentTypes) { + return nil, false + } + return o.ContentTypes, true +} + +// HasContentTypes returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasContentTypes() bool { + if o != nil && !IsNil(o.ContentTypes) { + return true + } + + return false +} + +// SetContentTypes gets a reference to the given []string and assigns it to the ContentTypes field. +func (o *PatchedWritableExportTemplateRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableExportTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableExportTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableExportTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableExportTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableExportTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableExportTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTemplateCode returns the TemplateCode field value if set, zero value otherwise. +func (o *PatchedWritableExportTemplateRequest) GetTemplateCode() string { + if o == nil || IsNil(o.TemplateCode) { + var ret string + return ret + } + return *o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableExportTemplateRequest) GetTemplateCodeOk() (*string, bool) { + if o == nil || IsNil(o.TemplateCode) { + return nil, false + } + return o.TemplateCode, true +} + +// HasTemplateCode returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasTemplateCode() bool { + if o != nil && !IsNil(o.TemplateCode) { + return true + } + + return false +} + +// SetTemplateCode gets a reference to the given string and assigns it to the TemplateCode field. +func (o *PatchedWritableExportTemplateRequest) SetTemplateCode(v string) { + o.TemplateCode = &v +} + +// GetMimeType returns the MimeType field value if set, zero value otherwise. +func (o *PatchedWritableExportTemplateRequest) GetMimeType() string { + if o == nil || IsNil(o.MimeType) { + var ret string + return ret + } + return *o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableExportTemplateRequest) GetMimeTypeOk() (*string, bool) { + if o == nil || IsNil(o.MimeType) { + return nil, false + } + return o.MimeType, true +} + +// HasMimeType returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasMimeType() bool { + if o != nil && !IsNil(o.MimeType) { + return true + } + + return false +} + +// SetMimeType gets a reference to the given string and assigns it to the MimeType field. +func (o *PatchedWritableExportTemplateRequest) SetMimeType(v string) { + o.MimeType = &v +} + +// GetFileExtension returns the FileExtension field value if set, zero value otherwise. +func (o *PatchedWritableExportTemplateRequest) GetFileExtension() string { + if o == nil || IsNil(o.FileExtension) { + var ret string + return ret + } + return *o.FileExtension +} + +// GetFileExtensionOk returns a tuple with the FileExtension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableExportTemplateRequest) GetFileExtensionOk() (*string, bool) { + if o == nil || IsNil(o.FileExtension) { + return nil, false + } + return o.FileExtension, true +} + +// HasFileExtension returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasFileExtension() bool { + if o != nil && !IsNil(o.FileExtension) { + return true + } + + return false +} + +// SetFileExtension gets a reference to the given string and assigns it to the FileExtension field. +func (o *PatchedWritableExportTemplateRequest) SetFileExtension(v string) { + o.FileExtension = &v +} + +// GetAsAttachment returns the AsAttachment field value if set, zero value otherwise. +func (o *PatchedWritableExportTemplateRequest) GetAsAttachment() bool { + if o == nil || IsNil(o.AsAttachment) { + var ret bool + return ret + } + return *o.AsAttachment +} + +// GetAsAttachmentOk returns a tuple with the AsAttachment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableExportTemplateRequest) GetAsAttachmentOk() (*bool, bool) { + if o == nil || IsNil(o.AsAttachment) { + return nil, false + } + return o.AsAttachment, true +} + +// HasAsAttachment returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasAsAttachment() bool { + if o != nil && !IsNil(o.AsAttachment) { + return true + } + + return false +} + +// SetAsAttachment gets a reference to the given bool and assigns it to the AsAttachment field. +func (o *PatchedWritableExportTemplateRequest) SetAsAttachment(v bool) { + o.AsAttachment = &v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableExportTemplateRequest) GetDataSource() int32 { + if o == nil || IsNil(o.DataSource.Get()) { + var ret int32 + return ret + } + return *o.DataSource.Get() +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableExportTemplateRequest) GetDataSourceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataSource.Get(), o.DataSource.IsSet() +} + +// HasDataSource returns a boolean if a field has been set. +func (o *PatchedWritableExportTemplateRequest) HasDataSource() bool { + if o != nil && o.DataSource.IsSet() { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NullableInt32 and assigns it to the DataSource field. +func (o *PatchedWritableExportTemplateRequest) SetDataSource(v int32) { + o.DataSource.Set(&v) +} + +// SetDataSourceNil sets the value for DataSource to be an explicit nil +func (o *PatchedWritableExportTemplateRequest) SetDataSourceNil() { + o.DataSource.Set(nil) +} + +// UnsetDataSource ensures that no value is present for DataSource, not even an explicit nil +func (o *PatchedWritableExportTemplateRequest) UnsetDataSource() { + o.DataSource.Unset() +} + +func (o PatchedWritableExportTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableExportTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContentTypes) { + toSerialize["content_types"] = o.ContentTypes + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.TemplateCode) { + toSerialize["template_code"] = o.TemplateCode + } + if !IsNil(o.MimeType) { + toSerialize["mime_type"] = o.MimeType + } + if !IsNil(o.FileExtension) { + toSerialize["file_extension"] = o.FileExtension + } + if !IsNil(o.AsAttachment) { + toSerialize["as_attachment"] = o.AsAttachment + } + if o.DataSource.IsSet() { + toSerialize["data_source"] = o.DataSource.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableExportTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableExportTemplateRequest := _PatchedWritableExportTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableExportTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableExportTemplateRequest(varPatchedWritableExportTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "template_code") + delete(additionalProperties, "mime_type") + delete(additionalProperties, "file_extension") + delete(additionalProperties, "as_attachment") + delete(additionalProperties, "data_source") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableExportTemplateRequest struct { + value *PatchedWritableExportTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableExportTemplateRequest) Get() *PatchedWritableExportTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableExportTemplateRequest) Set(val *PatchedWritableExportTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableExportTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableExportTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableExportTemplateRequest(val *PatchedWritableExportTemplateRequest) *NullablePatchedWritableExportTemplateRequest { + return &NullablePatchedWritableExportTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableExportTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableExportTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_fhrp_group_assignment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_fhrp_group_assignment_request.go new file mode 100644 index 00000000..c9c90b89 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_fhrp_group_assignment_request.go @@ -0,0 +1,264 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableFHRPGroupAssignmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableFHRPGroupAssignmentRequest{} + +// PatchedWritableFHRPGroupAssignmentRequest Adds support for custom fields and tags. +type PatchedWritableFHRPGroupAssignmentRequest struct { + Group *int32 `json:"group,omitempty"` + InterfaceType *string `json:"interface_type,omitempty"` + InterfaceId *int64 `json:"interface_id,omitempty"` + Priority *int32 `json:"priority,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableFHRPGroupAssignmentRequest PatchedWritableFHRPGroupAssignmentRequest + +// NewPatchedWritableFHRPGroupAssignmentRequest instantiates a new PatchedWritableFHRPGroupAssignmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableFHRPGroupAssignmentRequest() *PatchedWritableFHRPGroupAssignmentRequest { + this := PatchedWritableFHRPGroupAssignmentRequest{} + return &this +} + +// NewPatchedWritableFHRPGroupAssignmentRequestWithDefaults instantiates a new PatchedWritableFHRPGroupAssignmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableFHRPGroupAssignmentRequestWithDefaults() *PatchedWritableFHRPGroupAssignmentRequest { + this := PatchedWritableFHRPGroupAssignmentRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group) { + var ret int32 + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetGroupOk() (*int32, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given int32 and assigns it to the Group field. +func (o *PatchedWritableFHRPGroupAssignmentRequest) SetGroup(v int32) { + o.Group = &v +} + +// GetInterfaceType returns the InterfaceType field value if set, zero value otherwise. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetInterfaceType() string { + if o == nil || IsNil(o.InterfaceType) { + var ret string + return ret + } + return *o.InterfaceType +} + +// GetInterfaceTypeOk returns a tuple with the InterfaceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetInterfaceTypeOk() (*string, bool) { + if o == nil || IsNil(o.InterfaceType) { + return nil, false + } + return o.InterfaceType, true +} + +// HasInterfaceType returns a boolean if a field has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) HasInterfaceType() bool { + if o != nil && !IsNil(o.InterfaceType) { + return true + } + + return false +} + +// SetInterfaceType gets a reference to the given string and assigns it to the InterfaceType field. +func (o *PatchedWritableFHRPGroupAssignmentRequest) SetInterfaceType(v string) { + o.InterfaceType = &v +} + +// GetInterfaceId returns the InterfaceId field value if set, zero value otherwise. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetInterfaceId() int64 { + if o == nil || IsNil(o.InterfaceId) { + var ret int64 + return ret + } + return *o.InterfaceId +} + +// GetInterfaceIdOk returns a tuple with the InterfaceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetInterfaceIdOk() (*int64, bool) { + if o == nil || IsNil(o.InterfaceId) { + return nil, false + } + return o.InterfaceId, true +} + +// HasInterfaceId returns a boolean if a field has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) HasInterfaceId() bool { + if o != nil && !IsNil(o.InterfaceId) { + return true + } + + return false +} + +// SetInterfaceId gets a reference to the given int64 and assigns it to the InterfaceId field. +func (o *PatchedWritableFHRPGroupAssignmentRequest) SetInterfaceId(v int64) { + o.InterfaceId = &v +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetPriority() int32 { + if o == nil || IsNil(o.Priority) { + var ret int32 + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) GetPriorityOk() (*int32, bool) { + if o == nil || IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *PatchedWritableFHRPGroupAssignmentRequest) HasPriority() bool { + if o != nil && !IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given int32 and assigns it to the Priority field. +func (o *PatchedWritableFHRPGroupAssignmentRequest) SetPriority(v int32) { + o.Priority = &v +} + +func (o PatchedWritableFHRPGroupAssignmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableFHRPGroupAssignmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.InterfaceType) { + toSerialize["interface_type"] = o.InterfaceType + } + if !IsNil(o.InterfaceId) { + toSerialize["interface_id"] = o.InterfaceId + } + if !IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableFHRPGroupAssignmentRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableFHRPGroupAssignmentRequest := _PatchedWritableFHRPGroupAssignmentRequest{} + + err = json.Unmarshal(data, &varPatchedWritableFHRPGroupAssignmentRequest) + + if err != nil { + return err + } + + *o = PatchedWritableFHRPGroupAssignmentRequest(varPatchedWritableFHRPGroupAssignmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "interface_type") + delete(additionalProperties, "interface_id") + delete(additionalProperties, "priority") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableFHRPGroupAssignmentRequest struct { + value *PatchedWritableFHRPGroupAssignmentRequest + isSet bool +} + +func (v NullablePatchedWritableFHRPGroupAssignmentRequest) Get() *PatchedWritableFHRPGroupAssignmentRequest { + return v.value +} + +func (v *NullablePatchedWritableFHRPGroupAssignmentRequest) Set(val *PatchedWritableFHRPGroupAssignmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableFHRPGroupAssignmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableFHRPGroupAssignmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableFHRPGroupAssignmentRequest(val *PatchedWritableFHRPGroupAssignmentRequest) *NullablePatchedWritableFHRPGroupAssignmentRequest { + return &NullablePatchedWritableFHRPGroupAssignmentRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableFHRPGroupAssignmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableFHRPGroupAssignmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_front_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_front_port_request.go new file mode 100644 index 00000000..d805953d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_front_port_request.go @@ -0,0 +1,574 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableFrontPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableFrontPortRequest{} + +// PatchedWritableFrontPortRequest Adds support for custom fields and tags. +type PatchedWritableFrontPortRequest struct { + Device *int32 `json:"device,omitempty"` + Module NullableInt32 `json:"module,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *FrontPortTypeValue `json:"type,omitempty"` + Color *string `json:"color,omitempty"` + RearPort *int32 `json:"rear_port,omitempty"` + // Mapped position on corresponding rear port + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableFrontPortRequest PatchedWritableFrontPortRequest + +// NewPatchedWritableFrontPortRequest instantiates a new PatchedWritableFrontPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableFrontPortRequest() *PatchedWritableFrontPortRequest { + this := PatchedWritableFrontPortRequest{} + return &this +} + +// NewPatchedWritableFrontPortRequestWithDefaults instantiates a new PatchedWritableFrontPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableFrontPortRequestWithDefaults() *PatchedWritableFrontPortRequest { + this := PatchedWritableFrontPortRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableFrontPortRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableFrontPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableFrontPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *PatchedWritableFrontPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PatchedWritableFrontPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PatchedWritableFrontPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableFrontPortRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableFrontPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetType() FrontPortTypeValue { + if o == nil || IsNil(o.Type) { + var ret FrontPortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given FrontPortTypeValue and assigns it to the Type field. +func (o *PatchedWritableFrontPortRequest) SetType(v FrontPortTypeValue) { + o.Type = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedWritableFrontPortRequest) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetRearPort() int32 { + if o == nil || IsNil(o.RearPort) { + var ret int32 + return ret + } + return *o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetRearPortOk() (*int32, bool) { + if o == nil || IsNil(o.RearPort) { + return nil, false + } + return o.RearPort, true +} + +// HasRearPort returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasRearPort() bool { + if o != nil && !IsNil(o.RearPort) { + return true + } + + return false +} + +// SetRearPort gets a reference to the given int32 and assigns it to the RearPort field. +func (o *PatchedWritableFrontPortRequest) SetRearPort(v int32) { + o.RearPort = &v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *PatchedWritableFrontPortRequest) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableFrontPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritableFrontPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableFrontPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableFrontPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableFrontPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableFrontPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.RearPort) { + toSerialize["rear_port"] = o.RearPort + } + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableFrontPortRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableFrontPortRequest := _PatchedWritableFrontPortRequest{} + + err = json.Unmarshal(data, &varPatchedWritableFrontPortRequest) + + if err != nil { + return err + } + + *o = PatchedWritableFrontPortRequest(varPatchedWritableFrontPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableFrontPortRequest struct { + value *PatchedWritableFrontPortRequest + isSet bool +} + +func (v NullablePatchedWritableFrontPortRequest) Get() *PatchedWritableFrontPortRequest { + return v.value +} + +func (v *NullablePatchedWritableFrontPortRequest) Set(val *PatchedWritableFrontPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableFrontPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableFrontPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableFrontPortRequest(val *PatchedWritableFrontPortRequest) *NullablePatchedWritableFrontPortRequest { + return &NullablePatchedWritableFrontPortRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableFrontPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableFrontPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_front_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_front_port_template_request.go new file mode 100644 index 00000000..3c0d99ea --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_front_port_template_request.go @@ -0,0 +1,473 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableFrontPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableFrontPortTemplateRequest{} + +// PatchedWritableFrontPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableFrontPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *FrontPortTypeValue `json:"type,omitempty"` + Color *string `json:"color,omitempty"` + RearPort *int32 `json:"rear_port,omitempty"` + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableFrontPortTemplateRequest PatchedWritableFrontPortTemplateRequest + +// NewPatchedWritableFrontPortTemplateRequest instantiates a new PatchedWritableFrontPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableFrontPortTemplateRequest() *PatchedWritableFrontPortTemplateRequest { + this := PatchedWritableFrontPortTemplateRequest{} + return &this +} + +// NewPatchedWritableFrontPortTemplateRequestWithDefaults instantiates a new PatchedWritableFrontPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableFrontPortTemplateRequestWithDefaults() *PatchedWritableFrontPortTemplateRequest { + this := PatchedWritableFrontPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableFrontPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableFrontPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *PatchedWritableFrontPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PatchedWritableFrontPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PatchedWritableFrontPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableFrontPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableFrontPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *PatchedWritableFrontPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PatchedWritableFrontPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PatchedWritableFrontPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableFrontPortTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableFrontPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortTemplateRequest) GetType() FrontPortTypeValue { + if o == nil || IsNil(o.Type) { + var ret FrontPortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortTemplateRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given FrontPortTypeValue and assigns it to the Type field. +func (o *PatchedWritableFrontPortTemplateRequest) SetType(v FrontPortTypeValue) { + o.Type = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortTemplateRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortTemplateRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedWritableFrontPortTemplateRequest) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortTemplateRequest) GetRearPort() int32 { + if o == nil || IsNil(o.RearPort) { + var ret int32 + return ret + } + return *o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortTemplateRequest) GetRearPortOk() (*int32, bool) { + if o == nil || IsNil(o.RearPort) { + return nil, false + } + return o.RearPort, true +} + +// HasRearPort returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasRearPort() bool { + if o != nil && !IsNil(o.RearPort) { + return true + } + + return false +} + +// SetRearPort gets a reference to the given int32 and assigns it to the RearPort field. +func (o *PatchedWritableFrontPortTemplateRequest) SetRearPort(v int32) { + o.RearPort = &v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortTemplateRequest) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortTemplateRequest) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *PatchedWritableFrontPortTemplateRequest) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableFrontPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableFrontPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableFrontPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableFrontPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritableFrontPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableFrontPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.RearPort) { + toSerialize["rear_port"] = o.RearPort + } + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableFrontPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableFrontPortTemplateRequest := _PatchedWritableFrontPortTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableFrontPortTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableFrontPortTemplateRequest(varPatchedWritableFrontPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableFrontPortTemplateRequest struct { + value *PatchedWritableFrontPortTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableFrontPortTemplateRequest) Get() *PatchedWritableFrontPortTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableFrontPortTemplateRequest) Set(val *PatchedWritableFrontPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableFrontPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableFrontPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableFrontPortTemplateRequest(val *PatchedWritableFrontPortTemplateRequest) *NullablePatchedWritableFrontPortTemplateRequest { + return &NullablePatchedWritableFrontPortTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableFrontPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableFrontPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_policy_request.go new file mode 100644 index 00000000..b79c61eb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_policy_request.go @@ -0,0 +1,449 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableIKEPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableIKEPolicyRequest{} + +// PatchedWritableIKEPolicyRequest Adds support for custom fields and tags. +type PatchedWritableIKEPolicyRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Version *PatchedWritableIKEPolicyRequestVersion `json:"version,omitempty"` + Mode *IKEPolicyModeValue `json:"mode,omitempty"` + Proposals []int32 `json:"proposals,omitempty"` + PresharedKey *string `json:"preshared_key,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableIKEPolicyRequest PatchedWritableIKEPolicyRequest + +// NewPatchedWritableIKEPolicyRequest instantiates a new PatchedWritableIKEPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableIKEPolicyRequest() *PatchedWritableIKEPolicyRequest { + this := PatchedWritableIKEPolicyRequest{} + return &this +} + +// NewPatchedWritableIKEPolicyRequestWithDefaults instantiates a new PatchedWritableIKEPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableIKEPolicyRequestWithDefaults() *PatchedWritableIKEPolicyRequest { + this := PatchedWritableIKEPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableIKEPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableIKEPolicyRequest) SetDescription(v string) { + o.Description = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetVersion() PatchedWritableIKEPolicyRequestVersion { + if o == nil || IsNil(o.Version) { + var ret PatchedWritableIKEPolicyRequestVersion + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetVersionOk() (*PatchedWritableIKEPolicyRequestVersion, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given PatchedWritableIKEPolicyRequestVersion and assigns it to the Version field. +func (o *PatchedWritableIKEPolicyRequest) SetVersion(v PatchedWritableIKEPolicyRequestVersion) { + o.Version = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetMode() IKEPolicyModeValue { + if o == nil || IsNil(o.Mode) { + var ret IKEPolicyModeValue + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetModeOk() (*IKEPolicyModeValue, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given IKEPolicyModeValue and assigns it to the Mode field. +func (o *PatchedWritableIKEPolicyRequest) SetMode(v IKEPolicyModeValue) { + o.Mode = &v +} + +// GetProposals returns the Proposals field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetProposals() []int32 { + if o == nil || IsNil(o.Proposals) { + var ret []int32 + return ret + } + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetProposalsOk() ([]int32, bool) { + if o == nil || IsNil(o.Proposals) { + return nil, false + } + return o.Proposals, true +} + +// HasProposals returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasProposals() bool { + if o != nil && !IsNil(o.Proposals) { + return true + } + + return false +} + +// SetProposals gets a reference to the given []int32 and assigns it to the Proposals field. +func (o *PatchedWritableIKEPolicyRequest) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPresharedKey returns the PresharedKey field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetPresharedKey() string { + if o == nil || IsNil(o.PresharedKey) { + var ret string + return ret + } + return *o.PresharedKey +} + +// GetPresharedKeyOk returns a tuple with the PresharedKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetPresharedKeyOk() (*string, bool) { + if o == nil || IsNil(o.PresharedKey) { + return nil, false + } + return o.PresharedKey, true +} + +// HasPresharedKey returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasPresharedKey() bool { + if o != nil && !IsNil(o.PresharedKey) { + return true + } + + return false +} + +// SetPresharedKey gets a reference to the given string and assigns it to the PresharedKey field. +func (o *PatchedWritableIKEPolicyRequest) SetPresharedKey(v string) { + o.PresharedKey = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableIKEPolicyRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableIKEPolicyRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableIKEPolicyRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEPolicyRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableIKEPolicyRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableIKEPolicyRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableIKEPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableIKEPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.Proposals) { + toSerialize["proposals"] = o.Proposals + } + if !IsNil(o.PresharedKey) { + toSerialize["preshared_key"] = o.PresharedKey + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableIKEPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableIKEPolicyRequest := _PatchedWritableIKEPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedWritableIKEPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedWritableIKEPolicyRequest(varPatchedWritableIKEPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "version") + delete(additionalProperties, "mode") + delete(additionalProperties, "proposals") + delete(additionalProperties, "preshared_key") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableIKEPolicyRequest struct { + value *PatchedWritableIKEPolicyRequest + isSet bool +} + +func (v NullablePatchedWritableIKEPolicyRequest) Get() *PatchedWritableIKEPolicyRequest { + return v.value +} + +func (v *NullablePatchedWritableIKEPolicyRequest) Set(val *PatchedWritableIKEPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIKEPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIKEPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIKEPolicyRequest(val *PatchedWritableIKEPolicyRequest) *NullablePatchedWritableIKEPolicyRequest { + return &NullablePatchedWritableIKEPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableIKEPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIKEPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_policy_request_version.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_policy_request_version.go new file mode 100644 index 00000000..9fca4239 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_policy_request_version.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableIKEPolicyRequestVersion * `1` - IKEv1 * `2` - IKEv2 +type PatchedWritableIKEPolicyRequestVersion int32 + +// List of PatchedWritableIKEPolicyRequest_version +const ( + PATCHEDWRITABLEIKEPOLICYREQUESTVERSION__1 PatchedWritableIKEPolicyRequestVersion = 1 + PATCHEDWRITABLEIKEPOLICYREQUESTVERSION__2 PatchedWritableIKEPolicyRequestVersion = 2 +) + +// All allowed values of PatchedWritableIKEPolicyRequestVersion enum +var AllowedPatchedWritableIKEPolicyRequestVersionEnumValues = []PatchedWritableIKEPolicyRequestVersion{ + 1, + 2, +} + +func (v *PatchedWritableIKEPolicyRequestVersion) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableIKEPolicyRequestVersion(value) + for _, existing := range AllowedPatchedWritableIKEPolicyRequestVersionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableIKEPolicyRequestVersion", value) +} + +// NewPatchedWritableIKEPolicyRequestVersionFromValue returns a pointer to a valid PatchedWritableIKEPolicyRequestVersion +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableIKEPolicyRequestVersionFromValue(v int32) (*PatchedWritableIKEPolicyRequestVersion, error) { + ev := PatchedWritableIKEPolicyRequestVersion(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableIKEPolicyRequestVersion: valid values are %v", v, AllowedPatchedWritableIKEPolicyRequestVersionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableIKEPolicyRequestVersion) IsValid() bool { + for _, existing := range AllowedPatchedWritableIKEPolicyRequestVersionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableIKEPolicyRequest_version value +func (v PatchedWritableIKEPolicyRequestVersion) Ptr() *PatchedWritableIKEPolicyRequestVersion { + return &v +} + +type NullablePatchedWritableIKEPolicyRequestVersion struct { + value *PatchedWritableIKEPolicyRequestVersion + isSet bool +} + +func (v NullablePatchedWritableIKEPolicyRequestVersion) Get() *PatchedWritableIKEPolicyRequestVersion { + return v.value +} + +func (v *NullablePatchedWritableIKEPolicyRequestVersion) Set(val *PatchedWritableIKEPolicyRequestVersion) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIKEPolicyRequestVersion) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIKEPolicyRequestVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIKEPolicyRequestVersion(val *PatchedWritableIKEPolicyRequestVersion) *NullablePatchedWritableIKEPolicyRequestVersion { + return &NullablePatchedWritableIKEPolicyRequestVersion{value: val, isSet: true} +} + +func (v NullablePatchedWritableIKEPolicyRequestVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIKEPolicyRequestVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request.go new file mode 100644 index 00000000..1fe929ad --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request.go @@ -0,0 +1,498 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableIKEProposalRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableIKEProposalRequest{} + +// PatchedWritableIKEProposalRequest Adds support for custom fields and tags. +type PatchedWritableIKEProposalRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + AuthenticationMethod *IKEProposalAuthenticationMethodValue `json:"authentication_method,omitempty"` + EncryptionAlgorithm *IKEProposalEncryptionAlgorithmValue `json:"encryption_algorithm,omitempty"` + AuthenticationAlgorithm *PatchedWritableIKEProposalRequestAuthenticationAlgorithm `json:"authentication_algorithm,omitempty"` + Group *PatchedWritableIKEProposalRequestGroup `json:"group,omitempty"` + // Security association lifetime (in seconds) + SaLifetime NullableInt32 `json:"sa_lifetime,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableIKEProposalRequest PatchedWritableIKEProposalRequest + +// NewPatchedWritableIKEProposalRequest instantiates a new PatchedWritableIKEProposalRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableIKEProposalRequest() *PatchedWritableIKEProposalRequest { + this := PatchedWritableIKEProposalRequest{} + return &this +} + +// NewPatchedWritableIKEProposalRequestWithDefaults instantiates a new PatchedWritableIKEProposalRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableIKEProposalRequestWithDefaults() *PatchedWritableIKEProposalRequest { + this := PatchedWritableIKEProposalRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableIKEProposalRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableIKEProposalRequest) SetDescription(v string) { + o.Description = &v +} + +// GetAuthenticationMethod returns the AuthenticationMethod field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetAuthenticationMethod() IKEProposalAuthenticationMethodValue { + if o == nil || IsNil(o.AuthenticationMethod) { + var ret IKEProposalAuthenticationMethodValue + return ret + } + return *o.AuthenticationMethod +} + +// GetAuthenticationMethodOk returns a tuple with the AuthenticationMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetAuthenticationMethodOk() (*IKEProposalAuthenticationMethodValue, bool) { + if o == nil || IsNil(o.AuthenticationMethod) { + return nil, false + } + return o.AuthenticationMethod, true +} + +// HasAuthenticationMethod returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasAuthenticationMethod() bool { + if o != nil && !IsNil(o.AuthenticationMethod) { + return true + } + + return false +} + +// SetAuthenticationMethod gets a reference to the given IKEProposalAuthenticationMethodValue and assigns it to the AuthenticationMethod field. +func (o *PatchedWritableIKEProposalRequest) SetAuthenticationMethod(v IKEProposalAuthenticationMethodValue) { + o.AuthenticationMethod = &v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetEncryptionAlgorithm() IKEProposalEncryptionAlgorithmValue { + if o == nil || IsNil(o.EncryptionAlgorithm) { + var ret IKEProposalEncryptionAlgorithmValue + return ret + } + return *o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetEncryptionAlgorithmOk() (*IKEProposalEncryptionAlgorithmValue, bool) { + if o == nil || IsNil(o.EncryptionAlgorithm) { + return nil, false + } + return o.EncryptionAlgorithm, true +} + +// HasEncryptionAlgorithm returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasEncryptionAlgorithm() bool { + if o != nil && !IsNil(o.EncryptionAlgorithm) { + return true + } + + return false +} + +// SetEncryptionAlgorithm gets a reference to the given IKEProposalEncryptionAlgorithmValue and assigns it to the EncryptionAlgorithm field. +func (o *PatchedWritableIKEProposalRequest) SetEncryptionAlgorithm(v IKEProposalEncryptionAlgorithmValue) { + o.EncryptionAlgorithm = &v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetAuthenticationAlgorithm() PatchedWritableIKEProposalRequestAuthenticationAlgorithm { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + var ret PatchedWritableIKEProposalRequestAuthenticationAlgorithm + return ret + } + return *o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetAuthenticationAlgorithmOk() (*PatchedWritableIKEProposalRequestAuthenticationAlgorithm, bool) { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + return nil, false + } + return o.AuthenticationAlgorithm, true +} + +// HasAuthenticationAlgorithm returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasAuthenticationAlgorithm() bool { + if o != nil && !IsNil(o.AuthenticationAlgorithm) { + return true + } + + return false +} + +// SetAuthenticationAlgorithm gets a reference to the given PatchedWritableIKEProposalRequestAuthenticationAlgorithm and assigns it to the AuthenticationAlgorithm field. +func (o *PatchedWritableIKEProposalRequest) SetAuthenticationAlgorithm(v PatchedWritableIKEProposalRequestAuthenticationAlgorithm) { + o.AuthenticationAlgorithm = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetGroup() PatchedWritableIKEProposalRequestGroup { + if o == nil || IsNil(o.Group) { + var ret PatchedWritableIKEProposalRequestGroup + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetGroupOk() (*PatchedWritableIKEProposalRequestGroup, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given PatchedWritableIKEProposalRequestGroup and assigns it to the Group field. +func (o *PatchedWritableIKEProposalRequest) SetGroup(v PatchedWritableIKEProposalRequestGroup) { + o.Group = &v +} + +// GetSaLifetime returns the SaLifetime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIKEProposalRequest) GetSaLifetime() int32 { + if o == nil || IsNil(o.SaLifetime.Get()) { + var ret int32 + return ret + } + return *o.SaLifetime.Get() +} + +// GetSaLifetimeOk returns a tuple with the SaLifetime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIKEProposalRequest) GetSaLifetimeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetime.Get(), o.SaLifetime.IsSet() +} + +// HasSaLifetime returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasSaLifetime() bool { + if o != nil && o.SaLifetime.IsSet() { + return true + } + + return false +} + +// SetSaLifetime gets a reference to the given NullableInt32 and assigns it to the SaLifetime field. +func (o *PatchedWritableIKEProposalRequest) SetSaLifetime(v int32) { + o.SaLifetime.Set(&v) +} + +// SetSaLifetimeNil sets the value for SaLifetime to be an explicit nil +func (o *PatchedWritableIKEProposalRequest) SetSaLifetimeNil() { + o.SaLifetime.Set(nil) +} + +// UnsetSaLifetime ensures that no value is present for SaLifetime, not even an explicit nil +func (o *PatchedWritableIKEProposalRequest) UnsetSaLifetime() { + o.SaLifetime.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableIKEProposalRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableIKEProposalRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableIKEProposalRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIKEProposalRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableIKEProposalRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableIKEProposalRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableIKEProposalRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableIKEProposalRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.AuthenticationMethod) { + toSerialize["authentication_method"] = o.AuthenticationMethod + } + if !IsNil(o.EncryptionAlgorithm) { + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + } + if !IsNil(o.AuthenticationAlgorithm) { + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + } + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if o.SaLifetime.IsSet() { + toSerialize["sa_lifetime"] = o.SaLifetime.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableIKEProposalRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableIKEProposalRequest := _PatchedWritableIKEProposalRequest{} + + err = json.Unmarshal(data, &varPatchedWritableIKEProposalRequest) + + if err != nil { + return err + } + + *o = PatchedWritableIKEProposalRequest(varPatchedWritableIKEProposalRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "authentication_method") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "group") + delete(additionalProperties, "sa_lifetime") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableIKEProposalRequest struct { + value *PatchedWritableIKEProposalRequest + isSet bool +} + +func (v NullablePatchedWritableIKEProposalRequest) Get() *PatchedWritableIKEProposalRequest { + return v.value +} + +func (v *NullablePatchedWritableIKEProposalRequest) Set(val *PatchedWritableIKEProposalRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIKEProposalRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIKEProposalRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIKEProposalRequest(val *PatchedWritableIKEProposalRequest) *NullablePatchedWritableIKEProposalRequest { + return &NullablePatchedWritableIKEProposalRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableIKEProposalRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIKEProposalRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request_authentication_algorithm.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request_authentication_algorithm.go new file mode 100644 index 00000000..2f0b2059 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request_authentication_algorithm.go @@ -0,0 +1,118 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableIKEProposalRequestAuthenticationAlgorithm * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC +type PatchedWritableIKEProposalRequestAuthenticationAlgorithm string + +// List of PatchedWritableIKEProposalRequest_authentication_algorithm +const ( + PATCHEDWRITABLEIKEPROPOSALREQUESTAUTHENTICATIONALGORITHM_HMAC_SHA1 PatchedWritableIKEProposalRequestAuthenticationAlgorithm = "hmac-sha1" + PATCHEDWRITABLEIKEPROPOSALREQUESTAUTHENTICATIONALGORITHM_HMAC_SHA256 PatchedWritableIKEProposalRequestAuthenticationAlgorithm = "hmac-sha256" + PATCHEDWRITABLEIKEPROPOSALREQUESTAUTHENTICATIONALGORITHM_HMAC_SHA384 PatchedWritableIKEProposalRequestAuthenticationAlgorithm = "hmac-sha384" + PATCHEDWRITABLEIKEPROPOSALREQUESTAUTHENTICATIONALGORITHM_HMAC_SHA512 PatchedWritableIKEProposalRequestAuthenticationAlgorithm = "hmac-sha512" + PATCHEDWRITABLEIKEPROPOSALREQUESTAUTHENTICATIONALGORITHM_HMAC_MD5 PatchedWritableIKEProposalRequestAuthenticationAlgorithm = "hmac-md5" + PATCHEDWRITABLEIKEPROPOSALREQUESTAUTHENTICATIONALGORITHM_EMPTY PatchedWritableIKEProposalRequestAuthenticationAlgorithm = "" +) + +// All allowed values of PatchedWritableIKEProposalRequestAuthenticationAlgorithm enum +var AllowedPatchedWritableIKEProposalRequestAuthenticationAlgorithmEnumValues = []PatchedWritableIKEProposalRequestAuthenticationAlgorithm{ + "hmac-sha1", + "hmac-sha256", + "hmac-sha384", + "hmac-sha512", + "hmac-md5", + "", +} + +func (v *PatchedWritableIKEProposalRequestAuthenticationAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableIKEProposalRequestAuthenticationAlgorithm(value) + for _, existing := range AllowedPatchedWritableIKEProposalRequestAuthenticationAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableIKEProposalRequestAuthenticationAlgorithm", value) +} + +// NewPatchedWritableIKEProposalRequestAuthenticationAlgorithmFromValue returns a pointer to a valid PatchedWritableIKEProposalRequestAuthenticationAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableIKEProposalRequestAuthenticationAlgorithmFromValue(v string) (*PatchedWritableIKEProposalRequestAuthenticationAlgorithm, error) { + ev := PatchedWritableIKEProposalRequestAuthenticationAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableIKEProposalRequestAuthenticationAlgorithm: valid values are %v", v, AllowedPatchedWritableIKEProposalRequestAuthenticationAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableIKEProposalRequestAuthenticationAlgorithm) IsValid() bool { + for _, existing := range AllowedPatchedWritableIKEProposalRequestAuthenticationAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableIKEProposalRequest_authentication_algorithm value +func (v PatchedWritableIKEProposalRequestAuthenticationAlgorithm) Ptr() *PatchedWritableIKEProposalRequestAuthenticationAlgorithm { + return &v +} + +type NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm struct { + value *PatchedWritableIKEProposalRequestAuthenticationAlgorithm + isSet bool +} + +func (v NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm) Get() *PatchedWritableIKEProposalRequestAuthenticationAlgorithm { + return v.value +} + +func (v *NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm) Set(val *PatchedWritableIKEProposalRequestAuthenticationAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm(val *PatchedWritableIKEProposalRequestAuthenticationAlgorithm) *NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm { + return &NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm{value: val, isSet: true} +} + +func (v NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIKEProposalRequestAuthenticationAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request_group.go new file mode 100644 index 00000000..72e88599 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ike_proposal_request_group.go @@ -0,0 +1,154 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableIKEProposalRequestGroup Diffie-Hellman group ID * `1` - Group 1 * `2` - Group 2 * `5` - Group 5 * `14` - Group 14 * `15` - Group 15 * `16` - Group 16 * `17` - Group 17 * `18` - Group 18 * `19` - Group 19 * `20` - Group 20 * `21` - Group 21 * `22` - Group 22 * `23` - Group 23 * `24` - Group 24 * `25` - Group 25 * `26` - Group 26 * `27` - Group 27 * `28` - Group 28 * `29` - Group 29 * `30` - Group 30 * `31` - Group 31 * `32` - Group 32 * `33` - Group 33 * `34` - Group 34 +type PatchedWritableIKEProposalRequestGroup int32 + +// List of PatchedWritableIKEProposalRequest_group +const ( + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__1 PatchedWritableIKEProposalRequestGroup = 1 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__2 PatchedWritableIKEProposalRequestGroup = 2 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__5 PatchedWritableIKEProposalRequestGroup = 5 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__14 PatchedWritableIKEProposalRequestGroup = 14 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__15 PatchedWritableIKEProposalRequestGroup = 15 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__16 PatchedWritableIKEProposalRequestGroup = 16 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__17 PatchedWritableIKEProposalRequestGroup = 17 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__18 PatchedWritableIKEProposalRequestGroup = 18 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__19 PatchedWritableIKEProposalRequestGroup = 19 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__20 PatchedWritableIKEProposalRequestGroup = 20 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__21 PatchedWritableIKEProposalRequestGroup = 21 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__22 PatchedWritableIKEProposalRequestGroup = 22 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__23 PatchedWritableIKEProposalRequestGroup = 23 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__24 PatchedWritableIKEProposalRequestGroup = 24 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__25 PatchedWritableIKEProposalRequestGroup = 25 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__26 PatchedWritableIKEProposalRequestGroup = 26 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__27 PatchedWritableIKEProposalRequestGroup = 27 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__28 PatchedWritableIKEProposalRequestGroup = 28 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__29 PatchedWritableIKEProposalRequestGroup = 29 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__30 PatchedWritableIKEProposalRequestGroup = 30 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__31 PatchedWritableIKEProposalRequestGroup = 31 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__32 PatchedWritableIKEProposalRequestGroup = 32 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__33 PatchedWritableIKEProposalRequestGroup = 33 + PATCHEDWRITABLEIKEPROPOSALREQUESTGROUP__34 PatchedWritableIKEProposalRequestGroup = 34 +) + +// All allowed values of PatchedWritableIKEProposalRequestGroup enum +var AllowedPatchedWritableIKEProposalRequestGroupEnumValues = []PatchedWritableIKEProposalRequestGroup{ + 1, + 2, + 5, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, +} + +func (v *PatchedWritableIKEProposalRequestGroup) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableIKEProposalRequestGroup(value) + for _, existing := range AllowedPatchedWritableIKEProposalRequestGroupEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableIKEProposalRequestGroup", value) +} + +// NewPatchedWritableIKEProposalRequestGroupFromValue returns a pointer to a valid PatchedWritableIKEProposalRequestGroup +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableIKEProposalRequestGroupFromValue(v int32) (*PatchedWritableIKEProposalRequestGroup, error) { + ev := PatchedWritableIKEProposalRequestGroup(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableIKEProposalRequestGroup: valid values are %v", v, AllowedPatchedWritableIKEProposalRequestGroupEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableIKEProposalRequestGroup) IsValid() bool { + for _, existing := range AllowedPatchedWritableIKEProposalRequestGroupEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableIKEProposalRequest_group value +func (v PatchedWritableIKEProposalRequestGroup) Ptr() *PatchedWritableIKEProposalRequestGroup { + return &v +} + +type NullablePatchedWritableIKEProposalRequestGroup struct { + value *PatchedWritableIKEProposalRequestGroup + isSet bool +} + +func (v NullablePatchedWritableIKEProposalRequestGroup) Get() *PatchedWritableIKEProposalRequestGroup { + return v.value +} + +func (v *NullablePatchedWritableIKEProposalRequestGroup) Set(val *PatchedWritableIKEProposalRequestGroup) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIKEProposalRequestGroup) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIKEProposalRequestGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIKEProposalRequestGroup(val *PatchedWritableIKEProposalRequestGroup) *NullablePatchedWritableIKEProposalRequestGroup { + return &NullablePatchedWritableIKEProposalRequestGroup{value: val, isSet: true} +} + +func (v NullablePatchedWritableIKEProposalRequestGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIKEProposalRequestGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_request.go new file mode 100644 index 00000000..3c8322c4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_request.go @@ -0,0 +1,1459 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableInterfaceRequest{} + +// PatchedWritableInterfaceRequest Adds support for custom fields and tags. +type PatchedWritableInterfaceRequest struct { + Device *int32 `json:"device,omitempty"` + Vdcs []int32 `json:"vdcs,omitempty"` + Module NullableInt32 `json:"module,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *InterfaceTypeValue `json:"type,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Bridge NullableInt32 `json:"bridge,omitempty"` + Lag NullableInt32 `json:"lag,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Speed NullableInt32 `json:"speed,omitempty"` + Duplex NullableInterfaceRequestDuplex `json:"duplex,omitempty"` + Wwn NullableString `json:"wwn,omitempty"` + // This interface is used only for out-of-band management + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Mode *PatchedWritableInterfaceRequestMode `json:"mode,omitempty"` + RfRole *WirelessRole `json:"rf_role,omitempty"` + RfChannel *WirelessChannel `json:"rf_channel,omitempty"` + PoeMode *InterfacePoeModeValue `json:"poe_mode,omitempty"` + PoeType *InterfacePoeTypeValue `json:"poe_type,omitempty"` + // Populated by selected channel (if set) + RfChannelFrequency NullableFloat64 `json:"rf_channel_frequency,omitempty"` + // Populated by selected channel (if set) + RfChannelWidth NullableFloat64 `json:"rf_channel_width,omitempty"` + TxPower NullableInt32 `json:"tx_power,omitempty"` + UntaggedVlan NullableInt32 `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + WirelessLans []int32 `json:"wireless_lans,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableInterfaceRequest PatchedWritableInterfaceRequest + +// NewPatchedWritableInterfaceRequest instantiates a new PatchedWritableInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableInterfaceRequest() *PatchedWritableInterfaceRequest { + this := PatchedWritableInterfaceRequest{} + return &this +} + +// NewPatchedWritableInterfaceRequestWithDefaults instantiates a new PatchedWritableInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableInterfaceRequestWithDefaults() *PatchedWritableInterfaceRequest { + this := PatchedWritableInterfaceRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableInterfaceRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetVdcs returns the Vdcs field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetVdcs() []int32 { + if o == nil || IsNil(o.Vdcs) { + var ret []int32 + return ret + } + return o.Vdcs +} + +// GetVdcsOk returns a tuple with the Vdcs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetVdcsOk() ([]int32, bool) { + if o == nil || IsNil(o.Vdcs) { + return nil, false + } + return o.Vdcs, true +} + +// HasVdcs returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasVdcs() bool { + if o != nil && !IsNil(o.Vdcs) { + return true + } + + return false +} + +// SetVdcs gets a reference to the given []int32 and assigns it to the Vdcs field. +func (o *PatchedWritableInterfaceRequest) SetVdcs(v []int32) { + o.Vdcs = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *PatchedWritableInterfaceRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableInterfaceRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableInterfaceRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetType() InterfaceTypeValue { + if o == nil || IsNil(o.Type) { + var ret InterfaceTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetTypeOk() (*InterfaceTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given InterfaceTypeValue and assigns it to the Type field. +func (o *PatchedWritableInterfaceRequest) SetType(v InterfaceTypeValue) { + o.Type = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedWritableInterfaceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableInterfaceRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetBridge() int32 { + if o == nil || IsNil(o.Bridge.Get()) { + var ret int32 + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetBridgeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableInt32 and assigns it to the Bridge field. +func (o *PatchedWritableInterfaceRequest) SetBridge(v int32) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetLag returns the Lag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetLag() int32 { + if o == nil || IsNil(o.Lag.Get()) { + var ret int32 + return ret + } + return *o.Lag.Get() +} + +// GetLagOk returns a tuple with the Lag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetLagOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Lag.Get(), o.Lag.IsSet() +} + +// HasLag returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasLag() bool { + if o != nil && o.Lag.IsSet() { + return true + } + + return false +} + +// SetLag gets a reference to the given NullableInt32 and assigns it to the Lag field. +func (o *PatchedWritableInterfaceRequest) SetLag(v int32) { + o.Lag.Set(&v) +} + +// SetLagNil sets the value for Lag to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetLagNil() { + o.Lag.Set(nil) +} + +// UnsetLag ensures that no value is present for Lag, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetLag() { + o.Lag.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *PatchedWritableInterfaceRequest) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *PatchedWritableInterfaceRequest) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetSpeed() int32 { + if o == nil || IsNil(o.Speed.Get()) { + var ret int32 + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableInt32 and assigns it to the Speed field. +func (o *PatchedWritableInterfaceRequest) SetSpeed(v int32) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDuplex returns the Duplex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetDuplex() InterfaceRequestDuplex { + if o == nil || IsNil(o.Duplex.Get()) { + var ret InterfaceRequestDuplex + return ret + } + return *o.Duplex.Get() +} + +// GetDuplexOk returns a tuple with the Duplex field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetDuplexOk() (*InterfaceRequestDuplex, bool) { + if o == nil { + return nil, false + } + return o.Duplex.Get(), o.Duplex.IsSet() +} + +// HasDuplex returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasDuplex() bool { + if o != nil && o.Duplex.IsSet() { + return true + } + + return false +} + +// SetDuplex gets a reference to the given NullableInterfaceRequestDuplex and assigns it to the Duplex field. +func (o *PatchedWritableInterfaceRequest) SetDuplex(v InterfaceRequestDuplex) { + o.Duplex.Set(&v) +} + +// SetDuplexNil sets the value for Duplex to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetDuplexNil() { + o.Duplex.Set(nil) +} + +// UnsetDuplex ensures that no value is present for Duplex, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetDuplex() { + o.Duplex.Unset() +} + +// GetWwn returns the Wwn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetWwn() string { + if o == nil || IsNil(o.Wwn.Get()) { + var ret string + return ret + } + return *o.Wwn.Get() +} + +// GetWwnOk returns a tuple with the Wwn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetWwnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Wwn.Get(), o.Wwn.IsSet() +} + +// HasWwn returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasWwn() bool { + if o != nil && o.Wwn.IsSet() { + return true + } + + return false +} + +// SetWwn gets a reference to the given NullableString and assigns it to the Wwn field. +func (o *PatchedWritableInterfaceRequest) SetWwn(v string) { + o.Wwn.Set(&v) +} + +// SetWwnNil sets the value for Wwn to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetWwnNil() { + o.Wwn.Set(nil) +} + +// UnsetWwn ensures that no value is present for Wwn, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetWwn() { + o.Wwn.Unset() +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *PatchedWritableInterfaceRequest) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableInterfaceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetMode() PatchedWritableInterfaceRequestMode { + if o == nil || IsNil(o.Mode) { + var ret PatchedWritableInterfaceRequestMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetModeOk() (*PatchedWritableInterfaceRequestMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given PatchedWritableInterfaceRequestMode and assigns it to the Mode field. +func (o *PatchedWritableInterfaceRequest) SetMode(v PatchedWritableInterfaceRequestMode) { + o.Mode = &v +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetRfRole() WirelessRole { + if o == nil || IsNil(o.RfRole) { + var ret WirelessRole + return ret + } + return *o.RfRole +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetRfRoleOk() (*WirelessRole, bool) { + if o == nil || IsNil(o.RfRole) { + return nil, false + } + return o.RfRole, true +} + +// HasRfRole returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasRfRole() bool { + if o != nil && !IsNil(o.RfRole) { + return true + } + + return false +} + +// SetRfRole gets a reference to the given WirelessRole and assigns it to the RfRole field. +func (o *PatchedWritableInterfaceRequest) SetRfRole(v WirelessRole) { + o.RfRole = &v +} + +// GetRfChannel returns the RfChannel field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetRfChannel() WirelessChannel { + if o == nil || IsNil(o.RfChannel) { + var ret WirelessChannel + return ret + } + return *o.RfChannel +} + +// GetRfChannelOk returns a tuple with the RfChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetRfChannelOk() (*WirelessChannel, bool) { + if o == nil || IsNil(o.RfChannel) { + return nil, false + } + return o.RfChannel, true +} + +// HasRfChannel returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasRfChannel() bool { + if o != nil && !IsNil(o.RfChannel) { + return true + } + + return false +} + +// SetRfChannel gets a reference to the given WirelessChannel and assigns it to the RfChannel field. +func (o *PatchedWritableInterfaceRequest) SetRfChannel(v WirelessChannel) { + o.RfChannel = &v +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetPoeMode() InterfacePoeModeValue { + if o == nil || IsNil(o.PoeMode) { + var ret InterfacePoeModeValue + return ret + } + return *o.PoeMode +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetPoeModeOk() (*InterfacePoeModeValue, bool) { + if o == nil || IsNil(o.PoeMode) { + return nil, false + } + return o.PoeMode, true +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasPoeMode() bool { + if o != nil && !IsNil(o.PoeMode) { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given InterfacePoeModeValue and assigns it to the PoeMode field. +func (o *PatchedWritableInterfaceRequest) SetPoeMode(v InterfacePoeModeValue) { + o.PoeMode = &v +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetPoeType() InterfacePoeTypeValue { + if o == nil || IsNil(o.PoeType) { + var ret InterfacePoeTypeValue + return ret + } + return *o.PoeType +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetPoeTypeOk() (*InterfacePoeTypeValue, bool) { + if o == nil || IsNil(o.PoeType) { + return nil, false + } + return o.PoeType, true +} + +// HasPoeType returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasPoeType() bool { + if o != nil && !IsNil(o.PoeType) { + return true + } + + return false +} + +// SetPoeType gets a reference to the given InterfacePoeTypeValue and assigns it to the PoeType field. +func (o *PatchedWritableInterfaceRequest) SetPoeType(v InterfacePoeTypeValue) { + o.PoeType = &v +} + +// GetRfChannelFrequency returns the RfChannelFrequency field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetRfChannelFrequency() float64 { + if o == nil || IsNil(o.RfChannelFrequency.Get()) { + var ret float64 + return ret + } + return *o.RfChannelFrequency.Get() +} + +// GetRfChannelFrequencyOk returns a tuple with the RfChannelFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetRfChannelFrequencyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelFrequency.Get(), o.RfChannelFrequency.IsSet() +} + +// HasRfChannelFrequency returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasRfChannelFrequency() bool { + if o != nil && o.RfChannelFrequency.IsSet() { + return true + } + + return false +} + +// SetRfChannelFrequency gets a reference to the given NullableFloat64 and assigns it to the RfChannelFrequency field. +func (o *PatchedWritableInterfaceRequest) SetRfChannelFrequency(v float64) { + o.RfChannelFrequency.Set(&v) +} + +// SetRfChannelFrequencyNil sets the value for RfChannelFrequency to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetRfChannelFrequencyNil() { + o.RfChannelFrequency.Set(nil) +} + +// UnsetRfChannelFrequency ensures that no value is present for RfChannelFrequency, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetRfChannelFrequency() { + o.RfChannelFrequency.Unset() +} + +// GetRfChannelWidth returns the RfChannelWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetRfChannelWidth() float64 { + if o == nil || IsNil(o.RfChannelWidth.Get()) { + var ret float64 + return ret + } + return *o.RfChannelWidth.Get() +} + +// GetRfChannelWidthOk returns a tuple with the RfChannelWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetRfChannelWidthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelWidth.Get(), o.RfChannelWidth.IsSet() +} + +// HasRfChannelWidth returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasRfChannelWidth() bool { + if o != nil && o.RfChannelWidth.IsSet() { + return true + } + + return false +} + +// SetRfChannelWidth gets a reference to the given NullableFloat64 and assigns it to the RfChannelWidth field. +func (o *PatchedWritableInterfaceRequest) SetRfChannelWidth(v float64) { + o.RfChannelWidth.Set(&v) +} + +// SetRfChannelWidthNil sets the value for RfChannelWidth to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetRfChannelWidthNil() { + o.RfChannelWidth.Set(nil) +} + +// UnsetRfChannelWidth ensures that no value is present for RfChannelWidth, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetRfChannelWidth() { + o.RfChannelWidth.Unset() +} + +// GetTxPower returns the TxPower field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetTxPower() int32 { + if o == nil || IsNil(o.TxPower.Get()) { + var ret int32 + return ret + } + return *o.TxPower.Get() +} + +// GetTxPowerOk returns a tuple with the TxPower field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetTxPowerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.TxPower.Get(), o.TxPower.IsSet() +} + +// HasTxPower returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasTxPower() bool { + if o != nil && o.TxPower.IsSet() { + return true + } + + return false +} + +// SetTxPower gets a reference to the given NullableInt32 and assigns it to the TxPower field. +func (o *PatchedWritableInterfaceRequest) SetTxPower(v int32) { + o.TxPower.Set(&v) +} + +// SetTxPowerNil sets the value for TxPower to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetTxPowerNil() { + o.TxPower.Set(nil) +} + +// UnsetTxPower ensures that no value is present for TxPower, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetTxPower() { + o.TxPower.Unset() +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetUntaggedVlan() int32 { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret int32 + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetUntaggedVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableInt32 and assigns it to the UntaggedVlan field. +func (o *PatchedWritableInterfaceRequest) SetUntaggedVlan(v int32) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *PatchedWritableInterfaceRequest) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritableInterfaceRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetWirelessLans returns the WirelessLans field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetWirelessLans() []int32 { + if o == nil || IsNil(o.WirelessLans) { + var ret []int32 + return ret + } + return o.WirelessLans +} + +// GetWirelessLansOk returns a tuple with the WirelessLans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetWirelessLansOk() ([]int32, bool) { + if o == nil || IsNil(o.WirelessLans) { + return nil, false + } + return o.WirelessLans, true +} + +// HasWirelessLans returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasWirelessLans() bool { + if o != nil && !IsNil(o.WirelessLans) { + return true + } + + return false +} + +// SetWirelessLans gets a reference to the given []int32 and assigns it to the WirelessLans field. +func (o *PatchedWritableInterfaceRequest) SetWirelessLans(v []int32) { + o.WirelessLans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *PatchedWritableInterfaceRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *PatchedWritableInterfaceRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *PatchedWritableInterfaceRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableInterfaceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableInterfaceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Vdcs) { + toSerialize["vdcs"] = o.Vdcs + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Lag.IsSet() { + toSerialize["lag"] = o.Lag.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if o.Duplex.IsSet() { + toSerialize["duplex"] = o.Duplex.Get() + } + if o.Wwn.IsSet() { + toSerialize["wwn"] = o.Wwn.Get() + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.RfRole) { + toSerialize["rf_role"] = o.RfRole + } + if !IsNil(o.RfChannel) { + toSerialize["rf_channel"] = o.RfChannel + } + if !IsNil(o.PoeMode) { + toSerialize["poe_mode"] = o.PoeMode + } + if !IsNil(o.PoeType) { + toSerialize["poe_type"] = o.PoeType + } + if o.RfChannelFrequency.IsSet() { + toSerialize["rf_channel_frequency"] = o.RfChannelFrequency.Get() + } + if o.RfChannelWidth.IsSet() { + toSerialize["rf_channel_width"] = o.RfChannelWidth.Get() + } + if o.TxPower.IsSet() { + toSerialize["tx_power"] = o.TxPower.Get() + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.WirelessLans) { + toSerialize["wireless_lans"] = o.WirelessLans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableInterfaceRequest := _PatchedWritableInterfaceRequest{} + + err = json.Unmarshal(data, &varPatchedWritableInterfaceRequest) + + if err != nil { + return err + } + + *o = PatchedWritableInterfaceRequest(varPatchedWritableInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "vdcs") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "lag") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "speed") + delete(additionalProperties, "duplex") + delete(additionalProperties, "wwn") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "rf_role") + delete(additionalProperties, "rf_channel") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_channel_frequency") + delete(additionalProperties, "rf_channel_width") + delete(additionalProperties, "tx_power") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "wireless_lans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableInterfaceRequest struct { + value *PatchedWritableInterfaceRequest + isSet bool +} + +func (v NullablePatchedWritableInterfaceRequest) Get() *PatchedWritableInterfaceRequest { + return v.value +} + +func (v *NullablePatchedWritableInterfaceRequest) Set(val *PatchedWritableInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableInterfaceRequest(val *PatchedWritableInterfaceRequest) *NullablePatchedWritableInterfaceRequest { + return &NullablePatchedWritableInterfaceRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_request_mode.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_request_mode.go new file mode 100644 index 00000000..b0b9e7ff --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_request_mode.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableInterfaceRequestMode IEEE 802.1Q tagging strategy * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) +type PatchedWritableInterfaceRequestMode string + +// List of PatchedWritableInterfaceRequest_mode +const ( + PATCHEDWRITABLEINTERFACEREQUESTMODE_ACCESS PatchedWritableInterfaceRequestMode = "access" + PATCHEDWRITABLEINTERFACEREQUESTMODE_TAGGED PatchedWritableInterfaceRequestMode = "tagged" + PATCHEDWRITABLEINTERFACEREQUESTMODE_TAGGED_ALL PatchedWritableInterfaceRequestMode = "tagged-all" + PATCHEDWRITABLEINTERFACEREQUESTMODE_EMPTY PatchedWritableInterfaceRequestMode = "" +) + +// All allowed values of PatchedWritableInterfaceRequestMode enum +var AllowedPatchedWritableInterfaceRequestModeEnumValues = []PatchedWritableInterfaceRequestMode{ + "access", + "tagged", + "tagged-all", + "", +} + +func (v *PatchedWritableInterfaceRequestMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableInterfaceRequestMode(value) + for _, existing := range AllowedPatchedWritableInterfaceRequestModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableInterfaceRequestMode", value) +} + +// NewPatchedWritableInterfaceRequestModeFromValue returns a pointer to a valid PatchedWritableInterfaceRequestMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableInterfaceRequestModeFromValue(v string) (*PatchedWritableInterfaceRequestMode, error) { + ev := PatchedWritableInterfaceRequestMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableInterfaceRequestMode: valid values are %v", v, AllowedPatchedWritableInterfaceRequestModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableInterfaceRequestMode) IsValid() bool { + for _, existing := range AllowedPatchedWritableInterfaceRequestModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableInterfaceRequest_mode value +func (v PatchedWritableInterfaceRequestMode) Ptr() *PatchedWritableInterfaceRequestMode { + return &v +} + +type NullablePatchedWritableInterfaceRequestMode struct { + value *PatchedWritableInterfaceRequestMode + isSet bool +} + +func (v NullablePatchedWritableInterfaceRequestMode) Get() *PatchedWritableInterfaceRequestMode { + return v.value +} + +func (v *NullablePatchedWritableInterfaceRequestMode) Set(val *PatchedWritableInterfaceRequestMode) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableInterfaceRequestMode) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableInterfaceRequestMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableInterfaceRequestMode(val *PatchedWritableInterfaceRequestMode) *NullablePatchedWritableInterfaceRequestMode { + return &NullablePatchedWritableInterfaceRequestMode{value: val, isSet: true} +} + +func (v NullablePatchedWritableInterfaceRequestMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableInterfaceRequestMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_template_request.go new file mode 100644 index 00000000..c5aada5a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_interface_template_request.go @@ -0,0 +1,595 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableInterfaceTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableInterfaceTemplateRequest{} + +// PatchedWritableInterfaceTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableInterfaceTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *InterfaceTypeValue `json:"type,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Bridge NullableInt32 `json:"bridge,omitempty"` + PoeMode *InterfacePoeModeValue `json:"poe_mode,omitempty"` + PoeType *InterfacePoeTypeValue `json:"poe_type,omitempty"` + RfRole *WirelessRole `json:"rf_role,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableInterfaceTemplateRequest PatchedWritableInterfaceTemplateRequest + +// NewPatchedWritableInterfaceTemplateRequest instantiates a new PatchedWritableInterfaceTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableInterfaceTemplateRequest() *PatchedWritableInterfaceTemplateRequest { + this := PatchedWritableInterfaceTemplateRequest{} + return &this +} + +// NewPatchedWritableInterfaceTemplateRequestWithDefaults instantiates a new PatchedWritableInterfaceTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableInterfaceTemplateRequestWithDefaults() *PatchedWritableInterfaceTemplateRequest { + this := PatchedWritableInterfaceTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *PatchedWritableInterfaceTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PatchedWritableInterfaceTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PatchedWritableInterfaceTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *PatchedWritableInterfaceTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PatchedWritableInterfaceTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PatchedWritableInterfaceTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableInterfaceTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableInterfaceTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetType() InterfaceTypeValue { + if o == nil || IsNil(o.Type) { + var ret InterfaceTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetTypeOk() (*InterfaceTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given InterfaceTypeValue and assigns it to the Type field. +func (o *PatchedWritableInterfaceTemplateRequest) SetType(v InterfaceTypeValue) { + o.Type = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedWritableInterfaceTemplateRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *PatchedWritableInterfaceTemplateRequest) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableInterfaceTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInterfaceTemplateRequest) GetBridge() int32 { + if o == nil || IsNil(o.Bridge.Get()) { + var ret int32 + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInterfaceTemplateRequest) GetBridgeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableInt32 and assigns it to the Bridge field. +func (o *PatchedWritableInterfaceTemplateRequest) SetBridge(v int32) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *PatchedWritableInterfaceTemplateRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *PatchedWritableInterfaceTemplateRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetPoeMode() InterfacePoeModeValue { + if o == nil || IsNil(o.PoeMode) { + var ret InterfacePoeModeValue + return ret + } + return *o.PoeMode +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetPoeModeOk() (*InterfacePoeModeValue, bool) { + if o == nil || IsNil(o.PoeMode) { + return nil, false + } + return o.PoeMode, true +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasPoeMode() bool { + if o != nil && !IsNil(o.PoeMode) { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given InterfacePoeModeValue and assigns it to the PoeMode field. +func (o *PatchedWritableInterfaceTemplateRequest) SetPoeMode(v InterfacePoeModeValue) { + o.PoeMode = &v +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetPoeType() InterfacePoeTypeValue { + if o == nil || IsNil(o.PoeType) { + var ret InterfacePoeTypeValue + return ret + } + return *o.PoeType +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetPoeTypeOk() (*InterfacePoeTypeValue, bool) { + if o == nil || IsNil(o.PoeType) { + return nil, false + } + return o.PoeType, true +} + +// HasPoeType returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasPoeType() bool { + if o != nil && !IsNil(o.PoeType) { + return true + } + + return false +} + +// SetPoeType gets a reference to the given InterfacePoeTypeValue and assigns it to the PoeType field. +func (o *PatchedWritableInterfaceTemplateRequest) SetPoeType(v InterfacePoeTypeValue) { + o.PoeType = &v +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise. +func (o *PatchedWritableInterfaceTemplateRequest) GetRfRole() WirelessRole { + if o == nil || IsNil(o.RfRole) { + var ret WirelessRole + return ret + } + return *o.RfRole +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInterfaceTemplateRequest) GetRfRoleOk() (*WirelessRole, bool) { + if o == nil || IsNil(o.RfRole) { + return nil, false + } + return o.RfRole, true +} + +// HasRfRole returns a boolean if a field has been set. +func (o *PatchedWritableInterfaceTemplateRequest) HasRfRole() bool { + if o != nil && !IsNil(o.RfRole) { + return true + } + + return false +} + +// SetRfRole gets a reference to the given WirelessRole and assigns it to the RfRole field. +func (o *PatchedWritableInterfaceTemplateRequest) SetRfRole(v WirelessRole) { + o.RfRole = &v +} + +func (o PatchedWritableInterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableInterfaceTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if !IsNil(o.PoeMode) { + toSerialize["poe_mode"] = o.PoeMode + } + if !IsNil(o.PoeType) { + toSerialize["poe_type"] = o.PoeType + } + if !IsNil(o.RfRole) { + toSerialize["rf_role"] = o.RfRole + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableInterfaceTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableInterfaceTemplateRequest := _PatchedWritableInterfaceTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableInterfaceTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableInterfaceTemplateRequest(varPatchedWritableInterfaceTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "bridge") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_role") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableInterfaceTemplateRequest struct { + value *PatchedWritableInterfaceTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableInterfaceTemplateRequest) Get() *PatchedWritableInterfaceTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableInterfaceTemplateRequest) Set(val *PatchedWritableInterfaceTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableInterfaceTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableInterfaceTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableInterfaceTemplateRequest(val *PatchedWritableInterfaceTemplateRequest) *NullablePatchedWritableInterfaceTemplateRequest { + return &NullablePatchedWritableInterfaceTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableInterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableInterfaceTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_inventory_item_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_inventory_item_request.go new file mode 100644 index 00000000..2b1416c3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_inventory_item_request.go @@ -0,0 +1,741 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableInventoryItemRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableInventoryItemRequest{} + +// PatchedWritableInventoryItemRequest Adds support for custom fields and tags. +type PatchedWritableInventoryItemRequest struct { + Device *int32 `json:"device,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableInt32 `json:"role,omitempty"` + Manufacturer NullableInt32 `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this item + AssetTag NullableString `json:"asset_tag,omitempty"` + // This item was automatically discovered + Discovered *bool `json:"discovered,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableInventoryItemRequest PatchedWritableInventoryItemRequest + +// NewPatchedWritableInventoryItemRequest instantiates a new PatchedWritableInventoryItemRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableInventoryItemRequest() *PatchedWritableInventoryItemRequest { + this := PatchedWritableInventoryItemRequest{} + return &this +} + +// NewPatchedWritableInventoryItemRequestWithDefaults instantiates a new PatchedWritableInventoryItemRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableInventoryItemRequestWithDefaults() *PatchedWritableInventoryItemRequest { + this := PatchedWritableInventoryItemRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableInventoryItemRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableInventoryItemRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableInventoryItemRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableInventoryItemRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableInventoryItemRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableInventoryItemRequest) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *PatchedWritableInventoryItemRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PatchedWritableInventoryItemRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PatchedWritableInventoryItemRequest) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret int32 + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableInt32 and assigns it to the Manufacturer field. +func (o *PatchedWritableInventoryItemRequest) SetManufacturer(v int32) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *PatchedWritableInventoryItemRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *PatchedWritableInventoryItemRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *PatchedWritableInventoryItemRequest) SetPartId(v string) { + o.PartId = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *PatchedWritableInventoryItemRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *PatchedWritableInventoryItemRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *PatchedWritableInventoryItemRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *PatchedWritableInventoryItemRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDiscovered returns the Discovered field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetDiscovered() bool { + if o == nil || IsNil(o.Discovered) { + var ret bool + return ret + } + return *o.Discovered +} + +// GetDiscoveredOk returns a tuple with the Discovered field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetDiscoveredOk() (*bool, bool) { + if o == nil || IsNil(o.Discovered) { + return nil, false + } + return o.Discovered, true +} + +// HasDiscovered returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasDiscovered() bool { + if o != nil && !IsNil(o.Discovered) { + return true + } + + return false +} + +// SetDiscovered gets a reference to the given bool and assigns it to the Discovered field. +func (o *PatchedWritableInventoryItemRequest) SetDiscovered(v bool) { + o.Discovered = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableInventoryItemRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemRequest) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemRequest) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *PatchedWritableInventoryItemRequest) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *PatchedWritableInventoryItemRequest) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *PatchedWritableInventoryItemRequest) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemRequest) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemRequest) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *PatchedWritableInventoryItemRequest) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *PatchedWritableInventoryItemRequest) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *PatchedWritableInventoryItemRequest) UnsetComponentId() { + o.ComponentId.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableInventoryItemRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableInventoryItemRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableInventoryItemRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableInventoryItemRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Discovered) { + toSerialize["discovered"] = o.Discovered + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableInventoryItemRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableInventoryItemRequest := _PatchedWritableInventoryItemRequest{} + + err = json.Unmarshal(data, &varPatchedWritableInventoryItemRequest) + + if err != nil { + return err + } + + *o = PatchedWritableInventoryItemRequest(varPatchedWritableInventoryItemRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "discovered") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableInventoryItemRequest struct { + value *PatchedWritableInventoryItemRequest + isSet bool +} + +func (v NullablePatchedWritableInventoryItemRequest) Get() *PatchedWritableInventoryItemRequest { + return v.value +} + +func (v *NullablePatchedWritableInventoryItemRequest) Set(val *PatchedWritableInventoryItemRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableInventoryItemRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableInventoryItemRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableInventoryItemRequest(val *PatchedWritableInventoryItemRequest) *NullablePatchedWritableInventoryItemRequest { + return &NullablePatchedWritableInventoryItemRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableInventoryItemRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableInventoryItemRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_inventory_item_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_inventory_item_template_request.go new file mode 100644 index 00000000..7f30f253 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_inventory_item_template_request.go @@ -0,0 +1,544 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableInventoryItemTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableInventoryItemTemplateRequest{} + +// PatchedWritableInventoryItemTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableInventoryItemTemplateRequest struct { + DeviceType *int32 `json:"device_type,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableInt32 `json:"role,omitempty"` + Manufacturer NullableInt32 `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableInventoryItemTemplateRequest PatchedWritableInventoryItemTemplateRequest + +// NewPatchedWritableInventoryItemTemplateRequest instantiates a new PatchedWritableInventoryItemTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableInventoryItemTemplateRequest() *PatchedWritableInventoryItemTemplateRequest { + this := PatchedWritableInventoryItemTemplateRequest{} + return &this +} + +// NewPatchedWritableInventoryItemTemplateRequestWithDefaults instantiates a new PatchedWritableInventoryItemTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableInventoryItemTemplateRequestWithDefaults() *PatchedWritableInventoryItemTemplateRequest { + this := PatchedWritableInventoryItemTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType) { + var ret int32 + return ret + } + return *o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil || IsNil(o.DeviceType) { + return nil, false + } + return o.DeviceType, true +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasDeviceType() bool { + if o != nil && !IsNil(o.DeviceType) { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given int32 and assigns it to the DeviceType field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetDeviceType(v int32) { + o.DeviceType = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemTemplateRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemTemplateRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemTemplateRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemTemplateRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemTemplateRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret int32 + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemTemplateRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableInt32 and assigns it to the Manufacturer field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetManufacturer(v int32) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemTemplateRequest) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetPartId(v string) { + o.PartId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableInventoryItemTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemTemplateRequest) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemTemplateRequest) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableInventoryItemTemplateRequest) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableInventoryItemTemplateRequest) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *PatchedWritableInventoryItemTemplateRequest) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *PatchedWritableInventoryItemTemplateRequest) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *PatchedWritableInventoryItemTemplateRequest) UnsetComponentId() { + o.ComponentId.Unset() +} + +func (o PatchedWritableInventoryItemTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableInventoryItemTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceType) { + toSerialize["device_type"] = o.DeviceType + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableInventoryItemTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableInventoryItemTemplateRequest := _PatchedWritableInventoryItemTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableInventoryItemTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableInventoryItemTemplateRequest(varPatchedWritableInventoryItemTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableInventoryItemTemplateRequest struct { + value *PatchedWritableInventoryItemTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableInventoryItemTemplateRequest) Get() *PatchedWritableInventoryItemTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableInventoryItemTemplateRequest) Set(val *PatchedWritableInventoryItemTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableInventoryItemTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableInventoryItemTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableInventoryItemTemplateRequest(val *PatchedWritableInventoryItemTemplateRequest) *NullablePatchedWritableInventoryItemTemplateRequest { + return &NullablePatchedWritableInventoryItemTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableInventoryItemTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableInventoryItemTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request.go new file mode 100644 index 00000000..17935f45 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request.go @@ -0,0 +1,654 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableIPAddressRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableIPAddressRequest{} + +// PatchedWritableIPAddressRequest Adds support for custom fields and tags. +type PatchedWritableIPAddressRequest struct { + Address *string `json:"address,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableIPAddressRequestStatus `json:"status,omitempty"` + Role *PatchedWritableIPAddressRequestRole `json:"role,omitempty"` + AssignedObjectType NullableString `json:"assigned_object_type,omitempty"` + AssignedObjectId NullableInt64 `json:"assigned_object_id,omitempty"` + // The IP for which this address is the \"outside\" IP + NatInside NullableInt32 `json:"nat_inside,omitempty"` + // Hostname or FQDN (not case-sensitive) + DnsName *string `json:"dns_name,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableIPAddressRequest PatchedWritableIPAddressRequest + +// NewPatchedWritableIPAddressRequest instantiates a new PatchedWritableIPAddressRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableIPAddressRequest() *PatchedWritableIPAddressRequest { + this := PatchedWritableIPAddressRequest{} + return &this +} + +// NewPatchedWritableIPAddressRequestWithDefaults instantiates a new PatchedWritableIPAddressRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableIPAddressRequestWithDefaults() *PatchedWritableIPAddressRequest { + this := PatchedWritableIPAddressRequest{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *PatchedWritableIPAddressRequest) SetAddress(v string) { + o.Address = &v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPAddressRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPAddressRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *PatchedWritableIPAddressRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *PatchedWritableIPAddressRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *PatchedWritableIPAddressRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPAddressRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPAddressRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableIPAddressRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableIPAddressRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableIPAddressRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetStatus() PatchedWritableIPAddressRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableIPAddressRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetStatusOk() (*PatchedWritableIPAddressRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableIPAddressRequestStatus and assigns it to the Status field. +func (o *PatchedWritableIPAddressRequest) SetStatus(v PatchedWritableIPAddressRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetRole() PatchedWritableIPAddressRequestRole { + if o == nil || IsNil(o.Role) { + var ret PatchedWritableIPAddressRequestRole + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetRoleOk() (*PatchedWritableIPAddressRequestRole, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given PatchedWritableIPAddressRequestRole and assigns it to the Role field. +func (o *PatchedWritableIPAddressRequest) SetRole(v PatchedWritableIPAddressRequestRole) { + o.Role = &v +} + +// GetAssignedObjectType returns the AssignedObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPAddressRequest) GetAssignedObjectType() string { + if o == nil || IsNil(o.AssignedObjectType.Get()) { + var ret string + return ret + } + return *o.AssignedObjectType.Get() +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPAddressRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectType.Get(), o.AssignedObjectType.IsSet() +} + +// HasAssignedObjectType returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasAssignedObjectType() bool { + if o != nil && o.AssignedObjectType.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectType gets a reference to the given NullableString and assigns it to the AssignedObjectType field. +func (o *PatchedWritableIPAddressRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType.Set(&v) +} + +// SetAssignedObjectTypeNil sets the value for AssignedObjectType to be an explicit nil +func (o *PatchedWritableIPAddressRequest) SetAssignedObjectTypeNil() { + o.AssignedObjectType.Set(nil) +} + +// UnsetAssignedObjectType ensures that no value is present for AssignedObjectType, not even an explicit nil +func (o *PatchedWritableIPAddressRequest) UnsetAssignedObjectType() { + o.AssignedObjectType.Unset() +} + +// GetAssignedObjectId returns the AssignedObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPAddressRequest) GetAssignedObjectId() int64 { + if o == nil || IsNil(o.AssignedObjectId.Get()) { + var ret int64 + return ret + } + return *o.AssignedObjectId.Get() +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPAddressRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectId.Get(), o.AssignedObjectId.IsSet() +} + +// HasAssignedObjectId returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasAssignedObjectId() bool { + if o != nil && o.AssignedObjectId.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectId gets a reference to the given NullableInt64 and assigns it to the AssignedObjectId field. +func (o *PatchedWritableIPAddressRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId.Set(&v) +} + +// SetAssignedObjectIdNil sets the value for AssignedObjectId to be an explicit nil +func (o *PatchedWritableIPAddressRequest) SetAssignedObjectIdNil() { + o.AssignedObjectId.Set(nil) +} + +// UnsetAssignedObjectId ensures that no value is present for AssignedObjectId, not even an explicit nil +func (o *PatchedWritableIPAddressRequest) UnsetAssignedObjectId() { + o.AssignedObjectId.Unset() +} + +// GetNatInside returns the NatInside field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPAddressRequest) GetNatInside() int32 { + if o == nil || IsNil(o.NatInside.Get()) { + var ret int32 + return ret + } + return *o.NatInside.Get() +} + +// GetNatInsideOk returns a tuple with the NatInside field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPAddressRequest) GetNatInsideOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.NatInside.Get(), o.NatInside.IsSet() +} + +// HasNatInside returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasNatInside() bool { + if o != nil && o.NatInside.IsSet() { + return true + } + + return false +} + +// SetNatInside gets a reference to the given NullableInt32 and assigns it to the NatInside field. +func (o *PatchedWritableIPAddressRequest) SetNatInside(v int32) { + o.NatInside.Set(&v) +} + +// SetNatInsideNil sets the value for NatInside to be an explicit nil +func (o *PatchedWritableIPAddressRequest) SetNatInsideNil() { + o.NatInside.Set(nil) +} + +// UnsetNatInside ensures that no value is present for NatInside, not even an explicit nil +func (o *PatchedWritableIPAddressRequest) UnsetNatInside() { + o.NatInside.Unset() +} + +// GetDnsName returns the DnsName field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetDnsName() string { + if o == nil || IsNil(o.DnsName) { + var ret string + return ret + } + return *o.DnsName +} + +// GetDnsNameOk returns a tuple with the DnsName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetDnsNameOk() (*string, bool) { + if o == nil || IsNil(o.DnsName) { + return nil, false + } + return o.DnsName, true +} + +// HasDnsName returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasDnsName() bool { + if o != nil && !IsNil(o.DnsName) { + return true + } + + return false +} + +// SetDnsName gets a reference to the given string and assigns it to the DnsName field. +func (o *PatchedWritableIPAddressRequest) SetDnsName(v string) { + o.DnsName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableIPAddressRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableIPAddressRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableIPAddressRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableIPAddressRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPAddressRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableIPAddressRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableIPAddressRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableIPAddressRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableIPAddressRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if o.AssignedObjectType.IsSet() { + toSerialize["assigned_object_type"] = o.AssignedObjectType.Get() + } + if o.AssignedObjectId.IsSet() { + toSerialize["assigned_object_id"] = o.AssignedObjectId.Get() + } + if o.NatInside.IsSet() { + toSerialize["nat_inside"] = o.NatInside.Get() + } + if !IsNil(o.DnsName) { + toSerialize["dns_name"] = o.DnsName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableIPAddressRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableIPAddressRequest := _PatchedWritableIPAddressRequest{} + + err = json.Unmarshal(data, &varPatchedWritableIPAddressRequest) + + if err != nil { + return err + } + + *o = PatchedWritableIPAddressRequest(varPatchedWritableIPAddressRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "nat_inside") + delete(additionalProperties, "dns_name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableIPAddressRequest struct { + value *PatchedWritableIPAddressRequest + isSet bool +} + +func (v NullablePatchedWritableIPAddressRequest) Get() *PatchedWritableIPAddressRequest { + return v.value +} + +func (v *NullablePatchedWritableIPAddressRequest) Set(val *PatchedWritableIPAddressRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPAddressRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPAddressRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPAddressRequest(val *PatchedWritableIPAddressRequest) *NullablePatchedWritableIPAddressRequest { + return &NullablePatchedWritableIPAddressRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPAddressRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPAddressRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request_role.go new file mode 100644 index 00000000..911528c9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request_role.go @@ -0,0 +1,124 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableIPAddressRequestRole The functional role of this IP * `loopback` - Loopback * `secondary` - Secondary * `anycast` - Anycast * `vip` - VIP * `vrrp` - VRRP * `hsrp` - HSRP * `glbp` - GLBP * `carp` - CARP +type PatchedWritableIPAddressRequestRole string + +// List of PatchedWritableIPAddressRequest_role +const ( + PATCHEDWRITABLEIPADDRESSREQUESTROLE_LOOPBACK PatchedWritableIPAddressRequestRole = "loopback" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_SECONDARY PatchedWritableIPAddressRequestRole = "secondary" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_ANYCAST PatchedWritableIPAddressRequestRole = "anycast" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_VIP PatchedWritableIPAddressRequestRole = "vip" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_VRRP PatchedWritableIPAddressRequestRole = "vrrp" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_HSRP PatchedWritableIPAddressRequestRole = "hsrp" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_GLBP PatchedWritableIPAddressRequestRole = "glbp" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_CARP PatchedWritableIPAddressRequestRole = "carp" + PATCHEDWRITABLEIPADDRESSREQUESTROLE_EMPTY PatchedWritableIPAddressRequestRole = "" +) + +// All allowed values of PatchedWritableIPAddressRequestRole enum +var AllowedPatchedWritableIPAddressRequestRoleEnumValues = []PatchedWritableIPAddressRequestRole{ + "loopback", + "secondary", + "anycast", + "vip", + "vrrp", + "hsrp", + "glbp", + "carp", + "", +} + +func (v *PatchedWritableIPAddressRequestRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableIPAddressRequestRole(value) + for _, existing := range AllowedPatchedWritableIPAddressRequestRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableIPAddressRequestRole", value) +} + +// NewPatchedWritableIPAddressRequestRoleFromValue returns a pointer to a valid PatchedWritableIPAddressRequestRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableIPAddressRequestRoleFromValue(v string) (*PatchedWritableIPAddressRequestRole, error) { + ev := PatchedWritableIPAddressRequestRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableIPAddressRequestRole: valid values are %v", v, AllowedPatchedWritableIPAddressRequestRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableIPAddressRequestRole) IsValid() bool { + for _, existing := range AllowedPatchedWritableIPAddressRequestRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableIPAddressRequest_role value +func (v PatchedWritableIPAddressRequestRole) Ptr() *PatchedWritableIPAddressRequestRole { + return &v +} + +type NullablePatchedWritableIPAddressRequestRole struct { + value *PatchedWritableIPAddressRequestRole + isSet bool +} + +func (v NullablePatchedWritableIPAddressRequestRole) Get() *PatchedWritableIPAddressRequestRole { + return v.value +} + +func (v *NullablePatchedWritableIPAddressRequestRole) Set(val *PatchedWritableIPAddressRequestRole) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPAddressRequestRole) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPAddressRequestRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPAddressRequestRole(val *PatchedWritableIPAddressRequestRole) *NullablePatchedWritableIPAddressRequestRole { + return &NullablePatchedWritableIPAddressRequestRole{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPAddressRequestRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPAddressRequestRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request_status.go new file mode 100644 index 00000000..2c5473dc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_address_request_status.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableIPAddressRequestStatus The operational status of this IP * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated * `dhcp` - DHCP * `slaac` - SLAAC +type PatchedWritableIPAddressRequestStatus string + +// List of PatchedWritableIPAddressRequest_status +const ( + PATCHEDWRITABLEIPADDRESSREQUESTSTATUS_ACTIVE PatchedWritableIPAddressRequestStatus = "active" + PATCHEDWRITABLEIPADDRESSREQUESTSTATUS_RESERVED PatchedWritableIPAddressRequestStatus = "reserved" + PATCHEDWRITABLEIPADDRESSREQUESTSTATUS_DEPRECATED PatchedWritableIPAddressRequestStatus = "deprecated" + PATCHEDWRITABLEIPADDRESSREQUESTSTATUS_DHCP PatchedWritableIPAddressRequestStatus = "dhcp" + PATCHEDWRITABLEIPADDRESSREQUESTSTATUS_SLAAC PatchedWritableIPAddressRequestStatus = "slaac" +) + +// All allowed values of PatchedWritableIPAddressRequestStatus enum +var AllowedPatchedWritableIPAddressRequestStatusEnumValues = []PatchedWritableIPAddressRequestStatus{ + "active", + "reserved", + "deprecated", + "dhcp", + "slaac", +} + +func (v *PatchedWritableIPAddressRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableIPAddressRequestStatus(value) + for _, existing := range AllowedPatchedWritableIPAddressRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableIPAddressRequestStatus", value) +} + +// NewPatchedWritableIPAddressRequestStatusFromValue returns a pointer to a valid PatchedWritableIPAddressRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableIPAddressRequestStatusFromValue(v string) (*PatchedWritableIPAddressRequestStatus, error) { + ev := PatchedWritableIPAddressRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableIPAddressRequestStatus: valid values are %v", v, AllowedPatchedWritableIPAddressRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableIPAddressRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritableIPAddressRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableIPAddressRequest_status value +func (v PatchedWritableIPAddressRequestStatus) Ptr() *PatchedWritableIPAddressRequestStatus { + return &v +} + +type NullablePatchedWritableIPAddressRequestStatus struct { + value *PatchedWritableIPAddressRequestStatus + isSet bool +} + +func (v NullablePatchedWritableIPAddressRequestStatus) Get() *PatchedWritableIPAddressRequestStatus { + return v.value +} + +func (v *NullablePatchedWritableIPAddressRequestStatus) Set(val *PatchedWritableIPAddressRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPAddressRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPAddressRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPAddressRequestStatus(val *PatchedWritableIPAddressRequestStatus) *NullablePatchedWritableIPAddressRequestStatus { + return &NullablePatchedWritableIPAddressRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPAddressRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPAddressRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_range_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_range_request.go new file mode 100644 index 00000000..1d91db98 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_range_request.go @@ -0,0 +1,558 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableIPRangeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableIPRangeRequest{} + +// PatchedWritableIPRangeRequest Adds support for custom fields and tags. +type PatchedWritableIPRangeRequest struct { + StartAddress *string `json:"start_address,omitempty"` + EndAddress *string `json:"end_address,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableIPRangeRequestStatus `json:"status,omitempty"` + // The primary function of this range + Role NullableInt32 `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableIPRangeRequest PatchedWritableIPRangeRequest + +// NewPatchedWritableIPRangeRequest instantiates a new PatchedWritableIPRangeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableIPRangeRequest() *PatchedWritableIPRangeRequest { + this := PatchedWritableIPRangeRequest{} + return &this +} + +// NewPatchedWritableIPRangeRequestWithDefaults instantiates a new PatchedWritableIPRangeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableIPRangeRequestWithDefaults() *PatchedWritableIPRangeRequest { + this := PatchedWritableIPRangeRequest{} + return &this +} + +// GetStartAddress returns the StartAddress field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetStartAddress() string { + if o == nil || IsNil(o.StartAddress) { + var ret string + return ret + } + return *o.StartAddress +} + +// GetStartAddressOk returns a tuple with the StartAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetStartAddressOk() (*string, bool) { + if o == nil || IsNil(o.StartAddress) { + return nil, false + } + return o.StartAddress, true +} + +// HasStartAddress returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasStartAddress() bool { + if o != nil && !IsNil(o.StartAddress) { + return true + } + + return false +} + +// SetStartAddress gets a reference to the given string and assigns it to the StartAddress field. +func (o *PatchedWritableIPRangeRequest) SetStartAddress(v string) { + o.StartAddress = &v +} + +// GetEndAddress returns the EndAddress field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetEndAddress() string { + if o == nil || IsNil(o.EndAddress) { + var ret string + return ret + } + return *o.EndAddress +} + +// GetEndAddressOk returns a tuple with the EndAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetEndAddressOk() (*string, bool) { + if o == nil || IsNil(o.EndAddress) { + return nil, false + } + return o.EndAddress, true +} + +// HasEndAddress returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasEndAddress() bool { + if o != nil && !IsNil(o.EndAddress) { + return true + } + + return false +} + +// SetEndAddress gets a reference to the given string and assigns it to the EndAddress field. +func (o *PatchedWritableIPRangeRequest) SetEndAddress(v string) { + o.EndAddress = &v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPRangeRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPRangeRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *PatchedWritableIPRangeRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *PatchedWritableIPRangeRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *PatchedWritableIPRangeRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPRangeRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPRangeRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableIPRangeRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableIPRangeRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableIPRangeRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetStatus() PatchedWritableIPRangeRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableIPRangeRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetStatusOk() (*PatchedWritableIPRangeRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableIPRangeRequestStatus and assigns it to the Status field. +func (o *PatchedWritableIPRangeRequest) SetStatus(v PatchedWritableIPRangeRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPRangeRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPRangeRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *PatchedWritableIPRangeRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PatchedWritableIPRangeRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PatchedWritableIPRangeRequest) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableIPRangeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableIPRangeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableIPRangeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableIPRangeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *PatchedWritableIPRangeRequest) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPRangeRequest) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *PatchedWritableIPRangeRequest) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *PatchedWritableIPRangeRequest) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +func (o PatchedWritableIPRangeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableIPRangeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.StartAddress) { + toSerialize["start_address"] = o.StartAddress + } + if !IsNil(o.EndAddress) { + toSerialize["end_address"] = o.EndAddress + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableIPRangeRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableIPRangeRequest := _PatchedWritableIPRangeRequest{} + + err = json.Unmarshal(data, &varPatchedWritableIPRangeRequest) + + if err != nil { + return err + } + + *o = PatchedWritableIPRangeRequest(varPatchedWritableIPRangeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "start_address") + delete(additionalProperties, "end_address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "mark_utilized") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableIPRangeRequest struct { + value *PatchedWritableIPRangeRequest + isSet bool +} + +func (v NullablePatchedWritableIPRangeRequest) Get() *PatchedWritableIPRangeRequest { + return v.value +} + +func (v *NullablePatchedWritableIPRangeRequest) Set(val *PatchedWritableIPRangeRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPRangeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPRangeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPRangeRequest(val *PatchedWritableIPRangeRequest) *NullablePatchedWritableIPRangeRequest { + return &NullablePatchedWritableIPRangeRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPRangeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPRangeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_range_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_range_request_status.go new file mode 100644 index 00000000..2125107c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_range_request_status.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableIPRangeRequestStatus Operational status of this range * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated +type PatchedWritableIPRangeRequestStatus string + +// List of PatchedWritableIPRangeRequest_status +const ( + PATCHEDWRITABLEIPRANGEREQUESTSTATUS_ACTIVE PatchedWritableIPRangeRequestStatus = "active" + PATCHEDWRITABLEIPRANGEREQUESTSTATUS_RESERVED PatchedWritableIPRangeRequestStatus = "reserved" + PATCHEDWRITABLEIPRANGEREQUESTSTATUS_DEPRECATED PatchedWritableIPRangeRequestStatus = "deprecated" +) + +// All allowed values of PatchedWritableIPRangeRequestStatus enum +var AllowedPatchedWritableIPRangeRequestStatusEnumValues = []PatchedWritableIPRangeRequestStatus{ + "active", + "reserved", + "deprecated", +} + +func (v *PatchedWritableIPRangeRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableIPRangeRequestStatus(value) + for _, existing := range AllowedPatchedWritableIPRangeRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableIPRangeRequestStatus", value) +} + +// NewPatchedWritableIPRangeRequestStatusFromValue returns a pointer to a valid PatchedWritableIPRangeRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableIPRangeRequestStatusFromValue(v string) (*PatchedWritableIPRangeRequestStatus, error) { + ev := PatchedWritableIPRangeRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableIPRangeRequestStatus: valid values are %v", v, AllowedPatchedWritableIPRangeRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableIPRangeRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritableIPRangeRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableIPRangeRequest_status value +func (v PatchedWritableIPRangeRequestStatus) Ptr() *PatchedWritableIPRangeRequestStatus { + return &v +} + +type NullablePatchedWritableIPRangeRequestStatus struct { + value *PatchedWritableIPRangeRequestStatus + isSet bool +} + +func (v NullablePatchedWritableIPRangeRequestStatus) Get() *PatchedWritableIPRangeRequestStatus { + return v.value +} + +func (v *NullablePatchedWritableIPRangeRequestStatus) Set(val *PatchedWritableIPRangeRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPRangeRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPRangeRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPRangeRequestStatus(val *PatchedWritableIPRangeRequestStatus) *NullablePatchedWritableIPRangeRequestStatus { + return &NullablePatchedWritableIPRangeRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPRangeRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPRangeRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_policy_request.go new file mode 100644 index 00000000..a2e6383d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_policy_request.go @@ -0,0 +1,386 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableIPSecPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableIPSecPolicyRequest{} + +// PatchedWritableIPSecPolicyRequest Adds support for custom fields and tags. +type PatchedWritableIPSecPolicyRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Proposals []int32 `json:"proposals,omitempty"` + PfsGroup NullablePatchedWritableIPSecPolicyRequestPfsGroup `json:"pfs_group,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableIPSecPolicyRequest PatchedWritableIPSecPolicyRequest + +// NewPatchedWritableIPSecPolicyRequest instantiates a new PatchedWritableIPSecPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableIPSecPolicyRequest() *PatchedWritableIPSecPolicyRequest { + this := PatchedWritableIPSecPolicyRequest{} + return &this +} + +// NewPatchedWritableIPSecPolicyRequestWithDefaults instantiates a new PatchedWritableIPSecPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableIPSecPolicyRequestWithDefaults() *PatchedWritableIPSecPolicyRequest { + this := PatchedWritableIPSecPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableIPSecPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableIPSecPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableIPSecPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableIPSecPolicyRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecPolicyRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableIPSecPolicyRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableIPSecPolicyRequest) SetDescription(v string) { + o.Description = &v +} + +// GetProposals returns the Proposals field value if set, zero value otherwise. +func (o *PatchedWritableIPSecPolicyRequest) GetProposals() []int32 { + if o == nil || IsNil(o.Proposals) { + var ret []int32 + return ret + } + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecPolicyRequest) GetProposalsOk() ([]int32, bool) { + if o == nil || IsNil(o.Proposals) { + return nil, false + } + return o.Proposals, true +} + +// HasProposals returns a boolean if a field has been set. +func (o *PatchedWritableIPSecPolicyRequest) HasProposals() bool { + if o != nil && !IsNil(o.Proposals) { + return true + } + + return false +} + +// SetProposals gets a reference to the given []int32 and assigns it to the Proposals field. +func (o *PatchedWritableIPSecPolicyRequest) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPfsGroup returns the PfsGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPSecPolicyRequest) GetPfsGroup() PatchedWritableIPSecPolicyRequestPfsGroup { + if o == nil || IsNil(o.PfsGroup.Get()) { + var ret PatchedWritableIPSecPolicyRequestPfsGroup + return ret + } + return *o.PfsGroup.Get() +} + +// GetPfsGroupOk returns a tuple with the PfsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPSecPolicyRequest) GetPfsGroupOk() (*PatchedWritableIPSecPolicyRequestPfsGroup, bool) { + if o == nil { + return nil, false + } + return o.PfsGroup.Get(), o.PfsGroup.IsSet() +} + +// HasPfsGroup returns a boolean if a field has been set. +func (o *PatchedWritableIPSecPolicyRequest) HasPfsGroup() bool { + if o != nil && o.PfsGroup.IsSet() { + return true + } + + return false +} + +// SetPfsGroup gets a reference to the given NullablePatchedWritableIPSecPolicyRequestPfsGroup and assigns it to the PfsGroup field. +func (o *PatchedWritableIPSecPolicyRequest) SetPfsGroup(v PatchedWritableIPSecPolicyRequestPfsGroup) { + o.PfsGroup.Set(&v) +} + +// SetPfsGroupNil sets the value for PfsGroup to be an explicit nil +func (o *PatchedWritableIPSecPolicyRequest) SetPfsGroupNil() { + o.PfsGroup.Set(nil) +} + +// UnsetPfsGroup ensures that no value is present for PfsGroup, not even an explicit nil +func (o *PatchedWritableIPSecPolicyRequest) UnsetPfsGroup() { + o.PfsGroup.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableIPSecPolicyRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecPolicyRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableIPSecPolicyRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableIPSecPolicyRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableIPSecPolicyRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecPolicyRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableIPSecPolicyRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableIPSecPolicyRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableIPSecPolicyRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecPolicyRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableIPSecPolicyRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableIPSecPolicyRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableIPSecPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableIPSecPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Proposals) { + toSerialize["proposals"] = o.Proposals + } + if o.PfsGroup.IsSet() { + toSerialize["pfs_group"] = o.PfsGroup.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableIPSecPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableIPSecPolicyRequest := _PatchedWritableIPSecPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedWritableIPSecPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedWritableIPSecPolicyRequest(varPatchedWritableIPSecPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "proposals") + delete(additionalProperties, "pfs_group") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableIPSecPolicyRequest struct { + value *PatchedWritableIPSecPolicyRequest + isSet bool +} + +func (v NullablePatchedWritableIPSecPolicyRequest) Get() *PatchedWritableIPSecPolicyRequest { + return v.value +} + +func (v *NullablePatchedWritableIPSecPolicyRequest) Set(val *PatchedWritableIPSecPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPSecPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPSecPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPSecPolicyRequest(val *PatchedWritableIPSecPolicyRequest) *NullablePatchedWritableIPSecPolicyRequest { + return &NullablePatchedWritableIPSecPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPSecPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPSecPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_policy_request_pfs_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_policy_request_pfs_group.go new file mode 100644 index 00000000..e26204a3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_policy_request_pfs_group.go @@ -0,0 +1,154 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableIPSecPolicyRequestPfsGroup Diffie-Hellman group for Perfect Forward Secrecy * `1` - Group 1 * `2` - Group 2 * `5` - Group 5 * `14` - Group 14 * `15` - Group 15 * `16` - Group 16 * `17` - Group 17 * `18` - Group 18 * `19` - Group 19 * `20` - Group 20 * `21` - Group 21 * `22` - Group 22 * `23` - Group 23 * `24` - Group 24 * `25` - Group 25 * `26` - Group 26 * `27` - Group 27 * `28` - Group 28 * `29` - Group 29 * `30` - Group 30 * `31` - Group 31 * `32` - Group 32 * `33` - Group 33 * `34` - Group 34 +type PatchedWritableIPSecPolicyRequestPfsGroup int32 + +// List of PatchedWritableIPSecPolicyRequest_pfs_group +const ( + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__1 PatchedWritableIPSecPolicyRequestPfsGroup = 1 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__2 PatchedWritableIPSecPolicyRequestPfsGroup = 2 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__5 PatchedWritableIPSecPolicyRequestPfsGroup = 5 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__14 PatchedWritableIPSecPolicyRequestPfsGroup = 14 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__15 PatchedWritableIPSecPolicyRequestPfsGroup = 15 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__16 PatchedWritableIPSecPolicyRequestPfsGroup = 16 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__17 PatchedWritableIPSecPolicyRequestPfsGroup = 17 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__18 PatchedWritableIPSecPolicyRequestPfsGroup = 18 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__19 PatchedWritableIPSecPolicyRequestPfsGroup = 19 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__20 PatchedWritableIPSecPolicyRequestPfsGroup = 20 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__21 PatchedWritableIPSecPolicyRequestPfsGroup = 21 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__22 PatchedWritableIPSecPolicyRequestPfsGroup = 22 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__23 PatchedWritableIPSecPolicyRequestPfsGroup = 23 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__24 PatchedWritableIPSecPolicyRequestPfsGroup = 24 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__25 PatchedWritableIPSecPolicyRequestPfsGroup = 25 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__26 PatchedWritableIPSecPolicyRequestPfsGroup = 26 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__27 PatchedWritableIPSecPolicyRequestPfsGroup = 27 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__28 PatchedWritableIPSecPolicyRequestPfsGroup = 28 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__29 PatchedWritableIPSecPolicyRequestPfsGroup = 29 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__30 PatchedWritableIPSecPolicyRequestPfsGroup = 30 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__31 PatchedWritableIPSecPolicyRequestPfsGroup = 31 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__32 PatchedWritableIPSecPolicyRequestPfsGroup = 32 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__33 PatchedWritableIPSecPolicyRequestPfsGroup = 33 + PATCHEDWRITABLEIPSECPOLICYREQUESTPFSGROUP__34 PatchedWritableIPSecPolicyRequestPfsGroup = 34 +) + +// All allowed values of PatchedWritableIPSecPolicyRequestPfsGroup enum +var AllowedPatchedWritableIPSecPolicyRequestPfsGroupEnumValues = []PatchedWritableIPSecPolicyRequestPfsGroup{ + 1, + 2, + 5, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, +} + +func (v *PatchedWritableIPSecPolicyRequestPfsGroup) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableIPSecPolicyRequestPfsGroup(value) + for _, existing := range AllowedPatchedWritableIPSecPolicyRequestPfsGroupEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableIPSecPolicyRequestPfsGroup", value) +} + +// NewPatchedWritableIPSecPolicyRequestPfsGroupFromValue returns a pointer to a valid PatchedWritableIPSecPolicyRequestPfsGroup +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableIPSecPolicyRequestPfsGroupFromValue(v int32) (*PatchedWritableIPSecPolicyRequestPfsGroup, error) { + ev := PatchedWritableIPSecPolicyRequestPfsGroup(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableIPSecPolicyRequestPfsGroup: valid values are %v", v, AllowedPatchedWritableIPSecPolicyRequestPfsGroupEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableIPSecPolicyRequestPfsGroup) IsValid() bool { + for _, existing := range AllowedPatchedWritableIPSecPolicyRequestPfsGroupEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableIPSecPolicyRequest_pfs_group value +func (v PatchedWritableIPSecPolicyRequestPfsGroup) Ptr() *PatchedWritableIPSecPolicyRequestPfsGroup { + return &v +} + +type NullablePatchedWritableIPSecPolicyRequestPfsGroup struct { + value *PatchedWritableIPSecPolicyRequestPfsGroup + isSet bool +} + +func (v NullablePatchedWritableIPSecPolicyRequestPfsGroup) Get() *PatchedWritableIPSecPolicyRequestPfsGroup { + return v.value +} + +func (v *NullablePatchedWritableIPSecPolicyRequestPfsGroup) Set(val *PatchedWritableIPSecPolicyRequestPfsGroup) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPSecPolicyRequestPfsGroup) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPSecPolicyRequestPfsGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPSecPolicyRequestPfsGroup(val *PatchedWritableIPSecPolicyRequestPfsGroup) *NullablePatchedWritableIPSecPolicyRequestPfsGroup { + return &NullablePatchedWritableIPSecPolicyRequestPfsGroup{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPSecPolicyRequestPfsGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPSecPolicyRequestPfsGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_profile_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_profile_request.go new file mode 100644 index 00000000..c343352d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_profile_request.go @@ -0,0 +1,412 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableIPSecProfileRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableIPSecProfileRequest{} + +// PatchedWritableIPSecProfileRequest Adds support for custom fields and tags. +type PatchedWritableIPSecProfileRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Mode *IPSecProfileModeValue `json:"mode,omitempty"` + IkePolicy *int32 `json:"ike_policy,omitempty"` + IpsecPolicy *int32 `json:"ipsec_policy,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableIPSecProfileRequest PatchedWritableIPSecProfileRequest + +// NewPatchedWritableIPSecProfileRequest instantiates a new PatchedWritableIPSecProfileRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableIPSecProfileRequest() *PatchedWritableIPSecProfileRequest { + this := PatchedWritableIPSecProfileRequest{} + return &this +} + +// NewPatchedWritableIPSecProfileRequestWithDefaults instantiates a new PatchedWritableIPSecProfileRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableIPSecProfileRequestWithDefaults() *PatchedWritableIPSecProfileRequest { + this := PatchedWritableIPSecProfileRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableIPSecProfileRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableIPSecProfileRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetMode() IPSecProfileModeValue { + if o == nil || IsNil(o.Mode) { + var ret IPSecProfileModeValue + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetModeOk() (*IPSecProfileModeValue, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given IPSecProfileModeValue and assigns it to the Mode field. +func (o *PatchedWritableIPSecProfileRequest) SetMode(v IPSecProfileModeValue) { + o.Mode = &v +} + +// GetIkePolicy returns the IkePolicy field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetIkePolicy() int32 { + if o == nil || IsNil(o.IkePolicy) { + var ret int32 + return ret + } + return *o.IkePolicy +} + +// GetIkePolicyOk returns a tuple with the IkePolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetIkePolicyOk() (*int32, bool) { + if o == nil || IsNil(o.IkePolicy) { + return nil, false + } + return o.IkePolicy, true +} + +// HasIkePolicy returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasIkePolicy() bool { + if o != nil && !IsNil(o.IkePolicy) { + return true + } + + return false +} + +// SetIkePolicy gets a reference to the given int32 and assigns it to the IkePolicy field. +func (o *PatchedWritableIPSecProfileRequest) SetIkePolicy(v int32) { + o.IkePolicy = &v +} + +// GetIpsecPolicy returns the IpsecPolicy field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetIpsecPolicy() int32 { + if o == nil || IsNil(o.IpsecPolicy) { + var ret int32 + return ret + } + return *o.IpsecPolicy +} + +// GetIpsecPolicyOk returns a tuple with the IpsecPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetIpsecPolicyOk() (*int32, bool) { + if o == nil || IsNil(o.IpsecPolicy) { + return nil, false + } + return o.IpsecPolicy, true +} + +// HasIpsecPolicy returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasIpsecPolicy() bool { + if o != nil && !IsNil(o.IpsecPolicy) { + return true + } + + return false +} + +// SetIpsecPolicy gets a reference to the given int32 and assigns it to the IpsecPolicy field. +func (o *PatchedWritableIPSecProfileRequest) SetIpsecPolicy(v int32) { + o.IpsecPolicy = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableIPSecProfileRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableIPSecProfileRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProfileRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProfileRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProfileRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableIPSecProfileRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableIPSecProfileRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableIPSecProfileRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.IkePolicy) { + toSerialize["ike_policy"] = o.IkePolicy + } + if !IsNil(o.IpsecPolicy) { + toSerialize["ipsec_policy"] = o.IpsecPolicy + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableIPSecProfileRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableIPSecProfileRequest := _PatchedWritableIPSecProfileRequest{} + + err = json.Unmarshal(data, &varPatchedWritableIPSecProfileRequest) + + if err != nil { + return err + } + + *o = PatchedWritableIPSecProfileRequest(varPatchedWritableIPSecProfileRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "ike_policy") + delete(additionalProperties, "ipsec_policy") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableIPSecProfileRequest struct { + value *PatchedWritableIPSecProfileRequest + isSet bool +} + +func (v NullablePatchedWritableIPSecProfileRequest) Get() *PatchedWritableIPSecProfileRequest { + return v.value +} + +func (v *NullablePatchedWritableIPSecProfileRequest) Set(val *PatchedWritableIPSecProfileRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPSecProfileRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPSecProfileRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPSecProfileRequest(val *PatchedWritableIPSecProfileRequest) *NullablePatchedWritableIPSecProfileRequest { + return &NullablePatchedWritableIPSecProfileRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPSecProfileRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPSecProfileRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_proposal_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_proposal_request.go new file mode 100644 index 00000000..b01b6696 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_ip_sec_proposal_request.go @@ -0,0 +1,473 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableIPSecProposalRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableIPSecProposalRequest{} + +// PatchedWritableIPSecProposalRequest Adds support for custom fields and tags. +type PatchedWritableIPSecProposalRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + EncryptionAlgorithm *Encryption `json:"encryption_algorithm,omitempty"` + AuthenticationAlgorithm *Authentication `json:"authentication_algorithm,omitempty"` + // Security association lifetime (seconds) + SaLifetimeSeconds NullableInt32 `json:"sa_lifetime_seconds,omitempty"` + // Security association lifetime (in kilobytes) + SaLifetimeData NullableInt32 `json:"sa_lifetime_data,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableIPSecProposalRequest PatchedWritableIPSecProposalRequest + +// NewPatchedWritableIPSecProposalRequest instantiates a new PatchedWritableIPSecProposalRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableIPSecProposalRequest() *PatchedWritableIPSecProposalRequest { + this := PatchedWritableIPSecProposalRequest{} + return &this +} + +// NewPatchedWritableIPSecProposalRequestWithDefaults instantiates a new PatchedWritableIPSecProposalRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableIPSecProposalRequestWithDefaults() *PatchedWritableIPSecProposalRequest { + this := PatchedWritableIPSecProposalRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProposalRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProposalRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableIPSecProposalRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProposalRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProposalRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableIPSecProposalRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProposalRequest) GetEncryptionAlgorithm() Encryption { + if o == nil || IsNil(o.EncryptionAlgorithm) { + var ret Encryption + return ret + } + return *o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProposalRequest) GetEncryptionAlgorithmOk() (*Encryption, bool) { + if o == nil || IsNil(o.EncryptionAlgorithm) { + return nil, false + } + return o.EncryptionAlgorithm, true +} + +// HasEncryptionAlgorithm returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasEncryptionAlgorithm() bool { + if o != nil && !IsNil(o.EncryptionAlgorithm) { + return true + } + + return false +} + +// SetEncryptionAlgorithm gets a reference to the given Encryption and assigns it to the EncryptionAlgorithm field. +func (o *PatchedWritableIPSecProposalRequest) SetEncryptionAlgorithm(v Encryption) { + o.EncryptionAlgorithm = &v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProposalRequest) GetAuthenticationAlgorithm() Authentication { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + var ret Authentication + return ret + } + return *o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProposalRequest) GetAuthenticationAlgorithmOk() (*Authentication, bool) { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + return nil, false + } + return o.AuthenticationAlgorithm, true +} + +// HasAuthenticationAlgorithm returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasAuthenticationAlgorithm() bool { + if o != nil && !IsNil(o.AuthenticationAlgorithm) { + return true + } + + return false +} + +// SetAuthenticationAlgorithm gets a reference to the given Authentication and assigns it to the AuthenticationAlgorithm field. +func (o *PatchedWritableIPSecProposalRequest) SetAuthenticationAlgorithm(v Authentication) { + o.AuthenticationAlgorithm = &v +} + +// GetSaLifetimeSeconds returns the SaLifetimeSeconds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPSecProposalRequest) GetSaLifetimeSeconds() int32 { + if o == nil || IsNil(o.SaLifetimeSeconds.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeSeconds.Get() +} + +// GetSaLifetimeSecondsOk returns a tuple with the SaLifetimeSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPSecProposalRequest) GetSaLifetimeSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeSeconds.Get(), o.SaLifetimeSeconds.IsSet() +} + +// HasSaLifetimeSeconds returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasSaLifetimeSeconds() bool { + if o != nil && o.SaLifetimeSeconds.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeSeconds gets a reference to the given NullableInt32 and assigns it to the SaLifetimeSeconds field. +func (o *PatchedWritableIPSecProposalRequest) SetSaLifetimeSeconds(v int32) { + o.SaLifetimeSeconds.Set(&v) +} + +// SetSaLifetimeSecondsNil sets the value for SaLifetimeSeconds to be an explicit nil +func (o *PatchedWritableIPSecProposalRequest) SetSaLifetimeSecondsNil() { + o.SaLifetimeSeconds.Set(nil) +} + +// UnsetSaLifetimeSeconds ensures that no value is present for SaLifetimeSeconds, not even an explicit nil +func (o *PatchedWritableIPSecProposalRequest) UnsetSaLifetimeSeconds() { + o.SaLifetimeSeconds.Unset() +} + +// GetSaLifetimeData returns the SaLifetimeData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableIPSecProposalRequest) GetSaLifetimeData() int32 { + if o == nil || IsNil(o.SaLifetimeData.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeData.Get() +} + +// GetSaLifetimeDataOk returns a tuple with the SaLifetimeData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableIPSecProposalRequest) GetSaLifetimeDataOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeData.Get(), o.SaLifetimeData.IsSet() +} + +// HasSaLifetimeData returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasSaLifetimeData() bool { + if o != nil && o.SaLifetimeData.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeData gets a reference to the given NullableInt32 and assigns it to the SaLifetimeData field. +func (o *PatchedWritableIPSecProposalRequest) SetSaLifetimeData(v int32) { + o.SaLifetimeData.Set(&v) +} + +// SetSaLifetimeDataNil sets the value for SaLifetimeData to be an explicit nil +func (o *PatchedWritableIPSecProposalRequest) SetSaLifetimeDataNil() { + o.SaLifetimeData.Set(nil) +} + +// UnsetSaLifetimeData ensures that no value is present for SaLifetimeData, not even an explicit nil +func (o *PatchedWritableIPSecProposalRequest) UnsetSaLifetimeData() { + o.SaLifetimeData.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProposalRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProposalRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableIPSecProposalRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProposalRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProposalRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableIPSecProposalRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableIPSecProposalRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableIPSecProposalRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableIPSecProposalRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableIPSecProposalRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableIPSecProposalRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableIPSecProposalRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.EncryptionAlgorithm) { + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + } + if !IsNil(o.AuthenticationAlgorithm) { + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + } + if o.SaLifetimeSeconds.IsSet() { + toSerialize["sa_lifetime_seconds"] = o.SaLifetimeSeconds.Get() + } + if o.SaLifetimeData.IsSet() { + toSerialize["sa_lifetime_data"] = o.SaLifetimeData.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableIPSecProposalRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableIPSecProposalRequest := _PatchedWritableIPSecProposalRequest{} + + err = json.Unmarshal(data, &varPatchedWritableIPSecProposalRequest) + + if err != nil { + return err + } + + *o = PatchedWritableIPSecProposalRequest(varPatchedWritableIPSecProposalRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "sa_lifetime_seconds") + delete(additionalProperties, "sa_lifetime_data") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableIPSecProposalRequest struct { + value *PatchedWritableIPSecProposalRequest + isSet bool +} + +func (v NullablePatchedWritableIPSecProposalRequest) Get() *PatchedWritableIPSecProposalRequest { + return v.value +} + +func (v *NullablePatchedWritableIPSecProposalRequest) Set(val *PatchedWritableIPSecProposalRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableIPSecProposalRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableIPSecProposalRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableIPSecProposalRequest(val *PatchedWritableIPSecProposalRequest) *NullablePatchedWritableIPSecProposalRequest { + return &NullablePatchedWritableIPSecProposalRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableIPSecProposalRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableIPSecProposalRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_journal_entry_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_journal_entry_request.go new file mode 100644 index 00000000..ac4276f6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_journal_entry_request.go @@ -0,0 +1,386 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableJournalEntryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableJournalEntryRequest{} + +// PatchedWritableJournalEntryRequest Adds support for custom fields and tags. +type PatchedWritableJournalEntryRequest struct { + AssignedObjectType *string `json:"assigned_object_type,omitempty"` + AssignedObjectId *int64 `json:"assigned_object_id,omitempty"` + CreatedBy NullableInt32 `json:"created_by,omitempty"` + Kind *JournalEntryKindValue `json:"kind,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableJournalEntryRequest PatchedWritableJournalEntryRequest + +// NewPatchedWritableJournalEntryRequest instantiates a new PatchedWritableJournalEntryRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableJournalEntryRequest() *PatchedWritableJournalEntryRequest { + this := PatchedWritableJournalEntryRequest{} + return &this +} + +// NewPatchedWritableJournalEntryRequestWithDefaults instantiates a new PatchedWritableJournalEntryRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableJournalEntryRequestWithDefaults() *PatchedWritableJournalEntryRequest { + this := PatchedWritableJournalEntryRequest{} + return &this +} + +// GetAssignedObjectType returns the AssignedObjectType field value if set, zero value otherwise. +func (o *PatchedWritableJournalEntryRequest) GetAssignedObjectType() string { + if o == nil || IsNil(o.AssignedObjectType) { + var ret string + return ret + } + return *o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableJournalEntryRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil || IsNil(o.AssignedObjectType) { + return nil, false + } + return o.AssignedObjectType, true +} + +// HasAssignedObjectType returns a boolean if a field has been set. +func (o *PatchedWritableJournalEntryRequest) HasAssignedObjectType() bool { + if o != nil && !IsNil(o.AssignedObjectType) { + return true + } + + return false +} + +// SetAssignedObjectType gets a reference to the given string and assigns it to the AssignedObjectType field. +func (o *PatchedWritableJournalEntryRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType = &v +} + +// GetAssignedObjectId returns the AssignedObjectId field value if set, zero value otherwise. +func (o *PatchedWritableJournalEntryRequest) GetAssignedObjectId() int64 { + if o == nil || IsNil(o.AssignedObjectId) { + var ret int64 + return ret + } + return *o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableJournalEntryRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil || IsNil(o.AssignedObjectId) { + return nil, false + } + return o.AssignedObjectId, true +} + +// HasAssignedObjectId returns a boolean if a field has been set. +func (o *PatchedWritableJournalEntryRequest) HasAssignedObjectId() bool { + if o != nil && !IsNil(o.AssignedObjectId) { + return true + } + + return false +} + +// SetAssignedObjectId gets a reference to the given int64 and assigns it to the AssignedObjectId field. +func (o *PatchedWritableJournalEntryRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId = &v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableJournalEntryRequest) GetCreatedBy() int32 { + if o == nil || IsNil(o.CreatedBy.Get()) { + var ret int32 + return ret + } + return *o.CreatedBy.Get() +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableJournalEntryRequest) GetCreatedByOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CreatedBy.Get(), o.CreatedBy.IsSet() +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *PatchedWritableJournalEntryRequest) HasCreatedBy() bool { + if o != nil && o.CreatedBy.IsSet() { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given NullableInt32 and assigns it to the CreatedBy field. +func (o *PatchedWritableJournalEntryRequest) SetCreatedBy(v int32) { + o.CreatedBy.Set(&v) +} + +// SetCreatedByNil sets the value for CreatedBy to be an explicit nil +func (o *PatchedWritableJournalEntryRequest) SetCreatedByNil() { + o.CreatedBy.Set(nil) +} + +// UnsetCreatedBy ensures that no value is present for CreatedBy, not even an explicit nil +func (o *PatchedWritableJournalEntryRequest) UnsetCreatedBy() { + o.CreatedBy.Unset() +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *PatchedWritableJournalEntryRequest) GetKind() JournalEntryKindValue { + if o == nil || IsNil(o.Kind) { + var ret JournalEntryKindValue + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableJournalEntryRequest) GetKindOk() (*JournalEntryKindValue, bool) { + if o == nil || IsNil(o.Kind) { + return nil, false + } + return o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *PatchedWritableJournalEntryRequest) HasKind() bool { + if o != nil && !IsNil(o.Kind) { + return true + } + + return false +} + +// SetKind gets a reference to the given JournalEntryKindValue and assigns it to the Kind field. +func (o *PatchedWritableJournalEntryRequest) SetKind(v JournalEntryKindValue) { + o.Kind = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableJournalEntryRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableJournalEntryRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableJournalEntryRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableJournalEntryRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableJournalEntryRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableJournalEntryRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableJournalEntryRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableJournalEntryRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableJournalEntryRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableJournalEntryRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableJournalEntryRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableJournalEntryRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableJournalEntryRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableJournalEntryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AssignedObjectType) { + toSerialize["assigned_object_type"] = o.AssignedObjectType + } + if !IsNil(o.AssignedObjectId) { + toSerialize["assigned_object_id"] = o.AssignedObjectId + } + if o.CreatedBy.IsSet() { + toSerialize["created_by"] = o.CreatedBy.Get() + } + if !IsNil(o.Kind) { + toSerialize["kind"] = o.Kind + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableJournalEntryRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableJournalEntryRequest := _PatchedWritableJournalEntryRequest{} + + err = json.Unmarshal(data, &varPatchedWritableJournalEntryRequest) + + if err != nil { + return err + } + + *o = PatchedWritableJournalEntryRequest(varPatchedWritableJournalEntryRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "created_by") + delete(additionalProperties, "kind") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableJournalEntryRequest struct { + value *PatchedWritableJournalEntryRequest + isSet bool +} + +func (v NullablePatchedWritableJournalEntryRequest) Get() *PatchedWritableJournalEntryRequest { + return v.value +} + +func (v *NullablePatchedWritableJournalEntryRequest) Set(val *PatchedWritableJournalEntryRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableJournalEntryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableJournalEntryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableJournalEntryRequest(val *PatchedWritableJournalEntryRequest) *NullablePatchedWritableJournalEntryRequest { + return &NullablePatchedWritableJournalEntryRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableJournalEntryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableJournalEntryRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_l2_vpn_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_l2_vpn_request.go new file mode 100644 index 00000000..4917306c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_l2_vpn_request.go @@ -0,0 +1,545 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableL2VPNRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableL2VPNRequest{} + +// PatchedWritableL2VPNRequest Adds support for custom fields and tags. +type PatchedWritableL2VPNRequest struct { + Identifier NullableInt64 `json:"identifier,omitempty"` + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Type *L2VPNTypeValue `json:"type,omitempty"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableL2VPNRequest PatchedWritableL2VPNRequest + +// NewPatchedWritableL2VPNRequest instantiates a new PatchedWritableL2VPNRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableL2VPNRequest() *PatchedWritableL2VPNRequest { + this := PatchedWritableL2VPNRequest{} + return &this +} + +// NewPatchedWritableL2VPNRequestWithDefaults instantiates a new PatchedWritableL2VPNRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableL2VPNRequestWithDefaults() *PatchedWritableL2VPNRequest { + this := PatchedWritableL2VPNRequest{} + return &this +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableL2VPNRequest) GetIdentifier() int64 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int64 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableL2VPNRequest) GetIdentifierOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt64 and assigns it to the Identifier field. +func (o *PatchedWritableL2VPNRequest) SetIdentifier(v int64) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *PatchedWritableL2VPNRequest) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *PatchedWritableL2VPNRequest) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableL2VPNRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableL2VPNRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetType() L2VPNTypeValue { + if o == nil || IsNil(o.Type) { + var ret L2VPNTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetTypeOk() (*L2VPNTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given L2VPNTypeValue and assigns it to the Type field. +func (o *PatchedWritableL2VPNRequest) SetType(v L2VPNTypeValue) { + o.Type = &v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *PatchedWritableL2VPNRequest) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *PatchedWritableL2VPNRequest) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableL2VPNRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableL2VPNRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableL2VPNRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableL2VPNRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableL2VPNRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableL2VPNRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableL2VPNRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableL2VPNRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableL2VPNRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableL2VPNRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableL2VPNRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableL2VPNRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableL2VPNRequest := _PatchedWritableL2VPNRequest{} + + err = json.Unmarshal(data, &varPatchedWritableL2VPNRequest) + + if err != nil { + return err + } + + *o = PatchedWritableL2VPNRequest(varPatchedWritableL2VPNRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "identifier") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "type") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableL2VPNRequest struct { + value *PatchedWritableL2VPNRequest + isSet bool +} + +func (v NullablePatchedWritableL2VPNRequest) Get() *PatchedWritableL2VPNRequest { + return v.value +} + +func (v *NullablePatchedWritableL2VPNRequest) Set(val *PatchedWritableL2VPNRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableL2VPNRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableL2VPNRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableL2VPNRequest(val *PatchedWritableL2VPNRequest) *NullablePatchedWritableL2VPNRequest { + return &NullablePatchedWritableL2VPNRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableL2VPNRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableL2VPNRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_l2_vpn_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_l2_vpn_termination_request.go new file mode 100644 index 00000000..e165d5b7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_l2_vpn_termination_request.go @@ -0,0 +1,301 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableL2VPNTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableL2VPNTerminationRequest{} + +// PatchedWritableL2VPNTerminationRequest Adds support for custom fields and tags. +type PatchedWritableL2VPNTerminationRequest struct { + L2vpn *int32 `json:"l2vpn,omitempty"` + AssignedObjectType *string `json:"assigned_object_type,omitempty"` + AssignedObjectId *int64 `json:"assigned_object_id,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableL2VPNTerminationRequest PatchedWritableL2VPNTerminationRequest + +// NewPatchedWritableL2VPNTerminationRequest instantiates a new PatchedWritableL2VPNTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableL2VPNTerminationRequest() *PatchedWritableL2VPNTerminationRequest { + this := PatchedWritableL2VPNTerminationRequest{} + return &this +} + +// NewPatchedWritableL2VPNTerminationRequestWithDefaults instantiates a new PatchedWritableL2VPNTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableL2VPNTerminationRequestWithDefaults() *PatchedWritableL2VPNTerminationRequest { + this := PatchedWritableL2VPNTerminationRequest{} + return &this +} + +// GetL2vpn returns the L2vpn field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNTerminationRequest) GetL2vpn() int32 { + if o == nil || IsNil(o.L2vpn) { + var ret int32 + return ret + } + return *o.L2vpn +} + +// GetL2vpnOk returns a tuple with the L2vpn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNTerminationRequest) GetL2vpnOk() (*int32, bool) { + if o == nil || IsNil(o.L2vpn) { + return nil, false + } + return o.L2vpn, true +} + +// HasL2vpn returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNTerminationRequest) HasL2vpn() bool { + if o != nil && !IsNil(o.L2vpn) { + return true + } + + return false +} + +// SetL2vpn gets a reference to the given int32 and assigns it to the L2vpn field. +func (o *PatchedWritableL2VPNTerminationRequest) SetL2vpn(v int32) { + o.L2vpn = &v +} + +// GetAssignedObjectType returns the AssignedObjectType field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNTerminationRequest) GetAssignedObjectType() string { + if o == nil || IsNil(o.AssignedObjectType) { + var ret string + return ret + } + return *o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNTerminationRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil || IsNil(o.AssignedObjectType) { + return nil, false + } + return o.AssignedObjectType, true +} + +// HasAssignedObjectType returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNTerminationRequest) HasAssignedObjectType() bool { + if o != nil && !IsNil(o.AssignedObjectType) { + return true + } + + return false +} + +// SetAssignedObjectType gets a reference to the given string and assigns it to the AssignedObjectType field. +func (o *PatchedWritableL2VPNTerminationRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType = &v +} + +// GetAssignedObjectId returns the AssignedObjectId field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNTerminationRequest) GetAssignedObjectId() int64 { + if o == nil || IsNil(o.AssignedObjectId) { + var ret int64 + return ret + } + return *o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNTerminationRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil || IsNil(o.AssignedObjectId) { + return nil, false + } + return o.AssignedObjectId, true +} + +// HasAssignedObjectId returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNTerminationRequest) HasAssignedObjectId() bool { + if o != nil && !IsNil(o.AssignedObjectId) { + return true + } + + return false +} + +// SetAssignedObjectId gets a reference to the given int64 and assigns it to the AssignedObjectId field. +func (o *PatchedWritableL2VPNTerminationRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableL2VPNTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableL2VPNTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableL2VPNTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableL2VPNTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableL2VPNTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableL2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableL2VPNTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.L2vpn) { + toSerialize["l2vpn"] = o.L2vpn + } + if !IsNil(o.AssignedObjectType) { + toSerialize["assigned_object_type"] = o.AssignedObjectType + } + if !IsNil(o.AssignedObjectId) { + toSerialize["assigned_object_id"] = o.AssignedObjectId + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableL2VPNTerminationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableL2VPNTerminationRequest := _PatchedWritableL2VPNTerminationRequest{} + + err = json.Unmarshal(data, &varPatchedWritableL2VPNTerminationRequest) + + if err != nil { + return err + } + + *o = PatchedWritableL2VPNTerminationRequest(varPatchedWritableL2VPNTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "l2vpn") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableL2VPNTerminationRequest struct { + value *PatchedWritableL2VPNTerminationRequest + isSet bool +} + +func (v NullablePatchedWritableL2VPNTerminationRequest) Get() *PatchedWritableL2VPNTerminationRequest { + return v.value +} + +func (v *NullablePatchedWritableL2VPNTerminationRequest) Set(val *PatchedWritableL2VPNTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableL2VPNTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableL2VPNTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableL2VPNTerminationRequest(val *PatchedWritableL2VPNTerminationRequest) *NullablePatchedWritableL2VPNTerminationRequest { + return &NullablePatchedWritableL2VPNTerminationRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableL2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableL2VPNTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_location_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_location_request.go new file mode 100644 index 00000000..639409bf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_location_request.go @@ -0,0 +1,471 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableLocationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableLocationRequest{} + +// PatchedWritableLocationRequest Extends PrimaryModelSerializer to include MPTT support. +type PatchedWritableLocationRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Site *int32 `json:"site,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Status *LocationStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableLocationRequest PatchedWritableLocationRequest + +// NewPatchedWritableLocationRequest instantiates a new PatchedWritableLocationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableLocationRequest() *PatchedWritableLocationRequest { + this := PatchedWritableLocationRequest{} + return &this +} + +// NewPatchedWritableLocationRequestWithDefaults instantiates a new PatchedWritableLocationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableLocationRequestWithDefaults() *PatchedWritableLocationRequest { + this := PatchedWritableLocationRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableLocationRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableLocationRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableLocationRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableLocationRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableLocationRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableLocationRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetSite returns the Site field value if set, zero value otherwise. +func (o *PatchedWritableLocationRequest) GetSite() int32 { + if o == nil || IsNil(o.Site) { + var ret int32 + return ret + } + return *o.Site +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableLocationRequest) GetSiteOk() (*int32, bool) { + if o == nil || IsNil(o.Site) { + return nil, false + } + return o.Site, true +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasSite() bool { + if o != nil && !IsNil(o.Site) { + return true + } + + return false +} + +// SetSite gets a reference to the given int32 and assigns it to the Site field. +func (o *PatchedWritableLocationRequest) SetSite(v int32) { + o.Site = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableLocationRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableLocationRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableLocationRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableLocationRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableLocationRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableLocationRequest) GetStatus() LocationStatusValue { + if o == nil || IsNil(o.Status) { + var ret LocationStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableLocationRequest) GetStatusOk() (*LocationStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatusValue and assigns it to the Status field. +func (o *PatchedWritableLocationRequest) SetStatus(v LocationStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableLocationRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableLocationRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableLocationRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableLocationRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableLocationRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableLocationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableLocationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableLocationRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableLocationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableLocationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableLocationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableLocationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableLocationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableLocationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableLocationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableLocationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableLocationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Site) { + toSerialize["site"] = o.Site + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableLocationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableLocationRequest := _PatchedWritableLocationRequest{} + + err = json.Unmarshal(data, &varPatchedWritableLocationRequest) + + if err != nil { + return err + } + + *o = PatchedWritableLocationRequest(varPatchedWritableLocationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "site") + delete(additionalProperties, "parent") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableLocationRequest struct { + value *PatchedWritableLocationRequest + isSet bool +} + +func (v NullablePatchedWritableLocationRequest) Get() *PatchedWritableLocationRequest { + return v.value +} + +func (v *NullablePatchedWritableLocationRequest) Set(val *PatchedWritableLocationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableLocationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableLocationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableLocationRequest(val *PatchedWritableLocationRequest) *NullablePatchedWritableLocationRequest { + return &NullablePatchedWritableLocationRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableLocationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableLocationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_bay_request.go new file mode 100644 index 00000000..54f0aec5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_bay_request.go @@ -0,0 +1,414 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableModuleBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableModuleBayRequest{} + +// PatchedWritableModuleBayRequest Adds support for custom fields and tags. +type PatchedWritableModuleBayRequest struct { + Device *int32 `json:"device,omitempty"` + Name *string `json:"name,omitempty"` + InstalledModule *int32 `json:"installed_module,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableModuleBayRequest PatchedWritableModuleBayRequest + +// NewPatchedWritableModuleBayRequest instantiates a new PatchedWritableModuleBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableModuleBayRequest() *PatchedWritableModuleBayRequest { + this := PatchedWritableModuleBayRequest{} + return &this +} + +// NewPatchedWritableModuleBayRequestWithDefaults instantiates a new PatchedWritableModuleBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableModuleBayRequestWithDefaults() *PatchedWritableModuleBayRequest { + this := PatchedWritableModuleBayRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableModuleBayRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableModuleBayRequest) SetName(v string) { + o.Name = &v +} + +// GetInstalledModule returns the InstalledModule field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetInstalledModule() int32 { + if o == nil || IsNil(o.InstalledModule) { + var ret int32 + return ret + } + return *o.InstalledModule +} + +// GetInstalledModuleOk returns a tuple with the InstalledModule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetInstalledModuleOk() (*int32, bool) { + if o == nil || IsNil(o.InstalledModule) { + return nil, false + } + return o.InstalledModule, true +} + +// HasInstalledModule returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasInstalledModule() bool { + if o != nil && !IsNil(o.InstalledModule) { + return true + } + + return false +} + +// SetInstalledModule gets a reference to the given int32 and assigns it to the InstalledModule field. +func (o *PatchedWritableModuleBayRequest) SetInstalledModule(v int32) { + o.InstalledModule = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableModuleBayRequest) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *PatchedWritableModuleBayRequest) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableModuleBayRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableModuleBayRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableModuleBayRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableModuleBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableModuleBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.InstalledModule) { + toSerialize["installed_module"] = o.InstalledModule + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableModuleBayRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableModuleBayRequest := _PatchedWritableModuleBayRequest{} + + err = json.Unmarshal(data, &varPatchedWritableModuleBayRequest) + + if err != nil { + return err + } + + *o = PatchedWritableModuleBayRequest(varPatchedWritableModuleBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "installed_module") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableModuleBayRequest struct { + value *PatchedWritableModuleBayRequest + isSet bool +} + +func (v NullablePatchedWritableModuleBayRequest) Get() *PatchedWritableModuleBayRequest { + return v.value +} + +func (v *NullablePatchedWritableModuleBayRequest) Set(val *PatchedWritableModuleBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableModuleBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableModuleBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableModuleBayRequest(val *PatchedWritableModuleBayRequest) *NullablePatchedWritableModuleBayRequest { + return &NullablePatchedWritableModuleBayRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableModuleBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableModuleBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_bay_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_bay_template_request.go new file mode 100644 index 00000000..8c7d4600 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_bay_template_request.go @@ -0,0 +1,304 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableModuleBayTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableModuleBayTemplateRequest{} + +// PatchedWritableModuleBayTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableModuleBayTemplateRequest struct { + DeviceType *int32 `json:"device_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableModuleBayTemplateRequest PatchedWritableModuleBayTemplateRequest + +// NewPatchedWritableModuleBayTemplateRequest instantiates a new PatchedWritableModuleBayTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableModuleBayTemplateRequest() *PatchedWritableModuleBayTemplateRequest { + this := PatchedWritableModuleBayTemplateRequest{} + return &this +} + +// NewPatchedWritableModuleBayTemplateRequestWithDefaults instantiates a new PatchedWritableModuleBayTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableModuleBayTemplateRequestWithDefaults() *PatchedWritableModuleBayTemplateRequest { + this := PatchedWritableModuleBayTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType) { + var ret int32 + return ret + } + return *o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil || IsNil(o.DeviceType) { + return nil, false + } + return o.DeviceType, true +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayTemplateRequest) HasDeviceType() bool { + if o != nil && !IsNil(o.DeviceType) { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given int32 and assigns it to the DeviceType field. +func (o *PatchedWritableModuleBayTemplateRequest) SetDeviceType(v int32) { + o.DeviceType = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableModuleBayTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableModuleBayTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayTemplateRequest) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayTemplateRequest) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayTemplateRequest) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *PatchedWritableModuleBayTemplateRequest) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableModuleBayTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleBayTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableModuleBayTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableModuleBayTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritableModuleBayTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableModuleBayTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceType) { + toSerialize["device_type"] = o.DeviceType + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableModuleBayTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableModuleBayTemplateRequest := _PatchedWritableModuleBayTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableModuleBayTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableModuleBayTemplateRequest(varPatchedWritableModuleBayTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableModuleBayTemplateRequest struct { + value *PatchedWritableModuleBayTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableModuleBayTemplateRequest) Get() *PatchedWritableModuleBayTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableModuleBayTemplateRequest) Set(val *PatchedWritableModuleBayTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableModuleBayTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableModuleBayTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableModuleBayTemplateRequest(val *PatchedWritableModuleBayTemplateRequest) *NullablePatchedWritableModuleBayTemplateRequest { + return &NullablePatchedWritableModuleBayTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableModuleBayTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableModuleBayTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_request.go new file mode 100644 index 00000000..30668c01 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_request.go @@ -0,0 +1,498 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableModuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableModuleRequest{} + +// PatchedWritableModuleRequest Adds support for custom fields and tags. +type PatchedWritableModuleRequest struct { + Device *int32 `json:"device,omitempty"` + ModuleBay *int32 `json:"module_bay,omitempty"` + ModuleType *int32 `json:"module_type,omitempty"` + Status *ModuleStatusValue `json:"status,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableModuleRequest PatchedWritableModuleRequest + +// NewPatchedWritableModuleRequest instantiates a new PatchedWritableModuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableModuleRequest() *PatchedWritableModuleRequest { + this := PatchedWritableModuleRequest{} + return &this +} + +// NewPatchedWritableModuleRequestWithDefaults instantiates a new PatchedWritableModuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableModuleRequestWithDefaults() *PatchedWritableModuleRequest { + this := PatchedWritableModuleRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableModuleRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetModuleBay returns the ModuleBay field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetModuleBay() int32 { + if o == nil || IsNil(o.ModuleBay) { + var ret int32 + return ret + } + return *o.ModuleBay +} + +// GetModuleBayOk returns a tuple with the ModuleBay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetModuleBayOk() (*int32, bool) { + if o == nil || IsNil(o.ModuleBay) { + return nil, false + } + return o.ModuleBay, true +} + +// HasModuleBay returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasModuleBay() bool { + if o != nil && !IsNil(o.ModuleBay) { + return true + } + + return false +} + +// SetModuleBay gets a reference to the given int32 and assigns it to the ModuleBay field. +func (o *PatchedWritableModuleRequest) SetModuleBay(v int32) { + o.ModuleBay = &v +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType) { + var ret int32 + return ret + } + return *o.ModuleType +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil || IsNil(o.ModuleType) { + return nil, false + } + return o.ModuleType, true +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasModuleType() bool { + if o != nil && !IsNil(o.ModuleType) { + return true + } + + return false +} + +// SetModuleType gets a reference to the given int32 and assigns it to the ModuleType field. +func (o *PatchedWritableModuleRequest) SetModuleType(v int32) { + o.ModuleType = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetStatus() ModuleStatusValue { + if o == nil || IsNil(o.Status) { + var ret ModuleStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetStatusOk() (*ModuleStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatusValue and assigns it to the Status field. +func (o *PatchedWritableModuleRequest) SetStatus(v ModuleStatusValue) { + o.Status = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *PatchedWritableModuleRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableModuleRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableModuleRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *PatchedWritableModuleRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *PatchedWritableModuleRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *PatchedWritableModuleRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableModuleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableModuleRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableModuleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableModuleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableModuleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableModuleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableModuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableModuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.ModuleBay) { + toSerialize["module_bay"] = o.ModuleBay + } + if !IsNil(o.ModuleType) { + toSerialize["module_type"] = o.ModuleType + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableModuleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableModuleRequest := _PatchedWritableModuleRequest{} + + err = json.Unmarshal(data, &varPatchedWritableModuleRequest) + + if err != nil { + return err + } + + *o = PatchedWritableModuleRequest(varPatchedWritableModuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module_bay") + delete(additionalProperties, "module_type") + delete(additionalProperties, "status") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableModuleRequest struct { + value *PatchedWritableModuleRequest + isSet bool +} + +func (v NullablePatchedWritableModuleRequest) Get() *PatchedWritableModuleRequest { + return v.value +} + +func (v *NullablePatchedWritableModuleRequest) Set(val *PatchedWritableModuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableModuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableModuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableModuleRequest(val *PatchedWritableModuleRequest) *NullablePatchedWritableModuleRequest { + return &NullablePatchedWritableModuleRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableModuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableModuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_type_request.go new file mode 100644 index 00000000..f5e635e9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_module_type_request.go @@ -0,0 +1,461 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableModuleTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableModuleTypeRequest{} + +// PatchedWritableModuleTypeRequest Adds support for custom fields and tags. +type PatchedWritableModuleTypeRequest struct { + Manufacturer *int32 `json:"manufacturer,omitempty"` + Model *string `json:"model,omitempty"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit *DeviceTypeWeightUnitValue `json:"weight_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableModuleTypeRequest PatchedWritableModuleTypeRequest + +// NewPatchedWritableModuleTypeRequest instantiates a new PatchedWritableModuleTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableModuleTypeRequest() *PatchedWritableModuleTypeRequest { + this := PatchedWritableModuleTypeRequest{} + return &this +} + +// NewPatchedWritableModuleTypeRequestWithDefaults instantiates a new PatchedWritableModuleTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableModuleTypeRequestWithDefaults() *PatchedWritableModuleTypeRequest { + this := PatchedWritableModuleTypeRequest{} + return &this +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer) { + var ret int32 + return ret + } + return *o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetManufacturerOk() (*int32, bool) { + if o == nil || IsNil(o.Manufacturer) { + return nil, false + } + return o.Manufacturer, true +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasManufacturer() bool { + if o != nil && !IsNil(o.Manufacturer) { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given int32 and assigns it to the Manufacturer field. +func (o *PatchedWritableModuleTypeRequest) SetManufacturer(v int32) { + o.Manufacturer = &v +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetModel() string { + if o == nil || IsNil(o.Model) { + var ret string + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetModelOk() (*string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given string and assigns it to the Model field. +func (o *PatchedWritableModuleTypeRequest) SetModel(v string) { + o.Model = &v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *PatchedWritableModuleTypeRequest) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableModuleTypeRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableModuleTypeRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *PatchedWritableModuleTypeRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *PatchedWritableModuleTypeRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *PatchedWritableModuleTypeRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetWeightUnit() DeviceTypeWeightUnitValue { + if o == nil || IsNil(o.WeightUnit) { + var ret DeviceTypeWeightUnitValue + return ret + } + return *o.WeightUnit +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetWeightUnitOk() (*DeviceTypeWeightUnitValue, bool) { + if o == nil || IsNil(o.WeightUnit) { + return nil, false + } + return o.WeightUnit, true +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasWeightUnit() bool { + if o != nil && !IsNil(o.WeightUnit) { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given DeviceTypeWeightUnitValue and assigns it to the WeightUnit field. +func (o *PatchedWritableModuleTypeRequest) SetWeightUnit(v DeviceTypeWeightUnitValue) { + o.WeightUnit = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableModuleTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableModuleTypeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableModuleTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableModuleTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableModuleTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableModuleTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableModuleTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableModuleTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableModuleTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Manufacturer) { + toSerialize["manufacturer"] = o.Manufacturer + } + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if !IsNil(o.WeightUnit) { + toSerialize["weight_unit"] = o.WeightUnit + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableModuleTypeRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableModuleTypeRequest := _PatchedWritableModuleTypeRequest{} + + err = json.Unmarshal(data, &varPatchedWritableModuleTypeRequest) + + if err != nil { + return err + } + + *o = PatchedWritableModuleTypeRequest(varPatchedWritableModuleTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "model") + delete(additionalProperties, "part_number") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableModuleTypeRequest struct { + value *PatchedWritableModuleTypeRequest + isSet bool +} + +func (v NullablePatchedWritableModuleTypeRequest) Get() *PatchedWritableModuleTypeRequest { + return v.value +} + +func (v *NullablePatchedWritableModuleTypeRequest) Set(val *PatchedWritableModuleTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableModuleTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableModuleTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableModuleTypeRequest(val *PatchedWritableModuleTypeRequest) *NullablePatchedWritableModuleTypeRequest { + return &NullablePatchedWritableModuleTypeRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableModuleTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableModuleTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_object_permission_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_object_permission_request.go new file mode 100644 index 00000000..299406a2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_object_permission_request.go @@ -0,0 +1,415 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableObjectPermissionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableObjectPermissionRequest{} + +// PatchedWritableObjectPermissionRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableObjectPermissionRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ObjectTypes []string `json:"object_types,omitempty"` + Groups []int32 `json:"groups,omitempty"` + Users []int32 `json:"users,omitempty"` + // The list of actions granted by this permission + Actions []string `json:"actions,omitempty"` + // Queryset filter matching the applicable objects of the selected type(s) + Constraints interface{} `json:"constraints,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableObjectPermissionRequest PatchedWritableObjectPermissionRequest + +// NewPatchedWritableObjectPermissionRequest instantiates a new PatchedWritableObjectPermissionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableObjectPermissionRequest() *PatchedWritableObjectPermissionRequest { + this := PatchedWritableObjectPermissionRequest{} + return &this +} + +// NewPatchedWritableObjectPermissionRequestWithDefaults instantiates a new PatchedWritableObjectPermissionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableObjectPermissionRequestWithDefaults() *PatchedWritableObjectPermissionRequest { + this := PatchedWritableObjectPermissionRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableObjectPermissionRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableObjectPermissionRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableObjectPermissionRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableObjectPermissionRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableObjectPermissionRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableObjectPermissionRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedWritableObjectPermissionRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableObjectPermissionRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedWritableObjectPermissionRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetObjectTypes returns the ObjectTypes field value if set, zero value otherwise. +func (o *PatchedWritableObjectPermissionRequest) GetObjectTypes() []string { + if o == nil || IsNil(o.ObjectTypes) { + var ret []string + return ret + } + return o.ObjectTypes +} + +// GetObjectTypesOk returns a tuple with the ObjectTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableObjectPermissionRequest) GetObjectTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ObjectTypes) { + return nil, false + } + return o.ObjectTypes, true +} + +// HasObjectTypes returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasObjectTypes() bool { + if o != nil && !IsNil(o.ObjectTypes) { + return true + } + + return false +} + +// SetObjectTypes gets a reference to the given []string and assigns it to the ObjectTypes field. +func (o *PatchedWritableObjectPermissionRequest) SetObjectTypes(v []string) { + o.ObjectTypes = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *PatchedWritableObjectPermissionRequest) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableObjectPermissionRequest) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *PatchedWritableObjectPermissionRequest) SetGroups(v []int32) { + o.Groups = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *PatchedWritableObjectPermissionRequest) GetUsers() []int32 { + if o == nil || IsNil(o.Users) { + var ret []int32 + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableObjectPermissionRequest) GetUsersOk() ([]int32, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []int32 and assigns it to the Users field. +func (o *PatchedWritableObjectPermissionRequest) SetUsers(v []int32) { + o.Users = v +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *PatchedWritableObjectPermissionRequest) GetActions() []string { + if o == nil || IsNil(o.Actions) { + var ret []string + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableObjectPermissionRequest) GetActionsOk() ([]string, bool) { + if o == nil || IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasActions() bool { + if o != nil && !IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []string and assigns it to the Actions field. +func (o *PatchedWritableObjectPermissionRequest) SetActions(v []string) { + o.Actions = v +} + +// GetConstraints returns the Constraints field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableObjectPermissionRequest) GetConstraints() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Constraints +} + +// GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableObjectPermissionRequest) GetConstraintsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Constraints) { + return nil, false + } + return &o.Constraints, true +} + +// HasConstraints returns a boolean if a field has been set. +func (o *PatchedWritableObjectPermissionRequest) HasConstraints() bool { + if o != nil && IsNil(o.Constraints) { + return true + } + + return false +} + +// SetConstraints gets a reference to the given interface{} and assigns it to the Constraints field. +func (o *PatchedWritableObjectPermissionRequest) SetConstraints(v interface{}) { + o.Constraints = v +} + +func (o PatchedWritableObjectPermissionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableObjectPermissionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.ObjectTypes) { + toSerialize["object_types"] = o.ObjectTypes + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + if !IsNil(o.Actions) { + toSerialize["actions"] = o.Actions + } + if o.Constraints != nil { + toSerialize["constraints"] = o.Constraints + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableObjectPermissionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableObjectPermissionRequest := _PatchedWritableObjectPermissionRequest{} + + err = json.Unmarshal(data, &varPatchedWritableObjectPermissionRequest) + + if err != nil { + return err + } + + *o = PatchedWritableObjectPermissionRequest(varPatchedWritableObjectPermissionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "enabled") + delete(additionalProperties, "object_types") + delete(additionalProperties, "groups") + delete(additionalProperties, "users") + delete(additionalProperties, "actions") + delete(additionalProperties, "constraints") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableObjectPermissionRequest struct { + value *PatchedWritableObjectPermissionRequest + isSet bool +} + +func (v NullablePatchedWritableObjectPermissionRequest) Get() *PatchedWritableObjectPermissionRequest { + return v.value +} + +func (v *NullablePatchedWritableObjectPermissionRequest) Set(val *PatchedWritableObjectPermissionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableObjectPermissionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableObjectPermissionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableObjectPermissionRequest(val *PatchedWritableObjectPermissionRequest) *NullablePatchedWritableObjectPermissionRequest { + return &NullablePatchedWritableObjectPermissionRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableObjectPermissionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableObjectPermissionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_platform_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_platform_request.go new file mode 100644 index 00000000..f3e5df76 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_platform_request.go @@ -0,0 +1,398 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePlatformRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePlatformRequest{} + +// PatchedWritablePlatformRequest Adds support for custom fields and tags. +type PatchedWritablePlatformRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + // Optionally limit this platform to devices of a certain manufacturer + Manufacturer NullableInt32 `json:"manufacturer,omitempty"` + ConfigTemplate NullableInt32 `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePlatformRequest PatchedWritablePlatformRequest + +// NewPatchedWritablePlatformRequest instantiates a new PatchedWritablePlatformRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePlatformRequest() *PatchedWritablePlatformRequest { + this := PatchedWritablePlatformRequest{} + return &this +} + +// NewPatchedWritablePlatformRequestWithDefaults instantiates a new PatchedWritablePlatformRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePlatformRequestWithDefaults() *PatchedWritablePlatformRequest { + this := PatchedWritablePlatformRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritablePlatformRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePlatformRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritablePlatformRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritablePlatformRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritablePlatformRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePlatformRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritablePlatformRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritablePlatformRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePlatformRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret int32 + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePlatformRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *PatchedWritablePlatformRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableInt32 and assigns it to the Manufacturer field. +func (o *PatchedWritablePlatformRequest) SetManufacturer(v int32) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *PatchedWritablePlatformRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *PatchedWritablePlatformRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePlatformRequest) GetConfigTemplate() int32 { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret int32 + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePlatformRequest) GetConfigTemplateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *PatchedWritablePlatformRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableInt32 and assigns it to the ConfigTemplate field. +func (o *PatchedWritablePlatformRequest) SetConfigTemplate(v int32) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *PatchedWritablePlatformRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *PatchedWritablePlatformRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePlatformRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePlatformRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePlatformRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePlatformRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritablePlatformRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePlatformRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritablePlatformRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritablePlatformRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritablePlatformRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePlatformRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritablePlatformRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritablePlatformRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritablePlatformRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePlatformRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePlatformRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePlatformRequest := _PatchedWritablePlatformRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePlatformRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePlatformRequest(varPatchedWritablePlatformRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePlatformRequest struct { + value *PatchedWritablePlatformRequest + isSet bool +} + +func (v NullablePatchedWritablePlatformRequest) Get() *PatchedWritablePlatformRequest { + return v.value +} + +func (v *NullablePatchedWritablePlatformRequest) Set(val *PatchedWritablePlatformRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePlatformRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePlatformRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePlatformRequest(val *PatchedWritablePlatformRequest) *NullablePatchedWritablePlatformRequest { + return &NullablePatchedWritablePlatformRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePlatformRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePlatformRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request.go new file mode 100644 index 00000000..b7fa6070 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request.go @@ -0,0 +1,732 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePowerFeedRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePowerFeedRequest{} + +// PatchedWritablePowerFeedRequest Adds support for custom fields and tags. +type PatchedWritablePowerFeedRequest struct { + PowerPanel *int32 `json:"power_panel,omitempty"` + Rack NullableInt32 `json:"rack,omitempty"` + Name *string `json:"name,omitempty"` + Status *PatchedWritablePowerFeedRequestStatus `json:"status,omitempty"` + Type *PatchedWritablePowerFeedRequestType `json:"type,omitempty"` + Supply *PatchedWritablePowerFeedRequestSupply `json:"supply,omitempty"` + Phase *PatchedWritablePowerFeedRequestPhase `json:"phase,omitempty"` + Voltage *int32 `json:"voltage,omitempty"` + Amperage *int32 `json:"amperage,omitempty"` + // Maximum permissible draw (percentage) + MaxUtilization *int32 `json:"max_utilization,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Description *string `json:"description,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePowerFeedRequest PatchedWritablePowerFeedRequest + +// NewPatchedWritablePowerFeedRequest instantiates a new PatchedWritablePowerFeedRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePowerFeedRequest() *PatchedWritablePowerFeedRequest { + this := PatchedWritablePowerFeedRequest{} + return &this +} + +// NewPatchedWritablePowerFeedRequestWithDefaults instantiates a new PatchedWritablePowerFeedRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePowerFeedRequestWithDefaults() *PatchedWritablePowerFeedRequest { + this := PatchedWritablePowerFeedRequest{} + return &this +} + +// GetPowerPanel returns the PowerPanel field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetPowerPanel() int32 { + if o == nil || IsNil(o.PowerPanel) { + var ret int32 + return ret + } + return *o.PowerPanel +} + +// GetPowerPanelOk returns a tuple with the PowerPanel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetPowerPanelOk() (*int32, bool) { + if o == nil || IsNil(o.PowerPanel) { + return nil, false + } + return o.PowerPanel, true +} + +// HasPowerPanel returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasPowerPanel() bool { + if o != nil && !IsNil(o.PowerPanel) { + return true + } + + return false +} + +// SetPowerPanel gets a reference to the given int32 and assigns it to the PowerPanel field. +func (o *PatchedWritablePowerFeedRequest) SetPowerPanel(v int32) { + o.PowerPanel = &v +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerFeedRequest) GetRack() int32 { + if o == nil || IsNil(o.Rack.Get()) { + var ret int32 + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerFeedRequest) GetRackOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableInt32 and assigns it to the Rack field. +func (o *PatchedWritablePowerFeedRequest) SetRack(v int32) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *PatchedWritablePowerFeedRequest) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *PatchedWritablePowerFeedRequest) UnsetRack() { + o.Rack.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritablePowerFeedRequest) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetStatus() PatchedWritablePowerFeedRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritablePowerFeedRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetStatusOk() (*PatchedWritablePowerFeedRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritablePowerFeedRequestStatus and assigns it to the Status field. +func (o *PatchedWritablePowerFeedRequest) SetStatus(v PatchedWritablePowerFeedRequestStatus) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetType() PatchedWritablePowerFeedRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerFeedRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetTypeOk() (*PatchedWritablePowerFeedRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerFeedRequestType and assigns it to the Type field. +func (o *PatchedWritablePowerFeedRequest) SetType(v PatchedWritablePowerFeedRequestType) { + o.Type = &v +} + +// GetSupply returns the Supply field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetSupply() PatchedWritablePowerFeedRequestSupply { + if o == nil || IsNil(o.Supply) { + var ret PatchedWritablePowerFeedRequestSupply + return ret + } + return *o.Supply +} + +// GetSupplyOk returns a tuple with the Supply field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetSupplyOk() (*PatchedWritablePowerFeedRequestSupply, bool) { + if o == nil || IsNil(o.Supply) { + return nil, false + } + return o.Supply, true +} + +// HasSupply returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasSupply() bool { + if o != nil && !IsNil(o.Supply) { + return true + } + + return false +} + +// SetSupply gets a reference to the given PatchedWritablePowerFeedRequestSupply and assigns it to the Supply field. +func (o *PatchedWritablePowerFeedRequest) SetSupply(v PatchedWritablePowerFeedRequestSupply) { + o.Supply = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetPhase() PatchedWritablePowerFeedRequestPhase { + if o == nil || IsNil(o.Phase) { + var ret PatchedWritablePowerFeedRequestPhase + return ret + } + return *o.Phase +} + +// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetPhaseOk() (*PatchedWritablePowerFeedRequestPhase, bool) { + if o == nil || IsNil(o.Phase) { + return nil, false + } + return o.Phase, true +} + +// HasPhase returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasPhase() bool { + if o != nil && !IsNil(o.Phase) { + return true + } + + return false +} + +// SetPhase gets a reference to the given PatchedWritablePowerFeedRequestPhase and assigns it to the Phase field. +func (o *PatchedWritablePowerFeedRequest) SetPhase(v PatchedWritablePowerFeedRequestPhase) { + o.Phase = &v +} + +// GetVoltage returns the Voltage field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetVoltage() int32 { + if o == nil || IsNil(o.Voltage) { + var ret int32 + return ret + } + return *o.Voltage +} + +// GetVoltageOk returns a tuple with the Voltage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetVoltageOk() (*int32, bool) { + if o == nil || IsNil(o.Voltage) { + return nil, false + } + return o.Voltage, true +} + +// HasVoltage returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasVoltage() bool { + if o != nil && !IsNil(o.Voltage) { + return true + } + + return false +} + +// SetVoltage gets a reference to the given int32 and assigns it to the Voltage field. +func (o *PatchedWritablePowerFeedRequest) SetVoltage(v int32) { + o.Voltage = &v +} + +// GetAmperage returns the Amperage field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetAmperage() int32 { + if o == nil || IsNil(o.Amperage) { + var ret int32 + return ret + } + return *o.Amperage +} + +// GetAmperageOk returns a tuple with the Amperage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetAmperageOk() (*int32, bool) { + if o == nil || IsNil(o.Amperage) { + return nil, false + } + return o.Amperage, true +} + +// HasAmperage returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasAmperage() bool { + if o != nil && !IsNil(o.Amperage) { + return true + } + + return false +} + +// SetAmperage gets a reference to the given int32 and assigns it to the Amperage field. +func (o *PatchedWritablePowerFeedRequest) SetAmperage(v int32) { + o.Amperage = &v +} + +// GetMaxUtilization returns the MaxUtilization field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetMaxUtilization() int32 { + if o == nil || IsNil(o.MaxUtilization) { + var ret int32 + return ret + } + return *o.MaxUtilization +} + +// GetMaxUtilizationOk returns a tuple with the MaxUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetMaxUtilizationOk() (*int32, bool) { + if o == nil || IsNil(o.MaxUtilization) { + return nil, false + } + return o.MaxUtilization, true +} + +// HasMaxUtilization returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasMaxUtilization() bool { + if o != nil && !IsNil(o.MaxUtilization) { + return true + } + + return false +} + +// SetMaxUtilization gets a reference to the given int32 and assigns it to the MaxUtilization field. +func (o *PatchedWritablePowerFeedRequest) SetMaxUtilization(v int32) { + o.MaxUtilization = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritablePowerFeedRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePowerFeedRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerFeedRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerFeedRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritablePowerFeedRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritablePowerFeedRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritablePowerFeedRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritablePowerFeedRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritablePowerFeedRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritablePowerFeedRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerFeedRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritablePowerFeedRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritablePowerFeedRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritablePowerFeedRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePowerFeedRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PowerPanel) { + toSerialize["power_panel"] = o.PowerPanel + } + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Supply) { + toSerialize["supply"] = o.Supply + } + if !IsNil(o.Phase) { + toSerialize["phase"] = o.Phase + } + if !IsNil(o.Voltage) { + toSerialize["voltage"] = o.Voltage + } + if !IsNil(o.Amperage) { + toSerialize["amperage"] = o.Amperage + } + if !IsNil(o.MaxUtilization) { + toSerialize["max_utilization"] = o.MaxUtilization + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePowerFeedRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePowerFeedRequest := _PatchedWritablePowerFeedRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePowerFeedRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePowerFeedRequest(varPatchedWritablePowerFeedRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "power_panel") + delete(additionalProperties, "rack") + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "type") + delete(additionalProperties, "supply") + delete(additionalProperties, "phase") + delete(additionalProperties, "voltage") + delete(additionalProperties, "amperage") + delete(additionalProperties, "max_utilization") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "description") + delete(additionalProperties, "tenant") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePowerFeedRequest struct { + value *PatchedWritablePowerFeedRequest + isSet bool +} + +func (v NullablePatchedWritablePowerFeedRequest) Get() *PatchedWritablePowerFeedRequest { + return v.value +} + +func (v *NullablePatchedWritablePowerFeedRequest) Set(val *PatchedWritablePowerFeedRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerFeedRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerFeedRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerFeedRequest(val *PatchedWritablePowerFeedRequest) *NullablePatchedWritablePowerFeedRequest { + return &NullablePatchedWritablePowerFeedRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerFeedRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerFeedRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_phase.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_phase.go new file mode 100644 index 00000000..02fcdaf5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_phase.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerFeedRequestPhase * `single-phase` - Single phase * `three-phase` - Three-phase +type PatchedWritablePowerFeedRequestPhase string + +// List of PatchedWritablePowerFeedRequest_phase +const ( + PATCHEDWRITABLEPOWERFEEDREQUESTPHASE_SINGLE_PHASE PatchedWritablePowerFeedRequestPhase = "single-phase" + PATCHEDWRITABLEPOWERFEEDREQUESTPHASE_THREE_PHASE PatchedWritablePowerFeedRequestPhase = "three-phase" +) + +// All allowed values of PatchedWritablePowerFeedRequestPhase enum +var AllowedPatchedWritablePowerFeedRequestPhaseEnumValues = []PatchedWritablePowerFeedRequestPhase{ + "single-phase", + "three-phase", +} + +func (v *PatchedWritablePowerFeedRequestPhase) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerFeedRequestPhase(value) + for _, existing := range AllowedPatchedWritablePowerFeedRequestPhaseEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerFeedRequestPhase", value) +} + +// NewPatchedWritablePowerFeedRequestPhaseFromValue returns a pointer to a valid PatchedWritablePowerFeedRequestPhase +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerFeedRequestPhaseFromValue(v string) (*PatchedWritablePowerFeedRequestPhase, error) { + ev := PatchedWritablePowerFeedRequestPhase(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerFeedRequestPhase: valid values are %v", v, AllowedPatchedWritablePowerFeedRequestPhaseEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerFeedRequestPhase) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerFeedRequestPhaseEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerFeedRequest_phase value +func (v PatchedWritablePowerFeedRequestPhase) Ptr() *PatchedWritablePowerFeedRequestPhase { + return &v +} + +type NullablePatchedWritablePowerFeedRequestPhase struct { + value *PatchedWritablePowerFeedRequestPhase + isSet bool +} + +func (v NullablePatchedWritablePowerFeedRequestPhase) Get() *PatchedWritablePowerFeedRequestPhase { + return v.value +} + +func (v *NullablePatchedWritablePowerFeedRequestPhase) Set(val *PatchedWritablePowerFeedRequestPhase) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerFeedRequestPhase) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerFeedRequestPhase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerFeedRequestPhase(val *PatchedWritablePowerFeedRequestPhase) *NullablePatchedWritablePowerFeedRequestPhase { + return &NullablePatchedWritablePowerFeedRequestPhase{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerFeedRequestPhase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerFeedRequestPhase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_status.go new file mode 100644 index 00000000..ed01912b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_status.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerFeedRequestStatus * `offline` - Offline * `active` - Active * `planned` - Planned * `failed` - Failed +type PatchedWritablePowerFeedRequestStatus string + +// List of PatchedWritablePowerFeedRequest_status +const ( + PATCHEDWRITABLEPOWERFEEDREQUESTSTATUS_OFFLINE PatchedWritablePowerFeedRequestStatus = "offline" + PATCHEDWRITABLEPOWERFEEDREQUESTSTATUS_ACTIVE PatchedWritablePowerFeedRequestStatus = "active" + PATCHEDWRITABLEPOWERFEEDREQUESTSTATUS_PLANNED PatchedWritablePowerFeedRequestStatus = "planned" + PATCHEDWRITABLEPOWERFEEDREQUESTSTATUS_FAILED PatchedWritablePowerFeedRequestStatus = "failed" +) + +// All allowed values of PatchedWritablePowerFeedRequestStatus enum +var AllowedPatchedWritablePowerFeedRequestStatusEnumValues = []PatchedWritablePowerFeedRequestStatus{ + "offline", + "active", + "planned", + "failed", +} + +func (v *PatchedWritablePowerFeedRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerFeedRequestStatus(value) + for _, existing := range AllowedPatchedWritablePowerFeedRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerFeedRequestStatus", value) +} + +// NewPatchedWritablePowerFeedRequestStatusFromValue returns a pointer to a valid PatchedWritablePowerFeedRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerFeedRequestStatusFromValue(v string) (*PatchedWritablePowerFeedRequestStatus, error) { + ev := PatchedWritablePowerFeedRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerFeedRequestStatus: valid values are %v", v, AllowedPatchedWritablePowerFeedRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerFeedRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerFeedRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerFeedRequest_status value +func (v PatchedWritablePowerFeedRequestStatus) Ptr() *PatchedWritablePowerFeedRequestStatus { + return &v +} + +type NullablePatchedWritablePowerFeedRequestStatus struct { + value *PatchedWritablePowerFeedRequestStatus + isSet bool +} + +func (v NullablePatchedWritablePowerFeedRequestStatus) Get() *PatchedWritablePowerFeedRequestStatus { + return v.value +} + +func (v *NullablePatchedWritablePowerFeedRequestStatus) Set(val *PatchedWritablePowerFeedRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerFeedRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerFeedRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerFeedRequestStatus(val *PatchedWritablePowerFeedRequestStatus) *NullablePatchedWritablePowerFeedRequestStatus { + return &NullablePatchedWritablePowerFeedRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerFeedRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerFeedRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_supply.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_supply.go new file mode 100644 index 00000000..facea877 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_supply.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerFeedRequestSupply * `ac` - AC * `dc` - DC +type PatchedWritablePowerFeedRequestSupply string + +// List of PatchedWritablePowerFeedRequest_supply +const ( + PATCHEDWRITABLEPOWERFEEDREQUESTSUPPLY_AC PatchedWritablePowerFeedRequestSupply = "ac" + PATCHEDWRITABLEPOWERFEEDREQUESTSUPPLY_DC PatchedWritablePowerFeedRequestSupply = "dc" +) + +// All allowed values of PatchedWritablePowerFeedRequestSupply enum +var AllowedPatchedWritablePowerFeedRequestSupplyEnumValues = []PatchedWritablePowerFeedRequestSupply{ + "ac", + "dc", +} + +func (v *PatchedWritablePowerFeedRequestSupply) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerFeedRequestSupply(value) + for _, existing := range AllowedPatchedWritablePowerFeedRequestSupplyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerFeedRequestSupply", value) +} + +// NewPatchedWritablePowerFeedRequestSupplyFromValue returns a pointer to a valid PatchedWritablePowerFeedRequestSupply +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerFeedRequestSupplyFromValue(v string) (*PatchedWritablePowerFeedRequestSupply, error) { + ev := PatchedWritablePowerFeedRequestSupply(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerFeedRequestSupply: valid values are %v", v, AllowedPatchedWritablePowerFeedRequestSupplyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerFeedRequestSupply) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerFeedRequestSupplyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerFeedRequest_supply value +func (v PatchedWritablePowerFeedRequestSupply) Ptr() *PatchedWritablePowerFeedRequestSupply { + return &v +} + +type NullablePatchedWritablePowerFeedRequestSupply struct { + value *PatchedWritablePowerFeedRequestSupply + isSet bool +} + +func (v NullablePatchedWritablePowerFeedRequestSupply) Get() *PatchedWritablePowerFeedRequestSupply { + return v.value +} + +func (v *NullablePatchedWritablePowerFeedRequestSupply) Set(val *PatchedWritablePowerFeedRequestSupply) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerFeedRequestSupply) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerFeedRequestSupply) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerFeedRequestSupply(val *PatchedWritablePowerFeedRequestSupply) *NullablePatchedWritablePowerFeedRequestSupply { + return &NullablePatchedWritablePowerFeedRequestSupply{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerFeedRequestSupply) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerFeedRequestSupply) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_type.go new file mode 100644 index 00000000..5eed61e0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_feed_request_type.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerFeedRequestType * `primary` - Primary * `redundant` - Redundant +type PatchedWritablePowerFeedRequestType string + +// List of PatchedWritablePowerFeedRequest_type +const ( + PATCHEDWRITABLEPOWERFEEDREQUESTTYPE_PRIMARY PatchedWritablePowerFeedRequestType = "primary" + PATCHEDWRITABLEPOWERFEEDREQUESTTYPE_REDUNDANT PatchedWritablePowerFeedRequestType = "redundant" +) + +// All allowed values of PatchedWritablePowerFeedRequestType enum +var AllowedPatchedWritablePowerFeedRequestTypeEnumValues = []PatchedWritablePowerFeedRequestType{ + "primary", + "redundant", +} + +func (v *PatchedWritablePowerFeedRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerFeedRequestType(value) + for _, existing := range AllowedPatchedWritablePowerFeedRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerFeedRequestType", value) +} + +// NewPatchedWritablePowerFeedRequestTypeFromValue returns a pointer to a valid PatchedWritablePowerFeedRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerFeedRequestTypeFromValue(v string) (*PatchedWritablePowerFeedRequestType, error) { + ev := PatchedWritablePowerFeedRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerFeedRequestType: valid values are %v", v, AllowedPatchedWritablePowerFeedRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerFeedRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerFeedRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerFeedRequest_type value +func (v PatchedWritablePowerFeedRequestType) Ptr() *PatchedWritablePowerFeedRequestType { + return &v +} + +type NullablePatchedWritablePowerFeedRequestType struct { + value *PatchedWritablePowerFeedRequestType + isSet bool +} + +func (v NullablePatchedWritablePowerFeedRequestType) Get() *PatchedWritablePowerFeedRequestType { + return v.value +} + +func (v *NullablePatchedWritablePowerFeedRequestType) Set(val *PatchedWritablePowerFeedRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerFeedRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerFeedRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerFeedRequestType(val *PatchedWritablePowerFeedRequestType) *NullablePatchedWritablePowerFeedRequestType { + return &NullablePatchedWritablePowerFeedRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerFeedRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerFeedRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request.go new file mode 100644 index 00000000..31b600a5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request.go @@ -0,0 +1,547 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePowerOutletRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePowerOutletRequest{} + +// PatchedWritablePowerOutletRequest Adds support for custom fields and tags. +type PatchedWritablePowerOutletRequest struct { + Device *int32 `json:"device,omitempty"` + Module NullableInt32 `json:"module,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerOutletRequestType `json:"type,omitempty"` + PowerPort NullableInt32 `json:"power_port,omitempty"` + FeedLeg *PatchedWritablePowerOutletRequestFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePowerOutletRequest PatchedWritablePowerOutletRequest + +// NewPatchedWritablePowerOutletRequest instantiates a new PatchedWritablePowerOutletRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePowerOutletRequest() *PatchedWritablePowerOutletRequest { + this := PatchedWritablePowerOutletRequest{} + return &this +} + +// NewPatchedWritablePowerOutletRequestWithDefaults instantiates a new PatchedWritablePowerOutletRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePowerOutletRequestWithDefaults() *PatchedWritablePowerOutletRequest { + this := PatchedWritablePowerOutletRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritablePowerOutletRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerOutletRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerOutletRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *PatchedWritablePowerOutletRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PatchedWritablePowerOutletRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PatchedWritablePowerOutletRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritablePowerOutletRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritablePowerOutletRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetType() PatchedWritablePowerOutletRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerOutletRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetTypeOk() (*PatchedWritablePowerOutletRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerOutletRequestType and assigns it to the Type field. +func (o *PatchedWritablePowerOutletRequest) SetType(v PatchedWritablePowerOutletRequestType) { + o.Type = &v +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerOutletRequest) GetPowerPort() int32 { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret int32 + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerOutletRequest) GetPowerPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableInt32 and assigns it to the PowerPort field. +func (o *PatchedWritablePowerOutletRequest) SetPowerPort(v int32) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *PatchedWritablePowerOutletRequest) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *PatchedWritablePowerOutletRequest) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetFeedLeg() PatchedWritablePowerOutletRequestFeedLeg { + if o == nil || IsNil(o.FeedLeg) { + var ret PatchedWritablePowerOutletRequestFeedLeg + return ret + } + return *o.FeedLeg +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetFeedLegOk() (*PatchedWritablePowerOutletRequestFeedLeg, bool) { + if o == nil || IsNil(o.FeedLeg) { + return nil, false + } + return o.FeedLeg, true +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasFeedLeg() bool { + if o != nil && !IsNil(o.FeedLeg) { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given PatchedWritablePowerOutletRequestFeedLeg and assigns it to the FeedLeg field. +func (o *PatchedWritablePowerOutletRequest) SetFeedLeg(v PatchedWritablePowerOutletRequestFeedLeg) { + o.FeedLeg = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePowerOutletRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritablePowerOutletRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritablePowerOutletRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritablePowerOutletRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritablePowerOutletRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePowerOutletRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if !IsNil(o.FeedLeg) { + toSerialize["feed_leg"] = o.FeedLeg + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePowerOutletRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePowerOutletRequest := _PatchedWritablePowerOutletRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePowerOutletRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePowerOutletRequest(varPatchedWritablePowerOutletRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePowerOutletRequest struct { + value *PatchedWritablePowerOutletRequest + isSet bool +} + +func (v NullablePatchedWritablePowerOutletRequest) Get() *PatchedWritablePowerOutletRequest { + return v.value +} + +func (v *NullablePatchedWritablePowerOutletRequest) Set(val *PatchedWritablePowerOutletRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerOutletRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerOutletRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerOutletRequest(val *PatchedWritablePowerOutletRequest) *NullablePatchedWritablePowerOutletRequest { + return &NullablePatchedWritablePowerOutletRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerOutletRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerOutletRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request_feed_leg.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request_feed_leg.go new file mode 100644 index 00000000..c60a1c0a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request_feed_leg.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerOutletRequestFeedLeg Phase (for three-phase feeds) * `A` - A * `B` - B * `C` - C +type PatchedWritablePowerOutletRequestFeedLeg string + +// List of PatchedWritablePowerOutletRequest_feed_leg +const ( + PATCHEDWRITABLEPOWEROUTLETREQUESTFEEDLEG_A PatchedWritablePowerOutletRequestFeedLeg = "A" + PATCHEDWRITABLEPOWEROUTLETREQUESTFEEDLEG_B PatchedWritablePowerOutletRequestFeedLeg = "B" + PATCHEDWRITABLEPOWEROUTLETREQUESTFEEDLEG_C PatchedWritablePowerOutletRequestFeedLeg = "C" + PATCHEDWRITABLEPOWEROUTLETREQUESTFEEDLEG_EMPTY PatchedWritablePowerOutletRequestFeedLeg = "" +) + +// All allowed values of PatchedWritablePowerOutletRequestFeedLeg enum +var AllowedPatchedWritablePowerOutletRequestFeedLegEnumValues = []PatchedWritablePowerOutletRequestFeedLeg{ + "A", + "B", + "C", + "", +} + +func (v *PatchedWritablePowerOutletRequestFeedLeg) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerOutletRequestFeedLeg(value) + for _, existing := range AllowedPatchedWritablePowerOutletRequestFeedLegEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerOutletRequestFeedLeg", value) +} + +// NewPatchedWritablePowerOutletRequestFeedLegFromValue returns a pointer to a valid PatchedWritablePowerOutletRequestFeedLeg +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerOutletRequestFeedLegFromValue(v string) (*PatchedWritablePowerOutletRequestFeedLeg, error) { + ev := PatchedWritablePowerOutletRequestFeedLeg(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerOutletRequestFeedLeg: valid values are %v", v, AllowedPatchedWritablePowerOutletRequestFeedLegEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerOutletRequestFeedLeg) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerOutletRequestFeedLegEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerOutletRequest_feed_leg value +func (v PatchedWritablePowerOutletRequestFeedLeg) Ptr() *PatchedWritablePowerOutletRequestFeedLeg { + return &v +} + +type NullablePatchedWritablePowerOutletRequestFeedLeg struct { + value *PatchedWritablePowerOutletRequestFeedLeg + isSet bool +} + +func (v NullablePatchedWritablePowerOutletRequestFeedLeg) Get() *PatchedWritablePowerOutletRequestFeedLeg { + return v.value +} + +func (v *NullablePatchedWritablePowerOutletRequestFeedLeg) Set(val *PatchedWritablePowerOutletRequestFeedLeg) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerOutletRequestFeedLeg) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerOutletRequestFeedLeg) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerOutletRequestFeedLeg(val *PatchedWritablePowerOutletRequestFeedLeg) *NullablePatchedWritablePowerOutletRequestFeedLeg { + return &NullablePatchedWritablePowerOutletRequestFeedLeg{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerOutletRequestFeedLeg) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerOutletRequestFeedLeg) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request_type.go new file mode 100644 index 00000000..955fc5f2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_request_type.go @@ -0,0 +1,294 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerOutletRequestType Physical port type * `iec-60320-c5` - C5 * `iec-60320-c7` - C7 * `iec-60320-c13` - C13 * `iec-60320-c15` - C15 * `iec-60320-c19` - C19 * `iec-60320-c21` - C21 * `iec-60309-p-n-e-4h` - P+N+E 4H * `iec-60309-p-n-e-6h` - P+N+E 6H * `iec-60309-p-n-e-9h` - P+N+E 9H * `iec-60309-2p-e-4h` - 2P+E 4H * `iec-60309-2p-e-6h` - 2P+E 6H * `iec-60309-2p-e-9h` - 2P+E 9H * `iec-60309-3p-e-4h` - 3P+E 4H * `iec-60309-3p-e-6h` - 3P+E 6H * `iec-60309-3p-e-9h` - 3P+E 9H * `iec-60309-3p-n-e-4h` - 3P+N+E 4H * `iec-60309-3p-n-e-6h` - 3P+N+E 6H * `iec-60309-3p-n-e-9h` - 3P+N+E 9H * `iec-60906-1` - IEC 60906-1 * `nbr-14136-10a` - 2P+T 10A (NBR 14136) * `nbr-14136-20a` - 2P+T 20A (NBR 14136) * `nema-1-15r` - NEMA 1-15R * `nema-5-15r` - NEMA 5-15R * `nema-5-20r` - NEMA 5-20R * `nema-5-30r` - NEMA 5-30R * `nema-5-50r` - NEMA 5-50R * `nema-6-15r` - NEMA 6-15R * `nema-6-20r` - NEMA 6-20R * `nema-6-30r` - NEMA 6-30R * `nema-6-50r` - NEMA 6-50R * `nema-10-30r` - NEMA 10-30R * `nema-10-50r` - NEMA 10-50R * `nema-14-20r` - NEMA 14-20R * `nema-14-30r` - NEMA 14-30R * `nema-14-50r` - NEMA 14-50R * `nema-14-60r` - NEMA 14-60R * `nema-15-15r` - NEMA 15-15R * `nema-15-20r` - NEMA 15-20R * `nema-15-30r` - NEMA 15-30R * `nema-15-50r` - NEMA 15-50R * `nema-15-60r` - NEMA 15-60R * `nema-l1-15r` - NEMA L1-15R * `nema-l5-15r` - NEMA L5-15R * `nema-l5-20r` - NEMA L5-20R * `nema-l5-30r` - NEMA L5-30R * `nema-l5-50r` - NEMA L5-50R * `nema-l6-15r` - NEMA L6-15R * `nema-l6-20r` - NEMA L6-20R * `nema-l6-30r` - NEMA L6-30R * `nema-l6-50r` - NEMA L6-50R * `nema-l10-30r` - NEMA L10-30R * `nema-l14-20r` - NEMA L14-20R * `nema-l14-30r` - NEMA L14-30R * `nema-l14-50r` - NEMA L14-50R * `nema-l14-60r` - NEMA L14-60R * `nema-l15-20r` - NEMA L15-20R * `nema-l15-30r` - NEMA L15-30R * `nema-l15-50r` - NEMA L15-50R * `nema-l15-60r` - NEMA L15-60R * `nema-l21-20r` - NEMA L21-20R * `nema-l21-30r` - NEMA L21-30R * `nema-l22-30r` - NEMA L22-30R * `CS6360C` - CS6360C * `CS6364C` - CS6364C * `CS8164C` - CS8164C * `CS8264C` - CS8264C * `CS8364C` - CS8364C * `CS8464C` - CS8464C * `ita-e` - ITA Type E (CEE 7/5) * `ita-f` - ITA Type F (CEE 7/3) * `ita-g` - ITA Type G (BS 1363) * `ita-h` - ITA Type H * `ita-i` - ITA Type I * `ita-j` - ITA Type J * `ita-k` - ITA Type K * `ita-l` - ITA Type L (CEI 23-50) * `ita-m` - ITA Type M (BS 546) * `ita-n` - ITA Type N * `ita-o` - ITA Type O * `ita-multistandard` - ITA Multistandard * `usb-a` - USB Type A * `usb-micro-b` - USB Micro B * `usb-c` - USB Type C * `dc-terminal` - DC Terminal * `hdot-cx` - HDOT Cx * `saf-d-grid` - Saf-D-Grid * `neutrik-powercon-20a` - Neutrik powerCON (20A) * `neutrik-powercon-32a` - Neutrik powerCON (32A) * `neutrik-powercon-true1` - Neutrik powerCON TRUE1 * `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP * `ubiquiti-smartpower` - Ubiquiti SmartPower * `hardwired` - Hardwired * `other` - Other +type PatchedWritablePowerOutletRequestType string + +// List of PatchedWritablePowerOutletRequest_type +const ( + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60320_C5 PatchedWritablePowerOutletRequestType = "iec-60320-c5" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60320_C7 PatchedWritablePowerOutletRequestType = "iec-60320-c7" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60320_C13 PatchedWritablePowerOutletRequestType = "iec-60320-c13" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60320_C15 PatchedWritablePowerOutletRequestType = "iec-60320-c15" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60320_C19 PatchedWritablePowerOutletRequestType = "iec-60320-c19" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60320_C21 PatchedWritablePowerOutletRequestType = "iec-60320-c21" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_P_N_E_4H PatchedWritablePowerOutletRequestType = "iec-60309-p-n-e-4h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_P_N_E_6H PatchedWritablePowerOutletRequestType = "iec-60309-p-n-e-6h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_P_N_E_9H PatchedWritablePowerOutletRequestType = "iec-60309-p-n-e-9h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_2P_E_4H PatchedWritablePowerOutletRequestType = "iec-60309-2p-e-4h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_2P_E_6H PatchedWritablePowerOutletRequestType = "iec-60309-2p-e-6h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_2P_E_9H PatchedWritablePowerOutletRequestType = "iec-60309-2p-e-9h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_3P_E_4H PatchedWritablePowerOutletRequestType = "iec-60309-3p-e-4h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_3P_E_6H PatchedWritablePowerOutletRequestType = "iec-60309-3p-e-6h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_3P_E_9H PatchedWritablePowerOutletRequestType = "iec-60309-3p-e-9h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_3P_N_E_4H PatchedWritablePowerOutletRequestType = "iec-60309-3p-n-e-4h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_3P_N_E_6H PatchedWritablePowerOutletRequestType = "iec-60309-3p-n-e-6h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60309_3P_N_E_9H PatchedWritablePowerOutletRequestType = "iec-60309-3p-n-e-9h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_IEC_60906_1 PatchedWritablePowerOutletRequestType = "iec-60906-1" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NBR_14136_10A PatchedWritablePowerOutletRequestType = "nbr-14136-10a" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NBR_14136_20A PatchedWritablePowerOutletRequestType = "nbr-14136-20a" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_1_15R PatchedWritablePowerOutletRequestType = "nema-1-15r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_5_15R PatchedWritablePowerOutletRequestType = "nema-5-15r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_5_20R PatchedWritablePowerOutletRequestType = "nema-5-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_5_30R PatchedWritablePowerOutletRequestType = "nema-5-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_5_50R PatchedWritablePowerOutletRequestType = "nema-5-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_6_15R PatchedWritablePowerOutletRequestType = "nema-6-15r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_6_20R PatchedWritablePowerOutletRequestType = "nema-6-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_6_30R PatchedWritablePowerOutletRequestType = "nema-6-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_6_50R PatchedWritablePowerOutletRequestType = "nema-6-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_10_30R PatchedWritablePowerOutletRequestType = "nema-10-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_10_50R PatchedWritablePowerOutletRequestType = "nema-10-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_14_20R PatchedWritablePowerOutletRequestType = "nema-14-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_14_30R PatchedWritablePowerOutletRequestType = "nema-14-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_14_50R PatchedWritablePowerOutletRequestType = "nema-14-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_14_60R PatchedWritablePowerOutletRequestType = "nema-14-60r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_15_15R PatchedWritablePowerOutletRequestType = "nema-15-15r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_15_20R PatchedWritablePowerOutletRequestType = "nema-15-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_15_30R PatchedWritablePowerOutletRequestType = "nema-15-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_15_50R PatchedWritablePowerOutletRequestType = "nema-15-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_15_60R PatchedWritablePowerOutletRequestType = "nema-15-60r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L1_15R PatchedWritablePowerOutletRequestType = "nema-l1-15r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L5_15R PatchedWritablePowerOutletRequestType = "nema-l5-15r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L5_20R PatchedWritablePowerOutletRequestType = "nema-l5-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L5_30R PatchedWritablePowerOutletRequestType = "nema-l5-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L5_50R PatchedWritablePowerOutletRequestType = "nema-l5-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L6_15R PatchedWritablePowerOutletRequestType = "nema-l6-15r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L6_20R PatchedWritablePowerOutletRequestType = "nema-l6-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L6_30R PatchedWritablePowerOutletRequestType = "nema-l6-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L6_50R PatchedWritablePowerOutletRequestType = "nema-l6-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L10_30R PatchedWritablePowerOutletRequestType = "nema-l10-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L14_20R PatchedWritablePowerOutletRequestType = "nema-l14-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L14_30R PatchedWritablePowerOutletRequestType = "nema-l14-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L14_50R PatchedWritablePowerOutletRequestType = "nema-l14-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L14_60R PatchedWritablePowerOutletRequestType = "nema-l14-60r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L15_20R PatchedWritablePowerOutletRequestType = "nema-l15-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L15_30R PatchedWritablePowerOutletRequestType = "nema-l15-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L15_50R PatchedWritablePowerOutletRequestType = "nema-l15-50r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L15_60R PatchedWritablePowerOutletRequestType = "nema-l15-60r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L21_20R PatchedWritablePowerOutletRequestType = "nema-l21-20r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L21_30R PatchedWritablePowerOutletRequestType = "nema-l21-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEMA_L22_30R PatchedWritablePowerOutletRequestType = "nema-l22-30r" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_CS6360_C PatchedWritablePowerOutletRequestType = "CS6360C" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_CS6364_C PatchedWritablePowerOutletRequestType = "CS6364C" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_CS8164_C PatchedWritablePowerOutletRequestType = "CS8164C" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_CS8264_C PatchedWritablePowerOutletRequestType = "CS8264C" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_CS8364_C PatchedWritablePowerOutletRequestType = "CS8364C" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_CS8464_C PatchedWritablePowerOutletRequestType = "CS8464C" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_E PatchedWritablePowerOutletRequestType = "ita-e" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_F PatchedWritablePowerOutletRequestType = "ita-f" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_G PatchedWritablePowerOutletRequestType = "ita-g" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_H PatchedWritablePowerOutletRequestType = "ita-h" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_I PatchedWritablePowerOutletRequestType = "ita-i" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_J PatchedWritablePowerOutletRequestType = "ita-j" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_K PatchedWritablePowerOutletRequestType = "ita-k" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_L PatchedWritablePowerOutletRequestType = "ita-l" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_M PatchedWritablePowerOutletRequestType = "ita-m" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_N PatchedWritablePowerOutletRequestType = "ita-n" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_O PatchedWritablePowerOutletRequestType = "ita-o" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_ITA_MULTISTANDARD PatchedWritablePowerOutletRequestType = "ita-multistandard" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_USB_A PatchedWritablePowerOutletRequestType = "usb-a" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_USB_MICRO_B PatchedWritablePowerOutletRequestType = "usb-micro-b" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_USB_C PatchedWritablePowerOutletRequestType = "usb-c" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_DC_TERMINAL PatchedWritablePowerOutletRequestType = "dc-terminal" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_HDOT_CX PatchedWritablePowerOutletRequestType = "hdot-cx" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_SAF_D_GRID PatchedWritablePowerOutletRequestType = "saf-d-grid" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_20A PatchedWritablePowerOutletRequestType = "neutrik-powercon-20a" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_32A PatchedWritablePowerOutletRequestType = "neutrik-powercon-32a" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_TRUE1 PatchedWritablePowerOutletRequestType = "neutrik-powercon-true1" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_TRUE1_TOP PatchedWritablePowerOutletRequestType = "neutrik-powercon-true1-top" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_UBIQUITI_SMARTPOWER PatchedWritablePowerOutletRequestType = "ubiquiti-smartpower" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_HARDWIRED PatchedWritablePowerOutletRequestType = "hardwired" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_OTHER PatchedWritablePowerOutletRequestType = "other" + PATCHEDWRITABLEPOWEROUTLETREQUESTTYPE_EMPTY PatchedWritablePowerOutletRequestType = "" +) + +// All allowed values of PatchedWritablePowerOutletRequestType enum +var AllowedPatchedWritablePowerOutletRequestTypeEnumValues = []PatchedWritablePowerOutletRequestType{ + "iec-60320-c5", + "iec-60320-c7", + "iec-60320-c13", + "iec-60320-c15", + "iec-60320-c19", + "iec-60320-c21", + "iec-60309-p-n-e-4h", + "iec-60309-p-n-e-6h", + "iec-60309-p-n-e-9h", + "iec-60309-2p-e-4h", + "iec-60309-2p-e-6h", + "iec-60309-2p-e-9h", + "iec-60309-3p-e-4h", + "iec-60309-3p-e-6h", + "iec-60309-3p-e-9h", + "iec-60309-3p-n-e-4h", + "iec-60309-3p-n-e-6h", + "iec-60309-3p-n-e-9h", + "iec-60906-1", + "nbr-14136-10a", + "nbr-14136-20a", + "nema-1-15r", + "nema-5-15r", + "nema-5-20r", + "nema-5-30r", + "nema-5-50r", + "nema-6-15r", + "nema-6-20r", + "nema-6-30r", + "nema-6-50r", + "nema-10-30r", + "nema-10-50r", + "nema-14-20r", + "nema-14-30r", + "nema-14-50r", + "nema-14-60r", + "nema-15-15r", + "nema-15-20r", + "nema-15-30r", + "nema-15-50r", + "nema-15-60r", + "nema-l1-15r", + "nema-l5-15r", + "nema-l5-20r", + "nema-l5-30r", + "nema-l5-50r", + "nema-l6-15r", + "nema-l6-20r", + "nema-l6-30r", + "nema-l6-50r", + "nema-l10-30r", + "nema-l14-20r", + "nema-l14-30r", + "nema-l14-50r", + "nema-l14-60r", + "nema-l15-20r", + "nema-l15-30r", + "nema-l15-50r", + "nema-l15-60r", + "nema-l21-20r", + "nema-l21-30r", + "nema-l22-30r", + "CS6360C", + "CS6364C", + "CS8164C", + "CS8264C", + "CS8364C", + "CS8464C", + "ita-e", + "ita-f", + "ita-g", + "ita-h", + "ita-i", + "ita-j", + "ita-k", + "ita-l", + "ita-m", + "ita-n", + "ita-o", + "ita-multistandard", + "usb-a", + "usb-micro-b", + "usb-c", + "dc-terminal", + "hdot-cx", + "saf-d-grid", + "neutrik-powercon-20a", + "neutrik-powercon-32a", + "neutrik-powercon-true1", + "neutrik-powercon-true1-top", + "ubiquiti-smartpower", + "hardwired", + "other", + "", +} + +func (v *PatchedWritablePowerOutletRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerOutletRequestType(value) + for _, existing := range AllowedPatchedWritablePowerOutletRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerOutletRequestType", value) +} + +// NewPatchedWritablePowerOutletRequestTypeFromValue returns a pointer to a valid PatchedWritablePowerOutletRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerOutletRequestTypeFromValue(v string) (*PatchedWritablePowerOutletRequestType, error) { + ev := PatchedWritablePowerOutletRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerOutletRequestType: valid values are %v", v, AllowedPatchedWritablePowerOutletRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerOutletRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerOutletRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerOutletRequest_type value +func (v PatchedWritablePowerOutletRequestType) Ptr() *PatchedWritablePowerOutletRequestType { + return &v +} + +type NullablePatchedWritablePowerOutletRequestType struct { + value *PatchedWritablePowerOutletRequestType + isSet bool +} + +func (v NullablePatchedWritablePowerOutletRequestType) Get() *PatchedWritablePowerOutletRequestType { + return v.value +} + +func (v *NullablePatchedWritablePowerOutletRequestType) Set(val *PatchedWritablePowerOutletRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerOutletRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerOutletRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerOutletRequestType(val *PatchedWritablePowerOutletRequestType) *NullablePatchedWritablePowerOutletRequestType { + return &NullablePatchedWritablePowerOutletRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerOutletRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerOutletRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_template_request.go new file mode 100644 index 00000000..c41aa57c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_template_request.go @@ -0,0 +1,447 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePowerOutletTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePowerOutletTemplateRequest{} + +// PatchedWritablePowerOutletTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritablePowerOutletTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerOutletTemplateRequestType `json:"type,omitempty"` + PowerPort NullableInt32 `json:"power_port,omitempty"` + FeedLeg *PatchedWritablePowerOutletRequestFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePowerOutletTemplateRequest PatchedWritablePowerOutletTemplateRequest + +// NewPatchedWritablePowerOutletTemplateRequest instantiates a new PatchedWritablePowerOutletTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePowerOutletTemplateRequest() *PatchedWritablePowerOutletTemplateRequest { + this := PatchedWritablePowerOutletTemplateRequest{} + return &this +} + +// NewPatchedWritablePowerOutletTemplateRequestWithDefaults instantiates a new PatchedWritablePowerOutletTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePowerOutletTemplateRequestWithDefaults() *PatchedWritablePowerOutletTemplateRequest { + this := PatchedWritablePowerOutletTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerOutletTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerOutletTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PatchedWritablePowerOutletTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PatchedWritablePowerOutletTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerOutletTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerOutletTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PatchedWritablePowerOutletTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PatchedWritablePowerOutletTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletTemplateRequest) GetType() PatchedWritablePowerOutletTemplateRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerOutletTemplateRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) GetTypeOk() (*PatchedWritablePowerOutletTemplateRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerOutletTemplateRequestType and assigns it to the Type field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetType(v PatchedWritablePowerOutletTemplateRequestType) { + o.Type = &v +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerOutletTemplateRequest) GetPowerPort() int32 { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret int32 + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerOutletTemplateRequest) GetPowerPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableInt32 and assigns it to the PowerPort field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetPowerPort(v int32) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *PatchedWritablePowerOutletTemplateRequest) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *PatchedWritablePowerOutletTemplateRequest) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletTemplateRequest) GetFeedLeg() PatchedWritablePowerOutletRequestFeedLeg { + if o == nil || IsNil(o.FeedLeg) { + var ret PatchedWritablePowerOutletRequestFeedLeg + return ret + } + return *o.FeedLeg +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) GetFeedLegOk() (*PatchedWritablePowerOutletRequestFeedLeg, bool) { + if o == nil || IsNil(o.FeedLeg) { + return nil, false + } + return o.FeedLeg, true +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasFeedLeg() bool { + if o != nil && !IsNil(o.FeedLeg) { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given PatchedWritablePowerOutletRequestFeedLeg and assigns it to the FeedLeg field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetFeedLeg(v PatchedWritablePowerOutletRequestFeedLeg) { + o.FeedLeg = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePowerOutletTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePowerOutletTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePowerOutletTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritablePowerOutletTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePowerOutletTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if !IsNil(o.FeedLeg) { + toSerialize["feed_leg"] = o.FeedLeg + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePowerOutletTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePowerOutletTemplateRequest := _PatchedWritablePowerOutletTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePowerOutletTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePowerOutletTemplateRequest(varPatchedWritablePowerOutletTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePowerOutletTemplateRequest struct { + value *PatchedWritablePowerOutletTemplateRequest + isSet bool +} + +func (v NullablePatchedWritablePowerOutletTemplateRequest) Get() *PatchedWritablePowerOutletTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritablePowerOutletTemplateRequest) Set(val *PatchedWritablePowerOutletTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerOutletTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerOutletTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerOutletTemplateRequest(val *PatchedWritablePowerOutletTemplateRequest) *NullablePatchedWritablePowerOutletTemplateRequest { + return &NullablePatchedWritablePowerOutletTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerOutletTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerOutletTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_template_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_template_request_type.go new file mode 100644 index 00000000..c7df84aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_outlet_template_request_type.go @@ -0,0 +1,294 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerOutletTemplateRequestType * `iec-60320-c5` - C5 * `iec-60320-c7` - C7 * `iec-60320-c13` - C13 * `iec-60320-c15` - C15 * `iec-60320-c19` - C19 * `iec-60320-c21` - C21 * `iec-60309-p-n-e-4h` - P+N+E 4H * `iec-60309-p-n-e-6h` - P+N+E 6H * `iec-60309-p-n-e-9h` - P+N+E 9H * `iec-60309-2p-e-4h` - 2P+E 4H * `iec-60309-2p-e-6h` - 2P+E 6H * `iec-60309-2p-e-9h` - 2P+E 9H * `iec-60309-3p-e-4h` - 3P+E 4H * `iec-60309-3p-e-6h` - 3P+E 6H * `iec-60309-3p-e-9h` - 3P+E 9H * `iec-60309-3p-n-e-4h` - 3P+N+E 4H * `iec-60309-3p-n-e-6h` - 3P+N+E 6H * `iec-60309-3p-n-e-9h` - 3P+N+E 9H * `iec-60906-1` - IEC 60906-1 * `nbr-14136-10a` - 2P+T 10A (NBR 14136) * `nbr-14136-20a` - 2P+T 20A (NBR 14136) * `nema-1-15r` - NEMA 1-15R * `nema-5-15r` - NEMA 5-15R * `nema-5-20r` - NEMA 5-20R * `nema-5-30r` - NEMA 5-30R * `nema-5-50r` - NEMA 5-50R * `nema-6-15r` - NEMA 6-15R * `nema-6-20r` - NEMA 6-20R * `nema-6-30r` - NEMA 6-30R * `nema-6-50r` - NEMA 6-50R * `nema-10-30r` - NEMA 10-30R * `nema-10-50r` - NEMA 10-50R * `nema-14-20r` - NEMA 14-20R * `nema-14-30r` - NEMA 14-30R * `nema-14-50r` - NEMA 14-50R * `nema-14-60r` - NEMA 14-60R * `nema-15-15r` - NEMA 15-15R * `nema-15-20r` - NEMA 15-20R * `nema-15-30r` - NEMA 15-30R * `nema-15-50r` - NEMA 15-50R * `nema-15-60r` - NEMA 15-60R * `nema-l1-15r` - NEMA L1-15R * `nema-l5-15r` - NEMA L5-15R * `nema-l5-20r` - NEMA L5-20R * `nema-l5-30r` - NEMA L5-30R * `nema-l5-50r` - NEMA L5-50R * `nema-l6-15r` - NEMA L6-15R * `nema-l6-20r` - NEMA L6-20R * `nema-l6-30r` - NEMA L6-30R * `nema-l6-50r` - NEMA L6-50R * `nema-l10-30r` - NEMA L10-30R * `nema-l14-20r` - NEMA L14-20R * `nema-l14-30r` - NEMA L14-30R * `nema-l14-50r` - NEMA L14-50R * `nema-l14-60r` - NEMA L14-60R * `nema-l15-20r` - NEMA L15-20R * `nema-l15-30r` - NEMA L15-30R * `nema-l15-50r` - NEMA L15-50R * `nema-l15-60r` - NEMA L15-60R * `nema-l21-20r` - NEMA L21-20R * `nema-l21-30r` - NEMA L21-30R * `nema-l22-30r` - NEMA L22-30R * `CS6360C` - CS6360C * `CS6364C` - CS6364C * `CS8164C` - CS8164C * `CS8264C` - CS8264C * `CS8364C` - CS8364C * `CS8464C` - CS8464C * `ita-e` - ITA Type E (CEE 7/5) * `ita-f` - ITA Type F (CEE 7/3) * `ita-g` - ITA Type G (BS 1363) * `ita-h` - ITA Type H * `ita-i` - ITA Type I * `ita-j` - ITA Type J * `ita-k` - ITA Type K * `ita-l` - ITA Type L (CEI 23-50) * `ita-m` - ITA Type M (BS 546) * `ita-n` - ITA Type N * `ita-o` - ITA Type O * `ita-multistandard` - ITA Multistandard * `usb-a` - USB Type A * `usb-micro-b` - USB Micro B * `usb-c` - USB Type C * `dc-terminal` - DC Terminal * `hdot-cx` - HDOT Cx * `saf-d-grid` - Saf-D-Grid * `neutrik-powercon-20a` - Neutrik powerCON (20A) * `neutrik-powercon-32a` - Neutrik powerCON (32A) * `neutrik-powercon-true1` - Neutrik powerCON TRUE1 * `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP * `ubiquiti-smartpower` - Ubiquiti SmartPower * `hardwired` - Hardwired * `other` - Other +type PatchedWritablePowerOutletTemplateRequestType string + +// List of PatchedWritablePowerOutletTemplateRequest_type +const ( + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60320_C5 PatchedWritablePowerOutletTemplateRequestType = "iec-60320-c5" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60320_C7 PatchedWritablePowerOutletTemplateRequestType = "iec-60320-c7" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60320_C13 PatchedWritablePowerOutletTemplateRequestType = "iec-60320-c13" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60320_C15 PatchedWritablePowerOutletTemplateRequestType = "iec-60320-c15" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60320_C19 PatchedWritablePowerOutletTemplateRequestType = "iec-60320-c19" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60320_C21 PatchedWritablePowerOutletTemplateRequestType = "iec-60320-c21" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_P_N_E_4H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-p-n-e-4h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_P_N_E_6H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-p-n-e-6h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_P_N_E_9H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-p-n-e-9h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_2P_E_4H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-2p-e-4h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_2P_E_6H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-2p-e-6h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_2P_E_9H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-2p-e-9h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_3P_E_4H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-3p-e-4h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_3P_E_6H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-3p-e-6h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_3P_E_9H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-3p-e-9h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_3P_N_E_4H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-3p-n-e-4h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_3P_N_E_6H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-3p-n-e-6h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60309_3P_N_E_9H PatchedWritablePowerOutletTemplateRequestType = "iec-60309-3p-n-e-9h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_IEC_60906_1 PatchedWritablePowerOutletTemplateRequestType = "iec-60906-1" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NBR_14136_10A PatchedWritablePowerOutletTemplateRequestType = "nbr-14136-10a" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NBR_14136_20A PatchedWritablePowerOutletTemplateRequestType = "nbr-14136-20a" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_1_15R PatchedWritablePowerOutletTemplateRequestType = "nema-1-15r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_5_15R PatchedWritablePowerOutletTemplateRequestType = "nema-5-15r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_5_20R PatchedWritablePowerOutletTemplateRequestType = "nema-5-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_5_30R PatchedWritablePowerOutletTemplateRequestType = "nema-5-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_5_50R PatchedWritablePowerOutletTemplateRequestType = "nema-5-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_6_15R PatchedWritablePowerOutletTemplateRequestType = "nema-6-15r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_6_20R PatchedWritablePowerOutletTemplateRequestType = "nema-6-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_6_30R PatchedWritablePowerOutletTemplateRequestType = "nema-6-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_6_50R PatchedWritablePowerOutletTemplateRequestType = "nema-6-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_10_30R PatchedWritablePowerOutletTemplateRequestType = "nema-10-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_10_50R PatchedWritablePowerOutletTemplateRequestType = "nema-10-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_14_20R PatchedWritablePowerOutletTemplateRequestType = "nema-14-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_14_30R PatchedWritablePowerOutletTemplateRequestType = "nema-14-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_14_50R PatchedWritablePowerOutletTemplateRequestType = "nema-14-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_14_60R PatchedWritablePowerOutletTemplateRequestType = "nema-14-60r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_15_15R PatchedWritablePowerOutletTemplateRequestType = "nema-15-15r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_15_20R PatchedWritablePowerOutletTemplateRequestType = "nema-15-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_15_30R PatchedWritablePowerOutletTemplateRequestType = "nema-15-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_15_50R PatchedWritablePowerOutletTemplateRequestType = "nema-15-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_15_60R PatchedWritablePowerOutletTemplateRequestType = "nema-15-60r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L1_15R PatchedWritablePowerOutletTemplateRequestType = "nema-l1-15r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L5_15R PatchedWritablePowerOutletTemplateRequestType = "nema-l5-15r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L5_20R PatchedWritablePowerOutletTemplateRequestType = "nema-l5-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L5_30R PatchedWritablePowerOutletTemplateRequestType = "nema-l5-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L5_50R PatchedWritablePowerOutletTemplateRequestType = "nema-l5-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L6_15R PatchedWritablePowerOutletTemplateRequestType = "nema-l6-15r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L6_20R PatchedWritablePowerOutletTemplateRequestType = "nema-l6-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L6_30R PatchedWritablePowerOutletTemplateRequestType = "nema-l6-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L6_50R PatchedWritablePowerOutletTemplateRequestType = "nema-l6-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L10_30R PatchedWritablePowerOutletTemplateRequestType = "nema-l10-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L14_20R PatchedWritablePowerOutletTemplateRequestType = "nema-l14-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L14_30R PatchedWritablePowerOutletTemplateRequestType = "nema-l14-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L14_50R PatchedWritablePowerOutletTemplateRequestType = "nema-l14-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L14_60R PatchedWritablePowerOutletTemplateRequestType = "nema-l14-60r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L15_20R PatchedWritablePowerOutletTemplateRequestType = "nema-l15-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L15_30R PatchedWritablePowerOutletTemplateRequestType = "nema-l15-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L15_50R PatchedWritablePowerOutletTemplateRequestType = "nema-l15-50r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L15_60R PatchedWritablePowerOutletTemplateRequestType = "nema-l15-60r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L21_20R PatchedWritablePowerOutletTemplateRequestType = "nema-l21-20r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L21_30R PatchedWritablePowerOutletTemplateRequestType = "nema-l21-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEMA_L22_30R PatchedWritablePowerOutletTemplateRequestType = "nema-l22-30r" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_CS6360_C PatchedWritablePowerOutletTemplateRequestType = "CS6360C" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_CS6364_C PatchedWritablePowerOutletTemplateRequestType = "CS6364C" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_CS8164_C PatchedWritablePowerOutletTemplateRequestType = "CS8164C" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_CS8264_C PatchedWritablePowerOutletTemplateRequestType = "CS8264C" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_CS8364_C PatchedWritablePowerOutletTemplateRequestType = "CS8364C" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_CS8464_C PatchedWritablePowerOutletTemplateRequestType = "CS8464C" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_E PatchedWritablePowerOutletTemplateRequestType = "ita-e" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_F PatchedWritablePowerOutletTemplateRequestType = "ita-f" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_G PatchedWritablePowerOutletTemplateRequestType = "ita-g" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_H PatchedWritablePowerOutletTemplateRequestType = "ita-h" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_I PatchedWritablePowerOutletTemplateRequestType = "ita-i" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_J PatchedWritablePowerOutletTemplateRequestType = "ita-j" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_K PatchedWritablePowerOutletTemplateRequestType = "ita-k" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_L PatchedWritablePowerOutletTemplateRequestType = "ita-l" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_M PatchedWritablePowerOutletTemplateRequestType = "ita-m" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_N PatchedWritablePowerOutletTemplateRequestType = "ita-n" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_O PatchedWritablePowerOutletTemplateRequestType = "ita-o" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_ITA_MULTISTANDARD PatchedWritablePowerOutletTemplateRequestType = "ita-multistandard" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_USB_A PatchedWritablePowerOutletTemplateRequestType = "usb-a" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_USB_MICRO_B PatchedWritablePowerOutletTemplateRequestType = "usb-micro-b" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_USB_C PatchedWritablePowerOutletTemplateRequestType = "usb-c" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_DC_TERMINAL PatchedWritablePowerOutletTemplateRequestType = "dc-terminal" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_HDOT_CX PatchedWritablePowerOutletTemplateRequestType = "hdot-cx" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_SAF_D_GRID PatchedWritablePowerOutletTemplateRequestType = "saf-d-grid" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_20A PatchedWritablePowerOutletTemplateRequestType = "neutrik-powercon-20a" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_32A PatchedWritablePowerOutletTemplateRequestType = "neutrik-powercon-32a" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_TRUE1 PatchedWritablePowerOutletTemplateRequestType = "neutrik-powercon-true1" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_TRUE1_TOP PatchedWritablePowerOutletTemplateRequestType = "neutrik-powercon-true1-top" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_UBIQUITI_SMARTPOWER PatchedWritablePowerOutletTemplateRequestType = "ubiquiti-smartpower" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_HARDWIRED PatchedWritablePowerOutletTemplateRequestType = "hardwired" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_OTHER PatchedWritablePowerOutletTemplateRequestType = "other" + PATCHEDWRITABLEPOWEROUTLETTEMPLATEREQUESTTYPE_EMPTY PatchedWritablePowerOutletTemplateRequestType = "" +) + +// All allowed values of PatchedWritablePowerOutletTemplateRequestType enum +var AllowedPatchedWritablePowerOutletTemplateRequestTypeEnumValues = []PatchedWritablePowerOutletTemplateRequestType{ + "iec-60320-c5", + "iec-60320-c7", + "iec-60320-c13", + "iec-60320-c15", + "iec-60320-c19", + "iec-60320-c21", + "iec-60309-p-n-e-4h", + "iec-60309-p-n-e-6h", + "iec-60309-p-n-e-9h", + "iec-60309-2p-e-4h", + "iec-60309-2p-e-6h", + "iec-60309-2p-e-9h", + "iec-60309-3p-e-4h", + "iec-60309-3p-e-6h", + "iec-60309-3p-e-9h", + "iec-60309-3p-n-e-4h", + "iec-60309-3p-n-e-6h", + "iec-60309-3p-n-e-9h", + "iec-60906-1", + "nbr-14136-10a", + "nbr-14136-20a", + "nema-1-15r", + "nema-5-15r", + "nema-5-20r", + "nema-5-30r", + "nema-5-50r", + "nema-6-15r", + "nema-6-20r", + "nema-6-30r", + "nema-6-50r", + "nema-10-30r", + "nema-10-50r", + "nema-14-20r", + "nema-14-30r", + "nema-14-50r", + "nema-14-60r", + "nema-15-15r", + "nema-15-20r", + "nema-15-30r", + "nema-15-50r", + "nema-15-60r", + "nema-l1-15r", + "nema-l5-15r", + "nema-l5-20r", + "nema-l5-30r", + "nema-l5-50r", + "nema-l6-15r", + "nema-l6-20r", + "nema-l6-30r", + "nema-l6-50r", + "nema-l10-30r", + "nema-l14-20r", + "nema-l14-30r", + "nema-l14-50r", + "nema-l14-60r", + "nema-l15-20r", + "nema-l15-30r", + "nema-l15-50r", + "nema-l15-60r", + "nema-l21-20r", + "nema-l21-30r", + "nema-l22-30r", + "CS6360C", + "CS6364C", + "CS8164C", + "CS8264C", + "CS8364C", + "CS8464C", + "ita-e", + "ita-f", + "ita-g", + "ita-h", + "ita-i", + "ita-j", + "ita-k", + "ita-l", + "ita-m", + "ita-n", + "ita-o", + "ita-multistandard", + "usb-a", + "usb-micro-b", + "usb-c", + "dc-terminal", + "hdot-cx", + "saf-d-grid", + "neutrik-powercon-20a", + "neutrik-powercon-32a", + "neutrik-powercon-true1", + "neutrik-powercon-true1-top", + "ubiquiti-smartpower", + "hardwired", + "other", + "", +} + +func (v *PatchedWritablePowerOutletTemplateRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerOutletTemplateRequestType(value) + for _, existing := range AllowedPatchedWritablePowerOutletTemplateRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerOutletTemplateRequestType", value) +} + +// NewPatchedWritablePowerOutletTemplateRequestTypeFromValue returns a pointer to a valid PatchedWritablePowerOutletTemplateRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerOutletTemplateRequestTypeFromValue(v string) (*PatchedWritablePowerOutletTemplateRequestType, error) { + ev := PatchedWritablePowerOutletTemplateRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerOutletTemplateRequestType: valid values are %v", v, AllowedPatchedWritablePowerOutletTemplateRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerOutletTemplateRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerOutletTemplateRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerOutletTemplateRequest_type value +func (v PatchedWritablePowerOutletTemplateRequestType) Ptr() *PatchedWritablePowerOutletTemplateRequestType { + return &v +} + +type NullablePatchedWritablePowerOutletTemplateRequestType struct { + value *PatchedWritablePowerOutletTemplateRequestType + isSet bool +} + +func (v NullablePatchedWritablePowerOutletTemplateRequestType) Get() *PatchedWritablePowerOutletTemplateRequestType { + return v.value +} + +func (v *NullablePatchedWritablePowerOutletTemplateRequestType) Set(val *PatchedWritablePowerOutletTemplateRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerOutletTemplateRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerOutletTemplateRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerOutletTemplateRequestType(val *PatchedWritablePowerOutletTemplateRequestType) *NullablePatchedWritablePowerOutletTemplateRequestType { + return &NullablePatchedWritablePowerOutletTemplateRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerOutletTemplateRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerOutletTemplateRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_panel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_panel_request.go new file mode 100644 index 00000000..e260e477 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_panel_request.go @@ -0,0 +1,386 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePowerPanelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePowerPanelRequest{} + +// PatchedWritablePowerPanelRequest Adds support for custom fields and tags. +type PatchedWritablePowerPanelRequest struct { + Site *int32 `json:"site,omitempty"` + Location NullableInt32 `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePowerPanelRequest PatchedWritablePowerPanelRequest + +// NewPatchedWritablePowerPanelRequest instantiates a new PatchedWritablePowerPanelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePowerPanelRequest() *PatchedWritablePowerPanelRequest { + this := PatchedWritablePowerPanelRequest{} + return &this +} + +// NewPatchedWritablePowerPanelRequestWithDefaults instantiates a new PatchedWritablePowerPanelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePowerPanelRequestWithDefaults() *PatchedWritablePowerPanelRequest { + this := PatchedWritablePowerPanelRequest{} + return &this +} + +// GetSite returns the Site field value if set, zero value otherwise. +func (o *PatchedWritablePowerPanelRequest) GetSite() int32 { + if o == nil || IsNil(o.Site) { + var ret int32 + return ret + } + return *o.Site +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPanelRequest) GetSiteOk() (*int32, bool) { + if o == nil || IsNil(o.Site) { + return nil, false + } + return o.Site, true +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritablePowerPanelRequest) HasSite() bool { + if o != nil && !IsNil(o.Site) { + return true + } + + return false +} + +// SetSite gets a reference to the given int32 and assigns it to the Site field. +func (o *PatchedWritablePowerPanelRequest) SetSite(v int32) { + o.Site = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPanelRequest) GetLocation() int32 { + if o == nil || IsNil(o.Location.Get()) { + var ret int32 + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPanelRequest) GetLocationOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *PatchedWritablePowerPanelRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableInt32 and assigns it to the Location field. +func (o *PatchedWritablePowerPanelRequest) SetLocation(v int32) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *PatchedWritablePowerPanelRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *PatchedWritablePowerPanelRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritablePowerPanelRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPanelRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritablePowerPanelRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritablePowerPanelRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePowerPanelRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPanelRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePowerPanelRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePowerPanelRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritablePowerPanelRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPanelRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritablePowerPanelRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritablePowerPanelRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritablePowerPanelRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPanelRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritablePowerPanelRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritablePowerPanelRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritablePowerPanelRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPanelRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritablePowerPanelRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritablePowerPanelRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritablePowerPanelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePowerPanelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Site) { + toSerialize["site"] = o.Site + } + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePowerPanelRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePowerPanelRequest := _PatchedWritablePowerPanelRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePowerPanelRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePowerPanelRequest(varPatchedWritablePowerPanelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePowerPanelRequest struct { + value *PatchedWritablePowerPanelRequest + isSet bool +} + +func (v NullablePatchedWritablePowerPanelRequest) Get() *PatchedWritablePowerPanelRequest { + return v.value +} + +func (v *NullablePatchedWritablePowerPanelRequest) Set(val *PatchedWritablePowerPanelRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerPanelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerPanelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerPanelRequest(val *PatchedWritablePowerPanelRequest) *NullablePatchedWritablePowerPanelRequest { + return &NullablePatchedWritablePowerPanelRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerPanelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerPanelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_request.go new file mode 100644 index 00000000..cc4cf1df --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_request.go @@ -0,0 +1,560 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePowerPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePowerPortRequest{} + +// PatchedWritablePowerPortRequest Adds support for custom fields and tags. +type PatchedWritablePowerPortRequest struct { + Device *int32 `json:"device,omitempty"` + Module NullableInt32 `json:"module,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerPortRequestType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePowerPortRequest PatchedWritablePowerPortRequest + +// NewPatchedWritablePowerPortRequest instantiates a new PatchedWritablePowerPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePowerPortRequest() *PatchedWritablePowerPortRequest { + this := PatchedWritablePowerPortRequest{} + return &this +} + +// NewPatchedWritablePowerPortRequestWithDefaults instantiates a new PatchedWritablePowerPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePowerPortRequestWithDefaults() *PatchedWritablePowerPortRequest { + this := PatchedWritablePowerPortRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritablePowerPortRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *PatchedWritablePowerPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PatchedWritablePowerPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PatchedWritablePowerPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritablePowerPortRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritablePowerPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetType() PatchedWritablePowerPortRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerPortRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetTypeOk() (*PatchedWritablePowerPortRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerPortRequestType and assigns it to the Type field. +func (o *PatchedWritablePowerPortRequest) SetType(v PatchedWritablePowerPortRequestType) { + o.Type = &v +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPortRequest) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPortRequest) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *PatchedWritablePowerPortRequest) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *PatchedWritablePowerPortRequest) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *PatchedWritablePowerPortRequest) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPortRequest) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPortRequest) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *PatchedWritablePowerPortRequest) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *PatchedWritablePowerPortRequest) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *PatchedWritablePowerPortRequest) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePowerPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritablePowerPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritablePowerPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritablePowerPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritablePowerPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePowerPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePowerPortRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePowerPortRequest := _PatchedWritablePowerPortRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePowerPortRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePowerPortRequest(varPatchedWritablePowerPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePowerPortRequest struct { + value *PatchedWritablePowerPortRequest + isSet bool +} + +func (v NullablePatchedWritablePowerPortRequest) Get() *PatchedWritablePowerPortRequest { + return v.value +} + +func (v *NullablePatchedWritablePowerPortRequest) Set(val *PatchedWritablePowerPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerPortRequest(val *PatchedWritablePowerPortRequest) *NullablePatchedWritablePowerPortRequest { + return &NullablePatchedWritablePowerPortRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_request_type.go new file mode 100644 index 00000000..c57b60be --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_request_type.go @@ -0,0 +1,308 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerPortRequestType Physical port type * `iec-60320-c6` - C6 * `iec-60320-c8` - C8 * `iec-60320-c14` - C14 * `iec-60320-c16` - C16 * `iec-60320-c20` - C20 * `iec-60320-c22` - C22 * `iec-60309-p-n-e-4h` - P+N+E 4H * `iec-60309-p-n-e-6h` - P+N+E 6H * `iec-60309-p-n-e-9h` - P+N+E 9H * `iec-60309-2p-e-4h` - 2P+E 4H * `iec-60309-2p-e-6h` - 2P+E 6H * `iec-60309-2p-e-9h` - 2P+E 9H * `iec-60309-3p-e-4h` - 3P+E 4H * `iec-60309-3p-e-6h` - 3P+E 6H * `iec-60309-3p-e-9h` - 3P+E 9H * `iec-60309-3p-n-e-4h` - 3P+N+E 4H * `iec-60309-3p-n-e-6h` - 3P+N+E 6H * `iec-60309-3p-n-e-9h` - 3P+N+E 9H * `iec-60906-1` - IEC 60906-1 * `nbr-14136-10a` - 2P+T 10A (NBR 14136) * `nbr-14136-20a` - 2P+T 20A (NBR 14136) * `nema-1-15p` - NEMA 1-15P * `nema-5-15p` - NEMA 5-15P * `nema-5-20p` - NEMA 5-20P * `nema-5-30p` - NEMA 5-30P * `nema-5-50p` - NEMA 5-50P * `nema-6-15p` - NEMA 6-15P * `nema-6-20p` - NEMA 6-20P * `nema-6-30p` - NEMA 6-30P * `nema-6-50p` - NEMA 6-50P * `nema-10-30p` - NEMA 10-30P * `nema-10-50p` - NEMA 10-50P * `nema-14-20p` - NEMA 14-20P * `nema-14-30p` - NEMA 14-30P * `nema-14-50p` - NEMA 14-50P * `nema-14-60p` - NEMA 14-60P * `nema-15-15p` - NEMA 15-15P * `nema-15-20p` - NEMA 15-20P * `nema-15-30p` - NEMA 15-30P * `nema-15-50p` - NEMA 15-50P * `nema-15-60p` - NEMA 15-60P * `nema-l1-15p` - NEMA L1-15P * `nema-l5-15p` - NEMA L5-15P * `nema-l5-20p` - NEMA L5-20P * `nema-l5-30p` - NEMA L5-30P * `nema-l5-50p` - NEMA L5-50P * `nema-l6-15p` - NEMA L6-15P * `nema-l6-20p` - NEMA L6-20P * `nema-l6-30p` - NEMA L6-30P * `nema-l6-50p` - NEMA L6-50P * `nema-l10-30p` - NEMA L10-30P * `nema-l14-20p` - NEMA L14-20P * `nema-l14-30p` - NEMA L14-30P * `nema-l14-50p` - NEMA L14-50P * `nema-l14-60p` - NEMA L14-60P * `nema-l15-20p` - NEMA L15-20P * `nema-l15-30p` - NEMA L15-30P * `nema-l15-50p` - NEMA L15-50P * `nema-l15-60p` - NEMA L15-60P * `nema-l21-20p` - NEMA L21-20P * `nema-l21-30p` - NEMA L21-30P * `nema-l22-30p` - NEMA L22-30P * `cs6361c` - CS6361C * `cs6365c` - CS6365C * `cs8165c` - CS8165C * `cs8265c` - CS8265C * `cs8365c` - CS8365C * `cs8465c` - CS8465C * `ita-c` - ITA Type C (CEE 7/16) * `ita-e` - ITA Type E (CEE 7/6) * `ita-f` - ITA Type F (CEE 7/4) * `ita-ef` - ITA Type E/F (CEE 7/7) * `ita-g` - ITA Type G (BS 1363) * `ita-h` - ITA Type H * `ita-i` - ITA Type I * `ita-j` - ITA Type J * `ita-k` - ITA Type K * `ita-l` - ITA Type L (CEI 23-50) * `ita-m` - ITA Type M (BS 546) * `ita-n` - ITA Type N * `ita-o` - ITA Type O * `usb-a` - USB Type A * `usb-b` - USB Type B * `usb-c` - USB Type C * `usb-mini-a` - USB Mini A * `usb-mini-b` - USB Mini B * `usb-micro-a` - USB Micro A * `usb-micro-b` - USB Micro B * `usb-micro-ab` - USB Micro AB * `usb-3-b` - USB 3.0 Type B * `usb-3-micro-b` - USB 3.0 Micro B * `dc-terminal` - DC Terminal * `saf-d-grid` - Saf-D-Grid * `neutrik-powercon-20` - Neutrik powerCON (20A) * `neutrik-powercon-32` - Neutrik powerCON (32A) * `neutrik-powercon-true1` - Neutrik powerCON TRUE1 * `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP * `ubiquiti-smartpower` - Ubiquiti SmartPower * `hardwired` - Hardwired * `other` - Other +type PatchedWritablePowerPortRequestType string + +// List of PatchedWritablePowerPortRequest_type +const ( + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60320_C6 PatchedWritablePowerPortRequestType = "iec-60320-c6" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60320_C8 PatchedWritablePowerPortRequestType = "iec-60320-c8" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60320_C14 PatchedWritablePowerPortRequestType = "iec-60320-c14" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60320_C16 PatchedWritablePowerPortRequestType = "iec-60320-c16" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60320_C20 PatchedWritablePowerPortRequestType = "iec-60320-c20" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60320_C22 PatchedWritablePowerPortRequestType = "iec-60320-c22" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_P_N_E_4H PatchedWritablePowerPortRequestType = "iec-60309-p-n-e-4h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_P_N_E_6H PatchedWritablePowerPortRequestType = "iec-60309-p-n-e-6h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_P_N_E_9H PatchedWritablePowerPortRequestType = "iec-60309-p-n-e-9h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_2P_E_4H PatchedWritablePowerPortRequestType = "iec-60309-2p-e-4h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_2P_E_6H PatchedWritablePowerPortRequestType = "iec-60309-2p-e-6h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_2P_E_9H PatchedWritablePowerPortRequestType = "iec-60309-2p-e-9h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_3P_E_4H PatchedWritablePowerPortRequestType = "iec-60309-3p-e-4h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_3P_E_6H PatchedWritablePowerPortRequestType = "iec-60309-3p-e-6h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_3P_E_9H PatchedWritablePowerPortRequestType = "iec-60309-3p-e-9h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_3P_N_E_4H PatchedWritablePowerPortRequestType = "iec-60309-3p-n-e-4h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_3P_N_E_6H PatchedWritablePowerPortRequestType = "iec-60309-3p-n-e-6h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60309_3P_N_E_9H PatchedWritablePowerPortRequestType = "iec-60309-3p-n-e-9h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_IEC_60906_1 PatchedWritablePowerPortRequestType = "iec-60906-1" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NBR_14136_10A PatchedWritablePowerPortRequestType = "nbr-14136-10a" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NBR_14136_20A PatchedWritablePowerPortRequestType = "nbr-14136-20a" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_1_15P PatchedWritablePowerPortRequestType = "nema-1-15p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_5_15P PatchedWritablePowerPortRequestType = "nema-5-15p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_5_20P PatchedWritablePowerPortRequestType = "nema-5-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_5_30P PatchedWritablePowerPortRequestType = "nema-5-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_5_50P PatchedWritablePowerPortRequestType = "nema-5-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_6_15P PatchedWritablePowerPortRequestType = "nema-6-15p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_6_20P PatchedWritablePowerPortRequestType = "nema-6-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_6_30P PatchedWritablePowerPortRequestType = "nema-6-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_6_50P PatchedWritablePowerPortRequestType = "nema-6-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_10_30P PatchedWritablePowerPortRequestType = "nema-10-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_10_50P PatchedWritablePowerPortRequestType = "nema-10-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_14_20P PatchedWritablePowerPortRequestType = "nema-14-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_14_30P PatchedWritablePowerPortRequestType = "nema-14-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_14_50P PatchedWritablePowerPortRequestType = "nema-14-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_14_60P PatchedWritablePowerPortRequestType = "nema-14-60p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_15_15P PatchedWritablePowerPortRequestType = "nema-15-15p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_15_20P PatchedWritablePowerPortRequestType = "nema-15-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_15_30P PatchedWritablePowerPortRequestType = "nema-15-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_15_50P PatchedWritablePowerPortRequestType = "nema-15-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_15_60P PatchedWritablePowerPortRequestType = "nema-15-60p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L1_15P PatchedWritablePowerPortRequestType = "nema-l1-15p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L5_15P PatchedWritablePowerPortRequestType = "nema-l5-15p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L5_20P PatchedWritablePowerPortRequestType = "nema-l5-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L5_30P PatchedWritablePowerPortRequestType = "nema-l5-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L5_50P PatchedWritablePowerPortRequestType = "nema-l5-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L6_15P PatchedWritablePowerPortRequestType = "nema-l6-15p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L6_20P PatchedWritablePowerPortRequestType = "nema-l6-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L6_30P PatchedWritablePowerPortRequestType = "nema-l6-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L6_50P PatchedWritablePowerPortRequestType = "nema-l6-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L10_30P PatchedWritablePowerPortRequestType = "nema-l10-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L14_20P PatchedWritablePowerPortRequestType = "nema-l14-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L14_30P PatchedWritablePowerPortRequestType = "nema-l14-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L14_50P PatchedWritablePowerPortRequestType = "nema-l14-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L14_60P PatchedWritablePowerPortRequestType = "nema-l14-60p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L15_20P PatchedWritablePowerPortRequestType = "nema-l15-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L15_30P PatchedWritablePowerPortRequestType = "nema-l15-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L15_50P PatchedWritablePowerPortRequestType = "nema-l15-50p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L15_60P PatchedWritablePowerPortRequestType = "nema-l15-60p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L21_20P PatchedWritablePowerPortRequestType = "nema-l21-20p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L21_30P PatchedWritablePowerPortRequestType = "nema-l21-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEMA_L22_30P PatchedWritablePowerPortRequestType = "nema-l22-30p" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_CS6361C PatchedWritablePowerPortRequestType = "cs6361c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_CS6365C PatchedWritablePowerPortRequestType = "cs6365c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_CS8165C PatchedWritablePowerPortRequestType = "cs8165c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_CS8265C PatchedWritablePowerPortRequestType = "cs8265c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_CS8365C PatchedWritablePowerPortRequestType = "cs8365c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_CS8465C PatchedWritablePowerPortRequestType = "cs8465c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_C PatchedWritablePowerPortRequestType = "ita-c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_E PatchedWritablePowerPortRequestType = "ita-e" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_F PatchedWritablePowerPortRequestType = "ita-f" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_EF PatchedWritablePowerPortRequestType = "ita-ef" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_G PatchedWritablePowerPortRequestType = "ita-g" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_H PatchedWritablePowerPortRequestType = "ita-h" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_I PatchedWritablePowerPortRequestType = "ita-i" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_J PatchedWritablePowerPortRequestType = "ita-j" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_K PatchedWritablePowerPortRequestType = "ita-k" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_L PatchedWritablePowerPortRequestType = "ita-l" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_M PatchedWritablePowerPortRequestType = "ita-m" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_N PatchedWritablePowerPortRequestType = "ita-n" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_ITA_O PatchedWritablePowerPortRequestType = "ita-o" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_A PatchedWritablePowerPortRequestType = "usb-a" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_B PatchedWritablePowerPortRequestType = "usb-b" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_C PatchedWritablePowerPortRequestType = "usb-c" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_MINI_A PatchedWritablePowerPortRequestType = "usb-mini-a" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_MINI_B PatchedWritablePowerPortRequestType = "usb-mini-b" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_MICRO_A PatchedWritablePowerPortRequestType = "usb-micro-a" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_MICRO_B PatchedWritablePowerPortRequestType = "usb-micro-b" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_MICRO_AB PatchedWritablePowerPortRequestType = "usb-micro-ab" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_3_B PatchedWritablePowerPortRequestType = "usb-3-b" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_USB_3_MICRO_B PatchedWritablePowerPortRequestType = "usb-3-micro-b" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_DC_TERMINAL PatchedWritablePowerPortRequestType = "dc-terminal" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_SAF_D_GRID PatchedWritablePowerPortRequestType = "saf-d-grid" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEUTRIK_POWERCON_20 PatchedWritablePowerPortRequestType = "neutrik-powercon-20" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEUTRIK_POWERCON_32 PatchedWritablePowerPortRequestType = "neutrik-powercon-32" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEUTRIK_POWERCON_TRUE1 PatchedWritablePowerPortRequestType = "neutrik-powercon-true1" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_NEUTRIK_POWERCON_TRUE1_TOP PatchedWritablePowerPortRequestType = "neutrik-powercon-true1-top" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_UBIQUITI_SMARTPOWER PatchedWritablePowerPortRequestType = "ubiquiti-smartpower" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_HARDWIRED PatchedWritablePowerPortRequestType = "hardwired" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_OTHER PatchedWritablePowerPortRequestType = "other" + PATCHEDWRITABLEPOWERPORTREQUESTTYPE_EMPTY PatchedWritablePowerPortRequestType = "" +) + +// All allowed values of PatchedWritablePowerPortRequestType enum +var AllowedPatchedWritablePowerPortRequestTypeEnumValues = []PatchedWritablePowerPortRequestType{ + "iec-60320-c6", + "iec-60320-c8", + "iec-60320-c14", + "iec-60320-c16", + "iec-60320-c20", + "iec-60320-c22", + "iec-60309-p-n-e-4h", + "iec-60309-p-n-e-6h", + "iec-60309-p-n-e-9h", + "iec-60309-2p-e-4h", + "iec-60309-2p-e-6h", + "iec-60309-2p-e-9h", + "iec-60309-3p-e-4h", + "iec-60309-3p-e-6h", + "iec-60309-3p-e-9h", + "iec-60309-3p-n-e-4h", + "iec-60309-3p-n-e-6h", + "iec-60309-3p-n-e-9h", + "iec-60906-1", + "nbr-14136-10a", + "nbr-14136-20a", + "nema-1-15p", + "nema-5-15p", + "nema-5-20p", + "nema-5-30p", + "nema-5-50p", + "nema-6-15p", + "nema-6-20p", + "nema-6-30p", + "nema-6-50p", + "nema-10-30p", + "nema-10-50p", + "nema-14-20p", + "nema-14-30p", + "nema-14-50p", + "nema-14-60p", + "nema-15-15p", + "nema-15-20p", + "nema-15-30p", + "nema-15-50p", + "nema-15-60p", + "nema-l1-15p", + "nema-l5-15p", + "nema-l5-20p", + "nema-l5-30p", + "nema-l5-50p", + "nema-l6-15p", + "nema-l6-20p", + "nema-l6-30p", + "nema-l6-50p", + "nema-l10-30p", + "nema-l14-20p", + "nema-l14-30p", + "nema-l14-50p", + "nema-l14-60p", + "nema-l15-20p", + "nema-l15-30p", + "nema-l15-50p", + "nema-l15-60p", + "nema-l21-20p", + "nema-l21-30p", + "nema-l22-30p", + "cs6361c", + "cs6365c", + "cs8165c", + "cs8265c", + "cs8365c", + "cs8465c", + "ita-c", + "ita-e", + "ita-f", + "ita-ef", + "ita-g", + "ita-h", + "ita-i", + "ita-j", + "ita-k", + "ita-l", + "ita-m", + "ita-n", + "ita-o", + "usb-a", + "usb-b", + "usb-c", + "usb-mini-a", + "usb-mini-b", + "usb-micro-a", + "usb-micro-b", + "usb-micro-ab", + "usb-3-b", + "usb-3-micro-b", + "dc-terminal", + "saf-d-grid", + "neutrik-powercon-20", + "neutrik-powercon-32", + "neutrik-powercon-true1", + "neutrik-powercon-true1-top", + "ubiquiti-smartpower", + "hardwired", + "other", + "", +} + +func (v *PatchedWritablePowerPortRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerPortRequestType(value) + for _, existing := range AllowedPatchedWritablePowerPortRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerPortRequestType", value) +} + +// NewPatchedWritablePowerPortRequestTypeFromValue returns a pointer to a valid PatchedWritablePowerPortRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerPortRequestTypeFromValue(v string) (*PatchedWritablePowerPortRequestType, error) { + ev := PatchedWritablePowerPortRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerPortRequestType: valid values are %v", v, AllowedPatchedWritablePowerPortRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerPortRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerPortRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerPortRequest_type value +func (v PatchedWritablePowerPortRequestType) Ptr() *PatchedWritablePowerPortRequestType { + return &v +} + +type NullablePatchedWritablePowerPortRequestType struct { + value *PatchedWritablePowerPortRequestType + isSet bool +} + +func (v NullablePatchedWritablePowerPortRequestType) Get() *PatchedWritablePowerPortRequestType { + return v.value +} + +func (v *NullablePatchedWritablePowerPortRequestType) Set(val *PatchedWritablePowerPortRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerPortRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerPortRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerPortRequestType(val *PatchedWritablePowerPortRequestType) *NullablePatchedWritablePowerPortRequestType { + return &NullablePatchedWritablePowerPortRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerPortRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerPortRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_template_request.go new file mode 100644 index 00000000..8bf8b82b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_template_request.go @@ -0,0 +1,460 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePowerPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePowerPortTemplateRequest{} + +// PatchedWritablePowerPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritablePowerPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerPortTemplateRequestType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePowerPortTemplateRequest PatchedWritablePowerPortTemplateRequest + +// NewPatchedWritablePowerPortTemplateRequest instantiates a new PatchedWritablePowerPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePowerPortTemplateRequest() *PatchedWritablePowerPortTemplateRequest { + this := PatchedWritablePowerPortTemplateRequest{} + return &this +} + +// NewPatchedWritablePowerPortTemplateRequestWithDefaults instantiates a new PatchedWritablePowerPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePowerPortTemplateRequestWithDefaults() *PatchedWritablePowerPortTemplateRequest { + this := PatchedWritablePowerPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *PatchedWritablePowerPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *PatchedWritablePowerPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritablePowerPortTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritablePowerPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortTemplateRequest) GetType() PatchedWritablePowerPortTemplateRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerPortTemplateRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortTemplateRequest) GetTypeOk() (*PatchedWritablePowerPortTemplateRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerPortTemplateRequestType and assigns it to the Type field. +func (o *PatchedWritablePowerPortTemplateRequest) SetType(v PatchedWritablePowerPortTemplateRequestType) { + o.Type = &v +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPortTemplateRequest) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPortTemplateRequest) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *PatchedWritablePowerPortTemplateRequest) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePowerPortTemplateRequest) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePowerPortTemplateRequest) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *PatchedWritablePowerPortTemplateRequest) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *PatchedWritablePowerPortTemplateRequest) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePowerPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePowerPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePowerPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePowerPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritablePowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePowerPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePowerPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePowerPortTemplateRequest := _PatchedWritablePowerPortTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePowerPortTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePowerPortTemplateRequest(varPatchedWritablePowerPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePowerPortTemplateRequest struct { + value *PatchedWritablePowerPortTemplateRequest + isSet bool +} + +func (v NullablePatchedWritablePowerPortTemplateRequest) Get() *PatchedWritablePowerPortTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritablePowerPortTemplateRequest) Set(val *PatchedWritablePowerPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerPortTemplateRequest(val *PatchedWritablePowerPortTemplateRequest) *NullablePatchedWritablePowerPortTemplateRequest { + return &NullablePatchedWritablePowerPortTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_template_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_template_request_type.go new file mode 100644 index 00000000..7476cade --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_power_port_template_request_type.go @@ -0,0 +1,308 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePowerPortTemplateRequestType * `iec-60320-c6` - C6 * `iec-60320-c8` - C8 * `iec-60320-c14` - C14 * `iec-60320-c16` - C16 * `iec-60320-c20` - C20 * `iec-60320-c22` - C22 * `iec-60309-p-n-e-4h` - P+N+E 4H * `iec-60309-p-n-e-6h` - P+N+E 6H * `iec-60309-p-n-e-9h` - P+N+E 9H * `iec-60309-2p-e-4h` - 2P+E 4H * `iec-60309-2p-e-6h` - 2P+E 6H * `iec-60309-2p-e-9h` - 2P+E 9H * `iec-60309-3p-e-4h` - 3P+E 4H * `iec-60309-3p-e-6h` - 3P+E 6H * `iec-60309-3p-e-9h` - 3P+E 9H * `iec-60309-3p-n-e-4h` - 3P+N+E 4H * `iec-60309-3p-n-e-6h` - 3P+N+E 6H * `iec-60309-3p-n-e-9h` - 3P+N+E 9H * `iec-60906-1` - IEC 60906-1 * `nbr-14136-10a` - 2P+T 10A (NBR 14136) * `nbr-14136-20a` - 2P+T 20A (NBR 14136) * `nema-1-15p` - NEMA 1-15P * `nema-5-15p` - NEMA 5-15P * `nema-5-20p` - NEMA 5-20P * `nema-5-30p` - NEMA 5-30P * `nema-5-50p` - NEMA 5-50P * `nema-6-15p` - NEMA 6-15P * `nema-6-20p` - NEMA 6-20P * `nema-6-30p` - NEMA 6-30P * `nema-6-50p` - NEMA 6-50P * `nema-10-30p` - NEMA 10-30P * `nema-10-50p` - NEMA 10-50P * `nema-14-20p` - NEMA 14-20P * `nema-14-30p` - NEMA 14-30P * `nema-14-50p` - NEMA 14-50P * `nema-14-60p` - NEMA 14-60P * `nema-15-15p` - NEMA 15-15P * `nema-15-20p` - NEMA 15-20P * `nema-15-30p` - NEMA 15-30P * `nema-15-50p` - NEMA 15-50P * `nema-15-60p` - NEMA 15-60P * `nema-l1-15p` - NEMA L1-15P * `nema-l5-15p` - NEMA L5-15P * `nema-l5-20p` - NEMA L5-20P * `nema-l5-30p` - NEMA L5-30P * `nema-l5-50p` - NEMA L5-50P * `nema-l6-15p` - NEMA L6-15P * `nema-l6-20p` - NEMA L6-20P * `nema-l6-30p` - NEMA L6-30P * `nema-l6-50p` - NEMA L6-50P * `nema-l10-30p` - NEMA L10-30P * `nema-l14-20p` - NEMA L14-20P * `nema-l14-30p` - NEMA L14-30P * `nema-l14-50p` - NEMA L14-50P * `nema-l14-60p` - NEMA L14-60P * `nema-l15-20p` - NEMA L15-20P * `nema-l15-30p` - NEMA L15-30P * `nema-l15-50p` - NEMA L15-50P * `nema-l15-60p` - NEMA L15-60P * `nema-l21-20p` - NEMA L21-20P * `nema-l21-30p` - NEMA L21-30P * `nema-l22-30p` - NEMA L22-30P * `cs6361c` - CS6361C * `cs6365c` - CS6365C * `cs8165c` - CS8165C * `cs8265c` - CS8265C * `cs8365c` - CS8365C * `cs8465c` - CS8465C * `ita-c` - ITA Type C (CEE 7/16) * `ita-e` - ITA Type E (CEE 7/6) * `ita-f` - ITA Type F (CEE 7/4) * `ita-ef` - ITA Type E/F (CEE 7/7) * `ita-g` - ITA Type G (BS 1363) * `ita-h` - ITA Type H * `ita-i` - ITA Type I * `ita-j` - ITA Type J * `ita-k` - ITA Type K * `ita-l` - ITA Type L (CEI 23-50) * `ita-m` - ITA Type M (BS 546) * `ita-n` - ITA Type N * `ita-o` - ITA Type O * `usb-a` - USB Type A * `usb-b` - USB Type B * `usb-c` - USB Type C * `usb-mini-a` - USB Mini A * `usb-mini-b` - USB Mini B * `usb-micro-a` - USB Micro A * `usb-micro-b` - USB Micro B * `usb-micro-ab` - USB Micro AB * `usb-3-b` - USB 3.0 Type B * `usb-3-micro-b` - USB 3.0 Micro B * `dc-terminal` - DC Terminal * `saf-d-grid` - Saf-D-Grid * `neutrik-powercon-20` - Neutrik powerCON (20A) * `neutrik-powercon-32` - Neutrik powerCON (32A) * `neutrik-powercon-true1` - Neutrik powerCON TRUE1 * `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP * `ubiquiti-smartpower` - Ubiquiti SmartPower * `hardwired` - Hardwired * `other` - Other +type PatchedWritablePowerPortTemplateRequestType string + +// List of PatchedWritablePowerPortTemplateRequest_type +const ( + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60320_C6 PatchedWritablePowerPortTemplateRequestType = "iec-60320-c6" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60320_C8 PatchedWritablePowerPortTemplateRequestType = "iec-60320-c8" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60320_C14 PatchedWritablePowerPortTemplateRequestType = "iec-60320-c14" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60320_C16 PatchedWritablePowerPortTemplateRequestType = "iec-60320-c16" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60320_C20 PatchedWritablePowerPortTemplateRequestType = "iec-60320-c20" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60320_C22 PatchedWritablePowerPortTemplateRequestType = "iec-60320-c22" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_P_N_E_4H PatchedWritablePowerPortTemplateRequestType = "iec-60309-p-n-e-4h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_P_N_E_6H PatchedWritablePowerPortTemplateRequestType = "iec-60309-p-n-e-6h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_P_N_E_9H PatchedWritablePowerPortTemplateRequestType = "iec-60309-p-n-e-9h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_2P_E_4H PatchedWritablePowerPortTemplateRequestType = "iec-60309-2p-e-4h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_2P_E_6H PatchedWritablePowerPortTemplateRequestType = "iec-60309-2p-e-6h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_2P_E_9H PatchedWritablePowerPortTemplateRequestType = "iec-60309-2p-e-9h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_3P_E_4H PatchedWritablePowerPortTemplateRequestType = "iec-60309-3p-e-4h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_3P_E_6H PatchedWritablePowerPortTemplateRequestType = "iec-60309-3p-e-6h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_3P_E_9H PatchedWritablePowerPortTemplateRequestType = "iec-60309-3p-e-9h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_3P_N_E_4H PatchedWritablePowerPortTemplateRequestType = "iec-60309-3p-n-e-4h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_3P_N_E_6H PatchedWritablePowerPortTemplateRequestType = "iec-60309-3p-n-e-6h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60309_3P_N_E_9H PatchedWritablePowerPortTemplateRequestType = "iec-60309-3p-n-e-9h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_IEC_60906_1 PatchedWritablePowerPortTemplateRequestType = "iec-60906-1" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NBR_14136_10A PatchedWritablePowerPortTemplateRequestType = "nbr-14136-10a" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NBR_14136_20A PatchedWritablePowerPortTemplateRequestType = "nbr-14136-20a" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_1_15P PatchedWritablePowerPortTemplateRequestType = "nema-1-15p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_5_15P PatchedWritablePowerPortTemplateRequestType = "nema-5-15p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_5_20P PatchedWritablePowerPortTemplateRequestType = "nema-5-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_5_30P PatchedWritablePowerPortTemplateRequestType = "nema-5-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_5_50P PatchedWritablePowerPortTemplateRequestType = "nema-5-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_6_15P PatchedWritablePowerPortTemplateRequestType = "nema-6-15p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_6_20P PatchedWritablePowerPortTemplateRequestType = "nema-6-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_6_30P PatchedWritablePowerPortTemplateRequestType = "nema-6-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_6_50P PatchedWritablePowerPortTemplateRequestType = "nema-6-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_10_30P PatchedWritablePowerPortTemplateRequestType = "nema-10-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_10_50P PatchedWritablePowerPortTemplateRequestType = "nema-10-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_14_20P PatchedWritablePowerPortTemplateRequestType = "nema-14-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_14_30P PatchedWritablePowerPortTemplateRequestType = "nema-14-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_14_50P PatchedWritablePowerPortTemplateRequestType = "nema-14-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_14_60P PatchedWritablePowerPortTemplateRequestType = "nema-14-60p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_15_15P PatchedWritablePowerPortTemplateRequestType = "nema-15-15p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_15_20P PatchedWritablePowerPortTemplateRequestType = "nema-15-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_15_30P PatchedWritablePowerPortTemplateRequestType = "nema-15-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_15_50P PatchedWritablePowerPortTemplateRequestType = "nema-15-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_15_60P PatchedWritablePowerPortTemplateRequestType = "nema-15-60p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L1_15P PatchedWritablePowerPortTemplateRequestType = "nema-l1-15p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L5_15P PatchedWritablePowerPortTemplateRequestType = "nema-l5-15p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L5_20P PatchedWritablePowerPortTemplateRequestType = "nema-l5-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L5_30P PatchedWritablePowerPortTemplateRequestType = "nema-l5-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L5_50P PatchedWritablePowerPortTemplateRequestType = "nema-l5-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L6_15P PatchedWritablePowerPortTemplateRequestType = "nema-l6-15p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L6_20P PatchedWritablePowerPortTemplateRequestType = "nema-l6-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L6_30P PatchedWritablePowerPortTemplateRequestType = "nema-l6-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L6_50P PatchedWritablePowerPortTemplateRequestType = "nema-l6-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L10_30P PatchedWritablePowerPortTemplateRequestType = "nema-l10-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L14_20P PatchedWritablePowerPortTemplateRequestType = "nema-l14-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L14_30P PatchedWritablePowerPortTemplateRequestType = "nema-l14-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L14_50P PatchedWritablePowerPortTemplateRequestType = "nema-l14-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L14_60P PatchedWritablePowerPortTemplateRequestType = "nema-l14-60p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L15_20P PatchedWritablePowerPortTemplateRequestType = "nema-l15-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L15_30P PatchedWritablePowerPortTemplateRequestType = "nema-l15-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L15_50P PatchedWritablePowerPortTemplateRequestType = "nema-l15-50p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L15_60P PatchedWritablePowerPortTemplateRequestType = "nema-l15-60p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L21_20P PatchedWritablePowerPortTemplateRequestType = "nema-l21-20p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L21_30P PatchedWritablePowerPortTemplateRequestType = "nema-l21-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEMA_L22_30P PatchedWritablePowerPortTemplateRequestType = "nema-l22-30p" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_CS6361C PatchedWritablePowerPortTemplateRequestType = "cs6361c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_CS6365C PatchedWritablePowerPortTemplateRequestType = "cs6365c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_CS8165C PatchedWritablePowerPortTemplateRequestType = "cs8165c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_CS8265C PatchedWritablePowerPortTemplateRequestType = "cs8265c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_CS8365C PatchedWritablePowerPortTemplateRequestType = "cs8365c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_CS8465C PatchedWritablePowerPortTemplateRequestType = "cs8465c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_C PatchedWritablePowerPortTemplateRequestType = "ita-c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_E PatchedWritablePowerPortTemplateRequestType = "ita-e" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_F PatchedWritablePowerPortTemplateRequestType = "ita-f" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_EF PatchedWritablePowerPortTemplateRequestType = "ita-ef" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_G PatchedWritablePowerPortTemplateRequestType = "ita-g" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_H PatchedWritablePowerPortTemplateRequestType = "ita-h" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_I PatchedWritablePowerPortTemplateRequestType = "ita-i" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_J PatchedWritablePowerPortTemplateRequestType = "ita-j" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_K PatchedWritablePowerPortTemplateRequestType = "ita-k" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_L PatchedWritablePowerPortTemplateRequestType = "ita-l" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_M PatchedWritablePowerPortTemplateRequestType = "ita-m" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_N PatchedWritablePowerPortTemplateRequestType = "ita-n" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_ITA_O PatchedWritablePowerPortTemplateRequestType = "ita-o" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_A PatchedWritablePowerPortTemplateRequestType = "usb-a" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_B PatchedWritablePowerPortTemplateRequestType = "usb-b" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_C PatchedWritablePowerPortTemplateRequestType = "usb-c" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_MINI_A PatchedWritablePowerPortTemplateRequestType = "usb-mini-a" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_MINI_B PatchedWritablePowerPortTemplateRequestType = "usb-mini-b" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_MICRO_A PatchedWritablePowerPortTemplateRequestType = "usb-micro-a" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_MICRO_B PatchedWritablePowerPortTemplateRequestType = "usb-micro-b" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_MICRO_AB PatchedWritablePowerPortTemplateRequestType = "usb-micro-ab" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_3_B PatchedWritablePowerPortTemplateRequestType = "usb-3-b" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_USB_3_MICRO_B PatchedWritablePowerPortTemplateRequestType = "usb-3-micro-b" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_DC_TERMINAL PatchedWritablePowerPortTemplateRequestType = "dc-terminal" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_SAF_D_GRID PatchedWritablePowerPortTemplateRequestType = "saf-d-grid" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_20 PatchedWritablePowerPortTemplateRequestType = "neutrik-powercon-20" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_32 PatchedWritablePowerPortTemplateRequestType = "neutrik-powercon-32" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_TRUE1 PatchedWritablePowerPortTemplateRequestType = "neutrik-powercon-true1" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_NEUTRIK_POWERCON_TRUE1_TOP PatchedWritablePowerPortTemplateRequestType = "neutrik-powercon-true1-top" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_UBIQUITI_SMARTPOWER PatchedWritablePowerPortTemplateRequestType = "ubiquiti-smartpower" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_HARDWIRED PatchedWritablePowerPortTemplateRequestType = "hardwired" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_OTHER PatchedWritablePowerPortTemplateRequestType = "other" + PATCHEDWRITABLEPOWERPORTTEMPLATEREQUESTTYPE_EMPTY PatchedWritablePowerPortTemplateRequestType = "" +) + +// All allowed values of PatchedWritablePowerPortTemplateRequestType enum +var AllowedPatchedWritablePowerPortTemplateRequestTypeEnumValues = []PatchedWritablePowerPortTemplateRequestType{ + "iec-60320-c6", + "iec-60320-c8", + "iec-60320-c14", + "iec-60320-c16", + "iec-60320-c20", + "iec-60320-c22", + "iec-60309-p-n-e-4h", + "iec-60309-p-n-e-6h", + "iec-60309-p-n-e-9h", + "iec-60309-2p-e-4h", + "iec-60309-2p-e-6h", + "iec-60309-2p-e-9h", + "iec-60309-3p-e-4h", + "iec-60309-3p-e-6h", + "iec-60309-3p-e-9h", + "iec-60309-3p-n-e-4h", + "iec-60309-3p-n-e-6h", + "iec-60309-3p-n-e-9h", + "iec-60906-1", + "nbr-14136-10a", + "nbr-14136-20a", + "nema-1-15p", + "nema-5-15p", + "nema-5-20p", + "nema-5-30p", + "nema-5-50p", + "nema-6-15p", + "nema-6-20p", + "nema-6-30p", + "nema-6-50p", + "nema-10-30p", + "nema-10-50p", + "nema-14-20p", + "nema-14-30p", + "nema-14-50p", + "nema-14-60p", + "nema-15-15p", + "nema-15-20p", + "nema-15-30p", + "nema-15-50p", + "nema-15-60p", + "nema-l1-15p", + "nema-l5-15p", + "nema-l5-20p", + "nema-l5-30p", + "nema-l5-50p", + "nema-l6-15p", + "nema-l6-20p", + "nema-l6-30p", + "nema-l6-50p", + "nema-l10-30p", + "nema-l14-20p", + "nema-l14-30p", + "nema-l14-50p", + "nema-l14-60p", + "nema-l15-20p", + "nema-l15-30p", + "nema-l15-50p", + "nema-l15-60p", + "nema-l21-20p", + "nema-l21-30p", + "nema-l22-30p", + "cs6361c", + "cs6365c", + "cs8165c", + "cs8265c", + "cs8365c", + "cs8465c", + "ita-c", + "ita-e", + "ita-f", + "ita-ef", + "ita-g", + "ita-h", + "ita-i", + "ita-j", + "ita-k", + "ita-l", + "ita-m", + "ita-n", + "ita-o", + "usb-a", + "usb-b", + "usb-c", + "usb-mini-a", + "usb-mini-b", + "usb-micro-a", + "usb-micro-b", + "usb-micro-ab", + "usb-3-b", + "usb-3-micro-b", + "dc-terminal", + "saf-d-grid", + "neutrik-powercon-20", + "neutrik-powercon-32", + "neutrik-powercon-true1", + "neutrik-powercon-true1-top", + "ubiquiti-smartpower", + "hardwired", + "other", + "", +} + +func (v *PatchedWritablePowerPortTemplateRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePowerPortTemplateRequestType(value) + for _, existing := range AllowedPatchedWritablePowerPortTemplateRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePowerPortTemplateRequestType", value) +} + +// NewPatchedWritablePowerPortTemplateRequestTypeFromValue returns a pointer to a valid PatchedWritablePowerPortTemplateRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePowerPortTemplateRequestTypeFromValue(v string) (*PatchedWritablePowerPortTemplateRequestType, error) { + ev := PatchedWritablePowerPortTemplateRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePowerPortTemplateRequestType: valid values are %v", v, AllowedPatchedWritablePowerPortTemplateRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePowerPortTemplateRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritablePowerPortTemplateRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePowerPortTemplateRequest_type value +func (v PatchedWritablePowerPortTemplateRequestType) Ptr() *PatchedWritablePowerPortTemplateRequestType { + return &v +} + +type NullablePatchedWritablePowerPortTemplateRequestType struct { + value *PatchedWritablePowerPortTemplateRequestType + isSet bool +} + +func (v NullablePatchedWritablePowerPortTemplateRequestType) Get() *PatchedWritablePowerPortTemplateRequestType { + return v.value +} + +func (v *NullablePatchedWritablePowerPortTemplateRequestType) Set(val *PatchedWritablePowerPortTemplateRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePowerPortTemplateRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePowerPortTemplateRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePowerPortTemplateRequestType(val *PatchedWritablePowerPortTemplateRequestType) *NullablePatchedWritablePowerPortTemplateRequestType { + return &NullablePatchedWritablePowerPortTemplateRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritablePowerPortTemplateRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePowerPortTemplateRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_prefix_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_prefix_request.go new file mode 100644 index 00000000..44c95020 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_prefix_request.go @@ -0,0 +1,655 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritablePrefixRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritablePrefixRequest{} + +// PatchedWritablePrefixRequest Adds support for custom fields and tags. +type PatchedWritablePrefixRequest struct { + Prefix *string `json:"prefix,omitempty"` + Site NullableInt32 `json:"site,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Vlan NullableInt32 `json:"vlan,omitempty"` + Status *PatchedWritablePrefixRequestStatus `json:"status,omitempty"` + // The primary function of this prefix + Role NullableInt32 `json:"role,omitempty"` + // All IP addresses within this prefix are considered usable + IsPool *bool `json:"is_pool,omitempty"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritablePrefixRequest PatchedWritablePrefixRequest + +// NewPatchedWritablePrefixRequest instantiates a new PatchedWritablePrefixRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritablePrefixRequest() *PatchedWritablePrefixRequest { + this := PatchedWritablePrefixRequest{} + return &this +} + +// NewPatchedWritablePrefixRequestWithDefaults instantiates a new PatchedWritablePrefixRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritablePrefixRequestWithDefaults() *PatchedWritablePrefixRequest { + this := PatchedWritablePrefixRequest{} + return &this +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetPrefix() string { + if o == nil || IsNil(o.Prefix) { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *PatchedWritablePrefixRequest) SetPrefix(v string) { + o.Prefix = &v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePrefixRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePrefixRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *PatchedWritablePrefixRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *PatchedWritablePrefixRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *PatchedWritablePrefixRequest) UnsetSite() { + o.Site.Unset() +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePrefixRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePrefixRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *PatchedWritablePrefixRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *PatchedWritablePrefixRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *PatchedWritablePrefixRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePrefixRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePrefixRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritablePrefixRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritablePrefixRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritablePrefixRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePrefixRequest) GetVlan() int32 { + if o == nil || IsNil(o.Vlan.Get()) { + var ret int32 + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePrefixRequest) GetVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableInt32 and assigns it to the Vlan field. +func (o *PatchedWritablePrefixRequest) SetVlan(v int32) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *PatchedWritablePrefixRequest) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *PatchedWritablePrefixRequest) UnsetVlan() { + o.Vlan.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetStatus() PatchedWritablePrefixRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritablePrefixRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetStatusOk() (*PatchedWritablePrefixRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritablePrefixRequestStatus and assigns it to the Status field. +func (o *PatchedWritablePrefixRequest) SetStatus(v PatchedWritablePrefixRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritablePrefixRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritablePrefixRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *PatchedWritablePrefixRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PatchedWritablePrefixRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PatchedWritablePrefixRequest) UnsetRole() { + o.Role.Unset() +} + +// GetIsPool returns the IsPool field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetIsPool() bool { + if o == nil || IsNil(o.IsPool) { + var ret bool + return ret + } + return *o.IsPool +} + +// GetIsPoolOk returns a tuple with the IsPool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetIsPoolOk() (*bool, bool) { + if o == nil || IsNil(o.IsPool) { + return nil, false + } + return o.IsPool, true +} + +// HasIsPool returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasIsPool() bool { + if o != nil && !IsNil(o.IsPool) { + return true + } + + return false +} + +// SetIsPool gets a reference to the given bool and assigns it to the IsPool field. +func (o *PatchedWritablePrefixRequest) SetIsPool(v bool) { + o.IsPool = &v +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *PatchedWritablePrefixRequest) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritablePrefixRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritablePrefixRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritablePrefixRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritablePrefixRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritablePrefixRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritablePrefixRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritablePrefixRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritablePrefixRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritablePrefixRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.IsPool) { + toSerialize["is_pool"] = o.IsPool + } + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritablePrefixRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritablePrefixRequest := _PatchedWritablePrefixRequest{} + + err = json.Unmarshal(data, &varPatchedWritablePrefixRequest) + + if err != nil { + return err + } + + *o = PatchedWritablePrefixRequest(varPatchedWritablePrefixRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "site") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "vlan") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "is_pool") + delete(additionalProperties, "mark_utilized") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritablePrefixRequest struct { + value *PatchedWritablePrefixRequest + isSet bool +} + +func (v NullablePatchedWritablePrefixRequest) Get() *PatchedWritablePrefixRequest { + return v.value +} + +func (v *NullablePatchedWritablePrefixRequest) Set(val *PatchedWritablePrefixRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePrefixRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePrefixRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePrefixRequest(val *PatchedWritablePrefixRequest) *NullablePatchedWritablePrefixRequest { + return &NullablePatchedWritablePrefixRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritablePrefixRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePrefixRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_prefix_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_prefix_request_status.go new file mode 100644 index 00000000..d04459a1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_prefix_request_status.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritablePrefixRequestStatus Operational status of this prefix * `container` - Container * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated +type PatchedWritablePrefixRequestStatus string + +// List of PatchedWritablePrefixRequest_status +const ( + PATCHEDWRITABLEPREFIXREQUESTSTATUS_CONTAINER PatchedWritablePrefixRequestStatus = "container" + PATCHEDWRITABLEPREFIXREQUESTSTATUS_ACTIVE PatchedWritablePrefixRequestStatus = "active" + PATCHEDWRITABLEPREFIXREQUESTSTATUS_RESERVED PatchedWritablePrefixRequestStatus = "reserved" + PATCHEDWRITABLEPREFIXREQUESTSTATUS_DEPRECATED PatchedWritablePrefixRequestStatus = "deprecated" +) + +// All allowed values of PatchedWritablePrefixRequestStatus enum +var AllowedPatchedWritablePrefixRequestStatusEnumValues = []PatchedWritablePrefixRequestStatus{ + "container", + "active", + "reserved", + "deprecated", +} + +func (v *PatchedWritablePrefixRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritablePrefixRequestStatus(value) + for _, existing := range AllowedPatchedWritablePrefixRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritablePrefixRequestStatus", value) +} + +// NewPatchedWritablePrefixRequestStatusFromValue returns a pointer to a valid PatchedWritablePrefixRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritablePrefixRequestStatusFromValue(v string) (*PatchedWritablePrefixRequestStatus, error) { + ev := PatchedWritablePrefixRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritablePrefixRequestStatus: valid values are %v", v, AllowedPatchedWritablePrefixRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritablePrefixRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritablePrefixRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritablePrefixRequest_status value +func (v PatchedWritablePrefixRequestStatus) Ptr() *PatchedWritablePrefixRequestStatus { + return &v +} + +type NullablePatchedWritablePrefixRequestStatus struct { + value *PatchedWritablePrefixRequestStatus + isSet bool +} + +func (v NullablePatchedWritablePrefixRequestStatus) Get() *PatchedWritablePrefixRequestStatus { + return v.value +} + +func (v *NullablePatchedWritablePrefixRequestStatus) Set(val *PatchedWritablePrefixRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritablePrefixRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritablePrefixRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritablePrefixRequestStatus(val *PatchedWritablePrefixRequestStatus) *NullablePatchedWritablePrefixRequestStatus { + return &NullablePatchedWritablePrefixRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritablePrefixRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritablePrefixRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_account_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_account_request.go new file mode 100644 index 00000000..806be290 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_account_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableProviderAccountRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableProviderAccountRequest{} + +// PatchedWritableProviderAccountRequest Adds support for custom fields and tags. +type PatchedWritableProviderAccountRequest struct { + Provider *int32 `json:"provider,omitempty"` + Name *string `json:"name,omitempty"` + Account *string `json:"account,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableProviderAccountRequest PatchedWritableProviderAccountRequest + +// NewPatchedWritableProviderAccountRequest instantiates a new PatchedWritableProviderAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableProviderAccountRequest() *PatchedWritableProviderAccountRequest { + this := PatchedWritableProviderAccountRequest{} + return &this +} + +// NewPatchedWritableProviderAccountRequestWithDefaults instantiates a new PatchedWritableProviderAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableProviderAccountRequestWithDefaults() *PatchedWritableProviderAccountRequest { + this := PatchedWritableProviderAccountRequest{} + return &this +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *PatchedWritableProviderAccountRequest) GetProvider() int32 { + if o == nil || IsNil(o.Provider) { + var ret int32 + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderAccountRequest) GetProviderOk() (*int32, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchedWritableProviderAccountRequest) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given int32 and assigns it to the Provider field. +func (o *PatchedWritableProviderAccountRequest) SetProvider(v int32) { + o.Provider = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableProviderAccountRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderAccountRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableProviderAccountRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableProviderAccountRequest) SetName(v string) { + o.Name = &v +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *PatchedWritableProviderAccountRequest) GetAccount() string { + if o == nil || IsNil(o.Account) { + var ret string + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderAccountRequest) GetAccountOk() (*string, bool) { + if o == nil || IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *PatchedWritableProviderAccountRequest) HasAccount() bool { + if o != nil && !IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given string and assigns it to the Account field. +func (o *PatchedWritableProviderAccountRequest) SetAccount(v string) { + o.Account = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableProviderAccountRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderAccountRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableProviderAccountRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableProviderAccountRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableProviderAccountRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderAccountRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableProviderAccountRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableProviderAccountRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableProviderAccountRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderAccountRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableProviderAccountRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableProviderAccountRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableProviderAccountRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderAccountRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableProviderAccountRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableProviderAccountRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableProviderAccountRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableProviderAccountRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Account) { + toSerialize["account"] = o.Account + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableProviderAccountRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableProviderAccountRequest := _PatchedWritableProviderAccountRequest{} + + err = json.Unmarshal(data, &varPatchedWritableProviderAccountRequest) + + if err != nil { + return err + } + + *o = PatchedWritableProviderAccountRequest(varPatchedWritableProviderAccountRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "account") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableProviderAccountRequest struct { + value *PatchedWritableProviderAccountRequest + isSet bool +} + +func (v NullablePatchedWritableProviderAccountRequest) Get() *PatchedWritableProviderAccountRequest { + return v.value +} + +func (v *NullablePatchedWritableProviderAccountRequest) Set(val *PatchedWritableProviderAccountRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableProviderAccountRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableProviderAccountRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableProviderAccountRequest(val *PatchedWritableProviderAccountRequest) *NullablePatchedWritableProviderAccountRequest { + return &NullablePatchedWritableProviderAccountRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableProviderAccountRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableProviderAccountRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_network_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_network_request.go new file mode 100644 index 00000000..e5d52f32 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_network_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableProviderNetworkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableProviderNetworkRequest{} + +// PatchedWritableProviderNetworkRequest Adds support for custom fields and tags. +type PatchedWritableProviderNetworkRequest struct { + Provider *int32 `json:"provider,omitempty"` + Name *string `json:"name,omitempty"` + ServiceId *string `json:"service_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableProviderNetworkRequest PatchedWritableProviderNetworkRequest + +// NewPatchedWritableProviderNetworkRequest instantiates a new PatchedWritableProviderNetworkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableProviderNetworkRequest() *PatchedWritableProviderNetworkRequest { + this := PatchedWritableProviderNetworkRequest{} + return &this +} + +// NewPatchedWritableProviderNetworkRequestWithDefaults instantiates a new PatchedWritableProviderNetworkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableProviderNetworkRequestWithDefaults() *PatchedWritableProviderNetworkRequest { + this := PatchedWritableProviderNetworkRequest{} + return &this +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *PatchedWritableProviderNetworkRequest) GetProvider() int32 { + if o == nil || IsNil(o.Provider) { + var ret int32 + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderNetworkRequest) GetProviderOk() (*int32, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchedWritableProviderNetworkRequest) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given int32 and assigns it to the Provider field. +func (o *PatchedWritableProviderNetworkRequest) SetProvider(v int32) { + o.Provider = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableProviderNetworkRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderNetworkRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableProviderNetworkRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableProviderNetworkRequest) SetName(v string) { + o.Name = &v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *PatchedWritableProviderNetworkRequest) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderNetworkRequest) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *PatchedWritableProviderNetworkRequest) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *PatchedWritableProviderNetworkRequest) SetServiceId(v string) { + o.ServiceId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableProviderNetworkRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderNetworkRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableProviderNetworkRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableProviderNetworkRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableProviderNetworkRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderNetworkRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableProviderNetworkRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableProviderNetworkRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableProviderNetworkRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderNetworkRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableProviderNetworkRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableProviderNetworkRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableProviderNetworkRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderNetworkRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableProviderNetworkRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableProviderNetworkRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableProviderNetworkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableProviderNetworkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ServiceId) { + toSerialize["service_id"] = o.ServiceId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableProviderNetworkRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableProviderNetworkRequest := _PatchedWritableProviderNetworkRequest{} + + err = json.Unmarshal(data, &varPatchedWritableProviderNetworkRequest) + + if err != nil { + return err + } + + *o = PatchedWritableProviderNetworkRequest(varPatchedWritableProviderNetworkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "service_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableProviderNetworkRequest struct { + value *PatchedWritableProviderNetworkRequest + isSet bool +} + +func (v NullablePatchedWritableProviderNetworkRequest) Get() *PatchedWritableProviderNetworkRequest { + return v.value +} + +func (v *NullablePatchedWritableProviderNetworkRequest) Set(val *PatchedWritableProviderNetworkRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableProviderNetworkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableProviderNetworkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableProviderNetworkRequest(val *PatchedWritableProviderNetworkRequest) *NullablePatchedWritableProviderNetworkRequest { + return &NullablePatchedWritableProviderNetworkRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableProviderNetworkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableProviderNetworkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_request.go new file mode 100644 index 00000000..9a1d240c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_provider_request.go @@ -0,0 +1,413 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableProviderRequest{} + +// PatchedWritableProviderRequest Adds support for custom fields and tags. +type PatchedWritableProviderRequest struct { + // Full name of the provider + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Accounts []int32 `json:"accounts,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableProviderRequest PatchedWritableProviderRequest + +// NewPatchedWritableProviderRequest instantiates a new PatchedWritableProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableProviderRequest() *PatchedWritableProviderRequest { + this := PatchedWritableProviderRequest{} + return &this +} + +// NewPatchedWritableProviderRequestWithDefaults instantiates a new PatchedWritableProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableProviderRequestWithDefaults() *PatchedWritableProviderRequest { + this := PatchedWritableProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableProviderRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetAccounts returns the Accounts field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetAccounts() []int32 { + if o == nil || IsNil(o.Accounts) { + var ret []int32 + return ret + } + return o.Accounts +} + +// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetAccountsOk() ([]int32, bool) { + if o == nil || IsNil(o.Accounts) { + return nil, false + } + return o.Accounts, true +} + +// HasAccounts returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasAccounts() bool { + if o != nil && !IsNil(o.Accounts) { + return true + } + + return false +} + +// SetAccounts gets a reference to the given []int32 and assigns it to the Accounts field. +func (o *PatchedWritableProviderRequest) SetAccounts(v []int32) { + o.Accounts = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableProviderRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableProviderRequest) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *PatchedWritableProviderRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableProviderRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableProviderRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableProviderRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableProviderRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableProviderRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Accounts) { + toSerialize["accounts"] = o.Accounts + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableProviderRequest := _PatchedWritableProviderRequest{} + + err = json.Unmarshal(data, &varPatchedWritableProviderRequest) + + if err != nil { + return err + } + + *o = PatchedWritableProviderRequest(varPatchedWritableProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "accounts") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableProviderRequest struct { + value *PatchedWritableProviderRequest + isSet bool +} + +func (v NullablePatchedWritableProviderRequest) Get() *PatchedWritableProviderRequest { + return v.value +} + +func (v *NullablePatchedWritableProviderRequest) Set(val *PatchedWritableProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableProviderRequest(val *PatchedWritableProviderRequest) *NullablePatchedWritableProviderRequest { + return &NullablePatchedWritableProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request.go new file mode 100644 index 00000000..90ec96bf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request.go @@ -0,0 +1,1160 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableRackRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableRackRequest{} + +// PatchedWritableRackRequest Adds support for custom fields and tags. +type PatchedWritableRackRequest struct { + Name *string `json:"name,omitempty"` + FacilityId NullableString `json:"facility_id,omitempty"` + Site *int32 `json:"site,omitempty"` + Location NullableInt32 `json:"location,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableRackRequestStatus `json:"status,omitempty"` + // Functional role + Role NullableInt32 `json:"role,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this rack + AssetTag NullableString `json:"asset_tag,omitempty"` + Type *PatchedWritableRackRequestType `json:"type,omitempty"` + Width *PatchedWritableRackRequestWidth `json:"width,omitempty"` + // Height in rack units + UHeight *int32 `json:"u_height,omitempty"` + // Starting unit for rack + StartingUnit *int32 `json:"starting_unit,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + // Maximum load capacity for the rack + MaxWeight NullableInt32 `json:"max_weight,omitempty"` + WeightUnit *DeviceTypeWeightUnitValue `json:"weight_unit,omitempty"` + // Units are numbered top-to-bottom + DescUnits *bool `json:"desc_units,omitempty"` + // Outer dimension of rack (width) + OuterWidth NullableInt32 `json:"outer_width,omitempty"` + // Outer dimension of rack (depth) + OuterDepth NullableInt32 `json:"outer_depth,omitempty"` + OuterUnit *PatchedWritableRackRequestOuterUnit `json:"outer_unit,omitempty"` + // Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails. + MountingDepth NullableInt32 `json:"mounting_depth,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableRackRequest PatchedWritableRackRequest + +// NewPatchedWritableRackRequest instantiates a new PatchedWritableRackRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableRackRequest() *PatchedWritableRackRequest { + this := PatchedWritableRackRequest{} + return &this +} + +// NewPatchedWritableRackRequestWithDefaults instantiates a new PatchedWritableRackRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableRackRequestWithDefaults() *PatchedWritableRackRequest { + this := PatchedWritableRackRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableRackRequest) SetName(v string) { + o.Name = &v +} + +// GetFacilityId returns the FacilityId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetFacilityId() string { + if o == nil || IsNil(o.FacilityId.Get()) { + var ret string + return ret + } + return *o.FacilityId.Get() +} + +// GetFacilityIdOk returns a tuple with the FacilityId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetFacilityIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FacilityId.Get(), o.FacilityId.IsSet() +} + +// HasFacilityId returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasFacilityId() bool { + if o != nil && o.FacilityId.IsSet() { + return true + } + + return false +} + +// SetFacilityId gets a reference to the given NullableString and assigns it to the FacilityId field. +func (o *PatchedWritableRackRequest) SetFacilityId(v string) { + o.FacilityId.Set(&v) +} + +// SetFacilityIdNil sets the value for FacilityId to be an explicit nil +func (o *PatchedWritableRackRequest) SetFacilityIdNil() { + o.FacilityId.Set(nil) +} + +// UnsetFacilityId ensures that no value is present for FacilityId, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetFacilityId() { + o.FacilityId.Unset() +} + +// GetSite returns the Site field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetSite() int32 { + if o == nil || IsNil(o.Site) { + var ret int32 + return ret + } + return *o.Site +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetSiteOk() (*int32, bool) { + if o == nil || IsNil(o.Site) { + return nil, false + } + return o.Site, true +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasSite() bool { + if o != nil && !IsNil(o.Site) { + return true + } + + return false +} + +// SetSite gets a reference to the given int32 and assigns it to the Site field. +func (o *PatchedWritableRackRequest) SetSite(v int32) { + o.Site = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetLocation() int32 { + if o == nil || IsNil(o.Location.Get()) { + var ret int32 + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetLocationOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableInt32 and assigns it to the Location field. +func (o *PatchedWritableRackRequest) SetLocation(v int32) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *PatchedWritableRackRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableRackRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableRackRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetStatus() PatchedWritableRackRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableRackRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetStatusOk() (*PatchedWritableRackRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableRackRequestStatus and assigns it to the Status field. +func (o *PatchedWritableRackRequest) SetStatus(v PatchedWritableRackRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *PatchedWritableRackRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PatchedWritableRackRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetRole() { + o.Role.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *PatchedWritableRackRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *PatchedWritableRackRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *PatchedWritableRackRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetType() PatchedWritableRackRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableRackRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetTypeOk() (*PatchedWritableRackRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableRackRequestType and assigns it to the Type field. +func (o *PatchedWritableRackRequest) SetType(v PatchedWritableRackRequestType) { + o.Type = &v +} + +// GetWidth returns the Width field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetWidth() PatchedWritableRackRequestWidth { + if o == nil || IsNil(o.Width) { + var ret PatchedWritableRackRequestWidth + return ret + } + return *o.Width +} + +// GetWidthOk returns a tuple with the Width field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetWidthOk() (*PatchedWritableRackRequestWidth, bool) { + if o == nil || IsNil(o.Width) { + return nil, false + } + return o.Width, true +} + +// HasWidth returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasWidth() bool { + if o != nil && !IsNil(o.Width) { + return true + } + + return false +} + +// SetWidth gets a reference to the given PatchedWritableRackRequestWidth and assigns it to the Width field. +func (o *PatchedWritableRackRequest) SetWidth(v PatchedWritableRackRequestWidth) { + o.Width = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetUHeight() int32 { + if o == nil || IsNil(o.UHeight) { + var ret int32 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetUHeightOk() (*int32, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given int32 and assigns it to the UHeight field. +func (o *PatchedWritableRackRequest) SetUHeight(v int32) { + o.UHeight = &v +} + +// GetStartingUnit returns the StartingUnit field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetStartingUnit() int32 { + if o == nil || IsNil(o.StartingUnit) { + var ret int32 + return ret + } + return *o.StartingUnit +} + +// GetStartingUnitOk returns a tuple with the StartingUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetStartingUnitOk() (*int32, bool) { + if o == nil || IsNil(o.StartingUnit) { + return nil, false + } + return o.StartingUnit, true +} + +// HasStartingUnit returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasStartingUnit() bool { + if o != nil && !IsNil(o.StartingUnit) { + return true + } + + return false +} + +// SetStartingUnit gets a reference to the given int32 and assigns it to the StartingUnit field. +func (o *PatchedWritableRackRequest) SetStartingUnit(v int32) { + o.StartingUnit = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *PatchedWritableRackRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *PatchedWritableRackRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetMaxWeight returns the MaxWeight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetMaxWeight() int32 { + if o == nil || IsNil(o.MaxWeight.Get()) { + var ret int32 + return ret + } + return *o.MaxWeight.Get() +} + +// GetMaxWeightOk returns a tuple with the MaxWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetMaxWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxWeight.Get(), o.MaxWeight.IsSet() +} + +// HasMaxWeight returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasMaxWeight() bool { + if o != nil && o.MaxWeight.IsSet() { + return true + } + + return false +} + +// SetMaxWeight gets a reference to the given NullableInt32 and assigns it to the MaxWeight field. +func (o *PatchedWritableRackRequest) SetMaxWeight(v int32) { + o.MaxWeight.Set(&v) +} + +// SetMaxWeightNil sets the value for MaxWeight to be an explicit nil +func (o *PatchedWritableRackRequest) SetMaxWeightNil() { + o.MaxWeight.Set(nil) +} + +// UnsetMaxWeight ensures that no value is present for MaxWeight, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetMaxWeight() { + o.MaxWeight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetWeightUnit() DeviceTypeWeightUnitValue { + if o == nil || IsNil(o.WeightUnit) { + var ret DeviceTypeWeightUnitValue + return ret + } + return *o.WeightUnit +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetWeightUnitOk() (*DeviceTypeWeightUnitValue, bool) { + if o == nil || IsNil(o.WeightUnit) { + return nil, false + } + return o.WeightUnit, true +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasWeightUnit() bool { + if o != nil && !IsNil(o.WeightUnit) { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given DeviceTypeWeightUnitValue and assigns it to the WeightUnit field. +func (o *PatchedWritableRackRequest) SetWeightUnit(v DeviceTypeWeightUnitValue) { + o.WeightUnit = &v +} + +// GetDescUnits returns the DescUnits field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetDescUnits() bool { + if o == nil || IsNil(o.DescUnits) { + var ret bool + return ret + } + return *o.DescUnits +} + +// GetDescUnitsOk returns a tuple with the DescUnits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetDescUnitsOk() (*bool, bool) { + if o == nil || IsNil(o.DescUnits) { + return nil, false + } + return o.DescUnits, true +} + +// HasDescUnits returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasDescUnits() bool { + if o != nil && !IsNil(o.DescUnits) { + return true + } + + return false +} + +// SetDescUnits gets a reference to the given bool and assigns it to the DescUnits field. +func (o *PatchedWritableRackRequest) SetDescUnits(v bool) { + o.DescUnits = &v +} + +// GetOuterWidth returns the OuterWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetOuterWidth() int32 { + if o == nil || IsNil(o.OuterWidth.Get()) { + var ret int32 + return ret + } + return *o.OuterWidth.Get() +} + +// GetOuterWidthOk returns a tuple with the OuterWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetOuterWidthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterWidth.Get(), o.OuterWidth.IsSet() +} + +// HasOuterWidth returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasOuterWidth() bool { + if o != nil && o.OuterWidth.IsSet() { + return true + } + + return false +} + +// SetOuterWidth gets a reference to the given NullableInt32 and assigns it to the OuterWidth field. +func (o *PatchedWritableRackRequest) SetOuterWidth(v int32) { + o.OuterWidth.Set(&v) +} + +// SetOuterWidthNil sets the value for OuterWidth to be an explicit nil +func (o *PatchedWritableRackRequest) SetOuterWidthNil() { + o.OuterWidth.Set(nil) +} + +// UnsetOuterWidth ensures that no value is present for OuterWidth, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetOuterWidth() { + o.OuterWidth.Unset() +} + +// GetOuterDepth returns the OuterDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetOuterDepth() int32 { + if o == nil || IsNil(o.OuterDepth.Get()) { + var ret int32 + return ret + } + return *o.OuterDepth.Get() +} + +// GetOuterDepthOk returns a tuple with the OuterDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetOuterDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterDepth.Get(), o.OuterDepth.IsSet() +} + +// HasOuterDepth returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasOuterDepth() bool { + if o != nil && o.OuterDepth.IsSet() { + return true + } + + return false +} + +// SetOuterDepth gets a reference to the given NullableInt32 and assigns it to the OuterDepth field. +func (o *PatchedWritableRackRequest) SetOuterDepth(v int32) { + o.OuterDepth.Set(&v) +} + +// SetOuterDepthNil sets the value for OuterDepth to be an explicit nil +func (o *PatchedWritableRackRequest) SetOuterDepthNil() { + o.OuterDepth.Set(nil) +} + +// UnsetOuterDepth ensures that no value is present for OuterDepth, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetOuterDepth() { + o.OuterDepth.Unset() +} + +// GetOuterUnit returns the OuterUnit field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetOuterUnit() PatchedWritableRackRequestOuterUnit { + if o == nil || IsNil(o.OuterUnit) { + var ret PatchedWritableRackRequestOuterUnit + return ret + } + return *o.OuterUnit +} + +// GetOuterUnitOk returns a tuple with the OuterUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetOuterUnitOk() (*PatchedWritableRackRequestOuterUnit, bool) { + if o == nil || IsNil(o.OuterUnit) { + return nil, false + } + return o.OuterUnit, true +} + +// HasOuterUnit returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasOuterUnit() bool { + if o != nil && !IsNil(o.OuterUnit) { + return true + } + + return false +} + +// SetOuterUnit gets a reference to the given PatchedWritableRackRequestOuterUnit and assigns it to the OuterUnit field. +func (o *PatchedWritableRackRequest) SetOuterUnit(v PatchedWritableRackRequestOuterUnit) { + o.OuterUnit = &v +} + +// GetMountingDepth returns the MountingDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackRequest) GetMountingDepth() int32 { + if o == nil || IsNil(o.MountingDepth.Get()) { + var ret int32 + return ret + } + return *o.MountingDepth.Get() +} + +// GetMountingDepthOk returns a tuple with the MountingDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackRequest) GetMountingDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MountingDepth.Get(), o.MountingDepth.IsSet() +} + +// HasMountingDepth returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasMountingDepth() bool { + if o != nil && o.MountingDepth.IsSet() { + return true + } + + return false +} + +// SetMountingDepth gets a reference to the given NullableInt32 and assigns it to the MountingDepth field. +func (o *PatchedWritableRackRequest) SetMountingDepth(v int32) { + o.MountingDepth.Set(&v) +} + +// SetMountingDepthNil sets the value for MountingDepth to be an explicit nil +func (o *PatchedWritableRackRequest) SetMountingDepthNil() { + o.MountingDepth.Set(nil) +} + +// UnsetMountingDepth ensures that no value is present for MountingDepth, not even an explicit nil +func (o *PatchedWritableRackRequest) UnsetMountingDepth() { + o.MountingDepth.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableRackRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableRackRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableRackRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableRackRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableRackRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableRackRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableRackRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableRackRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.FacilityId.IsSet() { + toSerialize["facility_id"] = o.FacilityId.Get() + } + if !IsNil(o.Site) { + toSerialize["site"] = o.Site + } + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Width) { + toSerialize["width"] = o.Width + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.StartingUnit) { + toSerialize["starting_unit"] = o.StartingUnit + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.MaxWeight.IsSet() { + toSerialize["max_weight"] = o.MaxWeight.Get() + } + if !IsNil(o.WeightUnit) { + toSerialize["weight_unit"] = o.WeightUnit + } + if !IsNil(o.DescUnits) { + toSerialize["desc_units"] = o.DescUnits + } + if o.OuterWidth.IsSet() { + toSerialize["outer_width"] = o.OuterWidth.Get() + } + if o.OuterDepth.IsSet() { + toSerialize["outer_depth"] = o.OuterDepth.Get() + } + if !IsNil(o.OuterUnit) { + toSerialize["outer_unit"] = o.OuterUnit + } + if o.MountingDepth.IsSet() { + toSerialize["mounting_depth"] = o.MountingDepth.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableRackRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableRackRequest := _PatchedWritableRackRequest{} + + err = json.Unmarshal(data, &varPatchedWritableRackRequest) + + if err != nil { + return err + } + + *o = PatchedWritableRackRequest(varPatchedWritableRackRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "facility_id") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "type") + delete(additionalProperties, "width") + delete(additionalProperties, "u_height") + delete(additionalProperties, "starting_unit") + delete(additionalProperties, "weight") + delete(additionalProperties, "max_weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "desc_units") + delete(additionalProperties, "outer_width") + delete(additionalProperties, "outer_depth") + delete(additionalProperties, "outer_unit") + delete(additionalProperties, "mounting_depth") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableRackRequest struct { + value *PatchedWritableRackRequest + isSet bool +} + +func (v NullablePatchedWritableRackRequest) Get() *PatchedWritableRackRequest { + return v.value +} + +func (v *NullablePatchedWritableRackRequest) Set(val *PatchedWritableRackRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRackRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRackRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRackRequest(val *PatchedWritableRackRequest) *NullablePatchedWritableRackRequest { + return &NullablePatchedWritableRackRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableRackRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRackRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_outer_unit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_outer_unit.go new file mode 100644 index 00000000..716b499b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_outer_unit.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableRackRequestOuterUnit * `mm` - Millimeters * `in` - Inches +type PatchedWritableRackRequestOuterUnit string + +// List of PatchedWritableRackRequest_outer_unit +const ( + PATCHEDWRITABLERACKREQUESTOUTERUNIT_MM PatchedWritableRackRequestOuterUnit = "mm" + PATCHEDWRITABLERACKREQUESTOUTERUNIT_IN PatchedWritableRackRequestOuterUnit = "in" + PATCHEDWRITABLERACKREQUESTOUTERUNIT_EMPTY PatchedWritableRackRequestOuterUnit = "" +) + +// All allowed values of PatchedWritableRackRequestOuterUnit enum +var AllowedPatchedWritableRackRequestOuterUnitEnumValues = []PatchedWritableRackRequestOuterUnit{ + "mm", + "in", + "", +} + +func (v *PatchedWritableRackRequestOuterUnit) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableRackRequestOuterUnit(value) + for _, existing := range AllowedPatchedWritableRackRequestOuterUnitEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableRackRequestOuterUnit", value) +} + +// NewPatchedWritableRackRequestOuterUnitFromValue returns a pointer to a valid PatchedWritableRackRequestOuterUnit +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableRackRequestOuterUnitFromValue(v string) (*PatchedWritableRackRequestOuterUnit, error) { + ev := PatchedWritableRackRequestOuterUnit(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableRackRequestOuterUnit: valid values are %v", v, AllowedPatchedWritableRackRequestOuterUnitEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableRackRequestOuterUnit) IsValid() bool { + for _, existing := range AllowedPatchedWritableRackRequestOuterUnitEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableRackRequest_outer_unit value +func (v PatchedWritableRackRequestOuterUnit) Ptr() *PatchedWritableRackRequestOuterUnit { + return &v +} + +type NullablePatchedWritableRackRequestOuterUnit struct { + value *PatchedWritableRackRequestOuterUnit + isSet bool +} + +func (v NullablePatchedWritableRackRequestOuterUnit) Get() *PatchedWritableRackRequestOuterUnit { + return v.value +} + +func (v *NullablePatchedWritableRackRequestOuterUnit) Set(val *PatchedWritableRackRequestOuterUnit) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRackRequestOuterUnit) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRackRequestOuterUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRackRequestOuterUnit(val *PatchedWritableRackRequestOuterUnit) *NullablePatchedWritableRackRequestOuterUnit { + return &NullablePatchedWritableRackRequestOuterUnit{value: val, isSet: true} +} + +func (v NullablePatchedWritableRackRequestOuterUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRackRequestOuterUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_status.go new file mode 100644 index 00000000..8375b2d7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_status.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableRackRequestStatus * `reserved` - Reserved * `available` - Available * `planned` - Planned * `active` - Active * `deprecated` - Deprecated +type PatchedWritableRackRequestStatus string + +// List of PatchedWritableRackRequest_status +const ( + PATCHEDWRITABLERACKREQUESTSTATUS_RESERVED PatchedWritableRackRequestStatus = "reserved" + PATCHEDWRITABLERACKREQUESTSTATUS_AVAILABLE PatchedWritableRackRequestStatus = "available" + PATCHEDWRITABLERACKREQUESTSTATUS_PLANNED PatchedWritableRackRequestStatus = "planned" + PATCHEDWRITABLERACKREQUESTSTATUS_ACTIVE PatchedWritableRackRequestStatus = "active" + PATCHEDWRITABLERACKREQUESTSTATUS_DEPRECATED PatchedWritableRackRequestStatus = "deprecated" +) + +// All allowed values of PatchedWritableRackRequestStatus enum +var AllowedPatchedWritableRackRequestStatusEnumValues = []PatchedWritableRackRequestStatus{ + "reserved", + "available", + "planned", + "active", + "deprecated", +} + +func (v *PatchedWritableRackRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableRackRequestStatus(value) + for _, existing := range AllowedPatchedWritableRackRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableRackRequestStatus", value) +} + +// NewPatchedWritableRackRequestStatusFromValue returns a pointer to a valid PatchedWritableRackRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableRackRequestStatusFromValue(v string) (*PatchedWritableRackRequestStatus, error) { + ev := PatchedWritableRackRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableRackRequestStatus: valid values are %v", v, AllowedPatchedWritableRackRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableRackRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritableRackRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableRackRequest_status value +func (v PatchedWritableRackRequestStatus) Ptr() *PatchedWritableRackRequestStatus { + return &v +} + +type NullablePatchedWritableRackRequestStatus struct { + value *PatchedWritableRackRequestStatus + isSet bool +} + +func (v NullablePatchedWritableRackRequestStatus) Get() *PatchedWritableRackRequestStatus { + return v.value +} + +func (v *NullablePatchedWritableRackRequestStatus) Set(val *PatchedWritableRackRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRackRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRackRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRackRequestStatus(val *PatchedWritableRackRequestStatus) *NullablePatchedWritableRackRequestStatus { + return &NullablePatchedWritableRackRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritableRackRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRackRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_type.go new file mode 100644 index 00000000..b6280c13 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_type.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableRackRequestType * `2-post-frame` - 2-post frame * `4-post-frame` - 4-post frame * `4-post-cabinet` - 4-post cabinet * `wall-frame` - Wall-mounted frame * `wall-frame-vertical` - Wall-mounted frame (vertical) * `wall-cabinet` - Wall-mounted cabinet * `wall-cabinet-vertical` - Wall-mounted cabinet (vertical) +type PatchedWritableRackRequestType string + +// List of PatchedWritableRackRequest_type +const ( + PATCHEDWRITABLERACKREQUESTTYPE__2_POST_FRAME PatchedWritableRackRequestType = "2-post-frame" + PATCHEDWRITABLERACKREQUESTTYPE__4_POST_FRAME PatchedWritableRackRequestType = "4-post-frame" + PATCHEDWRITABLERACKREQUESTTYPE__4_POST_CABINET PatchedWritableRackRequestType = "4-post-cabinet" + PATCHEDWRITABLERACKREQUESTTYPE_WALL_FRAME PatchedWritableRackRequestType = "wall-frame" + PATCHEDWRITABLERACKREQUESTTYPE_WALL_FRAME_VERTICAL PatchedWritableRackRequestType = "wall-frame-vertical" + PATCHEDWRITABLERACKREQUESTTYPE_WALL_CABINET PatchedWritableRackRequestType = "wall-cabinet" + PATCHEDWRITABLERACKREQUESTTYPE_WALL_CABINET_VERTICAL PatchedWritableRackRequestType = "wall-cabinet-vertical" + PATCHEDWRITABLERACKREQUESTTYPE_EMPTY PatchedWritableRackRequestType = "" +) + +// All allowed values of PatchedWritableRackRequestType enum +var AllowedPatchedWritableRackRequestTypeEnumValues = []PatchedWritableRackRequestType{ + "2-post-frame", + "4-post-frame", + "4-post-cabinet", + "wall-frame", + "wall-frame-vertical", + "wall-cabinet", + "wall-cabinet-vertical", + "", +} + +func (v *PatchedWritableRackRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableRackRequestType(value) + for _, existing := range AllowedPatchedWritableRackRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableRackRequestType", value) +} + +// NewPatchedWritableRackRequestTypeFromValue returns a pointer to a valid PatchedWritableRackRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableRackRequestTypeFromValue(v string) (*PatchedWritableRackRequestType, error) { + ev := PatchedWritableRackRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableRackRequestType: valid values are %v", v, AllowedPatchedWritableRackRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableRackRequestType) IsValid() bool { + for _, existing := range AllowedPatchedWritableRackRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableRackRequest_type value +func (v PatchedWritableRackRequestType) Ptr() *PatchedWritableRackRequestType { + return &v +} + +type NullablePatchedWritableRackRequestType struct { + value *PatchedWritableRackRequestType + isSet bool +} + +func (v NullablePatchedWritableRackRequestType) Get() *PatchedWritableRackRequestType { + return v.value +} + +func (v *NullablePatchedWritableRackRequestType) Set(val *PatchedWritableRackRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRackRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRackRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRackRequestType(val *PatchedWritableRackRequestType) *NullablePatchedWritableRackRequestType { + return &NullablePatchedWritableRackRequestType{value: val, isSet: true} +} + +func (v NullablePatchedWritableRackRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRackRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_width.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_width.go new file mode 100644 index 00000000..2ac6d70b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_request_width.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableRackRequestWidth Rail-to-rail width * `10` - 10 inches * `19` - 19 inches * `21` - 21 inches * `23` - 23 inches +type PatchedWritableRackRequestWidth int32 + +// List of PatchedWritableRackRequest_width +const ( + PATCHEDWRITABLERACKREQUESTWIDTH__10 PatchedWritableRackRequestWidth = 10 + PATCHEDWRITABLERACKREQUESTWIDTH__19 PatchedWritableRackRequestWidth = 19 + PATCHEDWRITABLERACKREQUESTWIDTH__21 PatchedWritableRackRequestWidth = 21 + PATCHEDWRITABLERACKREQUESTWIDTH__23 PatchedWritableRackRequestWidth = 23 +) + +// All allowed values of PatchedWritableRackRequestWidth enum +var AllowedPatchedWritableRackRequestWidthEnumValues = []PatchedWritableRackRequestWidth{ + 10, + 19, + 21, + 23, +} + +func (v *PatchedWritableRackRequestWidth) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableRackRequestWidth(value) + for _, existing := range AllowedPatchedWritableRackRequestWidthEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableRackRequestWidth", value) +} + +// NewPatchedWritableRackRequestWidthFromValue returns a pointer to a valid PatchedWritableRackRequestWidth +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableRackRequestWidthFromValue(v int32) (*PatchedWritableRackRequestWidth, error) { + ev := PatchedWritableRackRequestWidth(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableRackRequestWidth: valid values are %v", v, AllowedPatchedWritableRackRequestWidthEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableRackRequestWidth) IsValid() bool { + for _, existing := range AllowedPatchedWritableRackRequestWidthEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableRackRequest_width value +func (v PatchedWritableRackRequestWidth) Ptr() *PatchedWritableRackRequestWidth { + return &v +} + +type NullablePatchedWritableRackRequestWidth struct { + value *PatchedWritableRackRequestWidth + isSet bool +} + +func (v NullablePatchedWritableRackRequestWidth) Get() *PatchedWritableRackRequestWidth { + return v.value +} + +func (v *NullablePatchedWritableRackRequestWidth) Set(val *PatchedWritableRackRequestWidth) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRackRequestWidth) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRackRequestWidth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRackRequestWidth(val *PatchedWritableRackRequestWidth) *NullablePatchedWritableRackRequestWidth { + return &NullablePatchedWritableRackRequestWidth{value: val, isSet: true} +} + +func (v NullablePatchedWritableRackRequestWidth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRackRequestWidth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_reservation_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_reservation_request.go new file mode 100644 index 00000000..67dbffe4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rack_reservation_request.go @@ -0,0 +1,423 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableRackReservationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableRackReservationRequest{} + +// PatchedWritableRackReservationRequest Adds support for custom fields and tags. +type PatchedWritableRackReservationRequest struct { + Rack *int32 `json:"rack,omitempty"` + Units []int32 `json:"units,omitempty"` + User *int32 `json:"user,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableRackReservationRequest PatchedWritableRackReservationRequest + +// NewPatchedWritableRackReservationRequest instantiates a new PatchedWritableRackReservationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableRackReservationRequest() *PatchedWritableRackReservationRequest { + this := PatchedWritableRackReservationRequest{} + return &this +} + +// NewPatchedWritableRackReservationRequestWithDefaults instantiates a new PatchedWritableRackReservationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableRackReservationRequestWithDefaults() *PatchedWritableRackReservationRequest { + this := PatchedWritableRackReservationRequest{} + return &this +} + +// GetRack returns the Rack field value if set, zero value otherwise. +func (o *PatchedWritableRackReservationRequest) GetRack() int32 { + if o == nil || IsNil(o.Rack) { + var ret int32 + return ret + } + return *o.Rack +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackReservationRequest) GetRackOk() (*int32, bool) { + if o == nil || IsNil(o.Rack) { + return nil, false + } + return o.Rack, true +} + +// HasRack returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasRack() bool { + if o != nil && !IsNil(o.Rack) { + return true + } + + return false +} + +// SetRack gets a reference to the given int32 and assigns it to the Rack field. +func (o *PatchedWritableRackReservationRequest) SetRack(v int32) { + o.Rack = &v +} + +// GetUnits returns the Units field value if set, zero value otherwise. +func (o *PatchedWritableRackReservationRequest) GetUnits() []int32 { + if o == nil || IsNil(o.Units) { + var ret []int32 + return ret + } + return o.Units +} + +// GetUnitsOk returns a tuple with the Units field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackReservationRequest) GetUnitsOk() ([]int32, bool) { + if o == nil || IsNil(o.Units) { + return nil, false + } + return o.Units, true +} + +// HasUnits returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasUnits() bool { + if o != nil && !IsNil(o.Units) { + return true + } + + return false +} + +// SetUnits gets a reference to the given []int32 and assigns it to the Units field. +func (o *PatchedWritableRackReservationRequest) SetUnits(v []int32) { + o.Units = v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedWritableRackReservationRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackReservationRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedWritableRackReservationRequest) SetUser(v int32) { + o.User = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRackReservationRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRackReservationRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableRackReservationRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableRackReservationRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableRackReservationRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableRackReservationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackReservationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableRackReservationRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableRackReservationRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackReservationRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableRackReservationRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableRackReservationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackReservationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableRackReservationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableRackReservationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRackReservationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableRackReservationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableRackReservationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableRackReservationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableRackReservationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Rack) { + toSerialize["rack"] = o.Rack + } + if !IsNil(o.Units) { + toSerialize["units"] = o.Units + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableRackReservationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableRackReservationRequest := _PatchedWritableRackReservationRequest{} + + err = json.Unmarshal(data, &varPatchedWritableRackReservationRequest) + + if err != nil { + return err + } + + *o = PatchedWritableRackReservationRequest(varPatchedWritableRackReservationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "rack") + delete(additionalProperties, "units") + delete(additionalProperties, "user") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableRackReservationRequest struct { + value *PatchedWritableRackReservationRequest + isSet bool +} + +func (v NullablePatchedWritableRackReservationRequest) Get() *PatchedWritableRackReservationRequest { + return v.value +} + +func (v *NullablePatchedWritableRackReservationRequest) Set(val *PatchedWritableRackReservationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRackReservationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRackReservationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRackReservationRequest(val *PatchedWritableRackReservationRequest) *NullablePatchedWritableRackReservationRequest { + return &NullablePatchedWritableRackReservationRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableRackReservationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRackReservationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rear_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rear_port_request.go new file mode 100644 index 00000000..89f97447 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rear_port_request.go @@ -0,0 +1,537 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableRearPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableRearPortRequest{} + +// PatchedWritableRearPortRequest Adds support for custom fields and tags. +type PatchedWritableRearPortRequest struct { + Device *int32 `json:"device,omitempty"` + Module NullableInt32 `json:"module,omitempty"` + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *FrontPortTypeValue `json:"type,omitempty"` + Color *string `json:"color,omitempty"` + // Number of front ports which may be mapped + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableRearPortRequest PatchedWritableRearPortRequest + +// NewPatchedWritableRearPortRequest instantiates a new PatchedWritableRearPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableRearPortRequest() *PatchedWritableRearPortRequest { + this := PatchedWritableRearPortRequest{} + return &this +} + +// NewPatchedWritableRearPortRequestWithDefaults instantiates a new PatchedWritableRearPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableRearPortRequestWithDefaults() *PatchedWritableRearPortRequest { + this := PatchedWritableRearPortRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device) { + var ret int32 + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given int32 and assigns it to the Device field. +func (o *PatchedWritableRearPortRequest) SetDevice(v int32) { + o.Device = &v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRearPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRearPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *PatchedWritableRearPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PatchedWritableRearPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PatchedWritableRearPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableRearPortRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableRearPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetType() FrontPortTypeValue { + if o == nil || IsNil(o.Type) { + var ret FrontPortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given FrontPortTypeValue and assigns it to the Type field. +func (o *PatchedWritableRearPortRequest) SetType(v FrontPortTypeValue) { + o.Type = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedWritableRearPortRequest) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *PatchedWritableRearPortRequest) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableRearPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PatchedWritableRearPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableRearPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableRearPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableRearPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableRearPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableRearPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableRearPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableRearPortRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableRearPortRequest := _PatchedWritableRearPortRequest{} + + err = json.Unmarshal(data, &varPatchedWritableRearPortRequest) + + if err != nil { + return err + } + + *o = PatchedWritableRearPortRequest(varPatchedWritableRearPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableRearPortRequest struct { + value *PatchedWritableRearPortRequest + isSet bool +} + +func (v NullablePatchedWritableRearPortRequest) Get() *PatchedWritableRearPortRequest { + return v.value +} + +func (v *NullablePatchedWritableRearPortRequest) Set(val *PatchedWritableRearPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRearPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRearPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRearPortRequest(val *PatchedWritableRearPortRequest) *NullablePatchedWritableRearPortRequest { + return &NullablePatchedWritableRearPortRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableRearPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRearPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rear_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rear_port_template_request.go new file mode 100644 index 00000000..986b386a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_rear_port_template_request.go @@ -0,0 +1,436 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableRearPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableRearPortTemplateRequest{} + +// PatchedWritableRearPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableRearPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name *string `json:"name,omitempty"` + // Physical label + Label *string `json:"label,omitempty"` + Type *FrontPortTypeValue `json:"type,omitempty"` + Color *string `json:"color,omitempty"` + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableRearPortTemplateRequest PatchedWritableRearPortTemplateRequest + +// NewPatchedWritableRearPortTemplateRequest instantiates a new PatchedWritableRearPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableRearPortTemplateRequest() *PatchedWritableRearPortTemplateRequest { + this := PatchedWritableRearPortTemplateRequest{} + return &this +} + +// NewPatchedWritableRearPortTemplateRequestWithDefaults instantiates a new PatchedWritableRearPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableRearPortTemplateRequestWithDefaults() *PatchedWritableRearPortTemplateRequest { + this := PatchedWritableRearPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRearPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRearPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *PatchedWritableRearPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PatchedWritableRearPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PatchedWritableRearPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRearPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRearPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *PatchedWritableRearPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PatchedWritableRearPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PatchedWritableRearPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableRearPortTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableRearPortTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedWritableRearPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedWritableRearPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedWritableRearPortTemplateRequest) GetType() FrontPortTypeValue { + if o == nil || IsNil(o.Type) { + var ret FrontPortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortTemplateRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given FrontPortTypeValue and assigns it to the Type field. +func (o *PatchedWritableRearPortTemplateRequest) SetType(v FrontPortTypeValue) { + o.Type = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *PatchedWritableRearPortTemplateRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortTemplateRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *PatchedWritableRearPortTemplateRequest) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *PatchedWritableRearPortTemplateRequest) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortTemplateRequest) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *PatchedWritableRearPortTemplateRequest) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableRearPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRearPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableRearPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableRearPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritableRearPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableRearPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableRearPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableRearPortTemplateRequest := _PatchedWritableRearPortTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableRearPortTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableRearPortTemplateRequest(varPatchedWritableRearPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableRearPortTemplateRequest struct { + value *PatchedWritableRearPortTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableRearPortTemplateRequest) Get() *PatchedWritableRearPortTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableRearPortTemplateRequest) Set(val *PatchedWritableRearPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRearPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRearPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRearPortTemplateRequest(val *PatchedWritableRearPortTemplateRequest) *NullablePatchedWritableRearPortTemplateRequest { + return &NullablePatchedWritableRearPortTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableRearPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRearPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_region_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_region_request.go new file mode 100644 index 00000000..ad3073e6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_region_request.go @@ -0,0 +1,349 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableRegionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableRegionRequest{} + +// PatchedWritableRegionRequest Extends PrimaryModelSerializer to include MPTT support. +type PatchedWritableRegionRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableRegionRequest PatchedWritableRegionRequest + +// NewPatchedWritableRegionRequest instantiates a new PatchedWritableRegionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableRegionRequest() *PatchedWritableRegionRequest { + this := PatchedWritableRegionRequest{} + return &this +} + +// NewPatchedWritableRegionRequestWithDefaults instantiates a new PatchedWritableRegionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableRegionRequestWithDefaults() *PatchedWritableRegionRequest { + this := PatchedWritableRegionRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableRegionRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRegionRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableRegionRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableRegionRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableRegionRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRegionRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableRegionRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableRegionRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRegionRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRegionRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableRegionRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableRegionRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableRegionRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableRegionRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableRegionRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRegionRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableRegionRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableRegionRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableRegionRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRegionRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableRegionRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableRegionRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableRegionRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRegionRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableRegionRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableRegionRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableRegionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableRegionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableRegionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableRegionRequest := _PatchedWritableRegionRequest{} + + err = json.Unmarshal(data, &varPatchedWritableRegionRequest) + + if err != nil { + return err + } + + *o = PatchedWritableRegionRequest(varPatchedWritableRegionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableRegionRequest struct { + value *PatchedWritableRegionRequest + isSet bool +} + +func (v NullablePatchedWritableRegionRequest) Get() *PatchedWritableRegionRequest { + return v.value +} + +func (v *NullablePatchedWritableRegionRequest) Set(val *PatchedWritableRegionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRegionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRegionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRegionRequest(val *PatchedWritableRegionRequest) *NullablePatchedWritableRegionRequest { + return &NullablePatchedWritableRegionRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableRegionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRegionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_route_target_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_route_target_request.go new file mode 100644 index 00000000..e54dcd94 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_route_target_request.go @@ -0,0 +1,350 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableRouteTargetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableRouteTargetRequest{} + +// PatchedWritableRouteTargetRequest Adds support for custom fields and tags. +type PatchedWritableRouteTargetRequest struct { + // Route target value (formatted in accordance with RFC 4360) + Name *string `json:"name,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableRouteTargetRequest PatchedWritableRouteTargetRequest + +// NewPatchedWritableRouteTargetRequest instantiates a new PatchedWritableRouteTargetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableRouteTargetRequest() *PatchedWritableRouteTargetRequest { + this := PatchedWritableRouteTargetRequest{} + return &this +} + +// NewPatchedWritableRouteTargetRequestWithDefaults instantiates a new PatchedWritableRouteTargetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableRouteTargetRequestWithDefaults() *PatchedWritableRouteTargetRequest { + this := PatchedWritableRouteTargetRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableRouteTargetRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRouteTargetRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableRouteTargetRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableRouteTargetRequest) SetName(v string) { + o.Name = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableRouteTargetRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableRouteTargetRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableRouteTargetRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableRouteTargetRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableRouteTargetRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableRouteTargetRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableRouteTargetRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRouteTargetRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableRouteTargetRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableRouteTargetRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableRouteTargetRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRouteTargetRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableRouteTargetRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableRouteTargetRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableRouteTargetRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRouteTargetRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableRouteTargetRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableRouteTargetRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableRouteTargetRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableRouteTargetRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableRouteTargetRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableRouteTargetRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableRouteTargetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableRouteTargetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableRouteTargetRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableRouteTargetRequest := _PatchedWritableRouteTargetRequest{} + + err = json.Unmarshal(data, &varPatchedWritableRouteTargetRequest) + + if err != nil { + return err + } + + *o = PatchedWritableRouteTargetRequest(varPatchedWritableRouteTargetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableRouteTargetRequest struct { + value *PatchedWritableRouteTargetRequest + isSet bool +} + +func (v NullablePatchedWritableRouteTargetRequest) Get() *PatchedWritableRouteTargetRequest { + return v.value +} + +func (v *NullablePatchedWritableRouteTargetRequest) Set(val *PatchedWritableRouteTargetRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableRouteTargetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableRouteTargetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableRouteTargetRequest(val *PatchedWritableRouteTargetRequest) *NullablePatchedWritableRouteTargetRequest { + return &NullablePatchedWritableRouteTargetRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableRouteTargetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableRouteTargetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_request.go new file mode 100644 index 00000000..92e76130 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_request.go @@ -0,0 +1,509 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableServiceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableServiceRequest{} + +// PatchedWritableServiceRequest Adds support for custom fields and tags. +type PatchedWritableServiceRequest struct { + Device NullableInt32 `json:"device,omitempty"` + VirtualMachine NullableInt32 `json:"virtual_machine,omitempty"` + Name *string `json:"name,omitempty"` + Ports []int32 `json:"ports,omitempty"` + Protocol *PatchedWritableServiceRequestProtocol `json:"protocol,omitempty"` + // The specific IP addresses (if any) to which this service is bound + Ipaddresses []int32 `json:"ipaddresses,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableServiceRequest PatchedWritableServiceRequest + +// NewPatchedWritableServiceRequest instantiates a new PatchedWritableServiceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableServiceRequest() *PatchedWritableServiceRequest { + this := PatchedWritableServiceRequest{} + return &this +} + +// NewPatchedWritableServiceRequestWithDefaults instantiates a new PatchedWritableServiceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableServiceRequestWithDefaults() *PatchedWritableServiceRequest { + this := PatchedWritableServiceRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableServiceRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device.Get()) { + var ret int32 + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableServiceRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableInt32 and assigns it to the Device field. +func (o *PatchedWritableServiceRequest) SetDevice(v int32) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *PatchedWritableServiceRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *PatchedWritableServiceRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetVirtualMachine returns the VirtualMachine field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableServiceRequest) GetVirtualMachine() int32 { + if o == nil || IsNil(o.VirtualMachine.Get()) { + var ret int32 + return ret + } + return *o.VirtualMachine.Get() +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableServiceRequest) GetVirtualMachineOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VirtualMachine.Get(), o.VirtualMachine.IsSet() +} + +// HasVirtualMachine returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasVirtualMachine() bool { + if o != nil && o.VirtualMachine.IsSet() { + return true + } + + return false +} + +// SetVirtualMachine gets a reference to the given NullableInt32 and assigns it to the VirtualMachine field. +func (o *PatchedWritableServiceRequest) SetVirtualMachine(v int32) { + o.VirtualMachine.Set(&v) +} + +// SetVirtualMachineNil sets the value for VirtualMachine to be an explicit nil +func (o *PatchedWritableServiceRequest) SetVirtualMachineNil() { + o.VirtualMachine.Set(nil) +} + +// UnsetVirtualMachine ensures that no value is present for VirtualMachine, not even an explicit nil +func (o *PatchedWritableServiceRequest) UnsetVirtualMachine() { + o.VirtualMachine.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableServiceRequest) SetName(v string) { + o.Name = &v +} + +// GetPorts returns the Ports field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetPorts() []int32 { + if o == nil || IsNil(o.Ports) { + var ret []int32 + return ret + } + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetPortsOk() ([]int32, bool) { + if o == nil || IsNil(o.Ports) { + return nil, false + } + return o.Ports, true +} + +// HasPorts returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasPorts() bool { + if o != nil && !IsNil(o.Ports) { + return true + } + + return false +} + +// SetPorts gets a reference to the given []int32 and assigns it to the Ports field. +func (o *PatchedWritableServiceRequest) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetProtocol() PatchedWritableServiceRequestProtocol { + if o == nil || IsNil(o.Protocol) { + var ret PatchedWritableServiceRequestProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetProtocolOk() (*PatchedWritableServiceRequestProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given PatchedWritableServiceRequestProtocol and assigns it to the Protocol field. +func (o *PatchedWritableServiceRequest) SetProtocol(v PatchedWritableServiceRequestProtocol) { + o.Protocol = &v +} + +// GetIpaddresses returns the Ipaddresses field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetIpaddresses() []int32 { + if o == nil || IsNil(o.Ipaddresses) { + var ret []int32 + return ret + } + return o.Ipaddresses +} + +// GetIpaddressesOk returns a tuple with the Ipaddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetIpaddressesOk() ([]int32, bool) { + if o == nil || IsNil(o.Ipaddresses) { + return nil, false + } + return o.Ipaddresses, true +} + +// HasIpaddresses returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasIpaddresses() bool { + if o != nil && !IsNil(o.Ipaddresses) { + return true + } + + return false +} + +// SetIpaddresses gets a reference to the given []int32 and assigns it to the Ipaddresses field. +func (o *PatchedWritableServiceRequest) SetIpaddresses(v []int32) { + o.Ipaddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableServiceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableServiceRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableServiceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableServiceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableServiceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableServiceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableServiceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableServiceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.VirtualMachine.IsSet() { + toSerialize["virtual_machine"] = o.VirtualMachine.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ports) { + toSerialize["ports"] = o.Ports + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Ipaddresses) { + toSerialize["ipaddresses"] = o.Ipaddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableServiceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableServiceRequest := _PatchedWritableServiceRequest{} + + err = json.Unmarshal(data, &varPatchedWritableServiceRequest) + + if err != nil { + return err + } + + *o = PatchedWritableServiceRequest(varPatchedWritableServiceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "ipaddresses") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableServiceRequest struct { + value *PatchedWritableServiceRequest + isSet bool +} + +func (v NullablePatchedWritableServiceRequest) Get() *PatchedWritableServiceRequest { + return v.value +} + +func (v *NullablePatchedWritableServiceRequest) Set(val *PatchedWritableServiceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableServiceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableServiceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableServiceRequest(val *PatchedWritableServiceRequest) *NullablePatchedWritableServiceRequest { + return &NullablePatchedWritableServiceRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableServiceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableServiceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_request_protocol.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_request_protocol.go new file mode 100644 index 00000000..55124384 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_request_protocol.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableServiceRequestProtocol * `tcp` - TCP * `udp` - UDP * `sctp` - SCTP +type PatchedWritableServiceRequestProtocol string + +// List of PatchedWritableServiceRequest_protocol +const ( + PATCHEDWRITABLESERVICEREQUESTPROTOCOL_TCP PatchedWritableServiceRequestProtocol = "tcp" + PATCHEDWRITABLESERVICEREQUESTPROTOCOL_UDP PatchedWritableServiceRequestProtocol = "udp" + PATCHEDWRITABLESERVICEREQUESTPROTOCOL_SCTP PatchedWritableServiceRequestProtocol = "sctp" +) + +// All allowed values of PatchedWritableServiceRequestProtocol enum +var AllowedPatchedWritableServiceRequestProtocolEnumValues = []PatchedWritableServiceRequestProtocol{ + "tcp", + "udp", + "sctp", +} + +func (v *PatchedWritableServiceRequestProtocol) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableServiceRequestProtocol(value) + for _, existing := range AllowedPatchedWritableServiceRequestProtocolEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableServiceRequestProtocol", value) +} + +// NewPatchedWritableServiceRequestProtocolFromValue returns a pointer to a valid PatchedWritableServiceRequestProtocol +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableServiceRequestProtocolFromValue(v string) (*PatchedWritableServiceRequestProtocol, error) { + ev := PatchedWritableServiceRequestProtocol(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableServiceRequestProtocol: valid values are %v", v, AllowedPatchedWritableServiceRequestProtocolEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableServiceRequestProtocol) IsValid() bool { + for _, existing := range AllowedPatchedWritableServiceRequestProtocolEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableServiceRequest_protocol value +func (v PatchedWritableServiceRequestProtocol) Ptr() *PatchedWritableServiceRequestProtocol { + return &v +} + +type NullablePatchedWritableServiceRequestProtocol struct { + value *PatchedWritableServiceRequestProtocol + isSet bool +} + +func (v NullablePatchedWritableServiceRequestProtocol) Get() *PatchedWritableServiceRequestProtocol { + return v.value +} + +func (v *NullablePatchedWritableServiceRequestProtocol) Set(val *PatchedWritableServiceRequestProtocol) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableServiceRequestProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableServiceRequestProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableServiceRequestProtocol(val *PatchedWritableServiceRequestProtocol) *NullablePatchedWritableServiceRequestProtocol { + return &NullablePatchedWritableServiceRequestProtocol{value: val, isSet: true} +} + +func (v NullablePatchedWritableServiceRequestProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableServiceRequestProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_template_request.go new file mode 100644 index 00000000..4c2ac56e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_service_template_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableServiceTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableServiceTemplateRequest{} + +// PatchedWritableServiceTemplateRequest Adds support for custom fields and tags. +type PatchedWritableServiceTemplateRequest struct { + Name *string `json:"name,omitempty"` + Ports []int32 `json:"ports,omitempty"` + Protocol *PatchedWritableServiceRequestProtocol `json:"protocol,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableServiceTemplateRequest PatchedWritableServiceTemplateRequest + +// NewPatchedWritableServiceTemplateRequest instantiates a new PatchedWritableServiceTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableServiceTemplateRequest() *PatchedWritableServiceTemplateRequest { + this := PatchedWritableServiceTemplateRequest{} + return &this +} + +// NewPatchedWritableServiceTemplateRequestWithDefaults instantiates a new PatchedWritableServiceTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableServiceTemplateRequestWithDefaults() *PatchedWritableServiceTemplateRequest { + this := PatchedWritableServiceTemplateRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableServiceTemplateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceTemplateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableServiceTemplateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableServiceTemplateRequest) SetName(v string) { + o.Name = &v +} + +// GetPorts returns the Ports field value if set, zero value otherwise. +func (o *PatchedWritableServiceTemplateRequest) GetPorts() []int32 { + if o == nil || IsNil(o.Ports) { + var ret []int32 + return ret + } + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceTemplateRequest) GetPortsOk() ([]int32, bool) { + if o == nil || IsNil(o.Ports) { + return nil, false + } + return o.Ports, true +} + +// HasPorts returns a boolean if a field has been set. +func (o *PatchedWritableServiceTemplateRequest) HasPorts() bool { + if o != nil && !IsNil(o.Ports) { + return true + } + + return false +} + +// SetPorts gets a reference to the given []int32 and assigns it to the Ports field. +func (o *PatchedWritableServiceTemplateRequest) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *PatchedWritableServiceTemplateRequest) GetProtocol() PatchedWritableServiceRequestProtocol { + if o == nil || IsNil(o.Protocol) { + var ret PatchedWritableServiceRequestProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceTemplateRequest) GetProtocolOk() (*PatchedWritableServiceRequestProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *PatchedWritableServiceTemplateRequest) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given PatchedWritableServiceRequestProtocol and assigns it to the Protocol field. +func (o *PatchedWritableServiceTemplateRequest) SetProtocol(v PatchedWritableServiceRequestProtocol) { + o.Protocol = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableServiceTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableServiceTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableServiceTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableServiceTemplateRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceTemplateRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableServiceTemplateRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableServiceTemplateRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableServiceTemplateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceTemplateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableServiceTemplateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableServiceTemplateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableServiceTemplateRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableServiceTemplateRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableServiceTemplateRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableServiceTemplateRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableServiceTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableServiceTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ports) { + toSerialize["ports"] = o.Ports + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableServiceTemplateRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableServiceTemplateRequest := _PatchedWritableServiceTemplateRequest{} + + err = json.Unmarshal(data, &varPatchedWritableServiceTemplateRequest) + + if err != nil { + return err + } + + *o = PatchedWritableServiceTemplateRequest(varPatchedWritableServiceTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableServiceTemplateRequest struct { + value *PatchedWritableServiceTemplateRequest + isSet bool +} + +func (v NullablePatchedWritableServiceTemplateRequest) Get() *PatchedWritableServiceTemplateRequest { + return v.value +} + +func (v *NullablePatchedWritableServiceTemplateRequest) Set(val *PatchedWritableServiceTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableServiceTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableServiceTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableServiceTemplateRequest(val *PatchedWritableServiceTemplateRequest) *NullablePatchedWritableServiceTemplateRequest { + return &NullablePatchedWritableServiceTemplateRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableServiceTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableServiceTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_site_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_site_group_request.go new file mode 100644 index 00000000..678d0b0b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_site_group_request.go @@ -0,0 +1,349 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableSiteGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableSiteGroupRequest{} + +// PatchedWritableSiteGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type PatchedWritableSiteGroupRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableSiteGroupRequest PatchedWritableSiteGroupRequest + +// NewPatchedWritableSiteGroupRequest instantiates a new PatchedWritableSiteGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableSiteGroupRequest() *PatchedWritableSiteGroupRequest { + this := PatchedWritableSiteGroupRequest{} + return &this +} + +// NewPatchedWritableSiteGroupRequestWithDefaults instantiates a new PatchedWritableSiteGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableSiteGroupRequestWithDefaults() *PatchedWritableSiteGroupRequest { + this := PatchedWritableSiteGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableSiteGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableSiteGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableSiteGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableSiteGroupRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteGroupRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableSiteGroupRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableSiteGroupRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableSiteGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableSiteGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableSiteGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableSiteGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableSiteGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableSiteGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableSiteGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableSiteGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableSiteGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableSiteGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableSiteGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableSiteGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableSiteGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableSiteGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableSiteGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableSiteGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableSiteGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableSiteGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableSiteGroupRequest := _PatchedWritableSiteGroupRequest{} + + err = json.Unmarshal(data, &varPatchedWritableSiteGroupRequest) + + if err != nil { + return err + } + + *o = PatchedWritableSiteGroupRequest(varPatchedWritableSiteGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableSiteGroupRequest struct { + value *PatchedWritableSiteGroupRequest + isSet bool +} + +func (v NullablePatchedWritableSiteGroupRequest) Get() *PatchedWritableSiteGroupRequest { + return v.value +} + +func (v *NullablePatchedWritableSiteGroupRequest) Set(val *PatchedWritableSiteGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableSiteGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableSiteGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableSiteGroupRequest(val *PatchedWritableSiteGroupRequest) *NullablePatchedWritableSiteGroupRequest { + return &NullablePatchedWritableSiteGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableSiteGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableSiteGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_site_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_site_request.go new file mode 100644 index 00000000..ad0c5e68 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_site_request.go @@ -0,0 +1,817 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableSiteRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableSiteRequest{} + +// PatchedWritableSiteRequest Adds support for custom fields and tags. +type PatchedWritableSiteRequest struct { + // Full name of the site + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Status *LocationStatusValue `json:"status,omitempty"` + Region NullableInt32 `json:"region,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + // Local facility ID or description + Facility *string `json:"facility,omitempty"` + TimeZone NullableString `json:"time_zone,omitempty"` + Description *string `json:"description,omitempty"` + // Physical location of the building + PhysicalAddress *string `json:"physical_address,omitempty"` + // If different from the physical address + ShippingAddress *string `json:"shipping_address,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableSiteRequest PatchedWritableSiteRequest + +// NewPatchedWritableSiteRequest instantiates a new PatchedWritableSiteRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableSiteRequest() *PatchedWritableSiteRequest { + this := PatchedWritableSiteRequest{} + return &this +} + +// NewPatchedWritableSiteRequestWithDefaults instantiates a new PatchedWritableSiteRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableSiteRequestWithDefaults() *PatchedWritableSiteRequest { + this := PatchedWritableSiteRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableSiteRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableSiteRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetStatus() LocationStatusValue { + if o == nil || IsNil(o.Status) { + var ret LocationStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetStatusOk() (*LocationStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatusValue and assigns it to the Status field. +func (o *PatchedWritableSiteRequest) SetStatus(v LocationStatusValue) { + o.Status = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableSiteRequest) GetRegion() int32 { + if o == nil || IsNil(o.Region.Get()) { + var ret int32 + return ret + } + return *o.Region.Get() +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableSiteRequest) GetRegionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Region.Get(), o.Region.IsSet() +} + +// HasRegion returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasRegion() bool { + if o != nil && o.Region.IsSet() { + return true + } + + return false +} + +// SetRegion gets a reference to the given NullableInt32 and assigns it to the Region field. +func (o *PatchedWritableSiteRequest) SetRegion(v int32) { + o.Region.Set(&v) +} + +// SetRegionNil sets the value for Region to be an explicit nil +func (o *PatchedWritableSiteRequest) SetRegionNil() { + o.Region.Set(nil) +} + +// UnsetRegion ensures that no value is present for Region, not even an explicit nil +func (o *PatchedWritableSiteRequest) UnsetRegion() { + o.Region.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableSiteRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableSiteRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *PatchedWritableSiteRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedWritableSiteRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedWritableSiteRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableSiteRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableSiteRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableSiteRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableSiteRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableSiteRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *PatchedWritableSiteRequest) SetFacility(v string) { + o.Facility = &v +} + +// GetTimeZone returns the TimeZone field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableSiteRequest) GetTimeZone() string { + if o == nil || IsNil(o.TimeZone.Get()) { + var ret string + return ret + } + return *o.TimeZone.Get() +} + +// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableSiteRequest) GetTimeZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TimeZone.Get(), o.TimeZone.IsSet() +} + +// HasTimeZone returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasTimeZone() bool { + if o != nil && o.TimeZone.IsSet() { + return true + } + + return false +} + +// SetTimeZone gets a reference to the given NullableString and assigns it to the TimeZone field. +func (o *PatchedWritableSiteRequest) SetTimeZone(v string) { + o.TimeZone.Set(&v) +} + +// SetTimeZoneNil sets the value for TimeZone to be an explicit nil +func (o *PatchedWritableSiteRequest) SetTimeZoneNil() { + o.TimeZone.Set(nil) +} + +// UnsetTimeZone ensures that no value is present for TimeZone, not even an explicit nil +func (o *PatchedWritableSiteRequest) UnsetTimeZone() { + o.TimeZone.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableSiteRequest) SetDescription(v string) { + o.Description = &v +} + +// GetPhysicalAddress returns the PhysicalAddress field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetPhysicalAddress() string { + if o == nil || IsNil(o.PhysicalAddress) { + var ret string + return ret + } + return *o.PhysicalAddress +} + +// GetPhysicalAddressOk returns a tuple with the PhysicalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetPhysicalAddressOk() (*string, bool) { + if o == nil || IsNil(o.PhysicalAddress) { + return nil, false + } + return o.PhysicalAddress, true +} + +// HasPhysicalAddress returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasPhysicalAddress() bool { + if o != nil && !IsNil(o.PhysicalAddress) { + return true + } + + return false +} + +// SetPhysicalAddress gets a reference to the given string and assigns it to the PhysicalAddress field. +func (o *PatchedWritableSiteRequest) SetPhysicalAddress(v string) { + o.PhysicalAddress = &v +} + +// GetShippingAddress returns the ShippingAddress field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetShippingAddress() string { + if o == nil || IsNil(o.ShippingAddress) { + var ret string + return ret + } + return *o.ShippingAddress +} + +// GetShippingAddressOk returns a tuple with the ShippingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetShippingAddressOk() (*string, bool) { + if o == nil || IsNil(o.ShippingAddress) { + return nil, false + } + return o.ShippingAddress, true +} + +// HasShippingAddress returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasShippingAddress() bool { + if o != nil && !IsNil(o.ShippingAddress) { + return true + } + + return false +} + +// SetShippingAddress gets a reference to the given string and assigns it to the ShippingAddress field. +func (o *PatchedWritableSiteRequest) SetShippingAddress(v string) { + o.ShippingAddress = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableSiteRequest) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableSiteRequest) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *PatchedWritableSiteRequest) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *PatchedWritableSiteRequest) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *PatchedWritableSiteRequest) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableSiteRequest) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableSiteRequest) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *PatchedWritableSiteRequest) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *PatchedWritableSiteRequest) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *PatchedWritableSiteRequest) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableSiteRequest) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *PatchedWritableSiteRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableSiteRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableSiteRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableSiteRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableSiteRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableSiteRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableSiteRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableSiteRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Region.IsSet() { + toSerialize["region"] = o.Region.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if o.TimeZone.IsSet() { + toSerialize["time_zone"] = o.TimeZone.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PhysicalAddress) { + toSerialize["physical_address"] = o.PhysicalAddress + } + if !IsNil(o.ShippingAddress) { + toSerialize["shipping_address"] = o.ShippingAddress + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableSiteRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableSiteRequest := _PatchedWritableSiteRequest{} + + err = json.Unmarshal(data, &varPatchedWritableSiteRequest) + + if err != nil { + return err + } + + *o = PatchedWritableSiteRequest(varPatchedWritableSiteRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "status") + delete(additionalProperties, "region") + delete(additionalProperties, "group") + delete(additionalProperties, "tenant") + delete(additionalProperties, "facility") + delete(additionalProperties, "time_zone") + delete(additionalProperties, "description") + delete(additionalProperties, "physical_address") + delete(additionalProperties, "shipping_address") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableSiteRequest struct { + value *PatchedWritableSiteRequest + isSet bool +} + +func (v NullablePatchedWritableSiteRequest) Get() *PatchedWritableSiteRequest { + return v.value +} + +func (v *NullablePatchedWritableSiteRequest) Set(val *PatchedWritableSiteRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableSiteRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableSiteRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableSiteRequest(val *PatchedWritableSiteRequest) *NullablePatchedWritableSiteRequest { + return &NullablePatchedWritableSiteRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableSiteRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableSiteRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tenant_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tenant_group_request.go new file mode 100644 index 00000000..f86ca78b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tenant_group_request.go @@ -0,0 +1,349 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableTenantGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableTenantGroupRequest{} + +// PatchedWritableTenantGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type PatchedWritableTenantGroupRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableTenantGroupRequest PatchedWritableTenantGroupRequest + +// NewPatchedWritableTenantGroupRequest instantiates a new PatchedWritableTenantGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableTenantGroupRequest() *PatchedWritableTenantGroupRequest { + this := PatchedWritableTenantGroupRequest{} + return &this +} + +// NewPatchedWritableTenantGroupRequestWithDefaults instantiates a new PatchedWritableTenantGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableTenantGroupRequestWithDefaults() *PatchedWritableTenantGroupRequest { + this := PatchedWritableTenantGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableTenantGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableTenantGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableTenantGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableTenantGroupRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantGroupRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableTenantGroupRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableTenantGroupRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTenantGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTenantGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableTenantGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableTenantGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableTenantGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableTenantGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableTenantGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableTenantGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableTenantGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableTenantGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableTenantGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableTenantGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableTenantGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableTenantGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableTenantGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableTenantGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableTenantGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableTenantGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableTenantGroupRequest := _PatchedWritableTenantGroupRequest{} + + err = json.Unmarshal(data, &varPatchedWritableTenantGroupRequest) + + if err != nil { + return err + } + + *o = PatchedWritableTenantGroupRequest(varPatchedWritableTenantGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableTenantGroupRequest struct { + value *PatchedWritableTenantGroupRequest + isSet bool +} + +func (v NullablePatchedWritableTenantGroupRequest) Get() *PatchedWritableTenantGroupRequest { + return v.value +} + +func (v *NullablePatchedWritableTenantGroupRequest) Set(val *PatchedWritableTenantGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTenantGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTenantGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTenantGroupRequest(val *PatchedWritableTenantGroupRequest) *NullablePatchedWritableTenantGroupRequest { + return &NullablePatchedWritableTenantGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableTenantGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTenantGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tenant_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tenant_request.go new file mode 100644 index 00000000..976ee48f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tenant_request.go @@ -0,0 +1,386 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableTenantRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableTenantRequest{} + +// PatchedWritableTenantRequest Adds support for custom fields and tags. +type PatchedWritableTenantRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableTenantRequest PatchedWritableTenantRequest + +// NewPatchedWritableTenantRequest instantiates a new PatchedWritableTenantRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableTenantRequest() *PatchedWritableTenantRequest { + this := PatchedWritableTenantRequest{} + return &this +} + +// NewPatchedWritableTenantRequestWithDefaults instantiates a new PatchedWritableTenantRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableTenantRequestWithDefaults() *PatchedWritableTenantRequest { + this := PatchedWritableTenantRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableTenantRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableTenantRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableTenantRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableTenantRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableTenantRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableTenantRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTenantRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTenantRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableTenantRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *PatchedWritableTenantRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedWritableTenantRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedWritableTenantRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableTenantRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableTenantRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableTenantRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableTenantRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableTenantRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableTenantRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableTenantRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableTenantRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableTenantRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableTenantRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTenantRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableTenantRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableTenantRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableTenantRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableTenantRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableTenantRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableTenantRequest := _PatchedWritableTenantRequest{} + + err = json.Unmarshal(data, &varPatchedWritableTenantRequest) + + if err != nil { + return err + } + + *o = PatchedWritableTenantRequest(varPatchedWritableTenantRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "group") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableTenantRequest struct { + value *PatchedWritableTenantRequest + isSet bool +} + +func (v NullablePatchedWritableTenantRequest) Get() *PatchedWritableTenantRequest { + return v.value +} + +func (v *NullablePatchedWritableTenantRequest) Set(val *PatchedWritableTenantRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTenantRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTenantRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTenantRequest(val *PatchedWritableTenantRequest) *NullablePatchedWritableTenantRequest { + return &NullablePatchedWritableTenantRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableTenantRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTenantRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_token_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_token_request.go new file mode 100644 index 00000000..d8e92c3c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_token_request.go @@ -0,0 +1,362 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedWritableTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableTokenRequest{} + +// PatchedWritableTokenRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableTokenRequest struct { + User *int32 `json:"user,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + LastUsed NullableTime `json:"last_used,omitempty"` + Key *string `json:"key,omitempty"` + // Permit create/update/delete operations using this key + WriteEnabled *bool `json:"write_enabled,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableTokenRequest PatchedWritableTokenRequest + +// NewPatchedWritableTokenRequest instantiates a new PatchedWritableTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableTokenRequest() *PatchedWritableTokenRequest { + this := PatchedWritableTokenRequest{} + return &this +} + +// NewPatchedWritableTokenRequestWithDefaults instantiates a new PatchedWritableTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableTokenRequestWithDefaults() *PatchedWritableTokenRequest { + this := PatchedWritableTokenRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedWritableTokenRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTokenRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedWritableTokenRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedWritableTokenRequest) SetUser(v int32) { + o.User = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTokenRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *PatchedWritableTokenRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *PatchedWritableTokenRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *PatchedWritableTokenRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *PatchedWritableTokenRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetLastUsed returns the LastUsed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTokenRequest) GetLastUsed() time.Time { + if o == nil || IsNil(o.LastUsed.Get()) { + var ret time.Time + return ret + } + return *o.LastUsed.Get() +} + +// GetLastUsedOk returns a tuple with the LastUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTokenRequest) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUsed.Get(), o.LastUsed.IsSet() +} + +// HasLastUsed returns a boolean if a field has been set. +func (o *PatchedWritableTokenRequest) HasLastUsed() bool { + if o != nil && o.LastUsed.IsSet() { + return true + } + + return false +} + +// SetLastUsed gets a reference to the given NullableTime and assigns it to the LastUsed field. +func (o *PatchedWritableTokenRequest) SetLastUsed(v time.Time) { + o.LastUsed.Set(&v) +} + +// SetLastUsedNil sets the value for LastUsed to be an explicit nil +func (o *PatchedWritableTokenRequest) SetLastUsedNil() { + o.LastUsed.Set(nil) +} + +// UnsetLastUsed ensures that no value is present for LastUsed, not even an explicit nil +func (o *PatchedWritableTokenRequest) UnsetLastUsed() { + o.LastUsed.Unset() +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *PatchedWritableTokenRequest) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTokenRequest) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *PatchedWritableTokenRequest) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *PatchedWritableTokenRequest) SetKey(v string) { + o.Key = &v +} + +// GetWriteEnabled returns the WriteEnabled field value if set, zero value otherwise. +func (o *PatchedWritableTokenRequest) GetWriteEnabled() bool { + if o == nil || IsNil(o.WriteEnabled) { + var ret bool + return ret + } + return *o.WriteEnabled +} + +// GetWriteEnabledOk returns a tuple with the WriteEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTokenRequest) GetWriteEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.WriteEnabled) { + return nil, false + } + return o.WriteEnabled, true +} + +// HasWriteEnabled returns a boolean if a field has been set. +func (o *PatchedWritableTokenRequest) HasWriteEnabled() bool { + if o != nil && !IsNil(o.WriteEnabled) { + return true + } + + return false +} + +// SetWriteEnabled gets a reference to the given bool and assigns it to the WriteEnabled field. +func (o *PatchedWritableTokenRequest) SetWriteEnabled(v bool) { + o.WriteEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableTokenRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTokenRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableTokenRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableTokenRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedWritableTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if o.LastUsed.IsSet() { + toSerialize["last_used"] = o.LastUsed.Get() + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.WriteEnabled) { + toSerialize["write_enabled"] = o.WriteEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableTokenRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableTokenRequest := _PatchedWritableTokenRequest{} + + err = json.Unmarshal(data, &varPatchedWritableTokenRequest) + + if err != nil { + return err + } + + *o = PatchedWritableTokenRequest(varPatchedWritableTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "expires") + delete(additionalProperties, "last_used") + delete(additionalProperties, "key") + delete(additionalProperties, "write_enabled") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableTokenRequest struct { + value *PatchedWritableTokenRequest + isSet bool +} + +func (v NullablePatchedWritableTokenRequest) Get() *PatchedWritableTokenRequest { + return v.value +} + +func (v *NullablePatchedWritableTokenRequest) Set(val *PatchedWritableTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTokenRequest(val *PatchedWritableTokenRequest) *NullablePatchedWritableTokenRequest { + return &NullablePatchedWritableTokenRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request.go new file mode 100644 index 00000000..dc478034 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request.go @@ -0,0 +1,567 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableTunnelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableTunnelRequest{} + +// PatchedWritableTunnelRequest Adds support for custom fields and tags. +type PatchedWritableTunnelRequest struct { + Name *string `json:"name,omitempty"` + Status *PatchedWritableTunnelRequestStatus `json:"status,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Encapsulation *PatchedWritableTunnelRequestEncapsulation `json:"encapsulation,omitempty"` + IpsecProfile NullableInt32 `json:"ipsec_profile,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + TunnelId NullableInt64 `json:"tunnel_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableTunnelRequest PatchedWritableTunnelRequest + +// NewPatchedWritableTunnelRequest instantiates a new PatchedWritableTunnelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableTunnelRequest() *PatchedWritableTunnelRequest { + this := PatchedWritableTunnelRequest{} + return &this +} + +// NewPatchedWritableTunnelRequestWithDefaults instantiates a new PatchedWritableTunnelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableTunnelRequestWithDefaults() *PatchedWritableTunnelRequest { + this := PatchedWritableTunnelRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableTunnelRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableTunnelRequest) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableTunnelRequest) GetStatus() PatchedWritableTunnelRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableTunnelRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelRequest) GetStatusOk() (*PatchedWritableTunnelRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableTunnelRequestStatus and assigns it to the Status field. +func (o *PatchedWritableTunnelRequest) SetStatus(v PatchedWritableTunnelRequestStatus) { + o.Status = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTunnelRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTunnelRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *PatchedWritableTunnelRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedWritableTunnelRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedWritableTunnelRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetEncapsulation returns the Encapsulation field value if set, zero value otherwise. +func (o *PatchedWritableTunnelRequest) GetEncapsulation() PatchedWritableTunnelRequestEncapsulation { + if o == nil || IsNil(o.Encapsulation) { + var ret PatchedWritableTunnelRequestEncapsulation + return ret + } + return *o.Encapsulation +} + +// GetEncapsulationOk returns a tuple with the Encapsulation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelRequest) GetEncapsulationOk() (*PatchedWritableTunnelRequestEncapsulation, bool) { + if o == nil || IsNil(o.Encapsulation) { + return nil, false + } + return o.Encapsulation, true +} + +// HasEncapsulation returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasEncapsulation() bool { + if o != nil && !IsNil(o.Encapsulation) { + return true + } + + return false +} + +// SetEncapsulation gets a reference to the given PatchedWritableTunnelRequestEncapsulation and assigns it to the Encapsulation field. +func (o *PatchedWritableTunnelRequest) SetEncapsulation(v PatchedWritableTunnelRequestEncapsulation) { + o.Encapsulation = &v +} + +// GetIpsecProfile returns the IpsecProfile field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTunnelRequest) GetIpsecProfile() int32 { + if o == nil || IsNil(o.IpsecProfile.Get()) { + var ret int32 + return ret + } + return *o.IpsecProfile.Get() +} + +// GetIpsecProfileOk returns a tuple with the IpsecProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTunnelRequest) GetIpsecProfileOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.IpsecProfile.Get(), o.IpsecProfile.IsSet() +} + +// HasIpsecProfile returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasIpsecProfile() bool { + if o != nil && o.IpsecProfile.IsSet() { + return true + } + + return false +} + +// SetIpsecProfile gets a reference to the given NullableInt32 and assigns it to the IpsecProfile field. +func (o *PatchedWritableTunnelRequest) SetIpsecProfile(v int32) { + o.IpsecProfile.Set(&v) +} + +// SetIpsecProfileNil sets the value for IpsecProfile to be an explicit nil +func (o *PatchedWritableTunnelRequest) SetIpsecProfileNil() { + o.IpsecProfile.Set(nil) +} + +// UnsetIpsecProfile ensures that no value is present for IpsecProfile, not even an explicit nil +func (o *PatchedWritableTunnelRequest) UnsetIpsecProfile() { + o.IpsecProfile.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTunnelRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTunnelRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableTunnelRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableTunnelRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableTunnelRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTunnelId returns the TunnelId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTunnelRequest) GetTunnelId() int64 { + if o == nil || IsNil(o.TunnelId.Get()) { + var ret int64 + return ret + } + return *o.TunnelId.Get() +} + +// GetTunnelIdOk returns a tuple with the TunnelId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTunnelRequest) GetTunnelIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TunnelId.Get(), o.TunnelId.IsSet() +} + +// HasTunnelId returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasTunnelId() bool { + if o != nil && o.TunnelId.IsSet() { + return true + } + + return false +} + +// SetTunnelId gets a reference to the given NullableInt64 and assigns it to the TunnelId field. +func (o *PatchedWritableTunnelRequest) SetTunnelId(v int64) { + o.TunnelId.Set(&v) +} + +// SetTunnelIdNil sets the value for TunnelId to be an explicit nil +func (o *PatchedWritableTunnelRequest) SetTunnelIdNil() { + o.TunnelId.Set(nil) +} + +// UnsetTunnelId ensures that no value is present for TunnelId, not even an explicit nil +func (o *PatchedWritableTunnelRequest) UnsetTunnelId() { + o.TunnelId.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableTunnelRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableTunnelRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableTunnelRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableTunnelRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableTunnelRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableTunnelRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableTunnelRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableTunnelRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableTunnelRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableTunnelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableTunnelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Encapsulation) { + toSerialize["encapsulation"] = o.Encapsulation + } + if o.IpsecProfile.IsSet() { + toSerialize["ipsec_profile"] = o.IpsecProfile.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.TunnelId.IsSet() { + toSerialize["tunnel_id"] = o.TunnelId.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableTunnelRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableTunnelRequest := _PatchedWritableTunnelRequest{} + + err = json.Unmarshal(data, &varPatchedWritableTunnelRequest) + + if err != nil { + return err + } + + *o = PatchedWritableTunnelRequest(varPatchedWritableTunnelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "group") + delete(additionalProperties, "encapsulation") + delete(additionalProperties, "ipsec_profile") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tunnel_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableTunnelRequest struct { + value *PatchedWritableTunnelRequest + isSet bool +} + +func (v NullablePatchedWritableTunnelRequest) Get() *PatchedWritableTunnelRequest { + return v.value +} + +func (v *NullablePatchedWritableTunnelRequest) Set(val *PatchedWritableTunnelRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTunnelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTunnelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTunnelRequest(val *PatchedWritableTunnelRequest) *NullablePatchedWritableTunnelRequest { + return &NullablePatchedWritableTunnelRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableTunnelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTunnelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request_encapsulation.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request_encapsulation.go new file mode 100644 index 00000000..4aa0e14c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request_encapsulation.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableTunnelRequestEncapsulation * `ipsec-transport` - IPsec - Transport * `ipsec-tunnel` - IPsec - Tunnel * `ip-ip` - IP-in-IP * `gre` - GRE +type PatchedWritableTunnelRequestEncapsulation string + +// List of PatchedWritableTunnelRequest_encapsulation +const ( + PATCHEDWRITABLETUNNELREQUESTENCAPSULATION_IPSEC_TRANSPORT PatchedWritableTunnelRequestEncapsulation = "ipsec-transport" + PATCHEDWRITABLETUNNELREQUESTENCAPSULATION_IPSEC_TUNNEL PatchedWritableTunnelRequestEncapsulation = "ipsec-tunnel" + PATCHEDWRITABLETUNNELREQUESTENCAPSULATION_IP_IP PatchedWritableTunnelRequestEncapsulation = "ip-ip" + PATCHEDWRITABLETUNNELREQUESTENCAPSULATION_GRE PatchedWritableTunnelRequestEncapsulation = "gre" +) + +// All allowed values of PatchedWritableTunnelRequestEncapsulation enum +var AllowedPatchedWritableTunnelRequestEncapsulationEnumValues = []PatchedWritableTunnelRequestEncapsulation{ + "ipsec-transport", + "ipsec-tunnel", + "ip-ip", + "gre", +} + +func (v *PatchedWritableTunnelRequestEncapsulation) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableTunnelRequestEncapsulation(value) + for _, existing := range AllowedPatchedWritableTunnelRequestEncapsulationEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableTunnelRequestEncapsulation", value) +} + +// NewPatchedWritableTunnelRequestEncapsulationFromValue returns a pointer to a valid PatchedWritableTunnelRequestEncapsulation +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableTunnelRequestEncapsulationFromValue(v string) (*PatchedWritableTunnelRequestEncapsulation, error) { + ev := PatchedWritableTunnelRequestEncapsulation(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableTunnelRequestEncapsulation: valid values are %v", v, AllowedPatchedWritableTunnelRequestEncapsulationEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableTunnelRequestEncapsulation) IsValid() bool { + for _, existing := range AllowedPatchedWritableTunnelRequestEncapsulationEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableTunnelRequest_encapsulation value +func (v PatchedWritableTunnelRequestEncapsulation) Ptr() *PatchedWritableTunnelRequestEncapsulation { + return &v +} + +type NullablePatchedWritableTunnelRequestEncapsulation struct { + value *PatchedWritableTunnelRequestEncapsulation + isSet bool +} + +func (v NullablePatchedWritableTunnelRequestEncapsulation) Get() *PatchedWritableTunnelRequestEncapsulation { + return v.value +} + +func (v *NullablePatchedWritableTunnelRequestEncapsulation) Set(val *PatchedWritableTunnelRequestEncapsulation) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTunnelRequestEncapsulation) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTunnelRequestEncapsulation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTunnelRequestEncapsulation(val *PatchedWritableTunnelRequestEncapsulation) *NullablePatchedWritableTunnelRequestEncapsulation { + return &NullablePatchedWritableTunnelRequestEncapsulation{value: val, isSet: true} +} + +func (v NullablePatchedWritableTunnelRequestEncapsulation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTunnelRequestEncapsulation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request_status.go new file mode 100644 index 00000000..e850f2e0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_request_status.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableTunnelRequestStatus * `planned` - Planned * `active` - Active * `disabled` - Disabled +type PatchedWritableTunnelRequestStatus string + +// List of PatchedWritableTunnelRequest_status +const ( + PATCHEDWRITABLETUNNELREQUESTSTATUS_PLANNED PatchedWritableTunnelRequestStatus = "planned" + PATCHEDWRITABLETUNNELREQUESTSTATUS_ACTIVE PatchedWritableTunnelRequestStatus = "active" + PATCHEDWRITABLETUNNELREQUESTSTATUS_DISABLED PatchedWritableTunnelRequestStatus = "disabled" +) + +// All allowed values of PatchedWritableTunnelRequestStatus enum +var AllowedPatchedWritableTunnelRequestStatusEnumValues = []PatchedWritableTunnelRequestStatus{ + "planned", + "active", + "disabled", +} + +func (v *PatchedWritableTunnelRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableTunnelRequestStatus(value) + for _, existing := range AllowedPatchedWritableTunnelRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableTunnelRequestStatus", value) +} + +// NewPatchedWritableTunnelRequestStatusFromValue returns a pointer to a valid PatchedWritableTunnelRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableTunnelRequestStatusFromValue(v string) (*PatchedWritableTunnelRequestStatus, error) { + ev := PatchedWritableTunnelRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableTunnelRequestStatus: valid values are %v", v, AllowedPatchedWritableTunnelRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableTunnelRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritableTunnelRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableTunnelRequest_status value +func (v PatchedWritableTunnelRequestStatus) Ptr() *PatchedWritableTunnelRequestStatus { + return &v +} + +type NullablePatchedWritableTunnelRequestStatus struct { + value *PatchedWritableTunnelRequestStatus + isSet bool +} + +func (v NullablePatchedWritableTunnelRequestStatus) Get() *PatchedWritableTunnelRequestStatus { + return v.value +} + +func (v *NullablePatchedWritableTunnelRequestStatus) Set(val *PatchedWritableTunnelRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTunnelRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTunnelRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTunnelRequestStatus(val *PatchedWritableTunnelRequestStatus) *NullablePatchedWritableTunnelRequestStatus { + return &NullablePatchedWritableTunnelRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritableTunnelRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTunnelRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_termination_request.go new file mode 100644 index 00000000..8e38fef9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_termination_request.go @@ -0,0 +1,397 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableTunnelTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableTunnelTerminationRequest{} + +// PatchedWritableTunnelTerminationRequest Adds support for custom fields and tags. +type PatchedWritableTunnelTerminationRequest struct { + Tunnel *int32 `json:"tunnel,omitempty"` + Role *PatchedWritableTunnelTerminationRequestRole `json:"role,omitempty"` + TerminationType *string `json:"termination_type,omitempty"` + TerminationId NullableInt64 `json:"termination_id,omitempty"` + OutsideIp NullableInt32 `json:"outside_ip,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableTunnelTerminationRequest PatchedWritableTunnelTerminationRequest + +// NewPatchedWritableTunnelTerminationRequest instantiates a new PatchedWritableTunnelTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableTunnelTerminationRequest() *PatchedWritableTunnelTerminationRequest { + this := PatchedWritableTunnelTerminationRequest{} + return &this +} + +// NewPatchedWritableTunnelTerminationRequestWithDefaults instantiates a new PatchedWritableTunnelTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableTunnelTerminationRequestWithDefaults() *PatchedWritableTunnelTerminationRequest { + this := PatchedWritableTunnelTerminationRequest{} + return &this +} + +// GetTunnel returns the Tunnel field value if set, zero value otherwise. +func (o *PatchedWritableTunnelTerminationRequest) GetTunnel() int32 { + if o == nil || IsNil(o.Tunnel) { + var ret int32 + return ret + } + return *o.Tunnel +} + +// GetTunnelOk returns a tuple with the Tunnel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelTerminationRequest) GetTunnelOk() (*int32, bool) { + if o == nil || IsNil(o.Tunnel) { + return nil, false + } + return o.Tunnel, true +} + +// HasTunnel returns a boolean if a field has been set. +func (o *PatchedWritableTunnelTerminationRequest) HasTunnel() bool { + if o != nil && !IsNil(o.Tunnel) { + return true + } + + return false +} + +// SetTunnel gets a reference to the given int32 and assigns it to the Tunnel field. +func (o *PatchedWritableTunnelTerminationRequest) SetTunnel(v int32) { + o.Tunnel = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *PatchedWritableTunnelTerminationRequest) GetRole() PatchedWritableTunnelTerminationRequestRole { + if o == nil || IsNil(o.Role) { + var ret PatchedWritableTunnelTerminationRequestRole + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelTerminationRequest) GetRoleOk() (*PatchedWritableTunnelTerminationRequestRole, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableTunnelTerminationRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given PatchedWritableTunnelTerminationRequestRole and assigns it to the Role field. +func (o *PatchedWritableTunnelTerminationRequest) SetRole(v PatchedWritableTunnelTerminationRequestRole) { + o.Role = &v +} + +// GetTerminationType returns the TerminationType field value if set, zero value otherwise. +func (o *PatchedWritableTunnelTerminationRequest) GetTerminationType() string { + if o == nil || IsNil(o.TerminationType) { + var ret string + return ret + } + return *o.TerminationType +} + +// GetTerminationTypeOk returns a tuple with the TerminationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelTerminationRequest) GetTerminationTypeOk() (*string, bool) { + if o == nil || IsNil(o.TerminationType) { + return nil, false + } + return o.TerminationType, true +} + +// HasTerminationType returns a boolean if a field has been set. +func (o *PatchedWritableTunnelTerminationRequest) HasTerminationType() bool { + if o != nil && !IsNil(o.TerminationType) { + return true + } + + return false +} + +// SetTerminationType gets a reference to the given string and assigns it to the TerminationType field. +func (o *PatchedWritableTunnelTerminationRequest) SetTerminationType(v string) { + o.TerminationType = &v +} + +// GetTerminationId returns the TerminationId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTunnelTerminationRequest) GetTerminationId() int64 { + if o == nil || IsNil(o.TerminationId.Get()) { + var ret int64 + return ret + } + return *o.TerminationId.Get() +} + +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTunnelTerminationRequest) GetTerminationIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TerminationId.Get(), o.TerminationId.IsSet() +} + +// HasTerminationId returns a boolean if a field has been set. +func (o *PatchedWritableTunnelTerminationRequest) HasTerminationId() bool { + if o != nil && o.TerminationId.IsSet() { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given NullableInt64 and assigns it to the TerminationId field. +func (o *PatchedWritableTunnelTerminationRequest) SetTerminationId(v int64) { + o.TerminationId.Set(&v) +} + +// SetTerminationIdNil sets the value for TerminationId to be an explicit nil +func (o *PatchedWritableTunnelTerminationRequest) SetTerminationIdNil() { + o.TerminationId.Set(nil) +} + +// UnsetTerminationId ensures that no value is present for TerminationId, not even an explicit nil +func (o *PatchedWritableTunnelTerminationRequest) UnsetTerminationId() { + o.TerminationId.Unset() +} + +// GetOutsideIp returns the OutsideIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableTunnelTerminationRequest) GetOutsideIp() int32 { + if o == nil || IsNil(o.OutsideIp.Get()) { + var ret int32 + return ret + } + return *o.OutsideIp.Get() +} + +// GetOutsideIpOk returns a tuple with the OutsideIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableTunnelTerminationRequest) GetOutsideIpOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OutsideIp.Get(), o.OutsideIp.IsSet() +} + +// HasOutsideIp returns a boolean if a field has been set. +func (o *PatchedWritableTunnelTerminationRequest) HasOutsideIp() bool { + if o != nil && o.OutsideIp.IsSet() { + return true + } + + return false +} + +// SetOutsideIp gets a reference to the given NullableInt32 and assigns it to the OutsideIp field. +func (o *PatchedWritableTunnelTerminationRequest) SetOutsideIp(v int32) { + o.OutsideIp.Set(&v) +} + +// SetOutsideIpNil sets the value for OutsideIp to be an explicit nil +func (o *PatchedWritableTunnelTerminationRequest) SetOutsideIpNil() { + o.OutsideIp.Set(nil) +} + +// UnsetOutsideIp ensures that no value is present for OutsideIp, not even an explicit nil +func (o *PatchedWritableTunnelTerminationRequest) UnsetOutsideIp() { + o.OutsideIp.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableTunnelTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableTunnelTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableTunnelTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableTunnelTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableTunnelTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableTunnelTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableTunnelTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableTunnelTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableTunnelTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Tunnel) { + toSerialize["tunnel"] = o.Tunnel + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.TerminationType) { + toSerialize["termination_type"] = o.TerminationType + } + if o.TerminationId.IsSet() { + toSerialize["termination_id"] = o.TerminationId.Get() + } + if o.OutsideIp.IsSet() { + toSerialize["outside_ip"] = o.OutsideIp.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableTunnelTerminationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableTunnelTerminationRequest := _PatchedWritableTunnelTerminationRequest{} + + err = json.Unmarshal(data, &varPatchedWritableTunnelTerminationRequest) + + if err != nil { + return err + } + + *o = PatchedWritableTunnelTerminationRequest(varPatchedWritableTunnelTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tunnel") + delete(additionalProperties, "role") + delete(additionalProperties, "termination_type") + delete(additionalProperties, "termination_id") + delete(additionalProperties, "outside_ip") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableTunnelTerminationRequest struct { + value *PatchedWritableTunnelTerminationRequest + isSet bool +} + +func (v NullablePatchedWritableTunnelTerminationRequest) Get() *PatchedWritableTunnelTerminationRequest { + return v.value +} + +func (v *NullablePatchedWritableTunnelTerminationRequest) Set(val *PatchedWritableTunnelTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTunnelTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTunnelTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTunnelTerminationRequest(val *PatchedWritableTunnelTerminationRequest) *NullablePatchedWritableTunnelTerminationRequest { + return &NullablePatchedWritableTunnelTerminationRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableTunnelTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTunnelTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_termination_request_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_termination_request_role.go new file mode 100644 index 00000000..9e953db9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_tunnel_termination_request_role.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableTunnelTerminationRequestRole * `peer` - Peer * `hub` - Hub * `spoke` - Spoke +type PatchedWritableTunnelTerminationRequestRole string + +// List of PatchedWritableTunnelTerminationRequest_role +const ( + PATCHEDWRITABLETUNNELTERMINATIONREQUESTROLE_PEER PatchedWritableTunnelTerminationRequestRole = "peer" + PATCHEDWRITABLETUNNELTERMINATIONREQUESTROLE_HUB PatchedWritableTunnelTerminationRequestRole = "hub" + PATCHEDWRITABLETUNNELTERMINATIONREQUESTROLE_SPOKE PatchedWritableTunnelTerminationRequestRole = "spoke" +) + +// All allowed values of PatchedWritableTunnelTerminationRequestRole enum +var AllowedPatchedWritableTunnelTerminationRequestRoleEnumValues = []PatchedWritableTunnelTerminationRequestRole{ + "peer", + "hub", + "spoke", +} + +func (v *PatchedWritableTunnelTerminationRequestRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableTunnelTerminationRequestRole(value) + for _, existing := range AllowedPatchedWritableTunnelTerminationRequestRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableTunnelTerminationRequestRole", value) +} + +// NewPatchedWritableTunnelTerminationRequestRoleFromValue returns a pointer to a valid PatchedWritableTunnelTerminationRequestRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableTunnelTerminationRequestRoleFromValue(v string) (*PatchedWritableTunnelTerminationRequestRole, error) { + ev := PatchedWritableTunnelTerminationRequestRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableTunnelTerminationRequestRole: valid values are %v", v, AllowedPatchedWritableTunnelTerminationRequestRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableTunnelTerminationRequestRole) IsValid() bool { + for _, existing := range AllowedPatchedWritableTunnelTerminationRequestRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableTunnelTerminationRequest_role value +func (v PatchedWritableTunnelTerminationRequestRole) Ptr() *PatchedWritableTunnelTerminationRequestRole { + return &v +} + +type NullablePatchedWritableTunnelTerminationRequestRole struct { + value *PatchedWritableTunnelTerminationRequestRole + isSet bool +} + +func (v NullablePatchedWritableTunnelTerminationRequestRole) Get() *PatchedWritableTunnelTerminationRequestRole { + return v.value +} + +func (v *NullablePatchedWritableTunnelTerminationRequestRole) Set(val *PatchedWritableTunnelTerminationRequestRole) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableTunnelTerminationRequestRole) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableTunnelTerminationRequestRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableTunnelTerminationRequestRole(val *PatchedWritableTunnelTerminationRequestRole) *NullablePatchedWritableTunnelTerminationRequestRole { + return &NullablePatchedWritableTunnelTerminationRequestRole{value: val, isSet: true} +} + +func (v NullablePatchedWritableTunnelTerminationRequestRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableTunnelTerminationRequestRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_user_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_user_request.go new file mode 100644 index 00000000..b6feda90 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_user_request.go @@ -0,0 +1,454 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedWritableUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableUserRequest{} + +// PatchedWritableUserRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PatchedWritableUserRequest struct { + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + // Designates whether the user can log into this admin site. + IsStaff *bool `json:"is_staff,omitempty"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + DateJoined *time.Time `json:"date_joined,omitempty"` + // The groups this user belongs to. A user will get all permissions granted to each of their groups. + Groups []int32 `json:"groups,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableUserRequest PatchedWritableUserRequest + +// NewPatchedWritableUserRequest instantiates a new PatchedWritableUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableUserRequest() *PatchedWritableUserRequest { + this := PatchedWritableUserRequest{} + return &this +} + +// NewPatchedWritableUserRequestWithDefaults instantiates a new PatchedWritableUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableUserRequestWithDefaults() *PatchedWritableUserRequest { + this := PatchedWritableUserRequest{} + return &this +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *PatchedWritableUserRequest) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *PatchedWritableUserRequest) SetPassword(v string) { + o.Password = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *PatchedWritableUserRequest) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *PatchedWritableUserRequest) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *PatchedWritableUserRequest) SetEmail(v string) { + o.Email = &v +} + +// GetIsStaff returns the IsStaff field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetIsStaff() bool { + if o == nil || IsNil(o.IsStaff) { + var ret bool + return ret + } + return *o.IsStaff +} + +// GetIsStaffOk returns a tuple with the IsStaff field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetIsStaffOk() (*bool, bool) { + if o == nil || IsNil(o.IsStaff) { + return nil, false + } + return o.IsStaff, true +} + +// HasIsStaff returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasIsStaff() bool { + if o != nil && !IsNil(o.IsStaff) { + return true + } + + return false +} + +// SetIsStaff gets a reference to the given bool and assigns it to the IsStaff field. +func (o *PatchedWritableUserRequest) SetIsStaff(v bool) { + o.IsStaff = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *PatchedWritableUserRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetDateJoined returns the DateJoined field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetDateJoined() time.Time { + if o == nil || IsNil(o.DateJoined) { + var ret time.Time + return ret + } + return *o.DateJoined +} + +// GetDateJoinedOk returns a tuple with the DateJoined field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetDateJoinedOk() (*time.Time, bool) { + if o == nil || IsNil(o.DateJoined) { + return nil, false + } + return o.DateJoined, true +} + +// HasDateJoined returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasDateJoined() bool { + if o != nil && !IsNil(o.DateJoined) { + return true + } + + return false +} + +// SetDateJoined gets a reference to the given time.Time and assigns it to the DateJoined field. +func (o *PatchedWritableUserRequest) SetDateJoined(v time.Time) { + o.DateJoined = &v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *PatchedWritableUserRequest) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableUserRequest) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *PatchedWritableUserRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *PatchedWritableUserRequest) SetGroups(v []int32) { + o.Groups = v +} + +func (o PatchedWritableUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.IsStaff) { + toSerialize["is_staff"] = o.IsStaff + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.DateJoined) { + toSerialize["date_joined"] = o.DateJoined + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableUserRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableUserRequest := _PatchedWritableUserRequest{} + + err = json.Unmarshal(data, &varPatchedWritableUserRequest) + + if err != nil { + return err + } + + *o = PatchedWritableUserRequest(varPatchedWritableUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "email") + delete(additionalProperties, "is_staff") + delete(additionalProperties, "is_active") + delete(additionalProperties, "date_joined") + delete(additionalProperties, "groups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableUserRequest struct { + value *PatchedWritableUserRequest + isSet bool +} + +func (v NullablePatchedWritableUserRequest) Get() *PatchedWritableUserRequest { + return v.value +} + +func (v *NullablePatchedWritableUserRequest) Set(val *PatchedWritableUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableUserRequest(val *PatchedWritableUserRequest) *NullablePatchedWritableUserRequest { + return &NullablePatchedWritableUserRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_chassis_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_chassis_request.go new file mode 100644 index 00000000..0133026a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_chassis_request.go @@ -0,0 +1,386 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableVirtualChassisRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableVirtualChassisRequest{} + +// PatchedWritableVirtualChassisRequest Adds support for custom fields and tags. +type PatchedWritableVirtualChassisRequest struct { + Name *string `json:"name,omitempty"` + Domain *string `json:"domain,omitempty"` + Master NullableInt32 `json:"master,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableVirtualChassisRequest PatchedWritableVirtualChassisRequest + +// NewPatchedWritableVirtualChassisRequest instantiates a new PatchedWritableVirtualChassisRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableVirtualChassisRequest() *PatchedWritableVirtualChassisRequest { + this := PatchedWritableVirtualChassisRequest{} + return &this +} + +// NewPatchedWritableVirtualChassisRequestWithDefaults instantiates a new PatchedWritableVirtualChassisRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableVirtualChassisRequestWithDefaults() *PatchedWritableVirtualChassisRequest { + this := PatchedWritableVirtualChassisRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableVirtualChassisRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualChassisRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableVirtualChassisRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableVirtualChassisRequest) SetName(v string) { + o.Name = &v +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *PatchedWritableVirtualChassisRequest) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualChassisRequest) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *PatchedWritableVirtualChassisRequest) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *PatchedWritableVirtualChassisRequest) SetDomain(v string) { + o.Domain = &v +} + +// GetMaster returns the Master field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualChassisRequest) GetMaster() int32 { + if o == nil || IsNil(o.Master.Get()) { + var ret int32 + return ret + } + return *o.Master.Get() +} + +// GetMasterOk returns a tuple with the Master field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualChassisRequest) GetMasterOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Master.Get(), o.Master.IsSet() +} + +// HasMaster returns a boolean if a field has been set. +func (o *PatchedWritableVirtualChassisRequest) HasMaster() bool { + if o != nil && o.Master.IsSet() { + return true + } + + return false +} + +// SetMaster gets a reference to the given NullableInt32 and assigns it to the Master field. +func (o *PatchedWritableVirtualChassisRequest) SetMaster(v int32) { + o.Master.Set(&v) +} + +// SetMasterNil sets the value for Master to be an explicit nil +func (o *PatchedWritableVirtualChassisRequest) SetMasterNil() { + o.Master.Set(nil) +} + +// UnsetMaster ensures that no value is present for Master, not even an explicit nil +func (o *PatchedWritableVirtualChassisRequest) UnsetMaster() { + o.Master.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableVirtualChassisRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualChassisRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableVirtualChassisRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableVirtualChassisRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableVirtualChassisRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualChassisRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableVirtualChassisRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableVirtualChassisRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableVirtualChassisRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualChassisRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableVirtualChassisRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableVirtualChassisRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableVirtualChassisRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualChassisRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableVirtualChassisRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableVirtualChassisRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableVirtualChassisRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableVirtualChassisRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if o.Master.IsSet() { + toSerialize["master"] = o.Master.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableVirtualChassisRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableVirtualChassisRequest := _PatchedWritableVirtualChassisRequest{} + + err = json.Unmarshal(data, &varPatchedWritableVirtualChassisRequest) + + if err != nil { + return err + } + + *o = PatchedWritableVirtualChassisRequest(varPatchedWritableVirtualChassisRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "domain") + delete(additionalProperties, "master") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableVirtualChassisRequest struct { + value *PatchedWritableVirtualChassisRequest + isSet bool +} + +func (v NullablePatchedWritableVirtualChassisRequest) Get() *PatchedWritableVirtualChassisRequest { + return v.value +} + +func (v *NullablePatchedWritableVirtualChassisRequest) Set(val *PatchedWritableVirtualChassisRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVirtualChassisRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVirtualChassisRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVirtualChassisRequest(val *PatchedWritableVirtualChassisRequest) *NullablePatchedWritableVirtualChassisRequest { + return &NullablePatchedWritableVirtualChassisRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableVirtualChassisRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVirtualChassisRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_device_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_device_context_request.go new file mode 100644 index 00000000..10674b14 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_device_context_request.go @@ -0,0 +1,579 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableVirtualDeviceContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableVirtualDeviceContextRequest{} + +// PatchedWritableVirtualDeviceContextRequest Adds support for custom fields and tags. +type PatchedWritableVirtualDeviceContextRequest struct { + Name *string `json:"name,omitempty"` + Device NullableInt32 `json:"device,omitempty"` + // Numeric identifier unique to the parent device + Identifier NullableInt32 `json:"identifier,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + PrimaryIp4 NullableInt32 `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableInt32 `json:"primary_ip6,omitempty"` + Status *PatchedWritableVirtualDeviceContextRequestStatus `json:"status,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableVirtualDeviceContextRequest PatchedWritableVirtualDeviceContextRequest + +// NewPatchedWritableVirtualDeviceContextRequest instantiates a new PatchedWritableVirtualDeviceContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableVirtualDeviceContextRequest() *PatchedWritableVirtualDeviceContextRequest { + this := PatchedWritableVirtualDeviceContextRequest{} + return &this +} + +// NewPatchedWritableVirtualDeviceContextRequestWithDefaults instantiates a new PatchedWritableVirtualDeviceContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableVirtualDeviceContextRequestWithDefaults() *PatchedWritableVirtualDeviceContextRequest { + this := PatchedWritableVirtualDeviceContextRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDeviceContextRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetName(v string) { + o.Name = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualDeviceContextRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device.Get()) { + var ret int32 + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualDeviceContextRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableInt32 and assigns it to the Device field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetDevice(v int32) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualDeviceContextRequest) GetIdentifier() int32 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int32 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualDeviceContextRequest) GetIdentifierOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt32 and assigns it to the Identifier field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetIdentifier(v int32) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualDeviceContextRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualDeviceContextRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualDeviceContextRequest) GetPrimaryIp4() int32 { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualDeviceContextRequest) GetPrimaryIp4Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp4 field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetPrimaryIp4(v int32) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualDeviceContextRequest) GetPrimaryIp6() int32 { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualDeviceContextRequest) GetPrimaryIp6Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp6 field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetPrimaryIp6(v int32) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *PatchedWritableVirtualDeviceContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDeviceContextRequest) GetStatus() PatchedWritableVirtualDeviceContextRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableVirtualDeviceContextRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) GetStatusOk() (*PatchedWritableVirtualDeviceContextRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableVirtualDeviceContextRequestStatus and assigns it to the Status field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetStatus(v PatchedWritableVirtualDeviceContextRequestStatus) { + o.Status = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDeviceContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDeviceContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDeviceContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDeviceContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDeviceContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableVirtualDeviceContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableVirtualDeviceContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableVirtualDeviceContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableVirtualDeviceContextRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableVirtualDeviceContextRequest := _PatchedWritableVirtualDeviceContextRequest{} + + err = json.Unmarshal(data, &varPatchedWritableVirtualDeviceContextRequest) + + if err != nil { + return err + } + + *o = PatchedWritableVirtualDeviceContextRequest(varPatchedWritableVirtualDeviceContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "device") + delete(additionalProperties, "identifier") + delete(additionalProperties, "tenant") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "status") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableVirtualDeviceContextRequest struct { + value *PatchedWritableVirtualDeviceContextRequest + isSet bool +} + +func (v NullablePatchedWritableVirtualDeviceContextRequest) Get() *PatchedWritableVirtualDeviceContextRequest { + return v.value +} + +func (v *NullablePatchedWritableVirtualDeviceContextRequest) Set(val *PatchedWritableVirtualDeviceContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVirtualDeviceContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVirtualDeviceContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVirtualDeviceContextRequest(val *PatchedWritableVirtualDeviceContextRequest) *NullablePatchedWritableVirtualDeviceContextRequest { + return &NullablePatchedWritableVirtualDeviceContextRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableVirtualDeviceContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVirtualDeviceContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_device_context_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_device_context_request_status.go new file mode 100644 index 00000000..acf43ea1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_device_context_request_status.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableVirtualDeviceContextRequestStatus * `active` - Active * `planned` - Planned * `offline` - Offline +type PatchedWritableVirtualDeviceContextRequestStatus string + +// List of PatchedWritableVirtualDeviceContextRequest_status +const ( + PATCHEDWRITABLEVIRTUALDEVICECONTEXTREQUESTSTATUS_ACTIVE PatchedWritableVirtualDeviceContextRequestStatus = "active" + PATCHEDWRITABLEVIRTUALDEVICECONTEXTREQUESTSTATUS_PLANNED PatchedWritableVirtualDeviceContextRequestStatus = "planned" + PATCHEDWRITABLEVIRTUALDEVICECONTEXTREQUESTSTATUS_OFFLINE PatchedWritableVirtualDeviceContextRequestStatus = "offline" +) + +// All allowed values of PatchedWritableVirtualDeviceContextRequestStatus enum +var AllowedPatchedWritableVirtualDeviceContextRequestStatusEnumValues = []PatchedWritableVirtualDeviceContextRequestStatus{ + "active", + "planned", + "offline", +} + +func (v *PatchedWritableVirtualDeviceContextRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableVirtualDeviceContextRequestStatus(value) + for _, existing := range AllowedPatchedWritableVirtualDeviceContextRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableVirtualDeviceContextRequestStatus", value) +} + +// NewPatchedWritableVirtualDeviceContextRequestStatusFromValue returns a pointer to a valid PatchedWritableVirtualDeviceContextRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableVirtualDeviceContextRequestStatusFromValue(v string) (*PatchedWritableVirtualDeviceContextRequestStatus, error) { + ev := PatchedWritableVirtualDeviceContextRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableVirtualDeviceContextRequestStatus: valid values are %v", v, AllowedPatchedWritableVirtualDeviceContextRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableVirtualDeviceContextRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritableVirtualDeviceContextRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableVirtualDeviceContextRequest_status value +func (v PatchedWritableVirtualDeviceContextRequestStatus) Ptr() *PatchedWritableVirtualDeviceContextRequestStatus { + return &v +} + +type NullablePatchedWritableVirtualDeviceContextRequestStatus struct { + value *PatchedWritableVirtualDeviceContextRequestStatus + isSet bool +} + +func (v NullablePatchedWritableVirtualDeviceContextRequestStatus) Get() *PatchedWritableVirtualDeviceContextRequestStatus { + return v.value +} + +func (v *NullablePatchedWritableVirtualDeviceContextRequestStatus) Set(val *PatchedWritableVirtualDeviceContextRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVirtualDeviceContextRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVirtualDeviceContextRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVirtualDeviceContextRequestStatus(val *PatchedWritableVirtualDeviceContextRequestStatus) *NullablePatchedWritableVirtualDeviceContextRequestStatus { + return &NullablePatchedWritableVirtualDeviceContextRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritableVirtualDeviceContextRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVirtualDeviceContextRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_disk_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_disk_request.go new file mode 100644 index 00000000..c46ec326 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_disk_request.go @@ -0,0 +1,338 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableVirtualDiskRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableVirtualDiskRequest{} + +// PatchedWritableVirtualDiskRequest Adds support for custom fields and tags. +type PatchedWritableVirtualDiskRequest struct { + VirtualMachine *int32 `json:"virtual_machine,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Size *int32 `json:"size,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableVirtualDiskRequest PatchedWritableVirtualDiskRequest + +// NewPatchedWritableVirtualDiskRequest instantiates a new PatchedWritableVirtualDiskRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableVirtualDiskRequest() *PatchedWritableVirtualDiskRequest { + this := PatchedWritableVirtualDiskRequest{} + return &this +} + +// NewPatchedWritableVirtualDiskRequestWithDefaults instantiates a new PatchedWritableVirtualDiskRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableVirtualDiskRequestWithDefaults() *PatchedWritableVirtualDiskRequest { + this := PatchedWritableVirtualDiskRequest{} + return &this +} + +// GetVirtualMachine returns the VirtualMachine field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDiskRequest) GetVirtualMachine() int32 { + if o == nil || IsNil(o.VirtualMachine) { + var ret int32 + return ret + } + return *o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDiskRequest) GetVirtualMachineOk() (*int32, bool) { + if o == nil || IsNil(o.VirtualMachine) { + return nil, false + } + return o.VirtualMachine, true +} + +// HasVirtualMachine returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDiskRequest) HasVirtualMachine() bool { + if o != nil && !IsNil(o.VirtualMachine) { + return true + } + + return false +} + +// SetVirtualMachine gets a reference to the given int32 and assigns it to the VirtualMachine field. +func (o *PatchedWritableVirtualDiskRequest) SetVirtualMachine(v int32) { + o.VirtualMachine = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDiskRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDiskRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDiskRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableVirtualDiskRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDiskRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDiskRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDiskRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableVirtualDiskRequest) SetDescription(v string) { + o.Description = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDiskRequest) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDiskRequest) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDiskRequest) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *PatchedWritableVirtualDiskRequest) SetSize(v int32) { + o.Size = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDiskRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDiskRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDiskRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableVirtualDiskRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableVirtualDiskRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualDiskRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableVirtualDiskRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableVirtualDiskRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableVirtualDiskRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableVirtualDiskRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VirtualMachine) { + toSerialize["virtual_machine"] = o.VirtualMachine + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableVirtualDiskRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableVirtualDiskRequest := _PatchedWritableVirtualDiskRequest{} + + err = json.Unmarshal(data, &varPatchedWritableVirtualDiskRequest) + + if err != nil { + return err + } + + *o = PatchedWritableVirtualDiskRequest(varPatchedWritableVirtualDiskRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "size") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableVirtualDiskRequest struct { + value *PatchedWritableVirtualDiskRequest + isSet bool +} + +func (v NullablePatchedWritableVirtualDiskRequest) Get() *PatchedWritableVirtualDiskRequest { + return v.value +} + +func (v *NullablePatchedWritableVirtualDiskRequest) Set(val *PatchedWritableVirtualDiskRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVirtualDiskRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVirtualDiskRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVirtualDiskRequest(val *PatchedWritableVirtualDiskRequest) *NullablePatchedWritableVirtualDiskRequest { + return &NullablePatchedWritableVirtualDiskRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableVirtualDiskRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVirtualDiskRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_machine_with_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_machine_with_config_context_request.go new file mode 100644 index 00000000..d8a24d56 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_virtual_machine_with_config_context_request.go @@ -0,0 +1,905 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableVirtualMachineWithConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableVirtualMachineWithConfigContextRequest{} + +// PatchedWritableVirtualMachineWithConfigContextRequest Adds support for custom fields and tags. +type PatchedWritableVirtualMachineWithConfigContextRequest struct { + Name *string `json:"name,omitempty"` + Status *ModuleStatusValue `json:"status,omitempty"` + Site NullableInt32 `json:"site,omitempty"` + Cluster NullableInt32 `json:"cluster,omitempty"` + Device NullableInt32 `json:"device,omitempty"` + Role NullableInt32 `json:"role,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Platform NullableInt32 `json:"platform,omitempty"` + PrimaryIp4 NullableInt32 `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableInt32 `json:"primary_ip6,omitempty"` + Vcpus NullableFloat64 `json:"vcpus,omitempty"` + Memory NullableInt32 `json:"memory,omitempty"` + Disk NullableInt32 `json:"disk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableVirtualMachineWithConfigContextRequest PatchedWritableVirtualMachineWithConfigContextRequest + +// NewPatchedWritableVirtualMachineWithConfigContextRequest instantiates a new PatchedWritableVirtualMachineWithConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableVirtualMachineWithConfigContextRequest() *PatchedWritableVirtualMachineWithConfigContextRequest { + this := PatchedWritableVirtualMachineWithConfigContextRequest{} + return &this +} + +// NewPatchedWritableVirtualMachineWithConfigContextRequestWithDefaults instantiates a new PatchedWritableVirtualMachineWithConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableVirtualMachineWithConfigContextRequestWithDefaults() *PatchedWritableVirtualMachineWithConfigContextRequest { + this := PatchedWritableVirtualMachineWithConfigContextRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetStatus() ModuleStatusValue { + if o == nil || IsNil(o.Status) { + var ret ModuleStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetStatusOk() (*ModuleStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatusValue and assigns it to the Status field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetStatus(v ModuleStatusValue) { + o.Status = &v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetSite() { + o.Site.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetCluster() int32 { + if o == nil || IsNil(o.Cluster.Get()) { + var ret int32 + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetClusterOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableInt32 and assigns it to the Cluster field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetCluster(v int32) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetCluster() { + o.Cluster.Unset() +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device.Get()) { + var ret int32 + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableInt32 and assigns it to the Device field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetDevice(v int32) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetRole() { + o.Role.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetPlatform() int32 { + if o == nil || IsNil(o.Platform.Get()) { + var ret int32 + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetPlatformOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableInt32 and assigns it to the Platform field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetPlatform(v int32) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetPlatform() { + o.Platform.Unset() +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetPrimaryIp4() int32 { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetPrimaryIp4Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp4 field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetPrimaryIp4(v int32) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetPrimaryIp6() int32 { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetPrimaryIp6Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp6 field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetPrimaryIp6(v int32) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetVcpus returns the Vcpus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetVcpus() float64 { + if o == nil || IsNil(o.Vcpus.Get()) { + var ret float64 + return ret + } + return *o.Vcpus.Get() +} + +// GetVcpusOk returns a tuple with the Vcpus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetVcpusOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Vcpus.Get(), o.Vcpus.IsSet() +} + +// HasVcpus returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasVcpus() bool { + if o != nil && o.Vcpus.IsSet() { + return true + } + + return false +} + +// SetVcpus gets a reference to the given NullableFloat64 and assigns it to the Vcpus field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetVcpus(v float64) { + o.Vcpus.Set(&v) +} + +// SetVcpusNil sets the value for Vcpus to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetVcpusNil() { + o.Vcpus.Set(nil) +} + +// UnsetVcpus ensures that no value is present for Vcpus, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetVcpus() { + o.Vcpus.Unset() +} + +// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetMemory() int32 { + if o == nil || IsNil(o.Memory.Get()) { + var ret int32 + return ret + } + return *o.Memory.Get() +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetMemoryOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Memory.Get(), o.Memory.IsSet() +} + +// HasMemory returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasMemory() bool { + if o != nil && o.Memory.IsSet() { + return true + } + + return false +} + +// SetMemory gets a reference to the given NullableInt32 and assigns it to the Memory field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetMemory(v int32) { + o.Memory.Set(&v) +} + +// SetMemoryNil sets the value for Memory to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetMemoryNil() { + o.Memory.Set(nil) +} + +// UnsetMemory ensures that no value is present for Memory, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetMemory() { + o.Memory.Unset() +} + +// GetDisk returns the Disk field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetDisk() int32 { + if o == nil || IsNil(o.Disk.Get()) { + var ret int32 + return ret + } + return *o.Disk.Get() +} + +// GetDiskOk returns a tuple with the Disk field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetDiskOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Disk.Get(), o.Disk.IsSet() +} + +// HasDisk returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasDisk() bool { + if o != nil && o.Disk.IsSet() { + return true + } + + return false +} + +// SetDisk gets a reference to the given NullableInt32 and assigns it to the Disk field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetDisk(v int32) { + o.Disk.Set(&v) +} + +// SetDiskNil sets the value for Disk to be an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetDiskNil() { + o.Disk.Set(nil) +} + +// UnsetDisk ensures that no value is present for Disk, not even an explicit nil +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnsetDisk() { + o.Disk.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableVirtualMachineWithConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableVirtualMachineWithConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.Vcpus.IsSet() { + toSerialize["vcpus"] = o.Vcpus.Get() + } + if o.Memory.IsSet() { + toSerialize["memory"] = o.Memory.Get() + } + if o.Disk.IsSet() { + toSerialize["disk"] = o.Disk.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableVirtualMachineWithConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableVirtualMachineWithConfigContextRequest := _PatchedWritableVirtualMachineWithConfigContextRequest{} + + err = json.Unmarshal(data, &varPatchedWritableVirtualMachineWithConfigContextRequest) + + if err != nil { + return err + } + + *o = PatchedWritableVirtualMachineWithConfigContextRequest(varPatchedWritableVirtualMachineWithConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "site") + delete(additionalProperties, "cluster") + delete(additionalProperties, "device") + delete(additionalProperties, "role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "vcpus") + delete(additionalProperties, "memory") + delete(additionalProperties, "disk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableVirtualMachineWithConfigContextRequest struct { + value *PatchedWritableVirtualMachineWithConfigContextRequest + isSet bool +} + +func (v NullablePatchedWritableVirtualMachineWithConfigContextRequest) Get() *PatchedWritableVirtualMachineWithConfigContextRequest { + return v.value +} + +func (v *NullablePatchedWritableVirtualMachineWithConfigContextRequest) Set(val *PatchedWritableVirtualMachineWithConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVirtualMachineWithConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVirtualMachineWithConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVirtualMachineWithConfigContextRequest(val *PatchedWritableVirtualMachineWithConfigContextRequest) *NullablePatchedWritableVirtualMachineWithConfigContextRequest { + return &NullablePatchedWritableVirtualMachineWithConfigContextRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableVirtualMachineWithConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVirtualMachineWithConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vlan_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vlan_request.go new file mode 100644 index 00000000..847227e0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vlan_request.go @@ -0,0 +1,571 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableVLANRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableVLANRequest{} + +// PatchedWritableVLANRequest Adds support for custom fields and tags. +type PatchedWritableVLANRequest struct { + // The specific site to which this VLAN is assigned (if any) + Site NullableInt32 `json:"site,omitempty"` + // VLAN group (optional) + Group NullableInt32 `json:"group,omitempty"` + // Numeric VLAN ID (1-4094) + Vid *int32 `json:"vid,omitempty"` + Name *string `json:"name,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableVLANRequestStatus `json:"status,omitempty"` + // The primary function of this VLAN + Role NullableInt32 `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableVLANRequest PatchedWritableVLANRequest + +// NewPatchedWritableVLANRequest instantiates a new PatchedWritableVLANRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableVLANRequest() *PatchedWritableVLANRequest { + this := PatchedWritableVLANRequest{} + return &this +} + +// NewPatchedWritableVLANRequestWithDefaults instantiates a new PatchedWritableVLANRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableVLANRequestWithDefaults() *PatchedWritableVLANRequest { + this := PatchedWritableVLANRequest{} + return &this +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVLANRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVLANRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *PatchedWritableVLANRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *PatchedWritableVLANRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *PatchedWritableVLANRequest) UnsetSite() { + o.Site.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVLANRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVLANRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *PatchedWritableVLANRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedWritableVLANRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedWritableVLANRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetVid returns the Vid field value if set, zero value otherwise. +func (o *PatchedWritableVLANRequest) GetVid() int32 { + if o == nil || IsNil(o.Vid) { + var ret int32 + return ret + } + return *o.Vid +} + +// GetVidOk returns a tuple with the Vid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVLANRequest) GetVidOk() (*int32, bool) { + if o == nil || IsNil(o.Vid) { + return nil, false + } + return o.Vid, true +} + +// HasVid returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasVid() bool { + if o != nil && !IsNil(o.Vid) { + return true + } + + return false +} + +// SetVid gets a reference to the given int32 and assigns it to the Vid field. +func (o *PatchedWritableVLANRequest) SetVid(v int32) { + o.Vid = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableVLANRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVLANRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableVLANRequest) SetName(v string) { + o.Name = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVLANRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVLANRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableVLANRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableVLANRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableVLANRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableVLANRequest) GetStatus() PatchedWritableVLANRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableVLANRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVLANRequest) GetStatusOk() (*PatchedWritableVLANRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableVLANRequestStatus and assigns it to the Status field. +func (o *PatchedWritableVLANRequest) SetStatus(v PatchedWritableVLANRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVLANRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVLANRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *PatchedWritableVLANRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PatchedWritableVLANRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PatchedWritableVLANRequest) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableVLANRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVLANRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableVLANRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableVLANRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVLANRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableVLANRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableVLANRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVLANRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableVLANRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableVLANRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVLANRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableVLANRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableVLANRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableVLANRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableVLANRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Vid) { + toSerialize["vid"] = o.Vid + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableVLANRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableVLANRequest := _PatchedWritableVLANRequest{} + + err = json.Unmarshal(data, &varPatchedWritableVLANRequest) + + if err != nil { + return err + } + + *o = PatchedWritableVLANRequest(varPatchedWritableVLANRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "site") + delete(additionalProperties, "group") + delete(additionalProperties, "vid") + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableVLANRequest struct { + value *PatchedWritableVLANRequest + isSet bool +} + +func (v NullablePatchedWritableVLANRequest) Get() *PatchedWritableVLANRequest { + return v.value +} + +func (v *NullablePatchedWritableVLANRequest) Set(val *PatchedWritableVLANRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVLANRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVLANRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVLANRequest(val *PatchedWritableVLANRequest) *NullablePatchedWritableVLANRequest { + return &NullablePatchedWritableVLANRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableVLANRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVLANRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vlan_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vlan_request_status.go new file mode 100644 index 00000000..0268976f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vlan_request_status.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableVLANRequestStatus Operational status of this VLAN * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated +type PatchedWritableVLANRequestStatus string + +// List of PatchedWritableVLANRequest_status +const ( + PATCHEDWRITABLEVLANREQUESTSTATUS_ACTIVE PatchedWritableVLANRequestStatus = "active" + PATCHEDWRITABLEVLANREQUESTSTATUS_RESERVED PatchedWritableVLANRequestStatus = "reserved" + PATCHEDWRITABLEVLANREQUESTSTATUS_DEPRECATED PatchedWritableVLANRequestStatus = "deprecated" +) + +// All allowed values of PatchedWritableVLANRequestStatus enum +var AllowedPatchedWritableVLANRequestStatusEnumValues = []PatchedWritableVLANRequestStatus{ + "active", + "reserved", + "deprecated", +} + +func (v *PatchedWritableVLANRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableVLANRequestStatus(value) + for _, existing := range AllowedPatchedWritableVLANRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableVLANRequestStatus", value) +} + +// NewPatchedWritableVLANRequestStatusFromValue returns a pointer to a valid PatchedWritableVLANRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableVLANRequestStatusFromValue(v string) (*PatchedWritableVLANRequestStatus, error) { + ev := PatchedWritableVLANRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableVLANRequestStatus: valid values are %v", v, AllowedPatchedWritableVLANRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableVLANRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritableVLANRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableVLANRequest_status value +func (v PatchedWritableVLANRequestStatus) Ptr() *PatchedWritableVLANRequestStatus { + return &v +} + +type NullablePatchedWritableVLANRequestStatus struct { + value *PatchedWritableVLANRequestStatus + isSet bool +} + +func (v NullablePatchedWritableVLANRequestStatus) Get() *PatchedWritableVLANRequestStatus { + return v.value +} + +func (v *NullablePatchedWritableVLANRequestStatus) Set(val *PatchedWritableVLANRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVLANRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVLANRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVLANRequestStatus(val *PatchedWritableVLANRequestStatus) *NullablePatchedWritableVLANRequestStatus { + return &NullablePatchedWritableVLANRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritableVLANRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVLANRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vm_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vm_interface_request.go new file mode 100644 index 00000000..8f65d1b1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vm_interface_request.go @@ -0,0 +1,700 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableVMInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableVMInterfaceRequest{} + +// PatchedWritableVMInterfaceRequest Adds support for custom fields and tags. +type PatchedWritableVMInterfaceRequest struct { + VirtualMachine *int32 `json:"virtual_machine,omitempty"` + Name *string `json:"name,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Bridge NullableInt32 `json:"bridge,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Description *string `json:"description,omitempty"` + Mode *PatchedWritableInterfaceRequestMode `json:"mode,omitempty"` + UntaggedVlan NullableInt32 `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableVMInterfaceRequest PatchedWritableVMInterfaceRequest + +// NewPatchedWritableVMInterfaceRequest instantiates a new PatchedWritableVMInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableVMInterfaceRequest() *PatchedWritableVMInterfaceRequest { + this := PatchedWritableVMInterfaceRequest{} + return &this +} + +// NewPatchedWritableVMInterfaceRequestWithDefaults instantiates a new PatchedWritableVMInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableVMInterfaceRequestWithDefaults() *PatchedWritableVMInterfaceRequest { + this := PatchedWritableVMInterfaceRequest{} + return &this +} + +// GetVirtualMachine returns the VirtualMachine field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetVirtualMachine() int32 { + if o == nil || IsNil(o.VirtualMachine) { + var ret int32 + return ret + } + return *o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetVirtualMachineOk() (*int32, bool) { + if o == nil || IsNil(o.VirtualMachine) { + return nil, false + } + return o.VirtualMachine, true +} + +// HasVirtualMachine returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasVirtualMachine() bool { + if o != nil && !IsNil(o.VirtualMachine) { + return true + } + + return false +} + +// SetVirtualMachine gets a reference to the given int32 and assigns it to the VirtualMachine field. +func (o *PatchedWritableVMInterfaceRequest) SetVirtualMachine(v int32) { + o.VirtualMachine = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableVMInterfaceRequest) SetName(v string) { + o.Name = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedWritableVMInterfaceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVMInterfaceRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVMInterfaceRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableVMInterfaceRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableVMInterfaceRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableVMInterfaceRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVMInterfaceRequest) GetBridge() int32 { + if o == nil || IsNil(o.Bridge.Get()) { + var ret int32 + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVMInterfaceRequest) GetBridgeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableInt32 and assigns it to the Bridge field. +func (o *PatchedWritableVMInterfaceRequest) SetBridge(v int32) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *PatchedWritableVMInterfaceRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *PatchedWritableVMInterfaceRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVMInterfaceRequest) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVMInterfaceRequest) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *PatchedWritableVMInterfaceRequest) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *PatchedWritableVMInterfaceRequest) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *PatchedWritableVMInterfaceRequest) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVMInterfaceRequest) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVMInterfaceRequest) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *PatchedWritableVMInterfaceRequest) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *PatchedWritableVMInterfaceRequest) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *PatchedWritableVMInterfaceRequest) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableVMInterfaceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetMode() PatchedWritableInterfaceRequestMode { + if o == nil || IsNil(o.Mode) { + var ret PatchedWritableInterfaceRequestMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetModeOk() (*PatchedWritableInterfaceRequestMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given PatchedWritableInterfaceRequestMode and assigns it to the Mode field. +func (o *PatchedWritableVMInterfaceRequest) SetMode(v PatchedWritableInterfaceRequestMode) { + o.Mode = &v +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVMInterfaceRequest) GetUntaggedVlan() int32 { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret int32 + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVMInterfaceRequest) GetUntaggedVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableInt32 and assigns it to the UntaggedVlan field. +func (o *PatchedWritableVMInterfaceRequest) SetUntaggedVlan(v int32) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *PatchedWritableVMInterfaceRequest) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *PatchedWritableVMInterfaceRequest) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *PatchedWritableVMInterfaceRequest) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVMInterfaceRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVMInterfaceRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *PatchedWritableVMInterfaceRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *PatchedWritableVMInterfaceRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *PatchedWritableVMInterfaceRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableVMInterfaceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableVMInterfaceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVMInterfaceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableVMInterfaceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableVMInterfaceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableVMInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableVMInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VirtualMachine) { + toSerialize["virtual_machine"] = o.VirtualMachine + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableVMInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableVMInterfaceRequest := _PatchedWritableVMInterfaceRequest{} + + err = json.Unmarshal(data, &varPatchedWritableVMInterfaceRequest) + + if err != nil { + return err + } + + *o = PatchedWritableVMInterfaceRequest(varPatchedWritableVMInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableVMInterfaceRequest struct { + value *PatchedWritableVMInterfaceRequest + isSet bool +} + +func (v NullablePatchedWritableVMInterfaceRequest) Get() *PatchedWritableVMInterfaceRequest { + return v.value +} + +func (v *NullablePatchedWritableVMInterfaceRequest) Set(val *PatchedWritableVMInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVMInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVMInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVMInterfaceRequest(val *PatchedWritableVMInterfaceRequest) *NullablePatchedWritableVMInterfaceRequest { + return &NullablePatchedWritableVMInterfaceRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableVMInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVMInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vrf_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vrf_request.go new file mode 100644 index 00000000..3eaaf4d4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_vrf_request.go @@ -0,0 +1,510 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableVRFRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableVRFRequest{} + +// PatchedWritableVRFRequest Adds support for custom fields and tags. +type PatchedWritableVRFRequest struct { + Name *string `json:"name,omitempty"` + // Unique route distinguisher (as defined in RFC 4364) + Rd NullableString `json:"rd,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique *bool `json:"enforce_unique,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableVRFRequest PatchedWritableVRFRequest + +// NewPatchedWritableVRFRequest instantiates a new PatchedWritableVRFRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableVRFRequest() *PatchedWritableVRFRequest { + this := PatchedWritableVRFRequest{} + return &this +} + +// NewPatchedWritableVRFRequestWithDefaults instantiates a new PatchedWritableVRFRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableVRFRequestWithDefaults() *PatchedWritableVRFRequest { + this := PatchedWritableVRFRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableVRFRequest) SetName(v string) { + o.Name = &v +} + +// GetRd returns the Rd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVRFRequest) GetRd() string { + if o == nil || IsNil(o.Rd.Get()) { + var ret string + return ret + } + return *o.Rd.Get() +} + +// GetRdOk returns a tuple with the Rd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVRFRequest) GetRdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rd.Get(), o.Rd.IsSet() +} + +// HasRd returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasRd() bool { + if o != nil && o.Rd.IsSet() { + return true + } + + return false +} + +// SetRd gets a reference to the given NullableString and assigns it to the Rd field. +func (o *PatchedWritableVRFRequest) SetRd(v string) { + o.Rd.Set(&v) +} + +// SetRdNil sets the value for Rd to be an explicit nil +func (o *PatchedWritableVRFRequest) SetRdNil() { + o.Rd.Set(nil) +} + +// UnsetRd ensures that no value is present for Rd, not even an explicit nil +func (o *PatchedWritableVRFRequest) UnsetRd() { + o.Rd.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableVRFRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableVRFRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableVRFRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableVRFRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableVRFRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetEnforceUnique returns the EnforceUnique field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetEnforceUnique() bool { + if o == nil || IsNil(o.EnforceUnique) { + var ret bool + return ret + } + return *o.EnforceUnique +} + +// GetEnforceUniqueOk returns a tuple with the EnforceUnique field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetEnforceUniqueOk() (*bool, bool) { + if o == nil || IsNil(o.EnforceUnique) { + return nil, false + } + return o.EnforceUnique, true +} + +// HasEnforceUnique returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasEnforceUnique() bool { + if o != nil && !IsNil(o.EnforceUnique) { + return true + } + + return false +} + +// SetEnforceUnique gets a reference to the given bool and assigns it to the EnforceUnique field. +func (o *PatchedWritableVRFRequest) SetEnforceUnique(v bool) { + o.EnforceUnique = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableVRFRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableVRFRequest) SetComments(v string) { + o.Comments = &v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *PatchedWritableVRFRequest) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *PatchedWritableVRFRequest) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableVRFRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableVRFRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableVRFRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableVRFRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableVRFRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableVRFRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableVRFRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Rd.IsSet() { + toSerialize["rd"] = o.Rd.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.EnforceUnique) { + toSerialize["enforce_unique"] = o.EnforceUnique + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableVRFRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableVRFRequest := _PatchedWritableVRFRequest{} + + err = json.Unmarshal(data, &varPatchedWritableVRFRequest) + + if err != nil { + return err + } + + *o = PatchedWritableVRFRequest(varPatchedWritableVRFRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "rd") + delete(additionalProperties, "tenant") + delete(additionalProperties, "enforce_unique") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableVRFRequest struct { + value *PatchedWritableVRFRequest + isSet bool +} + +func (v NullablePatchedWritableVRFRequest) Get() *PatchedWritableVRFRequest { + return v.value +} + +func (v *NullablePatchedWritableVRFRequest) Set(val *PatchedWritableVRFRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableVRFRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableVRFRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableVRFRequest(val *PatchedWritableVRFRequest) *NullablePatchedWritableVRFRequest { + return &NullablePatchedWritableVRFRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableVRFRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableVRFRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_group_request.go new file mode 100644 index 00000000..f8086e94 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_group_request.go @@ -0,0 +1,349 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableWirelessLANGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableWirelessLANGroupRequest{} + +// PatchedWritableWirelessLANGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type PatchedWritableWirelessLANGroupRequest struct { + Name *string `json:"name,omitempty"` + Slug *string `json:"slug,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableWirelessLANGroupRequest PatchedWritableWirelessLANGroupRequest + +// NewPatchedWritableWirelessLANGroupRequest instantiates a new PatchedWritableWirelessLANGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableWirelessLANGroupRequest() *PatchedWritableWirelessLANGroupRequest { + this := PatchedWritableWirelessLANGroupRequest{} + return &this +} + +// NewPatchedWritableWirelessLANGroupRequestWithDefaults instantiates a new PatchedWritableWirelessLANGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableWirelessLANGroupRequestWithDefaults() *PatchedWritableWirelessLANGroupRequest { + this := PatchedWritableWirelessLANGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWritableWirelessLANGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANGroupRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANGroupRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANGroupRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedWritableWirelessLANGroupRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableWirelessLANGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableWirelessLANGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *PatchedWritableWirelessLANGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *PatchedWritableWirelessLANGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *PatchedWritableWirelessLANGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableWirelessLANGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableWirelessLANGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableWirelessLANGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableWirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableWirelessLANGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableWirelessLANGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableWirelessLANGroupRequest := _PatchedWritableWirelessLANGroupRequest{} + + err = json.Unmarshal(data, &varPatchedWritableWirelessLANGroupRequest) + + if err != nil { + return err + } + + *o = PatchedWritableWirelessLANGroupRequest(varPatchedWritableWirelessLANGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableWirelessLANGroupRequest struct { + value *PatchedWritableWirelessLANGroupRequest + isSet bool +} + +func (v NullablePatchedWritableWirelessLANGroupRequest) Get() *PatchedWritableWirelessLANGroupRequest { + return v.value +} + +func (v *NullablePatchedWritableWirelessLANGroupRequest) Set(val *PatchedWritableWirelessLANGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableWirelessLANGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableWirelessLANGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableWirelessLANGroupRequest(val *PatchedWritableWirelessLANGroupRequest) *NullablePatchedWritableWirelessLANGroupRequest { + return &NullablePatchedWritableWirelessLANGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableWirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableWirelessLANGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_request.go new file mode 100644 index 00000000..b1047847 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_request.go @@ -0,0 +1,593 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableWirelessLANRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableWirelessLANRequest{} + +// PatchedWritableWirelessLANRequest Adds support for custom fields and tags. +type PatchedWritableWirelessLANRequest struct { + Ssid *string `json:"ssid,omitempty"` + Description *string `json:"description,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Status *PatchedWritableWirelessLANRequestStatus `json:"status,omitempty"` + Vlan NullableInt32 `json:"vlan,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + AuthType *AuthenticationType1 `json:"auth_type,omitempty"` + AuthCipher *AuthenticationCipher `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableWirelessLANRequest PatchedWritableWirelessLANRequest + +// NewPatchedWritableWirelessLANRequest instantiates a new PatchedWritableWirelessLANRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableWirelessLANRequest() *PatchedWritableWirelessLANRequest { + this := PatchedWritableWirelessLANRequest{} + return &this +} + +// NewPatchedWritableWirelessLANRequestWithDefaults instantiates a new PatchedWritableWirelessLANRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableWirelessLANRequestWithDefaults() *PatchedWritableWirelessLANRequest { + this := PatchedWritableWirelessLANRequest{} + return &this +} + +// GetSsid returns the Ssid field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetSsid() string { + if o == nil || IsNil(o.Ssid) { + var ret string + return ret + } + return *o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetSsidOk() (*string, bool) { + if o == nil || IsNil(o.Ssid) { + return nil, false + } + return o.Ssid, true +} + +// HasSsid returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasSsid() bool { + if o != nil && !IsNil(o.Ssid) { + return true + } + + return false +} + +// SetSsid gets a reference to the given string and assigns it to the Ssid field. +func (o *PatchedWritableWirelessLANRequest) SetSsid(v string) { + o.Ssid = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableWirelessLANRequest) SetDescription(v string) { + o.Description = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableWirelessLANRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableWirelessLANRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *PatchedWritableWirelessLANRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedWritableWirelessLANRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedWritableWirelessLANRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetStatus() PatchedWritableWirelessLANRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableWirelessLANRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetStatusOk() (*PatchedWritableWirelessLANRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableWirelessLANRequestStatus and assigns it to the Status field. +func (o *PatchedWritableWirelessLANRequest) SetStatus(v PatchedWritableWirelessLANRequestStatus) { + o.Status = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableWirelessLANRequest) GetVlan() int32 { + if o == nil || IsNil(o.Vlan.Get()) { + var ret int32 + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableWirelessLANRequest) GetVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableInt32 and assigns it to the Vlan field. +func (o *PatchedWritableWirelessLANRequest) SetVlan(v int32) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *PatchedWritableWirelessLANRequest) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *PatchedWritableWirelessLANRequest) UnsetVlan() { + o.Vlan.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableWirelessLANRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableWirelessLANRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableWirelessLANRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableWirelessLANRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableWirelessLANRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetAuthType() AuthenticationType1 { + if o == nil || IsNil(o.AuthType) { + var ret AuthenticationType1 + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetAuthTypeOk() (*AuthenticationType1, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthenticationType1 and assigns it to the AuthType field. +func (o *PatchedWritableWirelessLANRequest) SetAuthType(v AuthenticationType1) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetAuthCipher() AuthenticationCipher { + if o == nil || IsNil(o.AuthCipher) { + var ret AuthenticationCipher + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetAuthCipherOk() (*AuthenticationCipher, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given AuthenticationCipher and assigns it to the AuthCipher field. +func (o *PatchedWritableWirelessLANRequest) SetAuthCipher(v AuthenticationCipher) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *PatchedWritableWirelessLANRequest) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableWirelessLANRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableWirelessLANRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLANRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLANRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLANRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableWirelessLANRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableWirelessLANRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableWirelessLANRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ssid) { + toSerialize["ssid"] = o.Ssid + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableWirelessLANRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableWirelessLANRequest := _PatchedWritableWirelessLANRequest{} + + err = json.Unmarshal(data, &varPatchedWritableWirelessLANRequest) + + if err != nil { + return err + } + + *o = PatchedWritableWirelessLANRequest(varPatchedWritableWirelessLANRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "ssid") + delete(additionalProperties, "description") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "vlan") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableWirelessLANRequest struct { + value *PatchedWritableWirelessLANRequest + isSet bool +} + +func (v NullablePatchedWritableWirelessLANRequest) Get() *PatchedWritableWirelessLANRequest { + return v.value +} + +func (v *NullablePatchedWritableWirelessLANRequest) Set(val *PatchedWritableWirelessLANRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableWirelessLANRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableWirelessLANRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableWirelessLANRequest(val *PatchedWritableWirelessLANRequest) *NullablePatchedWritableWirelessLANRequest { + return &NullablePatchedWritableWirelessLANRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableWirelessLANRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableWirelessLANRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_request_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_request_status.go new file mode 100644 index 00000000..d7208d0d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_lan_request_status.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PatchedWritableWirelessLANRequestStatus * `active` - Active * `reserved` - Reserved * `disabled` - Disabled * `deprecated` - Deprecated +type PatchedWritableWirelessLANRequestStatus string + +// List of PatchedWritableWirelessLANRequest_status +const ( + PATCHEDWRITABLEWIRELESSLANREQUESTSTATUS_ACTIVE PatchedWritableWirelessLANRequestStatus = "active" + PATCHEDWRITABLEWIRELESSLANREQUESTSTATUS_RESERVED PatchedWritableWirelessLANRequestStatus = "reserved" + PATCHEDWRITABLEWIRELESSLANREQUESTSTATUS_DISABLED PatchedWritableWirelessLANRequestStatus = "disabled" + PATCHEDWRITABLEWIRELESSLANREQUESTSTATUS_DEPRECATED PatchedWritableWirelessLANRequestStatus = "deprecated" +) + +// All allowed values of PatchedWritableWirelessLANRequestStatus enum +var AllowedPatchedWritableWirelessLANRequestStatusEnumValues = []PatchedWritableWirelessLANRequestStatus{ + "active", + "reserved", + "disabled", + "deprecated", +} + +func (v *PatchedWritableWirelessLANRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchedWritableWirelessLANRequestStatus(value) + for _, existing := range AllowedPatchedWritableWirelessLANRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PatchedWritableWirelessLANRequestStatus", value) +} + +// NewPatchedWritableWirelessLANRequestStatusFromValue returns a pointer to a valid PatchedWritableWirelessLANRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchedWritableWirelessLANRequestStatusFromValue(v string) (*PatchedWritableWirelessLANRequestStatus, error) { + ev := PatchedWritableWirelessLANRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchedWritableWirelessLANRequestStatus: valid values are %v", v, AllowedPatchedWritableWirelessLANRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchedWritableWirelessLANRequestStatus) IsValid() bool { + for _, existing := range AllowedPatchedWritableWirelessLANRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchedWritableWirelessLANRequest_status value +func (v PatchedWritableWirelessLANRequestStatus) Ptr() *PatchedWritableWirelessLANRequestStatus { + return &v +} + +type NullablePatchedWritableWirelessLANRequestStatus struct { + value *PatchedWritableWirelessLANRequestStatus + isSet bool +} + +func (v NullablePatchedWritableWirelessLANRequestStatus) Get() *PatchedWritableWirelessLANRequestStatus { + return v.value +} + +func (v *NullablePatchedWritableWirelessLANRequestStatus) Set(val *PatchedWritableWirelessLANRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableWirelessLANRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableWirelessLANRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableWirelessLANRequestStatus(val *PatchedWritableWirelessLANRequestStatus) *NullablePatchedWritableWirelessLANRequestStatus { + return &NullablePatchedWritableWirelessLANRequestStatus{value: val, isSet: true} +} + +func (v NullablePatchedWritableWirelessLANRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableWirelessLANRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_link_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_link_request.go new file mode 100644 index 00000000..e45f7323 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_patched_writable_wireless_link_request.go @@ -0,0 +1,571 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PatchedWritableWirelessLinkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWritableWirelessLinkRequest{} + +// PatchedWritableWirelessLinkRequest Adds support for custom fields and tags. +type PatchedWritableWirelessLinkRequest struct { + InterfaceA *int32 `json:"interface_a,omitempty"` + InterfaceB *int32 `json:"interface_b,omitempty"` + Ssid *string `json:"ssid,omitempty"` + Status *CableStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + AuthType *AuthenticationType1 `json:"auth_type,omitempty"` + AuthCipher *AuthenticationCipher `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWritableWirelessLinkRequest PatchedWritableWirelessLinkRequest + +// NewPatchedWritableWirelessLinkRequest instantiates a new PatchedWritableWirelessLinkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWritableWirelessLinkRequest() *PatchedWritableWirelessLinkRequest { + this := PatchedWritableWirelessLinkRequest{} + return &this +} + +// NewPatchedWritableWirelessLinkRequestWithDefaults instantiates a new PatchedWritableWirelessLinkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWritableWirelessLinkRequestWithDefaults() *PatchedWritableWirelessLinkRequest { + this := PatchedWritableWirelessLinkRequest{} + return &this +} + +// GetInterfaceA returns the InterfaceA field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetInterfaceA() int32 { + if o == nil || IsNil(o.InterfaceA) { + var ret int32 + return ret + } + return *o.InterfaceA +} + +// GetInterfaceAOk returns a tuple with the InterfaceA field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetInterfaceAOk() (*int32, bool) { + if o == nil || IsNil(o.InterfaceA) { + return nil, false + } + return o.InterfaceA, true +} + +// HasInterfaceA returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasInterfaceA() bool { + if o != nil && !IsNil(o.InterfaceA) { + return true + } + + return false +} + +// SetInterfaceA gets a reference to the given int32 and assigns it to the InterfaceA field. +func (o *PatchedWritableWirelessLinkRequest) SetInterfaceA(v int32) { + o.InterfaceA = &v +} + +// GetInterfaceB returns the InterfaceB field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetInterfaceB() int32 { + if o == nil || IsNil(o.InterfaceB) { + var ret int32 + return ret + } + return *o.InterfaceB +} + +// GetInterfaceBOk returns a tuple with the InterfaceB field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetInterfaceBOk() (*int32, bool) { + if o == nil || IsNil(o.InterfaceB) { + return nil, false + } + return o.InterfaceB, true +} + +// HasInterfaceB returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasInterfaceB() bool { + if o != nil && !IsNil(o.InterfaceB) { + return true + } + + return false +} + +// SetInterfaceB gets a reference to the given int32 and assigns it to the InterfaceB field. +func (o *PatchedWritableWirelessLinkRequest) SetInterfaceB(v int32) { + o.InterfaceB = &v +} + +// GetSsid returns the Ssid field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetSsid() string { + if o == nil || IsNil(o.Ssid) { + var ret string + return ret + } + return *o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetSsidOk() (*string, bool) { + if o == nil || IsNil(o.Ssid) { + return nil, false + } + return o.Ssid, true +} + +// HasSsid returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasSsid() bool { + if o != nil && !IsNil(o.Ssid) { + return true + } + + return false +} + +// SetSsid gets a reference to the given string and assigns it to the Ssid field. +func (o *PatchedWritableWirelessLinkRequest) SetSsid(v string) { + o.Ssid = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetStatus() CableStatusValue { + if o == nil || IsNil(o.Status) { + var ret CableStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetStatusOk() (*CableStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatusValue and assigns it to the Status field. +func (o *PatchedWritableWirelessLinkRequest) SetStatus(v CableStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWritableWirelessLinkRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWritableWirelessLinkRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *PatchedWritableWirelessLinkRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PatchedWritableWirelessLinkRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PatchedWritableWirelessLinkRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetAuthType() AuthenticationType1 { + if o == nil || IsNil(o.AuthType) { + var ret AuthenticationType1 + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetAuthTypeOk() (*AuthenticationType1, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthenticationType1 and assigns it to the AuthType field. +func (o *PatchedWritableWirelessLinkRequest) SetAuthType(v AuthenticationType1) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetAuthCipher() AuthenticationCipher { + if o == nil || IsNil(o.AuthCipher) { + var ret AuthenticationCipher + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetAuthCipherOk() (*AuthenticationCipher, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given AuthenticationCipher and assigns it to the AuthCipher field. +func (o *PatchedWritableWirelessLinkRequest) SetAuthCipher(v AuthenticationCipher) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *PatchedWritableWirelessLinkRequest) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedWritableWirelessLinkRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PatchedWritableWirelessLinkRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PatchedWritableWirelessLinkRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PatchedWritableWirelessLinkRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWritableWirelessLinkRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PatchedWritableWirelessLinkRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PatchedWritableWirelessLinkRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PatchedWritableWirelessLinkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWritableWirelessLinkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InterfaceA) { + toSerialize["interface_a"] = o.InterfaceA + } + if !IsNil(o.InterfaceB) { + toSerialize["interface_b"] = o.InterfaceB + } + if !IsNil(o.Ssid) { + toSerialize["ssid"] = o.Ssid + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWritableWirelessLinkRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWritableWirelessLinkRequest := _PatchedWritableWirelessLinkRequest{} + + err = json.Unmarshal(data, &varPatchedWritableWirelessLinkRequest) + + if err != nil { + return err + } + + *o = PatchedWritableWirelessLinkRequest(varPatchedWritableWirelessLinkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "interface_a") + delete(additionalProperties, "interface_b") + delete(additionalProperties, "ssid") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWritableWirelessLinkRequest struct { + value *PatchedWritableWirelessLinkRequest + isSet bool +} + +func (v NullablePatchedWritableWirelessLinkRequest) Get() *PatchedWritableWirelessLinkRequest { + return v.value +} + +func (v *NullablePatchedWritableWirelessLinkRequest) Set(val *PatchedWritableWirelessLinkRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWritableWirelessLinkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWritableWirelessLinkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWritableWirelessLinkRequest(val *PatchedWritableWirelessLinkRequest) *NullablePatchedWritableWirelessLinkRequest { + return &NullablePatchedWritableWirelessLinkRequest{value: val, isSet: true} +} + +func (v NullablePatchedWritableWirelessLinkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWritableWirelessLinkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_platform.go b/vendor/github.com/netbox-community/go-netbox/v3/model_platform.go new file mode 100644 index 00000000..0b7cf5b1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_platform.go @@ -0,0 +1,610 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Platform type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Platform{} + +// Platform Adds support for custom fields and tags. +type Platform struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Manufacturer NullableNestedManufacturer `json:"manufacturer,omitempty"` + ConfigTemplate NullableNestedConfigTemplate `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + DeviceCount int32 `json:"device_count"` + VirtualmachineCount int32 `json:"virtualmachine_count"` + AdditionalProperties map[string]interface{} +} + +type _Platform Platform + +// NewPlatform instantiates a new Platform object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlatform(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, deviceCount int32, virtualmachineCount int32) *Platform { + this := Platform{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.DeviceCount = deviceCount + this.VirtualmachineCount = virtualmachineCount + return &this +} + +// NewPlatformWithDefaults instantiates a new Platform object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlatformWithDefaults() *Platform { + this := Platform{} + return &this +} + +// GetId returns the Id field value +func (o *Platform) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Platform) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Platform) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Platform) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Platform) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Platform) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Platform) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Platform) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Platform) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Platform) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Platform) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Platform) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Platform) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Platform) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Platform) SetSlug(v string) { + o.Slug = v +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Platform) GetManufacturer() NestedManufacturer { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret NestedManufacturer + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Platform) GetManufacturerOk() (*NestedManufacturer, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *Platform) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableNestedManufacturer and assigns it to the Manufacturer field. +func (o *Platform) SetManufacturer(v NestedManufacturer) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *Platform) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *Platform) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Platform) GetConfigTemplate() NestedConfigTemplate { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret NestedConfigTemplate + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Platform) GetConfigTemplateOk() (*NestedConfigTemplate, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *Platform) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableNestedConfigTemplate and assigns it to the ConfigTemplate field. +func (o *Platform) SetConfigTemplate(v NestedConfigTemplate) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *Platform) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *Platform) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Platform) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Platform) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Platform) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Platform) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Platform) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Platform) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Platform) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Platform) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Platform) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Platform) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Platform) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Platform) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Platform) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Platform) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Platform) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Platform) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Platform) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Platform) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDeviceCount returns the DeviceCount field value +func (o *Platform) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *Platform) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *Platform) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetVirtualmachineCount returns the VirtualmachineCount field value +func (o *Platform) GetVirtualmachineCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualmachineCount +} + +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// and a boolean to check if the value has been set. +func (o *Platform) GetVirtualmachineCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualmachineCount, true +} + +// SetVirtualmachineCount sets field value +func (o *Platform) SetVirtualmachineCount(v int32) { + o.VirtualmachineCount = v +} + +func (o Platform) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Platform) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["device_count"] = o.DeviceCount + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Platform) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "device_count", + "virtualmachine_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlatform := _Platform{} + + err = json.Unmarshal(data, &varPlatform) + + if err != nil { + return err + } + + *o = Platform(varPlatform) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "device_count") + delete(additionalProperties, "virtualmachine_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlatform struct { + value *Platform + isSet bool +} + +func (v NullablePlatform) Get() *Platform { + return v.value +} + +func (v *NullablePlatform) Set(val *Platform) { + v.value = val + v.isSet = true +} + +func (v NullablePlatform) IsSet() bool { + return v.isSet +} + +func (v *NullablePlatform) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlatform(val *Platform) *NullablePlatform { + return &NullablePlatform{value: val, isSet: true} +} + +func (v NullablePlatform) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlatform) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_platform_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_platform_request.go new file mode 100644 index 00000000..cc41d80a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_platform_request.go @@ -0,0 +1,402 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PlatformRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlatformRequest{} + +// PlatformRequest Adds support for custom fields and tags. +type PlatformRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Manufacturer NullableNestedManufacturerRequest `json:"manufacturer,omitempty"` + ConfigTemplate NullableNestedConfigTemplateRequest `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlatformRequest PlatformRequest + +// NewPlatformRequest instantiates a new PlatformRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlatformRequest(name string, slug string) *PlatformRequest { + this := PlatformRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewPlatformRequestWithDefaults instantiates a new PlatformRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlatformRequestWithDefaults() *PlatformRequest { + this := PlatformRequest{} + return &this +} + +// GetName returns the Name field value +func (o *PlatformRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PlatformRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PlatformRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *PlatformRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *PlatformRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *PlatformRequest) SetSlug(v string) { + o.Slug = v +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlatformRequest) GetManufacturer() NestedManufacturerRequest { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret NestedManufacturerRequest + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlatformRequest) GetManufacturerOk() (*NestedManufacturerRequest, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *PlatformRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableNestedManufacturerRequest and assigns it to the Manufacturer field. +func (o *PlatformRequest) SetManufacturer(v NestedManufacturerRequest) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *PlatformRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *PlatformRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlatformRequest) GetConfigTemplate() NestedConfigTemplateRequest { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret NestedConfigTemplateRequest + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlatformRequest) GetConfigTemplateOk() (*NestedConfigTemplateRequest, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *PlatformRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableNestedConfigTemplateRequest and assigns it to the ConfigTemplate field. +func (o *PlatformRequest) SetConfigTemplate(v NestedConfigTemplateRequest) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *PlatformRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *PlatformRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PlatformRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PlatformRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PlatformRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PlatformRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PlatformRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PlatformRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PlatformRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PlatformRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PlatformRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PlatformRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlatformRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlatformRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlatformRequest := _PlatformRequest{} + + err = json.Unmarshal(data, &varPlatformRequest) + + if err != nil { + return err + } + + *o = PlatformRequest(varPlatformRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlatformRequest struct { + value *PlatformRequest + isSet bool +} + +func (v NullablePlatformRequest) Get() *PlatformRequest { + return v.value +} + +func (v *NullablePlatformRequest) Set(val *PlatformRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePlatformRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePlatformRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlatformRequest(val *PlatformRequest) *NullablePlatformRequest { + return &NullablePlatformRequest{value: val, isSet: true} +} + +func (v NullablePlatformRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlatformRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed.go new file mode 100644 index 00000000..7cd3a8ad --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed.go @@ -0,0 +1,1122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the PowerFeed type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerFeed{} + +// PowerFeed Adds support for custom fields and tags. +type PowerFeed struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + PowerPanel NestedPowerPanel `json:"power_panel"` + Rack NullableNestedRack `json:"rack,omitempty"` + Name string `json:"name"` + Status *PowerFeedStatus `json:"status,omitempty"` + Type *PowerFeedType `json:"type,omitempty"` + Supply *PowerFeedSupply `json:"supply,omitempty"` + Phase *PowerFeedPhase `json:"phase,omitempty"` + Voltage *int32 `json:"voltage,omitempty"` + Amperage *int32 `json:"amperage,omitempty"` + // Maximum permissible draw (percentage) + MaxUtilization *int32 `json:"max_utilization,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` + ConnectedEndpointsType string `json:"connected_endpoints_type"` + ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` + Description *string `json:"description,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _PowerFeed PowerFeed + +// NewPowerFeed instantiates a new PowerFeed object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerFeed(id int32, url string, display string, powerPanel NestedPowerPanel, name string, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, connectedEndpoints []interface{}, connectedEndpointsType string, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *PowerFeed { + this := PowerFeed{} + this.Id = id + this.Url = url + this.Display = display + this.PowerPanel = powerPanel + this.Name = name + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.ConnectedEndpoints = connectedEndpoints + this.ConnectedEndpointsType = connectedEndpointsType + this.ConnectedEndpointsReachable = connectedEndpointsReachable + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewPowerFeedWithDefaults instantiates a new PowerFeed object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerFeedWithDefaults() *PowerFeed { + this := PowerFeed{} + return &this +} + +// GetId returns the Id field value +func (o *PowerFeed) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PowerFeed) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *PowerFeed) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *PowerFeed) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *PowerFeed) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *PowerFeed) SetDisplay(v string) { + o.Display = v +} + +// GetPowerPanel returns the PowerPanel field value +func (o *PowerFeed) GetPowerPanel() NestedPowerPanel { + if o == nil { + var ret NestedPowerPanel + return ret + } + + return o.PowerPanel +} + +// GetPowerPanelOk returns a tuple with the PowerPanel field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetPowerPanelOk() (*NestedPowerPanel, bool) { + if o == nil { + return nil, false + } + return &o.PowerPanel, true +} + +// SetPowerPanel sets field value +func (o *PowerFeed) SetPowerPanel(v NestedPowerPanel) { + o.PowerPanel = v +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerFeed) GetRack() NestedRack { + if o == nil || IsNil(o.Rack.Get()) { + var ret NestedRack + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerFeed) GetRackOk() (*NestedRack, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *PowerFeed) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableNestedRack and assigns it to the Rack field. +func (o *PowerFeed) SetRack(v NestedRack) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *PowerFeed) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *PowerFeed) UnsetRack() { + o.Rack.Unset() +} + +// GetName returns the Name field value +func (o *PowerFeed) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerFeed) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PowerFeed) GetStatus() PowerFeedStatus { + if o == nil || IsNil(o.Status) { + var ret PowerFeedStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetStatusOk() (*PowerFeedStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PowerFeed) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PowerFeedStatus and assigns it to the Status field. +func (o *PowerFeed) SetStatus(v PowerFeedStatus) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PowerFeed) GetType() PowerFeedType { + if o == nil || IsNil(o.Type) { + var ret PowerFeedType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetTypeOk() (*PowerFeedType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PowerFeed) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PowerFeedType and assigns it to the Type field. +func (o *PowerFeed) SetType(v PowerFeedType) { + o.Type = &v +} + +// GetSupply returns the Supply field value if set, zero value otherwise. +func (o *PowerFeed) GetSupply() PowerFeedSupply { + if o == nil || IsNil(o.Supply) { + var ret PowerFeedSupply + return ret + } + return *o.Supply +} + +// GetSupplyOk returns a tuple with the Supply field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetSupplyOk() (*PowerFeedSupply, bool) { + if o == nil || IsNil(o.Supply) { + return nil, false + } + return o.Supply, true +} + +// HasSupply returns a boolean if a field has been set. +func (o *PowerFeed) HasSupply() bool { + if o != nil && !IsNil(o.Supply) { + return true + } + + return false +} + +// SetSupply gets a reference to the given PowerFeedSupply and assigns it to the Supply field. +func (o *PowerFeed) SetSupply(v PowerFeedSupply) { + o.Supply = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *PowerFeed) GetPhase() PowerFeedPhase { + if o == nil || IsNil(o.Phase) { + var ret PowerFeedPhase + return ret + } + return *o.Phase +} + +// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetPhaseOk() (*PowerFeedPhase, bool) { + if o == nil || IsNil(o.Phase) { + return nil, false + } + return o.Phase, true +} + +// HasPhase returns a boolean if a field has been set. +func (o *PowerFeed) HasPhase() bool { + if o != nil && !IsNil(o.Phase) { + return true + } + + return false +} + +// SetPhase gets a reference to the given PowerFeedPhase and assigns it to the Phase field. +func (o *PowerFeed) SetPhase(v PowerFeedPhase) { + o.Phase = &v +} + +// GetVoltage returns the Voltage field value if set, zero value otherwise. +func (o *PowerFeed) GetVoltage() int32 { + if o == nil || IsNil(o.Voltage) { + var ret int32 + return ret + } + return *o.Voltage +} + +// GetVoltageOk returns a tuple with the Voltage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetVoltageOk() (*int32, bool) { + if o == nil || IsNil(o.Voltage) { + return nil, false + } + return o.Voltage, true +} + +// HasVoltage returns a boolean if a field has been set. +func (o *PowerFeed) HasVoltage() bool { + if o != nil && !IsNil(o.Voltage) { + return true + } + + return false +} + +// SetVoltage gets a reference to the given int32 and assigns it to the Voltage field. +func (o *PowerFeed) SetVoltage(v int32) { + o.Voltage = &v +} + +// GetAmperage returns the Amperage field value if set, zero value otherwise. +func (o *PowerFeed) GetAmperage() int32 { + if o == nil || IsNil(o.Amperage) { + var ret int32 + return ret + } + return *o.Amperage +} + +// GetAmperageOk returns a tuple with the Amperage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetAmperageOk() (*int32, bool) { + if o == nil || IsNil(o.Amperage) { + return nil, false + } + return o.Amperage, true +} + +// HasAmperage returns a boolean if a field has been set. +func (o *PowerFeed) HasAmperage() bool { + if o != nil && !IsNil(o.Amperage) { + return true + } + + return false +} + +// SetAmperage gets a reference to the given int32 and assigns it to the Amperage field. +func (o *PowerFeed) SetAmperage(v int32) { + o.Amperage = &v +} + +// GetMaxUtilization returns the MaxUtilization field value if set, zero value otherwise. +func (o *PowerFeed) GetMaxUtilization() int32 { + if o == nil || IsNil(o.MaxUtilization) { + var ret int32 + return ret + } + return *o.MaxUtilization +} + +// GetMaxUtilizationOk returns a tuple with the MaxUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetMaxUtilizationOk() (*int32, bool) { + if o == nil || IsNil(o.MaxUtilization) { + return nil, false + } + return o.MaxUtilization, true +} + +// HasMaxUtilization returns a boolean if a field has been set. +func (o *PowerFeed) HasMaxUtilization() bool { + if o != nil && !IsNil(o.MaxUtilization) { + return true + } + + return false +} + +// SetMaxUtilization gets a reference to the given int32 and assigns it to the MaxUtilization field. +func (o *PowerFeed) SetMaxUtilization(v int32) { + o.MaxUtilization = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PowerFeed) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PowerFeed) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PowerFeed) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *PowerFeed) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerFeed) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *PowerFeed) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *PowerFeed) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *PowerFeed) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *PowerFeed) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *PowerFeed) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *PowerFeed) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *PowerFeed) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetConnectedEndpoints returns the ConnectedEndpoints field value +func (o *PowerFeed) GetConnectedEndpoints() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConnectedEndpoints +} + +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetConnectedEndpointsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConnectedEndpoints, true +} + +// SetConnectedEndpoints sets field value +func (o *PowerFeed) SetConnectedEndpoints(v []interface{}) { + o.ConnectedEndpoints = v +} + +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value +func (o *PowerFeed) GetConnectedEndpointsType() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectedEndpointsType +} + +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetConnectedEndpointsTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsType, true +} + +// SetConnectedEndpointsType sets field value +func (o *PowerFeed) SetConnectedEndpointsType(v string) { + o.ConnectedEndpointsType = v +} + +// GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value +func (o *PowerFeed) GetConnectedEndpointsReachable() bool { + if o == nil { + var ret bool + return ret + } + + return o.ConnectedEndpointsReachable +} + +// GetConnectedEndpointsReachableOk returns a tuple with the ConnectedEndpointsReachable field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetConnectedEndpointsReachableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsReachable, true +} + +// SetConnectedEndpointsReachable sets field value +func (o *PowerFeed) SetConnectedEndpointsReachable(v bool) { + o.ConnectedEndpointsReachable = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerFeed) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerFeed) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerFeed) SetDescription(v string) { + o.Description = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerFeed) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerFeed) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PowerFeed) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *PowerFeed) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PowerFeed) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PowerFeed) UnsetTenant() { + o.Tenant.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PowerFeed) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PowerFeed) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PowerFeed) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerFeed) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerFeed) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *PowerFeed) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerFeed) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerFeed) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerFeed) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerFeed) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerFeed) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *PowerFeed) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerFeed) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerFeed) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *PowerFeed) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *PowerFeed) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *PowerFeed) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *PowerFeed) SetOccupied(v bool) { + o.Occupied = v +} + +func (o PowerFeed) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerFeed) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["power_panel"] = o.PowerPanel + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Supply) { + toSerialize["supply"] = o.Supply + } + if !IsNil(o.Phase) { + toSerialize["phase"] = o.Phase + } + if !IsNil(o.Voltage) { + toSerialize["voltage"] = o.Voltage + } + if !IsNil(o.Amperage) { + toSerialize["amperage"] = o.Amperage + } + if !IsNil(o.MaxUtilization) { + toSerialize["max_utilization"] = o.MaxUtilization + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + toSerialize["connected_endpoints"] = o.ConnectedEndpoints + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType + toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerFeed) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "power_panel", + "name", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "connected_endpoints", + "connected_endpoints_type", + "connected_endpoints_reachable", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerFeed := _PowerFeed{} + + err = json.Unmarshal(data, &varPowerFeed) + + if err != nil { + return err + } + + *o = PowerFeed(varPowerFeed) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "power_panel") + delete(additionalProperties, "rack") + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "type") + delete(additionalProperties, "supply") + delete(additionalProperties, "phase") + delete(additionalProperties, "voltage") + delete(additionalProperties, "amperage") + delete(additionalProperties, "max_utilization") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "connected_endpoints") + delete(additionalProperties, "connected_endpoints_type") + delete(additionalProperties, "connected_endpoints_reachable") + delete(additionalProperties, "description") + delete(additionalProperties, "tenant") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerFeed struct { + value *PowerFeed + isSet bool +} + +func (v NullablePowerFeed) Get() *PowerFeed { + return v.value +} + +func (v *NullablePowerFeed) Set(val *PowerFeed) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeed) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeed) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeed(val *PowerFeed) *NullablePowerFeed { + return &NullablePowerFeed{value: val, isSet: true} +} + +func (v NullablePowerFeed) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeed) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_phase.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_phase.go new file mode 100644 index 00000000..9f5563a2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_phase.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PowerFeedPhase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerFeedPhase{} + +// PowerFeedPhase struct for PowerFeedPhase +type PowerFeedPhase struct { + Value *PatchedWritablePowerFeedRequestPhase `json:"value,omitempty"` + Label *PowerFeedPhaseLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerFeedPhase PowerFeedPhase + +// NewPowerFeedPhase instantiates a new PowerFeedPhase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerFeedPhase() *PowerFeedPhase { + this := PowerFeedPhase{} + return &this +} + +// NewPowerFeedPhaseWithDefaults instantiates a new PowerFeedPhase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerFeedPhaseWithDefaults() *PowerFeedPhase { + this := PowerFeedPhase{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PowerFeedPhase) GetValue() PatchedWritablePowerFeedRequestPhase { + if o == nil || IsNil(o.Value) { + var ret PatchedWritablePowerFeedRequestPhase + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedPhase) GetValueOk() (*PatchedWritablePowerFeedRequestPhase, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PowerFeedPhase) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritablePowerFeedRequestPhase and assigns it to the Value field. +func (o *PowerFeedPhase) SetValue(v PatchedWritablePowerFeedRequestPhase) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerFeedPhase) GetLabel() PowerFeedPhaseLabel { + if o == nil || IsNil(o.Label) { + var ret PowerFeedPhaseLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedPhase) GetLabelOk() (*PowerFeedPhaseLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerFeedPhase) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PowerFeedPhaseLabel and assigns it to the Label field. +func (o *PowerFeedPhase) SetLabel(v PowerFeedPhaseLabel) { + o.Label = &v +} + +func (o PowerFeedPhase) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerFeedPhase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerFeedPhase) UnmarshalJSON(data []byte) (err error) { + varPowerFeedPhase := _PowerFeedPhase{} + + err = json.Unmarshal(data, &varPowerFeedPhase) + + if err != nil { + return err + } + + *o = PowerFeedPhase(varPowerFeedPhase) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerFeedPhase struct { + value *PowerFeedPhase + isSet bool +} + +func (v NullablePowerFeedPhase) Get() *PowerFeedPhase { + return v.value +} + +func (v *NullablePowerFeedPhase) Set(val *PowerFeedPhase) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedPhase) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedPhase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedPhase(val *PowerFeedPhase) *NullablePowerFeedPhase { + return &NullablePowerFeedPhase{value: val, isSet: true} +} + +func (v NullablePowerFeedPhase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedPhase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_phase_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_phase_label.go new file mode 100644 index 00000000..32cf8b40 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_phase_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerFeedPhaseLabel the model 'PowerFeedPhaseLabel' +type PowerFeedPhaseLabel string + +// List of PowerFeed_phase_label +const ( + POWERFEEDPHASELABEL_SINGLE_PHASE PowerFeedPhaseLabel = "Single phase" + POWERFEEDPHASELABEL_THREE_PHASE PowerFeedPhaseLabel = "Three-phase" +) + +// All allowed values of PowerFeedPhaseLabel enum +var AllowedPowerFeedPhaseLabelEnumValues = []PowerFeedPhaseLabel{ + "Single phase", + "Three-phase", +} + +func (v *PowerFeedPhaseLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerFeedPhaseLabel(value) + for _, existing := range AllowedPowerFeedPhaseLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerFeedPhaseLabel", value) +} + +// NewPowerFeedPhaseLabelFromValue returns a pointer to a valid PowerFeedPhaseLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerFeedPhaseLabelFromValue(v string) (*PowerFeedPhaseLabel, error) { + ev := PowerFeedPhaseLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerFeedPhaseLabel: valid values are %v", v, AllowedPowerFeedPhaseLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerFeedPhaseLabel) IsValid() bool { + for _, existing := range AllowedPowerFeedPhaseLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerFeed_phase_label value +func (v PowerFeedPhaseLabel) Ptr() *PowerFeedPhaseLabel { + return &v +} + +type NullablePowerFeedPhaseLabel struct { + value *PowerFeedPhaseLabel + isSet bool +} + +func (v NullablePowerFeedPhaseLabel) Get() *PowerFeedPhaseLabel { + return v.value +} + +func (v *NullablePowerFeedPhaseLabel) Set(val *PowerFeedPhaseLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedPhaseLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedPhaseLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedPhaseLabel(val *PowerFeedPhaseLabel) *NullablePowerFeedPhaseLabel { + return &NullablePowerFeedPhaseLabel{value: val, isSet: true} +} + +func (v NullablePowerFeedPhaseLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedPhaseLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_request.go new file mode 100644 index 00000000..f90f3125 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_request.go @@ -0,0 +1,737 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PowerFeedRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerFeedRequest{} + +// PowerFeedRequest Adds support for custom fields and tags. +type PowerFeedRequest struct { + PowerPanel NestedPowerPanelRequest `json:"power_panel"` + Rack NullableNestedRackRequest `json:"rack,omitempty"` + Name string `json:"name"` + Status *PatchedWritablePowerFeedRequestStatus `json:"status,omitempty"` + Type *PatchedWritablePowerFeedRequestType `json:"type,omitempty"` + Supply *PatchedWritablePowerFeedRequestSupply `json:"supply,omitempty"` + Phase *PatchedWritablePowerFeedRequestPhase `json:"phase,omitempty"` + Voltage *int32 `json:"voltage,omitempty"` + Amperage *int32 `json:"amperage,omitempty"` + // Maximum permissible draw (percentage) + MaxUtilization *int32 `json:"max_utilization,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Description *string `json:"description,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerFeedRequest PowerFeedRequest + +// NewPowerFeedRequest instantiates a new PowerFeedRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerFeedRequest(powerPanel NestedPowerPanelRequest, name string) *PowerFeedRequest { + this := PowerFeedRequest{} + this.PowerPanel = powerPanel + this.Name = name + return &this +} + +// NewPowerFeedRequestWithDefaults instantiates a new PowerFeedRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerFeedRequestWithDefaults() *PowerFeedRequest { + this := PowerFeedRequest{} + return &this +} + +// GetPowerPanel returns the PowerPanel field value +func (o *PowerFeedRequest) GetPowerPanel() NestedPowerPanelRequest { + if o == nil { + var ret NestedPowerPanelRequest + return ret + } + + return o.PowerPanel +} + +// GetPowerPanelOk returns a tuple with the PowerPanel field value +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetPowerPanelOk() (*NestedPowerPanelRequest, bool) { + if o == nil { + return nil, false + } + return &o.PowerPanel, true +} + +// SetPowerPanel sets field value +func (o *PowerFeedRequest) SetPowerPanel(v NestedPowerPanelRequest) { + o.PowerPanel = v +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerFeedRequest) GetRack() NestedRackRequest { + if o == nil || IsNil(o.Rack.Get()) { + var ret NestedRackRequest + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerFeedRequest) GetRackOk() (*NestedRackRequest, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableNestedRackRequest and assigns it to the Rack field. +func (o *PowerFeedRequest) SetRack(v NestedRackRequest) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *PowerFeedRequest) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *PowerFeedRequest) UnsetRack() { + o.Rack.Unset() +} + +// GetName returns the Name field value +func (o *PowerFeedRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerFeedRequest) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetStatus() PatchedWritablePowerFeedRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritablePowerFeedRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetStatusOk() (*PatchedWritablePowerFeedRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritablePowerFeedRequestStatus and assigns it to the Status field. +func (o *PowerFeedRequest) SetStatus(v PatchedWritablePowerFeedRequestStatus) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetType() PatchedWritablePowerFeedRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerFeedRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetTypeOk() (*PatchedWritablePowerFeedRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerFeedRequestType and assigns it to the Type field. +func (o *PowerFeedRequest) SetType(v PatchedWritablePowerFeedRequestType) { + o.Type = &v +} + +// GetSupply returns the Supply field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetSupply() PatchedWritablePowerFeedRequestSupply { + if o == nil || IsNil(o.Supply) { + var ret PatchedWritablePowerFeedRequestSupply + return ret + } + return *o.Supply +} + +// GetSupplyOk returns a tuple with the Supply field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetSupplyOk() (*PatchedWritablePowerFeedRequestSupply, bool) { + if o == nil || IsNil(o.Supply) { + return nil, false + } + return o.Supply, true +} + +// HasSupply returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasSupply() bool { + if o != nil && !IsNil(o.Supply) { + return true + } + + return false +} + +// SetSupply gets a reference to the given PatchedWritablePowerFeedRequestSupply and assigns it to the Supply field. +func (o *PowerFeedRequest) SetSupply(v PatchedWritablePowerFeedRequestSupply) { + o.Supply = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetPhase() PatchedWritablePowerFeedRequestPhase { + if o == nil || IsNil(o.Phase) { + var ret PatchedWritablePowerFeedRequestPhase + return ret + } + return *o.Phase +} + +// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetPhaseOk() (*PatchedWritablePowerFeedRequestPhase, bool) { + if o == nil || IsNil(o.Phase) { + return nil, false + } + return o.Phase, true +} + +// HasPhase returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasPhase() bool { + if o != nil && !IsNil(o.Phase) { + return true + } + + return false +} + +// SetPhase gets a reference to the given PatchedWritablePowerFeedRequestPhase and assigns it to the Phase field. +func (o *PowerFeedRequest) SetPhase(v PatchedWritablePowerFeedRequestPhase) { + o.Phase = &v +} + +// GetVoltage returns the Voltage field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetVoltage() int32 { + if o == nil || IsNil(o.Voltage) { + var ret int32 + return ret + } + return *o.Voltage +} + +// GetVoltageOk returns a tuple with the Voltage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetVoltageOk() (*int32, bool) { + if o == nil || IsNil(o.Voltage) { + return nil, false + } + return o.Voltage, true +} + +// HasVoltage returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasVoltage() bool { + if o != nil && !IsNil(o.Voltage) { + return true + } + + return false +} + +// SetVoltage gets a reference to the given int32 and assigns it to the Voltage field. +func (o *PowerFeedRequest) SetVoltage(v int32) { + o.Voltage = &v +} + +// GetAmperage returns the Amperage field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetAmperage() int32 { + if o == nil || IsNil(o.Amperage) { + var ret int32 + return ret + } + return *o.Amperage +} + +// GetAmperageOk returns a tuple with the Amperage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetAmperageOk() (*int32, bool) { + if o == nil || IsNil(o.Amperage) { + return nil, false + } + return o.Amperage, true +} + +// HasAmperage returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasAmperage() bool { + if o != nil && !IsNil(o.Amperage) { + return true + } + + return false +} + +// SetAmperage gets a reference to the given int32 and assigns it to the Amperage field. +func (o *PowerFeedRequest) SetAmperage(v int32) { + o.Amperage = &v +} + +// GetMaxUtilization returns the MaxUtilization field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetMaxUtilization() int32 { + if o == nil || IsNil(o.MaxUtilization) { + var ret int32 + return ret + } + return *o.MaxUtilization +} + +// GetMaxUtilizationOk returns a tuple with the MaxUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetMaxUtilizationOk() (*int32, bool) { + if o == nil || IsNil(o.MaxUtilization) { + return nil, false + } + return o.MaxUtilization, true +} + +// HasMaxUtilization returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasMaxUtilization() bool { + if o != nil && !IsNil(o.MaxUtilization) { + return true + } + + return false +} + +// SetMaxUtilization gets a reference to the given int32 and assigns it to the MaxUtilization field. +func (o *PowerFeedRequest) SetMaxUtilization(v int32) { + o.MaxUtilization = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PowerFeedRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerFeedRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerFeedRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerFeedRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *PowerFeedRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PowerFeedRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PowerFeedRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PowerFeedRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PowerFeedRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerFeedRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerFeedRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerFeedRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PowerFeedRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerFeedRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["power_panel"] = o.PowerPanel + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Supply) { + toSerialize["supply"] = o.Supply + } + if !IsNil(o.Phase) { + toSerialize["phase"] = o.Phase + } + if !IsNil(o.Voltage) { + toSerialize["voltage"] = o.Voltage + } + if !IsNil(o.Amperage) { + toSerialize["amperage"] = o.Amperage + } + if !IsNil(o.MaxUtilization) { + toSerialize["max_utilization"] = o.MaxUtilization + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerFeedRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "power_panel", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerFeedRequest := _PowerFeedRequest{} + + err = json.Unmarshal(data, &varPowerFeedRequest) + + if err != nil { + return err + } + + *o = PowerFeedRequest(varPowerFeedRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "power_panel") + delete(additionalProperties, "rack") + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "type") + delete(additionalProperties, "supply") + delete(additionalProperties, "phase") + delete(additionalProperties, "voltage") + delete(additionalProperties, "amperage") + delete(additionalProperties, "max_utilization") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "description") + delete(additionalProperties, "tenant") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerFeedRequest struct { + value *PowerFeedRequest + isSet bool +} + +func (v NullablePowerFeedRequest) Get() *PowerFeedRequest { + return v.value +} + +func (v *NullablePowerFeedRequest) Set(val *PowerFeedRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedRequest(val *PowerFeedRequest) *NullablePowerFeedRequest { + return &NullablePowerFeedRequest{value: val, isSet: true} +} + +func (v NullablePowerFeedRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_status.go new file mode 100644 index 00000000..d4858e9e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PowerFeedStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerFeedStatus{} + +// PowerFeedStatus struct for PowerFeedStatus +type PowerFeedStatus struct { + Value *PatchedWritablePowerFeedRequestStatus `json:"value,omitempty"` + Label *PowerFeedStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerFeedStatus PowerFeedStatus + +// NewPowerFeedStatus instantiates a new PowerFeedStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerFeedStatus() *PowerFeedStatus { + this := PowerFeedStatus{} + return &this +} + +// NewPowerFeedStatusWithDefaults instantiates a new PowerFeedStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerFeedStatusWithDefaults() *PowerFeedStatus { + this := PowerFeedStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PowerFeedStatus) GetValue() PatchedWritablePowerFeedRequestStatus { + if o == nil || IsNil(o.Value) { + var ret PatchedWritablePowerFeedRequestStatus + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedStatus) GetValueOk() (*PatchedWritablePowerFeedRequestStatus, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PowerFeedStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritablePowerFeedRequestStatus and assigns it to the Value field. +func (o *PowerFeedStatus) SetValue(v PatchedWritablePowerFeedRequestStatus) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerFeedStatus) GetLabel() PowerFeedStatusLabel { + if o == nil || IsNil(o.Label) { + var ret PowerFeedStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedStatus) GetLabelOk() (*PowerFeedStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerFeedStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PowerFeedStatusLabel and assigns it to the Label field. +func (o *PowerFeedStatus) SetLabel(v PowerFeedStatusLabel) { + o.Label = &v +} + +func (o PowerFeedStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerFeedStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerFeedStatus) UnmarshalJSON(data []byte) (err error) { + varPowerFeedStatus := _PowerFeedStatus{} + + err = json.Unmarshal(data, &varPowerFeedStatus) + + if err != nil { + return err + } + + *o = PowerFeedStatus(varPowerFeedStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerFeedStatus struct { + value *PowerFeedStatus + isSet bool +} + +func (v NullablePowerFeedStatus) Get() *PowerFeedStatus { + return v.value +} + +func (v *NullablePowerFeedStatus) Set(val *PowerFeedStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedStatus(val *PowerFeedStatus) *NullablePowerFeedStatus { + return &NullablePowerFeedStatus{value: val, isSet: true} +} + +func (v NullablePowerFeedStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_status_label.go new file mode 100644 index 00000000..42299ac6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_status_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerFeedStatusLabel the model 'PowerFeedStatusLabel' +type PowerFeedStatusLabel string + +// List of PowerFeed_status_label +const ( + POWERFEEDSTATUSLABEL_OFFLINE PowerFeedStatusLabel = "Offline" + POWERFEEDSTATUSLABEL_ACTIVE PowerFeedStatusLabel = "Active" + POWERFEEDSTATUSLABEL_PLANNED PowerFeedStatusLabel = "Planned" + POWERFEEDSTATUSLABEL_FAILED PowerFeedStatusLabel = "Failed" +) + +// All allowed values of PowerFeedStatusLabel enum +var AllowedPowerFeedStatusLabelEnumValues = []PowerFeedStatusLabel{ + "Offline", + "Active", + "Planned", + "Failed", +} + +func (v *PowerFeedStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerFeedStatusLabel(value) + for _, existing := range AllowedPowerFeedStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerFeedStatusLabel", value) +} + +// NewPowerFeedStatusLabelFromValue returns a pointer to a valid PowerFeedStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerFeedStatusLabelFromValue(v string) (*PowerFeedStatusLabel, error) { + ev := PowerFeedStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerFeedStatusLabel: valid values are %v", v, AllowedPowerFeedStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerFeedStatusLabel) IsValid() bool { + for _, existing := range AllowedPowerFeedStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerFeed_status_label value +func (v PowerFeedStatusLabel) Ptr() *PowerFeedStatusLabel { + return &v +} + +type NullablePowerFeedStatusLabel struct { + value *PowerFeedStatusLabel + isSet bool +} + +func (v NullablePowerFeedStatusLabel) Get() *PowerFeedStatusLabel { + return v.value +} + +func (v *NullablePowerFeedStatusLabel) Set(val *PowerFeedStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedStatusLabel(val *PowerFeedStatusLabel) *NullablePowerFeedStatusLabel { + return &NullablePowerFeedStatusLabel{value: val, isSet: true} +} + +func (v NullablePowerFeedStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_supply.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_supply.go new file mode 100644 index 00000000..2219a238 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_supply.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PowerFeedSupply type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerFeedSupply{} + +// PowerFeedSupply struct for PowerFeedSupply +type PowerFeedSupply struct { + Value *PatchedWritablePowerFeedRequestSupply `json:"value,omitempty"` + Label *PowerFeedSupplyLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerFeedSupply PowerFeedSupply + +// NewPowerFeedSupply instantiates a new PowerFeedSupply object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerFeedSupply() *PowerFeedSupply { + this := PowerFeedSupply{} + return &this +} + +// NewPowerFeedSupplyWithDefaults instantiates a new PowerFeedSupply object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerFeedSupplyWithDefaults() *PowerFeedSupply { + this := PowerFeedSupply{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PowerFeedSupply) GetValue() PatchedWritablePowerFeedRequestSupply { + if o == nil || IsNil(o.Value) { + var ret PatchedWritablePowerFeedRequestSupply + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedSupply) GetValueOk() (*PatchedWritablePowerFeedRequestSupply, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PowerFeedSupply) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritablePowerFeedRequestSupply and assigns it to the Value field. +func (o *PowerFeedSupply) SetValue(v PatchedWritablePowerFeedRequestSupply) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerFeedSupply) GetLabel() PowerFeedSupplyLabel { + if o == nil || IsNil(o.Label) { + var ret PowerFeedSupplyLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedSupply) GetLabelOk() (*PowerFeedSupplyLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerFeedSupply) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PowerFeedSupplyLabel and assigns it to the Label field. +func (o *PowerFeedSupply) SetLabel(v PowerFeedSupplyLabel) { + o.Label = &v +} + +func (o PowerFeedSupply) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerFeedSupply) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerFeedSupply) UnmarshalJSON(data []byte) (err error) { + varPowerFeedSupply := _PowerFeedSupply{} + + err = json.Unmarshal(data, &varPowerFeedSupply) + + if err != nil { + return err + } + + *o = PowerFeedSupply(varPowerFeedSupply) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerFeedSupply struct { + value *PowerFeedSupply + isSet bool +} + +func (v NullablePowerFeedSupply) Get() *PowerFeedSupply { + return v.value +} + +func (v *NullablePowerFeedSupply) Set(val *PowerFeedSupply) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedSupply) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedSupply) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedSupply(val *PowerFeedSupply) *NullablePowerFeedSupply { + return &NullablePowerFeedSupply{value: val, isSet: true} +} + +func (v NullablePowerFeedSupply) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedSupply) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_supply_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_supply_label.go new file mode 100644 index 00000000..a636263d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_supply_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerFeedSupplyLabel the model 'PowerFeedSupplyLabel' +type PowerFeedSupplyLabel string + +// List of PowerFeed_supply_label +const ( + POWERFEEDSUPPLYLABEL_AC PowerFeedSupplyLabel = "AC" + POWERFEEDSUPPLYLABEL_DC PowerFeedSupplyLabel = "DC" +) + +// All allowed values of PowerFeedSupplyLabel enum +var AllowedPowerFeedSupplyLabelEnumValues = []PowerFeedSupplyLabel{ + "AC", + "DC", +} + +func (v *PowerFeedSupplyLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerFeedSupplyLabel(value) + for _, existing := range AllowedPowerFeedSupplyLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerFeedSupplyLabel", value) +} + +// NewPowerFeedSupplyLabelFromValue returns a pointer to a valid PowerFeedSupplyLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerFeedSupplyLabelFromValue(v string) (*PowerFeedSupplyLabel, error) { + ev := PowerFeedSupplyLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerFeedSupplyLabel: valid values are %v", v, AllowedPowerFeedSupplyLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerFeedSupplyLabel) IsValid() bool { + for _, existing := range AllowedPowerFeedSupplyLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerFeed_supply_label value +func (v PowerFeedSupplyLabel) Ptr() *PowerFeedSupplyLabel { + return &v +} + +type NullablePowerFeedSupplyLabel struct { + value *PowerFeedSupplyLabel + isSet bool +} + +func (v NullablePowerFeedSupplyLabel) Get() *PowerFeedSupplyLabel { + return v.value +} + +func (v *NullablePowerFeedSupplyLabel) Set(val *PowerFeedSupplyLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedSupplyLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedSupplyLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedSupplyLabel(val *PowerFeedSupplyLabel) *NullablePowerFeedSupplyLabel { + return &NullablePowerFeedSupplyLabel{value: val, isSet: true} +} + +func (v NullablePowerFeedSupplyLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedSupplyLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_type.go new file mode 100644 index 00000000..c8f40c00 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PowerFeedType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerFeedType{} + +// PowerFeedType struct for PowerFeedType +type PowerFeedType struct { + Value *PatchedWritablePowerFeedRequestType `json:"value,omitempty"` + Label *PowerFeedTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerFeedType PowerFeedType + +// NewPowerFeedType instantiates a new PowerFeedType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerFeedType() *PowerFeedType { + this := PowerFeedType{} + return &this +} + +// NewPowerFeedTypeWithDefaults instantiates a new PowerFeedType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerFeedTypeWithDefaults() *PowerFeedType { + this := PowerFeedType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PowerFeedType) GetValue() PatchedWritablePowerFeedRequestType { + if o == nil || IsNil(o.Value) { + var ret PatchedWritablePowerFeedRequestType + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedType) GetValueOk() (*PatchedWritablePowerFeedRequestType, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PowerFeedType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritablePowerFeedRequestType and assigns it to the Value field. +func (o *PowerFeedType) SetValue(v PatchedWritablePowerFeedRequestType) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerFeedType) GetLabel() PowerFeedTypeLabel { + if o == nil || IsNil(o.Label) { + var ret PowerFeedTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerFeedType) GetLabelOk() (*PowerFeedTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerFeedType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PowerFeedTypeLabel and assigns it to the Label field. +func (o *PowerFeedType) SetLabel(v PowerFeedTypeLabel) { + o.Label = &v +} + +func (o PowerFeedType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerFeedType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerFeedType) UnmarshalJSON(data []byte) (err error) { + varPowerFeedType := _PowerFeedType{} + + err = json.Unmarshal(data, &varPowerFeedType) + + if err != nil { + return err + } + + *o = PowerFeedType(varPowerFeedType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerFeedType struct { + value *PowerFeedType + isSet bool +} + +func (v NullablePowerFeedType) Get() *PowerFeedType { + return v.value +} + +func (v *NullablePowerFeedType) Set(val *PowerFeedType) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedType) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedType(val *PowerFeedType) *NullablePowerFeedType { + return &NullablePowerFeedType{value: val, isSet: true} +} + +func (v NullablePowerFeedType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_type_label.go new file mode 100644 index 00000000..9802ed9d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_feed_type_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerFeedTypeLabel the model 'PowerFeedTypeLabel' +type PowerFeedTypeLabel string + +// List of PowerFeed_type_label +const ( + POWERFEEDTYPELABEL_PRIMARY PowerFeedTypeLabel = "Primary" + POWERFEEDTYPELABEL_REDUNDANT PowerFeedTypeLabel = "Redundant" +) + +// All allowed values of PowerFeedTypeLabel enum +var AllowedPowerFeedTypeLabelEnumValues = []PowerFeedTypeLabel{ + "Primary", + "Redundant", +} + +func (v *PowerFeedTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerFeedTypeLabel(value) + for _, existing := range AllowedPowerFeedTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerFeedTypeLabel", value) +} + +// NewPowerFeedTypeLabelFromValue returns a pointer to a valid PowerFeedTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerFeedTypeLabelFromValue(v string) (*PowerFeedTypeLabel, error) { + ev := PowerFeedTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerFeedTypeLabel: valid values are %v", v, AllowedPowerFeedTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerFeedTypeLabel) IsValid() bool { + for _, existing := range AllowedPowerFeedTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerFeed_type_label value +func (v PowerFeedTypeLabel) Ptr() *PowerFeedTypeLabel { + return &v +} + +type NullablePowerFeedTypeLabel struct { + value *PowerFeedTypeLabel + isSet bool +} + +func (v NullablePowerFeedTypeLabel) Get() *PowerFeedTypeLabel { + return v.value +} + +func (v *NullablePowerFeedTypeLabel) Set(val *PowerFeedTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerFeedTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerFeedTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerFeedTypeLabel(val *PowerFeedTypeLabel) *NullablePowerFeedTypeLabel { + return &NullablePowerFeedTypeLabel{value: val, isSet: true} +} + +func (v NullablePowerFeedTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerFeedTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet.go new file mode 100644 index 00000000..b24f396d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet.go @@ -0,0 +1,959 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the PowerOutlet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerOutlet{} + +// PowerOutlet Adds support for custom fields and tags. +type PowerOutlet struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Module NullableComponentNestedModule `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerOutletType `json:"type,omitempty"` + PowerPort NullableNestedPowerPort `json:"power_port,omitempty"` + FeedLeg NullablePowerOutletFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` + ConnectedEndpointsType string `json:"connected_endpoints_type"` + ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _PowerOutlet PowerOutlet + +// NewPowerOutlet instantiates a new PowerOutlet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerOutlet(id int32, url string, display string, device NestedDevice, name string, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, connectedEndpoints []interface{}, connectedEndpointsType string, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *PowerOutlet { + this := PowerOutlet{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.ConnectedEndpoints = connectedEndpoints + this.ConnectedEndpointsType = connectedEndpointsType + this.ConnectedEndpointsReachable = connectedEndpointsReachable + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewPowerOutletWithDefaults instantiates a new PowerOutlet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerOutletWithDefaults() *PowerOutlet { + this := PowerOutlet{} + return &this +} + +// GetId returns the Id field value +func (o *PowerOutlet) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PowerOutlet) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *PowerOutlet) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *PowerOutlet) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *PowerOutlet) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *PowerOutlet) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *PowerOutlet) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *PowerOutlet) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutlet) GetModule() ComponentNestedModule { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModule + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutlet) GetModuleOk() (*ComponentNestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PowerOutlet) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModule and assigns it to the Module field. +func (o *PowerOutlet) SetModule(v ComponentNestedModule) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PowerOutlet) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PowerOutlet) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *PowerOutlet) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerOutlet) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerOutlet) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerOutlet) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerOutlet) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutlet) GetType() PowerOutletType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerOutletType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutlet) GetTypeOk() (*PowerOutletType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerOutlet) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerOutletType and assigns it to the Type field. +func (o *PowerOutlet) SetType(v PowerOutletType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerOutlet) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerOutlet) UnsetType() { + o.Type.Unset() +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutlet) GetPowerPort() NestedPowerPort { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret NestedPowerPort + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutlet) GetPowerPortOk() (*NestedPowerPort, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *PowerOutlet) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableNestedPowerPort and assigns it to the PowerPort field. +func (o *PowerOutlet) SetPowerPort(v NestedPowerPort) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *PowerOutlet) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *PowerOutlet) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutlet) GetFeedLeg() PowerOutletFeedLeg { + if o == nil || IsNil(o.FeedLeg.Get()) { + var ret PowerOutletFeedLeg + return ret + } + return *o.FeedLeg.Get() +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutlet) GetFeedLegOk() (*PowerOutletFeedLeg, bool) { + if o == nil { + return nil, false + } + return o.FeedLeg.Get(), o.FeedLeg.IsSet() +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *PowerOutlet) HasFeedLeg() bool { + if o != nil && o.FeedLeg.IsSet() { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given NullablePowerOutletFeedLeg and assigns it to the FeedLeg field. +func (o *PowerOutlet) SetFeedLeg(v PowerOutletFeedLeg) { + o.FeedLeg.Set(&v) +} + +// SetFeedLegNil sets the value for FeedLeg to be an explicit nil +func (o *PowerOutlet) SetFeedLegNil() { + o.FeedLeg.Set(nil) +} + +// UnsetFeedLeg ensures that no value is present for FeedLeg, not even an explicit nil +func (o *PowerOutlet) UnsetFeedLeg() { + o.FeedLeg.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerOutlet) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerOutlet) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerOutlet) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PowerOutlet) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PowerOutlet) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PowerOutlet) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *PowerOutlet) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutlet) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *PowerOutlet) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *PowerOutlet) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *PowerOutlet) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *PowerOutlet) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *PowerOutlet) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *PowerOutlet) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *PowerOutlet) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetConnectedEndpoints returns the ConnectedEndpoints field value +func (o *PowerOutlet) GetConnectedEndpoints() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConnectedEndpoints +} + +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetConnectedEndpointsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConnectedEndpoints, true +} + +// SetConnectedEndpoints sets field value +func (o *PowerOutlet) SetConnectedEndpoints(v []interface{}) { + o.ConnectedEndpoints = v +} + +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value +func (o *PowerOutlet) GetConnectedEndpointsType() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectedEndpointsType +} + +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetConnectedEndpointsTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsType, true +} + +// SetConnectedEndpointsType sets field value +func (o *PowerOutlet) SetConnectedEndpointsType(v string) { + o.ConnectedEndpointsType = v +} + +// GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value +func (o *PowerOutlet) GetConnectedEndpointsReachable() bool { + if o == nil { + var ret bool + return ret + } + + return o.ConnectedEndpointsReachable +} + +// GetConnectedEndpointsReachableOk returns a tuple with the ConnectedEndpointsReachable field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetConnectedEndpointsReachableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsReachable, true +} + +// SetConnectedEndpointsReachable sets field value +func (o *PowerOutlet) SetConnectedEndpointsReachable(v bool) { + o.ConnectedEndpointsReachable = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerOutlet) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerOutlet) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *PowerOutlet) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerOutlet) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerOutlet) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerOutlet) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerOutlet) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutlet) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *PowerOutlet) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerOutlet) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutlet) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *PowerOutlet) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *PowerOutlet) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *PowerOutlet) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *PowerOutlet) SetOccupied(v bool) { + o.Occupied = v +} + +func (o PowerOutlet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerOutlet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if o.FeedLeg.IsSet() { + toSerialize["feed_leg"] = o.FeedLeg.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + toSerialize["connected_endpoints"] = o.ConnectedEndpoints + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType + toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerOutlet) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "connected_endpoints", + "connected_endpoints_type", + "connected_endpoints_reachable", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerOutlet := _PowerOutlet{} + + err = json.Unmarshal(data, &varPowerOutlet) + + if err != nil { + return err + } + + *o = PowerOutlet(varPowerOutlet) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "connected_endpoints") + delete(additionalProperties, "connected_endpoints_type") + delete(additionalProperties, "connected_endpoints_reachable") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerOutlet struct { + value *PowerOutlet + isSet bool +} + +func (v NullablePowerOutlet) Get() *PowerOutlet { + return v.value +} + +func (v *NullablePowerOutlet) Set(val *PowerOutlet) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutlet) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutlet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutlet(val *PowerOutlet) *NullablePowerOutlet { + return &NullablePowerOutlet{value: val, isSet: true} +} + +func (v NullablePowerOutlet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutlet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg.go new file mode 100644 index 00000000..a96825df --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PowerOutletFeedLeg type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerOutletFeedLeg{} + +// PowerOutletFeedLeg struct for PowerOutletFeedLeg +type PowerOutletFeedLeg struct { + Value *PowerOutletFeedLegValue `json:"value,omitempty"` + Label *PowerOutletFeedLegLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerOutletFeedLeg PowerOutletFeedLeg + +// NewPowerOutletFeedLeg instantiates a new PowerOutletFeedLeg object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerOutletFeedLeg() *PowerOutletFeedLeg { + this := PowerOutletFeedLeg{} + return &this +} + +// NewPowerOutletFeedLegWithDefaults instantiates a new PowerOutletFeedLeg object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerOutletFeedLegWithDefaults() *PowerOutletFeedLeg { + this := PowerOutletFeedLeg{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PowerOutletFeedLeg) GetValue() PowerOutletFeedLegValue { + if o == nil || IsNil(o.Value) { + var ret PowerOutletFeedLegValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletFeedLeg) GetValueOk() (*PowerOutletFeedLegValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PowerOutletFeedLeg) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PowerOutletFeedLegValue and assigns it to the Value field. +func (o *PowerOutletFeedLeg) SetValue(v PowerOutletFeedLegValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerOutletFeedLeg) GetLabel() PowerOutletFeedLegLabel { + if o == nil || IsNil(o.Label) { + var ret PowerOutletFeedLegLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletFeedLeg) GetLabelOk() (*PowerOutletFeedLegLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerOutletFeedLeg) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PowerOutletFeedLegLabel and assigns it to the Label field. +func (o *PowerOutletFeedLeg) SetLabel(v PowerOutletFeedLegLabel) { + o.Label = &v +} + +func (o PowerOutletFeedLeg) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerOutletFeedLeg) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerOutletFeedLeg) UnmarshalJSON(data []byte) (err error) { + varPowerOutletFeedLeg := _PowerOutletFeedLeg{} + + err = json.Unmarshal(data, &varPowerOutletFeedLeg) + + if err != nil { + return err + } + + *o = PowerOutletFeedLeg(varPowerOutletFeedLeg) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerOutletFeedLeg struct { + value *PowerOutletFeedLeg + isSet bool +} + +func (v NullablePowerOutletFeedLeg) Get() *PowerOutletFeedLeg { + return v.value +} + +func (v *NullablePowerOutletFeedLeg) Set(val *PowerOutletFeedLeg) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletFeedLeg) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletFeedLeg) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletFeedLeg(val *PowerOutletFeedLeg) *NullablePowerOutletFeedLeg { + return &NullablePowerOutletFeedLeg{value: val, isSet: true} +} + +func (v NullablePowerOutletFeedLeg) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletFeedLeg) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg_label.go new file mode 100644 index 00000000..074c9814 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerOutletFeedLegLabel the model 'PowerOutletFeedLegLabel' +type PowerOutletFeedLegLabel string + +// List of PowerOutlet_feed_leg_label +const ( + POWEROUTLETFEEDLEGLABEL_A PowerOutletFeedLegLabel = "A" + POWEROUTLETFEEDLEGLABEL_B PowerOutletFeedLegLabel = "B" + POWEROUTLETFEEDLEGLABEL_C PowerOutletFeedLegLabel = "C" +) + +// All allowed values of PowerOutletFeedLegLabel enum +var AllowedPowerOutletFeedLegLabelEnumValues = []PowerOutletFeedLegLabel{ + "A", + "B", + "C", +} + +func (v *PowerOutletFeedLegLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerOutletFeedLegLabel(value) + for _, existing := range AllowedPowerOutletFeedLegLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerOutletFeedLegLabel", value) +} + +// NewPowerOutletFeedLegLabelFromValue returns a pointer to a valid PowerOutletFeedLegLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerOutletFeedLegLabelFromValue(v string) (*PowerOutletFeedLegLabel, error) { + ev := PowerOutletFeedLegLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerOutletFeedLegLabel: valid values are %v", v, AllowedPowerOutletFeedLegLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerOutletFeedLegLabel) IsValid() bool { + for _, existing := range AllowedPowerOutletFeedLegLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerOutlet_feed_leg_label value +func (v PowerOutletFeedLegLabel) Ptr() *PowerOutletFeedLegLabel { + return &v +} + +type NullablePowerOutletFeedLegLabel struct { + value *PowerOutletFeedLegLabel + isSet bool +} + +func (v NullablePowerOutletFeedLegLabel) Get() *PowerOutletFeedLegLabel { + return v.value +} + +func (v *NullablePowerOutletFeedLegLabel) Set(val *PowerOutletFeedLegLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletFeedLegLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletFeedLegLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletFeedLegLabel(val *PowerOutletFeedLegLabel) *NullablePowerOutletFeedLegLabel { + return &NullablePowerOutletFeedLegLabel{value: val, isSet: true} +} + +func (v NullablePowerOutletFeedLegLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletFeedLegLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg_value.go new file mode 100644 index 00000000..70ba4903 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_feed_leg_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerOutletFeedLegValue * `A` - A * `B` - B * `C` - C +type PowerOutletFeedLegValue string + +// List of PowerOutlet_feed_leg_value +const ( + POWEROUTLETFEEDLEGVALUE_A PowerOutletFeedLegValue = "A" + POWEROUTLETFEEDLEGVALUE_B PowerOutletFeedLegValue = "B" + POWEROUTLETFEEDLEGVALUE_C PowerOutletFeedLegValue = "C" + POWEROUTLETFEEDLEGVALUE_EMPTY PowerOutletFeedLegValue = "" +) + +// All allowed values of PowerOutletFeedLegValue enum +var AllowedPowerOutletFeedLegValueEnumValues = []PowerOutletFeedLegValue{ + "A", + "B", + "C", + "", +} + +func (v *PowerOutletFeedLegValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerOutletFeedLegValue(value) + for _, existing := range AllowedPowerOutletFeedLegValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerOutletFeedLegValue", value) +} + +// NewPowerOutletFeedLegValueFromValue returns a pointer to a valid PowerOutletFeedLegValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerOutletFeedLegValueFromValue(v string) (*PowerOutletFeedLegValue, error) { + ev := PowerOutletFeedLegValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerOutletFeedLegValue: valid values are %v", v, AllowedPowerOutletFeedLegValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerOutletFeedLegValue) IsValid() bool { + for _, existing := range AllowedPowerOutletFeedLegValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerOutlet_feed_leg_value value +func (v PowerOutletFeedLegValue) Ptr() *PowerOutletFeedLegValue { + return &v +} + +type NullablePowerOutletFeedLegValue struct { + value *PowerOutletFeedLegValue + isSet bool +} + +func (v NullablePowerOutletFeedLegValue) Get() *PowerOutletFeedLegValue { + return v.value +} + +func (v *NullablePowerOutletFeedLegValue) Set(val *PowerOutletFeedLegValue) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletFeedLegValue) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletFeedLegValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletFeedLegValue(val *PowerOutletFeedLegValue) *NullablePowerOutletFeedLegValue { + return &NullablePowerOutletFeedLegValue{value: val, isSet: true} +} + +func (v NullablePowerOutletFeedLegValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletFeedLegValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request.go new file mode 100644 index 00000000..53179096 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request.go @@ -0,0 +1,574 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PowerOutletRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerOutletRequest{} + +// PowerOutletRequest Adds support for custom fields and tags. +type PowerOutletRequest struct { + Device NestedDeviceRequest `json:"device"` + Module NullableComponentNestedModuleRequest `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerOutletRequestType `json:"type,omitempty"` + PowerPort NullableNestedPowerPortRequest `json:"power_port,omitempty"` + FeedLeg NullablePowerOutletRequestFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerOutletRequest PowerOutletRequest + +// NewPowerOutletRequest instantiates a new PowerOutletRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerOutletRequest(device NestedDeviceRequest, name string) *PowerOutletRequest { + this := PowerOutletRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewPowerOutletRequestWithDefaults instantiates a new PowerOutletRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerOutletRequestWithDefaults() *PowerOutletRequest { + this := PowerOutletRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *PowerOutletRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *PowerOutletRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *PowerOutletRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletRequest) GetModule() ComponentNestedModuleRequest { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModuleRequest + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletRequest) GetModuleOk() (*ComponentNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModuleRequest and assigns it to the Module field. +func (o *PowerOutletRequest) SetModule(v ComponentNestedModuleRequest) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PowerOutletRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PowerOutletRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *PowerOutletRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerOutletRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerOutletRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerOutletRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerOutletRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletRequest) GetType() PowerOutletRequestType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerOutletRequestType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletRequest) GetTypeOk() (*PowerOutletRequestType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerOutletRequestType and assigns it to the Type field. +func (o *PowerOutletRequest) SetType(v PowerOutletRequestType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerOutletRequest) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerOutletRequest) UnsetType() { + o.Type.Unset() +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletRequest) GetPowerPort() NestedPowerPortRequest { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret NestedPowerPortRequest + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletRequest) GetPowerPortOk() (*NestedPowerPortRequest, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableNestedPowerPortRequest and assigns it to the PowerPort field. +func (o *PowerOutletRequest) SetPowerPort(v NestedPowerPortRequest) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *PowerOutletRequest) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *PowerOutletRequest) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletRequest) GetFeedLeg() PowerOutletRequestFeedLeg { + if o == nil || IsNil(o.FeedLeg.Get()) { + var ret PowerOutletRequestFeedLeg + return ret + } + return *o.FeedLeg.Get() +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletRequest) GetFeedLegOk() (*PowerOutletRequestFeedLeg, bool) { + if o == nil { + return nil, false + } + return o.FeedLeg.Get(), o.FeedLeg.IsSet() +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasFeedLeg() bool { + if o != nil && o.FeedLeg.IsSet() { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given NullablePowerOutletRequestFeedLeg and assigns it to the FeedLeg field. +func (o *PowerOutletRequest) SetFeedLeg(v PowerOutletRequestFeedLeg) { + o.FeedLeg.Set(&v) +} + +// SetFeedLegNil sets the value for FeedLeg to be an explicit nil +func (o *PowerOutletRequest) SetFeedLegNil() { + o.FeedLeg.Set(nil) +} + +// UnsetFeedLeg ensures that no value is present for FeedLeg, not even an explicit nil +func (o *PowerOutletRequest) UnsetFeedLeg() { + o.FeedLeg.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerOutletRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerOutletRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PowerOutletRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PowerOutletRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerOutletRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PowerOutletRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerOutletRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerOutletRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerOutletRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PowerOutletRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerOutletRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if o.FeedLeg.IsSet() { + toSerialize["feed_leg"] = o.FeedLeg.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerOutletRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerOutletRequest := _PowerOutletRequest{} + + err = json.Unmarshal(data, &varPowerOutletRequest) + + if err != nil { + return err + } + + *o = PowerOutletRequest(varPowerOutletRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerOutletRequest struct { + value *PowerOutletRequest + isSet bool +} + +func (v NullablePowerOutletRequest) Get() *PowerOutletRequest { + return v.value +} + +func (v *NullablePowerOutletRequest) Set(val *PowerOutletRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletRequest(val *PowerOutletRequest) *NullablePowerOutletRequest { + return &NullablePowerOutletRequest{value: val, isSet: true} +} + +func (v NullablePowerOutletRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request_feed_leg.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request_feed_leg.go new file mode 100644 index 00000000..b83f1e20 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request_feed_leg.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerOutletRequestFeedLeg * `A` - A * `B` - B * `C` - C +type PowerOutletRequestFeedLeg string + +// List of PowerOutletRequest_feed_leg +const ( + POWEROUTLETREQUESTFEEDLEG_A PowerOutletRequestFeedLeg = "A" + POWEROUTLETREQUESTFEEDLEG_B PowerOutletRequestFeedLeg = "B" + POWEROUTLETREQUESTFEEDLEG_C PowerOutletRequestFeedLeg = "C" + POWEROUTLETREQUESTFEEDLEG_EMPTY PowerOutletRequestFeedLeg = "" +) + +// All allowed values of PowerOutletRequestFeedLeg enum +var AllowedPowerOutletRequestFeedLegEnumValues = []PowerOutletRequestFeedLeg{ + "A", + "B", + "C", + "", +} + +func (v *PowerOutletRequestFeedLeg) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerOutletRequestFeedLeg(value) + for _, existing := range AllowedPowerOutletRequestFeedLegEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerOutletRequestFeedLeg", value) +} + +// NewPowerOutletRequestFeedLegFromValue returns a pointer to a valid PowerOutletRequestFeedLeg +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerOutletRequestFeedLegFromValue(v string) (*PowerOutletRequestFeedLeg, error) { + ev := PowerOutletRequestFeedLeg(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerOutletRequestFeedLeg: valid values are %v", v, AllowedPowerOutletRequestFeedLegEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerOutletRequestFeedLeg) IsValid() bool { + for _, existing := range AllowedPowerOutletRequestFeedLegEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerOutletRequest_feed_leg value +func (v PowerOutletRequestFeedLeg) Ptr() *PowerOutletRequestFeedLeg { + return &v +} + +type NullablePowerOutletRequestFeedLeg struct { + value *PowerOutletRequestFeedLeg + isSet bool +} + +func (v NullablePowerOutletRequestFeedLeg) Get() *PowerOutletRequestFeedLeg { + return v.value +} + +func (v *NullablePowerOutletRequestFeedLeg) Set(val *PowerOutletRequestFeedLeg) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletRequestFeedLeg) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletRequestFeedLeg) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletRequestFeedLeg(val *PowerOutletRequestFeedLeg) *NullablePowerOutletRequestFeedLeg { + return &NullablePowerOutletRequestFeedLeg{value: val, isSet: true} +} + +func (v NullablePowerOutletRequestFeedLeg) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletRequestFeedLeg) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request_type.go new file mode 100644 index 00000000..4d2b3436 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_request_type.go @@ -0,0 +1,294 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerOutletRequestType * `iec-60320-c5` - C5 * `iec-60320-c7` - C7 * `iec-60320-c13` - C13 * `iec-60320-c15` - C15 * `iec-60320-c19` - C19 * `iec-60320-c21` - C21 * `iec-60309-p-n-e-4h` - P+N+E 4H * `iec-60309-p-n-e-6h` - P+N+E 6H * `iec-60309-p-n-e-9h` - P+N+E 9H * `iec-60309-2p-e-4h` - 2P+E 4H * `iec-60309-2p-e-6h` - 2P+E 6H * `iec-60309-2p-e-9h` - 2P+E 9H * `iec-60309-3p-e-4h` - 3P+E 4H * `iec-60309-3p-e-6h` - 3P+E 6H * `iec-60309-3p-e-9h` - 3P+E 9H * `iec-60309-3p-n-e-4h` - 3P+N+E 4H * `iec-60309-3p-n-e-6h` - 3P+N+E 6H * `iec-60309-3p-n-e-9h` - 3P+N+E 9H * `iec-60906-1` - IEC 60906-1 * `nbr-14136-10a` - 2P+T 10A (NBR 14136) * `nbr-14136-20a` - 2P+T 20A (NBR 14136) * `nema-1-15r` - NEMA 1-15R * `nema-5-15r` - NEMA 5-15R * `nema-5-20r` - NEMA 5-20R * `nema-5-30r` - NEMA 5-30R * `nema-5-50r` - NEMA 5-50R * `nema-6-15r` - NEMA 6-15R * `nema-6-20r` - NEMA 6-20R * `nema-6-30r` - NEMA 6-30R * `nema-6-50r` - NEMA 6-50R * `nema-10-30r` - NEMA 10-30R * `nema-10-50r` - NEMA 10-50R * `nema-14-20r` - NEMA 14-20R * `nema-14-30r` - NEMA 14-30R * `nema-14-50r` - NEMA 14-50R * `nema-14-60r` - NEMA 14-60R * `nema-15-15r` - NEMA 15-15R * `nema-15-20r` - NEMA 15-20R * `nema-15-30r` - NEMA 15-30R * `nema-15-50r` - NEMA 15-50R * `nema-15-60r` - NEMA 15-60R * `nema-l1-15r` - NEMA L1-15R * `nema-l5-15r` - NEMA L5-15R * `nema-l5-20r` - NEMA L5-20R * `nema-l5-30r` - NEMA L5-30R * `nema-l5-50r` - NEMA L5-50R * `nema-l6-15r` - NEMA L6-15R * `nema-l6-20r` - NEMA L6-20R * `nema-l6-30r` - NEMA L6-30R * `nema-l6-50r` - NEMA L6-50R * `nema-l10-30r` - NEMA L10-30R * `nema-l14-20r` - NEMA L14-20R * `nema-l14-30r` - NEMA L14-30R * `nema-l14-50r` - NEMA L14-50R * `nema-l14-60r` - NEMA L14-60R * `nema-l15-20r` - NEMA L15-20R * `nema-l15-30r` - NEMA L15-30R * `nema-l15-50r` - NEMA L15-50R * `nema-l15-60r` - NEMA L15-60R * `nema-l21-20r` - NEMA L21-20R * `nema-l21-30r` - NEMA L21-30R * `nema-l22-30r` - NEMA L22-30R * `CS6360C` - CS6360C * `CS6364C` - CS6364C * `CS8164C` - CS8164C * `CS8264C` - CS8264C * `CS8364C` - CS8364C * `CS8464C` - CS8464C * `ita-e` - ITA Type E (CEE 7/5) * `ita-f` - ITA Type F (CEE 7/3) * `ita-g` - ITA Type G (BS 1363) * `ita-h` - ITA Type H * `ita-i` - ITA Type I * `ita-j` - ITA Type J * `ita-k` - ITA Type K * `ita-l` - ITA Type L (CEI 23-50) * `ita-m` - ITA Type M (BS 546) * `ita-n` - ITA Type N * `ita-o` - ITA Type O * `ita-multistandard` - ITA Multistandard * `usb-a` - USB Type A * `usb-micro-b` - USB Micro B * `usb-c` - USB Type C * `dc-terminal` - DC Terminal * `hdot-cx` - HDOT Cx * `saf-d-grid` - Saf-D-Grid * `neutrik-powercon-20a` - Neutrik powerCON (20A) * `neutrik-powercon-32a` - Neutrik powerCON (32A) * `neutrik-powercon-true1` - Neutrik powerCON TRUE1 * `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP * `ubiquiti-smartpower` - Ubiquiti SmartPower * `hardwired` - Hardwired * `other` - Other +type PowerOutletRequestType string + +// List of PowerOutletRequest_type +const ( + POWEROUTLETREQUESTTYPE_IEC_60320_C5 PowerOutletRequestType = "iec-60320-c5" + POWEROUTLETREQUESTTYPE_IEC_60320_C7 PowerOutletRequestType = "iec-60320-c7" + POWEROUTLETREQUESTTYPE_IEC_60320_C13 PowerOutletRequestType = "iec-60320-c13" + POWEROUTLETREQUESTTYPE_IEC_60320_C15 PowerOutletRequestType = "iec-60320-c15" + POWEROUTLETREQUESTTYPE_IEC_60320_C19 PowerOutletRequestType = "iec-60320-c19" + POWEROUTLETREQUESTTYPE_IEC_60320_C21 PowerOutletRequestType = "iec-60320-c21" + POWEROUTLETREQUESTTYPE_IEC_60309_P_N_E_4H PowerOutletRequestType = "iec-60309-p-n-e-4h" + POWEROUTLETREQUESTTYPE_IEC_60309_P_N_E_6H PowerOutletRequestType = "iec-60309-p-n-e-6h" + POWEROUTLETREQUESTTYPE_IEC_60309_P_N_E_9H PowerOutletRequestType = "iec-60309-p-n-e-9h" + POWEROUTLETREQUESTTYPE_IEC_60309_2P_E_4H PowerOutletRequestType = "iec-60309-2p-e-4h" + POWEROUTLETREQUESTTYPE_IEC_60309_2P_E_6H PowerOutletRequestType = "iec-60309-2p-e-6h" + POWEROUTLETREQUESTTYPE_IEC_60309_2P_E_9H PowerOutletRequestType = "iec-60309-2p-e-9h" + POWEROUTLETREQUESTTYPE_IEC_60309_3P_E_4H PowerOutletRequestType = "iec-60309-3p-e-4h" + POWEROUTLETREQUESTTYPE_IEC_60309_3P_E_6H PowerOutletRequestType = "iec-60309-3p-e-6h" + POWEROUTLETREQUESTTYPE_IEC_60309_3P_E_9H PowerOutletRequestType = "iec-60309-3p-e-9h" + POWEROUTLETREQUESTTYPE_IEC_60309_3P_N_E_4H PowerOutletRequestType = "iec-60309-3p-n-e-4h" + POWEROUTLETREQUESTTYPE_IEC_60309_3P_N_E_6H PowerOutletRequestType = "iec-60309-3p-n-e-6h" + POWEROUTLETREQUESTTYPE_IEC_60309_3P_N_E_9H PowerOutletRequestType = "iec-60309-3p-n-e-9h" + POWEROUTLETREQUESTTYPE_IEC_60906_1 PowerOutletRequestType = "iec-60906-1" + POWEROUTLETREQUESTTYPE_NBR_14136_10A PowerOutletRequestType = "nbr-14136-10a" + POWEROUTLETREQUESTTYPE_NBR_14136_20A PowerOutletRequestType = "nbr-14136-20a" + POWEROUTLETREQUESTTYPE_NEMA_1_15R PowerOutletRequestType = "nema-1-15r" + POWEROUTLETREQUESTTYPE_NEMA_5_15R PowerOutletRequestType = "nema-5-15r" + POWEROUTLETREQUESTTYPE_NEMA_5_20R PowerOutletRequestType = "nema-5-20r" + POWEROUTLETREQUESTTYPE_NEMA_5_30R PowerOutletRequestType = "nema-5-30r" + POWEROUTLETREQUESTTYPE_NEMA_5_50R PowerOutletRequestType = "nema-5-50r" + POWEROUTLETREQUESTTYPE_NEMA_6_15R PowerOutletRequestType = "nema-6-15r" + POWEROUTLETREQUESTTYPE_NEMA_6_20R PowerOutletRequestType = "nema-6-20r" + POWEROUTLETREQUESTTYPE_NEMA_6_30R PowerOutletRequestType = "nema-6-30r" + POWEROUTLETREQUESTTYPE_NEMA_6_50R PowerOutletRequestType = "nema-6-50r" + POWEROUTLETREQUESTTYPE_NEMA_10_30R PowerOutletRequestType = "nema-10-30r" + POWEROUTLETREQUESTTYPE_NEMA_10_50R PowerOutletRequestType = "nema-10-50r" + POWEROUTLETREQUESTTYPE_NEMA_14_20R PowerOutletRequestType = "nema-14-20r" + POWEROUTLETREQUESTTYPE_NEMA_14_30R PowerOutletRequestType = "nema-14-30r" + POWEROUTLETREQUESTTYPE_NEMA_14_50R PowerOutletRequestType = "nema-14-50r" + POWEROUTLETREQUESTTYPE_NEMA_14_60R PowerOutletRequestType = "nema-14-60r" + POWEROUTLETREQUESTTYPE_NEMA_15_15R PowerOutletRequestType = "nema-15-15r" + POWEROUTLETREQUESTTYPE_NEMA_15_20R PowerOutletRequestType = "nema-15-20r" + POWEROUTLETREQUESTTYPE_NEMA_15_30R PowerOutletRequestType = "nema-15-30r" + POWEROUTLETREQUESTTYPE_NEMA_15_50R PowerOutletRequestType = "nema-15-50r" + POWEROUTLETREQUESTTYPE_NEMA_15_60R PowerOutletRequestType = "nema-15-60r" + POWEROUTLETREQUESTTYPE_NEMA_L1_15R PowerOutletRequestType = "nema-l1-15r" + POWEROUTLETREQUESTTYPE_NEMA_L5_15R PowerOutletRequestType = "nema-l5-15r" + POWEROUTLETREQUESTTYPE_NEMA_L5_20R PowerOutletRequestType = "nema-l5-20r" + POWEROUTLETREQUESTTYPE_NEMA_L5_30R PowerOutletRequestType = "nema-l5-30r" + POWEROUTLETREQUESTTYPE_NEMA_L5_50R PowerOutletRequestType = "nema-l5-50r" + POWEROUTLETREQUESTTYPE_NEMA_L6_15R PowerOutletRequestType = "nema-l6-15r" + POWEROUTLETREQUESTTYPE_NEMA_L6_20R PowerOutletRequestType = "nema-l6-20r" + POWEROUTLETREQUESTTYPE_NEMA_L6_30R PowerOutletRequestType = "nema-l6-30r" + POWEROUTLETREQUESTTYPE_NEMA_L6_50R PowerOutletRequestType = "nema-l6-50r" + POWEROUTLETREQUESTTYPE_NEMA_L10_30R PowerOutletRequestType = "nema-l10-30r" + POWEROUTLETREQUESTTYPE_NEMA_L14_20R PowerOutletRequestType = "nema-l14-20r" + POWEROUTLETREQUESTTYPE_NEMA_L14_30R PowerOutletRequestType = "nema-l14-30r" + POWEROUTLETREQUESTTYPE_NEMA_L14_50R PowerOutletRequestType = "nema-l14-50r" + POWEROUTLETREQUESTTYPE_NEMA_L14_60R PowerOutletRequestType = "nema-l14-60r" + POWEROUTLETREQUESTTYPE_NEMA_L15_20R PowerOutletRequestType = "nema-l15-20r" + POWEROUTLETREQUESTTYPE_NEMA_L15_30R PowerOutletRequestType = "nema-l15-30r" + POWEROUTLETREQUESTTYPE_NEMA_L15_50R PowerOutletRequestType = "nema-l15-50r" + POWEROUTLETREQUESTTYPE_NEMA_L15_60R PowerOutletRequestType = "nema-l15-60r" + POWEROUTLETREQUESTTYPE_NEMA_L21_20R PowerOutletRequestType = "nema-l21-20r" + POWEROUTLETREQUESTTYPE_NEMA_L21_30R PowerOutletRequestType = "nema-l21-30r" + POWEROUTLETREQUESTTYPE_NEMA_L22_30R PowerOutletRequestType = "nema-l22-30r" + POWEROUTLETREQUESTTYPE_CS6360_C PowerOutletRequestType = "CS6360C" + POWEROUTLETREQUESTTYPE_CS6364_C PowerOutletRequestType = "CS6364C" + POWEROUTLETREQUESTTYPE_CS8164_C PowerOutletRequestType = "CS8164C" + POWEROUTLETREQUESTTYPE_CS8264_C PowerOutletRequestType = "CS8264C" + POWEROUTLETREQUESTTYPE_CS8364_C PowerOutletRequestType = "CS8364C" + POWEROUTLETREQUESTTYPE_CS8464_C PowerOutletRequestType = "CS8464C" + POWEROUTLETREQUESTTYPE_ITA_E PowerOutletRequestType = "ita-e" + POWEROUTLETREQUESTTYPE_ITA_F PowerOutletRequestType = "ita-f" + POWEROUTLETREQUESTTYPE_ITA_G PowerOutletRequestType = "ita-g" + POWEROUTLETREQUESTTYPE_ITA_H PowerOutletRequestType = "ita-h" + POWEROUTLETREQUESTTYPE_ITA_I PowerOutletRequestType = "ita-i" + POWEROUTLETREQUESTTYPE_ITA_J PowerOutletRequestType = "ita-j" + POWEROUTLETREQUESTTYPE_ITA_K PowerOutletRequestType = "ita-k" + POWEROUTLETREQUESTTYPE_ITA_L PowerOutletRequestType = "ita-l" + POWEROUTLETREQUESTTYPE_ITA_M PowerOutletRequestType = "ita-m" + POWEROUTLETREQUESTTYPE_ITA_N PowerOutletRequestType = "ita-n" + POWEROUTLETREQUESTTYPE_ITA_O PowerOutletRequestType = "ita-o" + POWEROUTLETREQUESTTYPE_ITA_MULTISTANDARD PowerOutletRequestType = "ita-multistandard" + POWEROUTLETREQUESTTYPE_USB_A PowerOutletRequestType = "usb-a" + POWEROUTLETREQUESTTYPE_USB_MICRO_B PowerOutletRequestType = "usb-micro-b" + POWEROUTLETREQUESTTYPE_USB_C PowerOutletRequestType = "usb-c" + POWEROUTLETREQUESTTYPE_DC_TERMINAL PowerOutletRequestType = "dc-terminal" + POWEROUTLETREQUESTTYPE_HDOT_CX PowerOutletRequestType = "hdot-cx" + POWEROUTLETREQUESTTYPE_SAF_D_GRID PowerOutletRequestType = "saf-d-grid" + POWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_20A PowerOutletRequestType = "neutrik-powercon-20a" + POWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_32A PowerOutletRequestType = "neutrik-powercon-32a" + POWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_TRUE1 PowerOutletRequestType = "neutrik-powercon-true1" + POWEROUTLETREQUESTTYPE_NEUTRIK_POWERCON_TRUE1_TOP PowerOutletRequestType = "neutrik-powercon-true1-top" + POWEROUTLETREQUESTTYPE_UBIQUITI_SMARTPOWER PowerOutletRequestType = "ubiquiti-smartpower" + POWEROUTLETREQUESTTYPE_HARDWIRED PowerOutletRequestType = "hardwired" + POWEROUTLETREQUESTTYPE_OTHER PowerOutletRequestType = "other" + POWEROUTLETREQUESTTYPE_EMPTY PowerOutletRequestType = "" +) + +// All allowed values of PowerOutletRequestType enum +var AllowedPowerOutletRequestTypeEnumValues = []PowerOutletRequestType{ + "iec-60320-c5", + "iec-60320-c7", + "iec-60320-c13", + "iec-60320-c15", + "iec-60320-c19", + "iec-60320-c21", + "iec-60309-p-n-e-4h", + "iec-60309-p-n-e-6h", + "iec-60309-p-n-e-9h", + "iec-60309-2p-e-4h", + "iec-60309-2p-e-6h", + "iec-60309-2p-e-9h", + "iec-60309-3p-e-4h", + "iec-60309-3p-e-6h", + "iec-60309-3p-e-9h", + "iec-60309-3p-n-e-4h", + "iec-60309-3p-n-e-6h", + "iec-60309-3p-n-e-9h", + "iec-60906-1", + "nbr-14136-10a", + "nbr-14136-20a", + "nema-1-15r", + "nema-5-15r", + "nema-5-20r", + "nema-5-30r", + "nema-5-50r", + "nema-6-15r", + "nema-6-20r", + "nema-6-30r", + "nema-6-50r", + "nema-10-30r", + "nema-10-50r", + "nema-14-20r", + "nema-14-30r", + "nema-14-50r", + "nema-14-60r", + "nema-15-15r", + "nema-15-20r", + "nema-15-30r", + "nema-15-50r", + "nema-15-60r", + "nema-l1-15r", + "nema-l5-15r", + "nema-l5-20r", + "nema-l5-30r", + "nema-l5-50r", + "nema-l6-15r", + "nema-l6-20r", + "nema-l6-30r", + "nema-l6-50r", + "nema-l10-30r", + "nema-l14-20r", + "nema-l14-30r", + "nema-l14-50r", + "nema-l14-60r", + "nema-l15-20r", + "nema-l15-30r", + "nema-l15-50r", + "nema-l15-60r", + "nema-l21-20r", + "nema-l21-30r", + "nema-l22-30r", + "CS6360C", + "CS6364C", + "CS8164C", + "CS8264C", + "CS8364C", + "CS8464C", + "ita-e", + "ita-f", + "ita-g", + "ita-h", + "ita-i", + "ita-j", + "ita-k", + "ita-l", + "ita-m", + "ita-n", + "ita-o", + "ita-multistandard", + "usb-a", + "usb-micro-b", + "usb-c", + "dc-terminal", + "hdot-cx", + "saf-d-grid", + "neutrik-powercon-20a", + "neutrik-powercon-32a", + "neutrik-powercon-true1", + "neutrik-powercon-true1-top", + "ubiquiti-smartpower", + "hardwired", + "other", + "", +} + +func (v *PowerOutletRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerOutletRequestType(value) + for _, existing := range AllowedPowerOutletRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerOutletRequestType", value) +} + +// NewPowerOutletRequestTypeFromValue returns a pointer to a valid PowerOutletRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerOutletRequestTypeFromValue(v string) (*PowerOutletRequestType, error) { + ev := PowerOutletRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerOutletRequestType: valid values are %v", v, AllowedPowerOutletRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerOutletRequestType) IsValid() bool { + for _, existing := range AllowedPowerOutletRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerOutletRequest_type value +func (v PowerOutletRequestType) Ptr() *PowerOutletRequestType { + return &v +} + +type NullablePowerOutletRequestType struct { + value *PowerOutletRequestType + isSet bool +} + +func (v NullablePowerOutletRequestType) Get() *PowerOutletRequestType { + return v.value +} + +func (v *NullablePowerOutletRequestType) Set(val *PowerOutletRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletRequestType(val *PowerOutletRequestType) *NullablePowerOutletRequestType { + return &NullablePowerOutletRequestType{value: val, isSet: true} +} + +func (v NullablePowerOutletRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_template.go new file mode 100644 index 00000000..87979e78 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_template.go @@ -0,0 +1,632 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the PowerOutletTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerOutletTemplate{} + +// PowerOutletTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PowerOutletTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NullableNestedDeviceType `json:"device_type,omitempty"` + ModuleType NullableNestedModuleType `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerOutletType `json:"type,omitempty"` + PowerPort NullableNestedPowerPortTemplate `json:"power_port,omitempty"` + FeedLeg NullablePowerOutletFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _PowerOutletTemplate PowerOutletTemplate + +// NewPowerOutletTemplate instantiates a new PowerOutletTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerOutletTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *PowerOutletTemplate { + this := PowerOutletTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewPowerOutletTemplateWithDefaults instantiates a new PowerOutletTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerOutletTemplateWithDefaults() *PowerOutletTemplate { + this := PowerOutletTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *PowerOutletTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PowerOutletTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *PowerOutletTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *PowerOutletTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *PowerOutletTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *PowerOutletTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplate) GetDeviceType() NestedDeviceType { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceType + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceType and assigns it to the DeviceType field. +func (o *PowerOutletTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PowerOutletTemplate) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PowerOutletTemplate) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplate) GetModuleType() NestedModuleType { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleType + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplate) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleType and assigns it to the ModuleType field. +func (o *PowerOutletTemplate) SetModuleType(v NestedModuleType) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PowerOutletTemplate) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PowerOutletTemplate) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *PowerOutletTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerOutletTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerOutletTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerOutletTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplate) GetType() PowerOutletType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerOutletType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplate) GetTypeOk() (*PowerOutletType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerOutletType and assigns it to the Type field. +func (o *PowerOutletTemplate) SetType(v PowerOutletType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerOutletTemplate) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerOutletTemplate) UnsetType() { + o.Type.Unset() +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplate) GetPowerPort() NestedPowerPortTemplate { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret NestedPowerPortTemplate + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplate) GetPowerPortOk() (*NestedPowerPortTemplate, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableNestedPowerPortTemplate and assigns it to the PowerPort field. +func (o *PowerOutletTemplate) SetPowerPort(v NestedPowerPortTemplate) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *PowerOutletTemplate) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *PowerOutletTemplate) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplate) GetFeedLeg() PowerOutletFeedLeg { + if o == nil || IsNil(o.FeedLeg.Get()) { + var ret PowerOutletFeedLeg + return ret + } + return *o.FeedLeg.Get() +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplate) GetFeedLegOk() (*PowerOutletFeedLeg, bool) { + if o == nil { + return nil, false + } + return o.FeedLeg.Get(), o.FeedLeg.IsSet() +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasFeedLeg() bool { + if o != nil && o.FeedLeg.IsSet() { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given NullablePowerOutletFeedLeg and assigns it to the FeedLeg field. +func (o *PowerOutletTemplate) SetFeedLeg(v PowerOutletFeedLeg) { + o.FeedLeg.Set(&v) +} + +// SetFeedLegNil sets the value for FeedLeg to be an explicit nil +func (o *PowerOutletTemplate) SetFeedLegNil() { + o.FeedLeg.Set(nil) +} + +// UnsetFeedLeg ensures that no value is present for FeedLeg, not even an explicit nil +func (o *PowerOutletTemplate) UnsetFeedLeg() { + o.FeedLeg.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerOutletTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerOutletTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerOutletTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *PowerOutletTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerOutletTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *PowerOutletTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o PowerOutletTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerOutletTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if o.FeedLeg.IsSet() { + toSerialize["feed_leg"] = o.FeedLeg.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerOutletTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerOutletTemplate := _PowerOutletTemplate{} + + err = json.Unmarshal(data, &varPowerOutletTemplate) + + if err != nil { + return err + } + + *o = PowerOutletTemplate(varPowerOutletTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerOutletTemplate struct { + value *PowerOutletTemplate + isSet bool +} + +func (v NullablePowerOutletTemplate) Get() *PowerOutletTemplate { + return v.value +} + +func (v *NullablePowerOutletTemplate) Set(val *PowerOutletTemplate) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletTemplate(val *PowerOutletTemplate) *NullablePowerOutletTemplate { + return &NullablePowerOutletTemplate{value: val, isSet: true} +} + +func (v NullablePowerOutletTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_template_request.go new file mode 100644 index 00000000..5a1072e7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_template_request.go @@ -0,0 +1,482 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PowerOutletTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerOutletTemplateRequest{} + +// PowerOutletTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PowerOutletTemplateRequest struct { + DeviceType NullableNestedDeviceTypeRequest `json:"device_type,omitempty"` + ModuleType NullableNestedModuleTypeRequest `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerOutletRequestType `json:"type,omitempty"` + PowerPort NullableNestedPowerPortTemplateRequest `json:"power_port,omitempty"` + FeedLeg NullablePowerOutletRequestFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerOutletTemplateRequest PowerOutletTemplateRequest + +// NewPowerOutletTemplateRequest instantiates a new PowerOutletTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerOutletTemplateRequest(name string) *PowerOutletTemplateRequest { + this := PowerOutletTemplateRequest{} + this.Name = name + return &this +} + +// NewPowerOutletTemplateRequestWithDefaults instantiates a new PowerOutletTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerOutletTemplateRequestWithDefaults() *PowerOutletTemplateRequest { + this := PowerOutletTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceTypeRequest + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PowerOutletTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceTypeRequest and assigns it to the DeviceType field. +func (o *PowerOutletTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PowerOutletTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PowerOutletTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplateRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleTypeRequest + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplateRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PowerOutletTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleTypeRequest and assigns it to the ModuleType field. +func (o *PowerOutletTemplateRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PowerOutletTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PowerOutletTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *PowerOutletTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerOutletTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerOutletTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerOutletTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerOutletTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplateRequest) GetType() PowerOutletRequestType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerOutletRequestType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplateRequest) GetTypeOk() (*PowerOutletRequestType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerOutletTemplateRequest) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerOutletRequestType and assigns it to the Type field. +func (o *PowerOutletTemplateRequest) SetType(v PowerOutletRequestType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerOutletTemplateRequest) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerOutletTemplateRequest) UnsetType() { + o.Type.Unset() +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplateRequest) GetPowerPort() NestedPowerPortTemplateRequest { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret NestedPowerPortTemplateRequest + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplateRequest) GetPowerPortOk() (*NestedPowerPortTemplateRequest, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *PowerOutletTemplateRequest) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableNestedPowerPortTemplateRequest and assigns it to the PowerPort field. +func (o *PowerOutletTemplateRequest) SetPowerPort(v NestedPowerPortTemplateRequest) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *PowerOutletTemplateRequest) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *PowerOutletTemplateRequest) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerOutletTemplateRequest) GetFeedLeg() PowerOutletRequestFeedLeg { + if o == nil || IsNil(o.FeedLeg.Get()) { + var ret PowerOutletRequestFeedLeg + return ret + } + return *o.FeedLeg.Get() +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerOutletTemplateRequest) GetFeedLegOk() (*PowerOutletRequestFeedLeg, bool) { + if o == nil { + return nil, false + } + return o.FeedLeg.Get(), o.FeedLeg.IsSet() +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *PowerOutletTemplateRequest) HasFeedLeg() bool { + if o != nil && o.FeedLeg.IsSet() { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given NullablePowerOutletRequestFeedLeg and assigns it to the FeedLeg field. +func (o *PowerOutletTemplateRequest) SetFeedLeg(v PowerOutletRequestFeedLeg) { + o.FeedLeg.Set(&v) +} + +// SetFeedLegNil sets the value for FeedLeg to be an explicit nil +func (o *PowerOutletTemplateRequest) SetFeedLegNil() { + o.FeedLeg.Set(nil) +} + +// UnsetFeedLeg ensures that no value is present for FeedLeg, not even an explicit nil +func (o *PowerOutletTemplateRequest) UnsetFeedLeg() { + o.FeedLeg.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerOutletTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerOutletTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerOutletTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PowerOutletTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerOutletTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if o.FeedLeg.IsSet() { + toSerialize["feed_leg"] = o.FeedLeg.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerOutletTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerOutletTemplateRequest := _PowerOutletTemplateRequest{} + + err = json.Unmarshal(data, &varPowerOutletTemplateRequest) + + if err != nil { + return err + } + + *o = PowerOutletTemplateRequest(varPowerOutletTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerOutletTemplateRequest struct { + value *PowerOutletTemplateRequest + isSet bool +} + +func (v NullablePowerOutletTemplateRequest) Get() *PowerOutletTemplateRequest { + return v.value +} + +func (v *NullablePowerOutletTemplateRequest) Set(val *PowerOutletTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletTemplateRequest(val *PowerOutletTemplateRequest) *NullablePowerOutletTemplateRequest { + return &NullablePowerOutletTemplateRequest{value: val, isSet: true} +} + +func (v NullablePowerOutletTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_type.go new file mode 100644 index 00000000..78940de9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PowerOutletType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerOutletType{} + +// PowerOutletType struct for PowerOutletType +type PowerOutletType struct { + Value *PatchedWritablePowerOutletTemplateRequestType `json:"value,omitempty"` + Label *PowerOutletTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerOutletType PowerOutletType + +// NewPowerOutletType instantiates a new PowerOutletType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerOutletType() *PowerOutletType { + this := PowerOutletType{} + return &this +} + +// NewPowerOutletTypeWithDefaults instantiates a new PowerOutletType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerOutletTypeWithDefaults() *PowerOutletType { + this := PowerOutletType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PowerOutletType) GetValue() PatchedWritablePowerOutletTemplateRequestType { + if o == nil || IsNil(o.Value) { + var ret PatchedWritablePowerOutletTemplateRequestType + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletType) GetValueOk() (*PatchedWritablePowerOutletTemplateRequestType, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PowerOutletType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritablePowerOutletTemplateRequestType and assigns it to the Value field. +func (o *PowerOutletType) SetValue(v PatchedWritablePowerOutletTemplateRequestType) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerOutletType) GetLabel() PowerOutletTypeLabel { + if o == nil || IsNil(o.Label) { + var ret PowerOutletTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerOutletType) GetLabelOk() (*PowerOutletTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerOutletType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PowerOutletTypeLabel and assigns it to the Label field. +func (o *PowerOutletType) SetLabel(v PowerOutletTypeLabel) { + o.Label = &v +} + +func (o PowerOutletType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerOutletType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerOutletType) UnmarshalJSON(data []byte) (err error) { + varPowerOutletType := _PowerOutletType{} + + err = json.Unmarshal(data, &varPowerOutletType) + + if err != nil { + return err + } + + *o = PowerOutletType(varPowerOutletType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerOutletType struct { + value *PowerOutletType + isSet bool +} + +func (v NullablePowerOutletType) Get() *PowerOutletType { + return v.value +} + +func (v *NullablePowerOutletType) Set(val *PowerOutletType) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletType) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletType(val *PowerOutletType) *NullablePowerOutletType { + return &NullablePowerOutletType{value: val, isSet: true} +} + +func (v NullablePowerOutletType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_type_label.go new file mode 100644 index 00000000..5d69d9a8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_outlet_type_label.go @@ -0,0 +1,292 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerOutletTypeLabel the model 'PowerOutletTypeLabel' +type PowerOutletTypeLabel string + +// List of PowerOutlet_type_label +const ( + POWEROUTLETTYPELABEL_C5 PowerOutletTypeLabel = "C5" + POWEROUTLETTYPELABEL_C7 PowerOutletTypeLabel = "C7" + POWEROUTLETTYPELABEL_C13 PowerOutletTypeLabel = "C13" + POWEROUTLETTYPELABEL_C15 PowerOutletTypeLabel = "C15" + POWEROUTLETTYPELABEL_C19 PowerOutletTypeLabel = "C19" + POWEROUTLETTYPELABEL_C21 PowerOutletTypeLabel = "C21" + POWEROUTLETTYPELABEL_PNE_4_H PowerOutletTypeLabel = "P+N+E 4H" + POWEROUTLETTYPELABEL_PNE_6_H PowerOutletTypeLabel = "P+N+E 6H" + POWEROUTLETTYPELABEL_PNE_9_H PowerOutletTypeLabel = "P+N+E 9H" + POWEROUTLETTYPELABEL__2_PE_4_H PowerOutletTypeLabel = "2P+E 4H" + POWEROUTLETTYPELABEL__2_PE_6_H PowerOutletTypeLabel = "2P+E 6H" + POWEROUTLETTYPELABEL__2_PE_9_H PowerOutletTypeLabel = "2P+E 9H" + POWEROUTLETTYPELABEL__3_PE_4_H PowerOutletTypeLabel = "3P+E 4H" + POWEROUTLETTYPELABEL__3_PE_6_H PowerOutletTypeLabel = "3P+E 6H" + POWEROUTLETTYPELABEL__3_PE_9_H PowerOutletTypeLabel = "3P+E 9H" + POWEROUTLETTYPELABEL__3_PNE_4_H PowerOutletTypeLabel = "3P+N+E 4H" + POWEROUTLETTYPELABEL__3_PNE_6_H PowerOutletTypeLabel = "3P+N+E 6H" + POWEROUTLETTYPELABEL__3_PNE_9_H PowerOutletTypeLabel = "3P+N+E 9H" + POWEROUTLETTYPELABEL_IEC_60906_1 PowerOutletTypeLabel = "IEC 60906-1" + POWEROUTLETTYPELABEL__2_PT_10_A__NBR_14136 PowerOutletTypeLabel = "2P+T 10A (NBR 14136)" + POWEROUTLETTYPELABEL__2_PT_20_A__NBR_14136 PowerOutletTypeLabel = "2P+T 20A (NBR 14136)" + POWEROUTLETTYPELABEL_NEMA_1_15_R PowerOutletTypeLabel = "NEMA 1-15R" + POWEROUTLETTYPELABEL_NEMA_5_15_R PowerOutletTypeLabel = "NEMA 5-15R" + POWEROUTLETTYPELABEL_NEMA_5_20_R PowerOutletTypeLabel = "NEMA 5-20R" + POWEROUTLETTYPELABEL_NEMA_5_30_R PowerOutletTypeLabel = "NEMA 5-30R" + POWEROUTLETTYPELABEL_NEMA_5_50_R PowerOutletTypeLabel = "NEMA 5-50R" + POWEROUTLETTYPELABEL_NEMA_6_15_R PowerOutletTypeLabel = "NEMA 6-15R" + POWEROUTLETTYPELABEL_NEMA_6_20_R PowerOutletTypeLabel = "NEMA 6-20R" + POWEROUTLETTYPELABEL_NEMA_6_30_R PowerOutletTypeLabel = "NEMA 6-30R" + POWEROUTLETTYPELABEL_NEMA_6_50_R PowerOutletTypeLabel = "NEMA 6-50R" + POWEROUTLETTYPELABEL_NEMA_10_30_R PowerOutletTypeLabel = "NEMA 10-30R" + POWEROUTLETTYPELABEL_NEMA_10_50_R PowerOutletTypeLabel = "NEMA 10-50R" + POWEROUTLETTYPELABEL_NEMA_14_20_R PowerOutletTypeLabel = "NEMA 14-20R" + POWEROUTLETTYPELABEL_NEMA_14_30_R PowerOutletTypeLabel = "NEMA 14-30R" + POWEROUTLETTYPELABEL_NEMA_14_50_R PowerOutletTypeLabel = "NEMA 14-50R" + POWEROUTLETTYPELABEL_NEMA_14_60_R PowerOutletTypeLabel = "NEMA 14-60R" + POWEROUTLETTYPELABEL_NEMA_15_15_R PowerOutletTypeLabel = "NEMA 15-15R" + POWEROUTLETTYPELABEL_NEMA_15_20_R PowerOutletTypeLabel = "NEMA 15-20R" + POWEROUTLETTYPELABEL_NEMA_15_30_R PowerOutletTypeLabel = "NEMA 15-30R" + POWEROUTLETTYPELABEL_NEMA_15_50_R PowerOutletTypeLabel = "NEMA 15-50R" + POWEROUTLETTYPELABEL_NEMA_15_60_R PowerOutletTypeLabel = "NEMA 15-60R" + POWEROUTLETTYPELABEL_NEMA_L1_15_R PowerOutletTypeLabel = "NEMA L1-15R" + POWEROUTLETTYPELABEL_NEMA_L5_15_R PowerOutletTypeLabel = "NEMA L5-15R" + POWEROUTLETTYPELABEL_NEMA_L5_20_R PowerOutletTypeLabel = "NEMA L5-20R" + POWEROUTLETTYPELABEL_NEMA_L5_30_R PowerOutletTypeLabel = "NEMA L5-30R" + POWEROUTLETTYPELABEL_NEMA_L5_50_R PowerOutletTypeLabel = "NEMA L5-50R" + POWEROUTLETTYPELABEL_NEMA_L6_15_R PowerOutletTypeLabel = "NEMA L6-15R" + POWEROUTLETTYPELABEL_NEMA_L6_20_R PowerOutletTypeLabel = "NEMA L6-20R" + POWEROUTLETTYPELABEL_NEMA_L6_30_R PowerOutletTypeLabel = "NEMA L6-30R" + POWEROUTLETTYPELABEL_NEMA_L6_50_R PowerOutletTypeLabel = "NEMA L6-50R" + POWEROUTLETTYPELABEL_NEMA_L10_30_R PowerOutletTypeLabel = "NEMA L10-30R" + POWEROUTLETTYPELABEL_NEMA_L14_20_R PowerOutletTypeLabel = "NEMA L14-20R" + POWEROUTLETTYPELABEL_NEMA_L14_30_R PowerOutletTypeLabel = "NEMA L14-30R" + POWEROUTLETTYPELABEL_NEMA_L14_50_R PowerOutletTypeLabel = "NEMA L14-50R" + POWEROUTLETTYPELABEL_NEMA_L14_60_R PowerOutletTypeLabel = "NEMA L14-60R" + POWEROUTLETTYPELABEL_NEMA_L15_20_R PowerOutletTypeLabel = "NEMA L15-20R" + POWEROUTLETTYPELABEL_NEMA_L15_30_R PowerOutletTypeLabel = "NEMA L15-30R" + POWEROUTLETTYPELABEL_NEMA_L15_50_R PowerOutletTypeLabel = "NEMA L15-50R" + POWEROUTLETTYPELABEL_NEMA_L15_60_R PowerOutletTypeLabel = "NEMA L15-60R" + POWEROUTLETTYPELABEL_NEMA_L21_20_R PowerOutletTypeLabel = "NEMA L21-20R" + POWEROUTLETTYPELABEL_NEMA_L21_30_R PowerOutletTypeLabel = "NEMA L21-30R" + POWEROUTLETTYPELABEL_NEMA_L22_30_R PowerOutletTypeLabel = "NEMA L22-30R" + POWEROUTLETTYPELABEL_CS6360_C PowerOutletTypeLabel = "CS6360C" + POWEROUTLETTYPELABEL_CS6364_C PowerOutletTypeLabel = "CS6364C" + POWEROUTLETTYPELABEL_CS8164_C PowerOutletTypeLabel = "CS8164C" + POWEROUTLETTYPELABEL_CS8264_C PowerOutletTypeLabel = "CS8264C" + POWEROUTLETTYPELABEL_CS8364_C PowerOutletTypeLabel = "CS8364C" + POWEROUTLETTYPELABEL_CS8464_C PowerOutletTypeLabel = "CS8464C" + POWEROUTLETTYPELABEL_ITA_TYPE_E__CEE_7_5 PowerOutletTypeLabel = "ITA Type E (CEE 7/5)" + POWEROUTLETTYPELABEL_ITA_TYPE_F__CEE_7_3 PowerOutletTypeLabel = "ITA Type F (CEE 7/3)" + POWEROUTLETTYPELABEL_ITA_TYPE_G__BS_1363 PowerOutletTypeLabel = "ITA Type G (BS 1363)" + POWEROUTLETTYPELABEL_ITA_TYPE_H PowerOutletTypeLabel = "ITA Type H" + POWEROUTLETTYPELABEL_ITA_TYPE_I PowerOutletTypeLabel = "ITA Type I" + POWEROUTLETTYPELABEL_ITA_TYPE_J PowerOutletTypeLabel = "ITA Type J" + POWEROUTLETTYPELABEL_ITA_TYPE_K PowerOutletTypeLabel = "ITA Type K" + POWEROUTLETTYPELABEL_ITA_TYPE_L__CEI_23_50 PowerOutletTypeLabel = "ITA Type L (CEI 23-50)" + POWEROUTLETTYPELABEL_ITA_TYPE_M__BS_546 PowerOutletTypeLabel = "ITA Type M (BS 546)" + POWEROUTLETTYPELABEL_ITA_TYPE_N PowerOutletTypeLabel = "ITA Type N" + POWEROUTLETTYPELABEL_ITA_TYPE_O PowerOutletTypeLabel = "ITA Type O" + POWEROUTLETTYPELABEL_ITA_MULTISTANDARD PowerOutletTypeLabel = "ITA Multistandard" + POWEROUTLETTYPELABEL_USB_TYPE_A PowerOutletTypeLabel = "USB Type A" + POWEROUTLETTYPELABEL_USB_MICRO_B PowerOutletTypeLabel = "USB Micro B" + POWEROUTLETTYPELABEL_USB_TYPE_C PowerOutletTypeLabel = "USB Type C" + POWEROUTLETTYPELABEL_DC_TERMINAL PowerOutletTypeLabel = "DC Terminal" + POWEROUTLETTYPELABEL_HDOT_CX PowerOutletTypeLabel = "HDOT Cx" + POWEROUTLETTYPELABEL_SAF_D_GRID PowerOutletTypeLabel = "Saf-D-Grid" + POWEROUTLETTYPELABEL_NEUTRIK_POWER_CON__20_A PowerOutletTypeLabel = "Neutrik powerCON (20A)" + POWEROUTLETTYPELABEL_NEUTRIK_POWER_CON__32_A PowerOutletTypeLabel = "Neutrik powerCON (32A)" + POWEROUTLETTYPELABEL_NEUTRIK_POWER_CON_TRUE1 PowerOutletTypeLabel = "Neutrik powerCON TRUE1" + POWEROUTLETTYPELABEL_NEUTRIK_POWER_CON_TRUE1_TOP PowerOutletTypeLabel = "Neutrik powerCON TRUE1 TOP" + POWEROUTLETTYPELABEL_UBIQUITI_SMART_POWER PowerOutletTypeLabel = "Ubiquiti SmartPower" + POWEROUTLETTYPELABEL_HARDWIRED PowerOutletTypeLabel = "Hardwired" + POWEROUTLETTYPELABEL_OTHER PowerOutletTypeLabel = "Other" +) + +// All allowed values of PowerOutletTypeLabel enum +var AllowedPowerOutletTypeLabelEnumValues = []PowerOutletTypeLabel{ + "C5", + "C7", + "C13", + "C15", + "C19", + "C21", + "P+N+E 4H", + "P+N+E 6H", + "P+N+E 9H", + "2P+E 4H", + "2P+E 6H", + "2P+E 9H", + "3P+E 4H", + "3P+E 6H", + "3P+E 9H", + "3P+N+E 4H", + "3P+N+E 6H", + "3P+N+E 9H", + "IEC 60906-1", + "2P+T 10A (NBR 14136)", + "2P+T 20A (NBR 14136)", + "NEMA 1-15R", + "NEMA 5-15R", + "NEMA 5-20R", + "NEMA 5-30R", + "NEMA 5-50R", + "NEMA 6-15R", + "NEMA 6-20R", + "NEMA 6-30R", + "NEMA 6-50R", + "NEMA 10-30R", + "NEMA 10-50R", + "NEMA 14-20R", + "NEMA 14-30R", + "NEMA 14-50R", + "NEMA 14-60R", + "NEMA 15-15R", + "NEMA 15-20R", + "NEMA 15-30R", + "NEMA 15-50R", + "NEMA 15-60R", + "NEMA L1-15R", + "NEMA L5-15R", + "NEMA L5-20R", + "NEMA L5-30R", + "NEMA L5-50R", + "NEMA L6-15R", + "NEMA L6-20R", + "NEMA L6-30R", + "NEMA L6-50R", + "NEMA L10-30R", + "NEMA L14-20R", + "NEMA L14-30R", + "NEMA L14-50R", + "NEMA L14-60R", + "NEMA L15-20R", + "NEMA L15-30R", + "NEMA L15-50R", + "NEMA L15-60R", + "NEMA L21-20R", + "NEMA L21-30R", + "NEMA L22-30R", + "CS6360C", + "CS6364C", + "CS8164C", + "CS8264C", + "CS8364C", + "CS8464C", + "ITA Type E (CEE 7/5)", + "ITA Type F (CEE 7/3)", + "ITA Type G (BS 1363)", + "ITA Type H", + "ITA Type I", + "ITA Type J", + "ITA Type K", + "ITA Type L (CEI 23-50)", + "ITA Type M (BS 546)", + "ITA Type N", + "ITA Type O", + "ITA Multistandard", + "USB Type A", + "USB Micro B", + "USB Type C", + "DC Terminal", + "HDOT Cx", + "Saf-D-Grid", + "Neutrik powerCON (20A)", + "Neutrik powerCON (32A)", + "Neutrik powerCON TRUE1", + "Neutrik powerCON TRUE1 TOP", + "Ubiquiti SmartPower", + "Hardwired", + "Other", +} + +func (v *PowerOutletTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerOutletTypeLabel(value) + for _, existing := range AllowedPowerOutletTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerOutletTypeLabel", value) +} + +// NewPowerOutletTypeLabelFromValue returns a pointer to a valid PowerOutletTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerOutletTypeLabelFromValue(v string) (*PowerOutletTypeLabel, error) { + ev := PowerOutletTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerOutletTypeLabel: valid values are %v", v, AllowedPowerOutletTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerOutletTypeLabel) IsValid() bool { + for _, existing := range AllowedPowerOutletTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerOutlet_type_label value +func (v PowerOutletTypeLabel) Ptr() *PowerOutletTypeLabel { + return &v +} + +type NullablePowerOutletTypeLabel struct { + value *PowerOutletTypeLabel + isSet bool +} + +func (v NullablePowerOutletTypeLabel) Get() *PowerOutletTypeLabel { + return v.value +} + +func (v *NullablePowerOutletTypeLabel) Set(val *PowerOutletTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerOutletTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerOutletTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerOutletTypeLabel(val *PowerOutletTypeLabel) *NullablePowerOutletTypeLabel { + return &NullablePowerOutletTypeLabel{value: val, isSet: true} +} + +func (v NullablePowerOutletTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerOutletTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_panel.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_panel.go new file mode 100644 index 00000000..d63a7ce6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_panel.go @@ -0,0 +1,570 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the PowerPanel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerPanel{} + +// PowerPanel Adds support for custom fields and tags. +type PowerPanel struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Site NestedSite `json:"site"` + Location NullableNestedLocation `json:"location,omitempty"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + PowerfeedCount int32 `json:"powerfeed_count"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _PowerPanel PowerPanel + +// NewPowerPanel instantiates a new PowerPanel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerPanel(id int32, url string, display string, site NestedSite, name string, powerfeedCount int32, created NullableTime, lastUpdated NullableTime) *PowerPanel { + this := PowerPanel{} + this.Id = id + this.Url = url + this.Display = display + this.Site = site + this.Name = name + this.PowerfeedCount = powerfeedCount + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewPowerPanelWithDefaults instantiates a new PowerPanel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerPanelWithDefaults() *PowerPanel { + this := PowerPanel{} + return &this +} + +// GetId returns the Id field value +func (o *PowerPanel) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PowerPanel) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *PowerPanel) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *PowerPanel) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *PowerPanel) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *PowerPanel) SetDisplay(v string) { + o.Display = v +} + +// GetSite returns the Site field value +func (o *PowerPanel) GetSite() NestedSite { + if o == nil { + var ret NestedSite + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *PowerPanel) SetSite(v NestedSite) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPanel) GetLocation() NestedLocation { + if o == nil || IsNil(o.Location.Get()) { + var ret NestedLocation + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPanel) GetLocationOk() (*NestedLocation, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *PowerPanel) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableNestedLocation and assigns it to the Location field. +func (o *PowerPanel) SetLocation(v NestedLocation) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *PowerPanel) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *PowerPanel) UnsetLocation() { + o.Location.Unset() +} + +// GetName returns the Name field value +func (o *PowerPanel) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerPanel) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerPanel) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerPanel) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerPanel) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PowerPanel) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PowerPanel) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PowerPanel) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerPanel) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerPanel) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *PowerPanel) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerPanel) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerPanel) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerPanel) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetPowerfeedCount returns the PowerfeedCount field value +func (o *PowerPanel) GetPowerfeedCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerfeedCount +} + +// GetPowerfeedCountOk returns a tuple with the PowerfeedCount field value +// and a boolean to check if the value has been set. +func (o *PowerPanel) GetPowerfeedCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerfeedCount, true +} + +// SetPowerfeedCount sets field value +func (o *PowerPanel) SetPowerfeedCount(v int32) { + o.PowerfeedCount = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerPanel) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPanel) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *PowerPanel) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerPanel) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPanel) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *PowerPanel) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o PowerPanel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerPanel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["powerfeed_count"] = o.PowerfeedCount + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerPanel) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "site", + "name", + "powerfeed_count", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerPanel := _PowerPanel{} + + err = json.Unmarshal(data, &varPowerPanel) + + if err != nil { + return err + } + + *o = PowerPanel(varPowerPanel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "powerfeed_count") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerPanel struct { + value *PowerPanel + isSet bool +} + +func (v NullablePowerPanel) Get() *PowerPanel { + return v.value +} + +func (v *NullablePowerPanel) Set(val *PowerPanel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPanel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPanel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPanel(val *PowerPanel) *NullablePowerPanel { + return &NullablePowerPanel{value: val, isSet: true} +} + +func (v NullablePowerPanel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPanel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_panel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_panel_request.go new file mode 100644 index 00000000..a7b1937e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_panel_request.go @@ -0,0 +1,391 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PowerPanelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerPanelRequest{} + +// PowerPanelRequest Adds support for custom fields and tags. +type PowerPanelRequest struct { + Site NestedSiteRequest `json:"site"` + Location NullableNestedLocationRequest `json:"location,omitempty"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerPanelRequest PowerPanelRequest + +// NewPowerPanelRequest instantiates a new PowerPanelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerPanelRequest(site NestedSiteRequest, name string) *PowerPanelRequest { + this := PowerPanelRequest{} + this.Site = site + this.Name = name + return &this +} + +// NewPowerPanelRequestWithDefaults instantiates a new PowerPanelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerPanelRequestWithDefaults() *PowerPanelRequest { + this := PowerPanelRequest{} + return &this +} + +// GetSite returns the Site field value +func (o *PowerPanelRequest) GetSite() NestedSiteRequest { + if o == nil { + var ret NestedSiteRequest + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *PowerPanelRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *PowerPanelRequest) SetSite(v NestedSiteRequest) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPanelRequest) GetLocation() NestedLocationRequest { + if o == nil || IsNil(o.Location.Get()) { + var ret NestedLocationRequest + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPanelRequest) GetLocationOk() (*NestedLocationRequest, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *PowerPanelRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableNestedLocationRequest and assigns it to the Location field. +func (o *PowerPanelRequest) SetLocation(v NestedLocationRequest) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *PowerPanelRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *PowerPanelRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetName returns the Name field value +func (o *PowerPanelRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerPanelRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerPanelRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerPanelRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanelRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerPanelRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerPanelRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PowerPanelRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanelRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PowerPanelRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PowerPanelRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerPanelRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanelRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerPanelRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PowerPanelRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerPanelRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPanelRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerPanelRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerPanelRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PowerPanelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerPanelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerPanelRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "site", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerPanelRequest := _PowerPanelRequest{} + + err = json.Unmarshal(data, &varPowerPanelRequest) + + if err != nil { + return err + } + + *o = PowerPanelRequest(varPowerPanelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerPanelRequest struct { + value *PowerPanelRequest + isSet bool +} + +func (v NullablePowerPanelRequest) Get() *PowerPanelRequest { + return v.value +} + +func (v *NullablePowerPanelRequest) Set(val *PowerPanelRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPanelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPanelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPanelRequest(val *PowerPanelRequest) *NullablePowerPanelRequest { + return &NullablePowerPanelRequest{value: val, isSet: true} +} + +func (v NullablePowerPanelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPanelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_port.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port.go new file mode 100644 index 00000000..a9e4e6b1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port.go @@ -0,0 +1,961 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the PowerPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerPort{} + +// PowerPort Adds support for custom fields and tags. +type PowerPort struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Module NullableComponentNestedModule `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerPortType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + ConnectedEndpoints []interface{} `json:"connected_endpoints"` + ConnectedEndpointsType string `json:"connected_endpoints_type"` + ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _PowerPort PowerPort + +// NewPowerPort instantiates a new PowerPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerPort(id int32, url string, display string, device NestedDevice, name string, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, connectedEndpoints []interface{}, connectedEndpointsType string, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *PowerPort { + this := PowerPort{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.ConnectedEndpoints = connectedEndpoints + this.ConnectedEndpointsType = connectedEndpointsType + this.ConnectedEndpointsReachable = connectedEndpointsReachable + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewPowerPortWithDefaults instantiates a new PowerPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerPortWithDefaults() *PowerPort { + this := PowerPort{} + return &this +} + +// GetId returns the Id field value +func (o *PowerPort) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PowerPort) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *PowerPort) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *PowerPort) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *PowerPort) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *PowerPort) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *PowerPort) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *PowerPort) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPort) GetModule() ComponentNestedModule { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModule + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPort) GetModuleOk() (*ComponentNestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PowerPort) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModule and assigns it to the Module field. +func (o *PowerPort) SetModule(v ComponentNestedModule) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PowerPort) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PowerPort) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *PowerPort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerPort) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerPort) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPort) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerPort) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerPort) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPort) GetType() PowerPortType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerPortType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPort) GetTypeOk() (*PowerPortType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerPort) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerPortType and assigns it to the Type field. +func (o *PowerPort) SetType(v PowerPortType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerPort) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerPort) UnsetType() { + o.Type.Unset() +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPort) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPort) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *PowerPort) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *PowerPort) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *PowerPort) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *PowerPort) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPort) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPort) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *PowerPort) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *PowerPort) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *PowerPort) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *PowerPort) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerPort) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPort) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerPort) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerPort) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PowerPort) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPort) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PowerPort) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PowerPort) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *PowerPort) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPort) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *PowerPort) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *PowerPort) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *PowerPort) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *PowerPort) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *PowerPort) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *PowerPort) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *PowerPort) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetConnectedEndpoints returns the ConnectedEndpoints field value +func (o *PowerPort) GetConnectedEndpoints() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConnectedEndpoints +} + +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetConnectedEndpointsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConnectedEndpoints, true +} + +// SetConnectedEndpoints sets field value +func (o *PowerPort) SetConnectedEndpoints(v []interface{}) { + o.ConnectedEndpoints = v +} + +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value +func (o *PowerPort) GetConnectedEndpointsType() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectedEndpointsType +} + +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetConnectedEndpointsTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsType, true +} + +// SetConnectedEndpointsType sets field value +func (o *PowerPort) SetConnectedEndpointsType(v string) { + o.ConnectedEndpointsType = v +} + +// GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value +func (o *PowerPort) GetConnectedEndpointsReachable() bool { + if o == nil { + var ret bool + return ret + } + + return o.ConnectedEndpointsReachable +} + +// GetConnectedEndpointsReachableOk returns a tuple with the ConnectedEndpointsReachable field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetConnectedEndpointsReachableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedEndpointsReachable, true +} + +// SetConnectedEndpointsReachable sets field value +func (o *PowerPort) SetConnectedEndpointsReachable(v bool) { + o.ConnectedEndpointsReachable = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerPort) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPort) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerPort) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *PowerPort) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerPort) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPort) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerPort) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerPort) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerPort) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPort) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *PowerPort) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerPort) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPort) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *PowerPort) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *PowerPort) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *PowerPort) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *PowerPort) SetOccupied(v bool) { + o.Occupied = v +} + +func (o PowerPort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + toSerialize["connected_endpoints"] = o.ConnectedEndpoints + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType + toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerPort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "connected_endpoints", + "connected_endpoints_type", + "connected_endpoints_reachable", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerPort := _PowerPort{} + + err = json.Unmarshal(data, &varPowerPort) + + if err != nil { + return err + } + + *o = PowerPort(varPowerPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "connected_endpoints") + delete(additionalProperties, "connected_endpoints_type") + delete(additionalProperties, "connected_endpoints_reachable") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerPort struct { + value *PowerPort + isSet bool +} + +func (v NullablePowerPort) Get() *PowerPort { + return v.value +} + +func (v *NullablePowerPort) Set(val *PowerPort) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPort) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPort(val *PowerPort) *NullablePowerPort { + return &NullablePowerPort{value: val, isSet: true} +} + +func (v NullablePowerPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_request.go new file mode 100644 index 00000000..69c67f68 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_request.go @@ -0,0 +1,576 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PowerPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerPortRequest{} + +// PowerPortRequest Adds support for custom fields and tags. +type PowerPortRequest struct { + Device NestedDeviceRequest `json:"device"` + Module NullableComponentNestedModuleRequest `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerPortRequestType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerPortRequest PowerPortRequest + +// NewPowerPortRequest instantiates a new PowerPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerPortRequest(device NestedDeviceRequest, name string) *PowerPortRequest { + this := PowerPortRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewPowerPortRequestWithDefaults instantiates a new PowerPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerPortRequestWithDefaults() *PowerPortRequest { + this := PowerPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *PowerPortRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *PowerPortRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *PowerPortRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortRequest) GetModule() ComponentNestedModuleRequest { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModuleRequest + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortRequest) GetModuleOk() (*ComponentNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *PowerPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModuleRequest and assigns it to the Module field. +func (o *PowerPortRequest) SetModule(v ComponentNestedModuleRequest) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *PowerPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *PowerPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *PowerPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortRequest) GetType() PowerPortRequestType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerPortRequestType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortRequest) GetTypeOk() (*PowerPortRequestType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerPortRequest) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerPortRequestType and assigns it to the Type field. +func (o *PowerPortRequest) SetType(v PowerPortRequestType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerPortRequest) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerPortRequest) UnsetType() { + o.Type.Unset() +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortRequest) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortRequest) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *PowerPortRequest) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *PowerPortRequest) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *PowerPortRequest) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *PowerPortRequest) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortRequest) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortRequest) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *PowerPortRequest) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *PowerPortRequest) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *PowerPortRequest) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *PowerPortRequest) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *PowerPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *PowerPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *PowerPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PowerPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PowerPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PowerPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PowerPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PowerPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PowerPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PowerPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerPortRequest := _PowerPortRequest{} + + err = json.Unmarshal(data, &varPowerPortRequest) + + if err != nil { + return err + } + + *o = PowerPortRequest(varPowerPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerPortRequest struct { + value *PowerPortRequest + isSet bool +} + +func (v NullablePowerPortRequest) Get() *PowerPortRequest { + return v.value +} + +func (v *NullablePowerPortRequest) Set(val *PowerPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPortRequest(val *PowerPortRequest) *NullablePowerPortRequest { + return &NullablePowerPortRequest{value: val, isSet: true} +} + +func (v NullablePowerPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_request_type.go new file mode 100644 index 00000000..2d90cd43 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_request_type.go @@ -0,0 +1,308 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerPortRequestType * `iec-60320-c6` - C6 * `iec-60320-c8` - C8 * `iec-60320-c14` - C14 * `iec-60320-c16` - C16 * `iec-60320-c20` - C20 * `iec-60320-c22` - C22 * `iec-60309-p-n-e-4h` - P+N+E 4H * `iec-60309-p-n-e-6h` - P+N+E 6H * `iec-60309-p-n-e-9h` - P+N+E 9H * `iec-60309-2p-e-4h` - 2P+E 4H * `iec-60309-2p-e-6h` - 2P+E 6H * `iec-60309-2p-e-9h` - 2P+E 9H * `iec-60309-3p-e-4h` - 3P+E 4H * `iec-60309-3p-e-6h` - 3P+E 6H * `iec-60309-3p-e-9h` - 3P+E 9H * `iec-60309-3p-n-e-4h` - 3P+N+E 4H * `iec-60309-3p-n-e-6h` - 3P+N+E 6H * `iec-60309-3p-n-e-9h` - 3P+N+E 9H * `iec-60906-1` - IEC 60906-1 * `nbr-14136-10a` - 2P+T 10A (NBR 14136) * `nbr-14136-20a` - 2P+T 20A (NBR 14136) * `nema-1-15p` - NEMA 1-15P * `nema-5-15p` - NEMA 5-15P * `nema-5-20p` - NEMA 5-20P * `nema-5-30p` - NEMA 5-30P * `nema-5-50p` - NEMA 5-50P * `nema-6-15p` - NEMA 6-15P * `nema-6-20p` - NEMA 6-20P * `nema-6-30p` - NEMA 6-30P * `nema-6-50p` - NEMA 6-50P * `nema-10-30p` - NEMA 10-30P * `nema-10-50p` - NEMA 10-50P * `nema-14-20p` - NEMA 14-20P * `nema-14-30p` - NEMA 14-30P * `nema-14-50p` - NEMA 14-50P * `nema-14-60p` - NEMA 14-60P * `nema-15-15p` - NEMA 15-15P * `nema-15-20p` - NEMA 15-20P * `nema-15-30p` - NEMA 15-30P * `nema-15-50p` - NEMA 15-50P * `nema-15-60p` - NEMA 15-60P * `nema-l1-15p` - NEMA L1-15P * `nema-l5-15p` - NEMA L5-15P * `nema-l5-20p` - NEMA L5-20P * `nema-l5-30p` - NEMA L5-30P * `nema-l5-50p` - NEMA L5-50P * `nema-l6-15p` - NEMA L6-15P * `nema-l6-20p` - NEMA L6-20P * `nema-l6-30p` - NEMA L6-30P * `nema-l6-50p` - NEMA L6-50P * `nema-l10-30p` - NEMA L10-30P * `nema-l14-20p` - NEMA L14-20P * `nema-l14-30p` - NEMA L14-30P * `nema-l14-50p` - NEMA L14-50P * `nema-l14-60p` - NEMA L14-60P * `nema-l15-20p` - NEMA L15-20P * `nema-l15-30p` - NEMA L15-30P * `nema-l15-50p` - NEMA L15-50P * `nema-l15-60p` - NEMA L15-60P * `nema-l21-20p` - NEMA L21-20P * `nema-l21-30p` - NEMA L21-30P * `nema-l22-30p` - NEMA L22-30P * `cs6361c` - CS6361C * `cs6365c` - CS6365C * `cs8165c` - CS8165C * `cs8265c` - CS8265C * `cs8365c` - CS8365C * `cs8465c` - CS8465C * `ita-c` - ITA Type C (CEE 7/16) * `ita-e` - ITA Type E (CEE 7/6) * `ita-f` - ITA Type F (CEE 7/4) * `ita-ef` - ITA Type E/F (CEE 7/7) * `ita-g` - ITA Type G (BS 1363) * `ita-h` - ITA Type H * `ita-i` - ITA Type I * `ita-j` - ITA Type J * `ita-k` - ITA Type K * `ita-l` - ITA Type L (CEI 23-50) * `ita-m` - ITA Type M (BS 546) * `ita-n` - ITA Type N * `ita-o` - ITA Type O * `usb-a` - USB Type A * `usb-b` - USB Type B * `usb-c` - USB Type C * `usb-mini-a` - USB Mini A * `usb-mini-b` - USB Mini B * `usb-micro-a` - USB Micro A * `usb-micro-b` - USB Micro B * `usb-micro-ab` - USB Micro AB * `usb-3-b` - USB 3.0 Type B * `usb-3-micro-b` - USB 3.0 Micro B * `dc-terminal` - DC Terminal * `saf-d-grid` - Saf-D-Grid * `neutrik-powercon-20` - Neutrik powerCON (20A) * `neutrik-powercon-32` - Neutrik powerCON (32A) * `neutrik-powercon-true1` - Neutrik powerCON TRUE1 * `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP * `ubiquiti-smartpower` - Ubiquiti SmartPower * `hardwired` - Hardwired * `other` - Other +type PowerPortRequestType string + +// List of PowerPortRequest_type +const ( + POWERPORTREQUESTTYPE_IEC_60320_C6 PowerPortRequestType = "iec-60320-c6" + POWERPORTREQUESTTYPE_IEC_60320_C8 PowerPortRequestType = "iec-60320-c8" + POWERPORTREQUESTTYPE_IEC_60320_C14 PowerPortRequestType = "iec-60320-c14" + POWERPORTREQUESTTYPE_IEC_60320_C16 PowerPortRequestType = "iec-60320-c16" + POWERPORTREQUESTTYPE_IEC_60320_C20 PowerPortRequestType = "iec-60320-c20" + POWERPORTREQUESTTYPE_IEC_60320_C22 PowerPortRequestType = "iec-60320-c22" + POWERPORTREQUESTTYPE_IEC_60309_P_N_E_4H PowerPortRequestType = "iec-60309-p-n-e-4h" + POWERPORTREQUESTTYPE_IEC_60309_P_N_E_6H PowerPortRequestType = "iec-60309-p-n-e-6h" + POWERPORTREQUESTTYPE_IEC_60309_P_N_E_9H PowerPortRequestType = "iec-60309-p-n-e-9h" + POWERPORTREQUESTTYPE_IEC_60309_2P_E_4H PowerPortRequestType = "iec-60309-2p-e-4h" + POWERPORTREQUESTTYPE_IEC_60309_2P_E_6H PowerPortRequestType = "iec-60309-2p-e-6h" + POWERPORTREQUESTTYPE_IEC_60309_2P_E_9H PowerPortRequestType = "iec-60309-2p-e-9h" + POWERPORTREQUESTTYPE_IEC_60309_3P_E_4H PowerPortRequestType = "iec-60309-3p-e-4h" + POWERPORTREQUESTTYPE_IEC_60309_3P_E_6H PowerPortRequestType = "iec-60309-3p-e-6h" + POWERPORTREQUESTTYPE_IEC_60309_3P_E_9H PowerPortRequestType = "iec-60309-3p-e-9h" + POWERPORTREQUESTTYPE_IEC_60309_3P_N_E_4H PowerPortRequestType = "iec-60309-3p-n-e-4h" + POWERPORTREQUESTTYPE_IEC_60309_3P_N_E_6H PowerPortRequestType = "iec-60309-3p-n-e-6h" + POWERPORTREQUESTTYPE_IEC_60309_3P_N_E_9H PowerPortRequestType = "iec-60309-3p-n-e-9h" + POWERPORTREQUESTTYPE_IEC_60906_1 PowerPortRequestType = "iec-60906-1" + POWERPORTREQUESTTYPE_NBR_14136_10A PowerPortRequestType = "nbr-14136-10a" + POWERPORTREQUESTTYPE_NBR_14136_20A PowerPortRequestType = "nbr-14136-20a" + POWERPORTREQUESTTYPE_NEMA_1_15P PowerPortRequestType = "nema-1-15p" + POWERPORTREQUESTTYPE_NEMA_5_15P PowerPortRequestType = "nema-5-15p" + POWERPORTREQUESTTYPE_NEMA_5_20P PowerPortRequestType = "nema-5-20p" + POWERPORTREQUESTTYPE_NEMA_5_30P PowerPortRequestType = "nema-5-30p" + POWERPORTREQUESTTYPE_NEMA_5_50P PowerPortRequestType = "nema-5-50p" + POWERPORTREQUESTTYPE_NEMA_6_15P PowerPortRequestType = "nema-6-15p" + POWERPORTREQUESTTYPE_NEMA_6_20P PowerPortRequestType = "nema-6-20p" + POWERPORTREQUESTTYPE_NEMA_6_30P PowerPortRequestType = "nema-6-30p" + POWERPORTREQUESTTYPE_NEMA_6_50P PowerPortRequestType = "nema-6-50p" + POWERPORTREQUESTTYPE_NEMA_10_30P PowerPortRequestType = "nema-10-30p" + POWERPORTREQUESTTYPE_NEMA_10_50P PowerPortRequestType = "nema-10-50p" + POWERPORTREQUESTTYPE_NEMA_14_20P PowerPortRequestType = "nema-14-20p" + POWERPORTREQUESTTYPE_NEMA_14_30P PowerPortRequestType = "nema-14-30p" + POWERPORTREQUESTTYPE_NEMA_14_50P PowerPortRequestType = "nema-14-50p" + POWERPORTREQUESTTYPE_NEMA_14_60P PowerPortRequestType = "nema-14-60p" + POWERPORTREQUESTTYPE_NEMA_15_15P PowerPortRequestType = "nema-15-15p" + POWERPORTREQUESTTYPE_NEMA_15_20P PowerPortRequestType = "nema-15-20p" + POWERPORTREQUESTTYPE_NEMA_15_30P PowerPortRequestType = "nema-15-30p" + POWERPORTREQUESTTYPE_NEMA_15_50P PowerPortRequestType = "nema-15-50p" + POWERPORTREQUESTTYPE_NEMA_15_60P PowerPortRequestType = "nema-15-60p" + POWERPORTREQUESTTYPE_NEMA_L1_15P PowerPortRequestType = "nema-l1-15p" + POWERPORTREQUESTTYPE_NEMA_L5_15P PowerPortRequestType = "nema-l5-15p" + POWERPORTREQUESTTYPE_NEMA_L5_20P PowerPortRequestType = "nema-l5-20p" + POWERPORTREQUESTTYPE_NEMA_L5_30P PowerPortRequestType = "nema-l5-30p" + POWERPORTREQUESTTYPE_NEMA_L5_50P PowerPortRequestType = "nema-l5-50p" + POWERPORTREQUESTTYPE_NEMA_L6_15P PowerPortRequestType = "nema-l6-15p" + POWERPORTREQUESTTYPE_NEMA_L6_20P PowerPortRequestType = "nema-l6-20p" + POWERPORTREQUESTTYPE_NEMA_L6_30P PowerPortRequestType = "nema-l6-30p" + POWERPORTREQUESTTYPE_NEMA_L6_50P PowerPortRequestType = "nema-l6-50p" + POWERPORTREQUESTTYPE_NEMA_L10_30P PowerPortRequestType = "nema-l10-30p" + POWERPORTREQUESTTYPE_NEMA_L14_20P PowerPortRequestType = "nema-l14-20p" + POWERPORTREQUESTTYPE_NEMA_L14_30P PowerPortRequestType = "nema-l14-30p" + POWERPORTREQUESTTYPE_NEMA_L14_50P PowerPortRequestType = "nema-l14-50p" + POWERPORTREQUESTTYPE_NEMA_L14_60P PowerPortRequestType = "nema-l14-60p" + POWERPORTREQUESTTYPE_NEMA_L15_20P PowerPortRequestType = "nema-l15-20p" + POWERPORTREQUESTTYPE_NEMA_L15_30P PowerPortRequestType = "nema-l15-30p" + POWERPORTREQUESTTYPE_NEMA_L15_50P PowerPortRequestType = "nema-l15-50p" + POWERPORTREQUESTTYPE_NEMA_L15_60P PowerPortRequestType = "nema-l15-60p" + POWERPORTREQUESTTYPE_NEMA_L21_20P PowerPortRequestType = "nema-l21-20p" + POWERPORTREQUESTTYPE_NEMA_L21_30P PowerPortRequestType = "nema-l21-30p" + POWERPORTREQUESTTYPE_NEMA_L22_30P PowerPortRequestType = "nema-l22-30p" + POWERPORTREQUESTTYPE_CS6361C PowerPortRequestType = "cs6361c" + POWERPORTREQUESTTYPE_CS6365C PowerPortRequestType = "cs6365c" + POWERPORTREQUESTTYPE_CS8165C PowerPortRequestType = "cs8165c" + POWERPORTREQUESTTYPE_CS8265C PowerPortRequestType = "cs8265c" + POWERPORTREQUESTTYPE_CS8365C PowerPortRequestType = "cs8365c" + POWERPORTREQUESTTYPE_CS8465C PowerPortRequestType = "cs8465c" + POWERPORTREQUESTTYPE_ITA_C PowerPortRequestType = "ita-c" + POWERPORTREQUESTTYPE_ITA_E PowerPortRequestType = "ita-e" + POWERPORTREQUESTTYPE_ITA_F PowerPortRequestType = "ita-f" + POWERPORTREQUESTTYPE_ITA_EF PowerPortRequestType = "ita-ef" + POWERPORTREQUESTTYPE_ITA_G PowerPortRequestType = "ita-g" + POWERPORTREQUESTTYPE_ITA_H PowerPortRequestType = "ita-h" + POWERPORTREQUESTTYPE_ITA_I PowerPortRequestType = "ita-i" + POWERPORTREQUESTTYPE_ITA_J PowerPortRequestType = "ita-j" + POWERPORTREQUESTTYPE_ITA_K PowerPortRequestType = "ita-k" + POWERPORTREQUESTTYPE_ITA_L PowerPortRequestType = "ita-l" + POWERPORTREQUESTTYPE_ITA_M PowerPortRequestType = "ita-m" + POWERPORTREQUESTTYPE_ITA_N PowerPortRequestType = "ita-n" + POWERPORTREQUESTTYPE_ITA_O PowerPortRequestType = "ita-o" + POWERPORTREQUESTTYPE_USB_A PowerPortRequestType = "usb-a" + POWERPORTREQUESTTYPE_USB_B PowerPortRequestType = "usb-b" + POWERPORTREQUESTTYPE_USB_C PowerPortRequestType = "usb-c" + POWERPORTREQUESTTYPE_USB_MINI_A PowerPortRequestType = "usb-mini-a" + POWERPORTREQUESTTYPE_USB_MINI_B PowerPortRequestType = "usb-mini-b" + POWERPORTREQUESTTYPE_USB_MICRO_A PowerPortRequestType = "usb-micro-a" + POWERPORTREQUESTTYPE_USB_MICRO_B PowerPortRequestType = "usb-micro-b" + POWERPORTREQUESTTYPE_USB_MICRO_AB PowerPortRequestType = "usb-micro-ab" + POWERPORTREQUESTTYPE_USB_3_B PowerPortRequestType = "usb-3-b" + POWERPORTREQUESTTYPE_USB_3_MICRO_B PowerPortRequestType = "usb-3-micro-b" + POWERPORTREQUESTTYPE_DC_TERMINAL PowerPortRequestType = "dc-terminal" + POWERPORTREQUESTTYPE_SAF_D_GRID PowerPortRequestType = "saf-d-grid" + POWERPORTREQUESTTYPE_NEUTRIK_POWERCON_20 PowerPortRequestType = "neutrik-powercon-20" + POWERPORTREQUESTTYPE_NEUTRIK_POWERCON_32 PowerPortRequestType = "neutrik-powercon-32" + POWERPORTREQUESTTYPE_NEUTRIK_POWERCON_TRUE1 PowerPortRequestType = "neutrik-powercon-true1" + POWERPORTREQUESTTYPE_NEUTRIK_POWERCON_TRUE1_TOP PowerPortRequestType = "neutrik-powercon-true1-top" + POWERPORTREQUESTTYPE_UBIQUITI_SMARTPOWER PowerPortRequestType = "ubiquiti-smartpower" + POWERPORTREQUESTTYPE_HARDWIRED PowerPortRequestType = "hardwired" + POWERPORTREQUESTTYPE_OTHER PowerPortRequestType = "other" + POWERPORTREQUESTTYPE_EMPTY PowerPortRequestType = "" +) + +// All allowed values of PowerPortRequestType enum +var AllowedPowerPortRequestTypeEnumValues = []PowerPortRequestType{ + "iec-60320-c6", + "iec-60320-c8", + "iec-60320-c14", + "iec-60320-c16", + "iec-60320-c20", + "iec-60320-c22", + "iec-60309-p-n-e-4h", + "iec-60309-p-n-e-6h", + "iec-60309-p-n-e-9h", + "iec-60309-2p-e-4h", + "iec-60309-2p-e-6h", + "iec-60309-2p-e-9h", + "iec-60309-3p-e-4h", + "iec-60309-3p-e-6h", + "iec-60309-3p-e-9h", + "iec-60309-3p-n-e-4h", + "iec-60309-3p-n-e-6h", + "iec-60309-3p-n-e-9h", + "iec-60906-1", + "nbr-14136-10a", + "nbr-14136-20a", + "nema-1-15p", + "nema-5-15p", + "nema-5-20p", + "nema-5-30p", + "nema-5-50p", + "nema-6-15p", + "nema-6-20p", + "nema-6-30p", + "nema-6-50p", + "nema-10-30p", + "nema-10-50p", + "nema-14-20p", + "nema-14-30p", + "nema-14-50p", + "nema-14-60p", + "nema-15-15p", + "nema-15-20p", + "nema-15-30p", + "nema-15-50p", + "nema-15-60p", + "nema-l1-15p", + "nema-l5-15p", + "nema-l5-20p", + "nema-l5-30p", + "nema-l5-50p", + "nema-l6-15p", + "nema-l6-20p", + "nema-l6-30p", + "nema-l6-50p", + "nema-l10-30p", + "nema-l14-20p", + "nema-l14-30p", + "nema-l14-50p", + "nema-l14-60p", + "nema-l15-20p", + "nema-l15-30p", + "nema-l15-50p", + "nema-l15-60p", + "nema-l21-20p", + "nema-l21-30p", + "nema-l22-30p", + "cs6361c", + "cs6365c", + "cs8165c", + "cs8265c", + "cs8365c", + "cs8465c", + "ita-c", + "ita-e", + "ita-f", + "ita-ef", + "ita-g", + "ita-h", + "ita-i", + "ita-j", + "ita-k", + "ita-l", + "ita-m", + "ita-n", + "ita-o", + "usb-a", + "usb-b", + "usb-c", + "usb-mini-a", + "usb-mini-b", + "usb-micro-a", + "usb-micro-b", + "usb-micro-ab", + "usb-3-b", + "usb-3-micro-b", + "dc-terminal", + "saf-d-grid", + "neutrik-powercon-20", + "neutrik-powercon-32", + "neutrik-powercon-true1", + "neutrik-powercon-true1-top", + "ubiquiti-smartpower", + "hardwired", + "other", + "", +} + +func (v *PowerPortRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerPortRequestType(value) + for _, existing := range AllowedPowerPortRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerPortRequestType", value) +} + +// NewPowerPortRequestTypeFromValue returns a pointer to a valid PowerPortRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerPortRequestTypeFromValue(v string) (*PowerPortRequestType, error) { + ev := PowerPortRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerPortRequestType: valid values are %v", v, AllowedPowerPortRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerPortRequestType) IsValid() bool { + for _, existing := range AllowedPowerPortRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerPortRequest_type value +func (v PowerPortRequestType) Ptr() *PowerPortRequestType { + return &v +} + +type NullablePowerPortRequestType struct { + value *PowerPortRequestType + isSet bool +} + +func (v NullablePowerPortRequestType) Get() *PowerPortRequestType { + return v.value +} + +func (v *NullablePowerPortRequestType) Set(val *PowerPortRequestType) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPortRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPortRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPortRequestType(val *PowerPortRequestType) *NullablePowerPortRequestType { + return &NullablePowerPortRequestType{value: val, isSet: true} +} + +func (v NullablePowerPortRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPortRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_template.go new file mode 100644 index 00000000..18662357 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_template.go @@ -0,0 +1,634 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the PowerPortTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerPortTemplate{} + +// PowerPortTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PowerPortTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NullableNestedDeviceType `json:"device_type,omitempty"` + ModuleType NullableNestedModuleType `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerPortType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _PowerPortTemplate PowerPortTemplate + +// NewPowerPortTemplate instantiates a new PowerPortTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerPortTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *PowerPortTemplate { + this := PowerPortTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewPowerPortTemplateWithDefaults instantiates a new PowerPortTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerPortTemplateWithDefaults() *PowerPortTemplate { + this := PowerPortTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *PowerPortTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PowerPortTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PowerPortTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *PowerPortTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *PowerPortTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *PowerPortTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *PowerPortTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *PowerPortTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *PowerPortTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplate) GetDeviceType() NestedDeviceType { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceType + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceType and assigns it to the DeviceType field. +func (o *PowerPortTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PowerPortTemplate) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PowerPortTemplate) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplate) GetModuleType() NestedModuleType { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleType + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplate) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleType and assigns it to the ModuleType field. +func (o *PowerPortTemplate) SetModuleType(v NestedModuleType) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PowerPortTemplate) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PowerPortTemplate) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *PowerPortTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerPortTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerPortTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerPortTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerPortTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplate) GetType() PowerPortType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerPortType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplate) GetTypeOk() (*PowerPortType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerPortType and assigns it to the Type field. +func (o *PowerPortTemplate) SetType(v PowerPortType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerPortTemplate) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerPortTemplate) UnsetType() { + o.Type.Unset() +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplate) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplate) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *PowerPortTemplate) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *PowerPortTemplate) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *PowerPortTemplate) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplate) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplate) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *PowerPortTemplate) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *PowerPortTemplate) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *PowerPortTemplate) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerPortTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerPortTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerPortTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *PowerPortTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *PowerPortTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *PowerPortTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o PowerPortTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerPortTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerPortTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerPortTemplate := _PowerPortTemplate{} + + err = json.Unmarshal(data, &varPowerPortTemplate) + + if err != nil { + return err + } + + *o = PowerPortTemplate(varPowerPortTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerPortTemplate struct { + value *PowerPortTemplate + isSet bool +} + +func (v NullablePowerPortTemplate) Get() *PowerPortTemplate { + return v.value +} + +func (v *NullablePowerPortTemplate) Set(val *PowerPortTemplate) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPortTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPortTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPortTemplate(val *PowerPortTemplate) *NullablePowerPortTemplate { + return &NullablePowerPortTemplate{value: val, isSet: true} +} + +func (v NullablePowerPortTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPortTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_template_request.go new file mode 100644 index 00000000..c7aa9453 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_template_request.go @@ -0,0 +1,484 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PowerPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerPortTemplateRequest{} + +// PowerPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type PowerPortTemplateRequest struct { + DeviceType NullableNestedDeviceTypeRequest `json:"device_type,omitempty"` + ModuleType NullableNestedModuleTypeRequest `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type NullablePowerPortRequestType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerPortTemplateRequest PowerPortTemplateRequest + +// NewPowerPortTemplateRequest instantiates a new PowerPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerPortTemplateRequest(name string) *PowerPortTemplateRequest { + this := PowerPortTemplateRequest{} + this.Name = name + return &this +} + +// NewPowerPortTemplateRequestWithDefaults instantiates a new PowerPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerPortTemplateRequestWithDefaults() *PowerPortTemplateRequest { + this := PowerPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceTypeRequest + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *PowerPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceTypeRequest and assigns it to the DeviceType field. +func (o *PowerPortTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *PowerPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *PowerPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplateRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleTypeRequest + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplateRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *PowerPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleTypeRequest and assigns it to the ModuleType field. +func (o *PowerPortTemplateRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *PowerPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *PowerPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *PowerPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PowerPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PowerPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PowerPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplateRequest) GetType() PowerPortRequestType { + if o == nil || IsNil(o.Type.Get()) { + var ret PowerPortRequestType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplateRequest) GetTypeOk() (*PowerPortRequestType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *PowerPortTemplateRequest) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullablePowerPortRequestType and assigns it to the Type field. +func (o *PowerPortTemplateRequest) SetType(v PowerPortRequestType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *PowerPortTemplateRequest) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *PowerPortTemplateRequest) UnsetType() { + o.Type.Unset() +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplateRequest) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplateRequest) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *PowerPortTemplateRequest) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *PowerPortTemplateRequest) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *PowerPortTemplateRequest) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *PowerPortTemplateRequest) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PowerPortTemplateRequest) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PowerPortTemplateRequest) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *PowerPortTemplateRequest) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *PowerPortTemplateRequest) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *PowerPortTemplateRequest) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *PowerPortTemplateRequest) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PowerPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PowerPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PowerPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPowerPortTemplateRequest := _PowerPortTemplateRequest{} + + err = json.Unmarshal(data, &varPowerPortTemplateRequest) + + if err != nil { + return err + } + + *o = PowerPortTemplateRequest(varPowerPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerPortTemplateRequest struct { + value *PowerPortTemplateRequest + isSet bool +} + +func (v NullablePowerPortTemplateRequest) Get() *PowerPortTemplateRequest { + return v.value +} + +func (v *NullablePowerPortTemplateRequest) Set(val *PowerPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPortTemplateRequest(val *PowerPortTemplateRequest) *NullablePowerPortTemplateRequest { + return &NullablePowerPortTemplateRequest{value: val, isSet: true} +} + +func (v NullablePowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_type.go new file mode 100644 index 00000000..1a3313fc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PowerPortType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PowerPortType{} + +// PowerPortType struct for PowerPortType +type PowerPortType struct { + Value *PatchedWritablePowerPortTemplateRequestType `json:"value,omitempty"` + Label *PowerPortTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PowerPortType PowerPortType + +// NewPowerPortType instantiates a new PowerPortType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPowerPortType() *PowerPortType { + this := PowerPortType{} + return &this +} + +// NewPowerPortTypeWithDefaults instantiates a new PowerPortType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPowerPortTypeWithDefaults() *PowerPortType { + this := PowerPortType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PowerPortType) GetValue() PatchedWritablePowerPortTemplateRequestType { + if o == nil || IsNil(o.Value) { + var ret PatchedWritablePowerPortTemplateRequestType + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortType) GetValueOk() (*PatchedWritablePowerPortTemplateRequestType, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PowerPortType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritablePowerPortTemplateRequestType and assigns it to the Value field. +func (o *PowerPortType) SetValue(v PatchedWritablePowerPortTemplateRequestType) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PowerPortType) GetLabel() PowerPortTypeLabel { + if o == nil || IsNil(o.Label) { + var ret PowerPortTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PowerPortType) GetLabelOk() (*PowerPortTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PowerPortType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PowerPortTypeLabel and assigns it to the Label field. +func (o *PowerPortType) SetLabel(v PowerPortTypeLabel) { + o.Label = &v +} + +func (o PowerPortType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PowerPortType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PowerPortType) UnmarshalJSON(data []byte) (err error) { + varPowerPortType := _PowerPortType{} + + err = json.Unmarshal(data, &varPowerPortType) + + if err != nil { + return err + } + + *o = PowerPortType(varPowerPortType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePowerPortType struct { + value *PowerPortType + isSet bool +} + +func (v NullablePowerPortType) Get() *PowerPortType { + return v.value +} + +func (v *NullablePowerPortType) Set(val *PowerPortType) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPortType) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPortType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPortType(val *PowerPortType) *NullablePowerPortType { + return &NullablePowerPortType{value: val, isSet: true} +} + +func (v NullablePowerPortType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPortType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_type_label.go new file mode 100644 index 00000000..bda09238 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_power_port_type_label.go @@ -0,0 +1,306 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PowerPortTypeLabel the model 'PowerPortTypeLabel' +type PowerPortTypeLabel string + +// List of PowerPort_type_label +const ( + POWERPORTTYPELABEL_C6 PowerPortTypeLabel = "C6" + POWERPORTTYPELABEL_C8 PowerPortTypeLabel = "C8" + POWERPORTTYPELABEL_C14 PowerPortTypeLabel = "C14" + POWERPORTTYPELABEL_C16 PowerPortTypeLabel = "C16" + POWERPORTTYPELABEL_C20 PowerPortTypeLabel = "C20" + POWERPORTTYPELABEL_C22 PowerPortTypeLabel = "C22" + POWERPORTTYPELABEL_PNE_4_H PowerPortTypeLabel = "P+N+E 4H" + POWERPORTTYPELABEL_PNE_6_H PowerPortTypeLabel = "P+N+E 6H" + POWERPORTTYPELABEL_PNE_9_H PowerPortTypeLabel = "P+N+E 9H" + POWERPORTTYPELABEL__2_PE_4_H PowerPortTypeLabel = "2P+E 4H" + POWERPORTTYPELABEL__2_PE_6_H PowerPortTypeLabel = "2P+E 6H" + POWERPORTTYPELABEL__2_PE_9_H PowerPortTypeLabel = "2P+E 9H" + POWERPORTTYPELABEL__3_PE_4_H PowerPortTypeLabel = "3P+E 4H" + POWERPORTTYPELABEL__3_PE_6_H PowerPortTypeLabel = "3P+E 6H" + POWERPORTTYPELABEL__3_PE_9_H PowerPortTypeLabel = "3P+E 9H" + POWERPORTTYPELABEL__3_PNE_4_H PowerPortTypeLabel = "3P+N+E 4H" + POWERPORTTYPELABEL__3_PNE_6_H PowerPortTypeLabel = "3P+N+E 6H" + POWERPORTTYPELABEL__3_PNE_9_H PowerPortTypeLabel = "3P+N+E 9H" + POWERPORTTYPELABEL_IEC_60906_1 PowerPortTypeLabel = "IEC 60906-1" + POWERPORTTYPELABEL__2_PT_10_A__NBR_14136 PowerPortTypeLabel = "2P+T 10A (NBR 14136)" + POWERPORTTYPELABEL__2_PT_20_A__NBR_14136 PowerPortTypeLabel = "2P+T 20A (NBR 14136)" + POWERPORTTYPELABEL_NEMA_1_15_P PowerPortTypeLabel = "NEMA 1-15P" + POWERPORTTYPELABEL_NEMA_5_15_P PowerPortTypeLabel = "NEMA 5-15P" + POWERPORTTYPELABEL_NEMA_5_20_P PowerPortTypeLabel = "NEMA 5-20P" + POWERPORTTYPELABEL_NEMA_5_30_P PowerPortTypeLabel = "NEMA 5-30P" + POWERPORTTYPELABEL_NEMA_5_50_P PowerPortTypeLabel = "NEMA 5-50P" + POWERPORTTYPELABEL_NEMA_6_15_P PowerPortTypeLabel = "NEMA 6-15P" + POWERPORTTYPELABEL_NEMA_6_20_P PowerPortTypeLabel = "NEMA 6-20P" + POWERPORTTYPELABEL_NEMA_6_30_P PowerPortTypeLabel = "NEMA 6-30P" + POWERPORTTYPELABEL_NEMA_6_50_P PowerPortTypeLabel = "NEMA 6-50P" + POWERPORTTYPELABEL_NEMA_10_30_P PowerPortTypeLabel = "NEMA 10-30P" + POWERPORTTYPELABEL_NEMA_10_50_P PowerPortTypeLabel = "NEMA 10-50P" + POWERPORTTYPELABEL_NEMA_14_20_P PowerPortTypeLabel = "NEMA 14-20P" + POWERPORTTYPELABEL_NEMA_14_30_P PowerPortTypeLabel = "NEMA 14-30P" + POWERPORTTYPELABEL_NEMA_14_50_P PowerPortTypeLabel = "NEMA 14-50P" + POWERPORTTYPELABEL_NEMA_14_60_P PowerPortTypeLabel = "NEMA 14-60P" + POWERPORTTYPELABEL_NEMA_15_15_P PowerPortTypeLabel = "NEMA 15-15P" + POWERPORTTYPELABEL_NEMA_15_20_P PowerPortTypeLabel = "NEMA 15-20P" + POWERPORTTYPELABEL_NEMA_15_30_P PowerPortTypeLabel = "NEMA 15-30P" + POWERPORTTYPELABEL_NEMA_15_50_P PowerPortTypeLabel = "NEMA 15-50P" + POWERPORTTYPELABEL_NEMA_15_60_P PowerPortTypeLabel = "NEMA 15-60P" + POWERPORTTYPELABEL_NEMA_L1_15_P PowerPortTypeLabel = "NEMA L1-15P" + POWERPORTTYPELABEL_NEMA_L5_15_P PowerPortTypeLabel = "NEMA L5-15P" + POWERPORTTYPELABEL_NEMA_L5_20_P PowerPortTypeLabel = "NEMA L5-20P" + POWERPORTTYPELABEL_NEMA_L5_30_P PowerPortTypeLabel = "NEMA L5-30P" + POWERPORTTYPELABEL_NEMA_L5_50_P PowerPortTypeLabel = "NEMA L5-50P" + POWERPORTTYPELABEL_NEMA_L6_15_P PowerPortTypeLabel = "NEMA L6-15P" + POWERPORTTYPELABEL_NEMA_L6_20_P PowerPortTypeLabel = "NEMA L6-20P" + POWERPORTTYPELABEL_NEMA_L6_30_P PowerPortTypeLabel = "NEMA L6-30P" + POWERPORTTYPELABEL_NEMA_L6_50_P PowerPortTypeLabel = "NEMA L6-50P" + POWERPORTTYPELABEL_NEMA_L10_30_P PowerPortTypeLabel = "NEMA L10-30P" + POWERPORTTYPELABEL_NEMA_L14_20_P PowerPortTypeLabel = "NEMA L14-20P" + POWERPORTTYPELABEL_NEMA_L14_30_P PowerPortTypeLabel = "NEMA L14-30P" + POWERPORTTYPELABEL_NEMA_L14_50_P PowerPortTypeLabel = "NEMA L14-50P" + POWERPORTTYPELABEL_NEMA_L14_60_P PowerPortTypeLabel = "NEMA L14-60P" + POWERPORTTYPELABEL_NEMA_L15_20_P PowerPortTypeLabel = "NEMA L15-20P" + POWERPORTTYPELABEL_NEMA_L15_30_P PowerPortTypeLabel = "NEMA L15-30P" + POWERPORTTYPELABEL_NEMA_L15_50_P PowerPortTypeLabel = "NEMA L15-50P" + POWERPORTTYPELABEL_NEMA_L15_60_P PowerPortTypeLabel = "NEMA L15-60P" + POWERPORTTYPELABEL_NEMA_L21_20_P PowerPortTypeLabel = "NEMA L21-20P" + POWERPORTTYPELABEL_NEMA_L21_30_P PowerPortTypeLabel = "NEMA L21-30P" + POWERPORTTYPELABEL_NEMA_L22_30_P PowerPortTypeLabel = "NEMA L22-30P" + POWERPORTTYPELABEL_CS6361_C PowerPortTypeLabel = "CS6361C" + POWERPORTTYPELABEL_CS6365_C PowerPortTypeLabel = "CS6365C" + POWERPORTTYPELABEL_CS8165_C PowerPortTypeLabel = "CS8165C" + POWERPORTTYPELABEL_CS8265_C PowerPortTypeLabel = "CS8265C" + POWERPORTTYPELABEL_CS8365_C PowerPortTypeLabel = "CS8365C" + POWERPORTTYPELABEL_CS8465_C PowerPortTypeLabel = "CS8465C" + POWERPORTTYPELABEL_ITA_TYPE_C__CEE_7_16 PowerPortTypeLabel = "ITA Type C (CEE 7/16)" + POWERPORTTYPELABEL_ITA_TYPE_E__CEE_7_6 PowerPortTypeLabel = "ITA Type E (CEE 7/6)" + POWERPORTTYPELABEL_ITA_TYPE_F__CEE_7_4 PowerPortTypeLabel = "ITA Type F (CEE 7/4)" + POWERPORTTYPELABEL_ITA_TYPE_E_F__CEE_7_7 PowerPortTypeLabel = "ITA Type E/F (CEE 7/7)" + POWERPORTTYPELABEL_ITA_TYPE_G__BS_1363 PowerPortTypeLabel = "ITA Type G (BS 1363)" + POWERPORTTYPELABEL_ITA_TYPE_H PowerPortTypeLabel = "ITA Type H" + POWERPORTTYPELABEL_ITA_TYPE_I PowerPortTypeLabel = "ITA Type I" + POWERPORTTYPELABEL_ITA_TYPE_J PowerPortTypeLabel = "ITA Type J" + POWERPORTTYPELABEL_ITA_TYPE_K PowerPortTypeLabel = "ITA Type K" + POWERPORTTYPELABEL_ITA_TYPE_L__CEI_23_50 PowerPortTypeLabel = "ITA Type L (CEI 23-50)" + POWERPORTTYPELABEL_ITA_TYPE_M__BS_546 PowerPortTypeLabel = "ITA Type M (BS 546)" + POWERPORTTYPELABEL_ITA_TYPE_N PowerPortTypeLabel = "ITA Type N" + POWERPORTTYPELABEL_ITA_TYPE_O PowerPortTypeLabel = "ITA Type O" + POWERPORTTYPELABEL_USB_TYPE_A PowerPortTypeLabel = "USB Type A" + POWERPORTTYPELABEL_USB_TYPE_B PowerPortTypeLabel = "USB Type B" + POWERPORTTYPELABEL_USB_TYPE_C PowerPortTypeLabel = "USB Type C" + POWERPORTTYPELABEL_USB_MINI_A PowerPortTypeLabel = "USB Mini A" + POWERPORTTYPELABEL_USB_MINI_B PowerPortTypeLabel = "USB Mini B" + POWERPORTTYPELABEL_USB_MICRO_A PowerPortTypeLabel = "USB Micro A" + POWERPORTTYPELABEL_USB_MICRO_B PowerPortTypeLabel = "USB Micro B" + POWERPORTTYPELABEL_USB_MICRO_AB PowerPortTypeLabel = "USB Micro AB" + POWERPORTTYPELABEL_USB_3_0_TYPE_B PowerPortTypeLabel = "USB 3.0 Type B" + POWERPORTTYPELABEL_USB_3_0_MICRO_B PowerPortTypeLabel = "USB 3.0 Micro B" + POWERPORTTYPELABEL_DC_TERMINAL PowerPortTypeLabel = "DC Terminal" + POWERPORTTYPELABEL_SAF_D_GRID PowerPortTypeLabel = "Saf-D-Grid" + POWERPORTTYPELABEL_NEUTRIK_POWER_CON__20_A PowerPortTypeLabel = "Neutrik powerCON (20A)" + POWERPORTTYPELABEL_NEUTRIK_POWER_CON__32_A PowerPortTypeLabel = "Neutrik powerCON (32A)" + POWERPORTTYPELABEL_NEUTRIK_POWER_CON_TRUE1 PowerPortTypeLabel = "Neutrik powerCON TRUE1" + POWERPORTTYPELABEL_NEUTRIK_POWER_CON_TRUE1_TOP PowerPortTypeLabel = "Neutrik powerCON TRUE1 TOP" + POWERPORTTYPELABEL_UBIQUITI_SMART_POWER PowerPortTypeLabel = "Ubiquiti SmartPower" + POWERPORTTYPELABEL_HARDWIRED PowerPortTypeLabel = "Hardwired" + POWERPORTTYPELABEL_OTHER PowerPortTypeLabel = "Other" +) + +// All allowed values of PowerPortTypeLabel enum +var AllowedPowerPortTypeLabelEnumValues = []PowerPortTypeLabel{ + "C6", + "C8", + "C14", + "C16", + "C20", + "C22", + "P+N+E 4H", + "P+N+E 6H", + "P+N+E 9H", + "2P+E 4H", + "2P+E 6H", + "2P+E 9H", + "3P+E 4H", + "3P+E 6H", + "3P+E 9H", + "3P+N+E 4H", + "3P+N+E 6H", + "3P+N+E 9H", + "IEC 60906-1", + "2P+T 10A (NBR 14136)", + "2P+T 20A (NBR 14136)", + "NEMA 1-15P", + "NEMA 5-15P", + "NEMA 5-20P", + "NEMA 5-30P", + "NEMA 5-50P", + "NEMA 6-15P", + "NEMA 6-20P", + "NEMA 6-30P", + "NEMA 6-50P", + "NEMA 10-30P", + "NEMA 10-50P", + "NEMA 14-20P", + "NEMA 14-30P", + "NEMA 14-50P", + "NEMA 14-60P", + "NEMA 15-15P", + "NEMA 15-20P", + "NEMA 15-30P", + "NEMA 15-50P", + "NEMA 15-60P", + "NEMA L1-15P", + "NEMA L5-15P", + "NEMA L5-20P", + "NEMA L5-30P", + "NEMA L5-50P", + "NEMA L6-15P", + "NEMA L6-20P", + "NEMA L6-30P", + "NEMA L6-50P", + "NEMA L10-30P", + "NEMA L14-20P", + "NEMA L14-30P", + "NEMA L14-50P", + "NEMA L14-60P", + "NEMA L15-20P", + "NEMA L15-30P", + "NEMA L15-50P", + "NEMA L15-60P", + "NEMA L21-20P", + "NEMA L21-30P", + "NEMA L22-30P", + "CS6361C", + "CS6365C", + "CS8165C", + "CS8265C", + "CS8365C", + "CS8465C", + "ITA Type C (CEE 7/16)", + "ITA Type E (CEE 7/6)", + "ITA Type F (CEE 7/4)", + "ITA Type E/F (CEE 7/7)", + "ITA Type G (BS 1363)", + "ITA Type H", + "ITA Type I", + "ITA Type J", + "ITA Type K", + "ITA Type L (CEI 23-50)", + "ITA Type M (BS 546)", + "ITA Type N", + "ITA Type O", + "USB Type A", + "USB Type B", + "USB Type C", + "USB Mini A", + "USB Mini B", + "USB Micro A", + "USB Micro B", + "USB Micro AB", + "USB 3.0 Type B", + "USB 3.0 Micro B", + "DC Terminal", + "Saf-D-Grid", + "Neutrik powerCON (20A)", + "Neutrik powerCON (32A)", + "Neutrik powerCON TRUE1", + "Neutrik powerCON TRUE1 TOP", + "Ubiquiti SmartPower", + "Hardwired", + "Other", +} + +func (v *PowerPortTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PowerPortTypeLabel(value) + for _, existing := range AllowedPowerPortTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PowerPortTypeLabel", value) +} + +// NewPowerPortTypeLabelFromValue returns a pointer to a valid PowerPortTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPowerPortTypeLabelFromValue(v string) (*PowerPortTypeLabel, error) { + ev := PowerPortTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PowerPortTypeLabel: valid values are %v", v, AllowedPowerPortTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PowerPortTypeLabel) IsValid() bool { + for _, existing := range AllowedPowerPortTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PowerPort_type_label value +func (v PowerPortTypeLabel) Ptr() *PowerPortTypeLabel { + return &v +} + +type NullablePowerPortTypeLabel struct { + value *PowerPortTypeLabel + isSet bool +} + +func (v NullablePowerPortTypeLabel) Get() *PowerPortTypeLabel { + return v.value +} + +func (v *NullablePowerPortTypeLabel) Set(val *PowerPortTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePowerPortTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePowerPortTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePowerPortTypeLabel(val *PowerPortTypeLabel) *NullablePowerPortTypeLabel { + return &NullablePowerPortTypeLabel{value: val, isSet: true} +} + +func (v NullablePowerPortTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePowerPortTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_prefix.go b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix.go new file mode 100644 index 00000000..3bec7e57 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix.go @@ -0,0 +1,904 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Prefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Prefix{} + +// Prefix Adds support for custom fields and tags. +type Prefix struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Family AggregateFamily `json:"family"` + Prefix string `json:"prefix"` + Site NullableNestedSite `json:"site,omitempty"` + Vrf NullableNestedVRF `json:"vrf,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Vlan NullableNestedVLAN `json:"vlan,omitempty"` + Status *PrefixStatus `json:"status,omitempty"` + Role NullableNestedRole `json:"role,omitempty"` + // All IP addresses within this prefix are considered usable + IsPool *bool `json:"is_pool,omitempty"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Children int32 `json:"children"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _Prefix Prefix + +// NewPrefix instantiates a new Prefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrefix(id int32, url string, display string, family AggregateFamily, prefix string, created NullableTime, lastUpdated NullableTime, children int32, depth int32) *Prefix { + this := Prefix{} + this.Id = id + this.Url = url + this.Display = display + this.Family = family + this.Prefix = prefix + this.Created = created + this.LastUpdated = lastUpdated + this.Children = children + this.Depth = depth + return &this +} + +// NewPrefixWithDefaults instantiates a new Prefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPrefixWithDefaults() *Prefix { + this := Prefix{} + return &this +} + +// GetId returns the Id field value +func (o *Prefix) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Prefix) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Prefix) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Prefix) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Prefix) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Prefix) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Prefix) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Prefix) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Prefix) SetDisplay(v string) { + o.Display = v +} + +// GetFamily returns the Family field value +func (o *Prefix) GetFamily() AggregateFamily { + if o == nil { + var ret AggregateFamily + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *Prefix) GetFamilyOk() (*AggregateFamily, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *Prefix) SetFamily(v AggregateFamily) { + o.Family = v +} + +// GetPrefix returns the Prefix field value +func (o *Prefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *Prefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *Prefix) SetPrefix(v string) { + o.Prefix = v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Prefix) GetSite() NestedSite { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSite + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Prefix) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *Prefix) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSite and assigns it to the Site field. +func (o *Prefix) SetSite(v NestedSite) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *Prefix) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *Prefix) UnsetSite() { + o.Site.Unset() +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Prefix) GetVrf() NestedVRF { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRF + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Prefix) GetVrfOk() (*NestedVRF, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *Prefix) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRF and assigns it to the Vrf field. +func (o *Prefix) SetVrf(v NestedVRF) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *Prefix) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *Prefix) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Prefix) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Prefix) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Prefix) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Prefix) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Prefix) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Prefix) UnsetTenant() { + o.Tenant.Unset() +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Prefix) GetVlan() NestedVLAN { + if o == nil || IsNil(o.Vlan.Get()) { + var ret NestedVLAN + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Prefix) GetVlanOk() (*NestedVLAN, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *Prefix) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableNestedVLAN and assigns it to the Vlan field. +func (o *Prefix) SetVlan(v NestedVLAN) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *Prefix) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *Prefix) UnsetVlan() { + o.Vlan.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Prefix) GetStatus() PrefixStatus { + if o == nil || IsNil(o.Status) { + var ret PrefixStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prefix) GetStatusOk() (*PrefixStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Prefix) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PrefixStatus and assigns it to the Status field. +func (o *Prefix) SetStatus(v PrefixStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Prefix) GetRole() NestedRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Prefix) GetRoleOk() (*NestedRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *Prefix) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRole and assigns it to the Role field. +func (o *Prefix) SetRole(v NestedRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *Prefix) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *Prefix) UnsetRole() { + o.Role.Unset() +} + +// GetIsPool returns the IsPool field value if set, zero value otherwise. +func (o *Prefix) GetIsPool() bool { + if o == nil || IsNil(o.IsPool) { + var ret bool + return ret + } + return *o.IsPool +} + +// GetIsPoolOk returns a tuple with the IsPool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prefix) GetIsPoolOk() (*bool, bool) { + if o == nil || IsNil(o.IsPool) { + return nil, false + } + return o.IsPool, true +} + +// HasIsPool returns a boolean if a field has been set. +func (o *Prefix) HasIsPool() bool { + if o != nil && !IsNil(o.IsPool) { + return true + } + + return false +} + +// SetIsPool gets a reference to the given bool and assigns it to the IsPool field. +func (o *Prefix) SetIsPool(v bool) { + o.IsPool = &v +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *Prefix) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prefix) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *Prefix) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *Prefix) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Prefix) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prefix) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Prefix) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Prefix) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Prefix) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prefix) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Prefix) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Prefix) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Prefix) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prefix) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Prefix) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Prefix) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Prefix) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prefix) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Prefix) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Prefix) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Prefix) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Prefix) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Prefix) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Prefix) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Prefix) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Prefix) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetChildren returns the Children field value +func (o *Prefix) GetChildren() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Children +} + +// GetChildrenOk returns a tuple with the Children field value +// and a boolean to check if the value has been set. +func (o *Prefix) GetChildrenOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Children, true +} + +// SetChildren sets field value +func (o *Prefix) SetChildren(v int32) { + o.Children = v +} + +// GetDepth returns the Depth field value +func (o *Prefix) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *Prefix) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *Prefix) SetDepth(v int32) { + o.Depth = v +} + +func (o Prefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Prefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["family"] = o.Family + toSerialize["prefix"] = o.Prefix + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.IsPool) { + toSerialize["is_pool"] = o.IsPool + } + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["children"] = o.Children + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Prefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "family", + "prefix", + "created", + "last_updated", + "children", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPrefix := _Prefix{} + + err = json.Unmarshal(data, &varPrefix) + + if err != nil { + return err + } + + *o = Prefix(varPrefix) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "family") + delete(additionalProperties, "prefix") + delete(additionalProperties, "site") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "vlan") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "is_pool") + delete(additionalProperties, "mark_utilized") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "children") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePrefix struct { + value *Prefix + isSet bool +} + +func (v NullablePrefix) Get() *Prefix { + return v.value +} + +func (v *NullablePrefix) Set(val *Prefix) { + v.value = val + v.isSet = true +} + +func (v NullablePrefix) IsSet() bool { + return v.isSet +} + +func (v *NullablePrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePrefix(val *Prefix) *NullablePrefix { + return &NullablePrefix{value: val, isSet: true} +} + +func (v NullablePrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_request.go new file mode 100644 index 00000000..5bba62d8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_request.go @@ -0,0 +1,667 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the PrefixRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PrefixRequest{} + +// PrefixRequest Adds support for custom fields and tags. +type PrefixRequest struct { + Prefix string `json:"prefix"` + Site NullableNestedSiteRequest `json:"site,omitempty"` + Vrf NullableNestedVRFRequest `json:"vrf,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Vlan NullableNestedVLANRequest `json:"vlan,omitempty"` + Status *PrefixStatusValue `json:"status,omitempty"` + Role NullableNestedRoleRequest `json:"role,omitempty"` + // All IP addresses within this prefix are considered usable + IsPool *bool `json:"is_pool,omitempty"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PrefixRequest PrefixRequest + +// NewPrefixRequest instantiates a new PrefixRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrefixRequest(prefix string) *PrefixRequest { + this := PrefixRequest{} + this.Prefix = prefix + return &this +} + +// NewPrefixRequestWithDefaults instantiates a new PrefixRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPrefixRequestWithDefaults() *PrefixRequest { + this := PrefixRequest{} + return &this +} + +// GetPrefix returns the Prefix field value +func (o *PrefixRequest) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *PrefixRequest) SetPrefix(v string) { + o.Prefix = v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PrefixRequest) GetSite() NestedSiteRequest { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSiteRequest + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PrefixRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *PrefixRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSiteRequest and assigns it to the Site field. +func (o *PrefixRequest) SetSite(v NestedSiteRequest) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *PrefixRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *PrefixRequest) UnsetSite() { + o.Site.Unset() +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PrefixRequest) GetVrf() NestedVRFRequest { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRFRequest + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PrefixRequest) GetVrfOk() (*NestedVRFRequest, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *PrefixRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRFRequest and assigns it to the Vrf field. +func (o *PrefixRequest) SetVrf(v NestedVRFRequest) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *PrefixRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *PrefixRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PrefixRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PrefixRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *PrefixRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *PrefixRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *PrefixRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *PrefixRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PrefixRequest) GetVlan() NestedVLANRequest { + if o == nil || IsNil(o.Vlan.Get()) { + var ret NestedVLANRequest + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PrefixRequest) GetVlanOk() (*NestedVLANRequest, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *PrefixRequest) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableNestedVLANRequest and assigns it to the Vlan field. +func (o *PrefixRequest) SetVlan(v NestedVLANRequest) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *PrefixRequest) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *PrefixRequest) UnsetVlan() { + o.Vlan.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PrefixRequest) GetStatus() PrefixStatusValue { + if o == nil || IsNil(o.Status) { + var ret PrefixStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetStatusOk() (*PrefixStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PrefixRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PrefixStatusValue and assigns it to the Status field. +func (o *PrefixRequest) SetStatus(v PrefixStatusValue) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PrefixRequest) GetRole() NestedRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PrefixRequest) GetRoleOk() (*NestedRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *PrefixRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRoleRequest and assigns it to the Role field. +func (o *PrefixRequest) SetRole(v NestedRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *PrefixRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *PrefixRequest) UnsetRole() { + o.Role.Unset() +} + +// GetIsPool returns the IsPool field value if set, zero value otherwise. +func (o *PrefixRequest) GetIsPool() bool { + if o == nil || IsNil(o.IsPool) { + var ret bool + return ret + } + return *o.IsPool +} + +// GetIsPoolOk returns a tuple with the IsPool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetIsPoolOk() (*bool, bool) { + if o == nil || IsNil(o.IsPool) { + return nil, false + } + return o.IsPool, true +} + +// HasIsPool returns a boolean if a field has been set. +func (o *PrefixRequest) HasIsPool() bool { + if o != nil && !IsNil(o.IsPool) { + return true + } + + return false +} + +// SetIsPool gets a reference to the given bool and assigns it to the IsPool field. +func (o *PrefixRequest) SetIsPool(v bool) { + o.IsPool = &v +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *PrefixRequest) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *PrefixRequest) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *PrefixRequest) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PrefixRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PrefixRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PrefixRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *PrefixRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *PrefixRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *PrefixRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PrefixRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PrefixRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *PrefixRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *PrefixRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *PrefixRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *PrefixRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o PrefixRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PrefixRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prefix"] = o.Prefix + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.IsPool) { + toSerialize["is_pool"] = o.IsPool + } + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PrefixRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPrefixRequest := _PrefixRequest{} + + err = json.Unmarshal(data, &varPrefixRequest) + + if err != nil { + return err + } + + *o = PrefixRequest(varPrefixRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "site") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "vlan") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "is_pool") + delete(additionalProperties, "mark_utilized") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePrefixRequest struct { + value *PrefixRequest + isSet bool +} + +func (v NullablePrefixRequest) Get() *PrefixRequest { + return v.value +} + +func (v *NullablePrefixRequest) Set(val *PrefixRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePrefixRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePrefixRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePrefixRequest(val *PrefixRequest) *NullablePrefixRequest { + return &NullablePrefixRequest{value: val, isSet: true} +} + +func (v NullablePrefixRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePrefixRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status.go new file mode 100644 index 00000000..c0d2f919 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the PrefixStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PrefixStatus{} + +// PrefixStatus struct for PrefixStatus +type PrefixStatus struct { + Value *PrefixStatusValue `json:"value,omitempty"` + Label *PrefixStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PrefixStatus PrefixStatus + +// NewPrefixStatus instantiates a new PrefixStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrefixStatus() *PrefixStatus { + this := PrefixStatus{} + return &this +} + +// NewPrefixStatusWithDefaults instantiates a new PrefixStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPrefixStatusWithDefaults() *PrefixStatus { + this := PrefixStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PrefixStatus) GetValue() PrefixStatusValue { + if o == nil || IsNil(o.Value) { + var ret PrefixStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixStatus) GetValueOk() (*PrefixStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PrefixStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PrefixStatusValue and assigns it to the Value field. +func (o *PrefixStatus) SetValue(v PrefixStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PrefixStatus) GetLabel() PrefixStatusLabel { + if o == nil || IsNil(o.Label) { + var ret PrefixStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PrefixStatus) GetLabelOk() (*PrefixStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PrefixStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given PrefixStatusLabel and assigns it to the Label field. +func (o *PrefixStatus) SetLabel(v PrefixStatusLabel) { + o.Label = &v +} + +func (o PrefixStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PrefixStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PrefixStatus) UnmarshalJSON(data []byte) (err error) { + varPrefixStatus := _PrefixStatus{} + + err = json.Unmarshal(data, &varPrefixStatus) + + if err != nil { + return err + } + + *o = PrefixStatus(varPrefixStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePrefixStatus struct { + value *PrefixStatus + isSet bool +} + +func (v NullablePrefixStatus) Get() *PrefixStatus { + return v.value +} + +func (v *NullablePrefixStatus) Set(val *PrefixStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePrefixStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePrefixStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePrefixStatus(val *PrefixStatus) *NullablePrefixStatus { + return &NullablePrefixStatus{value: val, isSet: true} +} + +func (v NullablePrefixStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePrefixStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status_label.go new file mode 100644 index 00000000..d3dd67bc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PrefixStatusLabel the model 'PrefixStatusLabel' +type PrefixStatusLabel string + +// List of Prefix_status_label +const ( + PREFIXSTATUSLABEL_CONTAINER PrefixStatusLabel = "Container" + PREFIXSTATUSLABEL_ACTIVE PrefixStatusLabel = "Active" + PREFIXSTATUSLABEL_RESERVED PrefixStatusLabel = "Reserved" + PREFIXSTATUSLABEL_DEPRECATED PrefixStatusLabel = "Deprecated" +) + +// All allowed values of PrefixStatusLabel enum +var AllowedPrefixStatusLabelEnumValues = []PrefixStatusLabel{ + "Container", + "Active", + "Reserved", + "Deprecated", +} + +func (v *PrefixStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PrefixStatusLabel(value) + for _, existing := range AllowedPrefixStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PrefixStatusLabel", value) +} + +// NewPrefixStatusLabelFromValue returns a pointer to a valid PrefixStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPrefixStatusLabelFromValue(v string) (*PrefixStatusLabel, error) { + ev := PrefixStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PrefixStatusLabel: valid values are %v", v, AllowedPrefixStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PrefixStatusLabel) IsValid() bool { + for _, existing := range AllowedPrefixStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Prefix_status_label value +func (v PrefixStatusLabel) Ptr() *PrefixStatusLabel { + return &v +} + +type NullablePrefixStatusLabel struct { + value *PrefixStatusLabel + isSet bool +} + +func (v NullablePrefixStatusLabel) Get() *PrefixStatusLabel { + return v.value +} + +func (v *NullablePrefixStatusLabel) Set(val *PrefixStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullablePrefixStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullablePrefixStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePrefixStatusLabel(val *PrefixStatusLabel) *NullablePrefixStatusLabel { + return &NullablePrefixStatusLabel{value: val, isSet: true} +} + +func (v NullablePrefixStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePrefixStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status_value.go new file mode 100644 index 00000000..7c017803 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_prefix_status_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// PrefixStatusValue * `container` - Container * `active` - Active * `reserved` - Reserved * `deprecated` - Deprecated +type PrefixStatusValue string + +// List of Prefix_status_value +const ( + PREFIXSTATUSVALUE_CONTAINER PrefixStatusValue = "container" + PREFIXSTATUSVALUE_ACTIVE PrefixStatusValue = "active" + PREFIXSTATUSVALUE_RESERVED PrefixStatusValue = "reserved" + PREFIXSTATUSVALUE_DEPRECATED PrefixStatusValue = "deprecated" +) + +// All allowed values of PrefixStatusValue enum +var AllowedPrefixStatusValueEnumValues = []PrefixStatusValue{ + "container", + "active", + "reserved", + "deprecated", +} + +func (v *PrefixStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PrefixStatusValue(value) + for _, existing := range AllowedPrefixStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PrefixStatusValue", value) +} + +// NewPrefixStatusValueFromValue returns a pointer to a valid PrefixStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPrefixStatusValueFromValue(v string) (*PrefixStatusValue, error) { + ev := PrefixStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PrefixStatusValue: valid values are %v", v, AllowedPrefixStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PrefixStatusValue) IsValid() bool { + for _, existing := range AllowedPrefixStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Prefix_status_value value +func (v PrefixStatusValue) Ptr() *PrefixStatusValue { + return &v +} + +type NullablePrefixStatusValue struct { + value *PrefixStatusValue + isSet bool +} + +func (v NullablePrefixStatusValue) Get() *PrefixStatusValue { + return v.value +} + +func (v *NullablePrefixStatusValue) Set(val *PrefixStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullablePrefixStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullablePrefixStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePrefixStatusValue(val *PrefixStatusValue) *NullablePrefixStatusValue { + return &NullablePrefixStatusValue{value: val, isSet: true} +} + +func (v NullablePrefixStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePrefixStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_provider.go b/vendor/github.com/netbox-community/go-netbox/v3/model_provider.go new file mode 100644 index 00000000..0683c8d4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_provider.go @@ -0,0 +1,597 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Provider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Provider{} + +// Provider Adds support for custom fields and tags. +type Provider struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Full name of the provider + Name string `json:"name"` + Slug string `json:"slug"` + Accounts []int32 `json:"accounts,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + CircuitCount int32 `json:"circuit_count"` + AdditionalProperties map[string]interface{} +} + +type _Provider Provider + +// NewProvider instantiates a new Provider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProvider(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int32) *Provider { + this := Provider{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.CircuitCount = circuitCount + return &this +} + +// NewProviderWithDefaults instantiates a new Provider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProviderWithDefaults() *Provider { + this := Provider{} + return &this +} + +// GetId returns the Id field value +func (o *Provider) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Provider) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Provider) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Provider) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Provider) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Provider) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Provider) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Provider) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Provider) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Provider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Provider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Provider) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Provider) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Provider) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Provider) SetSlug(v string) { + o.Slug = v +} + +// GetAccounts returns the Accounts field value if set, zero value otherwise. +func (o *Provider) GetAccounts() []int32 { + if o == nil || IsNil(o.Accounts) { + var ret []int32 + return ret + } + return o.Accounts +} + +// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetAccountsOk() ([]int32, bool) { + if o == nil || IsNil(o.Accounts) { + return nil, false + } + return o.Accounts, true +} + +// HasAccounts returns a boolean if a field has been set. +func (o *Provider) HasAccounts() bool { + if o != nil && !IsNil(o.Accounts) { + return true + } + + return false +} + +// SetAccounts gets a reference to the given []int32 and assigns it to the Accounts field. +func (o *Provider) SetAccounts(v []int32) { + o.Accounts = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Provider) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Provider) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Provider) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Provider) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Provider) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Provider) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *Provider) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *Provider) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *Provider) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Provider) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Provider) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Provider) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Provider) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Provider) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Provider) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Provider) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Provider) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Provider) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Provider) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Provider) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Provider) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetCircuitCount returns the CircuitCount field value +func (o *Provider) GetCircuitCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CircuitCount +} + +// GetCircuitCountOk returns a tuple with the CircuitCount field value +// and a boolean to check if the value has been set. +func (o *Provider) GetCircuitCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CircuitCount, true +} + +// SetCircuitCount sets field value +func (o *Provider) SetCircuitCount(v int32) { + o.CircuitCount = v +} + +func (o Provider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Provider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Accounts) { + toSerialize["accounts"] = o.Accounts + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["circuit_count"] = o.CircuitCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Provider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "circuit_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProvider := _Provider{} + + err = json.Unmarshal(data, &varProvider) + + if err != nil { + return err + } + + *o = Provider(varProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "accounts") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "circuit_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProvider struct { + value *Provider + isSet bool +} + +func (v NullableProvider) Get() *Provider { + return v.value +} + +func (v *NullableProvider) Set(val *Provider) { + v.value = val + v.isSet = true +} + +func (v NullableProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProvider(val *Provider) *NullableProvider { + return &NullableProvider{value: val, isSet: true} +} + +func (v NullableProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_provider_account.go b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_account.go new file mode 100644 index 00000000..18b60067 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_account.go @@ -0,0 +1,530 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ProviderAccount type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderAccount{} + +// ProviderAccount Adds support for custom fields and tags. +type ProviderAccount struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Provider NestedProvider `json:"provider"` + Name *string `json:"name,omitempty"` + Account string `json:"account"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ProviderAccount ProviderAccount + +// NewProviderAccount instantiates a new ProviderAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProviderAccount(id int32, url string, display string, provider NestedProvider, account string, created NullableTime, lastUpdated NullableTime) *ProviderAccount { + this := ProviderAccount{} + this.Id = id + this.Url = url + this.Display = display + this.Provider = provider + this.Account = account + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewProviderAccountWithDefaults instantiates a new ProviderAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProviderAccountWithDefaults() *ProviderAccount { + this := ProviderAccount{} + return &this +} + +// GetId returns the Id field value +func (o *ProviderAccount) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ProviderAccount) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ProviderAccount) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ProviderAccount) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ProviderAccount) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ProviderAccount) SetDisplay(v string) { + o.Display = v +} + +// GetProvider returns the Provider field value +func (o *ProviderAccount) GetProvider() NestedProvider { + if o == nil { + var ret NestedProvider + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetProviderOk() (*NestedProvider, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *ProviderAccount) SetProvider(v NestedProvider) { + o.Provider = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ProviderAccount) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ProviderAccount) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ProviderAccount) SetName(v string) { + o.Name = &v +} + +// GetAccount returns the Account field value +func (o *ProviderAccount) GetAccount() string { + if o == nil { + var ret string + return ret + } + + return o.Account +} + +// GetAccountOk returns a tuple with the Account field value +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Account, true +} + +// SetAccount sets field value +func (o *ProviderAccount) SetAccount(v string) { + o.Account = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ProviderAccount) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ProviderAccount) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ProviderAccount) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ProviderAccount) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ProviderAccount) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ProviderAccount) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProviderAccount) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProviderAccount) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ProviderAccount) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ProviderAccount) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccount) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ProviderAccount) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ProviderAccount) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ProviderAccount) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProviderAccount) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ProviderAccount) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ProviderAccount) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProviderAccount) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ProviderAccount) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ProviderAccount) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProviderAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["provider"] = o.Provider + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["account"] = o.Account + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProviderAccount) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "provider", + "account", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProviderAccount := _ProviderAccount{} + + err = json.Unmarshal(data, &varProviderAccount) + + if err != nil { + return err + } + + *o = ProviderAccount(varProviderAccount) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "account") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProviderAccount struct { + value *ProviderAccount + isSet bool +} + +func (v NullableProviderAccount) Get() *ProviderAccount { + return v.value +} + +func (v *NullableProviderAccount) Set(val *ProviderAccount) { + v.value = val + v.isSet = true +} + +func (v NullableProviderAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderAccount(val *ProviderAccount) *NullableProviderAccount { + return &NullableProviderAccount{value: val, isSet: true} +} + +func (v NullableProviderAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_provider_account_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_account_request.go new file mode 100644 index 00000000..3b9a3c9a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_account_request.go @@ -0,0 +1,380 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProviderAccountRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderAccountRequest{} + +// ProviderAccountRequest Adds support for custom fields and tags. +type ProviderAccountRequest struct { + Provider NestedProviderRequest `json:"provider"` + Name *string `json:"name,omitempty"` + Account string `json:"account"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProviderAccountRequest ProviderAccountRequest + +// NewProviderAccountRequest instantiates a new ProviderAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProviderAccountRequest(provider NestedProviderRequest, account string) *ProviderAccountRequest { + this := ProviderAccountRequest{} + this.Provider = provider + this.Account = account + return &this +} + +// NewProviderAccountRequestWithDefaults instantiates a new ProviderAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProviderAccountRequestWithDefaults() *ProviderAccountRequest { + this := ProviderAccountRequest{} + return &this +} + +// GetProvider returns the Provider field value +func (o *ProviderAccountRequest) GetProvider() NestedProviderRequest { + if o == nil { + var ret NestedProviderRequest + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *ProviderAccountRequest) GetProviderOk() (*NestedProviderRequest, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *ProviderAccountRequest) SetProvider(v NestedProviderRequest) { + o.Provider = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ProviderAccountRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccountRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ProviderAccountRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ProviderAccountRequest) SetName(v string) { + o.Name = &v +} + +// GetAccount returns the Account field value +func (o *ProviderAccountRequest) GetAccount() string { + if o == nil { + var ret string + return ret + } + + return o.Account +} + +// GetAccountOk returns a tuple with the Account field value +// and a boolean to check if the value has been set. +func (o *ProviderAccountRequest) GetAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Account, true +} + +// SetAccount sets field value +func (o *ProviderAccountRequest) SetAccount(v string) { + o.Account = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ProviderAccountRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccountRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ProviderAccountRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ProviderAccountRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ProviderAccountRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccountRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ProviderAccountRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ProviderAccountRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProviderAccountRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccountRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProviderAccountRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ProviderAccountRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ProviderAccountRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderAccountRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ProviderAccountRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ProviderAccountRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ProviderAccountRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProviderAccountRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["provider"] = o.Provider + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["account"] = o.Account + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProviderAccountRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "provider", + "account", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProviderAccountRequest := _ProviderAccountRequest{} + + err = json.Unmarshal(data, &varProviderAccountRequest) + + if err != nil { + return err + } + + *o = ProviderAccountRequest(varProviderAccountRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "account") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProviderAccountRequest struct { + value *ProviderAccountRequest + isSet bool +} + +func (v NullableProviderAccountRequest) Get() *ProviderAccountRequest { + return v.value +} + +func (v *NullableProviderAccountRequest) Set(val *ProviderAccountRequest) { + v.value = val + v.isSet = true +} + +func (v NullableProviderAccountRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderAccountRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderAccountRequest(val *ProviderAccountRequest) *NullableProviderAccountRequest { + return &NullableProviderAccountRequest{value: val, isSet: true} +} + +func (v NullableProviderAccountRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderAccountRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_provider_network.go b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_network.go new file mode 100644 index 00000000..c702a918 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_network.go @@ -0,0 +1,530 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ProviderNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderNetwork{} + +// ProviderNetwork Adds support for custom fields and tags. +type ProviderNetwork struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Provider NestedProvider `json:"provider"` + Name string `json:"name"` + ServiceId *string `json:"service_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ProviderNetwork ProviderNetwork + +// NewProviderNetwork instantiates a new ProviderNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProviderNetwork(id int32, url string, display string, provider NestedProvider, name string, created NullableTime, lastUpdated NullableTime) *ProviderNetwork { + this := ProviderNetwork{} + this.Id = id + this.Url = url + this.Display = display + this.Provider = provider + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewProviderNetworkWithDefaults instantiates a new ProviderNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProviderNetworkWithDefaults() *ProviderNetwork { + this := ProviderNetwork{} + return &this +} + +// GetId returns the Id field value +func (o *ProviderNetwork) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ProviderNetwork) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ProviderNetwork) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ProviderNetwork) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ProviderNetwork) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ProviderNetwork) SetDisplay(v string) { + o.Display = v +} + +// GetProvider returns the Provider field value +func (o *ProviderNetwork) GetProvider() NestedProvider { + if o == nil { + var ret NestedProvider + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetProviderOk() (*NestedProvider, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *ProviderNetwork) SetProvider(v NestedProvider) { + o.Provider = v +} + +// GetName returns the Name field value +func (o *ProviderNetwork) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProviderNetwork) SetName(v string) { + o.Name = v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *ProviderNetwork) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *ProviderNetwork) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *ProviderNetwork) SetServiceId(v string) { + o.ServiceId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ProviderNetwork) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ProviderNetwork) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ProviderNetwork) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ProviderNetwork) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ProviderNetwork) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ProviderNetwork) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProviderNetwork) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProviderNetwork) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ProviderNetwork) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ProviderNetwork) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetwork) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ProviderNetwork) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ProviderNetwork) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ProviderNetwork) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProviderNetwork) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ProviderNetwork) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ProviderNetwork) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProviderNetwork) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ProviderNetwork) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ProviderNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProviderNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["provider"] = o.Provider + toSerialize["name"] = o.Name + if !IsNil(o.ServiceId) { + toSerialize["service_id"] = o.ServiceId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProviderNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "provider", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProviderNetwork := _ProviderNetwork{} + + err = json.Unmarshal(data, &varProviderNetwork) + + if err != nil { + return err + } + + *o = ProviderNetwork(varProviderNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "service_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProviderNetwork struct { + value *ProviderNetwork + isSet bool +} + +func (v NullableProviderNetwork) Get() *ProviderNetwork { + return v.value +} + +func (v *NullableProviderNetwork) Set(val *ProviderNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableProviderNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderNetwork(val *ProviderNetwork) *NullableProviderNetwork { + return &NullableProviderNetwork{value: val, isSet: true} +} + +func (v NullableProviderNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_provider_network_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_network_request.go new file mode 100644 index 00000000..c469be62 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_network_request.go @@ -0,0 +1,380 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProviderNetworkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderNetworkRequest{} + +// ProviderNetworkRequest Adds support for custom fields and tags. +type ProviderNetworkRequest struct { + Provider NestedProviderRequest `json:"provider"` + Name string `json:"name"` + ServiceId *string `json:"service_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProviderNetworkRequest ProviderNetworkRequest + +// NewProviderNetworkRequest instantiates a new ProviderNetworkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProviderNetworkRequest(provider NestedProviderRequest, name string) *ProviderNetworkRequest { + this := ProviderNetworkRequest{} + this.Provider = provider + this.Name = name + return &this +} + +// NewProviderNetworkRequestWithDefaults instantiates a new ProviderNetworkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProviderNetworkRequestWithDefaults() *ProviderNetworkRequest { + this := ProviderNetworkRequest{} + return &this +} + +// GetProvider returns the Provider field value +func (o *ProviderNetworkRequest) GetProvider() NestedProviderRequest { + if o == nil { + var ret NestedProviderRequest + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *ProviderNetworkRequest) GetProviderOk() (*NestedProviderRequest, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *ProviderNetworkRequest) SetProvider(v NestedProviderRequest) { + o.Provider = v +} + +// GetName returns the Name field value +func (o *ProviderNetworkRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProviderNetworkRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProviderNetworkRequest) SetName(v string) { + o.Name = v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *ProviderNetworkRequest) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetworkRequest) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *ProviderNetworkRequest) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *ProviderNetworkRequest) SetServiceId(v string) { + o.ServiceId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ProviderNetworkRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetworkRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ProviderNetworkRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ProviderNetworkRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ProviderNetworkRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetworkRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ProviderNetworkRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ProviderNetworkRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProviderNetworkRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetworkRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProviderNetworkRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ProviderNetworkRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ProviderNetworkRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderNetworkRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ProviderNetworkRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ProviderNetworkRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ProviderNetworkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProviderNetworkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["provider"] = o.Provider + toSerialize["name"] = o.Name + if !IsNil(o.ServiceId) { + toSerialize["service_id"] = o.ServiceId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProviderNetworkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "provider", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProviderNetworkRequest := _ProviderNetworkRequest{} + + err = json.Unmarshal(data, &varProviderNetworkRequest) + + if err != nil { + return err + } + + *o = ProviderNetworkRequest(varProviderNetworkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "service_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProviderNetworkRequest struct { + value *ProviderNetworkRequest + isSet bool +} + +func (v NullableProviderNetworkRequest) Get() *ProviderNetworkRequest { + return v.value +} + +func (v *NullableProviderNetworkRequest) Set(val *ProviderNetworkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableProviderNetworkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderNetworkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderNetworkRequest(val *ProviderNetworkRequest) *NullableProviderNetworkRequest { + return &NullableProviderNetworkRequest{value: val, isSet: true} +} + +func (v NullableProviderNetworkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderNetworkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_provider_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_request.go new file mode 100644 index 00000000..1abdd848 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_provider_request.go @@ -0,0 +1,418 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderRequest{} + +// ProviderRequest Adds support for custom fields and tags. +type ProviderRequest struct { + // Full name of the provider + Name string `json:"name"` + Slug string `json:"slug"` + Accounts []int32 `json:"accounts,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProviderRequest ProviderRequest + +// NewProviderRequest instantiates a new ProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProviderRequest(name string, slug string) *ProviderRequest { + this := ProviderRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewProviderRequestWithDefaults instantiates a new ProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProviderRequestWithDefaults() *ProviderRequest { + this := ProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProviderRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ProviderRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ProviderRequest) SetSlug(v string) { + o.Slug = v +} + +// GetAccounts returns the Accounts field value if set, zero value otherwise. +func (o *ProviderRequest) GetAccounts() []int32 { + if o == nil || IsNil(o.Accounts) { + var ret []int32 + return ret + } + return o.Accounts +} + +// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetAccountsOk() ([]int32, bool) { + if o == nil || IsNil(o.Accounts) { + return nil, false + } + return o.Accounts, true +} + +// HasAccounts returns a boolean if a field has been set. +func (o *ProviderRequest) HasAccounts() bool { + if o != nil && !IsNil(o.Accounts) { + return true + } + + return false +} + +// SetAccounts gets a reference to the given []int32 and assigns it to the Accounts field. +func (o *ProviderRequest) SetAccounts(v []int32) { + o.Accounts = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ProviderRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ProviderRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ProviderRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ProviderRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ProviderRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ProviderRequest) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *ProviderRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *ProviderRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *ProviderRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProviderRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProviderRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ProviderRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ProviderRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProviderRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ProviderRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ProviderRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Accounts) { + toSerialize["accounts"] = o.Accounts + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProviderRequest := _ProviderRequest{} + + err = json.Unmarshal(data, &varProviderRequest) + + if err != nil { + return err + } + + *o = ProviderRequest(varProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "accounts") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProviderRequest struct { + value *ProviderRequest + isSet bool +} + +func (v NullableProviderRequest) Get() *ProviderRequest { + return v.value +} + +func (v *NullableProviderRequest) Set(val *ProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderRequest(val *ProviderRequest) *NullableProviderRequest { + return &NullableProviderRequest{value: val, isSet: true} +} + +func (v NullableProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack.go new file mode 100644 index 00000000..f46de854 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack.go @@ -0,0 +1,1405 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Rack type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Rack{} + +// Rack Adds support for custom fields and tags. +type Rack struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + FacilityId NullableString `json:"facility_id,omitempty"` + Site NestedSite `json:"site"` + Location NullableNestedLocation `json:"location,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Status *RackStatus `json:"status,omitempty"` + Role NullableNestedRackRole `json:"role,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this rack + AssetTag NullableString `json:"asset_tag,omitempty"` + Type NullableRackType `json:"type,omitempty"` + Width *RackWidth `json:"width,omitempty"` + // Height in rack units + UHeight *int32 `json:"u_height,omitempty"` + // Starting unit for rack + StartingUnit *int32 `json:"starting_unit,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + // Maximum load capacity for the rack + MaxWeight NullableInt32 `json:"max_weight,omitempty"` + WeightUnit NullableDeviceTypeWeightUnit `json:"weight_unit,omitempty"` + // Units are numbered top-to-bottom + DescUnits *bool `json:"desc_units,omitempty"` + // Outer dimension of rack (width) + OuterWidth NullableInt32 `json:"outer_width,omitempty"` + // Outer dimension of rack (depth) + OuterDepth NullableInt32 `json:"outer_depth,omitempty"` + OuterUnit NullableRackOuterUnit `json:"outer_unit,omitempty"` + // Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails. + MountingDepth NullableInt32 `json:"mounting_depth,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + DeviceCount int32 `json:"device_count"` + PowerfeedCount int32 `json:"powerfeed_count"` + AdditionalProperties map[string]interface{} +} + +type _Rack Rack + +// NewRack instantiates a new Rack object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRack(id int32, url string, display string, name string, site NestedSite, created NullableTime, lastUpdated NullableTime, deviceCount int32, powerfeedCount int32) *Rack { + this := Rack{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Site = site + this.Created = created + this.LastUpdated = lastUpdated + this.DeviceCount = deviceCount + this.PowerfeedCount = powerfeedCount + return &this +} + +// NewRackWithDefaults instantiates a new Rack object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackWithDefaults() *Rack { + this := Rack{} + return &this +} + +// GetId returns the Id field value +func (o *Rack) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Rack) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Rack) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Rack) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Rack) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Rack) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Rack) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Rack) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Rack) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Rack) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Rack) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Rack) SetName(v string) { + o.Name = v +} + +// GetFacilityId returns the FacilityId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetFacilityId() string { + if o == nil || IsNil(o.FacilityId.Get()) { + var ret string + return ret + } + return *o.FacilityId.Get() +} + +// GetFacilityIdOk returns a tuple with the FacilityId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetFacilityIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FacilityId.Get(), o.FacilityId.IsSet() +} + +// HasFacilityId returns a boolean if a field has been set. +func (o *Rack) HasFacilityId() bool { + if o != nil && o.FacilityId.IsSet() { + return true + } + + return false +} + +// SetFacilityId gets a reference to the given NullableString and assigns it to the FacilityId field. +func (o *Rack) SetFacilityId(v string) { + o.FacilityId.Set(&v) +} + +// SetFacilityIdNil sets the value for FacilityId to be an explicit nil +func (o *Rack) SetFacilityIdNil() { + o.FacilityId.Set(nil) +} + +// UnsetFacilityId ensures that no value is present for FacilityId, not even an explicit nil +func (o *Rack) UnsetFacilityId() { + o.FacilityId.Unset() +} + +// GetSite returns the Site field value +func (o *Rack) GetSite() NestedSite { + if o == nil { + var ret NestedSite + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *Rack) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *Rack) SetSite(v NestedSite) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetLocation() NestedLocation { + if o == nil || IsNil(o.Location.Get()) { + var ret NestedLocation + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetLocationOk() (*NestedLocation, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *Rack) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableNestedLocation and assigns it to the Location field. +func (o *Rack) SetLocation(v NestedLocation) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *Rack) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *Rack) UnsetLocation() { + o.Location.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Rack) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Rack) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Rack) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Rack) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Rack) GetStatus() RackStatus { + if o == nil || IsNil(o.Status) { + var ret RackStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetStatusOk() (*RackStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Rack) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given RackStatus and assigns it to the Status field. +func (o *Rack) SetStatus(v RackStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetRole() NestedRackRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRackRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetRoleOk() (*NestedRackRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *Rack) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRackRole and assigns it to the Role field. +func (o *Rack) SetRole(v NestedRackRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *Rack) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *Rack) UnsetRole() { + o.Role.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *Rack) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *Rack) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *Rack) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *Rack) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *Rack) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *Rack) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *Rack) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetType() RackType { + if o == nil || IsNil(o.Type.Get()) { + var ret RackType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetTypeOk() (*RackType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *Rack) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullableRackType and assigns it to the Type field. +func (o *Rack) SetType(v RackType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *Rack) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *Rack) UnsetType() { + o.Type.Unset() +} + +// GetWidth returns the Width field value if set, zero value otherwise. +func (o *Rack) GetWidth() RackWidth { + if o == nil || IsNil(o.Width) { + var ret RackWidth + return ret + } + return *o.Width +} + +// GetWidthOk returns a tuple with the Width field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetWidthOk() (*RackWidth, bool) { + if o == nil || IsNil(o.Width) { + return nil, false + } + return o.Width, true +} + +// HasWidth returns a boolean if a field has been set. +func (o *Rack) HasWidth() bool { + if o != nil && !IsNil(o.Width) { + return true + } + + return false +} + +// SetWidth gets a reference to the given RackWidth and assigns it to the Width field. +func (o *Rack) SetWidth(v RackWidth) { + o.Width = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *Rack) GetUHeight() int32 { + if o == nil || IsNil(o.UHeight) { + var ret int32 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetUHeightOk() (*int32, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *Rack) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given int32 and assigns it to the UHeight field. +func (o *Rack) SetUHeight(v int32) { + o.UHeight = &v +} + +// GetStartingUnit returns the StartingUnit field value if set, zero value otherwise. +func (o *Rack) GetStartingUnit() int32 { + if o == nil || IsNil(o.StartingUnit) { + var ret int32 + return ret + } + return *o.StartingUnit +} + +// GetStartingUnitOk returns a tuple with the StartingUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetStartingUnitOk() (*int32, bool) { + if o == nil || IsNil(o.StartingUnit) { + return nil, false + } + return o.StartingUnit, true +} + +// HasStartingUnit returns a boolean if a field has been set. +func (o *Rack) HasStartingUnit() bool { + if o != nil && !IsNil(o.StartingUnit) { + return true + } + + return false +} + +// SetStartingUnit gets a reference to the given int32 and assigns it to the StartingUnit field. +func (o *Rack) SetStartingUnit(v int32) { + o.StartingUnit = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *Rack) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *Rack) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *Rack) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *Rack) UnsetWeight() { + o.Weight.Unset() +} + +// GetMaxWeight returns the MaxWeight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetMaxWeight() int32 { + if o == nil || IsNil(o.MaxWeight.Get()) { + var ret int32 + return ret + } + return *o.MaxWeight.Get() +} + +// GetMaxWeightOk returns a tuple with the MaxWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetMaxWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxWeight.Get(), o.MaxWeight.IsSet() +} + +// HasMaxWeight returns a boolean if a field has been set. +func (o *Rack) HasMaxWeight() bool { + if o != nil && o.MaxWeight.IsSet() { + return true + } + + return false +} + +// SetMaxWeight gets a reference to the given NullableInt32 and assigns it to the MaxWeight field. +func (o *Rack) SetMaxWeight(v int32) { + o.MaxWeight.Set(&v) +} + +// SetMaxWeightNil sets the value for MaxWeight to be an explicit nil +func (o *Rack) SetMaxWeightNil() { + o.MaxWeight.Set(nil) +} + +// UnsetMaxWeight ensures that no value is present for MaxWeight, not even an explicit nil +func (o *Rack) UnsetMaxWeight() { + o.MaxWeight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetWeightUnit() DeviceTypeWeightUnit { + if o == nil || IsNil(o.WeightUnit.Get()) { + var ret DeviceTypeWeightUnit + return ret + } + return *o.WeightUnit.Get() +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetWeightUnitOk() (*DeviceTypeWeightUnit, bool) { + if o == nil { + return nil, false + } + return o.WeightUnit.Get(), o.WeightUnit.IsSet() +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *Rack) HasWeightUnit() bool { + if o != nil && o.WeightUnit.IsSet() { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given NullableDeviceTypeWeightUnit and assigns it to the WeightUnit field. +func (o *Rack) SetWeightUnit(v DeviceTypeWeightUnit) { + o.WeightUnit.Set(&v) +} + +// SetWeightUnitNil sets the value for WeightUnit to be an explicit nil +func (o *Rack) SetWeightUnitNil() { + o.WeightUnit.Set(nil) +} + +// UnsetWeightUnit ensures that no value is present for WeightUnit, not even an explicit nil +func (o *Rack) UnsetWeightUnit() { + o.WeightUnit.Unset() +} + +// GetDescUnits returns the DescUnits field value if set, zero value otherwise. +func (o *Rack) GetDescUnits() bool { + if o == nil || IsNil(o.DescUnits) { + var ret bool + return ret + } + return *o.DescUnits +} + +// GetDescUnitsOk returns a tuple with the DescUnits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetDescUnitsOk() (*bool, bool) { + if o == nil || IsNil(o.DescUnits) { + return nil, false + } + return o.DescUnits, true +} + +// HasDescUnits returns a boolean if a field has been set. +func (o *Rack) HasDescUnits() bool { + if o != nil && !IsNil(o.DescUnits) { + return true + } + + return false +} + +// SetDescUnits gets a reference to the given bool and assigns it to the DescUnits field. +func (o *Rack) SetDescUnits(v bool) { + o.DescUnits = &v +} + +// GetOuterWidth returns the OuterWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetOuterWidth() int32 { + if o == nil || IsNil(o.OuterWidth.Get()) { + var ret int32 + return ret + } + return *o.OuterWidth.Get() +} + +// GetOuterWidthOk returns a tuple with the OuterWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetOuterWidthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterWidth.Get(), o.OuterWidth.IsSet() +} + +// HasOuterWidth returns a boolean if a field has been set. +func (o *Rack) HasOuterWidth() bool { + if o != nil && o.OuterWidth.IsSet() { + return true + } + + return false +} + +// SetOuterWidth gets a reference to the given NullableInt32 and assigns it to the OuterWidth field. +func (o *Rack) SetOuterWidth(v int32) { + o.OuterWidth.Set(&v) +} + +// SetOuterWidthNil sets the value for OuterWidth to be an explicit nil +func (o *Rack) SetOuterWidthNil() { + o.OuterWidth.Set(nil) +} + +// UnsetOuterWidth ensures that no value is present for OuterWidth, not even an explicit nil +func (o *Rack) UnsetOuterWidth() { + o.OuterWidth.Unset() +} + +// GetOuterDepth returns the OuterDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetOuterDepth() int32 { + if o == nil || IsNil(o.OuterDepth.Get()) { + var ret int32 + return ret + } + return *o.OuterDepth.Get() +} + +// GetOuterDepthOk returns a tuple with the OuterDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetOuterDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterDepth.Get(), o.OuterDepth.IsSet() +} + +// HasOuterDepth returns a boolean if a field has been set. +func (o *Rack) HasOuterDepth() bool { + if o != nil && o.OuterDepth.IsSet() { + return true + } + + return false +} + +// SetOuterDepth gets a reference to the given NullableInt32 and assigns it to the OuterDepth field. +func (o *Rack) SetOuterDepth(v int32) { + o.OuterDepth.Set(&v) +} + +// SetOuterDepthNil sets the value for OuterDepth to be an explicit nil +func (o *Rack) SetOuterDepthNil() { + o.OuterDepth.Set(nil) +} + +// UnsetOuterDepth ensures that no value is present for OuterDepth, not even an explicit nil +func (o *Rack) UnsetOuterDepth() { + o.OuterDepth.Unset() +} + +// GetOuterUnit returns the OuterUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetOuterUnit() RackOuterUnit { + if o == nil || IsNil(o.OuterUnit.Get()) { + var ret RackOuterUnit + return ret + } + return *o.OuterUnit.Get() +} + +// GetOuterUnitOk returns a tuple with the OuterUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetOuterUnitOk() (*RackOuterUnit, bool) { + if o == nil { + return nil, false + } + return o.OuterUnit.Get(), o.OuterUnit.IsSet() +} + +// HasOuterUnit returns a boolean if a field has been set. +func (o *Rack) HasOuterUnit() bool { + if o != nil && o.OuterUnit.IsSet() { + return true + } + + return false +} + +// SetOuterUnit gets a reference to the given NullableRackOuterUnit and assigns it to the OuterUnit field. +func (o *Rack) SetOuterUnit(v RackOuterUnit) { + o.OuterUnit.Set(&v) +} + +// SetOuterUnitNil sets the value for OuterUnit to be an explicit nil +func (o *Rack) SetOuterUnitNil() { + o.OuterUnit.Set(nil) +} + +// UnsetOuterUnit ensures that no value is present for OuterUnit, not even an explicit nil +func (o *Rack) UnsetOuterUnit() { + o.OuterUnit.Unset() +} + +// GetMountingDepth returns the MountingDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Rack) GetMountingDepth() int32 { + if o == nil || IsNil(o.MountingDepth.Get()) { + var ret int32 + return ret + } + return *o.MountingDepth.Get() +} + +// GetMountingDepthOk returns a tuple with the MountingDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetMountingDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MountingDepth.Get(), o.MountingDepth.IsSet() +} + +// HasMountingDepth returns a boolean if a field has been set. +func (o *Rack) HasMountingDepth() bool { + if o != nil && o.MountingDepth.IsSet() { + return true + } + + return false +} + +// SetMountingDepth gets a reference to the given NullableInt32 and assigns it to the MountingDepth field. +func (o *Rack) SetMountingDepth(v int32) { + o.MountingDepth.Set(&v) +} + +// SetMountingDepthNil sets the value for MountingDepth to be an explicit nil +func (o *Rack) SetMountingDepthNil() { + o.MountingDepth.Set(nil) +} + +// UnsetMountingDepth ensures that no value is present for MountingDepth, not even an explicit nil +func (o *Rack) UnsetMountingDepth() { + o.MountingDepth.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Rack) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Rack) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Rack) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Rack) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Rack) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Rack) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Rack) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Rack) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Rack) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Rack) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Rack) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Rack) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Rack) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Rack) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Rack) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Rack) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Rack) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Rack) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetDeviceCount returns the DeviceCount field value +func (o *Rack) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *Rack) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *Rack) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetPowerfeedCount returns the PowerfeedCount field value +func (o *Rack) GetPowerfeedCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerfeedCount +} + +// GetPowerfeedCountOk returns a tuple with the PowerfeedCount field value +// and a boolean to check if the value has been set. +func (o *Rack) GetPowerfeedCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerfeedCount, true +} + +// SetPowerfeedCount sets field value +func (o *Rack) SetPowerfeedCount(v int32) { + o.PowerfeedCount = v +} + +func (o Rack) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Rack) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if o.FacilityId.IsSet() { + toSerialize["facility_id"] = o.FacilityId.Get() + } + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if !IsNil(o.Width) { + toSerialize["width"] = o.Width + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.StartingUnit) { + toSerialize["starting_unit"] = o.StartingUnit + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.MaxWeight.IsSet() { + toSerialize["max_weight"] = o.MaxWeight.Get() + } + if o.WeightUnit.IsSet() { + toSerialize["weight_unit"] = o.WeightUnit.Get() + } + if !IsNil(o.DescUnits) { + toSerialize["desc_units"] = o.DescUnits + } + if o.OuterWidth.IsSet() { + toSerialize["outer_width"] = o.OuterWidth.Get() + } + if o.OuterDepth.IsSet() { + toSerialize["outer_depth"] = o.OuterDepth.Get() + } + if o.OuterUnit.IsSet() { + toSerialize["outer_unit"] = o.OuterUnit.Get() + } + if o.MountingDepth.IsSet() { + toSerialize["mounting_depth"] = o.MountingDepth.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["device_count"] = o.DeviceCount + toSerialize["powerfeed_count"] = o.PowerfeedCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Rack) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "site", + "created", + "last_updated", + "device_count", + "powerfeed_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRack := _Rack{} + + err = json.Unmarshal(data, &varRack) + + if err != nil { + return err + } + + *o = Rack(varRack) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "facility_id") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "type") + delete(additionalProperties, "width") + delete(additionalProperties, "u_height") + delete(additionalProperties, "starting_unit") + delete(additionalProperties, "weight") + delete(additionalProperties, "max_weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "desc_units") + delete(additionalProperties, "outer_width") + delete(additionalProperties, "outer_depth") + delete(additionalProperties, "outer_unit") + delete(additionalProperties, "mounting_depth") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "device_count") + delete(additionalProperties, "powerfeed_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRack struct { + value *Rack + isSet bool +} + +func (v NullableRack) Get() *Rack { + return v.value +} + +func (v *NullableRack) Set(val *Rack) { + v.value = val + v.isSet = true +} + +func (v NullableRack) IsSet() bool { + return v.isSet +} + +func (v *NullableRack) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRack(val *Rack) *NullableRack { + return &NullableRack{value: val, isSet: true} +} + +func (v NullableRack) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRack) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_face.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_face.go new file mode 100644 index 00000000..94de8a28 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_face.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackFace * `front` - Front * `rear` - Rear +type RackFace string + +// List of Rack_face +const ( + RACKFACE_FRONT RackFace = "front" + RACKFACE_REAR RackFace = "rear" + RACKFACE_EMPTY RackFace = "" +) + +// All allowed values of RackFace enum +var AllowedRackFaceEnumValues = []RackFace{ + "front", + "rear", + "", +} + +func (v *RackFace) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackFace(value) + for _, existing := range AllowedRackFaceEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackFace", value) +} + +// NewRackFaceFromValue returns a pointer to a valid RackFace +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackFaceFromValue(v string) (*RackFace, error) { + ev := RackFace(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackFace: valid values are %v", v, AllowedRackFaceEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackFace) IsValid() bool { + for _, existing := range AllowedRackFaceEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Rack_face value +func (v RackFace) Ptr() *RackFace { + return &v +} + +type NullableRackFace struct { + value *RackFace + isSet bool +} + +func (v NullableRackFace) Get() *RackFace { + return v.value +} + +func (v *NullableRackFace) Set(val *RackFace) { + v.value = val + v.isSet = true +} + +func (v NullableRackFace) IsSet() bool { + return v.isSet +} + +func (v *NullableRackFace) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackFace(val *RackFace) *NullableRackFace { + return &NullableRackFace{value: val, isSet: true} +} + +func (v NullableRackFace) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackFace) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_outer_unit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_outer_unit.go new file mode 100644 index 00000000..1c7cb7d8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_outer_unit.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the RackOuterUnit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackOuterUnit{} + +// RackOuterUnit struct for RackOuterUnit +type RackOuterUnit struct { + Value *PatchedWritableRackRequestOuterUnit `json:"value,omitempty"` + Label *RackOuterUnitLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackOuterUnit RackOuterUnit + +// NewRackOuterUnit instantiates a new RackOuterUnit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackOuterUnit() *RackOuterUnit { + this := RackOuterUnit{} + return &this +} + +// NewRackOuterUnitWithDefaults instantiates a new RackOuterUnit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackOuterUnitWithDefaults() *RackOuterUnit { + this := RackOuterUnit{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *RackOuterUnit) GetValue() PatchedWritableRackRequestOuterUnit { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableRackRequestOuterUnit + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackOuterUnit) GetValueOk() (*PatchedWritableRackRequestOuterUnit, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *RackOuterUnit) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableRackRequestOuterUnit and assigns it to the Value field. +func (o *RackOuterUnit) SetValue(v PatchedWritableRackRequestOuterUnit) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RackOuterUnit) GetLabel() RackOuterUnitLabel { + if o == nil || IsNil(o.Label) { + var ret RackOuterUnitLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackOuterUnit) GetLabelOk() (*RackOuterUnitLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RackOuterUnit) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given RackOuterUnitLabel and assigns it to the Label field. +func (o *RackOuterUnit) SetLabel(v RackOuterUnitLabel) { + o.Label = &v +} + +func (o RackOuterUnit) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackOuterUnit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackOuterUnit) UnmarshalJSON(data []byte) (err error) { + varRackOuterUnit := _RackOuterUnit{} + + err = json.Unmarshal(data, &varRackOuterUnit) + + if err != nil { + return err + } + + *o = RackOuterUnit(varRackOuterUnit) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackOuterUnit struct { + value *RackOuterUnit + isSet bool +} + +func (v NullableRackOuterUnit) Get() *RackOuterUnit { + return v.value +} + +func (v *NullableRackOuterUnit) Set(val *RackOuterUnit) { + v.value = val + v.isSet = true +} + +func (v NullableRackOuterUnit) IsSet() bool { + return v.isSet +} + +func (v *NullableRackOuterUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackOuterUnit(val *RackOuterUnit) *NullableRackOuterUnit { + return &NullableRackOuterUnit{value: val, isSet: true} +} + +func (v NullableRackOuterUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackOuterUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_outer_unit_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_outer_unit_label.go new file mode 100644 index 00000000..6b37e86b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_outer_unit_label.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackOuterUnitLabel the model 'RackOuterUnitLabel' +type RackOuterUnitLabel string + +// List of Rack_outer_unit_label +const ( + RACKOUTERUNITLABEL_MILLIMETERS RackOuterUnitLabel = "Millimeters" + RACKOUTERUNITLABEL_INCHES RackOuterUnitLabel = "Inches" +) + +// All allowed values of RackOuterUnitLabel enum +var AllowedRackOuterUnitLabelEnumValues = []RackOuterUnitLabel{ + "Millimeters", + "Inches", +} + +func (v *RackOuterUnitLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackOuterUnitLabel(value) + for _, existing := range AllowedRackOuterUnitLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackOuterUnitLabel", value) +} + +// NewRackOuterUnitLabelFromValue returns a pointer to a valid RackOuterUnitLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackOuterUnitLabelFromValue(v string) (*RackOuterUnitLabel, error) { + ev := RackOuterUnitLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackOuterUnitLabel: valid values are %v", v, AllowedRackOuterUnitLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackOuterUnitLabel) IsValid() bool { + for _, existing := range AllowedRackOuterUnitLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Rack_outer_unit_label value +func (v RackOuterUnitLabel) Ptr() *RackOuterUnitLabel { + return &v +} + +type NullableRackOuterUnitLabel struct { + value *RackOuterUnitLabel + isSet bool +} + +func (v NullableRackOuterUnitLabel) Get() *RackOuterUnitLabel { + return v.value +} + +func (v *NullableRackOuterUnitLabel) Set(val *RackOuterUnitLabel) { + v.value = val + v.isSet = true +} + +func (v NullableRackOuterUnitLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableRackOuterUnitLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackOuterUnitLabel(val *RackOuterUnitLabel) *NullableRackOuterUnitLabel { + return &NullableRackOuterUnitLabel{value: val, isSet: true} +} + +func (v NullableRackOuterUnitLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackOuterUnitLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request.go new file mode 100644 index 00000000..d9d5253e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request.go @@ -0,0 +1,1197 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RackRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackRequest{} + +// RackRequest Adds support for custom fields and tags. +type RackRequest struct { + Name string `json:"name"` + FacilityId NullableString `json:"facility_id,omitempty"` + Site NestedSiteRequest `json:"site"` + Location NullableNestedLocationRequest `json:"location,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Status *PatchedWritableRackRequestStatus `json:"status,omitempty"` + Role NullableNestedRackRoleRequest `json:"role,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this rack + AssetTag NullableString `json:"asset_tag,omitempty"` + Type NullableRackRequestType `json:"type,omitempty"` + Width *RackWidthValue `json:"width,omitempty"` + // Height in rack units + UHeight *int32 `json:"u_height,omitempty"` + // Starting unit for rack + StartingUnit *int32 `json:"starting_unit,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + // Maximum load capacity for the rack + MaxWeight NullableInt32 `json:"max_weight,omitempty"` + WeightUnit NullableDeviceTypeRequestWeightUnit `json:"weight_unit,omitempty"` + // Units are numbered top-to-bottom + DescUnits *bool `json:"desc_units,omitempty"` + // Outer dimension of rack (width) + OuterWidth NullableInt32 `json:"outer_width,omitempty"` + // Outer dimension of rack (depth) + OuterDepth NullableInt32 `json:"outer_depth,omitempty"` + OuterUnit NullableRackRequestOuterUnit `json:"outer_unit,omitempty"` + // Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails. + MountingDepth NullableInt32 `json:"mounting_depth,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackRequest RackRequest + +// NewRackRequest instantiates a new RackRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackRequest(name string, site NestedSiteRequest) *RackRequest { + this := RackRequest{} + this.Name = name + this.Site = site + return &this +} + +// NewRackRequestWithDefaults instantiates a new RackRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackRequestWithDefaults() *RackRequest { + this := RackRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RackRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RackRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RackRequest) SetName(v string) { + o.Name = v +} + +// GetFacilityId returns the FacilityId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetFacilityId() string { + if o == nil || IsNil(o.FacilityId.Get()) { + var ret string + return ret + } + return *o.FacilityId.Get() +} + +// GetFacilityIdOk returns a tuple with the FacilityId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetFacilityIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FacilityId.Get(), o.FacilityId.IsSet() +} + +// HasFacilityId returns a boolean if a field has been set. +func (o *RackRequest) HasFacilityId() bool { + if o != nil && o.FacilityId.IsSet() { + return true + } + + return false +} + +// SetFacilityId gets a reference to the given NullableString and assigns it to the FacilityId field. +func (o *RackRequest) SetFacilityId(v string) { + o.FacilityId.Set(&v) +} + +// SetFacilityIdNil sets the value for FacilityId to be an explicit nil +func (o *RackRequest) SetFacilityIdNil() { + o.FacilityId.Set(nil) +} + +// UnsetFacilityId ensures that no value is present for FacilityId, not even an explicit nil +func (o *RackRequest) UnsetFacilityId() { + o.FacilityId.Unset() +} + +// GetSite returns the Site field value +func (o *RackRequest) GetSite() NestedSiteRequest { + if o == nil { + var ret NestedSiteRequest + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *RackRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *RackRequest) SetSite(v NestedSiteRequest) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetLocation() NestedLocationRequest { + if o == nil || IsNil(o.Location.Get()) { + var ret NestedLocationRequest + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetLocationOk() (*NestedLocationRequest, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *RackRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableNestedLocationRequest and assigns it to the Location field. +func (o *RackRequest) SetLocation(v NestedLocationRequest) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *RackRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *RackRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *RackRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *RackRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *RackRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *RackRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RackRequest) GetStatus() PatchedWritableRackRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableRackRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetStatusOk() (*PatchedWritableRackRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *RackRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableRackRequestStatus and assigns it to the Status field. +func (o *RackRequest) SetStatus(v PatchedWritableRackRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetRole() NestedRackRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRackRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetRoleOk() (*NestedRackRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *RackRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRackRoleRequest and assigns it to the Role field. +func (o *RackRequest) SetRole(v NestedRackRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *RackRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *RackRequest) UnsetRole() { + o.Role.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *RackRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *RackRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *RackRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *RackRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *RackRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *RackRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *RackRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetType() RackRequestType { + if o == nil || IsNil(o.Type.Get()) { + var ret RackRequestType + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetTypeOk() (*RackRequestType, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *RackRequest) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullableRackRequestType and assigns it to the Type field. +func (o *RackRequest) SetType(v RackRequestType) { + o.Type.Set(&v) +} + +// SetTypeNil sets the value for Type to be an explicit nil +func (o *RackRequest) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *RackRequest) UnsetType() { + o.Type.Unset() +} + +// GetWidth returns the Width field value if set, zero value otherwise. +func (o *RackRequest) GetWidth() RackWidthValue { + if o == nil || IsNil(o.Width) { + var ret RackWidthValue + return ret + } + return *o.Width +} + +// GetWidthOk returns a tuple with the Width field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetWidthOk() (*RackWidthValue, bool) { + if o == nil || IsNil(o.Width) { + return nil, false + } + return o.Width, true +} + +// HasWidth returns a boolean if a field has been set. +func (o *RackRequest) HasWidth() bool { + if o != nil && !IsNil(o.Width) { + return true + } + + return false +} + +// SetWidth gets a reference to the given RackWidthValue and assigns it to the Width field. +func (o *RackRequest) SetWidth(v RackWidthValue) { + o.Width = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *RackRequest) GetUHeight() int32 { + if o == nil || IsNil(o.UHeight) { + var ret int32 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetUHeightOk() (*int32, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *RackRequest) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given int32 and assigns it to the UHeight field. +func (o *RackRequest) SetUHeight(v int32) { + o.UHeight = &v +} + +// GetStartingUnit returns the StartingUnit field value if set, zero value otherwise. +func (o *RackRequest) GetStartingUnit() int32 { + if o == nil || IsNil(o.StartingUnit) { + var ret int32 + return ret + } + return *o.StartingUnit +} + +// GetStartingUnitOk returns a tuple with the StartingUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetStartingUnitOk() (*int32, bool) { + if o == nil || IsNil(o.StartingUnit) { + return nil, false + } + return o.StartingUnit, true +} + +// HasStartingUnit returns a boolean if a field has been set. +func (o *RackRequest) HasStartingUnit() bool { + if o != nil && !IsNil(o.StartingUnit) { + return true + } + + return false +} + +// SetStartingUnit gets a reference to the given int32 and assigns it to the StartingUnit field. +func (o *RackRequest) SetStartingUnit(v int32) { + o.StartingUnit = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *RackRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *RackRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *RackRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *RackRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetMaxWeight returns the MaxWeight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetMaxWeight() int32 { + if o == nil || IsNil(o.MaxWeight.Get()) { + var ret int32 + return ret + } + return *o.MaxWeight.Get() +} + +// GetMaxWeightOk returns a tuple with the MaxWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetMaxWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxWeight.Get(), o.MaxWeight.IsSet() +} + +// HasMaxWeight returns a boolean if a field has been set. +func (o *RackRequest) HasMaxWeight() bool { + if o != nil && o.MaxWeight.IsSet() { + return true + } + + return false +} + +// SetMaxWeight gets a reference to the given NullableInt32 and assigns it to the MaxWeight field. +func (o *RackRequest) SetMaxWeight(v int32) { + o.MaxWeight.Set(&v) +} + +// SetMaxWeightNil sets the value for MaxWeight to be an explicit nil +func (o *RackRequest) SetMaxWeightNil() { + o.MaxWeight.Set(nil) +} + +// UnsetMaxWeight ensures that no value is present for MaxWeight, not even an explicit nil +func (o *RackRequest) UnsetMaxWeight() { + o.MaxWeight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetWeightUnit() DeviceTypeRequestWeightUnit { + if o == nil || IsNil(o.WeightUnit.Get()) { + var ret DeviceTypeRequestWeightUnit + return ret + } + return *o.WeightUnit.Get() +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetWeightUnitOk() (*DeviceTypeRequestWeightUnit, bool) { + if o == nil { + return nil, false + } + return o.WeightUnit.Get(), o.WeightUnit.IsSet() +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *RackRequest) HasWeightUnit() bool { + if o != nil && o.WeightUnit.IsSet() { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given NullableDeviceTypeRequestWeightUnit and assigns it to the WeightUnit field. +func (o *RackRequest) SetWeightUnit(v DeviceTypeRequestWeightUnit) { + o.WeightUnit.Set(&v) +} + +// SetWeightUnitNil sets the value for WeightUnit to be an explicit nil +func (o *RackRequest) SetWeightUnitNil() { + o.WeightUnit.Set(nil) +} + +// UnsetWeightUnit ensures that no value is present for WeightUnit, not even an explicit nil +func (o *RackRequest) UnsetWeightUnit() { + o.WeightUnit.Unset() +} + +// GetDescUnits returns the DescUnits field value if set, zero value otherwise. +func (o *RackRequest) GetDescUnits() bool { + if o == nil || IsNil(o.DescUnits) { + var ret bool + return ret + } + return *o.DescUnits +} + +// GetDescUnitsOk returns a tuple with the DescUnits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetDescUnitsOk() (*bool, bool) { + if o == nil || IsNil(o.DescUnits) { + return nil, false + } + return o.DescUnits, true +} + +// HasDescUnits returns a boolean if a field has been set. +func (o *RackRequest) HasDescUnits() bool { + if o != nil && !IsNil(o.DescUnits) { + return true + } + + return false +} + +// SetDescUnits gets a reference to the given bool and assigns it to the DescUnits field. +func (o *RackRequest) SetDescUnits(v bool) { + o.DescUnits = &v +} + +// GetOuterWidth returns the OuterWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetOuterWidth() int32 { + if o == nil || IsNil(o.OuterWidth.Get()) { + var ret int32 + return ret + } + return *o.OuterWidth.Get() +} + +// GetOuterWidthOk returns a tuple with the OuterWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetOuterWidthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterWidth.Get(), o.OuterWidth.IsSet() +} + +// HasOuterWidth returns a boolean if a field has been set. +func (o *RackRequest) HasOuterWidth() bool { + if o != nil && o.OuterWidth.IsSet() { + return true + } + + return false +} + +// SetOuterWidth gets a reference to the given NullableInt32 and assigns it to the OuterWidth field. +func (o *RackRequest) SetOuterWidth(v int32) { + o.OuterWidth.Set(&v) +} + +// SetOuterWidthNil sets the value for OuterWidth to be an explicit nil +func (o *RackRequest) SetOuterWidthNil() { + o.OuterWidth.Set(nil) +} + +// UnsetOuterWidth ensures that no value is present for OuterWidth, not even an explicit nil +func (o *RackRequest) UnsetOuterWidth() { + o.OuterWidth.Unset() +} + +// GetOuterDepth returns the OuterDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetOuterDepth() int32 { + if o == nil || IsNil(o.OuterDepth.Get()) { + var ret int32 + return ret + } + return *o.OuterDepth.Get() +} + +// GetOuterDepthOk returns a tuple with the OuterDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetOuterDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterDepth.Get(), o.OuterDepth.IsSet() +} + +// HasOuterDepth returns a boolean if a field has been set. +func (o *RackRequest) HasOuterDepth() bool { + if o != nil && o.OuterDepth.IsSet() { + return true + } + + return false +} + +// SetOuterDepth gets a reference to the given NullableInt32 and assigns it to the OuterDepth field. +func (o *RackRequest) SetOuterDepth(v int32) { + o.OuterDepth.Set(&v) +} + +// SetOuterDepthNil sets the value for OuterDepth to be an explicit nil +func (o *RackRequest) SetOuterDepthNil() { + o.OuterDepth.Set(nil) +} + +// UnsetOuterDepth ensures that no value is present for OuterDepth, not even an explicit nil +func (o *RackRequest) UnsetOuterDepth() { + o.OuterDepth.Unset() +} + +// GetOuterUnit returns the OuterUnit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetOuterUnit() RackRequestOuterUnit { + if o == nil || IsNil(o.OuterUnit.Get()) { + var ret RackRequestOuterUnit + return ret + } + return *o.OuterUnit.Get() +} + +// GetOuterUnitOk returns a tuple with the OuterUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetOuterUnitOk() (*RackRequestOuterUnit, bool) { + if o == nil { + return nil, false + } + return o.OuterUnit.Get(), o.OuterUnit.IsSet() +} + +// HasOuterUnit returns a boolean if a field has been set. +func (o *RackRequest) HasOuterUnit() bool { + if o != nil && o.OuterUnit.IsSet() { + return true + } + + return false +} + +// SetOuterUnit gets a reference to the given NullableRackRequestOuterUnit and assigns it to the OuterUnit field. +func (o *RackRequest) SetOuterUnit(v RackRequestOuterUnit) { + o.OuterUnit.Set(&v) +} + +// SetOuterUnitNil sets the value for OuterUnit to be an explicit nil +func (o *RackRequest) SetOuterUnitNil() { + o.OuterUnit.Set(nil) +} + +// UnsetOuterUnit ensures that no value is present for OuterUnit, not even an explicit nil +func (o *RackRequest) UnsetOuterUnit() { + o.OuterUnit.Unset() +} + +// GetMountingDepth returns the MountingDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackRequest) GetMountingDepth() int32 { + if o == nil || IsNil(o.MountingDepth.Get()) { + var ret int32 + return ret + } + return *o.MountingDepth.Get() +} + +// GetMountingDepthOk returns a tuple with the MountingDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRequest) GetMountingDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MountingDepth.Get(), o.MountingDepth.IsSet() +} + +// HasMountingDepth returns a boolean if a field has been set. +func (o *RackRequest) HasMountingDepth() bool { + if o != nil && o.MountingDepth.IsSet() { + return true + } + + return false +} + +// SetMountingDepth gets a reference to the given NullableInt32 and assigns it to the MountingDepth field. +func (o *RackRequest) SetMountingDepth(v int32) { + o.MountingDepth.Set(&v) +} + +// SetMountingDepthNil sets the value for MountingDepth to be an explicit nil +func (o *RackRequest) SetMountingDepthNil() { + o.MountingDepth.Set(nil) +} + +// UnsetMountingDepth ensures that no value is present for MountingDepth, not even an explicit nil +func (o *RackRequest) UnsetMountingDepth() { + o.MountingDepth.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RackRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RackRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RackRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *RackRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *RackRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *RackRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RackRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RackRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RackRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RackRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RackRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RackRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RackRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.FacilityId.IsSet() { + toSerialize["facility_id"] = o.FacilityId.Get() + } + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + if !IsNil(o.Width) { + toSerialize["width"] = o.Width + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.StartingUnit) { + toSerialize["starting_unit"] = o.StartingUnit + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.MaxWeight.IsSet() { + toSerialize["max_weight"] = o.MaxWeight.Get() + } + if o.WeightUnit.IsSet() { + toSerialize["weight_unit"] = o.WeightUnit.Get() + } + if !IsNil(o.DescUnits) { + toSerialize["desc_units"] = o.DescUnits + } + if o.OuterWidth.IsSet() { + toSerialize["outer_width"] = o.OuterWidth.Get() + } + if o.OuterDepth.IsSet() { + toSerialize["outer_depth"] = o.OuterDepth.Get() + } + if o.OuterUnit.IsSet() { + toSerialize["outer_unit"] = o.OuterUnit.Get() + } + if o.MountingDepth.IsSet() { + toSerialize["mounting_depth"] = o.MountingDepth.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "site", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRackRequest := _RackRequest{} + + err = json.Unmarshal(data, &varRackRequest) + + if err != nil { + return err + } + + *o = RackRequest(varRackRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "facility_id") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "type") + delete(additionalProperties, "width") + delete(additionalProperties, "u_height") + delete(additionalProperties, "starting_unit") + delete(additionalProperties, "weight") + delete(additionalProperties, "max_weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "desc_units") + delete(additionalProperties, "outer_width") + delete(additionalProperties, "outer_depth") + delete(additionalProperties, "outer_unit") + delete(additionalProperties, "mounting_depth") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackRequest struct { + value *RackRequest + isSet bool +} + +func (v NullableRackRequest) Get() *RackRequest { + return v.value +} + +func (v *NullableRackRequest) Set(val *RackRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRackRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRackRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackRequest(val *RackRequest) *NullableRackRequest { + return &NullableRackRequest{value: val, isSet: true} +} + +func (v NullableRackRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request_outer_unit.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request_outer_unit.go new file mode 100644 index 00000000..ab6bf294 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request_outer_unit.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackRequestOuterUnit * `mm` - Millimeters * `in` - Inches +type RackRequestOuterUnit string + +// List of RackRequest_outer_unit +const ( + RACKREQUESTOUTERUNIT_MM RackRequestOuterUnit = "mm" + RACKREQUESTOUTERUNIT_IN RackRequestOuterUnit = "in" + RACKREQUESTOUTERUNIT_EMPTY RackRequestOuterUnit = "" +) + +// All allowed values of RackRequestOuterUnit enum +var AllowedRackRequestOuterUnitEnumValues = []RackRequestOuterUnit{ + "mm", + "in", + "", +} + +func (v *RackRequestOuterUnit) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackRequestOuterUnit(value) + for _, existing := range AllowedRackRequestOuterUnitEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackRequestOuterUnit", value) +} + +// NewRackRequestOuterUnitFromValue returns a pointer to a valid RackRequestOuterUnit +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackRequestOuterUnitFromValue(v string) (*RackRequestOuterUnit, error) { + ev := RackRequestOuterUnit(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackRequestOuterUnit: valid values are %v", v, AllowedRackRequestOuterUnitEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackRequestOuterUnit) IsValid() bool { + for _, existing := range AllowedRackRequestOuterUnitEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RackRequest_outer_unit value +func (v RackRequestOuterUnit) Ptr() *RackRequestOuterUnit { + return &v +} + +type NullableRackRequestOuterUnit struct { + value *RackRequestOuterUnit + isSet bool +} + +func (v NullableRackRequestOuterUnit) Get() *RackRequestOuterUnit { + return v.value +} + +func (v *NullableRackRequestOuterUnit) Set(val *RackRequestOuterUnit) { + v.value = val + v.isSet = true +} + +func (v NullableRackRequestOuterUnit) IsSet() bool { + return v.isSet +} + +func (v *NullableRackRequestOuterUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackRequestOuterUnit(val *RackRequestOuterUnit) *NullableRackRequestOuterUnit { + return &NullableRackRequestOuterUnit{value: val, isSet: true} +} + +func (v NullableRackRequestOuterUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackRequestOuterUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request_type.go new file mode 100644 index 00000000..92351efe --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_request_type.go @@ -0,0 +1,122 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackRequestType * `2-post-frame` - 2-post frame * `4-post-frame` - 4-post frame * `4-post-cabinet` - 4-post cabinet * `wall-frame` - Wall-mounted frame * `wall-frame-vertical` - Wall-mounted frame (vertical) * `wall-cabinet` - Wall-mounted cabinet * `wall-cabinet-vertical` - Wall-mounted cabinet (vertical) +type RackRequestType string + +// List of RackRequest_type +const ( + RACKREQUESTTYPE__2_POST_FRAME RackRequestType = "2-post-frame" + RACKREQUESTTYPE__4_POST_FRAME RackRequestType = "4-post-frame" + RACKREQUESTTYPE__4_POST_CABINET RackRequestType = "4-post-cabinet" + RACKREQUESTTYPE_WALL_FRAME RackRequestType = "wall-frame" + RACKREQUESTTYPE_WALL_FRAME_VERTICAL RackRequestType = "wall-frame-vertical" + RACKREQUESTTYPE_WALL_CABINET RackRequestType = "wall-cabinet" + RACKREQUESTTYPE_WALL_CABINET_VERTICAL RackRequestType = "wall-cabinet-vertical" + RACKREQUESTTYPE_EMPTY RackRequestType = "" +) + +// All allowed values of RackRequestType enum +var AllowedRackRequestTypeEnumValues = []RackRequestType{ + "2-post-frame", + "4-post-frame", + "4-post-cabinet", + "wall-frame", + "wall-frame-vertical", + "wall-cabinet", + "wall-cabinet-vertical", + "", +} + +func (v *RackRequestType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackRequestType(value) + for _, existing := range AllowedRackRequestTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackRequestType", value) +} + +// NewRackRequestTypeFromValue returns a pointer to a valid RackRequestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackRequestTypeFromValue(v string) (*RackRequestType, error) { + ev := RackRequestType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackRequestType: valid values are %v", v, AllowedRackRequestTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackRequestType) IsValid() bool { + for _, existing := range AllowedRackRequestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RackRequest_type value +func (v RackRequestType) Ptr() *RackRequestType { + return &v +} + +type NullableRackRequestType struct { + value *RackRequestType + isSet bool +} + +func (v NullableRackRequestType) Get() *RackRequestType { + return v.value +} + +func (v *NullableRackRequestType) Set(val *RackRequestType) { + v.value = val + v.isSet = true +} + +func (v NullableRackRequestType) IsSet() bool { + return v.isSet +} + +func (v *NullableRackRequestType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackRequestType(val *RackRequestType) *NullableRackRequestType { + return &NullableRackRequestType{value: val, isSet: true} +} + +func (v NullableRackRequestType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackRequestType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_reservation.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_reservation.go new file mode 100644 index 00000000..901c5b0e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_reservation.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the RackReservation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackReservation{} + +// RackReservation Adds support for custom fields and tags. +type RackReservation struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Rack NestedRack `json:"rack"` + Units []int32 `json:"units"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + User NestedUser `json:"user"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Description string `json:"description"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackReservation RackReservation + +// NewRackReservation instantiates a new RackReservation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackReservation(id int32, url string, display string, rack NestedRack, units []int32, created NullableTime, lastUpdated NullableTime, user NestedUser, description string) *RackReservation { + this := RackReservation{} + this.Id = id + this.Url = url + this.Display = display + this.Rack = rack + this.Units = units + this.Created = created + this.LastUpdated = lastUpdated + this.User = user + this.Description = description + return &this +} + +// NewRackReservationWithDefaults instantiates a new RackReservation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackReservationWithDefaults() *RackReservation { + this := RackReservation{} + return &this +} + +// GetId returns the Id field value +func (o *RackReservation) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RackReservation) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RackReservation) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *RackReservation) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RackReservation) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RackReservation) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *RackReservation) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *RackReservation) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *RackReservation) SetDisplay(v string) { + o.Display = v +} + +// GetRack returns the Rack field value +func (o *RackReservation) GetRack() NestedRack { + if o == nil { + var ret NestedRack + return ret + } + + return o.Rack +} + +// GetRackOk returns a tuple with the Rack field value +// and a boolean to check if the value has been set. +func (o *RackReservation) GetRackOk() (*NestedRack, bool) { + if o == nil { + return nil, false + } + return &o.Rack, true +} + +// SetRack sets field value +func (o *RackReservation) SetRack(v NestedRack) { + o.Rack = v +} + +// GetUnits returns the Units field value +func (o *RackReservation) GetUnits() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Units +} + +// GetUnitsOk returns a tuple with the Units field value +// and a boolean to check if the value has been set. +func (o *RackReservation) GetUnitsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Units, true +} + +// SetUnits sets field value +func (o *RackReservation) SetUnits(v []int32) { + o.Units = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RackReservation) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackReservation) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *RackReservation) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RackReservation) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackReservation) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *RackReservation) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetUser returns the User field value +func (o *RackReservation) GetUser() NestedUser { + if o == nil { + var ret NestedUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *RackReservation) GetUserOk() (*NestedUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *RackReservation) SetUser(v NestedUser) { + o.User = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackReservation) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackReservation) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *RackReservation) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *RackReservation) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *RackReservation) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *RackReservation) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value +func (o *RackReservation) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *RackReservation) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *RackReservation) SetDescription(v string) { + o.Description = v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *RackReservation) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackReservation) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *RackReservation) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *RackReservation) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RackReservation) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackReservation) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RackReservation) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *RackReservation) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RackReservation) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackReservation) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RackReservation) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RackReservation) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RackReservation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackReservation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["rack"] = o.Rack + toSerialize["units"] = o.Units + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["user"] = o.User + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + toSerialize["description"] = o.Description + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackReservation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "rack", + "units", + "created", + "last_updated", + "user", + "description", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRackReservation := _RackReservation{} + + err = json.Unmarshal(data, &varRackReservation) + + if err != nil { + return err + } + + *o = RackReservation(varRackReservation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "rack") + delete(additionalProperties, "units") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "user") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackReservation struct { + value *RackReservation + isSet bool +} + +func (v NullableRackReservation) Get() *RackReservation { + return v.value +} + +func (v *NullableRackReservation) Set(val *RackReservation) { + v.value = val + v.isSet = true +} + +func (v NullableRackReservation) IsSet() bool { + return v.isSet +} + +func (v *NullableRackReservation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackReservation(val *RackReservation) *NullableRackReservation { + return &NullableRackReservation{value: val, isSet: true} +} + +func (v NullableRackReservation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackReservation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_reservation_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_reservation_request.go new file mode 100644 index 00000000..f5d20be5 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_reservation_request.go @@ -0,0 +1,412 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RackReservationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackReservationRequest{} + +// RackReservationRequest Adds support for custom fields and tags. +type RackReservationRequest struct { + Rack NestedRackRequest `json:"rack"` + Units []int32 `json:"units"` + User NestedUserRequest `json:"user"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Description string `json:"description"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackReservationRequest RackReservationRequest + +// NewRackReservationRequest instantiates a new RackReservationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackReservationRequest(rack NestedRackRequest, units []int32, user NestedUserRequest, description string) *RackReservationRequest { + this := RackReservationRequest{} + this.Rack = rack + this.Units = units + this.User = user + this.Description = description + return &this +} + +// NewRackReservationRequestWithDefaults instantiates a new RackReservationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackReservationRequestWithDefaults() *RackReservationRequest { + this := RackReservationRequest{} + return &this +} + +// GetRack returns the Rack field value +func (o *RackReservationRequest) GetRack() NestedRackRequest { + if o == nil { + var ret NestedRackRequest + return ret + } + + return o.Rack +} + +// GetRackOk returns a tuple with the Rack field value +// and a boolean to check if the value has been set. +func (o *RackReservationRequest) GetRackOk() (*NestedRackRequest, bool) { + if o == nil { + return nil, false + } + return &o.Rack, true +} + +// SetRack sets field value +func (o *RackReservationRequest) SetRack(v NestedRackRequest) { + o.Rack = v +} + +// GetUnits returns the Units field value +func (o *RackReservationRequest) GetUnits() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Units +} + +// GetUnitsOk returns a tuple with the Units field value +// and a boolean to check if the value has been set. +func (o *RackReservationRequest) GetUnitsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Units, true +} + +// SetUnits sets field value +func (o *RackReservationRequest) SetUnits(v []int32) { + o.Units = v +} + +// GetUser returns the User field value +func (o *RackReservationRequest) GetUser() NestedUserRequest { + if o == nil { + var ret NestedUserRequest + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *RackReservationRequest) GetUserOk() (*NestedUserRequest, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *RackReservationRequest) SetUser(v NestedUserRequest) { + o.User = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RackReservationRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackReservationRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *RackReservationRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *RackReservationRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *RackReservationRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *RackReservationRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value +func (o *RackReservationRequest) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *RackReservationRequest) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *RackReservationRequest) SetDescription(v string) { + o.Description = v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *RackReservationRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackReservationRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *RackReservationRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *RackReservationRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RackReservationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackReservationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RackReservationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RackReservationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RackReservationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackReservationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RackReservationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RackReservationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RackReservationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackReservationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["rack"] = o.Rack + toSerialize["units"] = o.Units + toSerialize["user"] = o.User + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + toSerialize["description"] = o.Description + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackReservationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "rack", + "units", + "user", + "description", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRackReservationRequest := _RackReservationRequest{} + + err = json.Unmarshal(data, &varRackReservationRequest) + + if err != nil { + return err + } + + *o = RackReservationRequest(varRackReservationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "rack") + delete(additionalProperties, "units") + delete(additionalProperties, "user") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackReservationRequest struct { + value *RackReservationRequest + isSet bool +} + +func (v NullableRackReservationRequest) Get() *RackReservationRequest { + return v.value +} + +func (v *NullableRackReservationRequest) Set(val *RackReservationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRackReservationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRackReservationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackReservationRequest(val *RackReservationRequest) *NullableRackReservationRequest { + return &NullableRackReservationRequest{value: val, isSet: true} +} + +func (v NullableRackReservationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackReservationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_role.go new file mode 100644 index 00000000..290d9573 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_role.go @@ -0,0 +1,522 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the RackRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackRole{} + +// RackRole Adds support for custom fields and tags. +type RackRole struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + RackCount int32 `json:"rack_count"` + AdditionalProperties map[string]interface{} +} + +type _RackRole RackRole + +// NewRackRole instantiates a new RackRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, rackCount int32) *RackRole { + this := RackRole{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.RackCount = rackCount + return &this +} + +// NewRackRoleWithDefaults instantiates a new RackRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackRoleWithDefaults() *RackRole { + this := RackRole{} + return &this +} + +// GetId returns the Id field value +func (o *RackRole) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RackRole) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RackRole) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *RackRole) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RackRole) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RackRole) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *RackRole) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *RackRole) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *RackRole) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *RackRole) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RackRole) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RackRole) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *RackRole) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *RackRole) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *RackRole) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *RackRole) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRole) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *RackRole) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *RackRole) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RackRole) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRole) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RackRole) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RackRole) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RackRole) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRole) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RackRole) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *RackRole) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RackRole) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRole) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RackRole) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RackRole) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RackRole) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRole) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *RackRole) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RackRole) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RackRole) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *RackRole) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetRackCount returns the RackCount field value +func (o *RackRole) GetRackCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RackCount +} + +// GetRackCountOk returns a tuple with the RackCount field value +// and a boolean to check if the value has been set. +func (o *RackRole) GetRackCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RackCount, true +} + +// SetRackCount sets field value +func (o *RackRole) SetRackCount(v int32) { + o.RackCount = v +} + +func (o RackRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["rack_count"] = o.RackCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "rack_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRackRole := _RackRole{} + + err = json.Unmarshal(data, &varRackRole) + + if err != nil { + return err + } + + *o = RackRole(varRackRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "rack_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackRole struct { + value *RackRole + isSet bool +} + +func (v NullableRackRole) Get() *RackRole { + return v.value +} + +func (v *NullableRackRole) Set(val *RackRole) { + v.value = val + v.isSet = true +} + +func (v NullableRackRole) IsSet() bool { + return v.isSet +} + +func (v *NullableRackRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackRole(val *RackRole) *NullableRackRole { + return &NullableRackRole{value: val, isSet: true} +} + +func (v NullableRackRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_role_request.go new file mode 100644 index 00000000..541392ea --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_role_request.go @@ -0,0 +1,343 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RackRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackRoleRequest{} + +// RackRoleRequest Adds support for custom fields and tags. +type RackRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackRoleRequest RackRoleRequest + +// NewRackRoleRequest instantiates a new RackRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackRoleRequest(name string, slug string) *RackRoleRequest { + this := RackRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewRackRoleRequestWithDefaults instantiates a new RackRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackRoleRequestWithDefaults() *RackRoleRequest { + this := RackRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RackRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RackRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RackRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *RackRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *RackRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *RackRoleRequest) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *RackRoleRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRoleRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *RackRoleRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *RackRoleRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RackRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RackRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RackRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RackRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RackRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RackRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RackRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RackRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RackRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RackRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRackRoleRequest := _RackRoleRequest{} + + err = json.Unmarshal(data, &varRackRoleRequest) + + if err != nil { + return err + } + + *o = RackRoleRequest(varRackRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackRoleRequest struct { + value *RackRoleRequest + isSet bool +} + +func (v NullableRackRoleRequest) Get() *RackRoleRequest { + return v.value +} + +func (v *NullableRackRoleRequest) Set(val *RackRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRackRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRackRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackRoleRequest(val *RackRoleRequest) *NullableRackRoleRequest { + return &NullableRackRoleRequest{value: val, isSet: true} +} + +func (v NullableRackRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_status.go new file mode 100644 index 00000000..fcba1876 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the RackStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackStatus{} + +// RackStatus struct for RackStatus +type RackStatus struct { + Value *PatchedWritableRackRequestStatus `json:"value,omitempty"` + Label *RackStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackStatus RackStatus + +// NewRackStatus instantiates a new RackStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackStatus() *RackStatus { + this := RackStatus{} + return &this +} + +// NewRackStatusWithDefaults instantiates a new RackStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackStatusWithDefaults() *RackStatus { + this := RackStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *RackStatus) GetValue() PatchedWritableRackRequestStatus { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableRackRequestStatus + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackStatus) GetValueOk() (*PatchedWritableRackRequestStatus, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *RackStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableRackRequestStatus and assigns it to the Value field. +func (o *RackStatus) SetValue(v PatchedWritableRackRequestStatus) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RackStatus) GetLabel() RackStatusLabel { + if o == nil || IsNil(o.Label) { + var ret RackStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackStatus) GetLabelOk() (*RackStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RackStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given RackStatusLabel and assigns it to the Label field. +func (o *RackStatus) SetLabel(v RackStatusLabel) { + o.Label = &v +} + +func (o RackStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackStatus) UnmarshalJSON(data []byte) (err error) { + varRackStatus := _RackStatus{} + + err = json.Unmarshal(data, &varRackStatus) + + if err != nil { + return err + } + + *o = RackStatus(varRackStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackStatus struct { + value *RackStatus + isSet bool +} + +func (v NullableRackStatus) Get() *RackStatus { + return v.value +} + +func (v *NullableRackStatus) Set(val *RackStatus) { + v.value = val + v.isSet = true +} + +func (v NullableRackStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableRackStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackStatus(val *RackStatus) *NullableRackStatus { + return &NullableRackStatus{value: val, isSet: true} +} + +func (v NullableRackStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_status_label.go new file mode 100644 index 00000000..00221c37 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_status_label.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackStatusLabel the model 'RackStatusLabel' +type RackStatusLabel string + +// List of Rack_status_label +const ( + RACKSTATUSLABEL_RESERVED RackStatusLabel = "Reserved" + RACKSTATUSLABEL_AVAILABLE RackStatusLabel = "Available" + RACKSTATUSLABEL_PLANNED RackStatusLabel = "Planned" + RACKSTATUSLABEL_ACTIVE RackStatusLabel = "Active" + RACKSTATUSLABEL_DEPRECATED RackStatusLabel = "Deprecated" +) + +// All allowed values of RackStatusLabel enum +var AllowedRackStatusLabelEnumValues = []RackStatusLabel{ + "Reserved", + "Available", + "Planned", + "Active", + "Deprecated", +} + +func (v *RackStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackStatusLabel(value) + for _, existing := range AllowedRackStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackStatusLabel", value) +} + +// NewRackStatusLabelFromValue returns a pointer to a valid RackStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackStatusLabelFromValue(v string) (*RackStatusLabel, error) { + ev := RackStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackStatusLabel: valid values are %v", v, AllowedRackStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackStatusLabel) IsValid() bool { + for _, existing := range AllowedRackStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Rack_status_label value +func (v RackStatusLabel) Ptr() *RackStatusLabel { + return &v +} + +type NullableRackStatusLabel struct { + value *RackStatusLabel + isSet bool +} + +func (v NullableRackStatusLabel) Get() *RackStatusLabel { + return v.value +} + +func (v *NullableRackStatusLabel) Set(val *RackStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableRackStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableRackStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackStatusLabel(val *RackStatusLabel) *NullableRackStatusLabel { + return &NullableRackStatusLabel{value: val, isSet: true} +} + +func (v NullableRackStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_type.go new file mode 100644 index 00000000..626d9709 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the RackType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackType{} + +// RackType struct for RackType +type RackType struct { + Value *PatchedWritableRackRequestType `json:"value,omitempty"` + Label *RackTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackType RackType + +// NewRackType instantiates a new RackType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackType() *RackType { + this := RackType{} + return &this +} + +// NewRackTypeWithDefaults instantiates a new RackType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackTypeWithDefaults() *RackType { + this := RackType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *RackType) GetValue() PatchedWritableRackRequestType { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableRackRequestType + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackType) GetValueOk() (*PatchedWritableRackRequestType, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *RackType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableRackRequestType and assigns it to the Value field. +func (o *RackType) SetValue(v PatchedWritableRackRequestType) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RackType) GetLabel() RackTypeLabel { + if o == nil || IsNil(o.Label) { + var ret RackTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackType) GetLabelOk() (*RackTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RackType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given RackTypeLabel and assigns it to the Label field. +func (o *RackType) SetLabel(v RackTypeLabel) { + o.Label = &v +} + +func (o RackType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackType) UnmarshalJSON(data []byte) (err error) { + varRackType := _RackType{} + + err = json.Unmarshal(data, &varRackType) + + if err != nil { + return err + } + + *o = RackType(varRackType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackType struct { + value *RackType + isSet bool +} + +func (v NullableRackType) Get() *RackType { + return v.value +} + +func (v *NullableRackType) Set(val *RackType) { + v.value = val + v.isSet = true +} + +func (v NullableRackType) IsSet() bool { + return v.isSet +} + +func (v *NullableRackType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackType(val *RackType) *NullableRackType { + return &NullableRackType{value: val, isSet: true} +} + +func (v NullableRackType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_type_label.go new file mode 100644 index 00000000..0b99176c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_type_label.go @@ -0,0 +1,120 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackTypeLabel the model 'RackTypeLabel' +type RackTypeLabel string + +// List of Rack_type_label +const ( + RACKTYPELABEL__2_POST_FRAME RackTypeLabel = "2-post frame" + RACKTYPELABEL__4_POST_FRAME RackTypeLabel = "4-post frame" + RACKTYPELABEL__4_POST_CABINET RackTypeLabel = "4-post cabinet" + RACKTYPELABEL_WALL_MOUNTED_FRAME RackTypeLabel = "Wall-mounted frame" + RACKTYPELABEL_WALL_MOUNTED_FRAME__VERTICAL RackTypeLabel = "Wall-mounted frame (vertical)" + RACKTYPELABEL_WALL_MOUNTED_CABINET RackTypeLabel = "Wall-mounted cabinet" + RACKTYPELABEL_WALL_MOUNTED_CABINET__VERTICAL RackTypeLabel = "Wall-mounted cabinet (vertical)" +) + +// All allowed values of RackTypeLabel enum +var AllowedRackTypeLabelEnumValues = []RackTypeLabel{ + "2-post frame", + "4-post frame", + "4-post cabinet", + "Wall-mounted frame", + "Wall-mounted frame (vertical)", + "Wall-mounted cabinet", + "Wall-mounted cabinet (vertical)", +} + +func (v *RackTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackTypeLabel(value) + for _, existing := range AllowedRackTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackTypeLabel", value) +} + +// NewRackTypeLabelFromValue returns a pointer to a valid RackTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackTypeLabelFromValue(v string) (*RackTypeLabel, error) { + ev := RackTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackTypeLabel: valid values are %v", v, AllowedRackTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackTypeLabel) IsValid() bool { + for _, existing := range AllowedRackTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Rack_type_label value +func (v RackTypeLabel) Ptr() *RackTypeLabel { + return &v +} + +type NullableRackTypeLabel struct { + value *RackTypeLabel + isSet bool +} + +func (v NullableRackTypeLabel) Get() *RackTypeLabel { + return v.value +} + +func (v *NullableRackTypeLabel) Set(val *RackTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableRackTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableRackTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackTypeLabel(val *RackTypeLabel) *NullableRackTypeLabel { + return &NullableRackTypeLabel{value: val, isSet: true} +} + +func (v NullableRackTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width.go new file mode 100644 index 00000000..c3ba678e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the RackWidth type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RackWidth{} + +// RackWidth struct for RackWidth +type RackWidth struct { + Value *RackWidthValue `json:"value,omitempty"` + Label *RackWidthLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RackWidth RackWidth + +// NewRackWidth instantiates a new RackWidth object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRackWidth() *RackWidth { + this := RackWidth{} + return &this +} + +// NewRackWidthWithDefaults instantiates a new RackWidth object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRackWidthWithDefaults() *RackWidth { + this := RackWidth{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *RackWidth) GetValue() RackWidthValue { + if o == nil || IsNil(o.Value) { + var ret RackWidthValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackWidth) GetValueOk() (*RackWidthValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *RackWidth) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given RackWidthValue and assigns it to the Value field. +func (o *RackWidth) SetValue(v RackWidthValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RackWidth) GetLabel() RackWidthLabel { + if o == nil || IsNil(o.Label) { + var ret RackWidthLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RackWidth) GetLabelOk() (*RackWidthLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RackWidth) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given RackWidthLabel and assigns it to the Label field. +func (o *RackWidth) SetLabel(v RackWidthLabel) { + o.Label = &v +} + +func (o RackWidth) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RackWidth) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RackWidth) UnmarshalJSON(data []byte) (err error) { + varRackWidth := _RackWidth{} + + err = json.Unmarshal(data, &varRackWidth) + + if err != nil { + return err + } + + *o = RackWidth(varRackWidth) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRackWidth struct { + value *RackWidth + isSet bool +} + +func (v NullableRackWidth) Get() *RackWidth { + return v.value +} + +func (v *NullableRackWidth) Set(val *RackWidth) { + v.value = val + v.isSet = true +} + +func (v NullableRackWidth) IsSet() bool { + return v.isSet +} + +func (v *NullableRackWidth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackWidth(val *RackWidth) *NullableRackWidth { + return &NullableRackWidth{value: val, isSet: true} +} + +func (v NullableRackWidth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackWidth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width_label.go new file mode 100644 index 00000000..6032d080 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackWidthLabel the model 'RackWidthLabel' +type RackWidthLabel string + +// List of Rack_width_label +const ( + RACKWIDTHLABEL__10_INCHES RackWidthLabel = "10 inches" + RACKWIDTHLABEL__19_INCHES RackWidthLabel = "19 inches" + RACKWIDTHLABEL__21_INCHES RackWidthLabel = "21 inches" + RACKWIDTHLABEL__23_INCHES RackWidthLabel = "23 inches" +) + +// All allowed values of RackWidthLabel enum +var AllowedRackWidthLabelEnumValues = []RackWidthLabel{ + "10 inches", + "19 inches", + "21 inches", + "23 inches", +} + +func (v *RackWidthLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackWidthLabel(value) + for _, existing := range AllowedRackWidthLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackWidthLabel", value) +} + +// NewRackWidthLabelFromValue returns a pointer to a valid RackWidthLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackWidthLabelFromValue(v string) (*RackWidthLabel, error) { + ev := RackWidthLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackWidthLabel: valid values are %v", v, AllowedRackWidthLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackWidthLabel) IsValid() bool { + for _, existing := range AllowedRackWidthLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Rack_width_label value +func (v RackWidthLabel) Ptr() *RackWidthLabel { + return &v +} + +type NullableRackWidthLabel struct { + value *RackWidthLabel + isSet bool +} + +func (v NullableRackWidthLabel) Get() *RackWidthLabel { + return v.value +} + +func (v *NullableRackWidthLabel) Set(val *RackWidthLabel) { + v.value = val + v.isSet = true +} + +func (v NullableRackWidthLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableRackWidthLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackWidthLabel(val *RackWidthLabel) *NullableRackWidthLabel { + return &NullableRackWidthLabel{value: val, isSet: true} +} + +func (v NullableRackWidthLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackWidthLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width_value.go new file mode 100644 index 00000000..83f9eb87 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rack_width_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// RackWidthValue * `10` - 10 inches * `19` - 19 inches * `21` - 21 inches * `23` - 23 inches +type RackWidthValue int32 + +// List of Rack_width_value +const ( + RACKWIDTHVALUE__10 RackWidthValue = 10 + RACKWIDTHVALUE__19 RackWidthValue = 19 + RACKWIDTHVALUE__21 RackWidthValue = 21 + RACKWIDTHVALUE__23 RackWidthValue = 23 +) + +// All allowed values of RackWidthValue enum +var AllowedRackWidthValueEnumValues = []RackWidthValue{ + 10, + 19, + 21, + 23, +} + +func (v *RackWidthValue) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RackWidthValue(value) + for _, existing := range AllowedRackWidthValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RackWidthValue", value) +} + +// NewRackWidthValueFromValue returns a pointer to a valid RackWidthValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRackWidthValueFromValue(v int32) (*RackWidthValue, error) { + ev := RackWidthValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RackWidthValue: valid values are %v", v, AllowedRackWidthValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RackWidthValue) IsValid() bool { + for _, existing := range AllowedRackWidthValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Rack_width_value value +func (v RackWidthValue) Ptr() *RackWidthValue { + return &v +} + +type NullableRackWidthValue struct { + value *RackWidthValue + isSet bool +} + +func (v NullableRackWidthValue) Get() *RackWidthValue { + return v.value +} + +func (v *NullableRackWidthValue) Set(val *RackWidthValue) { + v.value = val + v.isSet = true +} + +func (v NullableRackWidthValue) IsSet() bool { + return v.isSet +} + +func (v *NullableRackWidthValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRackWidthValue(val *RackWidthValue) *NullableRackWidthValue { + return &NullableRackWidthValue{value: val, isSet: true} +} + +func (v NullableRackWidthValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRackWidthValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port.go new file mode 100644 index 00000000..e0dfa224 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port.go @@ -0,0 +1,832 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the RearPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RearPort{} + +// RearPort Adds support for custom fields and tags. +type RearPort struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NestedDevice `json:"device"` + Module NullableComponentNestedModule `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortType `json:"type"` + Color *string `json:"color,omitempty"` + // Number of front ports which may be mapped + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Cable NullableNestedCable `json:"cable"` + CableEnd string `json:"cable_end"` + LinkPeers []interface{} `json:"link_peers"` + // Return the type of the peer link terminations, or None. + LinkPeersType string `json:"link_peers_type"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + Occupied bool `json:"_occupied"` + AdditionalProperties map[string]interface{} +} + +type _RearPort RearPort + +// NewRearPort instantiates a new RearPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRearPort(id int32, url string, display string, device NestedDevice, name string, type_ FrontPortType, cable NullableNestedCable, cableEnd string, linkPeers []interface{}, linkPeersType string, created NullableTime, lastUpdated NullableTime, occupied bool) *RearPort { + this := RearPort{} + this.Id = id + this.Url = url + this.Display = display + this.Device = device + this.Name = name + this.Type = type_ + this.Cable = cable + this.CableEnd = cableEnd + this.LinkPeers = linkPeers + this.LinkPeersType = linkPeersType + this.Created = created + this.LastUpdated = lastUpdated + this.Occupied = occupied + return &this +} + +// NewRearPortWithDefaults instantiates a new RearPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRearPortWithDefaults() *RearPort { + this := RearPort{} + return &this +} + +// GetId returns the Id field value +func (o *RearPort) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RearPort) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *RearPort) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RearPort) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *RearPort) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *RearPort) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value +func (o *RearPort) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *RearPort) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RearPort) GetModule() ComponentNestedModule { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModule + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPort) GetModuleOk() (*ComponentNestedModule, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *RearPort) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModule and assigns it to the Module field. +func (o *RearPort) SetModule(v ComponentNestedModule) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *RearPort) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *RearPort) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *RearPort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RearPort) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RearPort) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPort) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RearPort) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *RearPort) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *RearPort) GetType() FrontPortType { + if o == nil { + var ret FrontPortType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetTypeOk() (*FrontPortType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *RearPort) SetType(v FrontPortType) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *RearPort) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPort) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *RearPort) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *RearPort) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *RearPort) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPort) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *RearPort) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *RearPort) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RearPort) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPort) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RearPort) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RearPort) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *RearPort) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPort) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *RearPort) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *RearPort) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetCable returns the Cable field value +// If the value is explicit nil, the zero value for NestedCable will be returned +func (o *RearPort) GetCable() NestedCable { + if o == nil || o.Cable.Get() == nil { + var ret NestedCable + return ret + } + + return *o.Cable.Get() +} + +// GetCableOk returns a tuple with the Cable field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPort) GetCableOk() (*NestedCable, bool) { + if o == nil { + return nil, false + } + return o.Cable.Get(), o.Cable.IsSet() +} + +// SetCable sets field value +func (o *RearPort) SetCable(v NestedCable) { + o.Cable.Set(&v) +} + +// GetCableEnd returns the CableEnd field value +func (o *RearPort) GetCableEnd() string { + if o == nil { + var ret string + return ret + } + + return o.CableEnd +} + +// GetCableEndOk returns a tuple with the CableEnd field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetCableEndOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CableEnd, true +} + +// SetCableEnd sets field value +func (o *RearPort) SetCableEnd(v string) { + o.CableEnd = v +} + +// GetLinkPeers returns the LinkPeers field value +func (o *RearPort) GetLinkPeers() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.LinkPeers +} + +// GetLinkPeersOk returns a tuple with the LinkPeers field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetLinkPeersOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LinkPeers, true +} + +// SetLinkPeers sets field value +func (o *RearPort) SetLinkPeers(v []interface{}) { + o.LinkPeers = v +} + +// GetLinkPeersType returns the LinkPeersType field value +func (o *RearPort) GetLinkPeersType() string { + if o == nil { + var ret string + return ret + } + + return o.LinkPeersType +} + +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetLinkPeersTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LinkPeersType, true +} + +// SetLinkPeersType sets field value +func (o *RearPort) SetLinkPeersType(v string) { + o.LinkPeersType = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RearPort) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPort) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RearPort) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *RearPort) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RearPort) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPort) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RearPort) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RearPort) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RearPort) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPort) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *RearPort) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RearPort) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPort) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *RearPort) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetOccupied returns the Occupied field value +func (o *RearPort) GetOccupied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Occupied +} + +// GetOccupiedOk returns a tuple with the Occupied field value +// and a boolean to check if the value has been set. +func (o *RearPort) GetOccupiedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Occupied, true +} + +// SetOccupied sets field value +func (o *RearPort) SetOccupied(v bool) { + o.Occupied = v +} + +func (o RearPort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RearPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + toSerialize["cable"] = o.Cable.Get() + toSerialize["cable_end"] = o.CableEnd + toSerialize["link_peers"] = o.LinkPeers + toSerialize["link_peers_type"] = o.LinkPeersType + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["_occupied"] = o.Occupied + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RearPort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "device", + "name", + "type", + "cable", + "cable_end", + "link_peers", + "link_peers_type", + "created", + "last_updated", + "_occupied", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRearPort := _RearPort{} + + err = json.Unmarshal(data, &varRearPort) + + if err != nil { + return err + } + + *o = RearPort(varRearPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "cable") + delete(additionalProperties, "cable_end") + delete(additionalProperties, "link_peers") + delete(additionalProperties, "link_peers_type") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "_occupied") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRearPort struct { + value *RearPort + isSet bool +} + +func (v NullableRearPort) Get() *RearPort { + return v.value +} + +func (v *NullableRearPort) Set(val *RearPort) { + v.value = val + v.isSet = true +} + +func (v NullableRearPort) IsSet() bool { + return v.isSet +} + +func (v *NullableRearPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRearPort(val *RearPort) *NullableRearPort { + return &NullableRearPort{value: val, isSet: true} +} + +func (v NullableRearPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRearPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_request.go new file mode 100644 index 00000000..28a22fd4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_request.go @@ -0,0 +1,534 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RearPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RearPortRequest{} + +// RearPortRequest Adds support for custom fields and tags. +type RearPortRequest struct { + Device NestedDeviceRequest `json:"device"` + Module NullableComponentNestedModuleRequest `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + // Number of front ports which may be mapped + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RearPortRequest RearPortRequest + +// NewRearPortRequest instantiates a new RearPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRearPortRequest(device NestedDeviceRequest, name string, type_ FrontPortTypeValue) *RearPortRequest { + this := RearPortRequest{} + this.Device = device + this.Name = name + this.Type = type_ + return &this +} + +// NewRearPortRequestWithDefaults instantiates a new RearPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRearPortRequestWithDefaults() *RearPortRequest { + this := RearPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *RearPortRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *RearPortRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RearPortRequest) GetModule() ComponentNestedModuleRequest { + if o == nil || IsNil(o.Module.Get()) { + var ret ComponentNestedModuleRequest + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPortRequest) GetModuleOk() (*ComponentNestedModuleRequest, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *RearPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableComponentNestedModuleRequest and assigns it to the Module field. +func (o *RearPortRequest) SetModule(v ComponentNestedModuleRequest) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *RearPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *RearPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *RearPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RearPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RearPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RearPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *RearPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *RearPortRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *RearPortRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *RearPortRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *RearPortRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *RearPortRequest) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *RearPortRequest) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *RearPortRequest) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *RearPortRequest) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RearPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RearPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RearPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *RearPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *RearPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *RearPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RearPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RearPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RearPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RearPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RearPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RearPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RearPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RearPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RearPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRearPortRequest := _RearPortRequest{} + + err = json.Unmarshal(data, &varRearPortRequest) + + if err != nil { + return err + } + + *o = RearPortRequest(varRearPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRearPortRequest struct { + value *RearPortRequest + isSet bool +} + +func (v NullableRearPortRequest) Get() *RearPortRequest { + return v.value +} + +func (v *NullableRearPortRequest) Set(val *RearPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRearPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRearPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRearPortRequest(val *RearPortRequest) *NullableRearPortRequest { + return &NullableRearPortRequest{value: val, isSet: true} +} + +func (v NullableRearPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRearPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_template.go new file mode 100644 index 00000000..917d7bab --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_template.go @@ -0,0 +1,591 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the RearPortTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RearPortTemplate{} + +// RearPortTemplate Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type RearPortTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + DeviceType NullableNestedDeviceType `json:"device_type,omitempty"` + ModuleType NullableNestedModuleType `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortType `json:"type"` + Color *string `json:"color,omitempty"` + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _RearPortTemplate RearPortTemplate + +// NewRearPortTemplate instantiates a new RearPortTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRearPortTemplate(id int32, url string, display string, name string, type_ FrontPortType, created NullableTime, lastUpdated NullableTime) *RearPortTemplate { + this := RearPortTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Type = type_ + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewRearPortTemplateWithDefaults instantiates a new RearPortTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRearPortTemplateWithDefaults() *RearPortTemplate { + this := RearPortTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *RearPortTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RearPortTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *RearPortTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RearPortTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *RearPortTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *RearPortTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RearPortTemplate) GetDeviceType() NestedDeviceType { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceType + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPortTemplate) GetDeviceTypeOk() (*NestedDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *RearPortTemplate) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceType and assigns it to the DeviceType field. +func (o *RearPortTemplate) SetDeviceType(v NestedDeviceType) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *RearPortTemplate) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *RearPortTemplate) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RearPortTemplate) GetModuleType() NestedModuleType { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleType + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPortTemplate) GetModuleTypeOk() (*NestedModuleType, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *RearPortTemplate) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleType and assigns it to the ModuleType field. +func (o *RearPortTemplate) SetModuleType(v NestedModuleType) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *RearPortTemplate) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *RearPortTemplate) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *RearPortTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RearPortTemplate) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RearPortTemplate) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RearPortTemplate) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *RearPortTemplate) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *RearPortTemplate) GetType() FrontPortType { + if o == nil { + var ret FrontPortType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetTypeOk() (*FrontPortType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *RearPortTemplate) SetType(v FrontPortType) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *RearPortTemplate) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *RearPortTemplate) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *RearPortTemplate) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *RearPortTemplate) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *RearPortTemplate) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *RearPortTemplate) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RearPortTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RearPortTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RearPortTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RearPortTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPortTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *RearPortTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RearPortTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *RearPortTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o RearPortTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RearPortTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RearPortTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "type", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRearPortTemplate := _RearPortTemplate{} + + err = json.Unmarshal(data, &varRearPortTemplate) + + if err != nil { + return err + } + + *o = RearPortTemplate(varRearPortTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRearPortTemplate struct { + value *RearPortTemplate + isSet bool +} + +func (v NullableRearPortTemplate) Get() *RearPortTemplate { + return v.value +} + +func (v *NullableRearPortTemplate) Set(val *RearPortTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableRearPortTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableRearPortTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRearPortTemplate(val *RearPortTemplate) *NullableRearPortTemplate { + return &NullableRearPortTemplate{value: val, isSet: true} +} + +func (v NullableRearPortTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRearPortTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_template_request.go new file mode 100644 index 00000000..dc43d40f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rear_port_template_request.go @@ -0,0 +1,441 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RearPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RearPortTemplateRequest{} + +// RearPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type RearPortTemplateRequest struct { + DeviceType NullableNestedDeviceTypeRequest `json:"device_type,omitempty"` + ModuleType NullableNestedModuleTypeRequest `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RearPortTemplateRequest RearPortTemplateRequest + +// NewRearPortTemplateRequest instantiates a new RearPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRearPortTemplateRequest(name string, type_ FrontPortTypeValue) *RearPortTemplateRequest { + this := RearPortTemplateRequest{} + this.Name = name + this.Type = type_ + return &this +} + +// NewRearPortTemplateRequestWithDefaults instantiates a new RearPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRearPortTemplateRequestWithDefaults() *RearPortTemplateRequest { + this := RearPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RearPortTemplateRequest) GetDeviceType() NestedDeviceTypeRequest { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret NestedDeviceTypeRequest + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPortTemplateRequest) GetDeviceTypeOk() (*NestedDeviceTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *RearPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableNestedDeviceTypeRequest and assigns it to the DeviceType field. +func (o *RearPortTemplateRequest) SetDeviceType(v NestedDeviceTypeRequest) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *RearPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *RearPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RearPortTemplateRequest) GetModuleType() NestedModuleTypeRequest { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret NestedModuleTypeRequest + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RearPortTemplateRequest) GetModuleTypeOk() (*NestedModuleTypeRequest, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *RearPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableNestedModuleTypeRequest and assigns it to the ModuleType field. +func (o *RearPortTemplateRequest) SetModuleType(v NestedModuleTypeRequest) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *RearPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *RearPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *RearPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RearPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RearPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *RearPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *RearPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *RearPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *RearPortTemplateRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RearPortTemplateRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *RearPortTemplateRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *RearPortTemplateRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplateRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *RearPortTemplateRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *RearPortTemplateRequest) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *RearPortTemplateRequest) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplateRequest) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *RearPortTemplateRequest) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *RearPortTemplateRequest) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RearPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RearPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RearPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RearPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o RearPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RearPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RearPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRearPortTemplateRequest := _RearPortTemplateRequest{} + + err = json.Unmarshal(data, &varRearPortTemplateRequest) + + if err != nil { + return err + } + + *o = RearPortTemplateRequest(varRearPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRearPortTemplateRequest struct { + value *RearPortTemplateRequest + isSet bool +} + +func (v NullableRearPortTemplateRequest) Get() *RearPortTemplateRequest { + return v.value +} + +func (v *NullableRearPortTemplateRequest) Set(val *RearPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRearPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRearPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRearPortTemplateRequest(val *RearPortTemplateRequest) *NullableRearPortTemplateRequest { + return &NullableRearPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableRearPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRearPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_region.go b/vendor/github.com/netbox-community/go-netbox/v3/model_region.go new file mode 100644 index 00000000..ce1397a1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_region.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Region type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Region{} + +// Region Extends PrimaryModelSerializer to include MPTT support. +type Region struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedRegion `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + SiteCount int32 `json:"site_count"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _Region Region + +// NewRegion instantiates a new Region object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegion(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, siteCount int32, depth int32) *Region { + this := Region{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.SiteCount = siteCount + this.Depth = depth + return &this +} + +// NewRegionWithDefaults instantiates a new Region object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionWithDefaults() *Region { + this := Region{} + return &this +} + +// GetId returns the Id field value +func (o *Region) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Region) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Region) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Region) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Region) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Region) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Region) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Region) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Region) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Region) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Region) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Region) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Region) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Region) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Region) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Region) GetParent() NestedRegion { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedRegion + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Region) GetParentOk() (*NestedRegion, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *Region) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedRegion and assigns it to the Parent field. +func (o *Region) SetParent(v NestedRegion) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *Region) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *Region) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Region) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Region) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Region) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Region) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Region) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Region) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Region) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Region) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Region) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Region) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Region) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Region) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Region) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Region) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Region) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Region) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Region) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Region) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetSiteCount returns the SiteCount field value +func (o *Region) GetSiteCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SiteCount +} + +// GetSiteCountOk returns a tuple with the SiteCount field value +// and a boolean to check if the value has been set. +func (o *Region) GetSiteCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SiteCount, true +} + +// SetSiteCount sets field value +func (o *Region) SetSiteCount(v int32) { + o.SiteCount = v +} + +// GetDepth returns the Depth field value +func (o *Region) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *Region) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *Region) SetDepth(v int32) { + o.Depth = v +} + +func (o Region) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Region) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["site_count"] = o.SiteCount + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Region) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "site_count", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegion := _Region{} + + err = json.Unmarshal(data, &varRegion) + + if err != nil { + return err + } + + *o = Region(varRegion) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "site_count") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRegion struct { + value *Region + isSet bool +} + +func (v NullableRegion) Get() *Region { + return v.value +} + +func (v *NullableRegion) Set(val *Region) { + v.value = val + v.isSet = true +} + +func (v NullableRegion) IsSet() bool { + return v.isSet +} + +func (v *NullableRegion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegion(val *Region) *NullableRegion { + return &NullableRegion{value: val, isSet: true} +} + +func (v NullableRegion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_region_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_region_request.go new file mode 100644 index 00000000..8f0b35c4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_region_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RegionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionRequest{} + +// RegionRequest Extends PrimaryModelSerializer to include MPTT support. +type RegionRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedRegionRequest `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RegionRequest RegionRequest + +// NewRegionRequest instantiates a new RegionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionRequest(name string, slug string) *RegionRequest { + this := RegionRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewRegionRequestWithDefaults instantiates a new RegionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionRequestWithDefaults() *RegionRequest { + this := RegionRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RegionRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RegionRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RegionRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *RegionRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *RegionRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *RegionRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RegionRequest) GetParent() NestedRegionRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedRegionRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RegionRequest) GetParentOk() (*NestedRegionRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *RegionRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedRegionRequest and assigns it to the Parent field. +func (o *RegionRequest) SetParent(v NestedRegionRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *RegionRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *RegionRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RegionRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RegionRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RegionRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RegionRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RegionRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RegionRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RegionRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RegionRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RegionRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RegionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RegionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegionRequest := _RegionRequest{} + + err = json.Unmarshal(data, &varRegionRequest) + + if err != nil { + return err + } + + *o = RegionRequest(varRegionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRegionRequest struct { + value *RegionRequest + isSet bool +} + +func (v NullableRegionRequest) Get() *RegionRequest { + return v.value +} + +func (v *NullableRegionRequest) Set(val *RegionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRegionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionRequest(val *RegionRequest) *NullableRegionRequest { + return &NullableRegionRequest{value: val, isSet: true} +} + +func (v NullableRegionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rir.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rir.go new file mode 100644 index 00000000..a98e72af --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rir.go @@ -0,0 +1,523 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the RIR type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RIR{} + +// RIR Adds support for custom fields and tags. +type RIR struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + // IP space managed by this RIR is considered private + IsPrivate *bool `json:"is_private,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AggregateCount int32 `json:"aggregate_count"` + AdditionalProperties map[string]interface{} +} + +type _RIR RIR + +// NewRIR instantiates a new RIR object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRIR(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, aggregateCount int32) *RIR { + this := RIR{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.AggregateCount = aggregateCount + return &this +} + +// NewRIRWithDefaults instantiates a new RIR object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRIRWithDefaults() *RIR { + this := RIR{} + return &this +} + +// GetId returns the Id field value +func (o *RIR) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RIR) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RIR) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *RIR) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RIR) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RIR) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *RIR) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *RIR) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *RIR) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *RIR) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RIR) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RIR) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *RIR) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *RIR) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *RIR) SetSlug(v string) { + o.Slug = v +} + +// GetIsPrivate returns the IsPrivate field value if set, zero value otherwise. +func (o *RIR) GetIsPrivate() bool { + if o == nil || IsNil(o.IsPrivate) { + var ret bool + return ret + } + return *o.IsPrivate +} + +// GetIsPrivateOk returns a tuple with the IsPrivate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIR) GetIsPrivateOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrivate) { + return nil, false + } + return o.IsPrivate, true +} + +// HasIsPrivate returns a boolean if a field has been set. +func (o *RIR) HasIsPrivate() bool { + if o != nil && !IsNil(o.IsPrivate) { + return true + } + + return false +} + +// SetIsPrivate gets a reference to the given bool and assigns it to the IsPrivate field. +func (o *RIR) SetIsPrivate(v bool) { + o.IsPrivate = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RIR) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIR) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RIR) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RIR) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RIR) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIR) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RIR) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *RIR) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RIR) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIR) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RIR) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RIR) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RIR) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RIR) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *RIR) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RIR) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RIR) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *RIR) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetAggregateCount returns the AggregateCount field value +func (o *RIR) GetAggregateCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.AggregateCount +} + +// GetAggregateCountOk returns a tuple with the AggregateCount field value +// and a boolean to check if the value has been set. +func (o *RIR) GetAggregateCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.AggregateCount, true +} + +// SetAggregateCount sets field value +func (o *RIR) SetAggregateCount(v int32) { + o.AggregateCount = v +} + +func (o RIR) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RIR) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.IsPrivate) { + toSerialize["is_private"] = o.IsPrivate + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["aggregate_count"] = o.AggregateCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RIR) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "aggregate_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRIR := _RIR{} + + err = json.Unmarshal(data, &varRIR) + + if err != nil { + return err + } + + *o = RIR(varRIR) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "is_private") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "aggregate_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRIR struct { + value *RIR + isSet bool +} + +func (v NullableRIR) Get() *RIR { + return v.value +} + +func (v *NullableRIR) Set(val *RIR) { + v.value = val + v.isSet = true +} + +func (v NullableRIR) IsSet() bool { + return v.isSet +} + +func (v *NullableRIR) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRIR(val *RIR) *NullableRIR { + return &NullableRIR{value: val, isSet: true} +} + +func (v NullableRIR) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRIR) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_rir_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_rir_request.go new file mode 100644 index 00000000..58c299ba --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_rir_request.go @@ -0,0 +1,344 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RIRRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RIRRequest{} + +// RIRRequest Adds support for custom fields and tags. +type RIRRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + // IP space managed by this RIR is considered private + IsPrivate *bool `json:"is_private,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RIRRequest RIRRequest + +// NewRIRRequest instantiates a new RIRRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRIRRequest(name string, slug string) *RIRRequest { + this := RIRRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewRIRRequestWithDefaults instantiates a new RIRRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRIRRequestWithDefaults() *RIRRequest { + this := RIRRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RIRRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RIRRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RIRRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *RIRRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *RIRRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *RIRRequest) SetSlug(v string) { + o.Slug = v +} + +// GetIsPrivate returns the IsPrivate field value if set, zero value otherwise. +func (o *RIRRequest) GetIsPrivate() bool { + if o == nil || IsNil(o.IsPrivate) { + var ret bool + return ret + } + return *o.IsPrivate +} + +// GetIsPrivateOk returns a tuple with the IsPrivate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIRRequest) GetIsPrivateOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrivate) { + return nil, false + } + return o.IsPrivate, true +} + +// HasIsPrivate returns a boolean if a field has been set. +func (o *RIRRequest) HasIsPrivate() bool { + if o != nil && !IsNil(o.IsPrivate) { + return true + } + + return false +} + +// SetIsPrivate gets a reference to the given bool and assigns it to the IsPrivate field. +func (o *RIRRequest) SetIsPrivate(v bool) { + o.IsPrivate = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RIRRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIRRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RIRRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RIRRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RIRRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIRRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RIRRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RIRRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RIRRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RIRRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RIRRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RIRRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RIRRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RIRRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.IsPrivate) { + toSerialize["is_private"] = o.IsPrivate + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RIRRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRIRRequest := _RIRRequest{} + + err = json.Unmarshal(data, &varRIRRequest) + + if err != nil { + return err + } + + *o = RIRRequest(varRIRRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "is_private") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRIRRequest struct { + value *RIRRequest + isSet bool +} + +func (v NullableRIRRequest) Get() *RIRRequest { + return v.value +} + +func (v *NullableRIRRequest) Set(val *RIRRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRIRRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRIRRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRIRRequest(val *RIRRequest) *NullableRIRRequest { + return &NullableRIRRequest{value: val, isSet: true} +} + +func (v NullableRIRRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRIRRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_role.go new file mode 100644 index 00000000..f400ef12 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_role.go @@ -0,0 +1,551 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Role type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Role{} + +// Role Adds support for custom fields and tags. +type Role struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Weight *int32 `json:"weight,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + PrefixCount int32 `json:"prefix_count"` + VlanCount int32 `json:"vlan_count"` + AdditionalProperties map[string]interface{} +} + +type _Role Role + +// NewRole instantiates a new Role object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, prefixCount int32, vlanCount int32) *Role { + this := Role{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.PrefixCount = prefixCount + this.VlanCount = vlanCount + return &this +} + +// NewRoleWithDefaults instantiates a new Role object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleWithDefaults() *Role { + this := Role{} + return &this +} + +// GetId returns the Id field value +func (o *Role) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Role) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Role) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Role) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Role) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Role) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Role) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Role) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Role) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Role) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Role) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Role) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Role) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Role) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Role) SetSlug(v string) { + o.Slug = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *Role) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Role) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *Role) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *Role) SetWeight(v int32) { + o.Weight = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Role) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Role) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Role) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Role) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Role) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Role) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Role) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Role) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Role) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Role) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Role) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Role) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Role) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Role) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Role) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Role) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Role) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Role) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetPrefixCount returns the PrefixCount field value +func (o *Role) GetPrefixCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PrefixCount +} + +// GetPrefixCountOk returns a tuple with the PrefixCount field value +// and a boolean to check if the value has been set. +func (o *Role) GetPrefixCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PrefixCount, true +} + +// SetPrefixCount sets field value +func (o *Role) SetPrefixCount(v int32) { + o.PrefixCount = v +} + +// GetVlanCount returns the VlanCount field value +func (o *Role) GetVlanCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VlanCount +} + +// GetVlanCountOk returns a tuple with the VlanCount field value +// and a boolean to check if the value has been set. +func (o *Role) GetVlanCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VlanCount, true +} + +// SetVlanCount sets field value +func (o *Role) SetVlanCount(v int32) { + o.VlanCount = v +} + +func (o Role) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Role) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["prefix_count"] = o.PrefixCount + toSerialize["vlan_count"] = o.VlanCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Role) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "prefix_count", + "vlan_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRole := _Role{} + + err = json.Unmarshal(data, &varRole) + + if err != nil { + return err + } + + *o = Role(varRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "weight") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "prefix_count") + delete(additionalProperties, "vlan_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRole struct { + value *Role + isSet bool +} + +func (v NullableRole) Get() *Role { + return v.value +} + +func (v *NullableRole) Set(val *Role) { + v.value = val + v.isSet = true +} + +func (v NullableRole) IsSet() bool { + return v.isSet +} + +func (v *NullableRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRole(val *Role) *NullableRole { + return &NullableRole{value: val, isSet: true} +} + +func (v NullableRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_role_request.go new file mode 100644 index 00000000..a455a0cf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_role_request.go @@ -0,0 +1,343 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleRequest{} + +// RoleRequest Adds support for custom fields and tags. +type RoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Weight *int32 `json:"weight,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RoleRequest RoleRequest + +// NewRoleRequest instantiates a new RoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoleRequest(name string, slug string) *RoleRequest { + this := RoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewRoleRequestWithDefaults instantiates a new RoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleRequestWithDefaults() *RoleRequest { + this := RoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *RoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *RoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *RoleRequest) SetSlug(v string) { + o.Slug = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *RoleRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoleRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *RoleRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *RoleRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoleRequest := _RoleRequest{} + + err = json.Unmarshal(data, &varRoleRequest) + + if err != nil { + return err + } + + *o = RoleRequest(varRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "weight") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRoleRequest struct { + value *RoleRequest + isSet bool +} + +func (v NullableRoleRequest) Get() *RoleRequest { + return v.value +} + +func (v *NullableRoleRequest) Set(val *RoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoleRequest(val *RoleRequest) *NullableRoleRequest { + return &NullableRoleRequest{value: val, isSet: true} +} + +func (v NullableRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_route_target.go b/vendor/github.com/netbox-community/go-netbox/v3/model_route_target.go new file mode 100644 index 00000000..037ac03a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_route_target.go @@ -0,0 +1,513 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the RouteTarget type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RouteTarget{} + +// RouteTarget Adds support for custom fields and tags. +type RouteTarget struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Route target value (formatted in accordance with RFC 4360) + Name string `json:"name"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _RouteTarget RouteTarget + +// NewRouteTarget instantiates a new RouteTarget object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRouteTarget(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *RouteTarget { + this := RouteTarget{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewRouteTargetWithDefaults instantiates a new RouteTarget object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteTargetWithDefaults() *RouteTarget { + this := RouteTarget{} + return &this +} + +// GetId returns the Id field value +func (o *RouteTarget) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RouteTarget) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *RouteTarget) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RouteTarget) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *RouteTarget) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *RouteTarget) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *RouteTarget) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RouteTarget) SetName(v string) { + o.Name = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RouteTarget) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RouteTarget) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *RouteTarget) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *RouteTarget) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *RouteTarget) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *RouteTarget) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RouteTarget) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RouteTarget) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RouteTarget) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *RouteTarget) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *RouteTarget) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *RouteTarget) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RouteTarget) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RouteTarget) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *RouteTarget) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RouteTarget) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTarget) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RouteTarget) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RouteTarget) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RouteTarget) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RouteTarget) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *RouteTarget) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RouteTarget) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RouteTarget) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *RouteTarget) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o RouteTarget) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RouteTarget) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RouteTarget) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRouteTarget := _RouteTarget{} + + err = json.Unmarshal(data, &varRouteTarget) + + if err != nil { + return err + } + + *o = RouteTarget(varRouteTarget) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRouteTarget struct { + value *RouteTarget + isSet bool +} + +func (v NullableRouteTarget) Get() *RouteTarget { + return v.value +} + +func (v *NullableRouteTarget) Set(val *RouteTarget) { + v.value = val + v.isSet = true +} + +func (v NullableRouteTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteTarget(val *RouteTarget) *NullableRouteTarget { + return &NullableRouteTarget{value: val, isSet: true} +} + +func (v NullableRouteTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_route_target_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_route_target_request.go new file mode 100644 index 00000000..9ab07458 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_route_target_request.go @@ -0,0 +1,363 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the RouteTargetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RouteTargetRequest{} + +// RouteTargetRequest Adds support for custom fields and tags. +type RouteTargetRequest struct { + // Route target value (formatted in accordance with RFC 4360) + Name string `json:"name"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RouteTargetRequest RouteTargetRequest + +// NewRouteTargetRequest instantiates a new RouteTargetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRouteTargetRequest(name string) *RouteTargetRequest { + this := RouteTargetRequest{} + this.Name = name + return &this +} + +// NewRouteTargetRequestWithDefaults instantiates a new RouteTargetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteTargetRequestWithDefaults() *RouteTargetRequest { + this := RouteTargetRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RouteTargetRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RouteTargetRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RouteTargetRequest) SetName(v string) { + o.Name = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RouteTargetRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RouteTargetRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *RouteTargetRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *RouteTargetRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *RouteTargetRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *RouteTargetRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RouteTargetRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTargetRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RouteTargetRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RouteTargetRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *RouteTargetRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTargetRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *RouteTargetRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *RouteTargetRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *RouteTargetRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTargetRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RouteTargetRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *RouteTargetRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *RouteTargetRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RouteTargetRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *RouteTargetRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *RouteTargetRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o RouteTargetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RouteTargetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RouteTargetRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRouteTargetRequest := _RouteTargetRequest{} + + err = json.Unmarshal(data, &varRouteTargetRequest) + + if err != nil { + return err + } + + *o = RouteTargetRequest(varRouteTargetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRouteTargetRequest struct { + value *RouteTargetRequest + isSet bool +} + +func (v NullableRouteTargetRequest) Get() *RouteTargetRequest { + return v.value +} + +func (v *NullableRouteTargetRequest) Set(val *RouteTargetRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRouteTargetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteTargetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteTargetRequest(val *RouteTargetRequest) *NullableRouteTargetRequest { + return &NullableRouteTargetRequest{value: val, isSet: true} +} + +func (v NullableRouteTargetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteTargetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_saved_filter.go b/vendor/github.com/netbox-community/go-netbox/v3/model_saved_filter.go new file mode 100644 index 00000000..5fc00356 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_saved_filter.go @@ -0,0 +1,603 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the SavedFilter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SavedFilter{} + +// SavedFilter Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type SavedFilter struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + User NullableInt32 `json:"user,omitempty"` + Weight *int32 `json:"weight,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Shared *bool `json:"shared,omitempty"` + Parameters interface{} `json:"parameters"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _SavedFilter SavedFilter + +// NewSavedFilter instantiates a new SavedFilter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSavedFilter(id int32, url string, display string, contentTypes []string, name string, slug string, parameters interface{}, created NullableTime, lastUpdated NullableTime) *SavedFilter { + this := SavedFilter{} + this.Id = id + this.Url = url + this.Display = display + this.ContentTypes = contentTypes + this.Name = name + this.Slug = slug + this.Parameters = parameters + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewSavedFilterWithDefaults instantiates a new SavedFilter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSavedFilterWithDefaults() *SavedFilter { + this := SavedFilter{} + return &this +} + +// GetId returns the Id field value +func (o *SavedFilter) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SavedFilter) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *SavedFilter) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *SavedFilter) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *SavedFilter) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *SavedFilter) SetDisplay(v string) { + o.Display = v +} + +// GetContentTypes returns the ContentTypes field value +func (o *SavedFilter) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *SavedFilter) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *SavedFilter) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SavedFilter) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SavedFilter) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SavedFilter) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SavedFilter) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SavedFilter) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SavedFilter) SetDescription(v string) { + o.Description = &v +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SavedFilter) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SavedFilter) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *SavedFilter) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *SavedFilter) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *SavedFilter) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *SavedFilter) UnsetUser() { + o.User.Unset() +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *SavedFilter) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *SavedFilter) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *SavedFilter) SetWeight(v int32) { + o.Weight = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SavedFilter) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SavedFilter) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SavedFilter) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetShared returns the Shared field value if set, zero value otherwise. +func (o *SavedFilter) GetShared() bool { + if o == nil || IsNil(o.Shared) { + var ret bool + return ret + } + return *o.Shared +} + +// GetSharedOk returns a tuple with the Shared field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilter) GetSharedOk() (*bool, bool) { + if o == nil || IsNil(o.Shared) { + return nil, false + } + return o.Shared, true +} + +// HasShared returns a boolean if a field has been set. +func (o *SavedFilter) HasShared() bool { + if o != nil && !IsNil(o.Shared) { + return true + } + + return false +} + +// SetShared gets a reference to the given bool and assigns it to the Shared field. +func (o *SavedFilter) SetShared(v bool) { + o.Shared = &v +} + +// GetParameters returns the Parameters field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *SavedFilter) GetParameters() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SavedFilter) GetParametersOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return &o.Parameters, true +} + +// SetParameters sets field value +func (o *SavedFilter) SetParameters(v interface{}) { + o.Parameters = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *SavedFilter) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SavedFilter) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *SavedFilter) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *SavedFilter) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SavedFilter) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *SavedFilter) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o SavedFilter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SavedFilter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Shared) { + toSerialize["shared"] = o.Shared + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SavedFilter) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "content_types", + "name", + "slug", + "parameters", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSavedFilter := _SavedFilter{} + + err = json.Unmarshal(data, &varSavedFilter) + + if err != nil { + return err + } + + *o = SavedFilter(varSavedFilter) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "user") + delete(additionalProperties, "weight") + delete(additionalProperties, "enabled") + delete(additionalProperties, "shared") + delete(additionalProperties, "parameters") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSavedFilter struct { + value *SavedFilter + isSet bool +} + +func (v NullableSavedFilter) Get() *SavedFilter { + return v.value +} + +func (v *NullableSavedFilter) Set(val *SavedFilter) { + v.value = val + v.isSet = true +} + +func (v NullableSavedFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableSavedFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSavedFilter(val *SavedFilter) *NullableSavedFilter { + return &NullableSavedFilter{value: val, isSet: true} +} + +func (v NullableSavedFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSavedFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_saved_filter_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_saved_filter_request.go new file mode 100644 index 00000000..0adea8e6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_saved_filter_request.go @@ -0,0 +1,453 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the SavedFilterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SavedFilterRequest{} + +// SavedFilterRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type SavedFilterRequest struct { + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + User NullableInt32 `json:"user,omitempty"` + Weight *int32 `json:"weight,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Shared *bool `json:"shared,omitempty"` + Parameters interface{} `json:"parameters"` + AdditionalProperties map[string]interface{} +} + +type _SavedFilterRequest SavedFilterRequest + +// NewSavedFilterRequest instantiates a new SavedFilterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSavedFilterRequest(contentTypes []string, name string, slug string, parameters interface{}) *SavedFilterRequest { + this := SavedFilterRequest{} + this.ContentTypes = contentTypes + this.Name = name + this.Slug = slug + this.Parameters = parameters + return &this +} + +// NewSavedFilterRequestWithDefaults instantiates a new SavedFilterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSavedFilterRequestWithDefaults() *SavedFilterRequest { + this := SavedFilterRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *SavedFilterRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *SavedFilterRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *SavedFilterRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *SavedFilterRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SavedFilterRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SavedFilterRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SavedFilterRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SavedFilterRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SavedFilterRequest) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SavedFilterRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilterRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SavedFilterRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SavedFilterRequest) SetDescription(v string) { + o.Description = &v +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SavedFilterRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SavedFilterRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *SavedFilterRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *SavedFilterRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *SavedFilterRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *SavedFilterRequest) UnsetUser() { + o.User.Unset() +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *SavedFilterRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilterRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *SavedFilterRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *SavedFilterRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SavedFilterRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilterRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SavedFilterRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SavedFilterRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetShared returns the Shared field value if set, zero value otherwise. +func (o *SavedFilterRequest) GetShared() bool { + if o == nil || IsNil(o.Shared) { + var ret bool + return ret + } + return *o.Shared +} + +// GetSharedOk returns a tuple with the Shared field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SavedFilterRequest) GetSharedOk() (*bool, bool) { + if o == nil || IsNil(o.Shared) { + return nil, false + } + return o.Shared, true +} + +// HasShared returns a boolean if a field has been set. +func (o *SavedFilterRequest) HasShared() bool { + if o != nil && !IsNil(o.Shared) { + return true + } + + return false +} + +// SetShared gets a reference to the given bool and assigns it to the Shared field. +func (o *SavedFilterRequest) SetShared(v bool) { + o.Shared = &v +} + +// GetParameters returns the Parameters field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *SavedFilterRequest) GetParameters() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SavedFilterRequest) GetParametersOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return &o.Parameters, true +} + +// SetParameters sets field value +func (o *SavedFilterRequest) SetParameters(v interface{}) { + o.Parameters = v +} + +func (o SavedFilterRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SavedFilterRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Shared) { + toSerialize["shared"] = o.Shared + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SavedFilterRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "name", + "slug", + "parameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSavedFilterRequest := _SavedFilterRequest{} + + err = json.Unmarshal(data, &varSavedFilterRequest) + + if err != nil { + return err + } + + *o = SavedFilterRequest(varSavedFilterRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "user") + delete(additionalProperties, "weight") + delete(additionalProperties, "enabled") + delete(additionalProperties, "shared") + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSavedFilterRequest struct { + value *SavedFilterRequest + isSet bool +} + +func (v NullableSavedFilterRequest) Get() *SavedFilterRequest { + return v.value +} + +func (v *NullableSavedFilterRequest) Set(val *SavedFilterRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSavedFilterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSavedFilterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSavedFilterRequest(val *SavedFilterRequest) *NullableSavedFilterRequest { + return &NullableSavedFilterRequest{value: val, isSet: true} +} + +func (v NullableSavedFilterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSavedFilterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_schema_retrieve_format_parameter.go b/vendor/github.com/netbox-community/go-netbox/v3/model_schema_retrieve_format_parameter.go new file mode 100644 index 00000000..b3ae2a9b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_schema_retrieve_format_parameter.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// SchemaRetrieveFormatParameter the model 'SchemaRetrieveFormatParameter' +type SchemaRetrieveFormatParameter string + +// List of schema_retrieve_format_parameter +const ( + SCHEMARETRIEVEFORMATPARAMETER_JSON SchemaRetrieveFormatParameter = "json" + SCHEMARETRIEVEFORMATPARAMETER_YAML SchemaRetrieveFormatParameter = "yaml" +) + +// All allowed values of SchemaRetrieveFormatParameter enum +var AllowedSchemaRetrieveFormatParameterEnumValues = []SchemaRetrieveFormatParameter{ + "json", + "yaml", +} + +func (v *SchemaRetrieveFormatParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SchemaRetrieveFormatParameter(value) + for _, existing := range AllowedSchemaRetrieveFormatParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SchemaRetrieveFormatParameter", value) +} + +// NewSchemaRetrieveFormatParameterFromValue returns a pointer to a valid SchemaRetrieveFormatParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSchemaRetrieveFormatParameterFromValue(v string) (*SchemaRetrieveFormatParameter, error) { + ev := SchemaRetrieveFormatParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SchemaRetrieveFormatParameter: valid values are %v", v, AllowedSchemaRetrieveFormatParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SchemaRetrieveFormatParameter) IsValid() bool { + for _, existing := range AllowedSchemaRetrieveFormatParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to schema_retrieve_format_parameter value +func (v SchemaRetrieveFormatParameter) Ptr() *SchemaRetrieveFormatParameter { + return &v +} + +type NullableSchemaRetrieveFormatParameter struct { + value *SchemaRetrieveFormatParameter + isSet bool +} + +func (v NullableSchemaRetrieveFormatParameter) Get() *SchemaRetrieveFormatParameter { + return v.value +} + +func (v *NullableSchemaRetrieveFormatParameter) Set(val *SchemaRetrieveFormatParameter) { + v.value = val + v.isSet = true +} + +func (v NullableSchemaRetrieveFormatParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableSchemaRetrieveFormatParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchemaRetrieveFormatParameter(val *SchemaRetrieveFormatParameter) *NullableSchemaRetrieveFormatParameter { + return &NullableSchemaRetrieveFormatParameter{value: val, isSet: true} +} + +func (v NullableSchemaRetrieveFormatParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchemaRetrieveFormatParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_service.go b/vendor/github.com/netbox-community/go-netbox/v3/model_service.go new file mode 100644 index 00000000..4e5e5078 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_service.go @@ -0,0 +1,663 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Service type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Service{} + +// Service Adds support for custom fields and tags. +type Service struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Device NullableNestedDevice `json:"device,omitempty"` + VirtualMachine NullableNestedVirtualMachine `json:"virtual_machine,omitempty"` + Name string `json:"name"` + Ports []int32 `json:"ports"` + Protocol *ServiceProtocol `json:"protocol,omitempty"` + Ipaddresses []int32 `json:"ipaddresses,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Service Service + +// NewService instantiates a new Service object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewService(id int32, url string, display string, name string, ports []int32, created NullableTime, lastUpdated NullableTime) *Service { + this := Service{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Ports = ports + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewServiceWithDefaults instantiates a new Service object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceWithDefaults() *Service { + this := Service{} + return &this +} + +// GetId returns the Id field value +func (o *Service) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Service) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Service) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Service) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Service) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Service) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Service) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Service) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Service) SetDisplay(v string) { + o.Display = v +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Service) GetDevice() NestedDevice { + if o == nil || IsNil(o.Device.Get()) { + var ret NestedDevice + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Service) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *Service) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableNestedDevice and assigns it to the Device field. +func (o *Service) SetDevice(v NestedDevice) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *Service) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *Service) UnsetDevice() { + o.Device.Unset() +} + +// GetVirtualMachine returns the VirtualMachine field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Service) GetVirtualMachine() NestedVirtualMachine { + if o == nil || IsNil(o.VirtualMachine.Get()) { + var ret NestedVirtualMachine + return ret + } + return *o.VirtualMachine.Get() +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Service) GetVirtualMachineOk() (*NestedVirtualMachine, bool) { + if o == nil { + return nil, false + } + return o.VirtualMachine.Get(), o.VirtualMachine.IsSet() +} + +// HasVirtualMachine returns a boolean if a field has been set. +func (o *Service) HasVirtualMachine() bool { + if o != nil && o.VirtualMachine.IsSet() { + return true + } + + return false +} + +// SetVirtualMachine gets a reference to the given NullableNestedVirtualMachine and assigns it to the VirtualMachine field. +func (o *Service) SetVirtualMachine(v NestedVirtualMachine) { + o.VirtualMachine.Set(&v) +} + +// SetVirtualMachineNil sets the value for VirtualMachine to be an explicit nil +func (o *Service) SetVirtualMachineNil() { + o.VirtualMachine.Set(nil) +} + +// UnsetVirtualMachine ensures that no value is present for VirtualMachine, not even an explicit nil +func (o *Service) UnsetVirtualMachine() { + o.VirtualMachine.Unset() +} + +// GetName returns the Name field value +func (o *Service) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Service) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Service) SetName(v string) { + o.Name = v +} + +// GetPorts returns the Ports field value +func (o *Service) GetPorts() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value +// and a boolean to check if the value has been set. +func (o *Service) GetPortsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Ports, true +} + +// SetPorts sets field value +func (o *Service) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *Service) GetProtocol() ServiceProtocol { + if o == nil || IsNil(o.Protocol) { + var ret ServiceProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetProtocolOk() (*ServiceProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *Service) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given ServiceProtocol and assigns it to the Protocol field. +func (o *Service) SetProtocol(v ServiceProtocol) { + o.Protocol = &v +} + +// GetIpaddresses returns the Ipaddresses field value if set, zero value otherwise. +func (o *Service) GetIpaddresses() []int32 { + if o == nil || IsNil(o.Ipaddresses) { + var ret []int32 + return ret + } + return o.Ipaddresses +} + +// GetIpaddressesOk returns a tuple with the Ipaddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetIpaddressesOk() ([]int32, bool) { + if o == nil || IsNil(o.Ipaddresses) { + return nil, false + } + return o.Ipaddresses, true +} + +// HasIpaddresses returns a boolean if a field has been set. +func (o *Service) HasIpaddresses() bool { + if o != nil && !IsNil(o.Ipaddresses) { + return true + } + + return false +} + +// SetIpaddresses gets a reference to the given []int32 and assigns it to the Ipaddresses field. +func (o *Service) SetIpaddresses(v []int32) { + o.Ipaddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Service) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Service) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Service) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Service) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Service) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Service) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Service) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Service) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Service) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Service) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Service) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Service) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Service) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Service) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Service) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Service) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Service) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Service) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Service) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Service) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Service) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.VirtualMachine.IsSet() { + toSerialize["virtual_machine"] = o.VirtualMachine.Get() + } + toSerialize["name"] = o.Name + toSerialize["ports"] = o.Ports + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Ipaddresses) { + toSerialize["ipaddresses"] = o.Ipaddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Service) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "ports", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varService := _Service{} + + err = json.Unmarshal(data, &varService) + + if err != nil { + return err + } + + *o = Service(varService) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "device") + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "ipaddresses") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableService struct { + value *Service + isSet bool +} + +func (v NullableService) Get() *Service { + return v.value +} + +func (v *NullableService) Set(val *Service) { + v.value = val + v.isSet = true +} + +func (v NullableService) IsSet() bool { + return v.isSet +} + +func (v *NullableService) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableService(val *Service) *NullableService { + return &NullableService{value: val, isSet: true} +} + +func (v NullableService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableService) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_service_protocol.go b/vendor/github.com/netbox-community/go-netbox/v3/model_service_protocol.go new file mode 100644 index 00000000..c65506db --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_service_protocol.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the ServiceProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceProtocol{} + +// ServiceProtocol struct for ServiceProtocol +type ServiceProtocol struct { + Value *PatchedWritableServiceRequestProtocol `json:"value,omitempty"` + Label *ServiceProtocolLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ServiceProtocol ServiceProtocol + +// NewServiceProtocol instantiates a new ServiceProtocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceProtocol() *ServiceProtocol { + this := ServiceProtocol{} + return &this +} + +// NewServiceProtocolWithDefaults instantiates a new ServiceProtocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceProtocolWithDefaults() *ServiceProtocol { + this := ServiceProtocol{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ServiceProtocol) GetValue() PatchedWritableServiceRequestProtocol { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableServiceRequestProtocol + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceProtocol) GetValueOk() (*PatchedWritableServiceRequestProtocol, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ServiceProtocol) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableServiceRequestProtocol and assigns it to the Value field. +func (o *ServiceProtocol) SetValue(v PatchedWritableServiceRequestProtocol) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *ServiceProtocol) GetLabel() ServiceProtocolLabel { + if o == nil || IsNil(o.Label) { + var ret ServiceProtocolLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceProtocol) GetLabelOk() (*ServiceProtocolLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *ServiceProtocol) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given ServiceProtocolLabel and assigns it to the Label field. +func (o *ServiceProtocol) SetLabel(v ServiceProtocolLabel) { + o.Label = &v +} + +func (o ServiceProtocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceProtocol) UnmarshalJSON(data []byte) (err error) { + varServiceProtocol := _ServiceProtocol{} + + err = json.Unmarshal(data, &varServiceProtocol) + + if err != nil { + return err + } + + *o = ServiceProtocol(varServiceProtocol) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceProtocol struct { + value *ServiceProtocol + isSet bool +} + +func (v NullableServiceProtocol) Get() *ServiceProtocol { + return v.value +} + +func (v *NullableServiceProtocol) Set(val *ServiceProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableServiceProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceProtocol(val *ServiceProtocol) *NullableServiceProtocol { + return &NullableServiceProtocol{value: val, isSet: true} +} + +func (v NullableServiceProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_service_protocol_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_service_protocol_label.go new file mode 100644 index 00000000..79b00279 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_service_protocol_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// ServiceProtocolLabel the model 'ServiceProtocolLabel' +type ServiceProtocolLabel string + +// List of Service_protocol_label +const ( + SERVICEPROTOCOLLABEL_TCP ServiceProtocolLabel = "TCP" + SERVICEPROTOCOLLABEL_UDP ServiceProtocolLabel = "UDP" + SERVICEPROTOCOLLABEL_SCTP ServiceProtocolLabel = "SCTP" +) + +// All allowed values of ServiceProtocolLabel enum +var AllowedServiceProtocolLabelEnumValues = []ServiceProtocolLabel{ + "TCP", + "UDP", + "SCTP", +} + +func (v *ServiceProtocolLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceProtocolLabel(value) + for _, existing := range AllowedServiceProtocolLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ServiceProtocolLabel", value) +} + +// NewServiceProtocolLabelFromValue returns a pointer to a valid ServiceProtocolLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceProtocolLabelFromValue(v string) (*ServiceProtocolLabel, error) { + ev := ServiceProtocolLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceProtocolLabel: valid values are %v", v, AllowedServiceProtocolLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceProtocolLabel) IsValid() bool { + for _, existing := range AllowedServiceProtocolLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Service_protocol_label value +func (v ServiceProtocolLabel) Ptr() *ServiceProtocolLabel { + return &v +} + +type NullableServiceProtocolLabel struct { + value *ServiceProtocolLabel + isSet bool +} + +func (v NullableServiceProtocolLabel) Get() *ServiceProtocolLabel { + return v.value +} + +func (v *NullableServiceProtocolLabel) Set(val *ServiceProtocolLabel) { + v.value = val + v.isSet = true +} + +func (v NullableServiceProtocolLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceProtocolLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceProtocolLabel(val *ServiceProtocolLabel) *NullableServiceProtocolLabel { + return &NullableServiceProtocolLabel{value: val, isSet: true} +} + +func (v NullableServiceProtocolLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceProtocolLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_service_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_service_request.go new file mode 100644 index 00000000..c875323b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_service_request.go @@ -0,0 +1,513 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ServiceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceRequest{} + +// ServiceRequest Adds support for custom fields and tags. +type ServiceRequest struct { + Device NullableNestedDeviceRequest `json:"device,omitempty"` + VirtualMachine NullableNestedVirtualMachineRequest `json:"virtual_machine,omitempty"` + Name string `json:"name"` + Ports []int32 `json:"ports"` + Protocol *PatchedWritableServiceRequestProtocol `json:"protocol,omitempty"` + Ipaddresses []int32 `json:"ipaddresses,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ServiceRequest ServiceRequest + +// NewServiceRequest instantiates a new ServiceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceRequest(name string, ports []int32) *ServiceRequest { + this := ServiceRequest{} + this.Name = name + this.Ports = ports + return &this +} + +// NewServiceRequestWithDefaults instantiates a new ServiceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceRequestWithDefaults() *ServiceRequest { + this := ServiceRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ServiceRequest) GetDevice() NestedDeviceRequest { + if o == nil || IsNil(o.Device.Get()) { + var ret NestedDeviceRequest + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ServiceRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *ServiceRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableNestedDeviceRequest and assigns it to the Device field. +func (o *ServiceRequest) SetDevice(v NestedDeviceRequest) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *ServiceRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *ServiceRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetVirtualMachine returns the VirtualMachine field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ServiceRequest) GetVirtualMachine() NestedVirtualMachineRequest { + if o == nil || IsNil(o.VirtualMachine.Get()) { + var ret NestedVirtualMachineRequest + return ret + } + return *o.VirtualMachine.Get() +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ServiceRequest) GetVirtualMachineOk() (*NestedVirtualMachineRequest, bool) { + if o == nil { + return nil, false + } + return o.VirtualMachine.Get(), o.VirtualMachine.IsSet() +} + +// HasVirtualMachine returns a boolean if a field has been set. +func (o *ServiceRequest) HasVirtualMachine() bool { + if o != nil && o.VirtualMachine.IsSet() { + return true + } + + return false +} + +// SetVirtualMachine gets a reference to the given NullableNestedVirtualMachineRequest and assigns it to the VirtualMachine field. +func (o *ServiceRequest) SetVirtualMachine(v NestedVirtualMachineRequest) { + o.VirtualMachine.Set(&v) +} + +// SetVirtualMachineNil sets the value for VirtualMachine to be an explicit nil +func (o *ServiceRequest) SetVirtualMachineNil() { + o.VirtualMachine.Set(nil) +} + +// UnsetVirtualMachine ensures that no value is present for VirtualMachine, not even an explicit nil +func (o *ServiceRequest) UnsetVirtualMachine() { + o.VirtualMachine.Unset() +} + +// GetName returns the Name field value +func (o *ServiceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ServiceRequest) SetName(v string) { + o.Name = v +} + +// GetPorts returns the Ports field value +func (o *ServiceRequest) GetPorts() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetPortsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Ports, true +} + +// SetPorts sets field value +func (o *ServiceRequest) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *ServiceRequest) GetProtocol() PatchedWritableServiceRequestProtocol { + if o == nil || IsNil(o.Protocol) { + var ret PatchedWritableServiceRequestProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetProtocolOk() (*PatchedWritableServiceRequestProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *ServiceRequest) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given PatchedWritableServiceRequestProtocol and assigns it to the Protocol field. +func (o *ServiceRequest) SetProtocol(v PatchedWritableServiceRequestProtocol) { + o.Protocol = &v +} + +// GetIpaddresses returns the Ipaddresses field value if set, zero value otherwise. +func (o *ServiceRequest) GetIpaddresses() []int32 { + if o == nil || IsNil(o.Ipaddresses) { + var ret []int32 + return ret + } + return o.Ipaddresses +} + +// GetIpaddressesOk returns a tuple with the Ipaddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetIpaddressesOk() ([]int32, bool) { + if o == nil || IsNil(o.Ipaddresses) { + return nil, false + } + return o.Ipaddresses, true +} + +// HasIpaddresses returns a boolean if a field has been set. +func (o *ServiceRequest) HasIpaddresses() bool { + if o != nil && !IsNil(o.Ipaddresses) { + return true + } + + return false +} + +// SetIpaddresses gets a reference to the given []int32 and assigns it to the Ipaddresses field. +func (o *ServiceRequest) SetIpaddresses(v []int32) { + o.Ipaddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ServiceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ServiceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ServiceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ServiceRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ServiceRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ServiceRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ServiceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ServiceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ServiceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ServiceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ServiceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ServiceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ServiceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.VirtualMachine.IsSet() { + toSerialize["virtual_machine"] = o.VirtualMachine.Get() + } + toSerialize["name"] = o.Name + toSerialize["ports"] = o.Ports + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Ipaddresses) { + toSerialize["ipaddresses"] = o.Ipaddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "ports", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceRequest := _ServiceRequest{} + + err = json.Unmarshal(data, &varServiceRequest) + + if err != nil { + return err + } + + *o = ServiceRequest(varServiceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "ipaddresses") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceRequest struct { + value *ServiceRequest + isSet bool +} + +func (v NullableServiceRequest) Get() *ServiceRequest { + return v.value +} + +func (v *NullableServiceRequest) Set(val *ServiceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableServiceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceRequest(val *ServiceRequest) *NullableServiceRequest { + return &NullableServiceRequest{value: val, isSet: true} +} + +func (v NullableServiceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_service_template.go b/vendor/github.com/netbox-community/go-netbox/v3/model_service_template.go new file mode 100644 index 00000000..56623452 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_service_template.go @@ -0,0 +1,530 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ServiceTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceTemplate{} + +// ServiceTemplate Adds support for custom fields and tags. +type ServiceTemplate struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Ports []int32 `json:"ports"` + Protocol *ServiceProtocol `json:"protocol,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _ServiceTemplate ServiceTemplate + +// NewServiceTemplate instantiates a new ServiceTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceTemplate(id int32, url string, display string, name string, ports []int32, created NullableTime, lastUpdated NullableTime) *ServiceTemplate { + this := ServiceTemplate{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Ports = ports + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewServiceTemplateWithDefaults instantiates a new ServiceTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceTemplateWithDefaults() *ServiceTemplate { + this := ServiceTemplate{} + return &this +} + +// GetId returns the Id field value +func (o *ServiceTemplate) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ServiceTemplate) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *ServiceTemplate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ServiceTemplate) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *ServiceTemplate) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *ServiceTemplate) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *ServiceTemplate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ServiceTemplate) SetName(v string) { + o.Name = v +} + +// GetPorts returns the Ports field value +func (o *ServiceTemplate) GetPorts() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetPortsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Ports, true +} + +// SetPorts sets field value +func (o *ServiceTemplate) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *ServiceTemplate) GetProtocol() ServiceProtocol { + if o == nil || IsNil(o.Protocol) { + var ret ServiceProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetProtocolOk() (*ServiceProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *ServiceTemplate) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given ServiceProtocol and assigns it to the Protocol field. +func (o *ServiceTemplate) SetProtocol(v ServiceProtocol) { + o.Protocol = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ServiceTemplate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ServiceTemplate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ServiceTemplate) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ServiceTemplate) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ServiceTemplate) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ServiceTemplate) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ServiceTemplate) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ServiceTemplate) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *ServiceTemplate) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ServiceTemplate) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplate) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ServiceTemplate) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ServiceTemplate) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ServiceTemplate) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ServiceTemplate) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *ServiceTemplate) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *ServiceTemplate) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ServiceTemplate) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *ServiceTemplate) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o ServiceTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["ports"] = o.Ports + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "ports", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceTemplate := _ServiceTemplate{} + + err = json.Unmarshal(data, &varServiceTemplate) + + if err != nil { + return err + } + + *o = ServiceTemplate(varServiceTemplate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceTemplate struct { + value *ServiceTemplate + isSet bool +} + +func (v NullableServiceTemplate) Get() *ServiceTemplate { + return v.value +} + +func (v *NullableServiceTemplate) Set(val *ServiceTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableServiceTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceTemplate(val *ServiceTemplate) *NullableServiceTemplate { + return &NullableServiceTemplate{value: val, isSet: true} +} + +func (v NullableServiceTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_service_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_service_template_request.go new file mode 100644 index 00000000..4365368d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_service_template_request.go @@ -0,0 +1,380 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the ServiceTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceTemplateRequest{} + +// ServiceTemplateRequest Adds support for custom fields and tags. +type ServiceTemplateRequest struct { + Name string `json:"name"` + Ports []int32 `json:"ports"` + Protocol *PatchedWritableServiceRequestProtocol `json:"protocol,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ServiceTemplateRequest ServiceTemplateRequest + +// NewServiceTemplateRequest instantiates a new ServiceTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceTemplateRequest(name string, ports []int32) *ServiceTemplateRequest { + this := ServiceTemplateRequest{} + this.Name = name + this.Ports = ports + return &this +} + +// NewServiceTemplateRequestWithDefaults instantiates a new ServiceTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceTemplateRequestWithDefaults() *ServiceTemplateRequest { + this := ServiceTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ServiceTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ServiceTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ServiceTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetPorts returns the Ports field value +func (o *ServiceTemplateRequest) GetPorts() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value +// and a boolean to check if the value has been set. +func (o *ServiceTemplateRequest) GetPortsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Ports, true +} + +// SetPorts sets field value +func (o *ServiceTemplateRequest) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *ServiceTemplateRequest) GetProtocol() PatchedWritableServiceRequestProtocol { + if o == nil || IsNil(o.Protocol) { + var ret PatchedWritableServiceRequestProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplateRequest) GetProtocolOk() (*PatchedWritableServiceRequestProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *ServiceTemplateRequest) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given PatchedWritableServiceRequestProtocol and assigns it to the Protocol field. +func (o *ServiceTemplateRequest) SetProtocol(v PatchedWritableServiceRequestProtocol) { + o.Protocol = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ServiceTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ServiceTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ServiceTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *ServiceTemplateRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplateRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *ServiceTemplateRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *ServiceTemplateRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ServiceTemplateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ServiceTemplateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *ServiceTemplateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *ServiceTemplateRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceTemplateRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *ServiceTemplateRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *ServiceTemplateRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o ServiceTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["ports"] = o.Ports + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "ports", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceTemplateRequest := _ServiceTemplateRequest{} + + err = json.Unmarshal(data, &varServiceTemplateRequest) + + if err != nil { + return err + } + + *o = ServiceTemplateRequest(varServiceTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceTemplateRequest struct { + value *ServiceTemplateRequest + isSet bool +} + +func (v NullableServiceTemplateRequest) Get() *ServiceTemplateRequest { + return v.value +} + +func (v *NullableServiceTemplateRequest) Set(val *ServiceTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableServiceTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceTemplateRequest(val *ServiceTemplateRequest) *NullableServiceTemplateRequest { + return &NullableServiceTemplateRequest{value: val, isSet: true} +} + +func (v NullableServiceTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_site.go b/vendor/github.com/netbox-community/go-netbox/v3/model_site.go new file mode 100644 index 00000000..9f805087 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_site.go @@ -0,0 +1,1146 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Site type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Site{} + +// Site Adds support for custom fields and tags. +type Site struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Full name of the site + Name string `json:"name"` + Slug string `json:"slug"` + Status *LocationStatus `json:"status,omitempty"` + Region NullableNestedRegion `json:"region,omitempty"` + Group NullableNestedSiteGroup `json:"group,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + // Local facility ID or description + Facility *string `json:"facility,omitempty"` + TimeZone NullableString `json:"time_zone,omitempty"` + Description *string `json:"description,omitempty"` + // Physical location of the building + PhysicalAddress *string `json:"physical_address,omitempty"` + // If different from the physical address + ShippingAddress *string `json:"shipping_address,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + CircuitCount int32 `json:"circuit_count"` + DeviceCount int32 `json:"device_count"` + PrefixCount int32 `json:"prefix_count"` + RackCount int32 `json:"rack_count"` + VirtualmachineCount int32 `json:"virtualmachine_count"` + VlanCount int32 `json:"vlan_count"` + AdditionalProperties map[string]interface{} +} + +type _Site Site + +// NewSite instantiates a new Site object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSite(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int32, deviceCount int32, prefixCount int32, rackCount int32, virtualmachineCount int32, vlanCount int32) *Site { + this := Site{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.CircuitCount = circuitCount + this.DeviceCount = deviceCount + this.PrefixCount = prefixCount + this.RackCount = rackCount + this.VirtualmachineCount = virtualmachineCount + this.VlanCount = vlanCount + return &this +} + +// NewSiteWithDefaults instantiates a new Site object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSiteWithDefaults() *Site { + this := Site{} + return &this +} + +// GetId returns the Id field value +func (o *Site) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Site) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Site) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Site) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Site) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Site) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Site) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Site) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Site) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Site) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Site) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Site) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Site) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Site) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Site) SetSlug(v string) { + o.Slug = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Site) GetStatus() LocationStatus { + if o == nil || IsNil(o.Status) { + var ret LocationStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetStatusOk() (*LocationStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Site) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatus and assigns it to the Status field. +func (o *Site) SetStatus(v LocationStatus) { + o.Status = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Site) GetRegion() NestedRegion { + if o == nil || IsNil(o.Region.Get()) { + var ret NestedRegion + return ret + } + return *o.Region.Get() +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetRegionOk() (*NestedRegion, bool) { + if o == nil { + return nil, false + } + return o.Region.Get(), o.Region.IsSet() +} + +// HasRegion returns a boolean if a field has been set. +func (o *Site) HasRegion() bool { + if o != nil && o.Region.IsSet() { + return true + } + + return false +} + +// SetRegion gets a reference to the given NullableNestedRegion and assigns it to the Region field. +func (o *Site) SetRegion(v NestedRegion) { + o.Region.Set(&v) +} + +// SetRegionNil sets the value for Region to be an explicit nil +func (o *Site) SetRegionNil() { + o.Region.Set(nil) +} + +// UnsetRegion ensures that no value is present for Region, not even an explicit nil +func (o *Site) UnsetRegion() { + o.Region.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Site) GetGroup() NestedSiteGroup { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedSiteGroup + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetGroupOk() (*NestedSiteGroup, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *Site) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedSiteGroup and assigns it to the Group field. +func (o *Site) SetGroup(v NestedSiteGroup) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *Site) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *Site) UnsetGroup() { + o.Group.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Site) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Site) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Site) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Site) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Site) UnsetTenant() { + o.Tenant.Unset() +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *Site) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *Site) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *Site) SetFacility(v string) { + o.Facility = &v +} + +// GetTimeZone returns the TimeZone field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Site) GetTimeZone() string { + if o == nil || IsNil(o.TimeZone.Get()) { + var ret string + return ret + } + return *o.TimeZone.Get() +} + +// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetTimeZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TimeZone.Get(), o.TimeZone.IsSet() +} + +// HasTimeZone returns a boolean if a field has been set. +func (o *Site) HasTimeZone() bool { + if o != nil && o.TimeZone.IsSet() { + return true + } + + return false +} + +// SetTimeZone gets a reference to the given NullableString and assigns it to the TimeZone field. +func (o *Site) SetTimeZone(v string) { + o.TimeZone.Set(&v) +} + +// SetTimeZoneNil sets the value for TimeZone to be an explicit nil +func (o *Site) SetTimeZoneNil() { + o.TimeZone.Set(nil) +} + +// UnsetTimeZone ensures that no value is present for TimeZone, not even an explicit nil +func (o *Site) UnsetTimeZone() { + o.TimeZone.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Site) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Site) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Site) SetDescription(v string) { + o.Description = &v +} + +// GetPhysicalAddress returns the PhysicalAddress field value if set, zero value otherwise. +func (o *Site) GetPhysicalAddress() string { + if o == nil || IsNil(o.PhysicalAddress) { + var ret string + return ret + } + return *o.PhysicalAddress +} + +// GetPhysicalAddressOk returns a tuple with the PhysicalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetPhysicalAddressOk() (*string, bool) { + if o == nil || IsNil(o.PhysicalAddress) { + return nil, false + } + return o.PhysicalAddress, true +} + +// HasPhysicalAddress returns a boolean if a field has been set. +func (o *Site) HasPhysicalAddress() bool { + if o != nil && !IsNil(o.PhysicalAddress) { + return true + } + + return false +} + +// SetPhysicalAddress gets a reference to the given string and assigns it to the PhysicalAddress field. +func (o *Site) SetPhysicalAddress(v string) { + o.PhysicalAddress = &v +} + +// GetShippingAddress returns the ShippingAddress field value if set, zero value otherwise. +func (o *Site) GetShippingAddress() string { + if o == nil || IsNil(o.ShippingAddress) { + var ret string + return ret + } + return *o.ShippingAddress +} + +// GetShippingAddressOk returns a tuple with the ShippingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetShippingAddressOk() (*string, bool) { + if o == nil || IsNil(o.ShippingAddress) { + return nil, false + } + return o.ShippingAddress, true +} + +// HasShippingAddress returns a boolean if a field has been set. +func (o *Site) HasShippingAddress() bool { + if o != nil && !IsNil(o.ShippingAddress) { + return true + } + + return false +} + +// SetShippingAddress gets a reference to the given string and assigns it to the ShippingAddress field. +func (o *Site) SetShippingAddress(v string) { + o.ShippingAddress = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Site) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *Site) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *Site) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *Site) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *Site) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Site) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *Site) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *Site) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *Site) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *Site) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Site) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Site) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Site) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *Site) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *Site) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *Site) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Site) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Site) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Site) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Site) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Site) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Site) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Site) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Site) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Site) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Site) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Site) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Site) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetCircuitCount returns the CircuitCount field value +func (o *Site) GetCircuitCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CircuitCount +} + +// GetCircuitCountOk returns a tuple with the CircuitCount field value +// and a boolean to check if the value has been set. +func (o *Site) GetCircuitCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CircuitCount, true +} + +// SetCircuitCount sets field value +func (o *Site) SetCircuitCount(v int32) { + o.CircuitCount = v +} + +// GetDeviceCount returns the DeviceCount field value +func (o *Site) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *Site) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *Site) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetPrefixCount returns the PrefixCount field value +func (o *Site) GetPrefixCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PrefixCount +} + +// GetPrefixCountOk returns a tuple with the PrefixCount field value +// and a boolean to check if the value has been set. +func (o *Site) GetPrefixCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PrefixCount, true +} + +// SetPrefixCount sets field value +func (o *Site) SetPrefixCount(v int32) { + o.PrefixCount = v +} + +// GetRackCount returns the RackCount field value +func (o *Site) GetRackCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RackCount +} + +// GetRackCountOk returns a tuple with the RackCount field value +// and a boolean to check if the value has been set. +func (o *Site) GetRackCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RackCount, true +} + +// SetRackCount sets field value +func (o *Site) SetRackCount(v int32) { + o.RackCount = v +} + +// GetVirtualmachineCount returns the VirtualmachineCount field value +func (o *Site) GetVirtualmachineCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualmachineCount +} + +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// and a boolean to check if the value has been set. +func (o *Site) GetVirtualmachineCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualmachineCount, true +} + +// SetVirtualmachineCount sets field value +func (o *Site) SetVirtualmachineCount(v int32) { + o.VirtualmachineCount = v +} + +// GetVlanCount returns the VlanCount field value +func (o *Site) GetVlanCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VlanCount +} + +// GetVlanCountOk returns a tuple with the VlanCount field value +// and a boolean to check if the value has been set. +func (o *Site) GetVlanCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VlanCount, true +} + +// SetVlanCount sets field value +func (o *Site) SetVlanCount(v int32) { + o.VlanCount = v +} + +func (o Site) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Site) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Region.IsSet() { + toSerialize["region"] = o.Region.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if o.TimeZone.IsSet() { + toSerialize["time_zone"] = o.TimeZone.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PhysicalAddress) { + toSerialize["physical_address"] = o.PhysicalAddress + } + if !IsNil(o.ShippingAddress) { + toSerialize["shipping_address"] = o.ShippingAddress + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["circuit_count"] = o.CircuitCount + toSerialize["device_count"] = o.DeviceCount + toSerialize["prefix_count"] = o.PrefixCount + toSerialize["rack_count"] = o.RackCount + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + toSerialize["vlan_count"] = o.VlanCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Site) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "circuit_count", + "device_count", + "prefix_count", + "rack_count", + "virtualmachine_count", + "vlan_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSite := _Site{} + + err = json.Unmarshal(data, &varSite) + + if err != nil { + return err + } + + *o = Site(varSite) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "status") + delete(additionalProperties, "region") + delete(additionalProperties, "group") + delete(additionalProperties, "tenant") + delete(additionalProperties, "facility") + delete(additionalProperties, "time_zone") + delete(additionalProperties, "description") + delete(additionalProperties, "physical_address") + delete(additionalProperties, "shipping_address") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "circuit_count") + delete(additionalProperties, "device_count") + delete(additionalProperties, "prefix_count") + delete(additionalProperties, "rack_count") + delete(additionalProperties, "virtualmachine_count") + delete(additionalProperties, "vlan_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSite struct { + value *Site + isSet bool +} + +func (v NullableSite) Get() *Site { + return v.value +} + +func (v *NullableSite) Set(val *Site) { + v.value = val + v.isSet = true +} + +func (v NullableSite) IsSet() bool { + return v.isSet +} + +func (v *NullableSite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSite(val *Site) *NullableSite { + return &NullableSite{value: val, isSet: true} +} + +func (v NullableSite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_site_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_site_group.go new file mode 100644 index 00000000..3fa67d77 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_site_group.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the SiteGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SiteGroup{} + +// SiteGroup Extends PrimaryModelSerializer to include MPTT support. +type SiteGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedSiteGroup `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + SiteCount int32 `json:"site_count"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _SiteGroup SiteGroup + +// NewSiteGroup instantiates a new SiteGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSiteGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, siteCount int32, depth int32) *SiteGroup { + this := SiteGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.SiteCount = siteCount + this.Depth = depth + return &this +} + +// NewSiteGroupWithDefaults instantiates a new SiteGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSiteGroupWithDefaults() *SiteGroup { + this := SiteGroup{} + return &this +} + +// GetId returns the Id field value +func (o *SiteGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SiteGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *SiteGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *SiteGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *SiteGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *SiteGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *SiteGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SiteGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SiteGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SiteGroup) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteGroup) GetParent() NestedSiteGroup { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedSiteGroup + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteGroup) GetParentOk() (*NestedSiteGroup, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *SiteGroup) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedSiteGroup and assigns it to the Parent field. +func (o *SiteGroup) SetParent(v NestedSiteGroup) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *SiteGroup) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *SiteGroup) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SiteGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SiteGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SiteGroup) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SiteGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SiteGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *SiteGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *SiteGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *SiteGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *SiteGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *SiteGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *SiteGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *SiteGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *SiteGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetSiteCount returns the SiteCount field value +func (o *SiteGroup) GetSiteCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SiteCount +} + +// GetSiteCountOk returns a tuple with the SiteCount field value +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetSiteCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SiteCount, true +} + +// SetSiteCount sets field value +func (o *SiteGroup) SetSiteCount(v int32) { + o.SiteCount = v +} + +// GetDepth returns the Depth field value +func (o *SiteGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *SiteGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *SiteGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o SiteGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SiteGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["site_count"] = o.SiteCount + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SiteGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "site_count", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSiteGroup := _SiteGroup{} + + err = json.Unmarshal(data, &varSiteGroup) + + if err != nil { + return err + } + + *o = SiteGroup(varSiteGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "site_count") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSiteGroup struct { + value *SiteGroup + isSet bool +} + +func (v NullableSiteGroup) Get() *SiteGroup { + return v.value +} + +func (v *NullableSiteGroup) Set(val *SiteGroup) { + v.value = val + v.isSet = true +} + +func (v NullableSiteGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableSiteGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSiteGroup(val *SiteGroup) *NullableSiteGroup { + return &NullableSiteGroup{value: val, isSet: true} +} + +func (v NullableSiteGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSiteGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_site_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_site_group_request.go new file mode 100644 index 00000000..3257cb6b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_site_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the SiteGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SiteGroupRequest{} + +// SiteGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type SiteGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedSiteGroupRequest `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SiteGroupRequest SiteGroupRequest + +// NewSiteGroupRequest instantiates a new SiteGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSiteGroupRequest(name string, slug string) *SiteGroupRequest { + this := SiteGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewSiteGroupRequestWithDefaults instantiates a new SiteGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSiteGroupRequestWithDefaults() *SiteGroupRequest { + this := SiteGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SiteGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SiteGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SiteGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SiteGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SiteGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SiteGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteGroupRequest) GetParent() NestedSiteGroupRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedSiteGroupRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteGroupRequest) GetParentOk() (*NestedSiteGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *SiteGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedSiteGroupRequest and assigns it to the Parent field. +func (o *SiteGroupRequest) SetParent(v NestedSiteGroupRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *SiteGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *SiteGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SiteGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SiteGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SiteGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SiteGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SiteGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *SiteGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *SiteGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *SiteGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *SiteGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o SiteGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SiteGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SiteGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSiteGroupRequest := _SiteGroupRequest{} + + err = json.Unmarshal(data, &varSiteGroupRequest) + + if err != nil { + return err + } + + *o = SiteGroupRequest(varSiteGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSiteGroupRequest struct { + value *SiteGroupRequest + isSet bool +} + +func (v NullableSiteGroupRequest) Get() *SiteGroupRequest { + return v.value +} + +func (v *NullableSiteGroupRequest) Set(val *SiteGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSiteGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSiteGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSiteGroupRequest(val *SiteGroupRequest) *NullableSiteGroupRequest { + return &NullableSiteGroupRequest{value: val, isSet: true} +} + +func (v NullableSiteGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSiteGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_site_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_site_request.go new file mode 100644 index 00000000..3ae21615 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_site_request.go @@ -0,0 +1,822 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the SiteRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SiteRequest{} + +// SiteRequest Adds support for custom fields and tags. +type SiteRequest struct { + // Full name of the site + Name string `json:"name"` + Slug string `json:"slug"` + Status *LocationStatusValue `json:"status,omitempty"` + Region NullableNestedRegionRequest `json:"region,omitempty"` + Group NullableNestedSiteGroupRequest `json:"group,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + // Local facility ID or description + Facility *string `json:"facility,omitempty"` + TimeZone NullableString `json:"time_zone,omitempty"` + Description *string `json:"description,omitempty"` + // Physical location of the building + PhysicalAddress *string `json:"physical_address,omitempty"` + // If different from the physical address + ShippingAddress *string `json:"shipping_address,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SiteRequest SiteRequest + +// NewSiteRequest instantiates a new SiteRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSiteRequest(name string, slug string) *SiteRequest { + this := SiteRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewSiteRequestWithDefaults instantiates a new SiteRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSiteRequestWithDefaults() *SiteRequest { + this := SiteRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SiteRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SiteRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SiteRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SiteRequest) SetSlug(v string) { + o.Slug = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SiteRequest) GetStatus() LocationStatusValue { + if o == nil || IsNil(o.Status) { + var ret LocationStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetStatusOk() (*LocationStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SiteRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatusValue and assigns it to the Status field. +func (o *SiteRequest) SetStatus(v LocationStatusValue) { + o.Status = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteRequest) GetRegion() NestedRegionRequest { + if o == nil || IsNil(o.Region.Get()) { + var ret NestedRegionRequest + return ret + } + return *o.Region.Get() +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteRequest) GetRegionOk() (*NestedRegionRequest, bool) { + if o == nil { + return nil, false + } + return o.Region.Get(), o.Region.IsSet() +} + +// HasRegion returns a boolean if a field has been set. +func (o *SiteRequest) HasRegion() bool { + if o != nil && o.Region.IsSet() { + return true + } + + return false +} + +// SetRegion gets a reference to the given NullableNestedRegionRequest and assigns it to the Region field. +func (o *SiteRequest) SetRegion(v NestedRegionRequest) { + o.Region.Set(&v) +} + +// SetRegionNil sets the value for Region to be an explicit nil +func (o *SiteRequest) SetRegionNil() { + o.Region.Set(nil) +} + +// UnsetRegion ensures that no value is present for Region, not even an explicit nil +func (o *SiteRequest) UnsetRegion() { + o.Region.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteRequest) GetGroup() NestedSiteGroupRequest { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedSiteGroupRequest + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteRequest) GetGroupOk() (*NestedSiteGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *SiteRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedSiteGroupRequest and assigns it to the Group field. +func (o *SiteRequest) SetGroup(v NestedSiteGroupRequest) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *SiteRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *SiteRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *SiteRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *SiteRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *SiteRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *SiteRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *SiteRequest) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *SiteRequest) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *SiteRequest) SetFacility(v string) { + o.Facility = &v +} + +// GetTimeZone returns the TimeZone field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteRequest) GetTimeZone() string { + if o == nil || IsNil(o.TimeZone.Get()) { + var ret string + return ret + } + return *o.TimeZone.Get() +} + +// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteRequest) GetTimeZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TimeZone.Get(), o.TimeZone.IsSet() +} + +// HasTimeZone returns a boolean if a field has been set. +func (o *SiteRequest) HasTimeZone() bool { + if o != nil && o.TimeZone.IsSet() { + return true + } + + return false +} + +// SetTimeZone gets a reference to the given NullableString and assigns it to the TimeZone field. +func (o *SiteRequest) SetTimeZone(v string) { + o.TimeZone.Set(&v) +} + +// SetTimeZoneNil sets the value for TimeZone to be an explicit nil +func (o *SiteRequest) SetTimeZoneNil() { + o.TimeZone.Set(nil) +} + +// UnsetTimeZone ensures that no value is present for TimeZone, not even an explicit nil +func (o *SiteRequest) UnsetTimeZone() { + o.TimeZone.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SiteRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SiteRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SiteRequest) SetDescription(v string) { + o.Description = &v +} + +// GetPhysicalAddress returns the PhysicalAddress field value if set, zero value otherwise. +func (o *SiteRequest) GetPhysicalAddress() string { + if o == nil || IsNil(o.PhysicalAddress) { + var ret string + return ret + } + return *o.PhysicalAddress +} + +// GetPhysicalAddressOk returns a tuple with the PhysicalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetPhysicalAddressOk() (*string, bool) { + if o == nil || IsNil(o.PhysicalAddress) { + return nil, false + } + return o.PhysicalAddress, true +} + +// HasPhysicalAddress returns a boolean if a field has been set. +func (o *SiteRequest) HasPhysicalAddress() bool { + if o != nil && !IsNil(o.PhysicalAddress) { + return true + } + + return false +} + +// SetPhysicalAddress gets a reference to the given string and assigns it to the PhysicalAddress field. +func (o *SiteRequest) SetPhysicalAddress(v string) { + o.PhysicalAddress = &v +} + +// GetShippingAddress returns the ShippingAddress field value if set, zero value otherwise. +func (o *SiteRequest) GetShippingAddress() string { + if o == nil || IsNil(o.ShippingAddress) { + var ret string + return ret + } + return *o.ShippingAddress +} + +// GetShippingAddressOk returns a tuple with the ShippingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetShippingAddressOk() (*string, bool) { + if o == nil || IsNil(o.ShippingAddress) { + return nil, false + } + return o.ShippingAddress, true +} + +// HasShippingAddress returns a boolean if a field has been set. +func (o *SiteRequest) HasShippingAddress() bool { + if o != nil && !IsNil(o.ShippingAddress) { + return true + } + + return false +} + +// SetShippingAddress gets a reference to the given string and assigns it to the ShippingAddress field. +func (o *SiteRequest) SetShippingAddress(v string) { + o.ShippingAddress = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteRequest) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteRequest) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *SiteRequest) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *SiteRequest) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *SiteRequest) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *SiteRequest) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SiteRequest) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SiteRequest) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *SiteRequest) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *SiteRequest) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *SiteRequest) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *SiteRequest) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *SiteRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *SiteRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *SiteRequest) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *SiteRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *SiteRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *SiteRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SiteRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SiteRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *SiteRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *SiteRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SiteRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *SiteRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *SiteRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o SiteRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SiteRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Region.IsSet() { + toSerialize["region"] = o.Region.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if o.TimeZone.IsSet() { + toSerialize["time_zone"] = o.TimeZone.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PhysicalAddress) { + toSerialize["physical_address"] = o.PhysicalAddress + } + if !IsNil(o.ShippingAddress) { + toSerialize["shipping_address"] = o.ShippingAddress + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SiteRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSiteRequest := _SiteRequest{} + + err = json.Unmarshal(data, &varSiteRequest) + + if err != nil { + return err + } + + *o = SiteRequest(varSiteRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "status") + delete(additionalProperties, "region") + delete(additionalProperties, "group") + delete(additionalProperties, "tenant") + delete(additionalProperties, "facility") + delete(additionalProperties, "time_zone") + delete(additionalProperties, "description") + delete(additionalProperties, "physical_address") + delete(additionalProperties, "shipping_address") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSiteRequest struct { + value *SiteRequest + isSet bool +} + +func (v NullableSiteRequest) Get() *SiteRequest { + return v.value +} + +func (v *NullableSiteRequest) Set(val *SiteRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSiteRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSiteRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSiteRequest(val *SiteRequest) *NullableSiteRequest { + return &NullableSiteRequest{value: val, isSet: true} +} + +func (v NullableSiteRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSiteRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tag.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tag.go new file mode 100644 index 00000000..c817d90f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tag.go @@ -0,0 +1,485 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Tag type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Tag{} + +// Tag Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type Tag struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + ObjectTypes []string `json:"object_types,omitempty"` + TaggedItems int32 `json:"tagged_items"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Tag Tag + +// NewTag instantiates a new Tag object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTag(id int32, url string, display string, name string, slug string, taggedItems int32, created NullableTime, lastUpdated NullableTime) *Tag { + this := Tag{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.TaggedItems = taggedItems + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewTagWithDefaults instantiates a new Tag object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTagWithDefaults() *Tag { + this := Tag{} + return &this +} + +// GetId returns the Id field value +func (o *Tag) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Tag) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Tag) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Tag) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Tag) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Tag) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Tag) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Tag) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Tag) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Tag) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Tag) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Tag) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Tag) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Tag) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Tag) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *Tag) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Tag) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Tag) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Tag) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Tag) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Tag) SetDescription(v string) { + o.Description = &v +} + +// GetObjectTypes returns the ObjectTypes field value if set, zero value otherwise. +func (o *Tag) GetObjectTypes() []string { + if o == nil || IsNil(o.ObjectTypes) { + var ret []string + return ret + } + return o.ObjectTypes +} + +// GetObjectTypesOk returns a tuple with the ObjectTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetObjectTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ObjectTypes) { + return nil, false + } + return o.ObjectTypes, true +} + +// HasObjectTypes returns a boolean if a field has been set. +func (o *Tag) HasObjectTypes() bool { + if o != nil && !IsNil(o.ObjectTypes) { + return true + } + + return false +} + +// SetObjectTypes gets a reference to the given []string and assigns it to the ObjectTypes field. +func (o *Tag) SetObjectTypes(v []string) { + o.ObjectTypes = v +} + +// GetTaggedItems returns the TaggedItems field value +func (o *Tag) GetTaggedItems() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TaggedItems +} + +// GetTaggedItemsOk returns a tuple with the TaggedItems field value +// and a boolean to check if the value has been set. +func (o *Tag) GetTaggedItemsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TaggedItems, true +} + +// SetTaggedItems sets field value +func (o *Tag) SetTaggedItems(v int32) { + o.TaggedItems = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Tag) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tag) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Tag) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Tag) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tag) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Tag) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Tag) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Tag) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.ObjectTypes) { + toSerialize["object_types"] = o.ObjectTypes + } + toSerialize["tagged_items"] = o.TaggedItems + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Tag) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "tagged_items", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTag := _Tag{} + + err = json.Unmarshal(data, &varTag) + + if err != nil { + return err + } + + *o = Tag(varTag) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "object_types") + delete(additionalProperties, "tagged_items") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTag struct { + value *Tag + isSet bool +} + +func (v NullableTag) Get() *Tag { + return v.value +} + +func (v *NullableTag) Set(val *Tag) { + v.value = val + v.isSet = true +} + +func (v NullableTag) IsSet() bool { + return v.isSet +} + +func (v *NullableTag) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTag(val *Tag) *NullableTag { + return &NullableTag{value: val, isSet: true} +} + +func (v NullableTag) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTag) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tag_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tag_request.go new file mode 100644 index 00000000..f3a2422d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tag_request.go @@ -0,0 +1,306 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the TagRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TagRequest{} + +// TagRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type TagRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + ObjectTypes []string `json:"object_types,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TagRequest TagRequest + +// NewTagRequest instantiates a new TagRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTagRequest(name string, slug string) *TagRequest { + this := TagRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewTagRequestWithDefaults instantiates a new TagRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTagRequestWithDefaults() *TagRequest { + this := TagRequest{} + return &this +} + +// GetName returns the Name field value +func (o *TagRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TagRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TagRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TagRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TagRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TagRequest) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *TagRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *TagRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *TagRequest) SetColor(v string) { + o.Color = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TagRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TagRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TagRequest) SetDescription(v string) { + o.Description = &v +} + +// GetObjectTypes returns the ObjectTypes field value if set, zero value otherwise. +func (o *TagRequest) GetObjectTypes() []string { + if o == nil || IsNil(o.ObjectTypes) { + var ret []string + return ret + } + return o.ObjectTypes +} + +// GetObjectTypesOk returns a tuple with the ObjectTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TagRequest) GetObjectTypesOk() ([]string, bool) { + if o == nil || IsNil(o.ObjectTypes) { + return nil, false + } + return o.ObjectTypes, true +} + +// HasObjectTypes returns a boolean if a field has been set. +func (o *TagRequest) HasObjectTypes() bool { + if o != nil && !IsNil(o.ObjectTypes) { + return true + } + + return false +} + +// SetObjectTypes gets a reference to the given []string and assigns it to the ObjectTypes field. +func (o *TagRequest) SetObjectTypes(v []string) { + o.ObjectTypes = v +} + +func (o TagRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TagRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.ObjectTypes) { + toSerialize["object_types"] = o.ObjectTypes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TagRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTagRequest := _TagRequest{} + + err = json.Unmarshal(data, &varTagRequest) + + if err != nil { + return err + } + + *o = TagRequest(varTagRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "description") + delete(additionalProperties, "object_types") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTagRequest struct { + value *TagRequest + isSet bool +} + +func (v NullableTagRequest) Get() *TagRequest { + return v.value +} + +func (v *NullableTagRequest) Set(val *TagRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTagRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTagRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTagRequest(val *TagRequest) *NullableTagRequest { + return &NullableTagRequest{value: val, isSet: true} +} + +func (v NullableTagRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTagRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tenant.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant.go new file mode 100644 index 00000000..a24f61f0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant.go @@ -0,0 +1,831 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Tenant type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Tenant{} + +// Tenant Adds support for custom fields and tags. +type Tenant struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Group NullableNestedTenantGroup `json:"group,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + CircuitCount int32 `json:"circuit_count"` + DeviceCount int32 `json:"device_count"` + IpaddressCount int32 `json:"ipaddress_count"` + PrefixCount int32 `json:"prefix_count"` + RackCount int32 `json:"rack_count"` + SiteCount int32 `json:"site_count"` + VirtualmachineCount int32 `json:"virtualmachine_count"` + VlanCount int32 `json:"vlan_count"` + VrfCount int32 `json:"vrf_count"` + ClusterCount int32 `json:"cluster_count"` + AdditionalProperties map[string]interface{} +} + +type _Tenant Tenant + +// NewTenant instantiates a new Tenant object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenant(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int32, deviceCount int32, ipaddressCount int32, prefixCount int32, rackCount int32, siteCount int32, virtualmachineCount int32, vlanCount int32, vrfCount int32, clusterCount int32) *Tenant { + this := Tenant{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.CircuitCount = circuitCount + this.DeviceCount = deviceCount + this.IpaddressCount = ipaddressCount + this.PrefixCount = prefixCount + this.RackCount = rackCount + this.SiteCount = siteCount + this.VirtualmachineCount = virtualmachineCount + this.VlanCount = vlanCount + this.VrfCount = vrfCount + this.ClusterCount = clusterCount + return &this +} + +// NewTenantWithDefaults instantiates a new Tenant object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantWithDefaults() *Tenant { + this := Tenant{} + return &this +} + +// GetId returns the Id field value +func (o *Tenant) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Tenant) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Tenant) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Tenant) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Tenant) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Tenant) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Tenant) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Tenant) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Tenant) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Tenant) SetSlug(v string) { + o.Slug = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Tenant) GetGroup() NestedTenantGroup { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedTenantGroup + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tenant) GetGroupOk() (*NestedTenantGroup, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *Tenant) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedTenantGroup and assigns it to the Group field. +func (o *Tenant) SetGroup(v NestedTenantGroup) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *Tenant) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *Tenant) UnsetGroup() { + o.Group.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Tenant) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tenant) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Tenant) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Tenant) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Tenant) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tenant) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Tenant) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Tenant) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Tenant) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tenant) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Tenant) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Tenant) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Tenant) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tenant) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Tenant) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Tenant) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Tenant) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tenant) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Tenant) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Tenant) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tenant) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Tenant) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetCircuitCount returns the CircuitCount field value +func (o *Tenant) GetCircuitCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CircuitCount +} + +// GetCircuitCountOk returns a tuple with the CircuitCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetCircuitCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CircuitCount, true +} + +// SetCircuitCount sets field value +func (o *Tenant) SetCircuitCount(v int32) { + o.CircuitCount = v +} + +// GetDeviceCount returns the DeviceCount field value +func (o *Tenant) GetDeviceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceCount +} + +// GetDeviceCountOk returns a tuple with the DeviceCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetDeviceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceCount, true +} + +// SetDeviceCount sets field value +func (o *Tenant) SetDeviceCount(v int32) { + o.DeviceCount = v +} + +// GetIpaddressCount returns the IpaddressCount field value +func (o *Tenant) GetIpaddressCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.IpaddressCount +} + +// GetIpaddressCountOk returns a tuple with the IpaddressCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetIpaddressCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.IpaddressCount, true +} + +// SetIpaddressCount sets field value +func (o *Tenant) SetIpaddressCount(v int32) { + o.IpaddressCount = v +} + +// GetPrefixCount returns the PrefixCount field value +func (o *Tenant) GetPrefixCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PrefixCount +} + +// GetPrefixCountOk returns a tuple with the PrefixCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetPrefixCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PrefixCount, true +} + +// SetPrefixCount sets field value +func (o *Tenant) SetPrefixCount(v int32) { + o.PrefixCount = v +} + +// GetRackCount returns the RackCount field value +func (o *Tenant) GetRackCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RackCount +} + +// GetRackCountOk returns a tuple with the RackCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetRackCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RackCount, true +} + +// SetRackCount sets field value +func (o *Tenant) SetRackCount(v int32) { + o.RackCount = v +} + +// GetSiteCount returns the SiteCount field value +func (o *Tenant) GetSiteCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SiteCount +} + +// GetSiteCountOk returns a tuple with the SiteCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetSiteCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SiteCount, true +} + +// SetSiteCount sets field value +func (o *Tenant) SetSiteCount(v int32) { + o.SiteCount = v +} + +// GetVirtualmachineCount returns the VirtualmachineCount field value +func (o *Tenant) GetVirtualmachineCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualmachineCount +} + +// GetVirtualmachineCountOk returns a tuple with the VirtualmachineCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetVirtualmachineCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualmachineCount, true +} + +// SetVirtualmachineCount sets field value +func (o *Tenant) SetVirtualmachineCount(v int32) { + o.VirtualmachineCount = v +} + +// GetVlanCount returns the VlanCount field value +func (o *Tenant) GetVlanCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VlanCount +} + +// GetVlanCountOk returns a tuple with the VlanCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetVlanCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VlanCount, true +} + +// SetVlanCount sets field value +func (o *Tenant) SetVlanCount(v int32) { + o.VlanCount = v +} + +// GetVrfCount returns the VrfCount field value +func (o *Tenant) GetVrfCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VrfCount +} + +// GetVrfCountOk returns a tuple with the VrfCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetVrfCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VrfCount, true +} + +// SetVrfCount sets field value +func (o *Tenant) SetVrfCount(v int32) { + o.VrfCount = v +} + +// GetClusterCount returns the ClusterCount field value +func (o *Tenant) GetClusterCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ClusterCount +} + +// GetClusterCountOk returns a tuple with the ClusterCount field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetClusterCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ClusterCount, true +} + +// SetClusterCount sets field value +func (o *Tenant) SetClusterCount(v int32) { + o.ClusterCount = v +} + +func (o Tenant) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Tenant) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["circuit_count"] = o.CircuitCount + toSerialize["device_count"] = o.DeviceCount + toSerialize["ipaddress_count"] = o.IpaddressCount + toSerialize["prefix_count"] = o.PrefixCount + toSerialize["rack_count"] = o.RackCount + toSerialize["site_count"] = o.SiteCount + toSerialize["virtualmachine_count"] = o.VirtualmachineCount + toSerialize["vlan_count"] = o.VlanCount + toSerialize["vrf_count"] = o.VrfCount + toSerialize["cluster_count"] = o.ClusterCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Tenant) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "circuit_count", + "device_count", + "ipaddress_count", + "prefix_count", + "rack_count", + "site_count", + "virtualmachine_count", + "vlan_count", + "vrf_count", + "cluster_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenant := _Tenant{} + + err = json.Unmarshal(data, &varTenant) + + if err != nil { + return err + } + + *o = Tenant(varTenant) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "group") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "circuit_count") + delete(additionalProperties, "device_count") + delete(additionalProperties, "ipaddress_count") + delete(additionalProperties, "prefix_count") + delete(additionalProperties, "rack_count") + delete(additionalProperties, "site_count") + delete(additionalProperties, "virtualmachine_count") + delete(additionalProperties, "vlan_count") + delete(additionalProperties, "vrf_count") + delete(additionalProperties, "cluster_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenant struct { + value *Tenant + isSet bool +} + +func (v NullableTenant) Get() *Tenant { + return v.value +} + +func (v *NullableTenant) Set(val *Tenant) { + v.value = val + v.isSet = true +} + +func (v NullableTenant) IsSet() bool { + return v.isSet +} + +func (v *NullableTenant) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenant(val *Tenant) *NullableTenant { + return &NullableTenant{value: val, isSet: true} +} + +func (v NullableTenant) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenant) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_group.go new file mode 100644 index 00000000..0ce72217 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_group.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TenantGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantGroup{} + +// TenantGroup Extends PrimaryModelSerializer to include MPTT support. +type TenantGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedTenantGroup `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + TenantCount int32 `json:"tenant_count"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _TenantGroup TenantGroup + +// NewTenantGroup instantiates a new TenantGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, tenantCount int32, depth int32) *TenantGroup { + this := TenantGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.TenantCount = tenantCount + this.Depth = depth + return &this +} + +// NewTenantGroupWithDefaults instantiates a new TenantGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantGroupWithDefaults() *TenantGroup { + this := TenantGroup{} + return &this +} + +// GetId returns the Id field value +func (o *TenantGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TenantGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *TenantGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *TenantGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *TenantGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *TenantGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *TenantGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TenantGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TenantGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TenantGroup) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TenantGroup) GetParent() NestedTenantGroup { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedTenantGroup + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TenantGroup) GetParentOk() (*NestedTenantGroup, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *TenantGroup) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedTenantGroup and assigns it to the Parent field. +func (o *TenantGroup) SetParent(v NestedTenantGroup) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *TenantGroup) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *TenantGroup) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TenantGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TenantGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TenantGroup) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TenantGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TenantGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *TenantGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TenantGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TenantGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TenantGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *TenantGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TenantGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *TenantGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *TenantGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TenantGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *TenantGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetTenantCount returns the TenantCount field value +func (o *TenantGroup) GetTenantCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TenantCount +} + +// GetTenantCountOk returns a tuple with the TenantCount field value +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetTenantCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TenantCount, true +} + +// SetTenantCount sets field value +func (o *TenantGroup) SetTenantCount(v int32) { + o.TenantCount = v +} + +// GetDepth returns the Depth field value +func (o *TenantGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *TenantGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *TenantGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o TenantGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["tenant_count"] = o.TenantCount + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TenantGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "tenant_count", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantGroup := _TenantGroup{} + + err = json.Unmarshal(data, &varTenantGroup) + + if err != nil { + return err + } + + *o = TenantGroup(varTenantGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "tenant_count") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenantGroup struct { + value *TenantGroup + isSet bool +} + +func (v NullableTenantGroup) Get() *TenantGroup { + return v.value +} + +func (v *NullableTenantGroup) Set(val *TenantGroup) { + v.value = val + v.isSet = true +} + +func (v NullableTenantGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantGroup(val *TenantGroup) *NullableTenantGroup { + return &NullableTenantGroup{value: val, isSet: true} +} + +func (v NullableTenantGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_group_request.go new file mode 100644 index 00000000..6ee73fd2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the TenantGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantGroupRequest{} + +// TenantGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type TenantGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedTenantGroupRequest `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TenantGroupRequest TenantGroupRequest + +// NewTenantGroupRequest instantiates a new TenantGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantGroupRequest(name string, slug string) *TenantGroupRequest { + this := TenantGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewTenantGroupRequestWithDefaults instantiates a new TenantGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantGroupRequestWithDefaults() *TenantGroupRequest { + this := TenantGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *TenantGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TenantGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TenantGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TenantGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TenantGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TenantGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TenantGroupRequest) GetParent() NestedTenantGroupRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedTenantGroupRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TenantGroupRequest) GetParentOk() (*NestedTenantGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *TenantGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedTenantGroupRequest and assigns it to the Parent field. +func (o *TenantGroupRequest) SetParent(v NestedTenantGroupRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *TenantGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *TenantGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TenantGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TenantGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TenantGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TenantGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TenantGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *TenantGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TenantGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TenantGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TenantGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o TenantGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TenantGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantGroupRequest := _TenantGroupRequest{} + + err = json.Unmarshal(data, &varTenantGroupRequest) + + if err != nil { + return err + } + + *o = TenantGroupRequest(varTenantGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenantGroupRequest struct { + value *TenantGroupRequest + isSet bool +} + +func (v NullableTenantGroupRequest) Get() *TenantGroupRequest { + return v.value +} + +func (v *NullableTenantGroupRequest) Set(val *TenantGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTenantGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantGroupRequest(val *TenantGroupRequest) *NullableTenantGroupRequest { + return &NullableTenantGroupRequest{value: val, isSet: true} +} + +func (v NullableTenantGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_request.go new file mode 100644 index 00000000..f0e032e6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tenant_request.go @@ -0,0 +1,391 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the TenantRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantRequest{} + +// TenantRequest Adds support for custom fields and tags. +type TenantRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Group NullableNestedTenantGroupRequest `json:"group,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TenantRequest TenantRequest + +// NewTenantRequest instantiates a new TenantRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantRequest(name string, slug string) *TenantRequest { + this := TenantRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewTenantRequestWithDefaults instantiates a new TenantRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantRequestWithDefaults() *TenantRequest { + this := TenantRequest{} + return &this +} + +// GetName returns the Name field value +func (o *TenantRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TenantRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TenantRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TenantRequest) SetSlug(v string) { + o.Slug = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TenantRequest) GetGroup() NestedTenantGroupRequest { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedTenantGroupRequest + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TenantRequest) GetGroupOk() (*NestedTenantGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *TenantRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedTenantGroupRequest and assigns it to the Group field. +func (o *TenantRequest) SetGroup(v NestedTenantGroupRequest) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *TenantRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *TenantRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TenantRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TenantRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TenantRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *TenantRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *TenantRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *TenantRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TenantRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TenantRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *TenantRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TenantRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TenantRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TenantRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o TenantRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TenantRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantRequest := _TenantRequest{} + + err = json.Unmarshal(data, &varTenantRequest) + + if err != nil { + return err + } + + *o = TenantRequest(varTenantRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "group") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenantRequest struct { + value *TenantRequest + isSet bool +} + +func (v NullableTenantRequest) Get() *TenantRequest { + return v.value +} + +func (v *NullableTenantRequest) Set(val *TenantRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTenantRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantRequest(val *TenantRequest) *NullableTenantRequest { + return &NullableTenantRequest{value: val, isSet: true} +} + +func (v NullableTenantRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_termination.go b/vendor/github.com/netbox-community/go-netbox/v3/model_termination.go new file mode 100644 index 00000000..9ca34c30 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_termination.go @@ -0,0 +1,110 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// Termination * `A` - A * `Z` - Z +type Termination string + +// List of Termination +const ( + TERMINATION_A Termination = "A" + TERMINATION_Z Termination = "Z" +) + +// All allowed values of Termination enum +var AllowedTerminationEnumValues = []Termination{ + "A", + "Z", +} + +func (v *Termination) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Termination(value) + for _, existing := range AllowedTerminationEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Termination", value) +} + +// NewTerminationFromValue returns a pointer to a valid Termination +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTerminationFromValue(v string) (*Termination, error) { + ev := Termination(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Termination: valid values are %v", v, AllowedTerminationEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Termination) IsValid() bool { + for _, existing := range AllowedTerminationEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Termination value +func (v Termination) Ptr() *Termination { + return &v +} + +type NullableTermination struct { + value *Termination + isSet bool +} + +func (v NullableTermination) Get() *Termination { + return v.value +} + +func (v *NullableTermination) Set(val *Termination) { + v.value = val + v.isSet = true +} + +func (v NullableTermination) IsSet() bool { + return v.isSet +} + +func (v *NullableTermination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTermination(val *Termination) *NullableTermination { + return &NullableTermination{value: val, isSet: true} +} + +func (v NullableTermination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTermination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_token.go b/vendor/github.com/netbox-community/go-netbox/v3/model_token.go new file mode 100644 index 00000000..06c1ec6c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_token.go @@ -0,0 +1,491 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Token type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Token{} + +// Token Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type Token struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + User NestedUser `json:"user"` + Created time.Time `json:"created"` + Expires NullableTime `json:"expires,omitempty"` + LastUsed NullableTime `json:"last_used,omitempty"` + Key *string `json:"key,omitempty"` + // Permit create/update/delete operations using this key + WriteEnabled *bool `json:"write_enabled,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Token Token + +// NewToken instantiates a new Token object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewToken(id int32, url string, display string, user NestedUser, created time.Time) *Token { + this := Token{} + this.Id = id + this.Url = url + this.Display = display + this.User = user + this.Created = created + return &this +} + +// NewTokenWithDefaults instantiates a new Token object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenWithDefaults() *Token { + this := Token{} + return &this +} + +// GetId returns the Id field value +func (o *Token) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Token) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Token) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Token) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Token) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Token) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Token) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Token) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Token) SetDisplay(v string) { + o.Display = v +} + +// GetUser returns the User field value +func (o *Token) GetUser() NestedUser { + if o == nil { + var ret NestedUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *Token) GetUserOk() (*NestedUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *Token) SetUser(v NestedUser) { + o.User = v +} + +// GetCreated returns the Created field value +func (o *Token) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Token) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Token) SetCreated(v time.Time) { + o.Created = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Token) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Token) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *Token) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *Token) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *Token) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *Token) UnsetExpires() { + o.Expires.Unset() +} + +// GetLastUsed returns the LastUsed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Token) GetLastUsed() time.Time { + if o == nil || IsNil(o.LastUsed.Get()) { + var ret time.Time + return ret + } + return *o.LastUsed.Get() +} + +// GetLastUsedOk returns a tuple with the LastUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Token) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUsed.Get(), o.LastUsed.IsSet() +} + +// HasLastUsed returns a boolean if a field has been set. +func (o *Token) HasLastUsed() bool { + if o != nil && o.LastUsed.IsSet() { + return true + } + + return false +} + +// SetLastUsed gets a reference to the given NullableTime and assigns it to the LastUsed field. +func (o *Token) SetLastUsed(v time.Time) { + o.LastUsed.Set(&v) +} + +// SetLastUsedNil sets the value for LastUsed to be an explicit nil +func (o *Token) SetLastUsedNil() { + o.LastUsed.Set(nil) +} + +// UnsetLastUsed ensures that no value is present for LastUsed, not even an explicit nil +func (o *Token) UnsetLastUsed() { + o.LastUsed.Unset() +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *Token) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *Token) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *Token) SetKey(v string) { + o.Key = &v +} + +// GetWriteEnabled returns the WriteEnabled field value if set, zero value otherwise. +func (o *Token) GetWriteEnabled() bool { + if o == nil || IsNil(o.WriteEnabled) { + var ret bool + return ret + } + return *o.WriteEnabled +} + +// GetWriteEnabledOk returns a tuple with the WriteEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetWriteEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.WriteEnabled) { + return nil, false + } + return o.WriteEnabled, true +} + +// HasWriteEnabled returns a boolean if a field has been set. +func (o *Token) HasWriteEnabled() bool { + if o != nil && !IsNil(o.WriteEnabled) { + return true + } + + return false +} + +// SetWriteEnabled gets a reference to the given bool and assigns it to the WriteEnabled field. +func (o *Token) SetWriteEnabled(v bool) { + o.WriteEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Token) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Token) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Token) SetDescription(v string) { + o.Description = &v +} + +func (o Token) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Token) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["user"] = o.User + toSerialize["created"] = o.Created + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if o.LastUsed.IsSet() { + toSerialize["last_used"] = o.LastUsed.Get() + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.WriteEnabled) { + toSerialize["write_enabled"] = o.WriteEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Token) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "user", + "created", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varToken := _Token{} + + err = json.Unmarshal(data, &varToken) + + if err != nil { + return err + } + + *o = Token(varToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "user") + delete(additionalProperties, "created") + delete(additionalProperties, "expires") + delete(additionalProperties, "last_used") + delete(additionalProperties, "key") + delete(additionalProperties, "write_enabled") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableToken struct { + value *Token + isSet bool +} + +func (v NullableToken) Get() *Token { + return v.value +} + +func (v *NullableToken) Set(val *Token) { + v.value = val + v.isSet = true +} + +func (v NullableToken) IsSet() bool { + return v.isSet +} + +func (v *NullableToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableToken(val *Token) *NullableToken { + return &NullableToken{value: val, isSet: true} +} + +func (v NullableToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_token_provision.go b/vendor/github.com/netbox-community/go-netbox/v3/model_token_provision.go new file mode 100644 index 00000000..be2b7763 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_token_provision.go @@ -0,0 +1,464 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TokenProvision type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenProvision{} + +// TokenProvision Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type TokenProvision struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + User NestedUser `json:"user"` + Created time.Time `json:"created"` + Expires NullableTime `json:"expires,omitempty"` + LastUsed time.Time `json:"last_used"` + Key string `json:"key"` + // Permit create/update/delete operations using this key + WriteEnabled *bool `json:"write_enabled,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TokenProvision TokenProvision + +// NewTokenProvision instantiates a new TokenProvision object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenProvision(id int32, url string, display string, user NestedUser, created time.Time, lastUsed time.Time, key string) *TokenProvision { + this := TokenProvision{} + this.Id = id + this.Url = url + this.Display = display + this.User = user + this.Created = created + this.LastUsed = lastUsed + this.Key = key + return &this +} + +// NewTokenProvisionWithDefaults instantiates a new TokenProvision object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenProvisionWithDefaults() *TokenProvision { + this := TokenProvision{} + return &this +} + +// GetId returns the Id field value +func (o *TokenProvision) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TokenProvision) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *TokenProvision) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *TokenProvision) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *TokenProvision) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *TokenProvision) SetDisplay(v string) { + o.Display = v +} + +// GetUser returns the User field value +func (o *TokenProvision) GetUser() NestedUser { + if o == nil { + var ret NestedUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetUserOk() (*NestedUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *TokenProvision) SetUser(v NestedUser) { + o.User = v +} + +// GetCreated returns the Created field value +func (o *TokenProvision) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *TokenProvision) SetCreated(v time.Time) { + o.Created = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenProvision) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenProvision) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *TokenProvision) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *TokenProvision) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *TokenProvision) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *TokenProvision) UnsetExpires() { + o.Expires.Unset() +} + +// GetLastUsed returns the LastUsed field value +func (o *TokenProvision) GetLastUsed() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUsed +} + +// GetLastUsedOk returns a tuple with the LastUsed field value +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUsed, true +} + +// SetLastUsed sets field value +func (o *TokenProvision) SetLastUsed(v time.Time) { + o.LastUsed = v +} + +// GetKey returns the Key field value +func (o *TokenProvision) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *TokenProvision) SetKey(v string) { + o.Key = v +} + +// GetWriteEnabled returns the WriteEnabled field value if set, zero value otherwise. +func (o *TokenProvision) GetWriteEnabled() bool { + if o == nil || IsNil(o.WriteEnabled) { + var ret bool + return ret + } + return *o.WriteEnabled +} + +// GetWriteEnabledOk returns a tuple with the WriteEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetWriteEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.WriteEnabled) { + return nil, false + } + return o.WriteEnabled, true +} + +// HasWriteEnabled returns a boolean if a field has been set. +func (o *TokenProvision) HasWriteEnabled() bool { + if o != nil && !IsNil(o.WriteEnabled) { + return true + } + + return false +} + +// SetWriteEnabled gets a reference to the given bool and assigns it to the WriteEnabled field. +func (o *TokenProvision) SetWriteEnabled(v bool) { + o.WriteEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TokenProvision) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenProvision) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TokenProvision) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TokenProvision) SetDescription(v string) { + o.Description = &v +} + +func (o TokenProvision) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenProvision) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["user"] = o.User + toSerialize["created"] = o.Created + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + toSerialize["last_used"] = o.LastUsed + toSerialize["key"] = o.Key + if !IsNil(o.WriteEnabled) { + toSerialize["write_enabled"] = o.WriteEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TokenProvision) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "user", + "created", + "last_used", + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenProvision := _TokenProvision{} + + err = json.Unmarshal(data, &varTokenProvision) + + if err != nil { + return err + } + + *o = TokenProvision(varTokenProvision) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "user") + delete(additionalProperties, "created") + delete(additionalProperties, "expires") + delete(additionalProperties, "last_used") + delete(additionalProperties, "key") + delete(additionalProperties, "write_enabled") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTokenProvision struct { + value *TokenProvision + isSet bool +} + +func (v NullableTokenProvision) Get() *TokenProvision { + return v.value +} + +func (v *NullableTokenProvision) Set(val *TokenProvision) { + v.value = val + v.isSet = true +} + +func (v NullableTokenProvision) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenProvision) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenProvision(val *TokenProvision) *NullableTokenProvision { + return &NullableTokenProvision{value: val, isSet: true} +} + +func (v NullableTokenProvision) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenProvision) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_token_provision_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_token_provision_request.go new file mode 100644 index 00000000..b59141ff --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_token_provision_request.go @@ -0,0 +1,319 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TokenProvisionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenProvisionRequest{} + +// TokenProvisionRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type TokenProvisionRequest struct { + Expires NullableTime `json:"expires,omitempty"` + // Permit create/update/delete operations using this key + WriteEnabled *bool `json:"write_enabled,omitempty"` + Description *string `json:"description,omitempty"` + Username string `json:"username"` + Password string `json:"password"` + AdditionalProperties map[string]interface{} +} + +type _TokenProvisionRequest TokenProvisionRequest + +// NewTokenProvisionRequest instantiates a new TokenProvisionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenProvisionRequest(username string, password string) *TokenProvisionRequest { + this := TokenProvisionRequest{} + this.Username = username + this.Password = password + return &this +} + +// NewTokenProvisionRequestWithDefaults instantiates a new TokenProvisionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenProvisionRequestWithDefaults() *TokenProvisionRequest { + this := TokenProvisionRequest{} + return &this +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenProvisionRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenProvisionRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *TokenProvisionRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *TokenProvisionRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *TokenProvisionRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *TokenProvisionRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetWriteEnabled returns the WriteEnabled field value if set, zero value otherwise. +func (o *TokenProvisionRequest) GetWriteEnabled() bool { + if o == nil || IsNil(o.WriteEnabled) { + var ret bool + return ret + } + return *o.WriteEnabled +} + +// GetWriteEnabledOk returns a tuple with the WriteEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenProvisionRequest) GetWriteEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.WriteEnabled) { + return nil, false + } + return o.WriteEnabled, true +} + +// HasWriteEnabled returns a boolean if a field has been set. +func (o *TokenProvisionRequest) HasWriteEnabled() bool { + if o != nil && !IsNil(o.WriteEnabled) { + return true + } + + return false +} + +// SetWriteEnabled gets a reference to the given bool and assigns it to the WriteEnabled field. +func (o *TokenProvisionRequest) SetWriteEnabled(v bool) { + o.WriteEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TokenProvisionRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenProvisionRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TokenProvisionRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TokenProvisionRequest) SetDescription(v string) { + o.Description = &v +} + +// GetUsername returns the Username field value +func (o *TokenProvisionRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *TokenProvisionRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *TokenProvisionRequest) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *TokenProvisionRequest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *TokenProvisionRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *TokenProvisionRequest) SetPassword(v string) { + o.Password = v +} + +func (o TokenProvisionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenProvisionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.WriteEnabled) { + toSerialize["write_enabled"] = o.WriteEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TokenProvisionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "username", + "password", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenProvisionRequest := _TokenProvisionRequest{} + + err = json.Unmarshal(data, &varTokenProvisionRequest) + + if err != nil { + return err + } + + *o = TokenProvisionRequest(varTokenProvisionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "expires") + delete(additionalProperties, "write_enabled") + delete(additionalProperties, "description") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTokenProvisionRequest struct { + value *TokenProvisionRequest + isSet bool +} + +func (v NullableTokenProvisionRequest) Get() *TokenProvisionRequest { + return v.value +} + +func (v *NullableTokenProvisionRequest) Set(val *TokenProvisionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTokenProvisionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenProvisionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenProvisionRequest(val *TokenProvisionRequest) *NullableTokenProvisionRequest { + return &NullableTokenProvisionRequest{value: val, isSet: true} +} + +func (v NullableTokenProvisionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenProvisionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_token_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_token_request.go new file mode 100644 index 00000000..8659e068 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_token_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenRequest{} + +// TokenRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type TokenRequest struct { + User NestedUserRequest `json:"user"` + Expires NullableTime `json:"expires,omitempty"` + LastUsed NullableTime `json:"last_used,omitempty"` + Key *string `json:"key,omitempty"` + // Permit create/update/delete operations using this key + WriteEnabled *bool `json:"write_enabled,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TokenRequest TokenRequest + +// NewTokenRequest instantiates a new TokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenRequest(user NestedUserRequest) *TokenRequest { + this := TokenRequest{} + this.User = user + return &this +} + +// NewTokenRequestWithDefaults instantiates a new TokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenRequestWithDefaults() *TokenRequest { + this := TokenRequest{} + return &this +} + +// GetUser returns the User field value +func (o *TokenRequest) GetUser() NestedUserRequest { + if o == nil { + var ret NestedUserRequest + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetUserOk() (*NestedUserRequest, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *TokenRequest) SetUser(v NestedUserRequest) { + o.User = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *TokenRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *TokenRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *TokenRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *TokenRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetLastUsed returns the LastUsed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenRequest) GetLastUsed() time.Time { + if o == nil || IsNil(o.LastUsed.Get()) { + var ret time.Time + return ret + } + return *o.LastUsed.Get() +} + +// GetLastUsedOk returns a tuple with the LastUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenRequest) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUsed.Get(), o.LastUsed.IsSet() +} + +// HasLastUsed returns a boolean if a field has been set. +func (o *TokenRequest) HasLastUsed() bool { + if o != nil && o.LastUsed.IsSet() { + return true + } + + return false +} + +// SetLastUsed gets a reference to the given NullableTime and assigns it to the LastUsed field. +func (o *TokenRequest) SetLastUsed(v time.Time) { + o.LastUsed.Set(&v) +} + +// SetLastUsedNil sets the value for LastUsed to be an explicit nil +func (o *TokenRequest) SetLastUsedNil() { + o.LastUsed.Set(nil) +} + +// UnsetLastUsed ensures that no value is present for LastUsed, not even an explicit nil +func (o *TokenRequest) UnsetLastUsed() { + o.LastUsed.Unset() +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *TokenRequest) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *TokenRequest) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *TokenRequest) SetKey(v string) { + o.Key = &v +} + +// GetWriteEnabled returns the WriteEnabled field value if set, zero value otherwise. +func (o *TokenRequest) GetWriteEnabled() bool { + if o == nil || IsNil(o.WriteEnabled) { + var ret bool + return ret + } + return *o.WriteEnabled +} + +// GetWriteEnabledOk returns a tuple with the WriteEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetWriteEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.WriteEnabled) { + return nil, false + } + return o.WriteEnabled, true +} + +// HasWriteEnabled returns a boolean if a field has been set. +func (o *TokenRequest) HasWriteEnabled() bool { + if o != nil && !IsNil(o.WriteEnabled) { + return true + } + + return false +} + +// SetWriteEnabled gets a reference to the given bool and assigns it to the WriteEnabled field. +func (o *TokenRequest) SetWriteEnabled(v bool) { + o.WriteEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TokenRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TokenRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TokenRequest) SetDescription(v string) { + o.Description = &v +} + +func (o TokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if o.LastUsed.IsSet() { + toSerialize["last_used"] = o.LastUsed.Get() + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.WriteEnabled) { + toSerialize["write_enabled"] = o.WriteEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TokenRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenRequest := _TokenRequest{} + + err = json.Unmarshal(data, &varTokenRequest) + + if err != nil { + return err + } + + *o = TokenRequest(varTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "expires") + delete(additionalProperties, "last_used") + delete(additionalProperties, "key") + delete(additionalProperties, "write_enabled") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTokenRequest struct { + value *TokenRequest + isSet bool +} + +func (v NullableTokenRequest) Get() *TokenRequest { + return v.value +} + +func (v *NullableTokenRequest) Set(val *TokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenRequest(val *TokenRequest) *NullableTokenRequest { + return &NullableTokenRequest{value: val, isSet: true} +} + +func (v NullableTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel.go new file mode 100644 index 00000000..241fc871 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel.go @@ -0,0 +1,695 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Tunnel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Tunnel{} + +// Tunnel Adds support for custom fields and tags. +type Tunnel struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Status TunnelStatus `json:"status"` + Group NestedTunnelGroup `json:"group"` + Encapsulation TunnelEncapsulation `json:"encapsulation"` + IpsecProfile NullableNestedIPSecProfile `json:"ipsec_profile,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + TunnelId NullableInt64 `json:"tunnel_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Tunnel Tunnel + +// NewTunnel instantiates a new Tunnel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnel(id int32, url string, display string, name string, status TunnelStatus, group NestedTunnelGroup, encapsulation TunnelEncapsulation, created NullableTime, lastUpdated NullableTime) *Tunnel { + this := Tunnel{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Status = status + this.Group = group + this.Encapsulation = encapsulation + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewTunnelWithDefaults instantiates a new Tunnel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelWithDefaults() *Tunnel { + this := Tunnel{} + return &this +} + +// GetId returns the Id field value +func (o *Tunnel) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Tunnel) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Tunnel) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Tunnel) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Tunnel) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Tunnel) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Tunnel) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Tunnel) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Tunnel) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Tunnel) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Tunnel) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Tunnel) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *Tunnel) GetStatus() TunnelStatus { + if o == nil { + var ret TunnelStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Tunnel) GetStatusOk() (*TunnelStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Tunnel) SetStatus(v TunnelStatus) { + o.Status = v +} + +// GetGroup returns the Group field value +func (o *Tunnel) GetGroup() NestedTunnelGroup { + if o == nil { + var ret NestedTunnelGroup + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *Tunnel) GetGroupOk() (*NestedTunnelGroup, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *Tunnel) SetGroup(v NestedTunnelGroup) { + o.Group = v +} + +// GetEncapsulation returns the Encapsulation field value +func (o *Tunnel) GetEncapsulation() TunnelEncapsulation { + if o == nil { + var ret TunnelEncapsulation + return ret + } + + return o.Encapsulation +} + +// GetEncapsulationOk returns a tuple with the Encapsulation field value +// and a boolean to check if the value has been set. +func (o *Tunnel) GetEncapsulationOk() (*TunnelEncapsulation, bool) { + if o == nil { + return nil, false + } + return &o.Encapsulation, true +} + +// SetEncapsulation sets field value +func (o *Tunnel) SetEncapsulation(v TunnelEncapsulation) { + o.Encapsulation = v +} + +// GetIpsecProfile returns the IpsecProfile field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Tunnel) GetIpsecProfile() NestedIPSecProfile { + if o == nil || IsNil(o.IpsecProfile.Get()) { + var ret NestedIPSecProfile + return ret + } + return *o.IpsecProfile.Get() +} + +// GetIpsecProfileOk returns a tuple with the IpsecProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tunnel) GetIpsecProfileOk() (*NestedIPSecProfile, bool) { + if o == nil { + return nil, false + } + return o.IpsecProfile.Get(), o.IpsecProfile.IsSet() +} + +// HasIpsecProfile returns a boolean if a field has been set. +func (o *Tunnel) HasIpsecProfile() bool { + if o != nil && o.IpsecProfile.IsSet() { + return true + } + + return false +} + +// SetIpsecProfile gets a reference to the given NullableNestedIPSecProfile and assigns it to the IpsecProfile field. +func (o *Tunnel) SetIpsecProfile(v NestedIPSecProfile) { + o.IpsecProfile.Set(&v) +} + +// SetIpsecProfileNil sets the value for IpsecProfile to be an explicit nil +func (o *Tunnel) SetIpsecProfileNil() { + o.IpsecProfile.Set(nil) +} + +// UnsetIpsecProfile ensures that no value is present for IpsecProfile, not even an explicit nil +func (o *Tunnel) UnsetIpsecProfile() { + o.IpsecProfile.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Tunnel) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tunnel) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *Tunnel) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *Tunnel) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *Tunnel) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *Tunnel) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTunnelId returns the TunnelId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Tunnel) GetTunnelId() int64 { + if o == nil || IsNil(o.TunnelId.Get()) { + var ret int64 + return ret + } + return *o.TunnelId.Get() +} + +// GetTunnelIdOk returns a tuple with the TunnelId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tunnel) GetTunnelIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TunnelId.Get(), o.TunnelId.IsSet() +} + +// HasTunnelId returns a boolean if a field has been set. +func (o *Tunnel) HasTunnelId() bool { + if o != nil && o.TunnelId.IsSet() { + return true + } + + return false +} + +// SetTunnelId gets a reference to the given NullableInt64 and assigns it to the TunnelId field. +func (o *Tunnel) SetTunnelId(v int64) { + o.TunnelId.Set(&v) +} + +// SetTunnelIdNil sets the value for TunnelId to be an explicit nil +func (o *Tunnel) SetTunnelIdNil() { + o.TunnelId.Set(nil) +} + +// UnsetTunnelId ensures that no value is present for TunnelId, not even an explicit nil +func (o *Tunnel) UnsetTunnelId() { + o.TunnelId.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Tunnel) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tunnel) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Tunnel) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Tunnel) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *Tunnel) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tunnel) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *Tunnel) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *Tunnel) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Tunnel) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tunnel) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Tunnel) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Tunnel) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Tunnel) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tunnel) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Tunnel) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Tunnel) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Tunnel) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tunnel) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Tunnel) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Tunnel) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tunnel) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Tunnel) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Tunnel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Tunnel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + toSerialize["group"] = o.Group + toSerialize["encapsulation"] = o.Encapsulation + if o.IpsecProfile.IsSet() { + toSerialize["ipsec_profile"] = o.IpsecProfile.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.TunnelId.IsSet() { + toSerialize["tunnel_id"] = o.TunnelId.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Tunnel) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "status", + "group", + "encapsulation", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTunnel := _Tunnel{} + + err = json.Unmarshal(data, &varTunnel) + + if err != nil { + return err + } + + *o = Tunnel(varTunnel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "group") + delete(additionalProperties, "encapsulation") + delete(additionalProperties, "ipsec_profile") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tunnel_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnel struct { + value *Tunnel + isSet bool +} + +func (v NullableTunnel) Get() *Tunnel { + return v.value +} + +func (v *NullableTunnel) Set(val *Tunnel) { + v.value = val + v.isSet = true +} + +func (v NullableTunnel) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnel(val *Tunnel) *NullableTunnel { + return &NullableTunnel{value: val, isSet: true} +} + +func (v NullableTunnel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_encapsulation.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_encapsulation.go new file mode 100644 index 00000000..8b623a59 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_encapsulation.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the TunnelEncapsulation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelEncapsulation{} + +// TunnelEncapsulation struct for TunnelEncapsulation +type TunnelEncapsulation struct { + Value *PatchedWritableTunnelRequestEncapsulation `json:"value,omitempty"` + Label *TunnelEncapsulationLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TunnelEncapsulation TunnelEncapsulation + +// NewTunnelEncapsulation instantiates a new TunnelEncapsulation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelEncapsulation() *TunnelEncapsulation { + this := TunnelEncapsulation{} + return &this +} + +// NewTunnelEncapsulationWithDefaults instantiates a new TunnelEncapsulation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelEncapsulationWithDefaults() *TunnelEncapsulation { + this := TunnelEncapsulation{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *TunnelEncapsulation) GetValue() PatchedWritableTunnelRequestEncapsulation { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableTunnelRequestEncapsulation + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelEncapsulation) GetValueOk() (*PatchedWritableTunnelRequestEncapsulation, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *TunnelEncapsulation) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableTunnelRequestEncapsulation and assigns it to the Value field. +func (o *TunnelEncapsulation) SetValue(v PatchedWritableTunnelRequestEncapsulation) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *TunnelEncapsulation) GetLabel() TunnelEncapsulationLabel { + if o == nil || IsNil(o.Label) { + var ret TunnelEncapsulationLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelEncapsulation) GetLabelOk() (*TunnelEncapsulationLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *TunnelEncapsulation) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given TunnelEncapsulationLabel and assigns it to the Label field. +func (o *TunnelEncapsulation) SetLabel(v TunnelEncapsulationLabel) { + o.Label = &v +} + +func (o TunnelEncapsulation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelEncapsulation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelEncapsulation) UnmarshalJSON(data []byte) (err error) { + varTunnelEncapsulation := _TunnelEncapsulation{} + + err = json.Unmarshal(data, &varTunnelEncapsulation) + + if err != nil { + return err + } + + *o = TunnelEncapsulation(varTunnelEncapsulation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelEncapsulation struct { + value *TunnelEncapsulation + isSet bool +} + +func (v NullableTunnelEncapsulation) Get() *TunnelEncapsulation { + return v.value +} + +func (v *NullableTunnelEncapsulation) Set(val *TunnelEncapsulation) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelEncapsulation) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelEncapsulation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelEncapsulation(val *TunnelEncapsulation) *NullableTunnelEncapsulation { + return &NullableTunnelEncapsulation{value: val, isSet: true} +} + +func (v NullableTunnelEncapsulation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelEncapsulation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_encapsulation_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_encapsulation_label.go new file mode 100644 index 00000000..63640720 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_encapsulation_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// TunnelEncapsulationLabel the model 'TunnelEncapsulationLabel' +type TunnelEncapsulationLabel string + +// List of Tunnel_encapsulation_label +const ( + TUNNELENCAPSULATIONLABEL_I_PSEC___TRANSPORT TunnelEncapsulationLabel = "IPsec - Transport" + TUNNELENCAPSULATIONLABEL_I_PSEC___TUNNEL TunnelEncapsulationLabel = "IPsec - Tunnel" + TUNNELENCAPSULATIONLABEL_IP_IN_IP TunnelEncapsulationLabel = "IP-in-IP" + TUNNELENCAPSULATIONLABEL_GRE TunnelEncapsulationLabel = "GRE" +) + +// All allowed values of TunnelEncapsulationLabel enum +var AllowedTunnelEncapsulationLabelEnumValues = []TunnelEncapsulationLabel{ + "IPsec - Transport", + "IPsec - Tunnel", + "IP-in-IP", + "GRE", +} + +func (v *TunnelEncapsulationLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelEncapsulationLabel(value) + for _, existing := range AllowedTunnelEncapsulationLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TunnelEncapsulationLabel", value) +} + +// NewTunnelEncapsulationLabelFromValue returns a pointer to a valid TunnelEncapsulationLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelEncapsulationLabelFromValue(v string) (*TunnelEncapsulationLabel, error) { + ev := TunnelEncapsulationLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelEncapsulationLabel: valid values are %v", v, AllowedTunnelEncapsulationLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelEncapsulationLabel) IsValid() bool { + for _, existing := range AllowedTunnelEncapsulationLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Tunnel_encapsulation_label value +func (v TunnelEncapsulationLabel) Ptr() *TunnelEncapsulationLabel { + return &v +} + +type NullableTunnelEncapsulationLabel struct { + value *TunnelEncapsulationLabel + isSet bool +} + +func (v NullableTunnelEncapsulationLabel) Get() *TunnelEncapsulationLabel { + return v.value +} + +func (v *NullableTunnelEncapsulationLabel) Set(val *TunnelEncapsulationLabel) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelEncapsulationLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelEncapsulationLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelEncapsulationLabel(val *TunnelEncapsulationLabel) *NullableTunnelEncapsulationLabel { + return &NullableTunnelEncapsulationLabel{value: val, isSet: true} +} + +func (v NullableTunnelEncapsulationLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelEncapsulationLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_group.go new file mode 100644 index 00000000..724a26c4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_group.go @@ -0,0 +1,485 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TunnelGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelGroup{} + +// TunnelGroup Adds support for custom fields and tags. +type TunnelGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + TunnelCount int32 `json:"tunnel_count"` + AdditionalProperties map[string]interface{} +} + +type _TunnelGroup TunnelGroup + +// NewTunnelGroup instantiates a new TunnelGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, tunnelCount int32) *TunnelGroup { + this := TunnelGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.TunnelCount = tunnelCount + return &this +} + +// NewTunnelGroupWithDefaults instantiates a new TunnelGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelGroupWithDefaults() *TunnelGroup { + this := TunnelGroup{} + return &this +} + +// GetId returns the Id field value +func (o *TunnelGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TunnelGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *TunnelGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *TunnelGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *TunnelGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *TunnelGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *TunnelGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TunnelGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TunnelGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TunnelGroup) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TunnelGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TunnelGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TunnelGroup) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TunnelGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TunnelGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *TunnelGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TunnelGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TunnelGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TunnelGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *TunnelGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *TunnelGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *TunnelGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *TunnelGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetTunnelCount returns the TunnelCount field value +func (o *TunnelGroup) GetTunnelCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TunnelCount +} + +// GetTunnelCountOk returns a tuple with the TunnelCount field value +// and a boolean to check if the value has been set. +func (o *TunnelGroup) GetTunnelCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TunnelCount, true +} + +// SetTunnelCount sets field value +func (o *TunnelGroup) SetTunnelCount(v int32) { + o.TunnelCount = v +} + +func (o TunnelGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["tunnel_count"] = o.TunnelCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "tunnel_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTunnelGroup := _TunnelGroup{} + + err = json.Unmarshal(data, &varTunnelGroup) + + if err != nil { + return err + } + + *o = TunnelGroup(varTunnelGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "tunnel_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelGroup struct { + value *TunnelGroup + isSet bool +} + +func (v NullableTunnelGroup) Get() *TunnelGroup { + return v.value +} + +func (v *NullableTunnelGroup) Set(val *TunnelGroup) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelGroup(val *TunnelGroup) *NullableTunnelGroup { + return &NullableTunnelGroup{value: val, isSet: true} +} + +func (v NullableTunnelGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_group_request.go new file mode 100644 index 00000000..dc2f49a7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_group_request.go @@ -0,0 +1,306 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the TunnelGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelGroupRequest{} + +// TunnelGroupRequest Adds support for custom fields and tags. +type TunnelGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TunnelGroupRequest TunnelGroupRequest + +// NewTunnelGroupRequest instantiates a new TunnelGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelGroupRequest(name string, slug string) *TunnelGroupRequest { + this := TunnelGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewTunnelGroupRequestWithDefaults instantiates a new TunnelGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelGroupRequestWithDefaults() *TunnelGroupRequest { + this := TunnelGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *TunnelGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TunnelGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TunnelGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TunnelGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TunnelGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TunnelGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TunnelGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TunnelGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TunnelGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TunnelGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TunnelGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *TunnelGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TunnelGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TunnelGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TunnelGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o TunnelGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTunnelGroupRequest := _TunnelGroupRequest{} + + err = json.Unmarshal(data, &varTunnelGroupRequest) + + if err != nil { + return err + } + + *o = TunnelGroupRequest(varTunnelGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelGroupRequest struct { + value *TunnelGroupRequest + isSet bool +} + +func (v NullableTunnelGroupRequest) Get() *TunnelGroupRequest { + return v.value +} + +func (v *NullableTunnelGroupRequest) Set(val *TunnelGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelGroupRequest(val *TunnelGroupRequest) *NullableTunnelGroupRequest { + return &NullableTunnelGroupRequest{value: val, isSet: true} +} + +func (v NullableTunnelGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_request.go new file mode 100644 index 00000000..0b7e1a8a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_request.go @@ -0,0 +1,545 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the TunnelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelRequest{} + +// TunnelRequest Adds support for custom fields and tags. +type TunnelRequest struct { + Name string `json:"name"` + Status PatchedWritableTunnelRequestStatus `json:"status"` + Group NestedTunnelGroupRequest `json:"group"` + Encapsulation PatchedWritableTunnelRequestEncapsulation `json:"encapsulation"` + IpsecProfile NullableNestedIPSecProfileRequest `json:"ipsec_profile,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + TunnelId NullableInt64 `json:"tunnel_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TunnelRequest TunnelRequest + +// NewTunnelRequest instantiates a new TunnelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelRequest(name string, status PatchedWritableTunnelRequestStatus, group NestedTunnelGroupRequest, encapsulation PatchedWritableTunnelRequestEncapsulation) *TunnelRequest { + this := TunnelRequest{} + this.Name = name + this.Status = status + this.Group = group + this.Encapsulation = encapsulation + return &this +} + +// NewTunnelRequestWithDefaults instantiates a new TunnelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelRequestWithDefaults() *TunnelRequest { + this := TunnelRequest{} + return &this +} + +// GetName returns the Name field value +func (o *TunnelRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TunnelRequest) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *TunnelRequest) GetStatus() PatchedWritableTunnelRequestStatus { + if o == nil { + var ret PatchedWritableTunnelRequestStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetStatusOk() (*PatchedWritableTunnelRequestStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *TunnelRequest) SetStatus(v PatchedWritableTunnelRequestStatus) { + o.Status = v +} + +// GetGroup returns the Group field value +func (o *TunnelRequest) GetGroup() NestedTunnelGroupRequest { + if o == nil { + var ret NestedTunnelGroupRequest + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetGroupOk() (*NestedTunnelGroupRequest, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *TunnelRequest) SetGroup(v NestedTunnelGroupRequest) { + o.Group = v +} + +// GetEncapsulation returns the Encapsulation field value +func (o *TunnelRequest) GetEncapsulation() PatchedWritableTunnelRequestEncapsulation { + if o == nil { + var ret PatchedWritableTunnelRequestEncapsulation + return ret + } + + return o.Encapsulation +} + +// GetEncapsulationOk returns a tuple with the Encapsulation field value +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetEncapsulationOk() (*PatchedWritableTunnelRequestEncapsulation, bool) { + if o == nil { + return nil, false + } + return &o.Encapsulation, true +} + +// SetEncapsulation sets field value +func (o *TunnelRequest) SetEncapsulation(v PatchedWritableTunnelRequestEncapsulation) { + o.Encapsulation = v +} + +// GetIpsecProfile returns the IpsecProfile field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TunnelRequest) GetIpsecProfile() NestedIPSecProfileRequest { + if o == nil || IsNil(o.IpsecProfile.Get()) { + var ret NestedIPSecProfileRequest + return ret + } + return *o.IpsecProfile.Get() +} + +// GetIpsecProfileOk returns a tuple with the IpsecProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelRequest) GetIpsecProfileOk() (*NestedIPSecProfileRequest, bool) { + if o == nil { + return nil, false + } + return o.IpsecProfile.Get(), o.IpsecProfile.IsSet() +} + +// HasIpsecProfile returns a boolean if a field has been set. +func (o *TunnelRequest) HasIpsecProfile() bool { + if o != nil && o.IpsecProfile.IsSet() { + return true + } + + return false +} + +// SetIpsecProfile gets a reference to the given NullableNestedIPSecProfileRequest and assigns it to the IpsecProfile field. +func (o *TunnelRequest) SetIpsecProfile(v NestedIPSecProfileRequest) { + o.IpsecProfile.Set(&v) +} + +// SetIpsecProfileNil sets the value for IpsecProfile to be an explicit nil +func (o *TunnelRequest) SetIpsecProfileNil() { + o.IpsecProfile.Set(nil) +} + +// UnsetIpsecProfile ensures that no value is present for IpsecProfile, not even an explicit nil +func (o *TunnelRequest) UnsetIpsecProfile() { + o.IpsecProfile.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TunnelRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *TunnelRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *TunnelRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *TunnelRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *TunnelRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTunnelId returns the TunnelId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TunnelRequest) GetTunnelId() int64 { + if o == nil || IsNil(o.TunnelId.Get()) { + var ret int64 + return ret + } + return *o.TunnelId.Get() +} + +// GetTunnelIdOk returns a tuple with the TunnelId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelRequest) GetTunnelIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TunnelId.Get(), o.TunnelId.IsSet() +} + +// HasTunnelId returns a boolean if a field has been set. +func (o *TunnelRequest) HasTunnelId() bool { + if o != nil && o.TunnelId.IsSet() { + return true + } + + return false +} + +// SetTunnelId gets a reference to the given NullableInt64 and assigns it to the TunnelId field. +func (o *TunnelRequest) SetTunnelId(v int64) { + o.TunnelId.Set(&v) +} + +// SetTunnelIdNil sets the value for TunnelId to be an explicit nil +func (o *TunnelRequest) SetTunnelIdNil() { + o.TunnelId.Set(nil) +} + +// UnsetTunnelId ensures that no value is present for TunnelId, not even an explicit nil +func (o *TunnelRequest) UnsetTunnelId() { + o.TunnelId.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TunnelRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TunnelRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TunnelRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *TunnelRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *TunnelRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *TunnelRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TunnelRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TunnelRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *TunnelRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TunnelRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TunnelRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TunnelRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o TunnelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + toSerialize["group"] = o.Group + toSerialize["encapsulation"] = o.Encapsulation + if o.IpsecProfile.IsSet() { + toSerialize["ipsec_profile"] = o.IpsecProfile.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.TunnelId.IsSet() { + toSerialize["tunnel_id"] = o.TunnelId.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + "group", + "encapsulation", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTunnelRequest := _TunnelRequest{} + + err = json.Unmarshal(data, &varTunnelRequest) + + if err != nil { + return err + } + + *o = TunnelRequest(varTunnelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "group") + delete(additionalProperties, "encapsulation") + delete(additionalProperties, "ipsec_profile") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tunnel_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelRequest struct { + value *TunnelRequest + isSet bool +} + +func (v NullableTunnelRequest) Get() *TunnelRequest { + return v.value +} + +func (v *NullableTunnelRequest) Set(val *TunnelRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelRequest(val *TunnelRequest) *NullableTunnelRequest { + return &NullableTunnelRequest{value: val, isSet: true} +} + +func (v NullableTunnelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_status.go new file mode 100644 index 00000000..b63530c6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the TunnelStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelStatus{} + +// TunnelStatus struct for TunnelStatus +type TunnelStatus struct { + Value *PatchedWritableTunnelRequestStatus `json:"value,omitempty"` + Label *TunnelStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TunnelStatus TunnelStatus + +// NewTunnelStatus instantiates a new TunnelStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelStatus() *TunnelStatus { + this := TunnelStatus{} + return &this +} + +// NewTunnelStatusWithDefaults instantiates a new TunnelStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelStatusWithDefaults() *TunnelStatus { + this := TunnelStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *TunnelStatus) GetValue() PatchedWritableTunnelRequestStatus { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableTunnelRequestStatus + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelStatus) GetValueOk() (*PatchedWritableTunnelRequestStatus, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *TunnelStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableTunnelRequestStatus and assigns it to the Value field. +func (o *TunnelStatus) SetValue(v PatchedWritableTunnelRequestStatus) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *TunnelStatus) GetLabel() TunnelStatusLabel { + if o == nil || IsNil(o.Label) { + var ret TunnelStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelStatus) GetLabelOk() (*TunnelStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *TunnelStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given TunnelStatusLabel and assigns it to the Label field. +func (o *TunnelStatus) SetLabel(v TunnelStatusLabel) { + o.Label = &v +} + +func (o TunnelStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelStatus) UnmarshalJSON(data []byte) (err error) { + varTunnelStatus := _TunnelStatus{} + + err = json.Unmarshal(data, &varTunnelStatus) + + if err != nil { + return err + } + + *o = TunnelStatus(varTunnelStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelStatus struct { + value *TunnelStatus + isSet bool +} + +func (v NullableTunnelStatus) Get() *TunnelStatus { + return v.value +} + +func (v *NullableTunnelStatus) Set(val *TunnelStatus) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelStatus(val *TunnelStatus) *NullableTunnelStatus { + return &NullableTunnelStatus{value: val, isSet: true} +} + +func (v NullableTunnelStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_status_label.go new file mode 100644 index 00000000..cb5596c6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_status_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// TunnelStatusLabel the model 'TunnelStatusLabel' +type TunnelStatusLabel string + +// List of Tunnel_status_label +const ( + TUNNELSTATUSLABEL_PLANNED TunnelStatusLabel = "Planned" + TUNNELSTATUSLABEL_ACTIVE TunnelStatusLabel = "Active" + TUNNELSTATUSLABEL_DISABLED TunnelStatusLabel = "Disabled" +) + +// All allowed values of TunnelStatusLabel enum +var AllowedTunnelStatusLabelEnumValues = []TunnelStatusLabel{ + "Planned", + "Active", + "Disabled", +} + +func (v *TunnelStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelStatusLabel(value) + for _, existing := range AllowedTunnelStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TunnelStatusLabel", value) +} + +// NewTunnelStatusLabelFromValue returns a pointer to a valid TunnelStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelStatusLabelFromValue(v string) (*TunnelStatusLabel, error) { + ev := TunnelStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelStatusLabel: valid values are %v", v, AllowedTunnelStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelStatusLabel) IsValid() bool { + for _, existing := range AllowedTunnelStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Tunnel_status_label value +func (v TunnelStatusLabel) Ptr() *TunnelStatusLabel { + return &v +} + +type NullableTunnelStatusLabel struct { + value *TunnelStatusLabel + isSet bool +} + +func (v NullableTunnelStatusLabel) Get() *TunnelStatusLabel { + return v.value +} + +func (v *NullableTunnelStatusLabel) Set(val *TunnelStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelStatusLabel(val *TunnelStatusLabel) *NullableTunnelStatusLabel { + return &NullableTunnelStatusLabel{value: val, isSet: true} +} + +func (v NullableTunnelStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination.go new file mode 100644 index 00000000..843d0b44 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination.go @@ -0,0 +1,577 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TunnelTermination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelTermination{} + +// TunnelTermination Adds support for custom fields and tags. +type TunnelTermination struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Tunnel NestedTunnel `json:"tunnel"` + Role TunnelTerminationRole `json:"role"` + TerminationType string `json:"termination_type"` + TerminationId NullableInt64 `json:"termination_id,omitempty"` + Termination interface{} `json:"termination"` + OutsideIp NullableNestedIPAddress `json:"outside_ip,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _TunnelTermination TunnelTermination + +// NewTunnelTermination instantiates a new TunnelTermination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelTermination(id int32, url string, display string, tunnel NestedTunnel, role TunnelTerminationRole, terminationType string, termination interface{}, created NullableTime, lastUpdated NullableTime) *TunnelTermination { + this := TunnelTermination{} + this.Id = id + this.Url = url + this.Display = display + this.Tunnel = tunnel + this.Role = role + this.TerminationType = terminationType + this.Termination = termination + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewTunnelTerminationWithDefaults instantiates a new TunnelTermination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelTerminationWithDefaults() *TunnelTermination { + this := TunnelTermination{} + return &this +} + +// GetId returns the Id field value +func (o *TunnelTermination) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TunnelTermination) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *TunnelTermination) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *TunnelTermination) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *TunnelTermination) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *TunnelTermination) SetDisplay(v string) { + o.Display = v +} + +// GetTunnel returns the Tunnel field value +func (o *TunnelTermination) GetTunnel() NestedTunnel { + if o == nil { + var ret NestedTunnel + return ret + } + + return o.Tunnel +} + +// GetTunnelOk returns a tuple with the Tunnel field value +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetTunnelOk() (*NestedTunnel, bool) { + if o == nil { + return nil, false + } + return &o.Tunnel, true +} + +// SetTunnel sets field value +func (o *TunnelTermination) SetTunnel(v NestedTunnel) { + o.Tunnel = v +} + +// GetRole returns the Role field value +func (o *TunnelTermination) GetRole() TunnelTerminationRole { + if o == nil { + var ret TunnelTerminationRole + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetRoleOk() (*TunnelTerminationRole, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *TunnelTermination) SetRole(v TunnelTerminationRole) { + o.Role = v +} + +// GetTerminationType returns the TerminationType field value +func (o *TunnelTermination) GetTerminationType() string { + if o == nil { + var ret string + return ret + } + + return o.TerminationType +} + +// GetTerminationTypeOk returns a tuple with the TerminationType field value +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetTerminationTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TerminationType, true +} + +// SetTerminationType sets field value +func (o *TunnelTermination) SetTerminationType(v string) { + o.TerminationType = v +} + +// GetTerminationId returns the TerminationId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TunnelTermination) GetTerminationId() int64 { + if o == nil || IsNil(o.TerminationId.Get()) { + var ret int64 + return ret + } + return *o.TerminationId.Get() +} + +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelTermination) GetTerminationIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TerminationId.Get(), o.TerminationId.IsSet() +} + +// HasTerminationId returns a boolean if a field has been set. +func (o *TunnelTermination) HasTerminationId() bool { + if o != nil && o.TerminationId.IsSet() { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given NullableInt64 and assigns it to the TerminationId field. +func (o *TunnelTermination) SetTerminationId(v int64) { + o.TerminationId.Set(&v) +} + +// SetTerminationIdNil sets the value for TerminationId to be an explicit nil +func (o *TunnelTermination) SetTerminationIdNil() { + o.TerminationId.Set(nil) +} + +// UnsetTerminationId ensures that no value is present for TerminationId, not even an explicit nil +func (o *TunnelTermination) UnsetTerminationId() { + o.TerminationId.Unset() +} + +// GetTermination returns the Termination field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *TunnelTermination) GetTermination() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Termination +} + +// GetTerminationOk returns a tuple with the Termination field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelTermination) GetTerminationOk() (*interface{}, bool) { + if o == nil || IsNil(o.Termination) { + return nil, false + } + return &o.Termination, true +} + +// SetTermination sets field value +func (o *TunnelTermination) SetTermination(v interface{}) { + o.Termination = v +} + +// GetOutsideIp returns the OutsideIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TunnelTermination) GetOutsideIp() NestedIPAddress { + if o == nil || IsNil(o.OutsideIp.Get()) { + var ret NestedIPAddress + return ret + } + return *o.OutsideIp.Get() +} + +// GetOutsideIpOk returns a tuple with the OutsideIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelTermination) GetOutsideIpOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.OutsideIp.Get(), o.OutsideIp.IsSet() +} + +// HasOutsideIp returns a boolean if a field has been set. +func (o *TunnelTermination) HasOutsideIp() bool { + if o != nil && o.OutsideIp.IsSet() { + return true + } + + return false +} + +// SetOutsideIp gets a reference to the given NullableNestedIPAddress and assigns it to the OutsideIp field. +func (o *TunnelTermination) SetOutsideIp(v NestedIPAddress) { + o.OutsideIp.Set(&v) +} + +// SetOutsideIpNil sets the value for OutsideIp to be an explicit nil +func (o *TunnelTermination) SetOutsideIpNil() { + o.OutsideIp.Set(nil) +} + +// UnsetOutsideIp ensures that no value is present for OutsideIp, not even an explicit nil +func (o *TunnelTermination) UnsetOutsideIp() { + o.OutsideIp.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TunnelTermination) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TunnelTermination) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *TunnelTermination) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TunnelTermination) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelTermination) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TunnelTermination) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TunnelTermination) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *TunnelTermination) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelTermination) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *TunnelTermination) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *TunnelTermination) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelTermination) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *TunnelTermination) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o TunnelTermination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelTermination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["tunnel"] = o.Tunnel + toSerialize["role"] = o.Role + toSerialize["termination_type"] = o.TerminationType + if o.TerminationId.IsSet() { + toSerialize["termination_id"] = o.TerminationId.Get() + } + if o.Termination != nil { + toSerialize["termination"] = o.Termination + } + if o.OutsideIp.IsSet() { + toSerialize["outside_ip"] = o.OutsideIp.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelTermination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "tunnel", + "role", + "termination_type", + "termination", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTunnelTermination := _TunnelTermination{} + + err = json.Unmarshal(data, &varTunnelTermination) + + if err != nil { + return err + } + + *o = TunnelTermination(varTunnelTermination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "tunnel") + delete(additionalProperties, "role") + delete(additionalProperties, "termination_type") + delete(additionalProperties, "termination_id") + delete(additionalProperties, "termination") + delete(additionalProperties, "outside_ip") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelTermination struct { + value *TunnelTermination + isSet bool +} + +func (v NullableTunnelTermination) Get() *TunnelTermination { + return v.value +} + +func (v *NullableTunnelTermination) Set(val *TunnelTermination) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelTermination) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelTermination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelTermination(val *TunnelTermination) *NullableTunnelTermination { + return &NullableTunnelTermination{value: val, isSet: true} +} + +func (v NullableTunnelTermination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelTermination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_request.go new file mode 100644 index 00000000..4b367e57 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_request.go @@ -0,0 +1,394 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the TunnelTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelTerminationRequest{} + +// TunnelTerminationRequest Adds support for custom fields and tags. +type TunnelTerminationRequest struct { + Tunnel NestedTunnelRequest `json:"tunnel"` + Role PatchedWritableTunnelTerminationRequestRole `json:"role"` + TerminationType string `json:"termination_type"` + TerminationId NullableInt64 `json:"termination_id,omitempty"` + OutsideIp NullableNestedIPAddressRequest `json:"outside_ip,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TunnelTerminationRequest TunnelTerminationRequest + +// NewTunnelTerminationRequest instantiates a new TunnelTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelTerminationRequest(tunnel NestedTunnelRequest, role PatchedWritableTunnelTerminationRequestRole, terminationType string) *TunnelTerminationRequest { + this := TunnelTerminationRequest{} + this.Tunnel = tunnel + this.Role = role + this.TerminationType = terminationType + return &this +} + +// NewTunnelTerminationRequestWithDefaults instantiates a new TunnelTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelTerminationRequestWithDefaults() *TunnelTerminationRequest { + this := TunnelTerminationRequest{} + return &this +} + +// GetTunnel returns the Tunnel field value +func (o *TunnelTerminationRequest) GetTunnel() NestedTunnelRequest { + if o == nil { + var ret NestedTunnelRequest + return ret + } + + return o.Tunnel +} + +// GetTunnelOk returns a tuple with the Tunnel field value +// and a boolean to check if the value has been set. +func (o *TunnelTerminationRequest) GetTunnelOk() (*NestedTunnelRequest, bool) { + if o == nil { + return nil, false + } + return &o.Tunnel, true +} + +// SetTunnel sets field value +func (o *TunnelTerminationRequest) SetTunnel(v NestedTunnelRequest) { + o.Tunnel = v +} + +// GetRole returns the Role field value +func (o *TunnelTerminationRequest) GetRole() PatchedWritableTunnelTerminationRequestRole { + if o == nil { + var ret PatchedWritableTunnelTerminationRequestRole + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *TunnelTerminationRequest) GetRoleOk() (*PatchedWritableTunnelTerminationRequestRole, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *TunnelTerminationRequest) SetRole(v PatchedWritableTunnelTerminationRequestRole) { + o.Role = v +} + +// GetTerminationType returns the TerminationType field value +func (o *TunnelTerminationRequest) GetTerminationType() string { + if o == nil { + var ret string + return ret + } + + return o.TerminationType +} + +// GetTerminationTypeOk returns a tuple with the TerminationType field value +// and a boolean to check if the value has been set. +func (o *TunnelTerminationRequest) GetTerminationTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TerminationType, true +} + +// SetTerminationType sets field value +func (o *TunnelTerminationRequest) SetTerminationType(v string) { + o.TerminationType = v +} + +// GetTerminationId returns the TerminationId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TunnelTerminationRequest) GetTerminationId() int64 { + if o == nil || IsNil(o.TerminationId.Get()) { + var ret int64 + return ret + } + return *o.TerminationId.Get() +} + +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelTerminationRequest) GetTerminationIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TerminationId.Get(), o.TerminationId.IsSet() +} + +// HasTerminationId returns a boolean if a field has been set. +func (o *TunnelTerminationRequest) HasTerminationId() bool { + if o != nil && o.TerminationId.IsSet() { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given NullableInt64 and assigns it to the TerminationId field. +func (o *TunnelTerminationRequest) SetTerminationId(v int64) { + o.TerminationId.Set(&v) +} + +// SetTerminationIdNil sets the value for TerminationId to be an explicit nil +func (o *TunnelTerminationRequest) SetTerminationIdNil() { + o.TerminationId.Set(nil) +} + +// UnsetTerminationId ensures that no value is present for TerminationId, not even an explicit nil +func (o *TunnelTerminationRequest) UnsetTerminationId() { + o.TerminationId.Unset() +} + +// GetOutsideIp returns the OutsideIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TunnelTerminationRequest) GetOutsideIp() NestedIPAddressRequest { + if o == nil || IsNil(o.OutsideIp.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.OutsideIp.Get() +} + +// GetOutsideIpOk returns a tuple with the OutsideIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TunnelTerminationRequest) GetOutsideIpOk() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.OutsideIp.Get(), o.OutsideIp.IsSet() +} + +// HasOutsideIp returns a boolean if a field has been set. +func (o *TunnelTerminationRequest) HasOutsideIp() bool { + if o != nil && o.OutsideIp.IsSet() { + return true + } + + return false +} + +// SetOutsideIp gets a reference to the given NullableNestedIPAddressRequest and assigns it to the OutsideIp field. +func (o *TunnelTerminationRequest) SetOutsideIp(v NestedIPAddressRequest) { + o.OutsideIp.Set(&v) +} + +// SetOutsideIpNil sets the value for OutsideIp to be an explicit nil +func (o *TunnelTerminationRequest) SetOutsideIpNil() { + o.OutsideIp.Set(nil) +} + +// UnsetOutsideIp ensures that no value is present for OutsideIp, not even an explicit nil +func (o *TunnelTerminationRequest) UnsetOutsideIp() { + o.OutsideIp.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *TunnelTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *TunnelTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *TunnelTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *TunnelTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *TunnelTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *TunnelTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o TunnelTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["tunnel"] = o.Tunnel + toSerialize["role"] = o.Role + toSerialize["termination_type"] = o.TerminationType + if o.TerminationId.IsSet() { + toSerialize["termination_id"] = o.TerminationId.Get() + } + if o.OutsideIp.IsSet() { + toSerialize["outside_ip"] = o.OutsideIp.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "tunnel", + "role", + "termination_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTunnelTerminationRequest := _TunnelTerminationRequest{} + + err = json.Unmarshal(data, &varTunnelTerminationRequest) + + if err != nil { + return err + } + + *o = TunnelTerminationRequest(varTunnelTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tunnel") + delete(additionalProperties, "role") + delete(additionalProperties, "termination_type") + delete(additionalProperties, "termination_id") + delete(additionalProperties, "outside_ip") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelTerminationRequest struct { + value *TunnelTerminationRequest + isSet bool +} + +func (v NullableTunnelTerminationRequest) Get() *TunnelTerminationRequest { + return v.value +} + +func (v *NullableTunnelTerminationRequest) Set(val *TunnelTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelTerminationRequest(val *TunnelTerminationRequest) *NullableTunnelTerminationRequest { + return &NullableTunnelTerminationRequest{value: val, isSet: true} +} + +func (v NullableTunnelTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_role.go new file mode 100644 index 00000000..ccf6face --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_role.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the TunnelTerminationRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TunnelTerminationRole{} + +// TunnelTerminationRole struct for TunnelTerminationRole +type TunnelTerminationRole struct { + Value *PatchedWritableTunnelTerminationRequestRole `json:"value,omitempty"` + Label *TunnelTerminationRoleLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TunnelTerminationRole TunnelTerminationRole + +// NewTunnelTerminationRole instantiates a new TunnelTerminationRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTunnelTerminationRole() *TunnelTerminationRole { + this := TunnelTerminationRole{} + return &this +} + +// NewTunnelTerminationRoleWithDefaults instantiates a new TunnelTerminationRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTunnelTerminationRoleWithDefaults() *TunnelTerminationRole { + this := TunnelTerminationRole{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *TunnelTerminationRole) GetValue() PatchedWritableTunnelTerminationRequestRole { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableTunnelTerminationRequestRole + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelTerminationRole) GetValueOk() (*PatchedWritableTunnelTerminationRequestRole, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *TunnelTerminationRole) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableTunnelTerminationRequestRole and assigns it to the Value field. +func (o *TunnelTerminationRole) SetValue(v PatchedWritableTunnelTerminationRequestRole) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *TunnelTerminationRole) GetLabel() TunnelTerminationRoleLabel { + if o == nil || IsNil(o.Label) { + var ret TunnelTerminationRoleLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TunnelTerminationRole) GetLabelOk() (*TunnelTerminationRoleLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *TunnelTerminationRole) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given TunnelTerminationRoleLabel and assigns it to the Label field. +func (o *TunnelTerminationRole) SetLabel(v TunnelTerminationRoleLabel) { + o.Label = &v +} + +func (o TunnelTerminationRole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TunnelTerminationRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TunnelTerminationRole) UnmarshalJSON(data []byte) (err error) { + varTunnelTerminationRole := _TunnelTerminationRole{} + + err = json.Unmarshal(data, &varTunnelTerminationRole) + + if err != nil { + return err + } + + *o = TunnelTerminationRole(varTunnelTerminationRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTunnelTerminationRole struct { + value *TunnelTerminationRole + isSet bool +} + +func (v NullableTunnelTerminationRole) Get() *TunnelTerminationRole { + return v.value +} + +func (v *NullableTunnelTerminationRole) Set(val *TunnelTerminationRole) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelTerminationRole) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelTerminationRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelTerminationRole(val *TunnelTerminationRole) *NullableTunnelTerminationRole { + return &NullableTunnelTerminationRole{value: val, isSet: true} +} + +func (v NullableTunnelTerminationRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelTerminationRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_role_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_role_label.go new file mode 100644 index 00000000..f51f1a7e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_tunnel_termination_role_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// TunnelTerminationRoleLabel the model 'TunnelTerminationRoleLabel' +type TunnelTerminationRoleLabel string + +// List of TunnelTermination_role_label +const ( + TUNNELTERMINATIONROLELABEL_PEER TunnelTerminationRoleLabel = "Peer" + TUNNELTERMINATIONROLELABEL_HUB TunnelTerminationRoleLabel = "Hub" + TUNNELTERMINATIONROLELABEL_SPOKE TunnelTerminationRoleLabel = "Spoke" +) + +// All allowed values of TunnelTerminationRoleLabel enum +var AllowedTunnelTerminationRoleLabelEnumValues = []TunnelTerminationRoleLabel{ + "Peer", + "Hub", + "Spoke", +} + +func (v *TunnelTerminationRoleLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelTerminationRoleLabel(value) + for _, existing := range AllowedTunnelTerminationRoleLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TunnelTerminationRoleLabel", value) +} + +// NewTunnelTerminationRoleLabelFromValue returns a pointer to a valid TunnelTerminationRoleLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelTerminationRoleLabelFromValue(v string) (*TunnelTerminationRoleLabel, error) { + ev := TunnelTerminationRoleLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelTerminationRoleLabel: valid values are %v", v, AllowedTunnelTerminationRoleLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelTerminationRoleLabel) IsValid() bool { + for _, existing := range AllowedTunnelTerminationRoleLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelTermination_role_label value +func (v TunnelTerminationRoleLabel) Ptr() *TunnelTerminationRoleLabel { + return &v +} + +type NullableTunnelTerminationRoleLabel struct { + value *TunnelTerminationRoleLabel + isSet bool +} + +func (v NullableTunnelTerminationRoleLabel) Get() *TunnelTerminationRoleLabel { + return v.value +} + +func (v *NullableTunnelTerminationRoleLabel) Set(val *TunnelTerminationRoleLabel) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelTerminationRoleLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelTerminationRoleLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelTerminationRoleLabel(val *TunnelTerminationRoleLabel) *NullableTunnelTerminationRoleLabel { + return &NullableTunnelTerminationRoleLabel{value: val, isSet: true} +} + +func (v NullableTunnelTerminationRoleLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelTerminationRoleLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_user.go b/vendor/github.com/netbox-community/go-netbox/v3/model_user.go new file mode 100644 index 00000000..d1969f56 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_user.go @@ -0,0 +1,516 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type User struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + // Designates whether the user can log into this admin site. + IsStaff *bool `json:"is_staff,omitempty"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + DateJoined *time.Time `json:"date_joined,omitempty"` + Groups []int32 `json:"groups,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser(id int32, url string, display string, username string) *User { + this := User{} + this.Id = id + this.Url = url + this.Display = display + this.Username = username + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetId returns the Id field value +func (o *User) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *User) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *User) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *User) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *User) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *User) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *User) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *User) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *User) SetDisplay(v string) { + o.Display = v +} + +// GetUsername returns the Username field value +func (o *User) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *User) SetUsername(v string) { + o.Username = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetIsStaff returns the IsStaff field value if set, zero value otherwise. +func (o *User) GetIsStaff() bool { + if o == nil || IsNil(o.IsStaff) { + var ret bool + return ret + } + return *o.IsStaff +} + +// GetIsStaffOk returns a tuple with the IsStaff field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIsStaffOk() (*bool, bool) { + if o == nil || IsNil(o.IsStaff) { + return nil, false + } + return o.IsStaff, true +} + +// HasIsStaff returns a boolean if a field has been set. +func (o *User) HasIsStaff() bool { + if o != nil && !IsNil(o.IsStaff) { + return true + } + + return false +} + +// SetIsStaff gets a reference to the given bool and assigns it to the IsStaff field. +func (o *User) SetIsStaff(v bool) { + o.IsStaff = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *User) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *User) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *User) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetDateJoined returns the DateJoined field value if set, zero value otherwise. +func (o *User) GetDateJoined() time.Time { + if o == nil || IsNil(o.DateJoined) { + var ret time.Time + return ret + } + return *o.DateJoined +} + +// GetDateJoinedOk returns a tuple with the DateJoined field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetDateJoinedOk() (*time.Time, bool) { + if o == nil || IsNil(o.DateJoined) { + return nil, false + } + return o.DateJoined, true +} + +// HasDateJoined returns a boolean if a field has been set. +func (o *User) HasDateJoined() bool { + if o != nil && !IsNil(o.DateJoined) { + return true + } + + return false +} + +// SetDateJoined gets a reference to the given time.Time and assigns it to the DateJoined field. +func (o *User) SetDateJoined(v time.Time) { + o.DateJoined = &v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *User) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *User) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *User) SetGroups(v []int32) { + o.Groups = v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["username"] = o.Username + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.IsStaff) { + toSerialize["is_staff"] = o.IsStaff + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.DateJoined) { + toSerialize["date_joined"] = o.DateJoined + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *User) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUser := _User{} + + err = json.Unmarshal(data, &varUser) + + if err != nil { + return err + } + + *o = User(varUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "username") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "email") + delete(additionalProperties, "is_staff") + delete(additionalProperties, "is_active") + delete(additionalProperties, "date_joined") + delete(additionalProperties, "groups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_user_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_user_request.go new file mode 100644 index 00000000..59a6fa97 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_user_request.go @@ -0,0 +1,458 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserRequest{} + +// UserRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type UserRequest struct { + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username"` + Password string `json:"password"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + // Designates whether the user can log into this admin site. + IsStaff *bool `json:"is_staff,omitempty"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + DateJoined *time.Time `json:"date_joined,omitempty"` + Groups []int32 `json:"groups,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserRequest UserRequest + +// NewUserRequest instantiates a new UserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserRequest(username string, password string) *UserRequest { + this := UserRequest{} + this.Username = username + this.Password = password + return &this +} + +// NewUserRequestWithDefaults instantiates a new UserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserRequestWithDefaults() *UserRequest { + this := UserRequest{} + return &this +} + +// GetUsername returns the Username field value +func (o *UserRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *UserRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *UserRequest) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *UserRequest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *UserRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *UserRequest) SetPassword(v string) { + o.Password = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *UserRequest) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *UserRequest) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *UserRequest) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *UserRequest) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *UserRequest) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *UserRequest) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *UserRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *UserRequest) SetEmail(v string) { + o.Email = &v +} + +// GetIsStaff returns the IsStaff field value if set, zero value otherwise. +func (o *UserRequest) GetIsStaff() bool { + if o == nil || IsNil(o.IsStaff) { + var ret bool + return ret + } + return *o.IsStaff +} + +// GetIsStaffOk returns a tuple with the IsStaff field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetIsStaffOk() (*bool, bool) { + if o == nil || IsNil(o.IsStaff) { + return nil, false + } + return o.IsStaff, true +} + +// HasIsStaff returns a boolean if a field has been set. +func (o *UserRequest) HasIsStaff() bool { + if o != nil && !IsNil(o.IsStaff) { + return true + } + + return false +} + +// SetIsStaff gets a reference to the given bool and assigns it to the IsStaff field. +func (o *UserRequest) SetIsStaff(v bool) { + o.IsStaff = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *UserRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *UserRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *UserRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetDateJoined returns the DateJoined field value if set, zero value otherwise. +func (o *UserRequest) GetDateJoined() time.Time { + if o == nil || IsNil(o.DateJoined) { + var ret time.Time + return ret + } + return *o.DateJoined +} + +// GetDateJoinedOk returns a tuple with the DateJoined field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetDateJoinedOk() (*time.Time, bool) { + if o == nil || IsNil(o.DateJoined) { + return nil, false + } + return o.DateJoined, true +} + +// HasDateJoined returns a boolean if a field has been set. +func (o *UserRequest) HasDateJoined() bool { + if o != nil && !IsNil(o.DateJoined) { + return true + } + + return false +} + +// SetDateJoined gets a reference to the given time.Time and assigns it to the DateJoined field. +func (o *UserRequest) SetDateJoined(v time.Time) { + o.DateJoined = &v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *UserRequest) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *UserRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *UserRequest) SetGroups(v []int32) { + o.Groups = v +} + +func (o UserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.IsStaff) { + toSerialize["is_staff"] = o.IsStaff + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.DateJoined) { + toSerialize["date_joined"] = o.DateJoined + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "username", + "password", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserRequest := _UserRequest{} + + err = json.Unmarshal(data, &varUserRequest) + + if err != nil { + return err + } + + *o = UserRequest(varUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "email") + delete(additionalProperties, "is_staff") + delete(additionalProperties, "is_active") + delete(additionalProperties, "date_joined") + delete(additionalProperties, "groups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserRequest struct { + value *UserRequest + isSet bool +} + +func (v NullableUserRequest) Get() *UserRequest { + return v.value +} + +func (v *NullableUserRequest) Set(val *UserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRequest(val *UserRequest) *NullableUserRequest { + return &NullableUserRequest{value: val, isSet: true} +} + +func (v NullableUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_chassis.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_chassis.go new file mode 100644 index 00000000..9f63e78c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_chassis.go @@ -0,0 +1,578 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VirtualChassis type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualChassis{} + +// VirtualChassis Adds support for custom fields and tags. +type VirtualChassis struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Domain *string `json:"domain,omitempty"` + Master NullableNestedDevice `json:"master,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + MemberCount int32 `json:"member_count"` + AdditionalProperties map[string]interface{} +} + +type _VirtualChassis VirtualChassis + +// NewVirtualChassis instantiates a new VirtualChassis object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualChassis(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime, memberCount int32) *VirtualChassis { + this := VirtualChassis{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + this.MemberCount = memberCount + return &this +} + +// NewVirtualChassisWithDefaults instantiates a new VirtualChassis object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualChassisWithDefaults() *VirtualChassis { + this := VirtualChassis{} + return &this +} + +// GetId returns the Id field value +func (o *VirtualChassis) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VirtualChassis) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VirtualChassis) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VirtualChassis) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *VirtualChassis) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *VirtualChassis) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *VirtualChassis) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualChassis) SetName(v string) { + o.Name = v +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *VirtualChassis) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *VirtualChassis) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *VirtualChassis) SetDomain(v string) { + o.Domain = &v +} + +// GetMaster returns the Master field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualChassis) GetMaster() NestedDevice { + if o == nil || IsNil(o.Master.Get()) { + var ret NestedDevice + return ret + } + return *o.Master.Get() +} + +// GetMasterOk returns a tuple with the Master field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualChassis) GetMasterOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return o.Master.Get(), o.Master.IsSet() +} + +// HasMaster returns a boolean if a field has been set. +func (o *VirtualChassis) HasMaster() bool { + if o != nil && o.Master.IsSet() { + return true + } + + return false +} + +// SetMaster gets a reference to the given NullableNestedDevice and assigns it to the Master field. +func (o *VirtualChassis) SetMaster(v NestedDevice) { + o.Master.Set(&v) +} + +// SetMasterNil sets the value for Master to be an explicit nil +func (o *VirtualChassis) SetMasterNil() { + o.Master.Set(nil) +} + +// UnsetMaster ensures that no value is present for Master, not even an explicit nil +func (o *VirtualChassis) UnsetMaster() { + o.Master.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualChassis) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualChassis) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualChassis) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VirtualChassis) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VirtualChassis) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VirtualChassis) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualChassis) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualChassis) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VirtualChassis) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualChassis) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualChassis) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualChassis) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualChassis) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualChassis) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VirtualChassis) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualChassis) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualChassis) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VirtualChassis) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetMemberCount returns the MemberCount field value +func (o *VirtualChassis) GetMemberCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MemberCount +} + +// GetMemberCountOk returns a tuple with the MemberCount field value +// and a boolean to check if the value has been set. +func (o *VirtualChassis) GetMemberCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MemberCount, true +} + +// SetMemberCount sets field value +func (o *VirtualChassis) SetMemberCount(v int32) { + o.MemberCount = v +} + +func (o VirtualChassis) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualChassis) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if o.Master.IsSet() { + toSerialize["master"] = o.Master.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["member_count"] = o.MemberCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualChassis) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + "member_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualChassis := _VirtualChassis{} + + err = json.Unmarshal(data, &varVirtualChassis) + + if err != nil { + return err + } + + *o = VirtualChassis(varVirtualChassis) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "domain") + delete(additionalProperties, "master") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "member_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualChassis struct { + value *VirtualChassis + isSet bool +} + +func (v NullableVirtualChassis) Get() *VirtualChassis { + return v.value +} + +func (v *NullableVirtualChassis) Set(val *VirtualChassis) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualChassis) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualChassis) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualChassis(val *VirtualChassis) *NullableVirtualChassis { + return &NullableVirtualChassis{value: val, isSet: true} +} + +func (v NullableVirtualChassis) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualChassis) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_chassis_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_chassis_request.go new file mode 100644 index 00000000..2de73798 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_chassis_request.go @@ -0,0 +1,399 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VirtualChassisRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualChassisRequest{} + +// VirtualChassisRequest Adds support for custom fields and tags. +type VirtualChassisRequest struct { + Name string `json:"name"` + Domain *string `json:"domain,omitempty"` + Master NullableNestedDeviceRequest `json:"master,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualChassisRequest VirtualChassisRequest + +// NewVirtualChassisRequest instantiates a new VirtualChassisRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualChassisRequest(name string) *VirtualChassisRequest { + this := VirtualChassisRequest{} + this.Name = name + return &this +} + +// NewVirtualChassisRequestWithDefaults instantiates a new VirtualChassisRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualChassisRequestWithDefaults() *VirtualChassisRequest { + this := VirtualChassisRequest{} + return &this +} + +// GetName returns the Name field value +func (o *VirtualChassisRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualChassisRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualChassisRequest) SetName(v string) { + o.Name = v +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *VirtualChassisRequest) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassisRequest) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *VirtualChassisRequest) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *VirtualChassisRequest) SetDomain(v string) { + o.Domain = &v +} + +// GetMaster returns the Master field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualChassisRequest) GetMaster() NestedDeviceRequest { + if o == nil || IsNil(o.Master.Get()) { + var ret NestedDeviceRequest + return ret + } + return *o.Master.Get() +} + +// GetMasterOk returns a tuple with the Master field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualChassisRequest) GetMasterOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return o.Master.Get(), o.Master.IsSet() +} + +// HasMaster returns a boolean if a field has been set. +func (o *VirtualChassisRequest) HasMaster() bool { + if o != nil && o.Master.IsSet() { + return true + } + + return false +} + +// SetMaster gets a reference to the given NullableNestedDeviceRequest and assigns it to the Master field. +func (o *VirtualChassisRequest) SetMaster(v NestedDeviceRequest) { + o.Master.Set(&v) +} + +// SetMasterNil sets the value for Master to be an explicit nil +func (o *VirtualChassisRequest) SetMasterNil() { + o.Master.Set(nil) +} + +// UnsetMaster ensures that no value is present for Master, not even an explicit nil +func (o *VirtualChassisRequest) UnsetMaster() { + o.Master.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualChassisRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassisRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualChassisRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualChassisRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VirtualChassisRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassisRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VirtualChassisRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VirtualChassisRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualChassisRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassisRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualChassisRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VirtualChassisRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualChassisRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualChassisRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualChassisRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualChassisRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VirtualChassisRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualChassisRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if o.Master.IsSet() { + toSerialize["master"] = o.Master.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualChassisRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualChassisRequest := _VirtualChassisRequest{} + + err = json.Unmarshal(data, &varVirtualChassisRequest) + + if err != nil { + return err + } + + *o = VirtualChassisRequest(varVirtualChassisRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "domain") + delete(additionalProperties, "master") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualChassisRequest struct { + value *VirtualChassisRequest + isSet bool +} + +func (v NullableVirtualChassisRequest) Get() *VirtualChassisRequest { + return v.value +} + +func (v *NullableVirtualChassisRequest) Set(val *VirtualChassisRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualChassisRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualChassisRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualChassisRequest(val *VirtualChassisRequest) *NullableVirtualChassisRequest { + return &NullableVirtualChassisRequest{value: val, isSet: true} +} + +func (v NullableVirtualChassisRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualChassisRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context.go new file mode 100644 index 00000000..24a54f01 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context.go @@ -0,0 +1,775 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VirtualDeviceContext type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualDeviceContext{} + +// VirtualDeviceContext Adds support for custom fields and tags. +type VirtualDeviceContext struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Device NestedDevice `json:"device"` + // Numeric identifier unique to the parent device + Identifier NullableInt32 `json:"identifier,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + PrimaryIp NullableNestedIPAddress `json:"primary_ip"` + PrimaryIp4 NullableNestedIPAddress `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableNestedIPAddress `json:"primary_ip6,omitempty"` + Status VirtualDeviceContextStatus `json:"status"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + InterfaceCount int32 `json:"interface_count"` + AdditionalProperties map[string]interface{} +} + +type _VirtualDeviceContext VirtualDeviceContext + +// NewVirtualDeviceContext instantiates a new VirtualDeviceContext object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualDeviceContext(id int32, url string, display string, name string, device NestedDevice, primaryIp NullableNestedIPAddress, status VirtualDeviceContextStatus, created NullableTime, lastUpdated NullableTime, interfaceCount int32) *VirtualDeviceContext { + this := VirtualDeviceContext{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Device = device + this.PrimaryIp = primaryIp + this.Status = status + this.Created = created + this.LastUpdated = lastUpdated + this.InterfaceCount = interfaceCount + return &this +} + +// NewVirtualDeviceContextWithDefaults instantiates a new VirtualDeviceContext object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualDeviceContextWithDefaults() *VirtualDeviceContext { + this := VirtualDeviceContext{} + return &this +} + +// GetId returns the Id field value +func (o *VirtualDeviceContext) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VirtualDeviceContext) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VirtualDeviceContext) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VirtualDeviceContext) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *VirtualDeviceContext) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *VirtualDeviceContext) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *VirtualDeviceContext) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualDeviceContext) SetName(v string) { + o.Name = v +} + +// GetDevice returns the Device field value +func (o *VirtualDeviceContext) GetDevice() NestedDevice { + if o == nil { + var ret NestedDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *VirtualDeviceContext) SetDevice(v NestedDevice) { + o.Device = v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContext) GetIdentifier() int32 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int32 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContext) GetIdentifierOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt32 and assigns it to the Identifier field. +func (o *VirtualDeviceContext) SetIdentifier(v int32) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *VirtualDeviceContext) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *VirtualDeviceContext) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContext) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContext) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *VirtualDeviceContext) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VirtualDeviceContext) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VirtualDeviceContext) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPrimaryIp returns the PrimaryIp field value +// If the value is explicit nil, the zero value for NestedIPAddress will be returned +func (o *VirtualDeviceContext) GetPrimaryIp() NestedIPAddress { + if o == nil || o.PrimaryIp.Get() == nil { + var ret NestedIPAddress + return ret + } + + return *o.PrimaryIp.Get() +} + +// GetPrimaryIpOk returns a tuple with the PrimaryIp field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContext) GetPrimaryIpOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp.Get(), o.PrimaryIp.IsSet() +} + +// SetPrimaryIp sets field value +func (o *VirtualDeviceContext) SetPrimaryIp(v NestedIPAddress) { + o.PrimaryIp.Set(&v) +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContext) GetPrimaryIp4() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContext) GetPrimaryIp4Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp4 field. +func (o *VirtualDeviceContext) SetPrimaryIp4(v NestedIPAddress) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *VirtualDeviceContext) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *VirtualDeviceContext) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContext) GetPrimaryIp6() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContext) GetPrimaryIp6Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp6 field. +func (o *VirtualDeviceContext) SetPrimaryIp6(v NestedIPAddress) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *VirtualDeviceContext) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *VirtualDeviceContext) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetStatus returns the Status field value +func (o *VirtualDeviceContext) GetStatus() VirtualDeviceContextStatus { + if o == nil { + var ret VirtualDeviceContextStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetStatusOk() (*VirtualDeviceContextStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *VirtualDeviceContext) SetStatus(v VirtualDeviceContextStatus) { + o.Status = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualDeviceContext) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualDeviceContext) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VirtualDeviceContext) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VirtualDeviceContext) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualDeviceContext) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VirtualDeviceContext) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualDeviceContext) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualDeviceContext) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualDeviceContext) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContext) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VirtualDeviceContext) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualDeviceContext) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContext) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VirtualDeviceContext) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetInterfaceCount returns the InterfaceCount field value +func (o *VirtualDeviceContext) GetInterfaceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InterfaceCount +} + +// GetInterfaceCountOk returns a tuple with the InterfaceCount field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContext) GetInterfaceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceCount, true +} + +// SetInterfaceCount sets field value +func (o *VirtualDeviceContext) SetInterfaceCount(v int32) { + o.InterfaceCount = v +} + +func (o VirtualDeviceContext) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualDeviceContext) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["device"] = o.Device + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + toSerialize["primary_ip"] = o.PrimaryIp.Get() + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + toSerialize["status"] = o.Status + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["interface_count"] = o.InterfaceCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualDeviceContext) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "device", + "primary_ip", + "status", + "created", + "last_updated", + "interface_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualDeviceContext := _VirtualDeviceContext{} + + err = json.Unmarshal(data, &varVirtualDeviceContext) + + if err != nil { + return err + } + + *o = VirtualDeviceContext(varVirtualDeviceContext) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "device") + delete(additionalProperties, "identifier") + delete(additionalProperties, "tenant") + delete(additionalProperties, "primary_ip") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "status") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "interface_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualDeviceContext struct { + value *VirtualDeviceContext + isSet bool +} + +func (v NullableVirtualDeviceContext) Get() *VirtualDeviceContext { + return v.value +} + +func (v *NullableVirtualDeviceContext) Set(val *VirtualDeviceContext) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualDeviceContext) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualDeviceContext) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualDeviceContext(val *VirtualDeviceContext) *NullableVirtualDeviceContext { + return &NullableVirtualDeviceContext{value: val, isSet: true} +} + +func (v NullableVirtualDeviceContext) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualDeviceContext) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_request.go new file mode 100644 index 00000000..d4d77e7f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_request.go @@ -0,0 +1,565 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VirtualDeviceContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualDeviceContextRequest{} + +// VirtualDeviceContextRequest Adds support for custom fields and tags. +type VirtualDeviceContextRequest struct { + Name string `json:"name"` + Device NestedDeviceRequest `json:"device"` + // Numeric identifier unique to the parent device + Identifier NullableInt32 `json:"identifier,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + PrimaryIp4 NullableNestedIPAddressRequest `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableNestedIPAddressRequest `json:"primary_ip6,omitempty"` + Status PatchedWritableVirtualDeviceContextRequestStatus `json:"status"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualDeviceContextRequest VirtualDeviceContextRequest + +// NewVirtualDeviceContextRequest instantiates a new VirtualDeviceContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualDeviceContextRequest(name string, device NestedDeviceRequest, status PatchedWritableVirtualDeviceContextRequestStatus) *VirtualDeviceContextRequest { + this := VirtualDeviceContextRequest{} + this.Name = name + this.Device = device + this.Status = status + return &this +} + +// NewVirtualDeviceContextRequestWithDefaults instantiates a new VirtualDeviceContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualDeviceContextRequestWithDefaults() *VirtualDeviceContextRequest { + this := VirtualDeviceContextRequest{} + return &this +} + +// GetName returns the Name field value +func (o *VirtualDeviceContextRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualDeviceContextRequest) SetName(v string) { + o.Name = v +} + +// GetDevice returns the Device field value +func (o *VirtualDeviceContextRequest) GetDevice() NestedDeviceRequest { + if o == nil { + var ret NestedDeviceRequest + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *VirtualDeviceContextRequest) SetDevice(v NestedDeviceRequest) { + o.Device = v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContextRequest) GetIdentifier() int32 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int32 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContextRequest) GetIdentifierOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt32 and assigns it to the Identifier field. +func (o *VirtualDeviceContextRequest) SetIdentifier(v int32) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *VirtualDeviceContextRequest) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *VirtualDeviceContextRequest) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContextRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContextRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *VirtualDeviceContextRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VirtualDeviceContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VirtualDeviceContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContextRequest) GetPrimaryIp4() NestedIPAddressRequest { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContextRequest) GetPrimaryIp4Ok() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableNestedIPAddressRequest and assigns it to the PrimaryIp4 field. +func (o *VirtualDeviceContextRequest) SetPrimaryIp4(v NestedIPAddressRequest) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *VirtualDeviceContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *VirtualDeviceContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualDeviceContextRequest) GetPrimaryIp6() NestedIPAddressRequest { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDeviceContextRequest) GetPrimaryIp6Ok() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableNestedIPAddressRequest and assigns it to the PrimaryIp6 field. +func (o *VirtualDeviceContextRequest) SetPrimaryIp6(v NestedIPAddressRequest) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *VirtualDeviceContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *VirtualDeviceContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetStatus returns the Status field value +func (o *VirtualDeviceContextRequest) GetStatus() PatchedWritableVirtualDeviceContextRequestStatus { + if o == nil { + var ret PatchedWritableVirtualDeviceContextRequestStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextRequest) GetStatusOk() (*PatchedWritableVirtualDeviceContextRequestStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *VirtualDeviceContextRequest) SetStatus(v PatchedWritableVirtualDeviceContextRequestStatus) { + o.Status = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualDeviceContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualDeviceContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VirtualDeviceContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VirtualDeviceContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualDeviceContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VirtualDeviceContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualDeviceContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualDeviceContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualDeviceContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VirtualDeviceContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualDeviceContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["device"] = o.Device + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + toSerialize["status"] = o.Status + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualDeviceContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "device", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualDeviceContextRequest := _VirtualDeviceContextRequest{} + + err = json.Unmarshal(data, &varVirtualDeviceContextRequest) + + if err != nil { + return err + } + + *o = VirtualDeviceContextRequest(varVirtualDeviceContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "device") + delete(additionalProperties, "identifier") + delete(additionalProperties, "tenant") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "status") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualDeviceContextRequest struct { + value *VirtualDeviceContextRequest + isSet bool +} + +func (v NullableVirtualDeviceContextRequest) Get() *VirtualDeviceContextRequest { + return v.value +} + +func (v *NullableVirtualDeviceContextRequest) Set(val *VirtualDeviceContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualDeviceContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualDeviceContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualDeviceContextRequest(val *VirtualDeviceContextRequest) *NullableVirtualDeviceContextRequest { + return &NullableVirtualDeviceContextRequest{value: val, isSet: true} +} + +func (v NullableVirtualDeviceContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualDeviceContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_status.go new file mode 100644 index 00000000..d7bb9fb3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the VirtualDeviceContextStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualDeviceContextStatus{} + +// VirtualDeviceContextStatus struct for VirtualDeviceContextStatus +type VirtualDeviceContextStatus struct { + Value *PatchedWritableVirtualDeviceContextRequestStatus `json:"value,omitempty"` + Label *VirtualDeviceContextStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualDeviceContextStatus VirtualDeviceContextStatus + +// NewVirtualDeviceContextStatus instantiates a new VirtualDeviceContextStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualDeviceContextStatus() *VirtualDeviceContextStatus { + this := VirtualDeviceContextStatus{} + return &this +} + +// NewVirtualDeviceContextStatusWithDefaults instantiates a new VirtualDeviceContextStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualDeviceContextStatusWithDefaults() *VirtualDeviceContextStatus { + this := VirtualDeviceContextStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *VirtualDeviceContextStatus) GetValue() PatchedWritableVirtualDeviceContextRequestStatus { + if o == nil || IsNil(o.Value) { + var ret PatchedWritableVirtualDeviceContextRequestStatus + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextStatus) GetValueOk() (*PatchedWritableVirtualDeviceContextRequestStatus, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *VirtualDeviceContextStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PatchedWritableVirtualDeviceContextRequestStatus and assigns it to the Value field. +func (o *VirtualDeviceContextStatus) SetValue(v PatchedWritableVirtualDeviceContextRequestStatus) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *VirtualDeviceContextStatus) GetLabel() VirtualDeviceContextStatusLabel { + if o == nil || IsNil(o.Label) { + var ret VirtualDeviceContextStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDeviceContextStatus) GetLabelOk() (*VirtualDeviceContextStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *VirtualDeviceContextStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given VirtualDeviceContextStatusLabel and assigns it to the Label field. +func (o *VirtualDeviceContextStatus) SetLabel(v VirtualDeviceContextStatusLabel) { + o.Label = &v +} + +func (o VirtualDeviceContextStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualDeviceContextStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualDeviceContextStatus) UnmarshalJSON(data []byte) (err error) { + varVirtualDeviceContextStatus := _VirtualDeviceContextStatus{} + + err = json.Unmarshal(data, &varVirtualDeviceContextStatus) + + if err != nil { + return err + } + + *o = VirtualDeviceContextStatus(varVirtualDeviceContextStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualDeviceContextStatus struct { + value *VirtualDeviceContextStatus + isSet bool +} + +func (v NullableVirtualDeviceContextStatus) Get() *VirtualDeviceContextStatus { + return v.value +} + +func (v *NullableVirtualDeviceContextStatus) Set(val *VirtualDeviceContextStatus) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualDeviceContextStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualDeviceContextStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualDeviceContextStatus(val *VirtualDeviceContextStatus) *NullableVirtualDeviceContextStatus { + return &NullableVirtualDeviceContextStatus{value: val, isSet: true} +} + +func (v NullableVirtualDeviceContextStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualDeviceContextStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_status_label.go new file mode 100644 index 00000000..090353e1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_device_context_status_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// VirtualDeviceContextStatusLabel the model 'VirtualDeviceContextStatusLabel' +type VirtualDeviceContextStatusLabel string + +// List of VirtualDeviceContext_status_label +const ( + VIRTUALDEVICECONTEXTSTATUSLABEL_ACTIVE VirtualDeviceContextStatusLabel = "Active" + VIRTUALDEVICECONTEXTSTATUSLABEL_PLANNED VirtualDeviceContextStatusLabel = "Planned" + VIRTUALDEVICECONTEXTSTATUSLABEL_OFFLINE VirtualDeviceContextStatusLabel = "Offline" +) + +// All allowed values of VirtualDeviceContextStatusLabel enum +var AllowedVirtualDeviceContextStatusLabelEnumValues = []VirtualDeviceContextStatusLabel{ + "Active", + "Planned", + "Offline", +} + +func (v *VirtualDeviceContextStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VirtualDeviceContextStatusLabel(value) + for _, existing := range AllowedVirtualDeviceContextStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VirtualDeviceContextStatusLabel", value) +} + +// NewVirtualDeviceContextStatusLabelFromValue returns a pointer to a valid VirtualDeviceContextStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVirtualDeviceContextStatusLabelFromValue(v string) (*VirtualDeviceContextStatusLabel, error) { + ev := VirtualDeviceContextStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VirtualDeviceContextStatusLabel: valid values are %v", v, AllowedVirtualDeviceContextStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VirtualDeviceContextStatusLabel) IsValid() bool { + for _, existing := range AllowedVirtualDeviceContextStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VirtualDeviceContext_status_label value +func (v VirtualDeviceContextStatusLabel) Ptr() *VirtualDeviceContextStatusLabel { + return &v +} + +type NullableVirtualDeviceContextStatusLabel struct { + value *VirtualDeviceContextStatusLabel + isSet bool +} + +func (v NullableVirtualDeviceContextStatusLabel) Get() *VirtualDeviceContextStatusLabel { + return v.value +} + +func (v *NullableVirtualDeviceContextStatusLabel) Set(val *VirtualDeviceContextStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualDeviceContextStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualDeviceContextStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualDeviceContextStatusLabel(val *VirtualDeviceContextStatusLabel) *NullableVirtualDeviceContextStatusLabel { + return &NullableVirtualDeviceContextStatusLabel{value: val, isSet: true} +} + +func (v NullableVirtualDeviceContextStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualDeviceContextStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_disk.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_disk.go new file mode 100644 index 00000000..5d13b4ad --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_disk.go @@ -0,0 +1,456 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VirtualDisk type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualDisk{} + +// VirtualDisk Adds support for custom fields and tags. +type VirtualDisk struct { + Id int32 `json:"id"` + Url string `json:"url"` + VirtualMachine NestedVirtualMachine `json:"virtual_machine"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Size int32 `json:"size"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _VirtualDisk VirtualDisk + +// NewVirtualDisk instantiates a new VirtualDisk object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualDisk(id int32, url string, virtualMachine NestedVirtualMachine, name string, size int32, created NullableTime, lastUpdated NullableTime) *VirtualDisk { + this := VirtualDisk{} + this.Id = id + this.Url = url + this.VirtualMachine = virtualMachine + this.Name = name + this.Size = size + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewVirtualDiskWithDefaults instantiates a new VirtualDisk object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualDiskWithDefaults() *VirtualDisk { + this := VirtualDisk{} + return &this +} + +// GetId returns the Id field value +func (o *VirtualDisk) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VirtualDisk) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VirtualDisk) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VirtualDisk) SetUrl(v string) { + o.Url = v +} + +// GetVirtualMachine returns the VirtualMachine field value +func (o *VirtualDisk) GetVirtualMachine() NestedVirtualMachine { + if o == nil { + var ret NestedVirtualMachine + return ret + } + + return o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetVirtualMachineOk() (*NestedVirtualMachine, bool) { + if o == nil { + return nil, false + } + return &o.VirtualMachine, true +} + +// SetVirtualMachine sets field value +func (o *VirtualDisk) SetVirtualMachine(v NestedVirtualMachine) { + o.VirtualMachine = v +} + +// GetName returns the Name field value +func (o *VirtualDisk) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualDisk) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualDisk) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualDisk) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualDisk) SetDescription(v string) { + o.Description = &v +} + +// GetSize returns the Size field value +func (o *VirtualDisk) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *VirtualDisk) SetSize(v int32) { + o.Size = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualDisk) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualDisk) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VirtualDisk) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualDisk) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDisk) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualDisk) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualDisk) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualDisk) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDisk) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VirtualDisk) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualDisk) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualDisk) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VirtualDisk) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o VirtualDisk) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualDisk) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["virtual_machine"] = o.VirtualMachine + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["size"] = o.Size + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualDisk) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "virtual_machine", + "name", + "size", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualDisk := _VirtualDisk{} + + err = json.Unmarshal(data, &varVirtualDisk) + + if err != nil { + return err + } + + *o = VirtualDisk(varVirtualDisk) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "size") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualDisk struct { + value *VirtualDisk + isSet bool +} + +func (v NullableVirtualDisk) Get() *VirtualDisk { + return v.value +} + +func (v *NullableVirtualDisk) Set(val *VirtualDisk) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualDisk) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualDisk) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualDisk(val *VirtualDisk) *NullableVirtualDisk { + return &NullableVirtualDisk{value: val, isSet: true} +} + +func (v NullableVirtualDisk) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualDisk) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_disk_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_disk_request.go new file mode 100644 index 00000000..9b2accc7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_disk_request.go @@ -0,0 +1,335 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VirtualDiskRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualDiskRequest{} + +// VirtualDiskRequest Adds support for custom fields and tags. +type VirtualDiskRequest struct { + VirtualMachine NestedVirtualMachineRequest `json:"virtual_machine"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Size int32 `json:"size"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualDiskRequest VirtualDiskRequest + +// NewVirtualDiskRequest instantiates a new VirtualDiskRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualDiskRequest(virtualMachine NestedVirtualMachineRequest, name string, size int32) *VirtualDiskRequest { + this := VirtualDiskRequest{} + this.VirtualMachine = virtualMachine + this.Name = name + this.Size = size + return &this +} + +// NewVirtualDiskRequestWithDefaults instantiates a new VirtualDiskRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualDiskRequestWithDefaults() *VirtualDiskRequest { + this := VirtualDiskRequest{} + return &this +} + +// GetVirtualMachine returns the VirtualMachine field value +func (o *VirtualDiskRequest) GetVirtualMachine() NestedVirtualMachineRequest { + if o == nil { + var ret NestedVirtualMachineRequest + return ret + } + + return o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value +// and a boolean to check if the value has been set. +func (o *VirtualDiskRequest) GetVirtualMachineOk() (*NestedVirtualMachineRequest, bool) { + if o == nil { + return nil, false + } + return &o.VirtualMachine, true +} + +// SetVirtualMachine sets field value +func (o *VirtualDiskRequest) SetVirtualMachine(v NestedVirtualMachineRequest) { + o.VirtualMachine = v +} + +// GetName returns the Name field value +func (o *VirtualDiskRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualDiskRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualDiskRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualDiskRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDiskRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualDiskRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualDiskRequest) SetDescription(v string) { + o.Description = &v +} + +// GetSize returns the Size field value +func (o *VirtualDiskRequest) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *VirtualDiskRequest) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *VirtualDiskRequest) SetSize(v int32) { + o.Size = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualDiskRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDiskRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualDiskRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VirtualDiskRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualDiskRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualDiskRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualDiskRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualDiskRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VirtualDiskRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualDiskRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["virtual_machine"] = o.VirtualMachine + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["size"] = o.Size + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualDiskRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "virtual_machine", + "name", + "size", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualDiskRequest := _VirtualDiskRequest{} + + err = json.Unmarshal(data, &varVirtualDiskRequest) + + if err != nil { + return err + } + + *o = VirtualDiskRequest(varVirtualDiskRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "size") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualDiskRequest struct { + value *VirtualDiskRequest + isSet bool +} + +func (v NullableVirtualDiskRequest) Get() *VirtualDiskRequest { + return v.value +} + +func (v *NullableVirtualDiskRequest) Set(val *VirtualDiskRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualDiskRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualDiskRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualDiskRequest(val *VirtualDiskRequest) *NullableVirtualDiskRequest { + return &NullableVirtualDiskRequest{value: val, isSet: true} +} + +func (v NullableVirtualDiskRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualDiskRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_machine_with_config_context.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_machine_with_config_context.go new file mode 100644 index 00000000..2187c8fb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_machine_with_config_context.go @@ -0,0 +1,1190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VirtualMachineWithConfigContext type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualMachineWithConfigContext{} + +// VirtualMachineWithConfigContext Adds support for custom fields and tags. +type VirtualMachineWithConfigContext struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Status *ModuleStatus `json:"status,omitempty"` + Site NullableNestedSite `json:"site,omitempty"` + Cluster NullableNestedCluster `json:"cluster,omitempty"` + Device NullableNestedDevice `json:"device,omitempty"` + Role NullableNestedDeviceRole `json:"role,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Platform NullableNestedPlatform `json:"platform,omitempty"` + PrimaryIp NullableNestedIPAddress `json:"primary_ip"` + PrimaryIp4 NullableNestedIPAddress `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableNestedIPAddress `json:"primary_ip6,omitempty"` + Vcpus NullableFloat64 `json:"vcpus,omitempty"` + Memory NullableInt32 `json:"memory,omitempty"` + Disk NullableInt32 `json:"disk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + ConfigContext interface{} `json:"config_context"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + InterfaceCount int32 `json:"interface_count"` + VirtualDiskCount int32 `json:"virtual_disk_count"` + AdditionalProperties map[string]interface{} +} + +type _VirtualMachineWithConfigContext VirtualMachineWithConfigContext + +// NewVirtualMachineWithConfigContext instantiates a new VirtualMachineWithConfigContext object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualMachineWithConfigContext(id int32, url string, display string, name string, primaryIp NullableNestedIPAddress, configContext interface{}, created NullableTime, lastUpdated NullableTime, interfaceCount int32, virtualDiskCount int32) *VirtualMachineWithConfigContext { + this := VirtualMachineWithConfigContext{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.PrimaryIp = primaryIp + this.ConfigContext = configContext + this.Created = created + this.LastUpdated = lastUpdated + this.InterfaceCount = interfaceCount + this.VirtualDiskCount = virtualDiskCount + return &this +} + +// NewVirtualMachineWithConfigContextWithDefaults instantiates a new VirtualMachineWithConfigContext object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualMachineWithConfigContextWithDefaults() *VirtualMachineWithConfigContext { + this := VirtualMachineWithConfigContext{} + return &this +} + +// GetId returns the Id field value +func (o *VirtualMachineWithConfigContext) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VirtualMachineWithConfigContext) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VirtualMachineWithConfigContext) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VirtualMachineWithConfigContext) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *VirtualMachineWithConfigContext) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *VirtualMachineWithConfigContext) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *VirtualMachineWithConfigContext) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualMachineWithConfigContext) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContext) GetStatus() ModuleStatus { + if o == nil || IsNil(o.Status) { + var ret ModuleStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetStatusOk() (*ModuleStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatus and assigns it to the Status field. +func (o *VirtualMachineWithConfigContext) SetStatus(v ModuleStatus) { + o.Status = &v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetSite() NestedSite { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSite + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSite and assigns it to the Site field. +func (o *VirtualMachineWithConfigContext) SetSite(v NestedSite) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetSite() { + o.Site.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetCluster() NestedCluster { + if o == nil || IsNil(o.Cluster.Get()) { + var ret NestedCluster + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetClusterOk() (*NestedCluster, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableNestedCluster and assigns it to the Cluster field. +func (o *VirtualMachineWithConfigContext) SetCluster(v NestedCluster) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetCluster() { + o.Cluster.Unset() +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetDevice() NestedDevice { + if o == nil || IsNil(o.Device.Get()) { + var ret NestedDevice + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetDeviceOk() (*NestedDevice, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableNestedDevice and assigns it to the Device field. +func (o *VirtualMachineWithConfigContext) SetDevice(v NestedDevice) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetDevice() { + o.Device.Unset() +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetRole() NestedDeviceRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedDeviceRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetRoleOk() (*NestedDeviceRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedDeviceRole and assigns it to the Role field. +func (o *VirtualMachineWithConfigContext) SetRole(v NestedDeviceRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetRole() { + o.Role.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *VirtualMachineWithConfigContext) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetPlatform() NestedPlatform { + if o == nil || IsNil(o.Platform.Get()) { + var ret NestedPlatform + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetPlatformOk() (*NestedPlatform, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableNestedPlatform and assigns it to the Platform field. +func (o *VirtualMachineWithConfigContext) SetPlatform(v NestedPlatform) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetPlatform() { + o.Platform.Unset() +} + +// GetPrimaryIp returns the PrimaryIp field value +// If the value is explicit nil, the zero value for NestedIPAddress will be returned +func (o *VirtualMachineWithConfigContext) GetPrimaryIp() NestedIPAddress { + if o == nil || o.PrimaryIp.Get() == nil { + var ret NestedIPAddress + return ret + } + + return *o.PrimaryIp.Get() +} + +// GetPrimaryIpOk returns a tuple with the PrimaryIp field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetPrimaryIpOk() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp.Get(), o.PrimaryIp.IsSet() +} + +// SetPrimaryIp sets field value +func (o *VirtualMachineWithConfigContext) SetPrimaryIp(v NestedIPAddress) { + o.PrimaryIp.Set(&v) +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetPrimaryIp4() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetPrimaryIp4Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp4 field. +func (o *VirtualMachineWithConfigContext) SetPrimaryIp4(v NestedIPAddress) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetPrimaryIp6() NestedIPAddress { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret NestedIPAddress + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetPrimaryIp6Ok() (*NestedIPAddress, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableNestedIPAddress and assigns it to the PrimaryIp6 field. +func (o *VirtualMachineWithConfigContext) SetPrimaryIp6(v NestedIPAddress) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetVcpus returns the Vcpus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetVcpus() float64 { + if o == nil || IsNil(o.Vcpus.Get()) { + var ret float64 + return ret + } + return *o.Vcpus.Get() +} + +// GetVcpusOk returns a tuple with the Vcpus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetVcpusOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Vcpus.Get(), o.Vcpus.IsSet() +} + +// HasVcpus returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasVcpus() bool { + if o != nil && o.Vcpus.IsSet() { + return true + } + + return false +} + +// SetVcpus gets a reference to the given NullableFloat64 and assigns it to the Vcpus field. +func (o *VirtualMachineWithConfigContext) SetVcpus(v float64) { + o.Vcpus.Set(&v) +} + +// SetVcpusNil sets the value for Vcpus to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetVcpusNil() { + o.Vcpus.Set(nil) +} + +// UnsetVcpus ensures that no value is present for Vcpus, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetVcpus() { + o.Vcpus.Unset() +} + +// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetMemory() int32 { + if o == nil || IsNil(o.Memory.Get()) { + var ret int32 + return ret + } + return *o.Memory.Get() +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetMemoryOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Memory.Get(), o.Memory.IsSet() +} + +// HasMemory returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasMemory() bool { + if o != nil && o.Memory.IsSet() { + return true + } + + return false +} + +// SetMemory gets a reference to the given NullableInt32 and assigns it to the Memory field. +func (o *VirtualMachineWithConfigContext) SetMemory(v int32) { + o.Memory.Set(&v) +} + +// SetMemoryNil sets the value for Memory to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetMemoryNil() { + o.Memory.Set(nil) +} + +// UnsetMemory ensures that no value is present for Memory, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetMemory() { + o.Memory.Unset() +} + +// GetDisk returns the Disk field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetDisk() int32 { + if o == nil || IsNil(o.Disk.Get()) { + var ret int32 + return ret + } + return *o.Disk.Get() +} + +// GetDiskOk returns a tuple with the Disk field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetDiskOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Disk.Get(), o.Disk.IsSet() +} + +// HasDisk returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasDisk() bool { + if o != nil && o.Disk.IsSet() { + return true + } + + return false +} + +// SetDisk gets a reference to the given NullableInt32 and assigns it to the Disk field. +func (o *VirtualMachineWithConfigContext) SetDisk(v int32) { + o.Disk.Set(&v) +} + +// SetDiskNil sets the value for Disk to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetDiskNil() { + o.Disk.Set(nil) +} + +// UnsetDisk ensures that no value is present for Disk, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetDisk() { + o.Disk.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContext) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualMachineWithConfigContext) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContext) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VirtualMachineWithConfigContext) SetComments(v string) { + o.Comments = &v +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContext) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *VirtualMachineWithConfigContext) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContext) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VirtualMachineWithConfigContext) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContext) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualMachineWithConfigContext) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetConfigContext returns the ConfigContext field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *VirtualMachineWithConfigContext) GetConfigContext() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.ConfigContext +} + +// GetConfigContextOk returns a tuple with the ConfigContext field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetConfigContextOk() (*interface{}, bool) { + if o == nil || IsNil(o.ConfigContext) { + return nil, false + } + return &o.ConfigContext, true +} + +// SetConfigContext sets field value +func (o *VirtualMachineWithConfigContext) SetConfigContext(v interface{}) { + o.ConfigContext = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualMachineWithConfigContext) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VirtualMachineWithConfigContext) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VirtualMachineWithConfigContext) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContext) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VirtualMachineWithConfigContext) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetInterfaceCount returns the InterfaceCount field value +func (o *VirtualMachineWithConfigContext) GetInterfaceCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InterfaceCount +} + +// GetInterfaceCountOk returns a tuple with the InterfaceCount field value +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetInterfaceCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceCount, true +} + +// SetInterfaceCount sets field value +func (o *VirtualMachineWithConfigContext) SetInterfaceCount(v int32) { + o.InterfaceCount = v +} + +// GetVirtualDiskCount returns the VirtualDiskCount field value +func (o *VirtualMachineWithConfigContext) GetVirtualDiskCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualDiskCount +} + +// GetVirtualDiskCountOk returns a tuple with the VirtualDiskCount field value +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContext) GetVirtualDiskCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualDiskCount, true +} + +// SetVirtualDiskCount sets field value +func (o *VirtualMachineWithConfigContext) SetVirtualDiskCount(v int32) { + o.VirtualDiskCount = v +} + +func (o VirtualMachineWithConfigContext) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualMachineWithConfigContext) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + toSerialize["primary_ip"] = o.PrimaryIp.Get() + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.Vcpus.IsSet() { + toSerialize["vcpus"] = o.Vcpus.Get() + } + if o.Memory.IsSet() { + toSerialize["memory"] = o.Memory.Get() + } + if o.Disk.IsSet() { + toSerialize["disk"] = o.Disk.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if o.ConfigContext != nil { + toSerialize["config_context"] = o.ConfigContext + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["interface_count"] = o.InterfaceCount + toSerialize["virtual_disk_count"] = o.VirtualDiskCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualMachineWithConfigContext) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "primary_ip", + "config_context", + "created", + "last_updated", + "interface_count", + "virtual_disk_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualMachineWithConfigContext := _VirtualMachineWithConfigContext{} + + err = json.Unmarshal(data, &varVirtualMachineWithConfigContext) + + if err != nil { + return err + } + + *o = VirtualMachineWithConfigContext(varVirtualMachineWithConfigContext) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "site") + delete(additionalProperties, "cluster") + delete(additionalProperties, "device") + delete(additionalProperties, "role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "primary_ip") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "vcpus") + delete(additionalProperties, "memory") + delete(additionalProperties, "disk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "config_context") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "interface_count") + delete(additionalProperties, "virtual_disk_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualMachineWithConfigContext struct { + value *VirtualMachineWithConfigContext + isSet bool +} + +func (v NullableVirtualMachineWithConfigContext) Get() *VirtualMachineWithConfigContext { + return v.value +} + +func (v *NullableVirtualMachineWithConfigContext) Set(val *VirtualMachineWithConfigContext) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualMachineWithConfigContext) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualMachineWithConfigContext) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualMachineWithConfigContext(val *VirtualMachineWithConfigContext) *NullableVirtualMachineWithConfigContext { + return &NullableVirtualMachineWithConfigContext{value: val, isSet: true} +} + +func (v NullableVirtualMachineWithConfigContext) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualMachineWithConfigContext) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_machine_with_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_machine_with_config_context_request.go new file mode 100644 index 00000000..57011057 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_virtual_machine_with_config_context_request.go @@ -0,0 +1,918 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VirtualMachineWithConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualMachineWithConfigContextRequest{} + +// VirtualMachineWithConfigContextRequest Adds support for custom fields and tags. +type VirtualMachineWithConfigContextRequest struct { + Name string `json:"name"` + Status *ModuleStatusValue `json:"status,omitempty"` + Site NullableNestedSiteRequest `json:"site,omitempty"` + Cluster NullableNestedClusterRequest `json:"cluster,omitempty"` + Device NullableNestedDeviceRequest `json:"device,omitempty"` + Role NullableNestedDeviceRoleRequest `json:"role,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Platform NullableNestedPlatformRequest `json:"platform,omitempty"` + PrimaryIp4 NullableNestedIPAddressRequest `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableNestedIPAddressRequest `json:"primary_ip6,omitempty"` + Vcpus NullableFloat64 `json:"vcpus,omitempty"` + Memory NullableInt32 `json:"memory,omitempty"` + Disk NullableInt32 `json:"disk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualMachineWithConfigContextRequest VirtualMachineWithConfigContextRequest + +// NewVirtualMachineWithConfigContextRequest instantiates a new VirtualMachineWithConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualMachineWithConfigContextRequest(name string) *VirtualMachineWithConfigContextRequest { + this := VirtualMachineWithConfigContextRequest{} + this.Name = name + return &this +} + +// NewVirtualMachineWithConfigContextRequestWithDefaults instantiates a new VirtualMachineWithConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualMachineWithConfigContextRequestWithDefaults() *VirtualMachineWithConfigContextRequest { + this := VirtualMachineWithConfigContextRequest{} + return &this +} + +// GetName returns the Name field value +func (o *VirtualMachineWithConfigContextRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VirtualMachineWithConfigContextRequest) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContextRequest) GetStatus() ModuleStatusValue { + if o == nil || IsNil(o.Status) { + var ret ModuleStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContextRequest) GetStatusOk() (*ModuleStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatusValue and assigns it to the Status field. +func (o *VirtualMachineWithConfigContextRequest) SetStatus(v ModuleStatusValue) { + o.Status = &v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetSite() NestedSiteRequest { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSiteRequest + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSiteRequest and assigns it to the Site field. +func (o *VirtualMachineWithConfigContextRequest) SetSite(v NestedSiteRequest) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetSite() { + o.Site.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetCluster() NestedClusterRequest { + if o == nil || IsNil(o.Cluster.Get()) { + var ret NestedClusterRequest + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetClusterOk() (*NestedClusterRequest, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableNestedClusterRequest and assigns it to the Cluster field. +func (o *VirtualMachineWithConfigContextRequest) SetCluster(v NestedClusterRequest) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetCluster() { + o.Cluster.Unset() +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetDevice() NestedDeviceRequest { + if o == nil || IsNil(o.Device.Get()) { + var ret NestedDeviceRequest + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetDeviceOk() (*NestedDeviceRequest, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableNestedDeviceRequest and assigns it to the Device field. +func (o *VirtualMachineWithConfigContextRequest) SetDevice(v NestedDeviceRequest) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetRole() NestedDeviceRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedDeviceRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetRoleOk() (*NestedDeviceRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedDeviceRoleRequest and assigns it to the Role field. +func (o *VirtualMachineWithConfigContextRequest) SetRole(v NestedDeviceRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetRole() { + o.Role.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *VirtualMachineWithConfigContextRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetPlatform() NestedPlatformRequest { + if o == nil || IsNil(o.Platform.Get()) { + var ret NestedPlatformRequest + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetPlatformOk() (*NestedPlatformRequest, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableNestedPlatformRequest and assigns it to the Platform field. +func (o *VirtualMachineWithConfigContextRequest) SetPlatform(v NestedPlatformRequest) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetPlatform() { + o.Platform.Unset() +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetPrimaryIp4() NestedIPAddressRequest { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetPrimaryIp4Ok() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableNestedIPAddressRequest and assigns it to the PrimaryIp4 field. +func (o *VirtualMachineWithConfigContextRequest) SetPrimaryIp4(v NestedIPAddressRequest) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetPrimaryIp6() NestedIPAddressRequest { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret NestedIPAddressRequest + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetPrimaryIp6Ok() (*NestedIPAddressRequest, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableNestedIPAddressRequest and assigns it to the PrimaryIp6 field. +func (o *VirtualMachineWithConfigContextRequest) SetPrimaryIp6(v NestedIPAddressRequest) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetVcpus returns the Vcpus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetVcpus() float64 { + if o == nil || IsNil(o.Vcpus.Get()) { + var ret float64 + return ret + } + return *o.Vcpus.Get() +} + +// GetVcpusOk returns a tuple with the Vcpus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetVcpusOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Vcpus.Get(), o.Vcpus.IsSet() +} + +// HasVcpus returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasVcpus() bool { + if o != nil && o.Vcpus.IsSet() { + return true + } + + return false +} + +// SetVcpus gets a reference to the given NullableFloat64 and assigns it to the Vcpus field. +func (o *VirtualMachineWithConfigContextRequest) SetVcpus(v float64) { + o.Vcpus.Set(&v) +} + +// SetVcpusNil sets the value for Vcpus to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetVcpusNil() { + o.Vcpus.Set(nil) +} + +// UnsetVcpus ensures that no value is present for Vcpus, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetVcpus() { + o.Vcpus.Unset() +} + +// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetMemory() int32 { + if o == nil || IsNil(o.Memory.Get()) { + var ret int32 + return ret + } + return *o.Memory.Get() +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetMemoryOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Memory.Get(), o.Memory.IsSet() +} + +// HasMemory returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasMemory() bool { + if o != nil && o.Memory.IsSet() { + return true + } + + return false +} + +// SetMemory gets a reference to the given NullableInt32 and assigns it to the Memory field. +func (o *VirtualMachineWithConfigContextRequest) SetMemory(v int32) { + o.Memory.Set(&v) +} + +// SetMemoryNil sets the value for Memory to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetMemoryNil() { + o.Memory.Set(nil) +} + +// UnsetMemory ensures that no value is present for Memory, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetMemory() { + o.Memory.Unset() +} + +// GetDisk returns the Disk field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetDisk() int32 { + if o == nil || IsNil(o.Disk.Get()) { + var ret int32 + return ret + } + return *o.Disk.Get() +} + +// GetDiskOk returns a tuple with the Disk field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetDiskOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Disk.Get(), o.Disk.IsSet() +} + +// HasDisk returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasDisk() bool { + if o != nil && o.Disk.IsSet() { + return true + } + + return false +} + +// SetDisk gets a reference to the given NullableInt32 and assigns it to the Disk field. +func (o *VirtualMachineWithConfigContextRequest) SetDisk(v int32) { + o.Disk.Set(&v) +} + +// SetDiskNil sets the value for Disk to be an explicit nil +func (o *VirtualMachineWithConfigContextRequest) SetDiskNil() { + o.Disk.Set(nil) +} + +// UnsetDisk ensures that no value is present for Disk, not even an explicit nil +func (o *VirtualMachineWithConfigContextRequest) UnsetDisk() { + o.Disk.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualMachineWithConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VirtualMachineWithConfigContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualMachineWithConfigContextRequest) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualMachineWithConfigContextRequest) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *VirtualMachineWithConfigContextRequest) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VirtualMachineWithConfigContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VirtualMachineWithConfigContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualMachineWithConfigContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VirtualMachineWithConfigContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VirtualMachineWithConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualMachineWithConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.Vcpus.IsSet() { + toSerialize["vcpus"] = o.Vcpus.Get() + } + if o.Memory.IsSet() { + toSerialize["memory"] = o.Memory.Get() + } + if o.Disk.IsSet() { + toSerialize["disk"] = o.Disk.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualMachineWithConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVirtualMachineWithConfigContextRequest := _VirtualMachineWithConfigContextRequest{} + + err = json.Unmarshal(data, &varVirtualMachineWithConfigContextRequest) + + if err != nil { + return err + } + + *o = VirtualMachineWithConfigContextRequest(varVirtualMachineWithConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "site") + delete(additionalProperties, "cluster") + delete(additionalProperties, "device") + delete(additionalProperties, "role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "vcpus") + delete(additionalProperties, "memory") + delete(additionalProperties, "disk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualMachineWithConfigContextRequest struct { + value *VirtualMachineWithConfigContextRequest + isSet bool +} + +func (v NullableVirtualMachineWithConfigContextRequest) Get() *VirtualMachineWithConfigContextRequest { + return v.value +} + +func (v *NullableVirtualMachineWithConfigContextRequest) Set(val *VirtualMachineWithConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualMachineWithConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualMachineWithConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualMachineWithConfigContextRequest(val *VirtualMachineWithConfigContextRequest) *NullableVirtualMachineWithConfigContextRequest { + return &NullableVirtualMachineWithConfigContextRequest{value: val, isSet: true} +} + +func (v NullableVirtualMachineWithConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualMachineWithConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vlan.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan.go new file mode 100644 index 00000000..66090ee8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan.go @@ -0,0 +1,783 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VLAN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VLAN{} + +// VLAN Adds support for custom fields and tags. +type VLAN struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Site NullableNestedSite `json:"site,omitempty"` + Group NullableNestedVLANGroup `json:"group,omitempty"` + // Numeric VLAN ID (1-4094) + Vid int32 `json:"vid"` + Name string `json:"name"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + Status *IPRangeStatus `json:"status,omitempty"` + Role NullableNestedRole `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + L2vpnTermination NullableNestedL2VPNTermination `json:"l2vpn_termination"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + PrefixCount int32 `json:"prefix_count"` + AdditionalProperties map[string]interface{} +} + +type _VLAN VLAN + +// NewVLAN instantiates a new VLAN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVLAN(id int32, url string, display string, vid int32, name string, l2vpnTermination NullableNestedL2VPNTermination, created NullableTime, lastUpdated NullableTime, prefixCount int32) *VLAN { + this := VLAN{} + this.Id = id + this.Url = url + this.Display = display + this.Vid = vid + this.Name = name + this.L2vpnTermination = l2vpnTermination + this.Created = created + this.LastUpdated = lastUpdated + this.PrefixCount = prefixCount + return &this +} + +// NewVLANWithDefaults instantiates a new VLAN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVLANWithDefaults() *VLAN { + this := VLAN{} + return &this +} + +// GetId returns the Id field value +func (o *VLAN) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VLAN) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VLAN) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VLAN) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VLAN) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VLAN) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *VLAN) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *VLAN) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *VLAN) SetDisplay(v string) { + o.Display = v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLAN) GetSite() NestedSite { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSite + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLAN) GetSiteOk() (*NestedSite, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *VLAN) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSite and assigns it to the Site field. +func (o *VLAN) SetSite(v NestedSite) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *VLAN) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *VLAN) UnsetSite() { + o.Site.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLAN) GetGroup() NestedVLANGroup { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedVLANGroup + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLAN) GetGroupOk() (*NestedVLANGroup, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *VLAN) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedVLANGroup and assigns it to the Group field. +func (o *VLAN) SetGroup(v NestedVLANGroup) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *VLAN) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *VLAN) UnsetGroup() { + o.Group.Unset() +} + +// GetVid returns the Vid field value +func (o *VLAN) GetVid() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Vid +} + +// GetVidOk returns a tuple with the Vid field value +// and a boolean to check if the value has been set. +func (o *VLAN) GetVidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Vid, true +} + +// SetVid sets field value +func (o *VLAN) SetVid(v int32) { + o.Vid = v +} + +// GetName returns the Name field value +func (o *VLAN) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VLAN) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VLAN) SetName(v string) { + o.Name = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLAN) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLAN) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VLAN) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *VLAN) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VLAN) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VLAN) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *VLAN) GetStatus() IPRangeStatus { + if o == nil || IsNil(o.Status) { + var ret IPRangeStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLAN) GetStatusOk() (*IPRangeStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *VLAN) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given IPRangeStatus and assigns it to the Status field. +func (o *VLAN) SetStatus(v IPRangeStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLAN) GetRole() NestedRole { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRole + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLAN) GetRoleOk() (*NestedRole, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *VLAN) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRole and assigns it to the Role field. +func (o *VLAN) SetRole(v NestedRole) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *VLAN) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *VLAN) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VLAN) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLAN) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VLAN) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VLAN) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VLAN) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLAN) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VLAN) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VLAN) SetComments(v string) { + o.Comments = &v +} + +// GetL2vpnTermination returns the L2vpnTermination field value +// If the value is explicit nil, the zero value for NestedL2VPNTermination will be returned +func (o *VLAN) GetL2vpnTermination() NestedL2VPNTermination { + if o == nil || o.L2vpnTermination.Get() == nil { + var ret NestedL2VPNTermination + return ret + } + + return *o.L2vpnTermination.Get() +} + +// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLAN) GetL2vpnTerminationOk() (*NestedL2VPNTermination, bool) { + if o == nil { + return nil, false + } + return o.L2vpnTermination.Get(), o.L2vpnTermination.IsSet() +} + +// SetL2vpnTermination sets field value +func (o *VLAN) SetL2vpnTermination(v NestedL2VPNTermination) { + o.L2vpnTermination.Set(&v) +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VLAN) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLAN) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VLAN) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VLAN) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VLAN) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLAN) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VLAN) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VLAN) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VLAN) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLAN) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VLAN) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VLAN) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLAN) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VLAN) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetPrefixCount returns the PrefixCount field value +func (o *VLAN) GetPrefixCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PrefixCount +} + +// GetPrefixCountOk returns a tuple with the PrefixCount field value +// and a boolean to check if the value has been set. +func (o *VLAN) GetPrefixCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PrefixCount, true +} + +// SetPrefixCount sets field value +func (o *VLAN) SetPrefixCount(v int32) { + o.PrefixCount = v +} + +func (o VLAN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VLAN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + toSerialize["vid"] = o.Vid + toSerialize["name"] = o.Name + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["prefix_count"] = o.PrefixCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VLAN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "vid", + "name", + "l2vpn_termination", + "created", + "last_updated", + "prefix_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVLAN := _VLAN{} + + err = json.Unmarshal(data, &varVLAN) + + if err != nil { + return err + } + + *o = VLAN(varVLAN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "site") + delete(additionalProperties, "group") + delete(additionalProperties, "vid") + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "l2vpn_termination") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "prefix_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVLAN struct { + value *VLAN + isSet bool +} + +func (v NullableVLAN) Get() *VLAN { + return v.value +} + +func (v *NullableVLAN) Set(val *VLAN) { + v.value = val + v.isSet = true +} + +func (v NullableVLAN) IsSet() bool { + return v.isSet +} + +func (v *NullableVLAN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVLAN(val *VLAN) *NullableVLAN { + return &NullableVLAN{value: val, isSet: true} +} + +func (v NullableVLAN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVLAN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_group.go new file mode 100644 index 00000000..4cb2dbf6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_group.go @@ -0,0 +1,719 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VLANGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VLANGroup{} + +// VLANGroup Adds support for custom fields and tags. +type VLANGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + ScopeType NullableString `json:"scope_type,omitempty"` + ScopeId NullableInt32 `json:"scope_id,omitempty"` + Scope interface{} `json:"scope"` + // Lowest permissible ID of a child VLAN + MinVid *int32 `json:"min_vid,omitempty"` + // Highest permissible ID of a child VLAN + MaxVid *int32 `json:"max_vid,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + VlanCount int32 `json:"vlan_count"` + Utilization string `json:"utilization"` + AdditionalProperties map[string]interface{} +} + +type _VLANGroup VLANGroup + +// NewVLANGroup instantiates a new VLANGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVLANGroup(id int32, url string, display string, name string, slug string, scope interface{}, created NullableTime, lastUpdated NullableTime, vlanCount int32, utilization string) *VLANGroup { + this := VLANGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Scope = scope + this.Created = created + this.LastUpdated = lastUpdated + this.VlanCount = vlanCount + this.Utilization = utilization + return &this +} + +// NewVLANGroupWithDefaults instantiates a new VLANGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVLANGroupWithDefaults() *VLANGroup { + this := VLANGroup{} + return &this +} + +// GetId returns the Id field value +func (o *VLANGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VLANGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VLANGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VLANGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *VLANGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *VLANGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *VLANGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VLANGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *VLANGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *VLANGroup) SetSlug(v string) { + o.Slug = v +} + +// GetScopeType returns the ScopeType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANGroup) GetScopeType() string { + if o == nil || IsNil(o.ScopeType.Get()) { + var ret string + return ret + } + return *o.ScopeType.Get() +} + +// GetScopeTypeOk returns a tuple with the ScopeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANGroup) GetScopeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ScopeType.Get(), o.ScopeType.IsSet() +} + +// HasScopeType returns a boolean if a field has been set. +func (o *VLANGroup) HasScopeType() bool { + if o != nil && o.ScopeType.IsSet() { + return true + } + + return false +} + +// SetScopeType gets a reference to the given NullableString and assigns it to the ScopeType field. +func (o *VLANGroup) SetScopeType(v string) { + o.ScopeType.Set(&v) +} + +// SetScopeTypeNil sets the value for ScopeType to be an explicit nil +func (o *VLANGroup) SetScopeTypeNil() { + o.ScopeType.Set(nil) +} + +// UnsetScopeType ensures that no value is present for ScopeType, not even an explicit nil +func (o *VLANGroup) UnsetScopeType() { + o.ScopeType.Unset() +} + +// GetScopeId returns the ScopeId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANGroup) GetScopeId() int32 { + if o == nil || IsNil(o.ScopeId.Get()) { + var ret int32 + return ret + } + return *o.ScopeId.Get() +} + +// GetScopeIdOk returns a tuple with the ScopeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANGroup) GetScopeIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ScopeId.Get(), o.ScopeId.IsSet() +} + +// HasScopeId returns a boolean if a field has been set. +func (o *VLANGroup) HasScopeId() bool { + if o != nil && o.ScopeId.IsSet() { + return true + } + + return false +} + +// SetScopeId gets a reference to the given NullableInt32 and assigns it to the ScopeId field. +func (o *VLANGroup) SetScopeId(v int32) { + o.ScopeId.Set(&v) +} + +// SetScopeIdNil sets the value for ScopeId to be an explicit nil +func (o *VLANGroup) SetScopeIdNil() { + o.ScopeId.Set(nil) +} + +// UnsetScopeId ensures that no value is present for ScopeId, not even an explicit nil +func (o *VLANGroup) UnsetScopeId() { + o.ScopeId.Unset() +} + +// GetScope returns the Scope field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *VLANGroup) GetScope() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANGroup) GetScopeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return &o.Scope, true +} + +// SetScope sets field value +func (o *VLANGroup) SetScope(v interface{}) { + o.Scope = v +} + +// GetMinVid returns the MinVid field value if set, zero value otherwise. +func (o *VLANGroup) GetMinVid() int32 { + if o == nil || IsNil(o.MinVid) { + var ret int32 + return ret + } + return *o.MinVid +} + +// GetMinVidOk returns a tuple with the MinVid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetMinVidOk() (*int32, bool) { + if o == nil || IsNil(o.MinVid) { + return nil, false + } + return o.MinVid, true +} + +// HasMinVid returns a boolean if a field has been set. +func (o *VLANGroup) HasMinVid() bool { + if o != nil && !IsNil(o.MinVid) { + return true + } + + return false +} + +// SetMinVid gets a reference to the given int32 and assigns it to the MinVid field. +func (o *VLANGroup) SetMinVid(v int32) { + o.MinVid = &v +} + +// GetMaxVid returns the MaxVid field value if set, zero value otherwise. +func (o *VLANGroup) GetMaxVid() int32 { + if o == nil || IsNil(o.MaxVid) { + var ret int32 + return ret + } + return *o.MaxVid +} + +// GetMaxVidOk returns a tuple with the MaxVid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetMaxVidOk() (*int32, bool) { + if o == nil || IsNil(o.MaxVid) { + return nil, false + } + return o.MaxVid, true +} + +// HasMaxVid returns a boolean if a field has been set. +func (o *VLANGroup) HasMaxVid() bool { + if o != nil && !IsNil(o.MaxVid) { + return true + } + + return false +} + +// SetMaxVid gets a reference to the given int32 and assigns it to the MaxVid field. +func (o *VLANGroup) SetMaxVid(v int32) { + o.MaxVid = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VLANGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VLANGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VLANGroup) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VLANGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VLANGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VLANGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VLANGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VLANGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VLANGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VLANGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VLANGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VLANGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VLANGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetVlanCount returns the VlanCount field value +func (o *VLANGroup) GetVlanCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VlanCount +} + +// GetVlanCountOk returns a tuple with the VlanCount field value +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetVlanCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VlanCount, true +} + +// SetVlanCount sets field value +func (o *VLANGroup) SetVlanCount(v int32) { + o.VlanCount = v +} + +// GetUtilization returns the Utilization field value +func (o *VLANGroup) GetUtilization() string { + if o == nil { + var ret string + return ret + } + + return o.Utilization +} + +// GetUtilizationOk returns a tuple with the Utilization field value +// and a boolean to check if the value has been set. +func (o *VLANGroup) GetUtilizationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Utilization, true +} + +// SetUtilization sets field value +func (o *VLANGroup) SetUtilization(v string) { + o.Utilization = v +} + +func (o VLANGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VLANGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.ScopeType.IsSet() { + toSerialize["scope_type"] = o.ScopeType.Get() + } + if o.ScopeId.IsSet() { + toSerialize["scope_id"] = o.ScopeId.Get() + } + if o.Scope != nil { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.MinVid) { + toSerialize["min_vid"] = o.MinVid + } + if !IsNil(o.MaxVid) { + toSerialize["max_vid"] = o.MaxVid + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["vlan_count"] = o.VlanCount + toSerialize["utilization"] = o.Utilization + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VLANGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "scope", + "created", + "last_updated", + "vlan_count", + "utilization", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVLANGroup := _VLANGroup{} + + err = json.Unmarshal(data, &varVLANGroup) + + if err != nil { + return err + } + + *o = VLANGroup(varVLANGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "scope_type") + delete(additionalProperties, "scope_id") + delete(additionalProperties, "scope") + delete(additionalProperties, "min_vid") + delete(additionalProperties, "max_vid") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "vlan_count") + delete(additionalProperties, "utilization") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVLANGroup struct { + value *VLANGroup + isSet bool +} + +func (v NullableVLANGroup) Get() *VLANGroup { + return v.value +} + +func (v *NullableVLANGroup) Set(val *VLANGroup) { + v.value = val + v.isSet = true +} + +func (v NullableVLANGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableVLANGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVLANGroup(val *VLANGroup) *NullableVLANGroup { + return &NullableVLANGroup{value: val, isSet: true} +} + +func (v NullableVLANGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVLANGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_group_request.go new file mode 100644 index 00000000..d1b36b20 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_group_request.go @@ -0,0 +1,478 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VLANGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VLANGroupRequest{} + +// VLANGroupRequest Adds support for custom fields and tags. +type VLANGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + ScopeType NullableString `json:"scope_type,omitempty"` + ScopeId NullableInt32 `json:"scope_id,omitempty"` + // Lowest permissible ID of a child VLAN + MinVid *int32 `json:"min_vid,omitempty"` + // Highest permissible ID of a child VLAN + MaxVid *int32 `json:"max_vid,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VLANGroupRequest VLANGroupRequest + +// NewVLANGroupRequest instantiates a new VLANGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVLANGroupRequest(name string, slug string) *VLANGroupRequest { + this := VLANGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewVLANGroupRequestWithDefaults instantiates a new VLANGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVLANGroupRequestWithDefaults() *VLANGroupRequest { + this := VLANGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *VLANGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VLANGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VLANGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *VLANGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *VLANGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *VLANGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetScopeType returns the ScopeType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANGroupRequest) GetScopeType() string { + if o == nil || IsNil(o.ScopeType.Get()) { + var ret string + return ret + } + return *o.ScopeType.Get() +} + +// GetScopeTypeOk returns a tuple with the ScopeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANGroupRequest) GetScopeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ScopeType.Get(), o.ScopeType.IsSet() +} + +// HasScopeType returns a boolean if a field has been set. +func (o *VLANGroupRequest) HasScopeType() bool { + if o != nil && o.ScopeType.IsSet() { + return true + } + + return false +} + +// SetScopeType gets a reference to the given NullableString and assigns it to the ScopeType field. +func (o *VLANGroupRequest) SetScopeType(v string) { + o.ScopeType.Set(&v) +} + +// SetScopeTypeNil sets the value for ScopeType to be an explicit nil +func (o *VLANGroupRequest) SetScopeTypeNil() { + o.ScopeType.Set(nil) +} + +// UnsetScopeType ensures that no value is present for ScopeType, not even an explicit nil +func (o *VLANGroupRequest) UnsetScopeType() { + o.ScopeType.Unset() +} + +// GetScopeId returns the ScopeId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANGroupRequest) GetScopeId() int32 { + if o == nil || IsNil(o.ScopeId.Get()) { + var ret int32 + return ret + } + return *o.ScopeId.Get() +} + +// GetScopeIdOk returns a tuple with the ScopeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANGroupRequest) GetScopeIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ScopeId.Get(), o.ScopeId.IsSet() +} + +// HasScopeId returns a boolean if a field has been set. +func (o *VLANGroupRequest) HasScopeId() bool { + if o != nil && o.ScopeId.IsSet() { + return true + } + + return false +} + +// SetScopeId gets a reference to the given NullableInt32 and assigns it to the ScopeId field. +func (o *VLANGroupRequest) SetScopeId(v int32) { + o.ScopeId.Set(&v) +} + +// SetScopeIdNil sets the value for ScopeId to be an explicit nil +func (o *VLANGroupRequest) SetScopeIdNil() { + o.ScopeId.Set(nil) +} + +// UnsetScopeId ensures that no value is present for ScopeId, not even an explicit nil +func (o *VLANGroupRequest) UnsetScopeId() { + o.ScopeId.Unset() +} + +// GetMinVid returns the MinVid field value if set, zero value otherwise. +func (o *VLANGroupRequest) GetMinVid() int32 { + if o == nil || IsNil(o.MinVid) { + var ret int32 + return ret + } + return *o.MinVid +} + +// GetMinVidOk returns a tuple with the MinVid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroupRequest) GetMinVidOk() (*int32, bool) { + if o == nil || IsNil(o.MinVid) { + return nil, false + } + return o.MinVid, true +} + +// HasMinVid returns a boolean if a field has been set. +func (o *VLANGroupRequest) HasMinVid() bool { + if o != nil && !IsNil(o.MinVid) { + return true + } + + return false +} + +// SetMinVid gets a reference to the given int32 and assigns it to the MinVid field. +func (o *VLANGroupRequest) SetMinVid(v int32) { + o.MinVid = &v +} + +// GetMaxVid returns the MaxVid field value if set, zero value otherwise. +func (o *VLANGroupRequest) GetMaxVid() int32 { + if o == nil || IsNil(o.MaxVid) { + var ret int32 + return ret + } + return *o.MaxVid +} + +// GetMaxVidOk returns a tuple with the MaxVid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroupRequest) GetMaxVidOk() (*int32, bool) { + if o == nil || IsNil(o.MaxVid) { + return nil, false + } + return o.MaxVid, true +} + +// HasMaxVid returns a boolean if a field has been set. +func (o *VLANGroupRequest) HasMaxVid() bool { + if o != nil && !IsNil(o.MaxVid) { + return true + } + + return false +} + +// SetMaxVid gets a reference to the given int32 and assigns it to the MaxVid field. +func (o *VLANGroupRequest) SetMaxVid(v int32) { + o.MaxVid = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VLANGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VLANGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VLANGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VLANGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VLANGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VLANGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VLANGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VLANGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VLANGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VLANGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VLANGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.ScopeType.IsSet() { + toSerialize["scope_type"] = o.ScopeType.Get() + } + if o.ScopeId.IsSet() { + toSerialize["scope_id"] = o.ScopeId.Get() + } + if !IsNil(o.MinVid) { + toSerialize["min_vid"] = o.MinVid + } + if !IsNil(o.MaxVid) { + toSerialize["max_vid"] = o.MaxVid + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VLANGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVLANGroupRequest := _VLANGroupRequest{} + + err = json.Unmarshal(data, &varVLANGroupRequest) + + if err != nil { + return err + } + + *o = VLANGroupRequest(varVLANGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "scope_type") + delete(additionalProperties, "scope_id") + delete(additionalProperties, "min_vid") + delete(additionalProperties, "max_vid") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVLANGroupRequest struct { + value *VLANGroupRequest + isSet bool +} + +func (v NullableVLANGroupRequest) Get() *VLANGroupRequest { + return v.value +} + +func (v *NullableVLANGroupRequest) Set(val *VLANGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVLANGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVLANGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVLANGroupRequest(val *VLANGroupRequest) *NullableVLANGroupRequest { + return &NullableVLANGroupRequest{value: val, isSet: true} +} + +func (v NullableVLANGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVLANGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_request.go new file mode 100644 index 00000000..a3871792 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vlan_request.go @@ -0,0 +1,573 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VLANRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VLANRequest{} + +// VLANRequest Adds support for custom fields and tags. +type VLANRequest struct { + Site NullableNestedSiteRequest `json:"site,omitempty"` + Group NullableNestedVLANGroupRequest `json:"group,omitempty"` + // Numeric VLAN ID (1-4094) + Vid int32 `json:"vid"` + Name string `json:"name"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + Status *IPRangeStatusValue `json:"status,omitempty"` + Role NullableNestedRoleRequest `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VLANRequest VLANRequest + +// NewVLANRequest instantiates a new VLANRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVLANRequest(vid int32, name string) *VLANRequest { + this := VLANRequest{} + this.Vid = vid + this.Name = name + return &this +} + +// NewVLANRequestWithDefaults instantiates a new VLANRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVLANRequestWithDefaults() *VLANRequest { + this := VLANRequest{} + return &this +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANRequest) GetSite() NestedSiteRequest { + if o == nil || IsNil(o.Site.Get()) { + var ret NestedSiteRequest + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANRequest) GetSiteOk() (*NestedSiteRequest, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *VLANRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableNestedSiteRequest and assigns it to the Site field. +func (o *VLANRequest) SetSite(v NestedSiteRequest) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *VLANRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *VLANRequest) UnsetSite() { + o.Site.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANRequest) GetGroup() NestedVLANGroupRequest { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedVLANGroupRequest + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANRequest) GetGroupOk() (*NestedVLANGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *VLANRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedVLANGroupRequest and assigns it to the Group field. +func (o *VLANRequest) SetGroup(v NestedVLANGroupRequest) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *VLANRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *VLANRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetVid returns the Vid field value +func (o *VLANRequest) GetVid() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Vid +} + +// GetVidOk returns a tuple with the Vid field value +// and a boolean to check if the value has been set. +func (o *VLANRequest) GetVidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Vid, true +} + +// SetVid sets field value +func (o *VLANRequest) SetVid(v int32) { + o.Vid = v +} + +// GetName returns the Name field value +func (o *VLANRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VLANRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VLANRequest) SetName(v string) { + o.Name = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VLANRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *VLANRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VLANRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VLANRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *VLANRequest) GetStatus() IPRangeStatusValue { + if o == nil || IsNil(o.Status) { + var ret IPRangeStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANRequest) GetStatusOk() (*IPRangeStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *VLANRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given IPRangeStatusValue and assigns it to the Status field. +func (o *VLANRequest) SetStatus(v IPRangeStatusValue) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VLANRequest) GetRole() NestedRoleRequest { + if o == nil || IsNil(o.Role.Get()) { + var ret NestedRoleRequest + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VLANRequest) GetRoleOk() (*NestedRoleRequest, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *VLANRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableNestedRoleRequest and assigns it to the Role field. +func (o *VLANRequest) SetRole(v NestedRoleRequest) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *VLANRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *VLANRequest) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VLANRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VLANRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VLANRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VLANRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VLANRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VLANRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VLANRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VLANRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VLANRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VLANRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VLANRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VLANRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VLANRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VLANRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VLANRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + toSerialize["vid"] = o.Vid + toSerialize["name"] = o.Name + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VLANRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "vid", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVLANRequest := _VLANRequest{} + + err = json.Unmarshal(data, &varVLANRequest) + + if err != nil { + return err + } + + *o = VLANRequest(varVLANRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "site") + delete(additionalProperties, "group") + delete(additionalProperties, "vid") + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVLANRequest struct { + value *VLANRequest + isSet bool +} + +func (v NullableVLANRequest) Get() *VLANRequest { + return v.value +} + +func (v *NullableVLANRequest) Set(val *VLANRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVLANRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVLANRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVLANRequest(val *VLANRequest) *NullableVLANRequest { + return &NullableVLANRequest{value: val, isSet: true} +} + +func (v NullableVLANRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVLANRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vm_interface.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vm_interface.go new file mode 100644 index 00000000..13e73445 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vm_interface.go @@ -0,0 +1,944 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VMInterface type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VMInterface{} + +// VMInterface Adds support for custom fields and tags. +type VMInterface struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + VirtualMachine NestedVirtualMachine `json:"virtual_machine"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableNestedVMInterface `json:"parent,omitempty"` + Bridge NullableNestedVMInterface `json:"bridge,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Description *string `json:"description,omitempty"` + Mode *InterfaceMode `json:"mode,omitempty"` + UntaggedVlan NullableNestedVLAN `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + Vrf NullableNestedVRF `json:"vrf,omitempty"` + L2vpnTermination NullableNestedL2VPNTermination `json:"l2vpn_termination"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + CountIpaddresses int32 `json:"count_ipaddresses"` + CountFhrpGroups int32 `json:"count_fhrp_groups"` + AdditionalProperties map[string]interface{} +} + +type _VMInterface VMInterface + +// NewVMInterface instantiates a new VMInterface object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVMInterface(id int32, url string, display string, virtualMachine NestedVirtualMachine, name string, l2vpnTermination NullableNestedL2VPNTermination, created NullableTime, lastUpdated NullableTime, countIpaddresses int32, countFhrpGroups int32) *VMInterface { + this := VMInterface{} + this.Id = id + this.Url = url + this.Display = display + this.VirtualMachine = virtualMachine + this.Name = name + this.L2vpnTermination = l2vpnTermination + this.Created = created + this.LastUpdated = lastUpdated + this.CountIpaddresses = countIpaddresses + this.CountFhrpGroups = countFhrpGroups + return &this +} + +// NewVMInterfaceWithDefaults instantiates a new VMInterface object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVMInterfaceWithDefaults() *VMInterface { + this := VMInterface{} + return &this +} + +// GetId returns the Id field value +func (o *VMInterface) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VMInterface) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VMInterface) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VMInterface) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VMInterface) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VMInterface) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *VMInterface) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *VMInterface) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *VMInterface) SetDisplay(v string) { + o.Display = v +} + +// GetVirtualMachine returns the VirtualMachine field value +func (o *VMInterface) GetVirtualMachine() NestedVirtualMachine { + if o == nil { + var ret NestedVirtualMachine + return ret + } + + return o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value +// and a boolean to check if the value has been set. +func (o *VMInterface) GetVirtualMachineOk() (*NestedVirtualMachine, bool) { + if o == nil { + return nil, false + } + return &o.VirtualMachine, true +} + +// SetVirtualMachine sets field value +func (o *VMInterface) SetVirtualMachine(v NestedVirtualMachine) { + o.VirtualMachine = v +} + +// GetName returns the Name field value +func (o *VMInterface) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VMInterface) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VMInterface) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *VMInterface) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterface) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *VMInterface) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *VMInterface) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterface) GetParent() NestedVMInterface { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedVMInterface + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetParentOk() (*NestedVMInterface, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *VMInterface) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedVMInterface and assigns it to the Parent field. +func (o *VMInterface) SetParent(v NestedVMInterface) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *VMInterface) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *VMInterface) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterface) GetBridge() NestedVMInterface { + if o == nil || IsNil(o.Bridge.Get()) { + var ret NestedVMInterface + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetBridgeOk() (*NestedVMInterface, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *VMInterface) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableNestedVMInterface and assigns it to the Bridge field. +func (o *VMInterface) SetBridge(v NestedVMInterface) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *VMInterface) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *VMInterface) UnsetBridge() { + o.Bridge.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterface) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *VMInterface) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *VMInterface) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *VMInterface) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *VMInterface) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterface) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *VMInterface) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *VMInterface) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *VMInterface) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *VMInterface) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VMInterface) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterface) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VMInterface) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VMInterface) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *VMInterface) GetMode() InterfaceMode { + if o == nil || IsNil(o.Mode) { + var ret InterfaceMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterface) GetModeOk() (*InterfaceMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *VMInterface) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given InterfaceMode and assigns it to the Mode field. +func (o *VMInterface) SetMode(v InterfaceMode) { + o.Mode = &v +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterface) GetUntaggedVlan() NestedVLAN { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret NestedVLAN + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetUntaggedVlanOk() (*NestedVLAN, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *VMInterface) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableNestedVLAN and assigns it to the UntaggedVlan field. +func (o *VMInterface) SetUntaggedVlan(v NestedVLAN) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *VMInterface) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *VMInterface) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *VMInterface) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterface) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *VMInterface) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *VMInterface) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterface) GetVrf() NestedVRF { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRF + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetVrfOk() (*NestedVRF, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *VMInterface) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRF and assigns it to the Vrf field. +func (o *VMInterface) SetVrf(v NestedVRF) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *VMInterface) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *VMInterface) UnsetVrf() { + o.Vrf.Unset() +} + +// GetL2vpnTermination returns the L2vpnTermination field value +// If the value is explicit nil, the zero value for NestedL2VPNTermination will be returned +func (o *VMInterface) GetL2vpnTermination() NestedL2VPNTermination { + if o == nil || o.L2vpnTermination.Get() == nil { + var ret NestedL2VPNTermination + return ret + } + + return *o.L2vpnTermination.Get() +} + +// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetL2vpnTerminationOk() (*NestedL2VPNTermination, bool) { + if o == nil { + return nil, false + } + return o.L2vpnTermination.Get(), o.L2vpnTermination.IsSet() +} + +// SetL2vpnTermination sets field value +func (o *VMInterface) SetL2vpnTermination(v NestedL2VPNTermination) { + o.L2vpnTermination.Set(&v) +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VMInterface) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterface) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VMInterface) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VMInterface) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VMInterface) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterface) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VMInterface) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VMInterface) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VMInterface) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VMInterface) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VMInterface) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterface) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VMInterface) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetCountIpaddresses returns the CountIpaddresses field value +func (o *VMInterface) GetCountIpaddresses() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CountIpaddresses +} + +// GetCountIpaddressesOk returns a tuple with the CountIpaddresses field value +// and a boolean to check if the value has been set. +func (o *VMInterface) GetCountIpaddressesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CountIpaddresses, true +} + +// SetCountIpaddresses sets field value +func (o *VMInterface) SetCountIpaddresses(v int32) { + o.CountIpaddresses = v +} + +// GetCountFhrpGroups returns the CountFhrpGroups field value +func (o *VMInterface) GetCountFhrpGroups() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CountFhrpGroups +} + +// GetCountFhrpGroupsOk returns a tuple with the CountFhrpGroups field value +// and a boolean to check if the value has been set. +func (o *VMInterface) GetCountFhrpGroupsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CountFhrpGroups, true +} + +// SetCountFhrpGroups sets field value +func (o *VMInterface) SetCountFhrpGroups(v int32) { + o.CountFhrpGroups = v +} + +func (o VMInterface) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VMInterface) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["virtual_machine"] = o.VirtualMachine + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["count_ipaddresses"] = o.CountIpaddresses + toSerialize["count_fhrp_groups"] = o.CountFhrpGroups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VMInterface) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "virtual_machine", + "name", + "l2vpn_termination", + "created", + "last_updated", + "count_ipaddresses", + "count_fhrp_groups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVMInterface := _VMInterface{} + + err = json.Unmarshal(data, &varVMInterface) + + if err != nil { + return err + } + + *o = VMInterface(varVMInterface) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "l2vpn_termination") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "count_ipaddresses") + delete(additionalProperties, "count_fhrp_groups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVMInterface struct { + value *VMInterface + isSet bool +} + +func (v NullableVMInterface) Get() *VMInterface { + return v.value +} + +func (v *NullableVMInterface) Set(val *VMInterface) { + v.value = val + v.isSet = true +} + +func (v NullableVMInterface) IsSet() bool { + return v.isSet +} + +func (v *NullableVMInterface) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVMInterface(val *VMInterface) *NullableVMInterface { + return &NullableVMInterface{value: val, isSet: true} +} + +func (v NullableVMInterface) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVMInterface) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vm_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vm_interface_request.go new file mode 100644 index 00000000..5fb078c6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vm_interface_request.go @@ -0,0 +1,705 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VMInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VMInterfaceRequest{} + +// VMInterfaceRequest Adds support for custom fields and tags. +type VMInterfaceRequest struct { + VirtualMachine NestedVirtualMachineRequest `json:"virtual_machine"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableNestedVMInterfaceRequest `json:"parent,omitempty"` + Bridge NullableNestedVMInterfaceRequest `json:"bridge,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Description *string `json:"description,omitempty"` + Mode *InterfaceModeValue `json:"mode,omitempty"` + UntaggedVlan NullableNestedVLANRequest `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + Vrf NullableNestedVRFRequest `json:"vrf,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VMInterfaceRequest VMInterfaceRequest + +// NewVMInterfaceRequest instantiates a new VMInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVMInterfaceRequest(virtualMachine NestedVirtualMachineRequest, name string) *VMInterfaceRequest { + this := VMInterfaceRequest{} + this.VirtualMachine = virtualMachine + this.Name = name + return &this +} + +// NewVMInterfaceRequestWithDefaults instantiates a new VMInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVMInterfaceRequestWithDefaults() *VMInterfaceRequest { + this := VMInterfaceRequest{} + return &this +} + +// GetVirtualMachine returns the VirtualMachine field value +func (o *VMInterfaceRequest) GetVirtualMachine() NestedVirtualMachineRequest { + if o == nil { + var ret NestedVirtualMachineRequest + return ret + } + + return o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetVirtualMachineOk() (*NestedVirtualMachineRequest, bool) { + if o == nil { + return nil, false + } + return &o.VirtualMachine, true +} + +// SetVirtualMachine sets field value +func (o *VMInterfaceRequest) SetVirtualMachine(v NestedVirtualMachineRequest) { + o.VirtualMachine = v +} + +// GetName returns the Name field value +func (o *VMInterfaceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VMInterfaceRequest) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *VMInterfaceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *VMInterfaceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterfaceRequest) GetParent() NestedVMInterfaceRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedVMInterfaceRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterfaceRequest) GetParentOk() (*NestedVMInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedVMInterfaceRequest and assigns it to the Parent field. +func (o *VMInterfaceRequest) SetParent(v NestedVMInterfaceRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *VMInterfaceRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *VMInterfaceRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterfaceRequest) GetBridge() NestedVMInterfaceRequest { + if o == nil || IsNil(o.Bridge.Get()) { + var ret NestedVMInterfaceRequest + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterfaceRequest) GetBridgeOk() (*NestedVMInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableNestedVMInterfaceRequest and assigns it to the Bridge field. +func (o *VMInterfaceRequest) SetBridge(v NestedVMInterfaceRequest) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *VMInterfaceRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *VMInterfaceRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterfaceRequest) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterfaceRequest) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *VMInterfaceRequest) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *VMInterfaceRequest) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *VMInterfaceRequest) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterfaceRequest) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterfaceRequest) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *VMInterfaceRequest) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *VMInterfaceRequest) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *VMInterfaceRequest) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VMInterfaceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VMInterfaceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *VMInterfaceRequest) GetMode() InterfaceModeValue { + if o == nil || IsNil(o.Mode) { + var ret InterfaceModeValue + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetModeOk() (*InterfaceModeValue, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given InterfaceModeValue and assigns it to the Mode field. +func (o *VMInterfaceRequest) SetMode(v InterfaceModeValue) { + o.Mode = &v +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterfaceRequest) GetUntaggedVlan() NestedVLANRequest { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret NestedVLANRequest + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterfaceRequest) GetUntaggedVlanOk() (*NestedVLANRequest, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableNestedVLANRequest and assigns it to the UntaggedVlan field. +func (o *VMInterfaceRequest) SetUntaggedVlan(v NestedVLANRequest) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *VMInterfaceRequest) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *VMInterfaceRequest) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *VMInterfaceRequest) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *VMInterfaceRequest) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VMInterfaceRequest) GetVrf() NestedVRFRequest { + if o == nil || IsNil(o.Vrf.Get()) { + var ret NestedVRFRequest + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VMInterfaceRequest) GetVrfOk() (*NestedVRFRequest, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableNestedVRFRequest and assigns it to the Vrf field. +func (o *VMInterfaceRequest) SetVrf(v NestedVRFRequest) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *VMInterfaceRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *VMInterfaceRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VMInterfaceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VMInterfaceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VMInterfaceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VMInterfaceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VMInterfaceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VMInterfaceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VMInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VMInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["virtual_machine"] = o.VirtualMachine + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VMInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "virtual_machine", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVMInterfaceRequest := _VMInterfaceRequest{} + + err = json.Unmarshal(data, &varVMInterfaceRequest) + + if err != nil { + return err + } + + *o = VMInterfaceRequest(varVMInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVMInterfaceRequest struct { + value *VMInterfaceRequest + isSet bool +} + +func (v NullableVMInterfaceRequest) Get() *VMInterfaceRequest { + return v.value +} + +func (v *NullableVMInterfaceRequest) Set(val *VMInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVMInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVMInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVMInterfaceRequest(val *VMInterfaceRequest) *NullableVMInterfaceRequest { + return &NullableVMInterfaceRequest{value: val, isSet: true} +} + +func (v NullableVMInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVMInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vrf.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vrf.go new file mode 100644 index 00000000..df52e5aa --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vrf.go @@ -0,0 +1,731 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VRF type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VRF{} + +// VRF Adds support for custom fields and tags. +type VRF struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + // Unique route distinguisher (as defined in RFC 4364) + Rd NullableString `json:"rd,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique *bool `json:"enforce_unique,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + IpaddressCount int32 `json:"ipaddress_count"` + PrefixCount int32 `json:"prefix_count"` + AdditionalProperties map[string]interface{} +} + +type _VRF VRF + +// NewVRF instantiates a new VRF object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVRF(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime, ipaddressCount int32, prefixCount int32) *VRF { + this := VRF{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Created = created + this.LastUpdated = lastUpdated + this.IpaddressCount = ipaddressCount + this.PrefixCount = prefixCount + return &this +} + +// NewVRFWithDefaults instantiates a new VRF object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVRFWithDefaults() *VRF { + this := VRF{} + return &this +} + +// GetId returns the Id field value +func (o *VRF) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VRF) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VRF) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *VRF) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *VRF) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *VRF) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *VRF) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *VRF) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *VRF) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *VRF) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VRF) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VRF) SetName(v string) { + o.Name = v +} + +// GetRd returns the Rd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VRF) GetRd() string { + if o == nil || IsNil(o.Rd.Get()) { + var ret string + return ret + } + return *o.Rd.Get() +} + +// GetRdOk returns a tuple with the Rd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VRF) GetRdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rd.Get(), o.Rd.IsSet() +} + +// HasRd returns a boolean if a field has been set. +func (o *VRF) HasRd() bool { + if o != nil && o.Rd.IsSet() { + return true + } + + return false +} + +// SetRd gets a reference to the given NullableString and assigns it to the Rd field. +func (o *VRF) SetRd(v string) { + o.Rd.Set(&v) +} + +// SetRdNil sets the value for Rd to be an explicit nil +func (o *VRF) SetRdNil() { + o.Rd.Set(nil) +} + +// UnsetRd ensures that no value is present for Rd, not even an explicit nil +func (o *VRF) UnsetRd() { + o.Rd.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VRF) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VRF) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VRF) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *VRF) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VRF) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VRF) UnsetTenant() { + o.Tenant.Unset() +} + +// GetEnforceUnique returns the EnforceUnique field value if set, zero value otherwise. +func (o *VRF) GetEnforceUnique() bool { + if o == nil || IsNil(o.EnforceUnique) { + var ret bool + return ret + } + return *o.EnforceUnique +} + +// GetEnforceUniqueOk returns a tuple with the EnforceUnique field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRF) GetEnforceUniqueOk() (*bool, bool) { + if o == nil || IsNil(o.EnforceUnique) { + return nil, false + } + return o.EnforceUnique, true +} + +// HasEnforceUnique returns a boolean if a field has been set. +func (o *VRF) HasEnforceUnique() bool { + if o != nil && !IsNil(o.EnforceUnique) { + return true + } + + return false +} + +// SetEnforceUnique gets a reference to the given bool and assigns it to the EnforceUnique field. +func (o *VRF) SetEnforceUnique(v bool) { + o.EnforceUnique = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VRF) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRF) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VRF) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VRF) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VRF) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRF) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VRF) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VRF) SetComments(v string) { + o.Comments = &v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *VRF) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRF) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *VRF) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *VRF) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *VRF) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRF) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *VRF) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *VRF) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VRF) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRF) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VRF) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *VRF) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VRF) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRF) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VRF) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VRF) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VRF) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VRF) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *VRF) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *VRF) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VRF) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *VRF) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetIpaddressCount returns the IpaddressCount field value +func (o *VRF) GetIpaddressCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.IpaddressCount +} + +// GetIpaddressCountOk returns a tuple with the IpaddressCount field value +// and a boolean to check if the value has been set. +func (o *VRF) GetIpaddressCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.IpaddressCount, true +} + +// SetIpaddressCount sets field value +func (o *VRF) SetIpaddressCount(v int32) { + o.IpaddressCount = v +} + +// GetPrefixCount returns the PrefixCount field value +func (o *VRF) GetPrefixCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PrefixCount +} + +// GetPrefixCountOk returns a tuple with the PrefixCount field value +// and a boolean to check if the value has been set. +func (o *VRF) GetPrefixCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PrefixCount, true +} + +// SetPrefixCount sets field value +func (o *VRF) SetPrefixCount(v int32) { + o.PrefixCount = v +} + +func (o VRF) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VRF) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if o.Rd.IsSet() { + toSerialize["rd"] = o.Rd.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.EnforceUnique) { + toSerialize["enforce_unique"] = o.EnforceUnique + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["ipaddress_count"] = o.IpaddressCount + toSerialize["prefix_count"] = o.PrefixCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VRF) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "created", + "last_updated", + "ipaddress_count", + "prefix_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVRF := _VRF{} + + err = json.Unmarshal(data, &varVRF) + + if err != nil { + return err + } + + *o = VRF(varVRF) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "rd") + delete(additionalProperties, "tenant") + delete(additionalProperties, "enforce_unique") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "ipaddress_count") + delete(additionalProperties, "prefix_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVRF struct { + value *VRF + isSet bool +} + +func (v NullableVRF) Get() *VRF { + return v.value +} + +func (v *NullableVRF) Set(val *VRF) { + v.value = val + v.isSet = true +} + +func (v NullableVRF) IsSet() bool { + return v.isSet +} + +func (v *NullableVRF) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVRF(val *VRF) *NullableVRF { + return &NullableVRF{value: val, isSet: true} +} + +func (v NullableVRF) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVRF) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_vrf_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_vrf_request.go new file mode 100644 index 00000000..4fd41655 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_vrf_request.go @@ -0,0 +1,523 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the VRFRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VRFRequest{} + +// VRFRequest Adds support for custom fields and tags. +type VRFRequest struct { + Name string `json:"name"` + // Unique route distinguisher (as defined in RFC 4364) + Rd NullableString `json:"rd,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique *bool `json:"enforce_unique,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VRFRequest VRFRequest + +// NewVRFRequest instantiates a new VRFRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVRFRequest(name string) *VRFRequest { + this := VRFRequest{} + this.Name = name + return &this +} + +// NewVRFRequestWithDefaults instantiates a new VRFRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVRFRequestWithDefaults() *VRFRequest { + this := VRFRequest{} + return &this +} + +// GetName returns the Name field value +func (o *VRFRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VRFRequest) SetName(v string) { + o.Name = v +} + +// GetRd returns the Rd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VRFRequest) GetRd() string { + if o == nil || IsNil(o.Rd.Get()) { + var ret string + return ret + } + return *o.Rd.Get() +} + +// GetRdOk returns a tuple with the Rd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VRFRequest) GetRdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rd.Get(), o.Rd.IsSet() +} + +// HasRd returns a boolean if a field has been set. +func (o *VRFRequest) HasRd() bool { + if o != nil && o.Rd.IsSet() { + return true + } + + return false +} + +// SetRd gets a reference to the given NullableString and assigns it to the Rd field. +func (o *VRFRequest) SetRd(v string) { + o.Rd.Set(&v) +} + +// SetRdNil sets the value for Rd to be an explicit nil +func (o *VRFRequest) SetRdNil() { + o.Rd.Set(nil) +} + +// UnsetRd ensures that no value is present for Rd, not even an explicit nil +func (o *VRFRequest) UnsetRd() { + o.Rd.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VRFRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VRFRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *VRFRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *VRFRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *VRFRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *VRFRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetEnforceUnique returns the EnforceUnique field value if set, zero value otherwise. +func (o *VRFRequest) GetEnforceUnique() bool { + if o == nil || IsNil(o.EnforceUnique) { + var ret bool + return ret + } + return *o.EnforceUnique +} + +// GetEnforceUniqueOk returns a tuple with the EnforceUnique field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetEnforceUniqueOk() (*bool, bool) { + if o == nil || IsNil(o.EnforceUnique) { + return nil, false + } + return o.EnforceUnique, true +} + +// HasEnforceUnique returns a boolean if a field has been set. +func (o *VRFRequest) HasEnforceUnique() bool { + if o != nil && !IsNil(o.EnforceUnique) { + return true + } + + return false +} + +// SetEnforceUnique gets a reference to the given bool and assigns it to the EnforceUnique field. +func (o *VRFRequest) SetEnforceUnique(v bool) { + o.EnforceUnique = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VRFRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VRFRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VRFRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *VRFRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *VRFRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *VRFRequest) SetComments(v string) { + o.Comments = &v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *VRFRequest) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *VRFRequest) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *VRFRequest) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *VRFRequest) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *VRFRequest) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *VRFRequest) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VRFRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VRFRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *VRFRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *VRFRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VRFRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *VRFRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *VRFRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o VRFRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VRFRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Rd.IsSet() { + toSerialize["rd"] = o.Rd.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.EnforceUnique) { + toSerialize["enforce_unique"] = o.EnforceUnique + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VRFRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVRFRequest := _VRFRequest{} + + err = json.Unmarshal(data, &varVRFRequest) + + if err != nil { + return err + } + + *o = VRFRequest(varVRFRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "rd") + delete(additionalProperties, "tenant") + delete(additionalProperties, "enforce_unique") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVRFRequest struct { + value *VRFRequest + isSet bool +} + +func (v NullableVRFRequest) Get() *VRFRequest { + return v.value +} + +func (v *NullableVRFRequest) Set(val *VRFRequest) { + v.value = val + v.isSet = true +} + +func (v NullableVRFRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableVRFRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVRFRequest(val *VRFRequest) *NullableVRFRequest { + return &NullableVRFRequest{value: val, isSet: true} +} + +func (v NullableVRFRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVRFRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_webhook.go b/vendor/github.com/netbox-community/go-netbox/v3/model_webhook.go new file mode 100644 index 00000000..b05f23c1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_webhook.go @@ -0,0 +1,733 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Webhook type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Webhook{} + +// Webhook Adds support for custom fields and tags. +type Webhook struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body. + PayloadUrl string `json:"payload_url"` + HttpMethod *PatchedWebhookRequestHttpMethod `json:"http_method,omitempty"` + // The complete list of official content types is available here. + HttpContentType *string `json:"http_content_type,omitempty"` + // User-supplied HTTP headers to be sent with the request in addition to the HTTP content type. Headers should be defined in the format Name: Value. Jinja2 template processing is supported with the same context as the request body (below). + AdditionalHeaders *string `json:"additional_headers,omitempty"` + // Jinja2 template for a custom request body. If blank, a JSON object representing the change will be included. Available context data includes: event, model, timestamp, username, request_id, and data. + BodyTemplate *string `json:"body_template,omitempty"` + // When provided, the request will include a X-Hook-Signature header containing a HMAC hex digest of the payload body using the secret as the key. The secret is not transmitted in the request. + Secret *string `json:"secret,omitempty"` + // Enable SSL certificate verification. Disable with caution! + SslVerification *bool `json:"ssl_verification,omitempty"` + // The specific CA certificate file to use for SSL verification. Leave blank to use the system defaults. + CaFilePath NullableString `json:"ca_file_path,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _Webhook Webhook + +// NewWebhook instantiates a new Webhook object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhook(id int32, url string, display string, name string, payloadUrl string, created NullableTime, lastUpdated NullableTime) *Webhook { + this := Webhook{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.PayloadUrl = payloadUrl + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewWebhookWithDefaults instantiates a new Webhook object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookWithDefaults() *Webhook { + this := Webhook{} + return &this +} + +// GetId returns the Id field value +func (o *Webhook) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Webhook) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *Webhook) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Webhook) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *Webhook) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *Webhook) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *Webhook) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Webhook) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Webhook) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Webhook) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Webhook) SetDescription(v string) { + o.Description = &v +} + +// GetPayloadUrl returns the PayloadUrl field value +func (o *Webhook) GetPayloadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PayloadUrl +} + +// GetPayloadUrlOk returns a tuple with the PayloadUrl field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetPayloadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PayloadUrl, true +} + +// SetPayloadUrl sets field value +func (o *Webhook) SetPayloadUrl(v string) { + o.PayloadUrl = v +} + +// GetHttpMethod returns the HttpMethod field value if set, zero value otherwise. +func (o *Webhook) GetHttpMethod() PatchedWebhookRequestHttpMethod { + if o == nil || IsNil(o.HttpMethod) { + var ret PatchedWebhookRequestHttpMethod + return ret + } + return *o.HttpMethod +} + +// GetHttpMethodOk returns a tuple with the HttpMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetHttpMethodOk() (*PatchedWebhookRequestHttpMethod, bool) { + if o == nil || IsNil(o.HttpMethod) { + return nil, false + } + return o.HttpMethod, true +} + +// HasHttpMethod returns a boolean if a field has been set. +func (o *Webhook) HasHttpMethod() bool { + if o != nil && !IsNil(o.HttpMethod) { + return true + } + + return false +} + +// SetHttpMethod gets a reference to the given PatchedWebhookRequestHttpMethod and assigns it to the HttpMethod field. +func (o *Webhook) SetHttpMethod(v PatchedWebhookRequestHttpMethod) { + o.HttpMethod = &v +} + +// GetHttpContentType returns the HttpContentType field value if set, zero value otherwise. +func (o *Webhook) GetHttpContentType() string { + if o == nil || IsNil(o.HttpContentType) { + var ret string + return ret + } + return *o.HttpContentType +} + +// GetHttpContentTypeOk returns a tuple with the HttpContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetHttpContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.HttpContentType) { + return nil, false + } + return o.HttpContentType, true +} + +// HasHttpContentType returns a boolean if a field has been set. +func (o *Webhook) HasHttpContentType() bool { + if o != nil && !IsNil(o.HttpContentType) { + return true + } + + return false +} + +// SetHttpContentType gets a reference to the given string and assigns it to the HttpContentType field. +func (o *Webhook) SetHttpContentType(v string) { + o.HttpContentType = &v +} + +// GetAdditionalHeaders returns the AdditionalHeaders field value if set, zero value otherwise. +func (o *Webhook) GetAdditionalHeaders() string { + if o == nil || IsNil(o.AdditionalHeaders) { + var ret string + return ret + } + return *o.AdditionalHeaders +} + +// GetAdditionalHeadersOk returns a tuple with the AdditionalHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetAdditionalHeadersOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalHeaders) { + return nil, false + } + return o.AdditionalHeaders, true +} + +// HasAdditionalHeaders returns a boolean if a field has been set. +func (o *Webhook) HasAdditionalHeaders() bool { + if o != nil && !IsNil(o.AdditionalHeaders) { + return true + } + + return false +} + +// SetAdditionalHeaders gets a reference to the given string and assigns it to the AdditionalHeaders field. +func (o *Webhook) SetAdditionalHeaders(v string) { + o.AdditionalHeaders = &v +} + +// GetBodyTemplate returns the BodyTemplate field value if set, zero value otherwise. +func (o *Webhook) GetBodyTemplate() string { + if o == nil || IsNil(o.BodyTemplate) { + var ret string + return ret + } + return *o.BodyTemplate +} + +// GetBodyTemplateOk returns a tuple with the BodyTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetBodyTemplateOk() (*string, bool) { + if o == nil || IsNil(o.BodyTemplate) { + return nil, false + } + return o.BodyTemplate, true +} + +// HasBodyTemplate returns a boolean if a field has been set. +func (o *Webhook) HasBodyTemplate() bool { + if o != nil && !IsNil(o.BodyTemplate) { + return true + } + + return false +} + +// SetBodyTemplate gets a reference to the given string and assigns it to the BodyTemplate field. +func (o *Webhook) SetBodyTemplate(v string) { + o.BodyTemplate = &v +} + +// GetSecret returns the Secret field value if set, zero value otherwise. +func (o *Webhook) GetSecret() string { + if o == nil || IsNil(o.Secret) { + var ret string + return ret + } + return *o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetSecretOk() (*string, bool) { + if o == nil || IsNil(o.Secret) { + return nil, false + } + return o.Secret, true +} + +// HasSecret returns a boolean if a field has been set. +func (o *Webhook) HasSecret() bool { + if o != nil && !IsNil(o.Secret) { + return true + } + + return false +} + +// SetSecret gets a reference to the given string and assigns it to the Secret field. +func (o *Webhook) SetSecret(v string) { + o.Secret = &v +} + +// GetSslVerification returns the SslVerification field value if set, zero value otherwise. +func (o *Webhook) GetSslVerification() bool { + if o == nil || IsNil(o.SslVerification) { + var ret bool + return ret + } + return *o.SslVerification +} + +// GetSslVerificationOk returns a tuple with the SslVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetSslVerificationOk() (*bool, bool) { + if o == nil || IsNil(o.SslVerification) { + return nil, false + } + return o.SslVerification, true +} + +// HasSslVerification returns a boolean if a field has been set. +func (o *Webhook) HasSslVerification() bool { + if o != nil && !IsNil(o.SslVerification) { + return true + } + + return false +} + +// SetSslVerification gets a reference to the given bool and assigns it to the SslVerification field. +func (o *Webhook) SetSslVerification(v bool) { + o.SslVerification = &v +} + +// GetCaFilePath returns the CaFilePath field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetCaFilePath() string { + if o == nil || IsNil(o.CaFilePath.Get()) { + var ret string + return ret + } + return *o.CaFilePath.Get() +} + +// GetCaFilePathOk returns a tuple with the CaFilePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetCaFilePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CaFilePath.Get(), o.CaFilePath.IsSet() +} + +// HasCaFilePath returns a boolean if a field has been set. +func (o *Webhook) HasCaFilePath() bool { + if o != nil && o.CaFilePath.IsSet() { + return true + } + + return false +} + +// SetCaFilePath gets a reference to the given NullableString and assigns it to the CaFilePath field. +func (o *Webhook) SetCaFilePath(v string) { + o.CaFilePath.Set(&v) +} + +// SetCaFilePathNil sets the value for CaFilePath to be an explicit nil +func (o *Webhook) SetCaFilePathNil() { + o.CaFilePath.Set(nil) +} + +// UnsetCaFilePath ensures that no value is present for CaFilePath, not even an explicit nil +func (o *Webhook) UnsetCaFilePath() { + o.CaFilePath.Unset() +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *Webhook) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *Webhook) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *Webhook) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Webhook) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Webhook) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *Webhook) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Webhook) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *Webhook) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Webhook) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *Webhook) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o Webhook) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Webhook) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["payload_url"] = o.PayloadUrl + if !IsNil(o.HttpMethod) { + toSerialize["http_method"] = o.HttpMethod + } + if !IsNil(o.HttpContentType) { + toSerialize["http_content_type"] = o.HttpContentType + } + if !IsNil(o.AdditionalHeaders) { + toSerialize["additional_headers"] = o.AdditionalHeaders + } + if !IsNil(o.BodyTemplate) { + toSerialize["body_template"] = o.BodyTemplate + } + if !IsNil(o.Secret) { + toSerialize["secret"] = o.Secret + } + if !IsNil(o.SslVerification) { + toSerialize["ssl_verification"] = o.SslVerification + } + if o.CaFilePath.IsSet() { + toSerialize["ca_file_path"] = o.CaFilePath.Get() + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Webhook) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "payload_url", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhook := _Webhook{} + + err = json.Unmarshal(data, &varWebhook) + + if err != nil { + return err + } + + *o = Webhook(varWebhook) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "payload_url") + delete(additionalProperties, "http_method") + delete(additionalProperties, "http_content_type") + delete(additionalProperties, "additional_headers") + delete(additionalProperties, "body_template") + delete(additionalProperties, "secret") + delete(additionalProperties, "ssl_verification") + delete(additionalProperties, "ca_file_path") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "tags") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWebhook struct { + value *Webhook + isSet bool +} + +func (v NullableWebhook) Get() *Webhook { + return v.value +} + +func (v *NullableWebhook) Set(val *Webhook) { + v.value = val + v.isSet = true +} + +func (v NullableWebhook) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhook) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhook(val *Webhook) *NullableWebhook { + return &NullableWebhook{value: val, isSet: true} +} + +func (v NullableWebhook) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhook) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_webhook_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_webhook_request.go new file mode 100644 index 00000000..a7948dc0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_webhook_request.go @@ -0,0 +1,583 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WebhookRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookRequest{} + +// WebhookRequest Adds support for custom fields and tags. +type WebhookRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body. + PayloadUrl string `json:"payload_url"` + HttpMethod *PatchedWebhookRequestHttpMethod `json:"http_method,omitempty"` + // The complete list of official content types is available here. + HttpContentType *string `json:"http_content_type,omitempty"` + // User-supplied HTTP headers to be sent with the request in addition to the HTTP content type. Headers should be defined in the format Name: Value. Jinja2 template processing is supported with the same context as the request body (below). + AdditionalHeaders *string `json:"additional_headers,omitempty"` + // Jinja2 template for a custom request body. If blank, a JSON object representing the change will be included. Available context data includes: event, model, timestamp, username, request_id, and data. + BodyTemplate *string `json:"body_template,omitempty"` + // When provided, the request will include a X-Hook-Signature header containing a HMAC hex digest of the payload body using the secret as the key. The secret is not transmitted in the request. + Secret *string `json:"secret,omitempty"` + // Enable SSL certificate verification. Disable with caution! + SslVerification *bool `json:"ssl_verification,omitempty"` + // The specific CA certificate file to use for SSL verification. Leave blank to use the system defaults. + CaFilePath NullableString `json:"ca_file_path,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WebhookRequest WebhookRequest + +// NewWebhookRequest instantiates a new WebhookRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookRequest(name string, payloadUrl string) *WebhookRequest { + this := WebhookRequest{} + this.Name = name + this.PayloadUrl = payloadUrl + return &this +} + +// NewWebhookRequestWithDefaults instantiates a new WebhookRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookRequestWithDefaults() *WebhookRequest { + this := WebhookRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WebhookRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WebhookRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WebhookRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WebhookRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WebhookRequest) SetDescription(v string) { + o.Description = &v +} + +// GetPayloadUrl returns the PayloadUrl field value +func (o *WebhookRequest) GetPayloadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PayloadUrl +} + +// GetPayloadUrlOk returns a tuple with the PayloadUrl field value +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetPayloadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PayloadUrl, true +} + +// SetPayloadUrl sets field value +func (o *WebhookRequest) SetPayloadUrl(v string) { + o.PayloadUrl = v +} + +// GetHttpMethod returns the HttpMethod field value if set, zero value otherwise. +func (o *WebhookRequest) GetHttpMethod() PatchedWebhookRequestHttpMethod { + if o == nil || IsNil(o.HttpMethod) { + var ret PatchedWebhookRequestHttpMethod + return ret + } + return *o.HttpMethod +} + +// GetHttpMethodOk returns a tuple with the HttpMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetHttpMethodOk() (*PatchedWebhookRequestHttpMethod, bool) { + if o == nil || IsNil(o.HttpMethod) { + return nil, false + } + return o.HttpMethod, true +} + +// HasHttpMethod returns a boolean if a field has been set. +func (o *WebhookRequest) HasHttpMethod() bool { + if o != nil && !IsNil(o.HttpMethod) { + return true + } + + return false +} + +// SetHttpMethod gets a reference to the given PatchedWebhookRequestHttpMethod and assigns it to the HttpMethod field. +func (o *WebhookRequest) SetHttpMethod(v PatchedWebhookRequestHttpMethod) { + o.HttpMethod = &v +} + +// GetHttpContentType returns the HttpContentType field value if set, zero value otherwise. +func (o *WebhookRequest) GetHttpContentType() string { + if o == nil || IsNil(o.HttpContentType) { + var ret string + return ret + } + return *o.HttpContentType +} + +// GetHttpContentTypeOk returns a tuple with the HttpContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetHttpContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.HttpContentType) { + return nil, false + } + return o.HttpContentType, true +} + +// HasHttpContentType returns a boolean if a field has been set. +func (o *WebhookRequest) HasHttpContentType() bool { + if o != nil && !IsNil(o.HttpContentType) { + return true + } + + return false +} + +// SetHttpContentType gets a reference to the given string and assigns it to the HttpContentType field. +func (o *WebhookRequest) SetHttpContentType(v string) { + o.HttpContentType = &v +} + +// GetAdditionalHeaders returns the AdditionalHeaders field value if set, zero value otherwise. +func (o *WebhookRequest) GetAdditionalHeaders() string { + if o == nil || IsNil(o.AdditionalHeaders) { + var ret string + return ret + } + return *o.AdditionalHeaders +} + +// GetAdditionalHeadersOk returns a tuple with the AdditionalHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetAdditionalHeadersOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalHeaders) { + return nil, false + } + return o.AdditionalHeaders, true +} + +// HasAdditionalHeaders returns a boolean if a field has been set. +func (o *WebhookRequest) HasAdditionalHeaders() bool { + if o != nil && !IsNil(o.AdditionalHeaders) { + return true + } + + return false +} + +// SetAdditionalHeaders gets a reference to the given string and assigns it to the AdditionalHeaders field. +func (o *WebhookRequest) SetAdditionalHeaders(v string) { + o.AdditionalHeaders = &v +} + +// GetBodyTemplate returns the BodyTemplate field value if set, zero value otherwise. +func (o *WebhookRequest) GetBodyTemplate() string { + if o == nil || IsNil(o.BodyTemplate) { + var ret string + return ret + } + return *o.BodyTemplate +} + +// GetBodyTemplateOk returns a tuple with the BodyTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetBodyTemplateOk() (*string, bool) { + if o == nil || IsNil(o.BodyTemplate) { + return nil, false + } + return o.BodyTemplate, true +} + +// HasBodyTemplate returns a boolean if a field has been set. +func (o *WebhookRequest) HasBodyTemplate() bool { + if o != nil && !IsNil(o.BodyTemplate) { + return true + } + + return false +} + +// SetBodyTemplate gets a reference to the given string and assigns it to the BodyTemplate field. +func (o *WebhookRequest) SetBodyTemplate(v string) { + o.BodyTemplate = &v +} + +// GetSecret returns the Secret field value if set, zero value otherwise. +func (o *WebhookRequest) GetSecret() string { + if o == nil || IsNil(o.Secret) { + var ret string + return ret + } + return *o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetSecretOk() (*string, bool) { + if o == nil || IsNil(o.Secret) { + return nil, false + } + return o.Secret, true +} + +// HasSecret returns a boolean if a field has been set. +func (o *WebhookRequest) HasSecret() bool { + if o != nil && !IsNil(o.Secret) { + return true + } + + return false +} + +// SetSecret gets a reference to the given string and assigns it to the Secret field. +func (o *WebhookRequest) SetSecret(v string) { + o.Secret = &v +} + +// GetSslVerification returns the SslVerification field value if set, zero value otherwise. +func (o *WebhookRequest) GetSslVerification() bool { + if o == nil || IsNil(o.SslVerification) { + var ret bool + return ret + } + return *o.SslVerification +} + +// GetSslVerificationOk returns a tuple with the SslVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetSslVerificationOk() (*bool, bool) { + if o == nil || IsNil(o.SslVerification) { + return nil, false + } + return o.SslVerification, true +} + +// HasSslVerification returns a boolean if a field has been set. +func (o *WebhookRequest) HasSslVerification() bool { + if o != nil && !IsNil(o.SslVerification) { + return true + } + + return false +} + +// SetSslVerification gets a reference to the given bool and assigns it to the SslVerification field. +func (o *WebhookRequest) SetSslVerification(v bool) { + o.SslVerification = &v +} + +// GetCaFilePath returns the CaFilePath field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookRequest) GetCaFilePath() string { + if o == nil || IsNil(o.CaFilePath.Get()) { + var ret string + return ret + } + return *o.CaFilePath.Get() +} + +// GetCaFilePathOk returns a tuple with the CaFilePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookRequest) GetCaFilePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CaFilePath.Get(), o.CaFilePath.IsSet() +} + +// HasCaFilePath returns a boolean if a field has been set. +func (o *WebhookRequest) HasCaFilePath() bool { + if o != nil && o.CaFilePath.IsSet() { + return true + } + + return false +} + +// SetCaFilePath gets a reference to the given NullableString and assigns it to the CaFilePath field. +func (o *WebhookRequest) SetCaFilePath(v string) { + o.CaFilePath.Set(&v) +} + +// SetCaFilePathNil sets the value for CaFilePath to be an explicit nil +func (o *WebhookRequest) SetCaFilePathNil() { + o.CaFilePath.Set(nil) +} + +// UnsetCaFilePath ensures that no value is present for CaFilePath, not even an explicit nil +func (o *WebhookRequest) UnsetCaFilePath() { + o.CaFilePath.Unset() +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WebhookRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WebhookRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WebhookRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WebhookRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WebhookRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WebhookRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o WebhookRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["payload_url"] = o.PayloadUrl + if !IsNil(o.HttpMethod) { + toSerialize["http_method"] = o.HttpMethod + } + if !IsNil(o.HttpContentType) { + toSerialize["http_content_type"] = o.HttpContentType + } + if !IsNil(o.AdditionalHeaders) { + toSerialize["additional_headers"] = o.AdditionalHeaders + } + if !IsNil(o.BodyTemplate) { + toSerialize["body_template"] = o.BodyTemplate + } + if !IsNil(o.Secret) { + toSerialize["secret"] = o.Secret + } + if !IsNil(o.SslVerification) { + toSerialize["ssl_verification"] = o.SslVerification + } + if o.CaFilePath.IsSet() { + toSerialize["ca_file_path"] = o.CaFilePath.Get() + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WebhookRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "payload_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookRequest := _WebhookRequest{} + + err = json.Unmarshal(data, &varWebhookRequest) + + if err != nil { + return err + } + + *o = WebhookRequest(varWebhookRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "payload_url") + delete(additionalProperties, "http_method") + delete(additionalProperties, "http_content_type") + delete(additionalProperties, "additional_headers") + delete(additionalProperties, "body_template") + delete(additionalProperties, "secret") + delete(additionalProperties, "ssl_verification") + delete(additionalProperties, "ca_file_path") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWebhookRequest struct { + value *WebhookRequest + isSet bool +} + +func (v NullableWebhookRequest) Get() *WebhookRequest { + return v.value +} + +func (v *NullableWebhookRequest) Set(val *WebhookRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookRequest(val *WebhookRequest) *NullableWebhookRequest { + return &NullableWebhookRequest{value: val, isSet: true} +} + +func (v NullableWebhookRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_channel.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_channel.go new file mode 100644 index 00000000..994da1ac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_channel.go @@ -0,0 +1,502 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessChannel * `2.4g-1-2412-22` - 1 (2412 MHz) * `2.4g-2-2417-22` - 2 (2417 MHz) * `2.4g-3-2422-22` - 3 (2422 MHz) * `2.4g-4-2427-22` - 4 (2427 MHz) * `2.4g-5-2432-22` - 5 (2432 MHz) * `2.4g-6-2437-22` - 6 (2437 MHz) * `2.4g-7-2442-22` - 7 (2442 MHz) * `2.4g-8-2447-22` - 8 (2447 MHz) * `2.4g-9-2452-22` - 9 (2452 MHz) * `2.4g-10-2457-22` - 10 (2457 MHz) * `2.4g-11-2462-22` - 11 (2462 MHz) * `2.4g-12-2467-22` - 12 (2467 MHz) * `2.4g-13-2472-22` - 13 (2472 MHz) * `5g-32-5160-20` - 32 (5160/20 MHz) * `5g-34-5170-40` - 34 (5170/40 MHz) * `5g-36-5180-20` - 36 (5180/20 MHz) * `5g-38-5190-40` - 38 (5190/40 MHz) * `5g-40-5200-20` - 40 (5200/20 MHz) * `5g-42-5210-80` - 42 (5210/80 MHz) * `5g-44-5220-20` - 44 (5220/20 MHz) * `5g-46-5230-40` - 46 (5230/40 MHz) * `5g-48-5240-20` - 48 (5240/20 MHz) * `5g-50-5250-160` - 50 (5250/160 MHz) * `5g-52-5260-20` - 52 (5260/20 MHz) * `5g-54-5270-40` - 54 (5270/40 MHz) * `5g-56-5280-20` - 56 (5280/20 MHz) * `5g-58-5290-80` - 58 (5290/80 MHz) * `5g-60-5300-20` - 60 (5300/20 MHz) * `5g-62-5310-40` - 62 (5310/40 MHz) * `5g-64-5320-20` - 64 (5320/20 MHz) * `5g-100-5500-20` - 100 (5500/20 MHz) * `5g-102-5510-40` - 102 (5510/40 MHz) * `5g-104-5520-20` - 104 (5520/20 MHz) * `5g-106-5530-80` - 106 (5530/80 MHz) * `5g-108-5540-20` - 108 (5540/20 MHz) * `5g-110-5550-40` - 110 (5550/40 MHz) * `5g-112-5560-20` - 112 (5560/20 MHz) * `5g-114-5570-160` - 114 (5570/160 MHz) * `5g-116-5580-20` - 116 (5580/20 MHz) * `5g-118-5590-40` - 118 (5590/40 MHz) * `5g-120-5600-20` - 120 (5600/20 MHz) * `5g-122-5610-80` - 122 (5610/80 MHz) * `5g-124-5620-20` - 124 (5620/20 MHz) * `5g-126-5630-40` - 126 (5630/40 MHz) * `5g-128-5640-20` - 128 (5640/20 MHz) * `5g-132-5660-20` - 132 (5660/20 MHz) * `5g-134-5670-40` - 134 (5670/40 MHz) * `5g-136-5680-20` - 136 (5680/20 MHz) * `5g-138-5690-80` - 138 (5690/80 MHz) * `5g-140-5700-20` - 140 (5700/20 MHz) * `5g-142-5710-40` - 142 (5710/40 MHz) * `5g-144-5720-20` - 144 (5720/20 MHz) * `5g-149-5745-20` - 149 (5745/20 MHz) * `5g-151-5755-40` - 151 (5755/40 MHz) * `5g-153-5765-20` - 153 (5765/20 MHz) * `5g-155-5775-80` - 155 (5775/80 MHz) * `5g-157-5785-20` - 157 (5785/20 MHz) * `5g-159-5795-40` - 159 (5795/40 MHz) * `5g-161-5805-20` - 161 (5805/20 MHz) * `5g-163-5815-160` - 163 (5815/160 MHz) * `5g-165-5825-20` - 165 (5825/20 MHz) * `5g-167-5835-40` - 167 (5835/40 MHz) * `5g-169-5845-20` - 169 (5845/20 MHz) * `5g-171-5855-80` - 171 (5855/80 MHz) * `5g-173-5865-20` - 173 (5865/20 MHz) * `5g-175-5875-40` - 175 (5875/40 MHz) * `5g-177-5885-20` - 177 (5885/20 MHz) * `6g-1-5955-20` - 1 (5955/20 MHz) * `6g-3-5965-40` - 3 (5965/40 MHz) * `6g-5-5975-20` - 5 (5975/20 MHz) * `6g-7-5985-80` - 7 (5985/80 MHz) * `6g-9-5995-20` - 9 (5995/20 MHz) * `6g-11-6005-40` - 11 (6005/40 MHz) * `6g-13-6015-20` - 13 (6015/20 MHz) * `6g-15-6025-160` - 15 (6025/160 MHz) * `6g-17-6035-20` - 17 (6035/20 MHz) * `6g-19-6045-40` - 19 (6045/40 MHz) * `6g-21-6055-20` - 21 (6055/20 MHz) * `6g-23-6065-80` - 23 (6065/80 MHz) * `6g-25-6075-20` - 25 (6075/20 MHz) * `6g-27-6085-40` - 27 (6085/40 MHz) * `6g-29-6095-20` - 29 (6095/20 MHz) * `6g-31-6105-320` - 31 (6105/320 MHz) * `6g-33-6115-20` - 33 (6115/20 MHz) * `6g-35-6125-40` - 35 (6125/40 MHz) * `6g-37-6135-20` - 37 (6135/20 MHz) * `6g-39-6145-80` - 39 (6145/80 MHz) * `6g-41-6155-20` - 41 (6155/20 MHz) * `6g-43-6165-40` - 43 (6165/40 MHz) * `6g-45-6175-20` - 45 (6175/20 MHz) * `6g-47-6185-160` - 47 (6185/160 MHz) * `6g-49-6195-20` - 49 (6195/20 MHz) * `6g-51-6205-40` - 51 (6205/40 MHz) * `6g-53-6215-20` - 53 (6215/20 MHz) * `6g-55-6225-80` - 55 (6225/80 MHz) * `6g-57-6235-20` - 57 (6235/20 MHz) * `6g-59-6245-40` - 59 (6245/40 MHz) * `6g-61-6255-20` - 61 (6255/20 MHz) * `6g-65-6275-20` - 65 (6275/20 MHz) * `6g-67-6285-40` - 67 (6285/40 MHz) * `6g-69-6295-20` - 69 (6295/20 MHz) * `6g-71-6305-80` - 71 (6305/80 MHz) * `6g-73-6315-20` - 73 (6315/20 MHz) * `6g-75-6325-40` - 75 (6325/40 MHz) * `6g-77-6335-20` - 77 (6335/20 MHz) * `6g-79-6345-160` - 79 (6345/160 MHz) * `6g-81-6355-20` - 81 (6355/20 MHz) * `6g-83-6365-40` - 83 (6365/40 MHz) * `6g-85-6375-20` - 85 (6375/20 MHz) * `6g-87-6385-80` - 87 (6385/80 MHz) * `6g-89-6395-20` - 89 (6395/20 MHz) * `6g-91-6405-40` - 91 (6405/40 MHz) * `6g-93-6415-20` - 93 (6415/20 MHz) * `6g-95-6425-320` - 95 (6425/320 MHz) * `6g-97-6435-20` - 97 (6435/20 MHz) * `6g-99-6445-40` - 99 (6445/40 MHz) * `6g-101-6455-20` - 101 (6455/20 MHz) * `6g-103-6465-80` - 103 (6465/80 MHz) * `6g-105-6475-20` - 105 (6475/20 MHz) * `6g-107-6485-40` - 107 (6485/40 MHz) * `6g-109-6495-20` - 109 (6495/20 MHz) * `6g-111-6505-160` - 111 (6505/160 MHz) * `6g-113-6515-20` - 113 (6515/20 MHz) * `6g-115-6525-40` - 115 (6525/40 MHz) * `6g-117-6535-20` - 117 (6535/20 MHz) * `6g-119-6545-80` - 119 (6545/80 MHz) * `6g-121-6555-20` - 121 (6555/20 MHz) * `6g-123-6565-40` - 123 (6565/40 MHz) * `6g-125-6575-20` - 125 (6575/20 MHz) * `6g-129-6595-20` - 129 (6595/20 MHz) * `6g-131-6605-40` - 131 (6605/40 MHz) * `6g-133-6615-20` - 133 (6615/20 MHz) * `6g-135-6625-80` - 135 (6625/80 MHz) * `6g-137-6635-20` - 137 (6635/20 MHz) * `6g-139-6645-40` - 139 (6645/40 MHz) * `6g-141-6655-20` - 141 (6655/20 MHz) * `6g-143-6665-160` - 143 (6665/160 MHz) * `6g-145-6675-20` - 145 (6675/20 MHz) * `6g-147-6685-40` - 147 (6685/40 MHz) * `6g-149-6695-20` - 149 (6695/20 MHz) * `6g-151-6705-80` - 151 (6705/80 MHz) * `6g-153-6715-20` - 153 (6715/20 MHz) * `6g-155-6725-40` - 155 (6725/40 MHz) * `6g-157-6735-20` - 157 (6735/20 MHz) * `6g-159-6745-320` - 159 (6745/320 MHz) * `6g-161-6755-20` - 161 (6755/20 MHz) * `6g-163-6765-40` - 163 (6765/40 MHz) * `6g-165-6775-20` - 165 (6775/20 MHz) * `6g-167-6785-80` - 167 (6785/80 MHz) * `6g-169-6795-20` - 169 (6795/20 MHz) * `6g-171-6805-40` - 171 (6805/40 MHz) * `6g-173-6815-20` - 173 (6815/20 MHz) * `6g-175-6825-160` - 175 (6825/160 MHz) * `6g-177-6835-20` - 177 (6835/20 MHz) * `6g-179-6845-40` - 179 (6845/40 MHz) * `6g-181-6855-20` - 181 (6855/20 MHz) * `6g-183-6865-80` - 183 (6865/80 MHz) * `6g-185-6875-20` - 185 (6875/20 MHz) * `6g-187-6885-40` - 187 (6885/40 MHz) * `6g-189-6895-20` - 189 (6895/20 MHz) * `6g-193-6915-20` - 193 (6915/20 MHz) * `6g-195-6925-40` - 195 (6925/40 MHz) * `6g-197-6935-20` - 197 (6935/20 MHz) * `6g-199-6945-80` - 199 (6945/80 MHz) * `6g-201-6955-20` - 201 (6955/20 MHz) * `6g-203-6965-40` - 203 (6965/40 MHz) * `6g-205-6975-20` - 205 (6975/20 MHz) * `6g-207-6985-160` - 207 (6985/160 MHz) * `6g-209-6995-20` - 209 (6995/20 MHz) * `6g-211-7005-40` - 211 (7005/40 MHz) * `6g-213-7015-20` - 213 (7015/20 MHz) * `6g-215-7025-80` - 215 (7025/80 MHz) * `6g-217-7035-20` - 217 (7035/20 MHz) * `6g-219-7045-40` - 219 (7045/40 MHz) * `6g-221-7055-20` - 221 (7055/20 MHz) * `6g-225-7075-20` - 225 (7075/20 MHz) * `6g-227-7085-40` - 227 (7085/40 MHz) * `6g-229-7095-20` - 229 (7095/20 MHz) * `6g-233-7115-20` - 233 (7115/20 MHz) * `60g-1-58320-2160` - 1 (58.32/2.16 GHz) * `60g-2-60480-2160` - 2 (60.48/2.16 GHz) * `60g-3-62640-2160` - 3 (62.64/2.16 GHz) * `60g-4-64800-2160` - 4 (64.80/2.16 GHz) * `60g-5-66960-2160` - 5 (66.96/2.16 GHz) * `60g-6-69120-2160` - 6 (69.12/2.16 GHz) * `60g-9-59400-4320` - 9 (59.40/4.32 GHz) * `60g-10-61560-4320` - 10 (61.56/4.32 GHz) * `60g-11-63720-4320` - 11 (63.72/4.32 GHz) * `60g-12-65880-4320` - 12 (65.88/4.32 GHz) * `60g-13-68040-4320` - 13 (68.04/4.32 GHz) * `60g-17-60480-6480` - 17 (60.48/6.48 GHz) * `60g-18-62640-6480` - 18 (62.64/6.48 GHz) * `60g-19-64800-6480` - 19 (64.80/6.48 GHz) * `60g-20-66960-6480` - 20 (66.96/6.48 GHz) * `60g-25-61560-6480` - 25 (61.56/8.64 GHz) * `60g-26-63720-6480` - 26 (63.72/8.64 GHz) * `60g-27-65880-6480` - 27 (65.88/8.64 GHz) +type WirelessChannel string + +// List of Wireless_channel +const ( + WIRELESSCHANNEL__2_4G_1_2412_22 WirelessChannel = "2.4g-1-2412-22" + WIRELESSCHANNEL__2_4G_2_2417_22 WirelessChannel = "2.4g-2-2417-22" + WIRELESSCHANNEL__2_4G_3_2422_22 WirelessChannel = "2.4g-3-2422-22" + WIRELESSCHANNEL__2_4G_4_2427_22 WirelessChannel = "2.4g-4-2427-22" + WIRELESSCHANNEL__2_4G_5_2432_22 WirelessChannel = "2.4g-5-2432-22" + WIRELESSCHANNEL__2_4G_6_2437_22 WirelessChannel = "2.4g-6-2437-22" + WIRELESSCHANNEL__2_4G_7_2442_22 WirelessChannel = "2.4g-7-2442-22" + WIRELESSCHANNEL__2_4G_8_2447_22 WirelessChannel = "2.4g-8-2447-22" + WIRELESSCHANNEL__2_4G_9_2452_22 WirelessChannel = "2.4g-9-2452-22" + WIRELESSCHANNEL__2_4G_10_2457_22 WirelessChannel = "2.4g-10-2457-22" + WIRELESSCHANNEL__2_4G_11_2462_22 WirelessChannel = "2.4g-11-2462-22" + WIRELESSCHANNEL__2_4G_12_2467_22 WirelessChannel = "2.4g-12-2467-22" + WIRELESSCHANNEL__2_4G_13_2472_22 WirelessChannel = "2.4g-13-2472-22" + WIRELESSCHANNEL__5G_32_5160_20 WirelessChannel = "5g-32-5160-20" + WIRELESSCHANNEL__5G_34_5170_40 WirelessChannel = "5g-34-5170-40" + WIRELESSCHANNEL__5G_36_5180_20 WirelessChannel = "5g-36-5180-20" + WIRELESSCHANNEL__5G_38_5190_40 WirelessChannel = "5g-38-5190-40" + WIRELESSCHANNEL__5G_40_5200_20 WirelessChannel = "5g-40-5200-20" + WIRELESSCHANNEL__5G_42_5210_80 WirelessChannel = "5g-42-5210-80" + WIRELESSCHANNEL__5G_44_5220_20 WirelessChannel = "5g-44-5220-20" + WIRELESSCHANNEL__5G_46_5230_40 WirelessChannel = "5g-46-5230-40" + WIRELESSCHANNEL__5G_48_5240_20 WirelessChannel = "5g-48-5240-20" + WIRELESSCHANNEL__5G_50_5250_160 WirelessChannel = "5g-50-5250-160" + WIRELESSCHANNEL__5G_52_5260_20 WirelessChannel = "5g-52-5260-20" + WIRELESSCHANNEL__5G_54_5270_40 WirelessChannel = "5g-54-5270-40" + WIRELESSCHANNEL__5G_56_5280_20 WirelessChannel = "5g-56-5280-20" + WIRELESSCHANNEL__5G_58_5290_80 WirelessChannel = "5g-58-5290-80" + WIRELESSCHANNEL__5G_60_5300_20 WirelessChannel = "5g-60-5300-20" + WIRELESSCHANNEL__5G_62_5310_40 WirelessChannel = "5g-62-5310-40" + WIRELESSCHANNEL__5G_64_5320_20 WirelessChannel = "5g-64-5320-20" + WIRELESSCHANNEL__5G_100_5500_20 WirelessChannel = "5g-100-5500-20" + WIRELESSCHANNEL__5G_102_5510_40 WirelessChannel = "5g-102-5510-40" + WIRELESSCHANNEL__5G_104_5520_20 WirelessChannel = "5g-104-5520-20" + WIRELESSCHANNEL__5G_106_5530_80 WirelessChannel = "5g-106-5530-80" + WIRELESSCHANNEL__5G_108_5540_20 WirelessChannel = "5g-108-5540-20" + WIRELESSCHANNEL__5G_110_5550_40 WirelessChannel = "5g-110-5550-40" + WIRELESSCHANNEL__5G_112_5560_20 WirelessChannel = "5g-112-5560-20" + WIRELESSCHANNEL__5G_114_5570_160 WirelessChannel = "5g-114-5570-160" + WIRELESSCHANNEL__5G_116_5580_20 WirelessChannel = "5g-116-5580-20" + WIRELESSCHANNEL__5G_118_5590_40 WirelessChannel = "5g-118-5590-40" + WIRELESSCHANNEL__5G_120_5600_20 WirelessChannel = "5g-120-5600-20" + WIRELESSCHANNEL__5G_122_5610_80 WirelessChannel = "5g-122-5610-80" + WIRELESSCHANNEL__5G_124_5620_20 WirelessChannel = "5g-124-5620-20" + WIRELESSCHANNEL__5G_126_5630_40 WirelessChannel = "5g-126-5630-40" + WIRELESSCHANNEL__5G_128_5640_20 WirelessChannel = "5g-128-5640-20" + WIRELESSCHANNEL__5G_132_5660_20 WirelessChannel = "5g-132-5660-20" + WIRELESSCHANNEL__5G_134_5670_40 WirelessChannel = "5g-134-5670-40" + WIRELESSCHANNEL__5G_136_5680_20 WirelessChannel = "5g-136-5680-20" + WIRELESSCHANNEL__5G_138_5690_80 WirelessChannel = "5g-138-5690-80" + WIRELESSCHANNEL__5G_140_5700_20 WirelessChannel = "5g-140-5700-20" + WIRELESSCHANNEL__5G_142_5710_40 WirelessChannel = "5g-142-5710-40" + WIRELESSCHANNEL__5G_144_5720_20 WirelessChannel = "5g-144-5720-20" + WIRELESSCHANNEL__5G_149_5745_20 WirelessChannel = "5g-149-5745-20" + WIRELESSCHANNEL__5G_151_5755_40 WirelessChannel = "5g-151-5755-40" + WIRELESSCHANNEL__5G_153_5765_20 WirelessChannel = "5g-153-5765-20" + WIRELESSCHANNEL__5G_155_5775_80 WirelessChannel = "5g-155-5775-80" + WIRELESSCHANNEL__5G_157_5785_20 WirelessChannel = "5g-157-5785-20" + WIRELESSCHANNEL__5G_159_5795_40 WirelessChannel = "5g-159-5795-40" + WIRELESSCHANNEL__5G_161_5805_20 WirelessChannel = "5g-161-5805-20" + WIRELESSCHANNEL__5G_163_5815_160 WirelessChannel = "5g-163-5815-160" + WIRELESSCHANNEL__5G_165_5825_20 WirelessChannel = "5g-165-5825-20" + WIRELESSCHANNEL__5G_167_5835_40 WirelessChannel = "5g-167-5835-40" + WIRELESSCHANNEL__5G_169_5845_20 WirelessChannel = "5g-169-5845-20" + WIRELESSCHANNEL__5G_171_5855_80 WirelessChannel = "5g-171-5855-80" + WIRELESSCHANNEL__5G_173_5865_20 WirelessChannel = "5g-173-5865-20" + WIRELESSCHANNEL__5G_175_5875_40 WirelessChannel = "5g-175-5875-40" + WIRELESSCHANNEL__5G_177_5885_20 WirelessChannel = "5g-177-5885-20" + WIRELESSCHANNEL__6G_1_5955_20 WirelessChannel = "6g-1-5955-20" + WIRELESSCHANNEL__6G_3_5965_40 WirelessChannel = "6g-3-5965-40" + WIRELESSCHANNEL__6G_5_5975_20 WirelessChannel = "6g-5-5975-20" + WIRELESSCHANNEL__6G_7_5985_80 WirelessChannel = "6g-7-5985-80" + WIRELESSCHANNEL__6G_9_5995_20 WirelessChannel = "6g-9-5995-20" + WIRELESSCHANNEL__6G_11_6005_40 WirelessChannel = "6g-11-6005-40" + WIRELESSCHANNEL__6G_13_6015_20 WirelessChannel = "6g-13-6015-20" + WIRELESSCHANNEL__6G_15_6025_160 WirelessChannel = "6g-15-6025-160" + WIRELESSCHANNEL__6G_17_6035_20 WirelessChannel = "6g-17-6035-20" + WIRELESSCHANNEL__6G_19_6045_40 WirelessChannel = "6g-19-6045-40" + WIRELESSCHANNEL__6G_21_6055_20 WirelessChannel = "6g-21-6055-20" + WIRELESSCHANNEL__6G_23_6065_80 WirelessChannel = "6g-23-6065-80" + WIRELESSCHANNEL__6G_25_6075_20 WirelessChannel = "6g-25-6075-20" + WIRELESSCHANNEL__6G_27_6085_40 WirelessChannel = "6g-27-6085-40" + WIRELESSCHANNEL__6G_29_6095_20 WirelessChannel = "6g-29-6095-20" + WIRELESSCHANNEL__6G_31_6105_320 WirelessChannel = "6g-31-6105-320" + WIRELESSCHANNEL__6G_33_6115_20 WirelessChannel = "6g-33-6115-20" + WIRELESSCHANNEL__6G_35_6125_40 WirelessChannel = "6g-35-6125-40" + WIRELESSCHANNEL__6G_37_6135_20 WirelessChannel = "6g-37-6135-20" + WIRELESSCHANNEL__6G_39_6145_80 WirelessChannel = "6g-39-6145-80" + WIRELESSCHANNEL__6G_41_6155_20 WirelessChannel = "6g-41-6155-20" + WIRELESSCHANNEL__6G_43_6165_40 WirelessChannel = "6g-43-6165-40" + WIRELESSCHANNEL__6G_45_6175_20 WirelessChannel = "6g-45-6175-20" + WIRELESSCHANNEL__6G_47_6185_160 WirelessChannel = "6g-47-6185-160" + WIRELESSCHANNEL__6G_49_6195_20 WirelessChannel = "6g-49-6195-20" + WIRELESSCHANNEL__6G_51_6205_40 WirelessChannel = "6g-51-6205-40" + WIRELESSCHANNEL__6G_53_6215_20 WirelessChannel = "6g-53-6215-20" + WIRELESSCHANNEL__6G_55_6225_80 WirelessChannel = "6g-55-6225-80" + WIRELESSCHANNEL__6G_57_6235_20 WirelessChannel = "6g-57-6235-20" + WIRELESSCHANNEL__6G_59_6245_40 WirelessChannel = "6g-59-6245-40" + WIRELESSCHANNEL__6G_61_6255_20 WirelessChannel = "6g-61-6255-20" + WIRELESSCHANNEL__6G_65_6275_20 WirelessChannel = "6g-65-6275-20" + WIRELESSCHANNEL__6G_67_6285_40 WirelessChannel = "6g-67-6285-40" + WIRELESSCHANNEL__6G_69_6295_20 WirelessChannel = "6g-69-6295-20" + WIRELESSCHANNEL__6G_71_6305_80 WirelessChannel = "6g-71-6305-80" + WIRELESSCHANNEL__6G_73_6315_20 WirelessChannel = "6g-73-6315-20" + WIRELESSCHANNEL__6G_75_6325_40 WirelessChannel = "6g-75-6325-40" + WIRELESSCHANNEL__6G_77_6335_20 WirelessChannel = "6g-77-6335-20" + WIRELESSCHANNEL__6G_79_6345_160 WirelessChannel = "6g-79-6345-160" + WIRELESSCHANNEL__6G_81_6355_20 WirelessChannel = "6g-81-6355-20" + WIRELESSCHANNEL__6G_83_6365_40 WirelessChannel = "6g-83-6365-40" + WIRELESSCHANNEL__6G_85_6375_20 WirelessChannel = "6g-85-6375-20" + WIRELESSCHANNEL__6G_87_6385_80 WirelessChannel = "6g-87-6385-80" + WIRELESSCHANNEL__6G_89_6395_20 WirelessChannel = "6g-89-6395-20" + WIRELESSCHANNEL__6G_91_6405_40 WirelessChannel = "6g-91-6405-40" + WIRELESSCHANNEL__6G_93_6415_20 WirelessChannel = "6g-93-6415-20" + WIRELESSCHANNEL__6G_95_6425_320 WirelessChannel = "6g-95-6425-320" + WIRELESSCHANNEL__6G_97_6435_20 WirelessChannel = "6g-97-6435-20" + WIRELESSCHANNEL__6G_99_6445_40 WirelessChannel = "6g-99-6445-40" + WIRELESSCHANNEL__6G_101_6455_20 WirelessChannel = "6g-101-6455-20" + WIRELESSCHANNEL__6G_103_6465_80 WirelessChannel = "6g-103-6465-80" + WIRELESSCHANNEL__6G_105_6475_20 WirelessChannel = "6g-105-6475-20" + WIRELESSCHANNEL__6G_107_6485_40 WirelessChannel = "6g-107-6485-40" + WIRELESSCHANNEL__6G_109_6495_20 WirelessChannel = "6g-109-6495-20" + WIRELESSCHANNEL__6G_111_6505_160 WirelessChannel = "6g-111-6505-160" + WIRELESSCHANNEL__6G_113_6515_20 WirelessChannel = "6g-113-6515-20" + WIRELESSCHANNEL__6G_115_6525_40 WirelessChannel = "6g-115-6525-40" + WIRELESSCHANNEL__6G_117_6535_20 WirelessChannel = "6g-117-6535-20" + WIRELESSCHANNEL__6G_119_6545_80 WirelessChannel = "6g-119-6545-80" + WIRELESSCHANNEL__6G_121_6555_20 WirelessChannel = "6g-121-6555-20" + WIRELESSCHANNEL__6G_123_6565_40 WirelessChannel = "6g-123-6565-40" + WIRELESSCHANNEL__6G_125_6575_20 WirelessChannel = "6g-125-6575-20" + WIRELESSCHANNEL__6G_129_6595_20 WirelessChannel = "6g-129-6595-20" + WIRELESSCHANNEL__6G_131_6605_40 WirelessChannel = "6g-131-6605-40" + WIRELESSCHANNEL__6G_133_6615_20 WirelessChannel = "6g-133-6615-20" + WIRELESSCHANNEL__6G_135_6625_80 WirelessChannel = "6g-135-6625-80" + WIRELESSCHANNEL__6G_137_6635_20 WirelessChannel = "6g-137-6635-20" + WIRELESSCHANNEL__6G_139_6645_40 WirelessChannel = "6g-139-6645-40" + WIRELESSCHANNEL__6G_141_6655_20 WirelessChannel = "6g-141-6655-20" + WIRELESSCHANNEL__6G_143_6665_160 WirelessChannel = "6g-143-6665-160" + WIRELESSCHANNEL__6G_145_6675_20 WirelessChannel = "6g-145-6675-20" + WIRELESSCHANNEL__6G_147_6685_40 WirelessChannel = "6g-147-6685-40" + WIRELESSCHANNEL__6G_149_6695_20 WirelessChannel = "6g-149-6695-20" + WIRELESSCHANNEL__6G_151_6705_80 WirelessChannel = "6g-151-6705-80" + WIRELESSCHANNEL__6G_153_6715_20 WirelessChannel = "6g-153-6715-20" + WIRELESSCHANNEL__6G_155_6725_40 WirelessChannel = "6g-155-6725-40" + WIRELESSCHANNEL__6G_157_6735_20 WirelessChannel = "6g-157-6735-20" + WIRELESSCHANNEL__6G_159_6745_320 WirelessChannel = "6g-159-6745-320" + WIRELESSCHANNEL__6G_161_6755_20 WirelessChannel = "6g-161-6755-20" + WIRELESSCHANNEL__6G_163_6765_40 WirelessChannel = "6g-163-6765-40" + WIRELESSCHANNEL__6G_165_6775_20 WirelessChannel = "6g-165-6775-20" + WIRELESSCHANNEL__6G_167_6785_80 WirelessChannel = "6g-167-6785-80" + WIRELESSCHANNEL__6G_169_6795_20 WirelessChannel = "6g-169-6795-20" + WIRELESSCHANNEL__6G_171_6805_40 WirelessChannel = "6g-171-6805-40" + WIRELESSCHANNEL__6G_173_6815_20 WirelessChannel = "6g-173-6815-20" + WIRELESSCHANNEL__6G_175_6825_160 WirelessChannel = "6g-175-6825-160" + WIRELESSCHANNEL__6G_177_6835_20 WirelessChannel = "6g-177-6835-20" + WIRELESSCHANNEL__6G_179_6845_40 WirelessChannel = "6g-179-6845-40" + WIRELESSCHANNEL__6G_181_6855_20 WirelessChannel = "6g-181-6855-20" + WIRELESSCHANNEL__6G_183_6865_80 WirelessChannel = "6g-183-6865-80" + WIRELESSCHANNEL__6G_185_6875_20 WirelessChannel = "6g-185-6875-20" + WIRELESSCHANNEL__6G_187_6885_40 WirelessChannel = "6g-187-6885-40" + WIRELESSCHANNEL__6G_189_6895_20 WirelessChannel = "6g-189-6895-20" + WIRELESSCHANNEL__6G_193_6915_20 WirelessChannel = "6g-193-6915-20" + WIRELESSCHANNEL__6G_195_6925_40 WirelessChannel = "6g-195-6925-40" + WIRELESSCHANNEL__6G_197_6935_20 WirelessChannel = "6g-197-6935-20" + WIRELESSCHANNEL__6G_199_6945_80 WirelessChannel = "6g-199-6945-80" + WIRELESSCHANNEL__6G_201_6955_20 WirelessChannel = "6g-201-6955-20" + WIRELESSCHANNEL__6G_203_6965_40 WirelessChannel = "6g-203-6965-40" + WIRELESSCHANNEL__6G_205_6975_20 WirelessChannel = "6g-205-6975-20" + WIRELESSCHANNEL__6G_207_6985_160 WirelessChannel = "6g-207-6985-160" + WIRELESSCHANNEL__6G_209_6995_20 WirelessChannel = "6g-209-6995-20" + WIRELESSCHANNEL__6G_211_7005_40 WirelessChannel = "6g-211-7005-40" + WIRELESSCHANNEL__6G_213_7015_20 WirelessChannel = "6g-213-7015-20" + WIRELESSCHANNEL__6G_215_7025_80 WirelessChannel = "6g-215-7025-80" + WIRELESSCHANNEL__6G_217_7035_20 WirelessChannel = "6g-217-7035-20" + WIRELESSCHANNEL__6G_219_7045_40 WirelessChannel = "6g-219-7045-40" + WIRELESSCHANNEL__6G_221_7055_20 WirelessChannel = "6g-221-7055-20" + WIRELESSCHANNEL__6G_225_7075_20 WirelessChannel = "6g-225-7075-20" + WIRELESSCHANNEL__6G_227_7085_40 WirelessChannel = "6g-227-7085-40" + WIRELESSCHANNEL__6G_229_7095_20 WirelessChannel = "6g-229-7095-20" + WIRELESSCHANNEL__6G_233_7115_20 WirelessChannel = "6g-233-7115-20" + WIRELESSCHANNEL__60G_1_58320_2160 WirelessChannel = "60g-1-58320-2160" + WIRELESSCHANNEL__60G_2_60480_2160 WirelessChannel = "60g-2-60480-2160" + WIRELESSCHANNEL__60G_3_62640_2160 WirelessChannel = "60g-3-62640-2160" + WIRELESSCHANNEL__60G_4_64800_2160 WirelessChannel = "60g-4-64800-2160" + WIRELESSCHANNEL__60G_5_66960_2160 WirelessChannel = "60g-5-66960-2160" + WIRELESSCHANNEL__60G_6_69120_2160 WirelessChannel = "60g-6-69120-2160" + WIRELESSCHANNEL__60G_9_59400_4320 WirelessChannel = "60g-9-59400-4320" + WIRELESSCHANNEL__60G_10_61560_4320 WirelessChannel = "60g-10-61560-4320" + WIRELESSCHANNEL__60G_11_63720_4320 WirelessChannel = "60g-11-63720-4320" + WIRELESSCHANNEL__60G_12_65880_4320 WirelessChannel = "60g-12-65880-4320" + WIRELESSCHANNEL__60G_13_68040_4320 WirelessChannel = "60g-13-68040-4320" + WIRELESSCHANNEL__60G_17_60480_6480 WirelessChannel = "60g-17-60480-6480" + WIRELESSCHANNEL__60G_18_62640_6480 WirelessChannel = "60g-18-62640-6480" + WIRELESSCHANNEL__60G_19_64800_6480 WirelessChannel = "60g-19-64800-6480" + WIRELESSCHANNEL__60G_20_66960_6480 WirelessChannel = "60g-20-66960-6480" + WIRELESSCHANNEL__60G_25_61560_6480 WirelessChannel = "60g-25-61560-6480" + WIRELESSCHANNEL__60G_26_63720_6480 WirelessChannel = "60g-26-63720-6480" + WIRELESSCHANNEL__60G_27_65880_6480 WirelessChannel = "60g-27-65880-6480" + WIRELESSCHANNEL_EMPTY WirelessChannel = "" +) + +// All allowed values of WirelessChannel enum +var AllowedWirelessChannelEnumValues = []WirelessChannel{ + "2.4g-1-2412-22", + "2.4g-2-2417-22", + "2.4g-3-2422-22", + "2.4g-4-2427-22", + "2.4g-5-2432-22", + "2.4g-6-2437-22", + "2.4g-7-2442-22", + "2.4g-8-2447-22", + "2.4g-9-2452-22", + "2.4g-10-2457-22", + "2.4g-11-2462-22", + "2.4g-12-2467-22", + "2.4g-13-2472-22", + "5g-32-5160-20", + "5g-34-5170-40", + "5g-36-5180-20", + "5g-38-5190-40", + "5g-40-5200-20", + "5g-42-5210-80", + "5g-44-5220-20", + "5g-46-5230-40", + "5g-48-5240-20", + "5g-50-5250-160", + "5g-52-5260-20", + "5g-54-5270-40", + "5g-56-5280-20", + "5g-58-5290-80", + "5g-60-5300-20", + "5g-62-5310-40", + "5g-64-5320-20", + "5g-100-5500-20", + "5g-102-5510-40", + "5g-104-5520-20", + "5g-106-5530-80", + "5g-108-5540-20", + "5g-110-5550-40", + "5g-112-5560-20", + "5g-114-5570-160", + "5g-116-5580-20", + "5g-118-5590-40", + "5g-120-5600-20", + "5g-122-5610-80", + "5g-124-5620-20", + "5g-126-5630-40", + "5g-128-5640-20", + "5g-132-5660-20", + "5g-134-5670-40", + "5g-136-5680-20", + "5g-138-5690-80", + "5g-140-5700-20", + "5g-142-5710-40", + "5g-144-5720-20", + "5g-149-5745-20", + "5g-151-5755-40", + "5g-153-5765-20", + "5g-155-5775-80", + "5g-157-5785-20", + "5g-159-5795-40", + "5g-161-5805-20", + "5g-163-5815-160", + "5g-165-5825-20", + "5g-167-5835-40", + "5g-169-5845-20", + "5g-171-5855-80", + "5g-173-5865-20", + "5g-175-5875-40", + "5g-177-5885-20", + "6g-1-5955-20", + "6g-3-5965-40", + "6g-5-5975-20", + "6g-7-5985-80", + "6g-9-5995-20", + "6g-11-6005-40", + "6g-13-6015-20", + "6g-15-6025-160", + "6g-17-6035-20", + "6g-19-6045-40", + "6g-21-6055-20", + "6g-23-6065-80", + "6g-25-6075-20", + "6g-27-6085-40", + "6g-29-6095-20", + "6g-31-6105-320", + "6g-33-6115-20", + "6g-35-6125-40", + "6g-37-6135-20", + "6g-39-6145-80", + "6g-41-6155-20", + "6g-43-6165-40", + "6g-45-6175-20", + "6g-47-6185-160", + "6g-49-6195-20", + "6g-51-6205-40", + "6g-53-6215-20", + "6g-55-6225-80", + "6g-57-6235-20", + "6g-59-6245-40", + "6g-61-6255-20", + "6g-65-6275-20", + "6g-67-6285-40", + "6g-69-6295-20", + "6g-71-6305-80", + "6g-73-6315-20", + "6g-75-6325-40", + "6g-77-6335-20", + "6g-79-6345-160", + "6g-81-6355-20", + "6g-83-6365-40", + "6g-85-6375-20", + "6g-87-6385-80", + "6g-89-6395-20", + "6g-91-6405-40", + "6g-93-6415-20", + "6g-95-6425-320", + "6g-97-6435-20", + "6g-99-6445-40", + "6g-101-6455-20", + "6g-103-6465-80", + "6g-105-6475-20", + "6g-107-6485-40", + "6g-109-6495-20", + "6g-111-6505-160", + "6g-113-6515-20", + "6g-115-6525-40", + "6g-117-6535-20", + "6g-119-6545-80", + "6g-121-6555-20", + "6g-123-6565-40", + "6g-125-6575-20", + "6g-129-6595-20", + "6g-131-6605-40", + "6g-133-6615-20", + "6g-135-6625-80", + "6g-137-6635-20", + "6g-139-6645-40", + "6g-141-6655-20", + "6g-143-6665-160", + "6g-145-6675-20", + "6g-147-6685-40", + "6g-149-6695-20", + "6g-151-6705-80", + "6g-153-6715-20", + "6g-155-6725-40", + "6g-157-6735-20", + "6g-159-6745-320", + "6g-161-6755-20", + "6g-163-6765-40", + "6g-165-6775-20", + "6g-167-6785-80", + "6g-169-6795-20", + "6g-171-6805-40", + "6g-173-6815-20", + "6g-175-6825-160", + "6g-177-6835-20", + "6g-179-6845-40", + "6g-181-6855-20", + "6g-183-6865-80", + "6g-185-6875-20", + "6g-187-6885-40", + "6g-189-6895-20", + "6g-193-6915-20", + "6g-195-6925-40", + "6g-197-6935-20", + "6g-199-6945-80", + "6g-201-6955-20", + "6g-203-6965-40", + "6g-205-6975-20", + "6g-207-6985-160", + "6g-209-6995-20", + "6g-211-7005-40", + "6g-213-7015-20", + "6g-215-7025-80", + "6g-217-7035-20", + "6g-219-7045-40", + "6g-221-7055-20", + "6g-225-7075-20", + "6g-227-7085-40", + "6g-229-7095-20", + "6g-233-7115-20", + "60g-1-58320-2160", + "60g-2-60480-2160", + "60g-3-62640-2160", + "60g-4-64800-2160", + "60g-5-66960-2160", + "60g-6-69120-2160", + "60g-9-59400-4320", + "60g-10-61560-4320", + "60g-11-63720-4320", + "60g-12-65880-4320", + "60g-13-68040-4320", + "60g-17-60480-6480", + "60g-18-62640-6480", + "60g-19-64800-6480", + "60g-20-66960-6480", + "60g-25-61560-6480", + "60g-26-63720-6480", + "60g-27-65880-6480", + "", +} + +func (v *WirelessChannel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessChannel(value) + for _, existing := range AllowedWirelessChannelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessChannel", value) +} + +// NewWirelessChannelFromValue returns a pointer to a valid WirelessChannel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessChannelFromValue(v string) (*WirelessChannel, error) { + ev := WirelessChannel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessChannel: valid values are %v", v, AllowedWirelessChannelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessChannel) IsValid() bool { + for _, existing := range AllowedWirelessChannelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Wireless_channel value +func (v WirelessChannel) Ptr() *WirelessChannel { + return &v +} + +type NullableWirelessChannel struct { + value *WirelessChannel + isSet bool +} + +func (v NullableWirelessChannel) Get() *WirelessChannel { + return v.value +} + +func (v *NullableWirelessChannel) Set(val *WirelessChannel) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessChannel) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessChannel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessChannel(val *WirelessChannel) *NullableWirelessChannel { + return &NullableWirelessChannel{value: val, isSet: true} +} + +func (v NullableWirelessChannel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessChannel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan.go new file mode 100644 index 00000000..838d790c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan.go @@ -0,0 +1,756 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the WirelessLAN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLAN{} + +// WirelessLAN Adds support for custom fields and tags. +type WirelessLAN struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Ssid string `json:"ssid"` + Description *string `json:"description,omitempty"` + Group NullableNestedWirelessLANGroup `json:"group,omitempty"` + Status *WirelessLANStatus `json:"status,omitempty"` + Vlan NullableNestedVLAN `json:"vlan,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + AuthType *WirelessLANAuthType `json:"auth_type,omitempty"` + AuthCipher *WirelessLANAuthCipher `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLAN WirelessLAN + +// NewWirelessLAN instantiates a new WirelessLAN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLAN(id int32, url string, display string, ssid string, created NullableTime, lastUpdated NullableTime) *WirelessLAN { + this := WirelessLAN{} + this.Id = id + this.Url = url + this.Display = display + this.Ssid = ssid + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewWirelessLANWithDefaults instantiates a new WirelessLAN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLANWithDefaults() *WirelessLAN { + this := WirelessLAN{} + return &this +} + +// GetId returns the Id field value +func (o *WirelessLAN) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WirelessLAN) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *WirelessLAN) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *WirelessLAN) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *WirelessLAN) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *WirelessLAN) SetDisplay(v string) { + o.Display = v +} + +// GetSsid returns the Ssid field value +func (o *WirelessLAN) GetSsid() string { + if o == nil { + var ret string + return ret + } + + return o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetSsidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Ssid, true +} + +// SetSsid sets field value +func (o *WirelessLAN) SetSsid(v string) { + o.Ssid = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WirelessLAN) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WirelessLAN) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WirelessLAN) SetDescription(v string) { + o.Description = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLAN) GetGroup() NestedWirelessLANGroup { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedWirelessLANGroup + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLAN) GetGroupOk() (*NestedWirelessLANGroup, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WirelessLAN) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedWirelessLANGroup and assigns it to the Group field. +func (o *WirelessLAN) SetGroup(v NestedWirelessLANGroup) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WirelessLAN) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WirelessLAN) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WirelessLAN) GetStatus() WirelessLANStatus { + if o == nil || IsNil(o.Status) { + var ret WirelessLANStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetStatusOk() (*WirelessLANStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WirelessLAN) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given WirelessLANStatus and assigns it to the Status field. +func (o *WirelessLAN) SetStatus(v WirelessLANStatus) { + o.Status = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLAN) GetVlan() NestedVLAN { + if o == nil || IsNil(o.Vlan.Get()) { + var ret NestedVLAN + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLAN) GetVlanOk() (*NestedVLAN, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *WirelessLAN) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableNestedVLAN and assigns it to the Vlan field. +func (o *WirelessLAN) SetVlan(v NestedVLAN) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *WirelessLAN) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *WirelessLAN) UnsetVlan() { + o.Vlan.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLAN) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLAN) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WirelessLAN) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *WirelessLAN) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WirelessLAN) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WirelessLAN) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *WirelessLAN) GetAuthType() WirelessLANAuthType { + if o == nil || IsNil(o.AuthType) { + var ret WirelessLANAuthType + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetAuthTypeOk() (*WirelessLANAuthType, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *WirelessLAN) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given WirelessLANAuthType and assigns it to the AuthType field. +func (o *WirelessLAN) SetAuthType(v WirelessLANAuthType) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *WirelessLAN) GetAuthCipher() WirelessLANAuthCipher { + if o == nil || IsNil(o.AuthCipher) { + var ret WirelessLANAuthCipher + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetAuthCipherOk() (*WirelessLANAuthCipher, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *WirelessLAN) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given WirelessLANAuthCipher and assigns it to the AuthCipher field. +func (o *WirelessLAN) SetAuthCipher(v WirelessLANAuthCipher) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *WirelessLAN) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *WirelessLAN) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *WirelessLAN) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WirelessLAN) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WirelessLAN) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WirelessLAN) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WirelessLAN) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WirelessLAN) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *WirelessLAN) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WirelessLAN) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLAN) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WirelessLAN) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WirelessLAN) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *WirelessLAN) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLAN) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *WirelessLAN) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *WirelessLAN) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLAN) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *WirelessLAN) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o WirelessLAN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLAN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["ssid"] = o.Ssid + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLAN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "ssid", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWirelessLAN := _WirelessLAN{} + + err = json.Unmarshal(data, &varWirelessLAN) + + if err != nil { + return err + } + + *o = WirelessLAN(varWirelessLAN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "ssid") + delete(additionalProperties, "description") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "vlan") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLAN struct { + value *WirelessLAN + isSet bool +} + +func (v NullableWirelessLAN) Get() *WirelessLAN { + return v.value +} + +func (v *NullableWirelessLAN) Set(val *WirelessLAN) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLAN) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLAN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLAN(val *WirelessLAN) *NullableWirelessLAN { + return &NullableWirelessLAN{value: val, isSet: true} +} + +func (v NullableWirelessLAN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLAN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher.go new file mode 100644 index 00000000..490ed4fb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the WirelessLANAuthCipher type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLANAuthCipher{} + +// WirelessLANAuthCipher struct for WirelessLANAuthCipher +type WirelessLANAuthCipher struct { + Value *WirelessLANAuthCipherValue `json:"value,omitempty"` + Label *WirelessLANAuthCipherLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLANAuthCipher WirelessLANAuthCipher + +// NewWirelessLANAuthCipher instantiates a new WirelessLANAuthCipher object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLANAuthCipher() *WirelessLANAuthCipher { + this := WirelessLANAuthCipher{} + return &this +} + +// NewWirelessLANAuthCipherWithDefaults instantiates a new WirelessLANAuthCipher object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLANAuthCipherWithDefaults() *WirelessLANAuthCipher { + this := WirelessLANAuthCipher{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *WirelessLANAuthCipher) GetValue() WirelessLANAuthCipherValue { + if o == nil || IsNil(o.Value) { + var ret WirelessLANAuthCipherValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANAuthCipher) GetValueOk() (*WirelessLANAuthCipherValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *WirelessLANAuthCipher) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given WirelessLANAuthCipherValue and assigns it to the Value field. +func (o *WirelessLANAuthCipher) SetValue(v WirelessLANAuthCipherValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WirelessLANAuthCipher) GetLabel() WirelessLANAuthCipherLabel { + if o == nil || IsNil(o.Label) { + var ret WirelessLANAuthCipherLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANAuthCipher) GetLabelOk() (*WirelessLANAuthCipherLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WirelessLANAuthCipher) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given WirelessLANAuthCipherLabel and assigns it to the Label field. +func (o *WirelessLANAuthCipher) SetLabel(v WirelessLANAuthCipherLabel) { + o.Label = &v +} + +func (o WirelessLANAuthCipher) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLANAuthCipher) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLANAuthCipher) UnmarshalJSON(data []byte) (err error) { + varWirelessLANAuthCipher := _WirelessLANAuthCipher{} + + err = json.Unmarshal(data, &varWirelessLANAuthCipher) + + if err != nil { + return err + } + + *o = WirelessLANAuthCipher(varWirelessLANAuthCipher) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLANAuthCipher struct { + value *WirelessLANAuthCipher + isSet bool +} + +func (v NullableWirelessLANAuthCipher) Get() *WirelessLANAuthCipher { + return v.value +} + +func (v *NullableWirelessLANAuthCipher) Set(val *WirelessLANAuthCipher) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANAuthCipher) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANAuthCipher) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANAuthCipher(val *WirelessLANAuthCipher) *NullableWirelessLANAuthCipher { + return &NullableWirelessLANAuthCipher{value: val, isSet: true} +} + +func (v NullableWirelessLANAuthCipher) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANAuthCipher) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher_label.go new file mode 100644 index 00000000..b81fab6c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher_label.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessLANAuthCipherLabel the model 'WirelessLANAuthCipherLabel' +type WirelessLANAuthCipherLabel string + +// List of WirelessLAN_auth_cipher_label +const ( + WIRELESSLANAUTHCIPHERLABEL_AUTO WirelessLANAuthCipherLabel = "Auto" + WIRELESSLANAUTHCIPHERLABEL_TKIP WirelessLANAuthCipherLabel = "TKIP" + WIRELESSLANAUTHCIPHERLABEL_AES WirelessLANAuthCipherLabel = "AES" +) + +// All allowed values of WirelessLANAuthCipherLabel enum +var AllowedWirelessLANAuthCipherLabelEnumValues = []WirelessLANAuthCipherLabel{ + "Auto", + "TKIP", + "AES", +} + +func (v *WirelessLANAuthCipherLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessLANAuthCipherLabel(value) + for _, existing := range AllowedWirelessLANAuthCipherLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessLANAuthCipherLabel", value) +} + +// NewWirelessLANAuthCipherLabelFromValue returns a pointer to a valid WirelessLANAuthCipherLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessLANAuthCipherLabelFromValue(v string) (*WirelessLANAuthCipherLabel, error) { + ev := WirelessLANAuthCipherLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessLANAuthCipherLabel: valid values are %v", v, AllowedWirelessLANAuthCipherLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessLANAuthCipherLabel) IsValid() bool { + for _, existing := range AllowedWirelessLANAuthCipherLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WirelessLAN_auth_cipher_label value +func (v WirelessLANAuthCipherLabel) Ptr() *WirelessLANAuthCipherLabel { + return &v +} + +type NullableWirelessLANAuthCipherLabel struct { + value *WirelessLANAuthCipherLabel + isSet bool +} + +func (v NullableWirelessLANAuthCipherLabel) Get() *WirelessLANAuthCipherLabel { + return v.value +} + +func (v *NullableWirelessLANAuthCipherLabel) Set(val *WirelessLANAuthCipherLabel) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANAuthCipherLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANAuthCipherLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANAuthCipherLabel(val *WirelessLANAuthCipherLabel) *NullableWirelessLANAuthCipherLabel { + return &NullableWirelessLANAuthCipherLabel{value: val, isSet: true} +} + +func (v NullableWirelessLANAuthCipherLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANAuthCipherLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher_value.go new file mode 100644 index 00000000..28e8e588 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_cipher_value.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessLANAuthCipherValue * `auto` - Auto * `tkip` - TKIP * `aes` - AES +type WirelessLANAuthCipherValue string + +// List of WirelessLAN_auth_cipher_value +const ( + WIRELESSLANAUTHCIPHERVALUE_AUTO WirelessLANAuthCipherValue = "auto" + WIRELESSLANAUTHCIPHERVALUE_TKIP WirelessLANAuthCipherValue = "tkip" + WIRELESSLANAUTHCIPHERVALUE_AES WirelessLANAuthCipherValue = "aes" + WIRELESSLANAUTHCIPHERVALUE_EMPTY WirelessLANAuthCipherValue = "" +) + +// All allowed values of WirelessLANAuthCipherValue enum +var AllowedWirelessLANAuthCipherValueEnumValues = []WirelessLANAuthCipherValue{ + "auto", + "tkip", + "aes", + "", +} + +func (v *WirelessLANAuthCipherValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessLANAuthCipherValue(value) + for _, existing := range AllowedWirelessLANAuthCipherValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessLANAuthCipherValue", value) +} + +// NewWirelessLANAuthCipherValueFromValue returns a pointer to a valid WirelessLANAuthCipherValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessLANAuthCipherValueFromValue(v string) (*WirelessLANAuthCipherValue, error) { + ev := WirelessLANAuthCipherValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessLANAuthCipherValue: valid values are %v", v, AllowedWirelessLANAuthCipherValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessLANAuthCipherValue) IsValid() bool { + for _, existing := range AllowedWirelessLANAuthCipherValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WirelessLAN_auth_cipher_value value +func (v WirelessLANAuthCipherValue) Ptr() *WirelessLANAuthCipherValue { + return &v +} + +type NullableWirelessLANAuthCipherValue struct { + value *WirelessLANAuthCipherValue + isSet bool +} + +func (v NullableWirelessLANAuthCipherValue) Get() *WirelessLANAuthCipherValue { + return v.value +} + +func (v *NullableWirelessLANAuthCipherValue) Set(val *WirelessLANAuthCipherValue) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANAuthCipherValue) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANAuthCipherValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANAuthCipherValue(val *WirelessLANAuthCipherValue) *NullableWirelessLANAuthCipherValue { + return &NullableWirelessLANAuthCipherValue{value: val, isSet: true} +} + +func (v NullableWirelessLANAuthCipherValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANAuthCipherValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type.go new file mode 100644 index 00000000..58f0aac9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the WirelessLANAuthType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLANAuthType{} + +// WirelessLANAuthType struct for WirelessLANAuthType +type WirelessLANAuthType struct { + Value *WirelessLANAuthTypeValue `json:"value,omitempty"` + Label *WirelessLANAuthTypeLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLANAuthType WirelessLANAuthType + +// NewWirelessLANAuthType instantiates a new WirelessLANAuthType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLANAuthType() *WirelessLANAuthType { + this := WirelessLANAuthType{} + return &this +} + +// NewWirelessLANAuthTypeWithDefaults instantiates a new WirelessLANAuthType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLANAuthTypeWithDefaults() *WirelessLANAuthType { + this := WirelessLANAuthType{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *WirelessLANAuthType) GetValue() WirelessLANAuthTypeValue { + if o == nil || IsNil(o.Value) { + var ret WirelessLANAuthTypeValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANAuthType) GetValueOk() (*WirelessLANAuthTypeValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *WirelessLANAuthType) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given WirelessLANAuthTypeValue and assigns it to the Value field. +func (o *WirelessLANAuthType) SetValue(v WirelessLANAuthTypeValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WirelessLANAuthType) GetLabel() WirelessLANAuthTypeLabel { + if o == nil || IsNil(o.Label) { + var ret WirelessLANAuthTypeLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANAuthType) GetLabelOk() (*WirelessLANAuthTypeLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WirelessLANAuthType) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given WirelessLANAuthTypeLabel and assigns it to the Label field. +func (o *WirelessLANAuthType) SetLabel(v WirelessLANAuthTypeLabel) { + o.Label = &v +} + +func (o WirelessLANAuthType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLANAuthType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLANAuthType) UnmarshalJSON(data []byte) (err error) { + varWirelessLANAuthType := _WirelessLANAuthType{} + + err = json.Unmarshal(data, &varWirelessLANAuthType) + + if err != nil { + return err + } + + *o = WirelessLANAuthType(varWirelessLANAuthType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLANAuthType struct { + value *WirelessLANAuthType + isSet bool +} + +func (v NullableWirelessLANAuthType) Get() *WirelessLANAuthType { + return v.value +} + +func (v *NullableWirelessLANAuthType) Set(val *WirelessLANAuthType) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANAuthType) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANAuthType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANAuthType(val *WirelessLANAuthType) *NullableWirelessLANAuthType { + return &NullableWirelessLANAuthType{value: val, isSet: true} +} + +func (v NullableWirelessLANAuthType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANAuthType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type_label.go new file mode 100644 index 00000000..97e68e03 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessLANAuthTypeLabel the model 'WirelessLANAuthTypeLabel' +type WirelessLANAuthTypeLabel string + +// List of WirelessLAN_auth_type_label +const ( + WIRELESSLANAUTHTYPELABEL_OPEN WirelessLANAuthTypeLabel = "Open" + WIRELESSLANAUTHTYPELABEL_WEP WirelessLANAuthTypeLabel = "WEP" + WIRELESSLANAUTHTYPELABEL_WPA_PERSONAL__PSK WirelessLANAuthTypeLabel = "WPA Personal (PSK)" + WIRELESSLANAUTHTYPELABEL_WPA_ENTERPRISE WirelessLANAuthTypeLabel = "WPA Enterprise" +) + +// All allowed values of WirelessLANAuthTypeLabel enum +var AllowedWirelessLANAuthTypeLabelEnumValues = []WirelessLANAuthTypeLabel{ + "Open", + "WEP", + "WPA Personal (PSK)", + "WPA Enterprise", +} + +func (v *WirelessLANAuthTypeLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessLANAuthTypeLabel(value) + for _, existing := range AllowedWirelessLANAuthTypeLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessLANAuthTypeLabel", value) +} + +// NewWirelessLANAuthTypeLabelFromValue returns a pointer to a valid WirelessLANAuthTypeLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessLANAuthTypeLabelFromValue(v string) (*WirelessLANAuthTypeLabel, error) { + ev := WirelessLANAuthTypeLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessLANAuthTypeLabel: valid values are %v", v, AllowedWirelessLANAuthTypeLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessLANAuthTypeLabel) IsValid() bool { + for _, existing := range AllowedWirelessLANAuthTypeLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WirelessLAN_auth_type_label value +func (v WirelessLANAuthTypeLabel) Ptr() *WirelessLANAuthTypeLabel { + return &v +} + +type NullableWirelessLANAuthTypeLabel struct { + value *WirelessLANAuthTypeLabel + isSet bool +} + +func (v NullableWirelessLANAuthTypeLabel) Get() *WirelessLANAuthTypeLabel { + return v.value +} + +func (v *NullableWirelessLANAuthTypeLabel) Set(val *WirelessLANAuthTypeLabel) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANAuthTypeLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANAuthTypeLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANAuthTypeLabel(val *WirelessLANAuthTypeLabel) *NullableWirelessLANAuthTypeLabel { + return &NullableWirelessLANAuthTypeLabel{value: val, isSet: true} +} + +func (v NullableWirelessLANAuthTypeLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANAuthTypeLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type_value.go new file mode 100644 index 00000000..35d1c3f1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_auth_type_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessLANAuthTypeValue * `open` - Open * `wep` - WEP * `wpa-personal` - WPA Personal (PSK) * `wpa-enterprise` - WPA Enterprise +type WirelessLANAuthTypeValue string + +// List of WirelessLAN_auth_type_value +const ( + WIRELESSLANAUTHTYPEVALUE_OPEN WirelessLANAuthTypeValue = "open" + WIRELESSLANAUTHTYPEVALUE_WEP WirelessLANAuthTypeValue = "wep" + WIRELESSLANAUTHTYPEVALUE_WPA_PERSONAL WirelessLANAuthTypeValue = "wpa-personal" + WIRELESSLANAUTHTYPEVALUE_WPA_ENTERPRISE WirelessLANAuthTypeValue = "wpa-enterprise" + WIRELESSLANAUTHTYPEVALUE_EMPTY WirelessLANAuthTypeValue = "" +) + +// All allowed values of WirelessLANAuthTypeValue enum +var AllowedWirelessLANAuthTypeValueEnumValues = []WirelessLANAuthTypeValue{ + "open", + "wep", + "wpa-personal", + "wpa-enterprise", + "", +} + +func (v *WirelessLANAuthTypeValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessLANAuthTypeValue(value) + for _, existing := range AllowedWirelessLANAuthTypeValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessLANAuthTypeValue", value) +} + +// NewWirelessLANAuthTypeValueFromValue returns a pointer to a valid WirelessLANAuthTypeValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessLANAuthTypeValueFromValue(v string) (*WirelessLANAuthTypeValue, error) { + ev := WirelessLANAuthTypeValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessLANAuthTypeValue: valid values are %v", v, AllowedWirelessLANAuthTypeValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessLANAuthTypeValue) IsValid() bool { + for _, existing := range AllowedWirelessLANAuthTypeValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WirelessLAN_auth_type_value value +func (v WirelessLANAuthTypeValue) Ptr() *WirelessLANAuthTypeValue { + return &v +} + +type NullableWirelessLANAuthTypeValue struct { + value *WirelessLANAuthTypeValue + isSet bool +} + +func (v NullableWirelessLANAuthTypeValue) Get() *WirelessLANAuthTypeValue { + return v.value +} + +func (v *NullableWirelessLANAuthTypeValue) Set(val *WirelessLANAuthTypeValue) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANAuthTypeValue) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANAuthTypeValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANAuthTypeValue(val *WirelessLANAuthTypeValue) *NullableWirelessLANAuthTypeValue { + return &NullableWirelessLANAuthTypeValue{value: val, isSet: true} +} + +func (v NullableWirelessLANAuthTypeValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANAuthTypeValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_group.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_group.go new file mode 100644 index 00000000..61c785d4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_group.go @@ -0,0 +1,562 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the WirelessLANGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLANGroup{} + +// WirelessLANGroup Extends PrimaryModelSerializer to include MPTT support. +type WirelessLANGroup struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedWirelessLANGroup `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + WirelesslanCount int32 `json:"wirelesslan_count"` + Depth int32 `json:"_depth"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLANGroup WirelessLANGroup + +// NewWirelessLANGroup instantiates a new WirelessLANGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLANGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, wirelesslanCount int32, depth int32) *WirelessLANGroup { + this := WirelessLANGroup{} + this.Id = id + this.Url = url + this.Display = display + this.Name = name + this.Slug = slug + this.Created = created + this.LastUpdated = lastUpdated + this.WirelesslanCount = wirelesslanCount + this.Depth = depth + return &this +} + +// NewWirelessLANGroupWithDefaults instantiates a new WirelessLANGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLANGroupWithDefaults() *WirelessLANGroup { + this := WirelessLANGroup{} + return &this +} + +// GetId returns the Id field value +func (o *WirelessLANGroup) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WirelessLANGroup) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *WirelessLANGroup) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *WirelessLANGroup) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *WirelessLANGroup) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *WirelessLANGroup) SetDisplay(v string) { + o.Display = v +} + +// GetName returns the Name field value +func (o *WirelessLANGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WirelessLANGroup) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WirelessLANGroup) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WirelessLANGroup) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLANGroup) GetParent() NestedWirelessLANGroup { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedWirelessLANGroup + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLANGroup) GetParentOk() (*NestedWirelessLANGroup, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WirelessLANGroup) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedWirelessLANGroup and assigns it to the Parent field. +func (o *WirelessLANGroup) SetParent(v NestedWirelessLANGroup) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WirelessLANGroup) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WirelessLANGroup) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WirelessLANGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WirelessLANGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WirelessLANGroup) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WirelessLANGroup) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WirelessLANGroup) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *WirelessLANGroup) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WirelessLANGroup) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WirelessLANGroup) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WirelessLANGroup) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *WirelessLANGroup) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLANGroup) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *WirelessLANGroup) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *WirelessLANGroup) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLANGroup) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *WirelessLANGroup) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +// GetWirelesslanCount returns the WirelesslanCount field value +func (o *WirelessLANGroup) GetWirelesslanCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.WirelesslanCount +} + +// GetWirelesslanCountOk returns a tuple with the WirelesslanCount field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetWirelesslanCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.WirelesslanCount, true +} + +// SetWirelesslanCount sets field value +func (o *WirelessLANGroup) SetWirelesslanCount(v int32) { + o.WirelesslanCount = v +} + +// GetDepth returns the Depth field value +func (o *WirelessLANGroup) GetDepth() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroup) GetDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Depth, true +} + +// SetDepth sets field value +func (o *WirelessLANGroup) SetDepth(v int32) { + o.Depth = v +} + +func (o WirelessLANGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLANGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + toSerialize["wirelesslan_count"] = o.WirelesslanCount + toSerialize["_depth"] = o.Depth + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLANGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "name", + "slug", + "created", + "last_updated", + "wirelesslan_count", + "_depth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWirelessLANGroup := _WirelessLANGroup{} + + err = json.Unmarshal(data, &varWirelessLANGroup) + + if err != nil { + return err + } + + *o = WirelessLANGroup(varWirelessLANGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "wirelesslan_count") + delete(additionalProperties, "_depth") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLANGroup struct { + value *WirelessLANGroup + isSet bool +} + +func (v NullableWirelessLANGroup) Get() *WirelessLANGroup { + return v.value +} + +func (v *NullableWirelessLANGroup) Set(val *WirelessLANGroup) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANGroup(val *WirelessLANGroup) *NullableWirelessLANGroup { + return &NullableWirelessLANGroup{value: val, isSet: true} +} + +func (v NullableWirelessLANGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_group_request.go new file mode 100644 index 00000000..23a01cb4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WirelessLANGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLANGroupRequest{} + +// WirelessLANGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type WirelessLANGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableNestedWirelessLANGroupRequest `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLANGroupRequest WirelessLANGroupRequest + +// NewWirelessLANGroupRequest instantiates a new WirelessLANGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLANGroupRequest(name string, slug string) *WirelessLANGroupRequest { + this := WirelessLANGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWirelessLANGroupRequestWithDefaults instantiates a new WirelessLANGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLANGroupRequestWithDefaults() *WirelessLANGroupRequest { + this := WirelessLANGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WirelessLANGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WirelessLANGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WirelessLANGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WirelessLANGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WirelessLANGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLANGroupRequest) GetParent() NestedWirelessLANGroupRequest { + if o == nil || IsNil(o.Parent.Get()) { + var ret NestedWirelessLANGroupRequest + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLANGroupRequest) GetParentOk() (*NestedWirelessLANGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WirelessLANGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableNestedWirelessLANGroupRequest and assigns it to the Parent field. +func (o *WirelessLANGroupRequest) SetParent(v NestedWirelessLANGroupRequest) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WirelessLANGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WirelessLANGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WirelessLANGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WirelessLANGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WirelessLANGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WirelessLANGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WirelessLANGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WirelessLANGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WirelessLANGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WirelessLANGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WirelessLANGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLANGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLANGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWirelessLANGroupRequest := _WirelessLANGroupRequest{} + + err = json.Unmarshal(data, &varWirelessLANGroupRequest) + + if err != nil { + return err + } + + *o = WirelessLANGroupRequest(varWirelessLANGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLANGroupRequest struct { + value *WirelessLANGroupRequest + isSet bool +} + +func (v NullableWirelessLANGroupRequest) Get() *WirelessLANGroupRequest { + return v.value +} + +func (v *NullableWirelessLANGroupRequest) Set(val *WirelessLANGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANGroupRequest(val *WirelessLANGroupRequest) *NullableWirelessLANGroupRequest { + return &NullableWirelessLANGroupRequest{value: val, isSet: true} +} + +func (v NullableWirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_request.go new file mode 100644 index 00000000..91257e91 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_request.go @@ -0,0 +1,606 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WirelessLANRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLANRequest{} + +// WirelessLANRequest Adds support for custom fields and tags. +type WirelessLANRequest struct { + Ssid string `json:"ssid"` + Description *string `json:"description,omitempty"` + Group NullableNestedWirelessLANGroupRequest `json:"group,omitempty"` + Status *WirelessLANStatusValue `json:"status,omitempty"` + Vlan NullableNestedVLANRequest `json:"vlan,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + AuthType *WirelessLANAuthTypeValue `json:"auth_type,omitempty"` + AuthCipher *WirelessLANAuthCipherValue `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLANRequest WirelessLANRequest + +// NewWirelessLANRequest instantiates a new WirelessLANRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLANRequest(ssid string) *WirelessLANRequest { + this := WirelessLANRequest{} + this.Ssid = ssid + return &this +} + +// NewWirelessLANRequestWithDefaults instantiates a new WirelessLANRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLANRequestWithDefaults() *WirelessLANRequest { + this := WirelessLANRequest{} + return &this +} + +// GetSsid returns the Ssid field value +func (o *WirelessLANRequest) GetSsid() string { + if o == nil { + var ret string + return ret + } + + return o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetSsidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Ssid, true +} + +// SetSsid sets field value +func (o *WirelessLANRequest) SetSsid(v string) { + o.Ssid = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WirelessLANRequest) SetDescription(v string) { + o.Description = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLANRequest) GetGroup() NestedWirelessLANGroupRequest { + if o == nil || IsNil(o.Group.Get()) { + var ret NestedWirelessLANGroupRequest + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLANRequest) GetGroupOk() (*NestedWirelessLANGroupRequest, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableNestedWirelessLANGroupRequest and assigns it to the Group field. +func (o *WirelessLANRequest) SetGroup(v NestedWirelessLANGroupRequest) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WirelessLANRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WirelessLANRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetStatus() WirelessLANStatusValue { + if o == nil || IsNil(o.Status) { + var ret WirelessLANStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetStatusOk() (*WirelessLANStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given WirelessLANStatusValue and assigns it to the Status field. +func (o *WirelessLANRequest) SetStatus(v WirelessLANStatusValue) { + o.Status = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLANRequest) GetVlan() NestedVLANRequest { + if o == nil || IsNil(o.Vlan.Get()) { + var ret NestedVLANRequest + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLANRequest) GetVlanOk() (*NestedVLANRequest, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableNestedVLANRequest and assigns it to the Vlan field. +func (o *WirelessLANRequest) SetVlan(v NestedVLANRequest) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *WirelessLANRequest) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *WirelessLANRequest) UnsetVlan() { + o.Vlan.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLANRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLANRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *WirelessLANRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WirelessLANRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WirelessLANRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetAuthType() WirelessLANAuthTypeValue { + if o == nil || IsNil(o.AuthType) { + var ret WirelessLANAuthTypeValue + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetAuthTypeOk() (*WirelessLANAuthTypeValue, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given WirelessLANAuthTypeValue and assigns it to the AuthType field. +func (o *WirelessLANRequest) SetAuthType(v WirelessLANAuthTypeValue) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetAuthCipher() WirelessLANAuthCipherValue { + if o == nil || IsNil(o.AuthCipher) { + var ret WirelessLANAuthCipherValue + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetAuthCipherOk() (*WirelessLANAuthCipherValue, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given WirelessLANAuthCipherValue and assigns it to the AuthCipher field. +func (o *WirelessLANRequest) SetAuthCipher(v WirelessLANAuthCipherValue) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *WirelessLANRequest) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WirelessLANRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WirelessLANRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WirelessLANRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WirelessLANRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WirelessLANRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WirelessLANRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLANRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ssid"] = o.Ssid + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLANRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "ssid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWirelessLANRequest := _WirelessLANRequest{} + + err = json.Unmarshal(data, &varWirelessLANRequest) + + if err != nil { + return err + } + + *o = WirelessLANRequest(varWirelessLANRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "ssid") + delete(additionalProperties, "description") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "vlan") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLANRequest struct { + value *WirelessLANRequest + isSet bool +} + +func (v NullableWirelessLANRequest) Get() *WirelessLANRequest { + return v.value +} + +func (v *NullableWirelessLANRequest) Set(val *WirelessLANRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANRequest(val *WirelessLANRequest) *NullableWirelessLANRequest { + return &NullableWirelessLANRequest{value: val, isSet: true} +} + +func (v NullableWirelessLANRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status.go new file mode 100644 index 00000000..14cf5eae --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status.go @@ -0,0 +1,190 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the WirelessLANStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLANStatus{} + +// WirelessLANStatus struct for WirelessLANStatus +type WirelessLANStatus struct { + Value *WirelessLANStatusValue `json:"value,omitempty"` + Label *WirelessLANStatusLabel `json:"label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLANStatus WirelessLANStatus + +// NewWirelessLANStatus instantiates a new WirelessLANStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLANStatus() *WirelessLANStatus { + this := WirelessLANStatus{} + return &this +} + +// NewWirelessLANStatusWithDefaults instantiates a new WirelessLANStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLANStatusWithDefaults() *WirelessLANStatus { + this := WirelessLANStatus{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *WirelessLANStatus) GetValue() WirelessLANStatusValue { + if o == nil || IsNil(o.Value) { + var ret WirelessLANStatusValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANStatus) GetValueOk() (*WirelessLANStatusValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *WirelessLANStatus) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given WirelessLANStatusValue and assigns it to the Value field. +func (o *WirelessLANStatus) SetValue(v WirelessLANStatusValue) { + o.Value = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WirelessLANStatus) GetLabel() WirelessLANStatusLabel { + if o == nil || IsNil(o.Label) { + var ret WirelessLANStatusLabel + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLANStatus) GetLabelOk() (*WirelessLANStatusLabel, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WirelessLANStatus) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given WirelessLANStatusLabel and assigns it to the Label field. +func (o *WirelessLANStatus) SetLabel(v WirelessLANStatusLabel) { + o.Label = &v +} + +func (o WirelessLANStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLANStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLANStatus) UnmarshalJSON(data []byte) (err error) { + varWirelessLANStatus := _WirelessLANStatus{} + + err = json.Unmarshal(data, &varWirelessLANStatus) + + if err != nil { + return err + } + + *o = WirelessLANStatus(varWirelessLANStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLANStatus struct { + value *WirelessLANStatus + isSet bool +} + +func (v NullableWirelessLANStatus) Get() *WirelessLANStatus { + return v.value +} + +func (v *NullableWirelessLANStatus) Set(val *WirelessLANStatus) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANStatus(val *WirelessLANStatus) *NullableWirelessLANStatus { + return &NullableWirelessLANStatus{value: val, isSet: true} +} + +func (v NullableWirelessLANStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status_label.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status_label.go new file mode 100644 index 00000000..13c9b8c6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status_label.go @@ -0,0 +1,114 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessLANStatusLabel the model 'WirelessLANStatusLabel' +type WirelessLANStatusLabel string + +// List of WirelessLAN_status_label +const ( + WIRELESSLANSTATUSLABEL_ACTIVE WirelessLANStatusLabel = "Active" + WIRELESSLANSTATUSLABEL_RESERVED WirelessLANStatusLabel = "Reserved" + WIRELESSLANSTATUSLABEL_DISABLED WirelessLANStatusLabel = "Disabled" + WIRELESSLANSTATUSLABEL_DEPRECATED WirelessLANStatusLabel = "Deprecated" +) + +// All allowed values of WirelessLANStatusLabel enum +var AllowedWirelessLANStatusLabelEnumValues = []WirelessLANStatusLabel{ + "Active", + "Reserved", + "Disabled", + "Deprecated", +} + +func (v *WirelessLANStatusLabel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessLANStatusLabel(value) + for _, existing := range AllowedWirelessLANStatusLabelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessLANStatusLabel", value) +} + +// NewWirelessLANStatusLabelFromValue returns a pointer to a valid WirelessLANStatusLabel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessLANStatusLabelFromValue(v string) (*WirelessLANStatusLabel, error) { + ev := WirelessLANStatusLabel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessLANStatusLabel: valid values are %v", v, AllowedWirelessLANStatusLabelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessLANStatusLabel) IsValid() bool { + for _, existing := range AllowedWirelessLANStatusLabelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WirelessLAN_status_label value +func (v WirelessLANStatusLabel) Ptr() *WirelessLANStatusLabel { + return &v +} + +type NullableWirelessLANStatusLabel struct { + value *WirelessLANStatusLabel + isSet bool +} + +func (v NullableWirelessLANStatusLabel) Get() *WirelessLANStatusLabel { + return v.value +} + +func (v *NullableWirelessLANStatusLabel) Set(val *WirelessLANStatusLabel) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANStatusLabel) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANStatusLabel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANStatusLabel(val *WirelessLANStatusLabel) *NullableWirelessLANStatusLabel { + return &NullableWirelessLANStatusLabel{value: val, isSet: true} +} + +func (v NullableWirelessLANStatusLabel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANStatusLabel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status_value.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status_value.go new file mode 100644 index 00000000..93cb6a09 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_lan_status_value.go @@ -0,0 +1,116 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessLANStatusValue * `active` - Active * `reserved` - Reserved * `disabled` - Disabled * `deprecated` - Deprecated +type WirelessLANStatusValue string + +// List of WirelessLAN_status_value +const ( + WIRELESSLANSTATUSVALUE_ACTIVE WirelessLANStatusValue = "active" + WIRELESSLANSTATUSVALUE_RESERVED WirelessLANStatusValue = "reserved" + WIRELESSLANSTATUSVALUE_DISABLED WirelessLANStatusValue = "disabled" + WIRELESSLANSTATUSVALUE_DEPRECATED WirelessLANStatusValue = "deprecated" + WIRELESSLANSTATUSVALUE_EMPTY WirelessLANStatusValue = "" +) + +// All allowed values of WirelessLANStatusValue enum +var AllowedWirelessLANStatusValueEnumValues = []WirelessLANStatusValue{ + "active", + "reserved", + "disabled", + "deprecated", + "", +} + +func (v *WirelessLANStatusValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessLANStatusValue(value) + for _, existing := range AllowedWirelessLANStatusValueEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessLANStatusValue", value) +} + +// NewWirelessLANStatusValueFromValue returns a pointer to a valid WirelessLANStatusValue +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessLANStatusValueFromValue(v string) (*WirelessLANStatusValue, error) { + ev := WirelessLANStatusValue(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessLANStatusValue: valid values are %v", v, AllowedWirelessLANStatusValueEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessLANStatusValue) IsValid() bool { + for _, existing := range AllowedWirelessLANStatusValueEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WirelessLAN_status_value value +func (v WirelessLANStatusValue) Ptr() *WirelessLANStatusValue { + return &v +} + +type NullableWirelessLANStatusValue struct { + value *WirelessLANStatusValue + isSet bool +} + +func (v NullableWirelessLANStatusValue) Get() *WirelessLANStatusValue { + return v.value +} + +func (v *NullableWirelessLANStatusValue) Set(val *WirelessLANStatusValue) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLANStatusValue) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLANStatusValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLANStatusValue(val *WirelessLANStatusValue) *NullableWirelessLANStatusValue { + return &NullableWirelessLANStatusValue{value: val, isSet: true} +} + +func (v NullableWirelessLANStatusValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLANStatusValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_link.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_link.go new file mode 100644 index 00000000..a9b7d710 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_link.go @@ -0,0 +1,726 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the WirelessLink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLink{} + +// WirelessLink Adds support for custom fields and tags. +type WirelessLink struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + InterfaceA NestedInterface `json:"interface_a"` + InterfaceB NestedInterface `json:"interface_b"` + Ssid *string `json:"ssid,omitempty"` + Status *CableStatus `json:"status,omitempty"` + Tenant NullableNestedTenant `json:"tenant,omitempty"` + AuthType *WirelessLANAuthType `json:"auth_type,omitempty"` + AuthCipher *WirelessLANAuthCipher `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTag `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Created NullableTime `json:"created"` + LastUpdated NullableTime `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLink WirelessLink + +// NewWirelessLink instantiates a new WirelessLink object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLink(id int32, url string, display string, interfaceA NestedInterface, interfaceB NestedInterface, created NullableTime, lastUpdated NullableTime) *WirelessLink { + this := WirelessLink{} + this.Id = id + this.Url = url + this.Display = display + this.InterfaceA = interfaceA + this.InterfaceB = interfaceB + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewWirelessLinkWithDefaults instantiates a new WirelessLink object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLinkWithDefaults() *WirelessLink { + this := WirelessLink{} + return &this +} + +// GetId returns the Id field value +func (o *WirelessLink) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WirelessLink) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *WirelessLink) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *WirelessLink) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *WirelessLink) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *WirelessLink) SetDisplay(v string) { + o.Display = v +} + +// GetInterfaceA returns the InterfaceA field value +func (o *WirelessLink) GetInterfaceA() NestedInterface { + if o == nil { + var ret NestedInterface + return ret + } + + return o.InterfaceA +} + +// GetInterfaceAOk returns a tuple with the InterfaceA field value +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetInterfaceAOk() (*NestedInterface, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceA, true +} + +// SetInterfaceA sets field value +func (o *WirelessLink) SetInterfaceA(v NestedInterface) { + o.InterfaceA = v +} + +// GetInterfaceB returns the InterfaceB field value +func (o *WirelessLink) GetInterfaceB() NestedInterface { + if o == nil { + var ret NestedInterface + return ret + } + + return o.InterfaceB +} + +// GetInterfaceBOk returns a tuple with the InterfaceB field value +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetInterfaceBOk() (*NestedInterface, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceB, true +} + +// SetInterfaceB sets field value +func (o *WirelessLink) SetInterfaceB(v NestedInterface) { + o.InterfaceB = v +} + +// GetSsid returns the Ssid field value if set, zero value otherwise. +func (o *WirelessLink) GetSsid() string { + if o == nil || IsNil(o.Ssid) { + var ret string + return ret + } + return *o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetSsidOk() (*string, bool) { + if o == nil || IsNil(o.Ssid) { + return nil, false + } + return o.Ssid, true +} + +// HasSsid returns a boolean if a field has been set. +func (o *WirelessLink) HasSsid() bool { + if o != nil && !IsNil(o.Ssid) { + return true + } + + return false +} + +// SetSsid gets a reference to the given string and assigns it to the Ssid field. +func (o *WirelessLink) SetSsid(v string) { + o.Ssid = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WirelessLink) GetStatus() CableStatus { + if o == nil || IsNil(o.Status) { + var ret CableStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetStatusOk() (*CableStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WirelessLink) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatus and assigns it to the Status field. +func (o *WirelessLink) SetStatus(v CableStatus) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLink) GetTenant() NestedTenant { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenant + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLink) GetTenantOk() (*NestedTenant, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WirelessLink) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenant and assigns it to the Tenant field. +func (o *WirelessLink) SetTenant(v NestedTenant) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WirelessLink) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WirelessLink) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *WirelessLink) GetAuthType() WirelessLANAuthType { + if o == nil || IsNil(o.AuthType) { + var ret WirelessLANAuthType + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetAuthTypeOk() (*WirelessLANAuthType, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *WirelessLink) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given WirelessLANAuthType and assigns it to the AuthType field. +func (o *WirelessLink) SetAuthType(v WirelessLANAuthType) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *WirelessLink) GetAuthCipher() WirelessLANAuthCipher { + if o == nil || IsNil(o.AuthCipher) { + var ret WirelessLANAuthCipher + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetAuthCipherOk() (*WirelessLANAuthCipher, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *WirelessLink) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given WirelessLANAuthCipher and assigns it to the AuthCipher field. +func (o *WirelessLink) SetAuthCipher(v WirelessLANAuthCipher) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *WirelessLink) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *WirelessLink) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *WirelessLink) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WirelessLink) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WirelessLink) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WirelessLink) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WirelessLink) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WirelessLink) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WirelessLink) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WirelessLink) GetTags() []NestedTag { + if o == nil || IsNil(o.Tags) { + var ret []NestedTag + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetTagsOk() ([]NestedTag, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WirelessLink) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTag and assigns it to the Tags field. +func (o *WirelessLink) SetTags(v []NestedTag) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WirelessLink) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLink) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WirelessLink) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WirelessLink) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetCreated returns the Created field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *WirelessLink) GetCreated() time.Time { + if o == nil || o.Created.Get() == nil { + var ret time.Time + return ret + } + + return *o.Created.Get() +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLink) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Created.Get(), o.Created.IsSet() +} + +// SetCreated sets field value +func (o *WirelessLink) SetCreated(v time.Time) { + o.Created.Set(&v) +} + +// GetLastUpdated returns the LastUpdated field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *WirelessLink) GetLastUpdated() time.Time { + if o == nil || o.LastUpdated.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUpdated.Get() +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLink) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUpdated.Get(), o.LastUpdated.IsSet() +} + +// SetLastUpdated sets field value +func (o *WirelessLink) SetLastUpdated(v time.Time) { + o.LastUpdated.Set(&v) +} + +func (o WirelessLink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["interface_a"] = o.InterfaceA + toSerialize["interface_b"] = o.InterfaceB + if !IsNil(o.Ssid) { + toSerialize["ssid"] = o.Ssid + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + toSerialize["created"] = o.Created.Get() + toSerialize["last_updated"] = o.LastUpdated.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "interface_a", + "interface_b", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWirelessLink := _WirelessLink{} + + err = json.Unmarshal(data, &varWirelessLink) + + if err != nil { + return err + } + + *o = WirelessLink(varWirelessLink) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "interface_a") + delete(additionalProperties, "interface_b") + delete(additionalProperties, "ssid") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLink struct { + value *WirelessLink + isSet bool +} + +func (v NullableWirelessLink) Get() *WirelessLink { + return v.value +} + +func (v *NullableWirelessLink) Set(val *WirelessLink) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLink) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLink(val *WirelessLink) *NullableWirelessLink { + return &NullableWirelessLink{value: val, isSet: true} +} + +func (v NullableWirelessLink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_link_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_link_request.go new file mode 100644 index 00000000..b156fe6d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_link_request.go @@ -0,0 +1,576 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WirelessLinkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WirelessLinkRequest{} + +// WirelessLinkRequest Adds support for custom fields and tags. +type WirelessLinkRequest struct { + InterfaceA NestedInterfaceRequest `json:"interface_a"` + InterfaceB NestedInterfaceRequest `json:"interface_b"` + Ssid *string `json:"ssid,omitempty"` + Status *CableStatusValue `json:"status,omitempty"` + Tenant NullableNestedTenantRequest `json:"tenant,omitempty"` + AuthType *WirelessLANAuthTypeValue `json:"auth_type,omitempty"` + AuthCipher *WirelessLANAuthCipherValue `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WirelessLinkRequest WirelessLinkRequest + +// NewWirelessLinkRequest instantiates a new WirelessLinkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWirelessLinkRequest(interfaceA NestedInterfaceRequest, interfaceB NestedInterfaceRequest) *WirelessLinkRequest { + this := WirelessLinkRequest{} + this.InterfaceA = interfaceA + this.InterfaceB = interfaceB + return &this +} + +// NewWirelessLinkRequestWithDefaults instantiates a new WirelessLinkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWirelessLinkRequestWithDefaults() *WirelessLinkRequest { + this := WirelessLinkRequest{} + return &this +} + +// GetInterfaceA returns the InterfaceA field value +func (o *WirelessLinkRequest) GetInterfaceA() NestedInterfaceRequest { + if o == nil { + var ret NestedInterfaceRequest + return ret + } + + return o.InterfaceA +} + +// GetInterfaceAOk returns a tuple with the InterfaceA field value +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetInterfaceAOk() (*NestedInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceA, true +} + +// SetInterfaceA sets field value +func (o *WirelessLinkRequest) SetInterfaceA(v NestedInterfaceRequest) { + o.InterfaceA = v +} + +// GetInterfaceB returns the InterfaceB field value +func (o *WirelessLinkRequest) GetInterfaceB() NestedInterfaceRequest { + if o == nil { + var ret NestedInterfaceRequest + return ret + } + + return o.InterfaceB +} + +// GetInterfaceBOk returns a tuple with the InterfaceB field value +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetInterfaceBOk() (*NestedInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceB, true +} + +// SetInterfaceB sets field value +func (o *WirelessLinkRequest) SetInterfaceB(v NestedInterfaceRequest) { + o.InterfaceB = v +} + +// GetSsid returns the Ssid field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetSsid() string { + if o == nil || IsNil(o.Ssid) { + var ret string + return ret + } + return *o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetSsidOk() (*string, bool) { + if o == nil || IsNil(o.Ssid) { + return nil, false + } + return o.Ssid, true +} + +// HasSsid returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasSsid() bool { + if o != nil && !IsNil(o.Ssid) { + return true + } + + return false +} + +// SetSsid gets a reference to the given string and assigns it to the Ssid field. +func (o *WirelessLinkRequest) SetSsid(v string) { + o.Ssid = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetStatus() CableStatusValue { + if o == nil || IsNil(o.Status) { + var ret CableStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetStatusOk() (*CableStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatusValue and assigns it to the Status field. +func (o *WirelessLinkRequest) SetStatus(v CableStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WirelessLinkRequest) GetTenant() NestedTenantRequest { + if o == nil || IsNil(o.Tenant.Get()) { + var ret NestedTenantRequest + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WirelessLinkRequest) GetTenantOk() (*NestedTenantRequest, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableNestedTenantRequest and assigns it to the Tenant field. +func (o *WirelessLinkRequest) SetTenant(v NestedTenantRequest) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WirelessLinkRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WirelessLinkRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetAuthType() WirelessLANAuthTypeValue { + if o == nil || IsNil(o.AuthType) { + var ret WirelessLANAuthTypeValue + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetAuthTypeOk() (*WirelessLANAuthTypeValue, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given WirelessLANAuthTypeValue and assigns it to the AuthType field. +func (o *WirelessLinkRequest) SetAuthType(v WirelessLANAuthTypeValue) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetAuthCipher() WirelessLANAuthCipherValue { + if o == nil || IsNil(o.AuthCipher) { + var ret WirelessLANAuthCipherValue + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetAuthCipherOk() (*WirelessLANAuthCipherValue, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given WirelessLANAuthCipherValue and assigns it to the AuthCipher field. +func (o *WirelessLinkRequest) SetAuthCipher(v WirelessLANAuthCipherValue) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *WirelessLinkRequest) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WirelessLinkRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WirelessLinkRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WirelessLinkRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WirelessLinkRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WirelessLinkRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WirelessLinkRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WirelessLinkRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WirelessLinkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WirelessLinkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["interface_a"] = o.InterfaceA + toSerialize["interface_b"] = o.InterfaceB + if !IsNil(o.Ssid) { + toSerialize["ssid"] = o.Ssid + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WirelessLinkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "interface_a", + "interface_b", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWirelessLinkRequest := _WirelessLinkRequest{} + + err = json.Unmarshal(data, &varWirelessLinkRequest) + + if err != nil { + return err + } + + *o = WirelessLinkRequest(varWirelessLinkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "interface_a") + delete(additionalProperties, "interface_b") + delete(additionalProperties, "ssid") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWirelessLinkRequest struct { + value *WirelessLinkRequest + isSet bool +} + +func (v NullableWirelessLinkRequest) Get() *WirelessLinkRequest { + return v.value +} + +func (v *NullableWirelessLinkRequest) Set(val *WirelessLinkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessLinkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessLinkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessLinkRequest(val *WirelessLinkRequest) *NullableWirelessLinkRequest { + return &NullableWirelessLinkRequest{value: val, isSet: true} +} + +func (v NullableWirelessLinkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessLinkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_role.go b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_role.go new file mode 100644 index 00000000..13858aae --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_wireless_role.go @@ -0,0 +1,112 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// WirelessRole * `ap` - Access point * `station` - Station +type WirelessRole string + +// List of Wireless_role +const ( + WIRELESSROLE_AP WirelessRole = "ap" + WIRELESSROLE_STATION WirelessRole = "station" + WIRELESSROLE_EMPTY WirelessRole = "" +) + +// All allowed values of WirelessRole enum +var AllowedWirelessRoleEnumValues = []WirelessRole{ + "ap", + "station", + "", +} + +func (v *WirelessRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WirelessRole(value) + for _, existing := range AllowedWirelessRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WirelessRole", value) +} + +// NewWirelessRoleFromValue returns a pointer to a valid WirelessRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWirelessRoleFromValue(v string) (*WirelessRole, error) { + ev := WirelessRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WirelessRole: valid values are %v", v, AllowedWirelessRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WirelessRole) IsValid() bool { + for _, existing := range AllowedWirelessRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Wireless_role value +func (v WirelessRole) Ptr() *WirelessRole { + return &v +} + +type NullableWirelessRole struct { + value *WirelessRole + isSet bool +} + +func (v NullableWirelessRole) Get() *WirelessRole { + return v.value +} + +func (v *NullableWirelessRole) Set(val *WirelessRole) { + v.value = val + v.isSet = true +} + +func (v NullableWirelessRole) IsSet() bool { + return v.isSet +} + +func (v *NullableWirelessRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWirelessRole(val *WirelessRole) *NullableWirelessRole { + return &NullableWirelessRole{value: val, isSet: true} +} + +func (v NullableWirelessRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWirelessRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_aggregate_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_aggregate_request.go new file mode 100644 index 00000000..e17079e2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_aggregate_request.go @@ -0,0 +1,440 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableAggregateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableAggregateRequest{} + +// WritableAggregateRequest Adds support for custom fields and tags. +type WritableAggregateRequest struct { + Prefix string `json:"prefix"` + // Regional Internet Registry responsible for this IP space + Rir int32 `json:"rir"` + Tenant NullableInt32 `json:"tenant,omitempty"` + DateAdded NullableString `json:"date_added,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableAggregateRequest WritableAggregateRequest + +// NewWritableAggregateRequest instantiates a new WritableAggregateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableAggregateRequest(prefix string, rir int32) *WritableAggregateRequest { + this := WritableAggregateRequest{} + this.Prefix = prefix + this.Rir = rir + return &this +} + +// NewWritableAggregateRequestWithDefaults instantiates a new WritableAggregateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableAggregateRequestWithDefaults() *WritableAggregateRequest { + this := WritableAggregateRequest{} + return &this +} + +// GetPrefix returns the Prefix field value +func (o *WritableAggregateRequest) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *WritableAggregateRequest) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *WritableAggregateRequest) SetPrefix(v string) { + o.Prefix = v +} + +// GetRir returns the Rir field value +func (o *WritableAggregateRequest) GetRir() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Rir +} + +// GetRirOk returns a tuple with the Rir field value +// and a boolean to check if the value has been set. +func (o *WritableAggregateRequest) GetRirOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Rir, true +} + +// SetRir sets field value +func (o *WritableAggregateRequest) SetRir(v int32) { + o.Rir = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableAggregateRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableAggregateRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableAggregateRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableAggregateRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableAggregateRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableAggregateRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDateAdded returns the DateAdded field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableAggregateRequest) GetDateAdded() string { + if o == nil || IsNil(o.DateAdded.Get()) { + var ret string + return ret + } + return *o.DateAdded.Get() +} + +// GetDateAddedOk returns a tuple with the DateAdded field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableAggregateRequest) GetDateAddedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DateAdded.Get(), o.DateAdded.IsSet() +} + +// HasDateAdded returns a boolean if a field has been set. +func (o *WritableAggregateRequest) HasDateAdded() bool { + if o != nil && o.DateAdded.IsSet() { + return true + } + + return false +} + +// SetDateAdded gets a reference to the given NullableString and assigns it to the DateAdded field. +func (o *WritableAggregateRequest) SetDateAdded(v string) { + o.DateAdded.Set(&v) +} + +// SetDateAddedNil sets the value for DateAdded to be an explicit nil +func (o *WritableAggregateRequest) SetDateAddedNil() { + o.DateAdded.Set(nil) +} + +// UnsetDateAdded ensures that no value is present for DateAdded, not even an explicit nil +func (o *WritableAggregateRequest) UnsetDateAdded() { + o.DateAdded.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableAggregateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableAggregateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableAggregateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableAggregateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableAggregateRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableAggregateRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableAggregateRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableAggregateRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableAggregateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableAggregateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableAggregateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableAggregateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableAggregateRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableAggregateRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableAggregateRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableAggregateRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableAggregateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableAggregateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prefix"] = o.Prefix + toSerialize["rir"] = o.Rir + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.DateAdded.IsSet() { + toSerialize["date_added"] = o.DateAdded.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableAggregateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + "rir", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableAggregateRequest := _WritableAggregateRequest{} + + err = json.Unmarshal(data, &varWritableAggregateRequest) + + if err != nil { + return err + } + + *o = WritableAggregateRequest(varWritableAggregateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "date_added") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableAggregateRequest struct { + value *WritableAggregateRequest + isSet bool +} + +func (v NullableWritableAggregateRequest) Get() *WritableAggregateRequest { + return v.value +} + +func (v *NullableWritableAggregateRequest) Set(val *WritableAggregateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableAggregateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableAggregateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableAggregateRequest(val *WritableAggregateRequest) *NullableWritableAggregateRequest { + return &NullableWritableAggregateRequest{value: val, isSet: true} +} + +func (v NullableWritableAggregateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableAggregateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_asn_range_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_asn_range_request.go new file mode 100644 index 00000000..22d653c3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_asn_range_request.go @@ -0,0 +1,441 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableASNRangeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableASNRangeRequest{} + +// WritableASNRangeRequest Adds support for custom fields and tags. +type WritableASNRangeRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Rir int32 `json:"rir"` + Start int64 `json:"start"` + End int64 `json:"end"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableASNRangeRequest WritableASNRangeRequest + +// NewWritableASNRangeRequest instantiates a new WritableASNRangeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableASNRangeRequest(name string, slug string, rir int32, start int64, end int64) *WritableASNRangeRequest { + this := WritableASNRangeRequest{} + this.Name = name + this.Slug = slug + this.Rir = rir + this.Start = start + this.End = end + return &this +} + +// NewWritableASNRangeRequestWithDefaults instantiates a new WritableASNRangeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableASNRangeRequestWithDefaults() *WritableASNRangeRequest { + this := WritableASNRangeRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableASNRangeRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableASNRangeRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableASNRangeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableASNRangeRequest) SetSlug(v string) { + o.Slug = v +} + +// GetRir returns the Rir field value +func (o *WritableASNRangeRequest) GetRir() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Rir +} + +// GetRirOk returns a tuple with the Rir field value +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetRirOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Rir, true +} + +// SetRir sets field value +func (o *WritableASNRangeRequest) SetRir(v int32) { + o.Rir = v +} + +// GetStart returns the Start field value +func (o *WritableASNRangeRequest) GetStart() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetStartOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *WritableASNRangeRequest) SetStart(v int64) { + o.Start = v +} + +// GetEnd returns the End field value +func (o *WritableASNRangeRequest) GetEnd() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetEndOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *WritableASNRangeRequest) SetEnd(v int64) { + o.End = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableASNRangeRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableASNRangeRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableASNRangeRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableASNRangeRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableASNRangeRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableASNRangeRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableASNRangeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableASNRangeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableASNRangeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableASNRangeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableASNRangeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableASNRangeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableASNRangeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableASNRangeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableASNRangeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableASNRangeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableASNRangeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableASNRangeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["rir"] = o.Rir + toSerialize["start"] = o.Start + toSerialize["end"] = o.End + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableASNRangeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "rir", + "start", + "end", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableASNRangeRequest := _WritableASNRangeRequest{} + + err = json.Unmarshal(data, &varWritableASNRangeRequest) + + if err != nil { + return err + } + + *o = WritableASNRangeRequest(varWritableASNRangeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "rir") + delete(additionalProperties, "start") + delete(additionalProperties, "end") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableASNRangeRequest struct { + value *WritableASNRangeRequest + isSet bool +} + +func (v NullableWritableASNRangeRequest) Get() *WritableASNRangeRequest { + return v.value +} + +func (v *NullableWritableASNRangeRequest) Set(val *WritableASNRangeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableASNRangeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableASNRangeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableASNRangeRequest(val *WritableASNRangeRequest) *NullableWritableASNRangeRequest { + return &NullableWritableASNRangeRequest{value: val, isSet: true} +} + +func (v NullableWritableASNRangeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableASNRangeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_asn_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_asn_request.go new file mode 100644 index 00000000..9fed8afb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_asn_request.go @@ -0,0 +1,393 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableASNRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableASNRequest{} + +// WritableASNRequest Adds support for custom fields and tags. +type WritableASNRequest struct { + // 16- or 32-bit autonomous system number + Asn int64 `json:"asn"` + // Regional Internet Registry responsible for this AS number space + Rir int32 `json:"rir"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableASNRequest WritableASNRequest + +// NewWritableASNRequest instantiates a new WritableASNRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableASNRequest(asn int64, rir int32) *WritableASNRequest { + this := WritableASNRequest{} + this.Asn = asn + this.Rir = rir + return &this +} + +// NewWritableASNRequestWithDefaults instantiates a new WritableASNRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableASNRequestWithDefaults() *WritableASNRequest { + this := WritableASNRequest{} + return &this +} + +// GetAsn returns the Asn field value +func (o *WritableASNRequest) GetAsn() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *WritableASNRequest) GetAsnOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *WritableASNRequest) SetAsn(v int64) { + o.Asn = v +} + +// GetRir returns the Rir field value +func (o *WritableASNRequest) GetRir() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Rir +} + +// GetRirOk returns a tuple with the Rir field value +// and a boolean to check if the value has been set. +func (o *WritableASNRequest) GetRirOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Rir, true +} + +// SetRir sets field value +func (o *WritableASNRequest) SetRir(v int32) { + o.Rir = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableASNRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableASNRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableASNRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableASNRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableASNRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableASNRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableASNRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableASNRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableASNRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableASNRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableASNRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableASNRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableASNRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableASNRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableASNRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableASNRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableASNRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableASNRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableASNRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableASNRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableASNRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableASNRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableASNRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableASNRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["asn"] = o.Asn + toSerialize["rir"] = o.Rir + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableASNRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "asn", + "rir", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableASNRequest := _WritableASNRequest{} + + err = json.Unmarshal(data, &varWritableASNRequest) + + if err != nil { + return err + } + + *o = WritableASNRequest(varWritableASNRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "asn") + delete(additionalProperties, "rir") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableASNRequest struct { + value *WritableASNRequest + isSet bool +} + +func (v NullableWritableASNRequest) Get() *WritableASNRequest { + return v.value +} + +func (v *NullableWritableASNRequest) Set(val *WritableASNRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableASNRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableASNRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableASNRequest(val *WritableASNRequest) *NullableWritableASNRequest { + return &NullableWritableASNRequest{value: val, isSet: true} +} + +func (v NullableWritableASNRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableASNRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_bookmark_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_bookmark_request.go new file mode 100644 index 00000000..f6a83966 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_bookmark_request.go @@ -0,0 +1,224 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableBookmarkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableBookmarkRequest{} + +// WritableBookmarkRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableBookmarkRequest struct { + ObjectType string `json:"object_type"` + ObjectId int64 `json:"object_id"` + User int32 `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _WritableBookmarkRequest WritableBookmarkRequest + +// NewWritableBookmarkRequest instantiates a new WritableBookmarkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableBookmarkRequest(objectType string, objectId int64, user int32) *WritableBookmarkRequest { + this := WritableBookmarkRequest{} + this.ObjectType = objectType + this.ObjectId = objectId + this.User = user + return &this +} + +// NewWritableBookmarkRequestWithDefaults instantiates a new WritableBookmarkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableBookmarkRequestWithDefaults() *WritableBookmarkRequest { + this := WritableBookmarkRequest{} + return &this +} + +// GetObjectType returns the ObjectType field value +func (o *WritableBookmarkRequest) GetObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectType +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value +// and a boolean to check if the value has been set. +func (o *WritableBookmarkRequest) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectType, true +} + +// SetObjectType sets field value +func (o *WritableBookmarkRequest) SetObjectType(v string) { + o.ObjectType = v +} + +// GetObjectId returns the ObjectId field value +func (o *WritableBookmarkRequest) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *WritableBookmarkRequest) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *WritableBookmarkRequest) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetUser returns the User field value +func (o *WritableBookmarkRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *WritableBookmarkRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *WritableBookmarkRequest) SetUser(v int32) { + o.User = v +} + +func (o WritableBookmarkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableBookmarkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["object_type"] = o.ObjectType + toSerialize["object_id"] = o.ObjectId + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableBookmarkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "object_type", + "object_id", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableBookmarkRequest := _WritableBookmarkRequest{} + + err = json.Unmarshal(data, &varWritableBookmarkRequest) + + if err != nil { + return err + } + + *o = WritableBookmarkRequest(varWritableBookmarkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableBookmarkRequest struct { + value *WritableBookmarkRequest + isSet bool +} + +func (v NullableWritableBookmarkRequest) Get() *WritableBookmarkRequest { + return v.value +} + +func (v *NullableWritableBookmarkRequest) Set(val *WritableBookmarkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableBookmarkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableBookmarkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableBookmarkRequest(val *WritableBookmarkRequest) *NullableWritableBookmarkRequest { + return &NullableWritableBookmarkRequest{value: val, isSet: true} +} + +func (v NullableWritableBookmarkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableBookmarkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_cable_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_cable_request.go new file mode 100644 index 00000000..781a1b48 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_cable_request.go @@ -0,0 +1,619 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" +) + +// checks if the WritableCableRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableCableRequest{} + +// WritableCableRequest Adds support for custom fields and tags. +type WritableCableRequest struct { + Type *CableType `json:"type,omitempty"` + ATerminations []GenericObjectRequest `json:"a_terminations,omitempty"` + BTerminations []GenericObjectRequest `json:"b_terminations,omitempty"` + Status *CableStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Label *string `json:"label,omitempty"` + Color *string `json:"color,omitempty"` + Length NullableFloat64 `json:"length,omitempty"` + LengthUnit *CableLengthUnitValue `json:"length_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableCableRequest WritableCableRequest + +// NewWritableCableRequest instantiates a new WritableCableRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableCableRequest() *WritableCableRequest { + this := WritableCableRequest{} + return &this +} + +// NewWritableCableRequestWithDefaults instantiates a new WritableCableRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableCableRequestWithDefaults() *WritableCableRequest { + this := WritableCableRequest{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritableCableRequest) GetType() CableType { + if o == nil || IsNil(o.Type) { + var ret CableType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetTypeOk() (*CableType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritableCableRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given CableType and assigns it to the Type field. +func (o *WritableCableRequest) SetType(v CableType) { + o.Type = &v +} + +// GetATerminations returns the ATerminations field value if set, zero value otherwise. +func (o *WritableCableRequest) GetATerminations() []GenericObjectRequest { + if o == nil || IsNil(o.ATerminations) { + var ret []GenericObjectRequest + return ret + } + return o.ATerminations +} + +// GetATerminationsOk returns a tuple with the ATerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetATerminationsOk() ([]GenericObjectRequest, bool) { + if o == nil || IsNil(o.ATerminations) { + return nil, false + } + return o.ATerminations, true +} + +// HasATerminations returns a boolean if a field has been set. +func (o *WritableCableRequest) HasATerminations() bool { + if o != nil && !IsNil(o.ATerminations) { + return true + } + + return false +} + +// SetATerminations gets a reference to the given []GenericObjectRequest and assigns it to the ATerminations field. +func (o *WritableCableRequest) SetATerminations(v []GenericObjectRequest) { + o.ATerminations = v +} + +// GetBTerminations returns the BTerminations field value if set, zero value otherwise. +func (o *WritableCableRequest) GetBTerminations() []GenericObjectRequest { + if o == nil || IsNil(o.BTerminations) { + var ret []GenericObjectRequest + return ret + } + return o.BTerminations +} + +// GetBTerminationsOk returns a tuple with the BTerminations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetBTerminationsOk() ([]GenericObjectRequest, bool) { + if o == nil || IsNil(o.BTerminations) { + return nil, false + } + return o.BTerminations, true +} + +// HasBTerminations returns a boolean if a field has been set. +func (o *WritableCableRequest) HasBTerminations() bool { + if o != nil && !IsNil(o.BTerminations) { + return true + } + + return false +} + +// SetBTerminations gets a reference to the given []GenericObjectRequest and assigns it to the BTerminations field. +func (o *WritableCableRequest) SetBTerminations(v []GenericObjectRequest) { + o.BTerminations = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableCableRequest) GetStatus() CableStatusValue { + if o == nil || IsNil(o.Status) { + var ret CableStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetStatusOk() (*CableStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableCableRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatusValue and assigns it to the Status field. +func (o *WritableCableRequest) SetStatus(v CableStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCableRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCableRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableCableRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableCableRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableCableRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableCableRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableCableRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableCableRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableCableRequest) SetLabel(v string) { + o.Label = &v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *WritableCableRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *WritableCableRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *WritableCableRequest) SetColor(v string) { + o.Color = &v +} + +// GetLength returns the Length field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCableRequest) GetLength() float64 { + if o == nil || IsNil(o.Length.Get()) { + var ret float64 + return ret + } + return *o.Length.Get() +} + +// GetLengthOk returns a tuple with the Length field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCableRequest) GetLengthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Length.Get(), o.Length.IsSet() +} + +// HasLength returns a boolean if a field has been set. +func (o *WritableCableRequest) HasLength() bool { + if o != nil && o.Length.IsSet() { + return true + } + + return false +} + +// SetLength gets a reference to the given NullableFloat64 and assigns it to the Length field. +func (o *WritableCableRequest) SetLength(v float64) { + o.Length.Set(&v) +} + +// SetLengthNil sets the value for Length to be an explicit nil +func (o *WritableCableRequest) SetLengthNil() { + o.Length.Set(nil) +} + +// UnsetLength ensures that no value is present for Length, not even an explicit nil +func (o *WritableCableRequest) UnsetLength() { + o.Length.Unset() +} + +// GetLengthUnit returns the LengthUnit field value if set, zero value otherwise. +func (o *WritableCableRequest) GetLengthUnit() CableLengthUnitValue { + if o == nil || IsNil(o.LengthUnit) { + var ret CableLengthUnitValue + return ret + } + return *o.LengthUnit +} + +// GetLengthUnitOk returns a tuple with the LengthUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetLengthUnitOk() (*CableLengthUnitValue, bool) { + if o == nil || IsNil(o.LengthUnit) { + return nil, false + } + return o.LengthUnit, true +} + +// HasLengthUnit returns a boolean if a field has been set. +func (o *WritableCableRequest) HasLengthUnit() bool { + if o != nil && !IsNil(o.LengthUnit) { + return true + } + + return false +} + +// SetLengthUnit gets a reference to the given CableLengthUnitValue and assigns it to the LengthUnit field. +func (o *WritableCableRequest) SetLengthUnit(v CableLengthUnitValue) { + o.LengthUnit = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableCableRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableCableRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableCableRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableCableRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableCableRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableCableRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableCableRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableCableRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableCableRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableCableRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCableRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableCableRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableCableRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableCableRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableCableRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ATerminations) { + toSerialize["a_terminations"] = o.ATerminations + } + if !IsNil(o.BTerminations) { + toSerialize["b_terminations"] = o.BTerminations + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if o.Length.IsSet() { + toSerialize["length"] = o.Length.Get() + } + if !IsNil(o.LengthUnit) { + toSerialize["length_unit"] = o.LengthUnit + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableCableRequest) UnmarshalJSON(data []byte) (err error) { + varWritableCableRequest := _WritableCableRequest{} + + err = json.Unmarshal(data, &varWritableCableRequest) + + if err != nil { + return err + } + + *o = WritableCableRequest(varWritableCableRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "a_terminations") + delete(additionalProperties, "b_terminations") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "label") + delete(additionalProperties, "color") + delete(additionalProperties, "length") + delete(additionalProperties, "length_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableCableRequest struct { + value *WritableCableRequest + isSet bool +} + +func (v NullableWritableCableRequest) Get() *WritableCableRequest { + return v.value +} + +func (v *NullableWritableCableRequest) Set(val *WritableCableRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableCableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableCableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableCableRequest(val *WritableCableRequest) *NullableWritableCableRequest { + return &NullableWritableCableRequest{value: val, isSet: true} +} + +func (v NullableWritableCableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableCableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_circuit_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_circuit_request.go new file mode 100644 index 00000000..1d1e6fd7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_circuit_request.go @@ -0,0 +1,651 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableCircuitRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableCircuitRequest{} + +// WritableCircuitRequest Adds support for custom fields and tags. +type WritableCircuitRequest struct { + // Unique circuit ID + Cid string `json:"cid"` + Provider int32 `json:"provider"` + ProviderAccount NullableInt32 `json:"provider_account,omitempty"` + Type int32 `json:"type"` + Status *CircuitStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + InstallDate NullableString `json:"install_date,omitempty"` + TerminationDate NullableString `json:"termination_date,omitempty"` + // Committed rate + CommitRate NullableInt32 `json:"commit_rate,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableCircuitRequest WritableCircuitRequest + +// NewWritableCircuitRequest instantiates a new WritableCircuitRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableCircuitRequest(cid string, provider int32, type_ int32) *WritableCircuitRequest { + this := WritableCircuitRequest{} + this.Cid = cid + this.Provider = provider + this.Type = type_ + return &this +} + +// NewWritableCircuitRequestWithDefaults instantiates a new WritableCircuitRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableCircuitRequestWithDefaults() *WritableCircuitRequest { + this := WritableCircuitRequest{} + return &this +} + +// GetCid returns the Cid field value +func (o *WritableCircuitRequest) GetCid() string { + if o == nil { + var ret string + return ret + } + + return o.Cid +} + +// GetCidOk returns a tuple with the Cid field value +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetCidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cid, true +} + +// SetCid sets field value +func (o *WritableCircuitRequest) SetCid(v string) { + o.Cid = v +} + +// GetProvider returns the Provider field value +func (o *WritableCircuitRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *WritableCircuitRequest) SetProvider(v int32) { + o.Provider = v +} + +// GetProviderAccount returns the ProviderAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitRequest) GetProviderAccount() int32 { + if o == nil || IsNil(o.ProviderAccount.Get()) { + var ret int32 + return ret + } + return *o.ProviderAccount.Get() +} + +// GetProviderAccountOk returns a tuple with the ProviderAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitRequest) GetProviderAccountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ProviderAccount.Get(), o.ProviderAccount.IsSet() +} + +// HasProviderAccount returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasProviderAccount() bool { + if o != nil && o.ProviderAccount.IsSet() { + return true + } + + return false +} + +// SetProviderAccount gets a reference to the given NullableInt32 and assigns it to the ProviderAccount field. +func (o *WritableCircuitRequest) SetProviderAccount(v int32) { + o.ProviderAccount.Set(&v) +} + +// SetProviderAccountNil sets the value for ProviderAccount to be an explicit nil +func (o *WritableCircuitRequest) SetProviderAccountNil() { + o.ProviderAccount.Set(nil) +} + +// UnsetProviderAccount ensures that no value is present for ProviderAccount, not even an explicit nil +func (o *WritableCircuitRequest) UnsetProviderAccount() { + o.ProviderAccount.Unset() +} + +// GetType returns the Type field value +func (o *WritableCircuitRequest) GetType() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableCircuitRequest) SetType(v int32) { + o.Type = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableCircuitRequest) GetStatus() CircuitStatusValue { + if o == nil || IsNil(o.Status) { + var ret CircuitStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetStatusOk() (*CircuitStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CircuitStatusValue and assigns it to the Status field. +func (o *WritableCircuitRequest) SetStatus(v CircuitStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableCircuitRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableCircuitRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableCircuitRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetInstallDate returns the InstallDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitRequest) GetInstallDate() string { + if o == nil || IsNil(o.InstallDate.Get()) { + var ret string + return ret + } + return *o.InstallDate.Get() +} + +// GetInstallDateOk returns a tuple with the InstallDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitRequest) GetInstallDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.InstallDate.Get(), o.InstallDate.IsSet() +} + +// HasInstallDate returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasInstallDate() bool { + if o != nil && o.InstallDate.IsSet() { + return true + } + + return false +} + +// SetInstallDate gets a reference to the given NullableString and assigns it to the InstallDate field. +func (o *WritableCircuitRequest) SetInstallDate(v string) { + o.InstallDate.Set(&v) +} + +// SetInstallDateNil sets the value for InstallDate to be an explicit nil +func (o *WritableCircuitRequest) SetInstallDateNil() { + o.InstallDate.Set(nil) +} + +// UnsetInstallDate ensures that no value is present for InstallDate, not even an explicit nil +func (o *WritableCircuitRequest) UnsetInstallDate() { + o.InstallDate.Unset() +} + +// GetTerminationDate returns the TerminationDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitRequest) GetTerminationDate() string { + if o == nil || IsNil(o.TerminationDate.Get()) { + var ret string + return ret + } + return *o.TerminationDate.Get() +} + +// GetTerminationDateOk returns a tuple with the TerminationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitRequest) GetTerminationDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TerminationDate.Get(), o.TerminationDate.IsSet() +} + +// HasTerminationDate returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasTerminationDate() bool { + if o != nil && o.TerminationDate.IsSet() { + return true + } + + return false +} + +// SetTerminationDate gets a reference to the given NullableString and assigns it to the TerminationDate field. +func (o *WritableCircuitRequest) SetTerminationDate(v string) { + o.TerminationDate.Set(&v) +} + +// SetTerminationDateNil sets the value for TerminationDate to be an explicit nil +func (o *WritableCircuitRequest) SetTerminationDateNil() { + o.TerminationDate.Set(nil) +} + +// UnsetTerminationDate ensures that no value is present for TerminationDate, not even an explicit nil +func (o *WritableCircuitRequest) UnsetTerminationDate() { + o.TerminationDate.Unset() +} + +// GetCommitRate returns the CommitRate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitRequest) GetCommitRate() int32 { + if o == nil || IsNil(o.CommitRate.Get()) { + var ret int32 + return ret + } + return *o.CommitRate.Get() +} + +// GetCommitRateOk returns a tuple with the CommitRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitRequest) GetCommitRateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CommitRate.Get(), o.CommitRate.IsSet() +} + +// HasCommitRate returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasCommitRate() bool { + if o != nil && o.CommitRate.IsSet() { + return true + } + + return false +} + +// SetCommitRate gets a reference to the given NullableInt32 and assigns it to the CommitRate field. +func (o *WritableCircuitRequest) SetCommitRate(v int32) { + o.CommitRate.Set(&v) +} + +// SetCommitRateNil sets the value for CommitRate to be an explicit nil +func (o *WritableCircuitRequest) SetCommitRateNil() { + o.CommitRate.Set(nil) +} + +// UnsetCommitRate ensures that no value is present for CommitRate, not even an explicit nil +func (o *WritableCircuitRequest) UnsetCommitRate() { + o.CommitRate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableCircuitRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableCircuitRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableCircuitRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableCircuitRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableCircuitRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableCircuitRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableCircuitRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableCircuitRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableCircuitRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableCircuitRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableCircuitRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cid"] = o.Cid + toSerialize["provider"] = o.Provider + if o.ProviderAccount.IsSet() { + toSerialize["provider_account"] = o.ProviderAccount.Get() + } + toSerialize["type"] = o.Type + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.InstallDate.IsSet() { + toSerialize["install_date"] = o.InstallDate.Get() + } + if o.TerminationDate.IsSet() { + toSerialize["termination_date"] = o.TerminationDate.Get() + } + if o.CommitRate.IsSet() { + toSerialize["commit_rate"] = o.CommitRate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableCircuitRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cid", + "provider", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableCircuitRequest := _WritableCircuitRequest{} + + err = json.Unmarshal(data, &varWritableCircuitRequest) + + if err != nil { + return err + } + + *o = WritableCircuitRequest(varWritableCircuitRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cid") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_account") + delete(additionalProperties, "type") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "install_date") + delete(additionalProperties, "termination_date") + delete(additionalProperties, "commit_rate") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableCircuitRequest struct { + value *WritableCircuitRequest + isSet bool +} + +func (v NullableWritableCircuitRequest) Get() *WritableCircuitRequest { + return v.value +} + +func (v *NullableWritableCircuitRequest) Set(val *WritableCircuitRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableCircuitRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableCircuitRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableCircuitRequest(val *WritableCircuitRequest) *NullableWritableCircuitRequest { + return &NullableWritableCircuitRequest{value: val, isSet: true} +} + +func (v NullableWritableCircuitRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableCircuitRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_circuit_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_circuit_termination_request.go new file mode 100644 index 00000000..303e94c3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_circuit_termination_request.go @@ -0,0 +1,614 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableCircuitTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableCircuitTerminationRequest{} + +// WritableCircuitTerminationRequest Adds support for custom fields and tags. +type WritableCircuitTerminationRequest struct { + Circuit int32 `json:"circuit"` + TermSide Termination `json:"term_side"` + Site NullableInt32 `json:"site,omitempty"` + ProviderNetwork NullableInt32 `json:"provider_network,omitempty"` + // Physical circuit speed + PortSpeed NullableInt32 `json:"port_speed,omitempty"` + // Upstream speed, if different from port speed + UpstreamSpeed NullableInt32 `json:"upstream_speed,omitempty"` + // ID of the local cross-connect + XconnectId *string `json:"xconnect_id,omitempty"` + // Patch panel ID and port number(s) + PpInfo *string `json:"pp_info,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableCircuitTerminationRequest WritableCircuitTerminationRequest + +// NewWritableCircuitTerminationRequest instantiates a new WritableCircuitTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableCircuitTerminationRequest(circuit int32, termSide Termination) *WritableCircuitTerminationRequest { + this := WritableCircuitTerminationRequest{} + this.Circuit = circuit + this.TermSide = termSide + return &this +} + +// NewWritableCircuitTerminationRequestWithDefaults instantiates a new WritableCircuitTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableCircuitTerminationRequestWithDefaults() *WritableCircuitTerminationRequest { + this := WritableCircuitTerminationRequest{} + return &this +} + +// GetCircuit returns the Circuit field value +func (o *WritableCircuitTerminationRequest) GetCircuit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Circuit +} + +// GetCircuitOk returns a tuple with the Circuit field value +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetCircuitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Circuit, true +} + +// SetCircuit sets field value +func (o *WritableCircuitTerminationRequest) SetCircuit(v int32) { + o.Circuit = v +} + +// GetTermSide returns the TermSide field value +func (o *WritableCircuitTerminationRequest) GetTermSide() Termination { + if o == nil { + var ret Termination + return ret + } + + return o.TermSide +} + +// GetTermSideOk returns a tuple with the TermSide field value +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetTermSideOk() (*Termination, bool) { + if o == nil { + return nil, false + } + return &o.TermSide, true +} + +// SetTermSide sets field value +func (o *WritableCircuitTerminationRequest) SetTermSide(v Termination) { + o.TermSide = v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitTerminationRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitTerminationRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *WritableCircuitTerminationRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *WritableCircuitTerminationRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *WritableCircuitTerminationRequest) UnsetSite() { + o.Site.Unset() +} + +// GetProviderNetwork returns the ProviderNetwork field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitTerminationRequest) GetProviderNetwork() int32 { + if o == nil || IsNil(o.ProviderNetwork.Get()) { + var ret int32 + return ret + } + return *o.ProviderNetwork.Get() +} + +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitTerminationRequest) GetProviderNetworkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() +} + +// HasProviderNetwork returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasProviderNetwork() bool { + if o != nil && o.ProviderNetwork.IsSet() { + return true + } + + return false +} + +// SetProviderNetwork gets a reference to the given NullableInt32 and assigns it to the ProviderNetwork field. +func (o *WritableCircuitTerminationRequest) SetProviderNetwork(v int32) { + o.ProviderNetwork.Set(&v) +} + +// SetProviderNetworkNil sets the value for ProviderNetwork to be an explicit nil +func (o *WritableCircuitTerminationRequest) SetProviderNetworkNil() { + o.ProviderNetwork.Set(nil) +} + +// UnsetProviderNetwork ensures that no value is present for ProviderNetwork, not even an explicit nil +func (o *WritableCircuitTerminationRequest) UnsetProviderNetwork() { + o.ProviderNetwork.Unset() +} + +// GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitTerminationRequest) GetPortSpeed() int32 { + if o == nil || IsNil(o.PortSpeed.Get()) { + var ret int32 + return ret + } + return *o.PortSpeed.Get() +} + +// GetPortSpeedOk returns a tuple with the PortSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitTerminationRequest) GetPortSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PortSpeed.Get(), o.PortSpeed.IsSet() +} + +// HasPortSpeed returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasPortSpeed() bool { + if o != nil && o.PortSpeed.IsSet() { + return true + } + + return false +} + +// SetPortSpeed gets a reference to the given NullableInt32 and assigns it to the PortSpeed field. +func (o *WritableCircuitTerminationRequest) SetPortSpeed(v int32) { + o.PortSpeed.Set(&v) +} + +// SetPortSpeedNil sets the value for PortSpeed to be an explicit nil +func (o *WritableCircuitTerminationRequest) SetPortSpeedNil() { + o.PortSpeed.Set(nil) +} + +// UnsetPortSpeed ensures that no value is present for PortSpeed, not even an explicit nil +func (o *WritableCircuitTerminationRequest) UnsetPortSpeed() { + o.PortSpeed.Unset() +} + +// GetUpstreamSpeed returns the UpstreamSpeed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCircuitTerminationRequest) GetUpstreamSpeed() int32 { + if o == nil || IsNil(o.UpstreamSpeed.Get()) { + var ret int32 + return ret + } + return *o.UpstreamSpeed.Get() +} + +// GetUpstreamSpeedOk returns a tuple with the UpstreamSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCircuitTerminationRequest) GetUpstreamSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UpstreamSpeed.Get(), o.UpstreamSpeed.IsSet() +} + +// HasUpstreamSpeed returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasUpstreamSpeed() bool { + if o != nil && o.UpstreamSpeed.IsSet() { + return true + } + + return false +} + +// SetUpstreamSpeed gets a reference to the given NullableInt32 and assigns it to the UpstreamSpeed field. +func (o *WritableCircuitTerminationRequest) SetUpstreamSpeed(v int32) { + o.UpstreamSpeed.Set(&v) +} + +// SetUpstreamSpeedNil sets the value for UpstreamSpeed to be an explicit nil +func (o *WritableCircuitTerminationRequest) SetUpstreamSpeedNil() { + o.UpstreamSpeed.Set(nil) +} + +// UnsetUpstreamSpeed ensures that no value is present for UpstreamSpeed, not even an explicit nil +func (o *WritableCircuitTerminationRequest) UnsetUpstreamSpeed() { + o.UpstreamSpeed.Unset() +} + +// GetXconnectId returns the XconnectId field value if set, zero value otherwise. +func (o *WritableCircuitTerminationRequest) GetXconnectId() string { + if o == nil || IsNil(o.XconnectId) { + var ret string + return ret + } + return *o.XconnectId +} + +// GetXconnectIdOk returns a tuple with the XconnectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetXconnectIdOk() (*string, bool) { + if o == nil || IsNil(o.XconnectId) { + return nil, false + } + return o.XconnectId, true +} + +// HasXconnectId returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasXconnectId() bool { + if o != nil && !IsNil(o.XconnectId) { + return true + } + + return false +} + +// SetXconnectId gets a reference to the given string and assigns it to the XconnectId field. +func (o *WritableCircuitTerminationRequest) SetXconnectId(v string) { + o.XconnectId = &v +} + +// GetPpInfo returns the PpInfo field value if set, zero value otherwise. +func (o *WritableCircuitTerminationRequest) GetPpInfo() string { + if o == nil || IsNil(o.PpInfo) { + var ret string + return ret + } + return *o.PpInfo +} + +// GetPpInfoOk returns a tuple with the PpInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetPpInfoOk() (*string, bool) { + if o == nil || IsNil(o.PpInfo) { + return nil, false + } + return o.PpInfo, true +} + +// HasPpInfo returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasPpInfo() bool { + if o != nil && !IsNil(o.PpInfo) { + return true + } + + return false +} + +// SetPpInfo gets a reference to the given string and assigns it to the PpInfo field. +func (o *WritableCircuitTerminationRequest) SetPpInfo(v string) { + o.PpInfo = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableCircuitTerminationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableCircuitTerminationRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritableCircuitTerminationRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritableCircuitTerminationRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableCircuitTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableCircuitTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableCircuitTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCircuitTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableCircuitTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableCircuitTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableCircuitTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableCircuitTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["circuit"] = o.Circuit + toSerialize["term_side"] = o.TermSide + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.ProviderNetwork.IsSet() { + toSerialize["provider_network"] = o.ProviderNetwork.Get() + } + if o.PortSpeed.IsSet() { + toSerialize["port_speed"] = o.PortSpeed.Get() + } + if o.UpstreamSpeed.IsSet() { + toSerialize["upstream_speed"] = o.UpstreamSpeed.Get() + } + if !IsNil(o.XconnectId) { + toSerialize["xconnect_id"] = o.XconnectId + } + if !IsNil(o.PpInfo) { + toSerialize["pp_info"] = o.PpInfo + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableCircuitTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "circuit", + "term_side", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableCircuitTerminationRequest := _WritableCircuitTerminationRequest{} + + err = json.Unmarshal(data, &varWritableCircuitTerminationRequest) + + if err != nil { + return err + } + + *o = WritableCircuitTerminationRequest(varWritableCircuitTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "circuit") + delete(additionalProperties, "term_side") + delete(additionalProperties, "site") + delete(additionalProperties, "provider_network") + delete(additionalProperties, "port_speed") + delete(additionalProperties, "upstream_speed") + delete(additionalProperties, "xconnect_id") + delete(additionalProperties, "pp_info") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableCircuitTerminationRequest struct { + value *WritableCircuitTerminationRequest + isSet bool +} + +func (v NullableWritableCircuitTerminationRequest) Get() *WritableCircuitTerminationRequest { + return v.value +} + +func (v *NullableWritableCircuitTerminationRequest) Set(val *WritableCircuitTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableCircuitTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableCircuitTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableCircuitTerminationRequest(val *WritableCircuitTerminationRequest) *NullableWritableCircuitTerminationRequest { + return &NullableWritableCircuitTerminationRequest{value: val, isSet: true} +} + +func (v NullableWritableCircuitTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableCircuitTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_cluster_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_cluster_request.go new file mode 100644 index 00000000..566ca9cb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_cluster_request.go @@ -0,0 +1,524 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableClusterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableClusterRequest{} + +// WritableClusterRequest Adds support for custom fields and tags. +type WritableClusterRequest struct { + Name string `json:"name"` + Type int32 `json:"type"` + Group NullableInt32 `json:"group,omitempty"` + Status *ClusterStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Site NullableInt32 `json:"site,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableClusterRequest WritableClusterRequest + +// NewWritableClusterRequest instantiates a new WritableClusterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableClusterRequest(name string, type_ int32) *WritableClusterRequest { + this := WritableClusterRequest{} + this.Name = name + this.Type = type_ + return &this +} + +// NewWritableClusterRequestWithDefaults instantiates a new WritableClusterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableClusterRequestWithDefaults() *WritableClusterRequest { + this := WritableClusterRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableClusterRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableClusterRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableClusterRequest) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *WritableClusterRequest) GetType() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableClusterRequest) GetTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableClusterRequest) SetType(v int32) { + o.Type = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableClusterRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableClusterRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *WritableClusterRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WritableClusterRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WritableClusterRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableClusterRequest) GetStatus() ClusterStatusValue { + if o == nil || IsNil(o.Status) { + var ret ClusterStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableClusterRequest) GetStatusOk() (*ClusterStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ClusterStatusValue and assigns it to the Status field. +func (o *WritableClusterRequest) SetStatus(v ClusterStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableClusterRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableClusterRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableClusterRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableClusterRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableClusterRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableClusterRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableClusterRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *WritableClusterRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *WritableClusterRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *WritableClusterRequest) UnsetSite() { + o.Site.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableClusterRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableClusterRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableClusterRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableClusterRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableClusterRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableClusterRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableClusterRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableClusterRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableClusterRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableClusterRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableClusterRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableClusterRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableClusterRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableClusterRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableClusterRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableClusterRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableClusterRequest := _WritableClusterRequest{} + + err = json.Unmarshal(data, &varWritableClusterRequest) + + if err != nil { + return err + } + + *o = WritableClusterRequest(varWritableClusterRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "site") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableClusterRequest struct { + value *WritableClusterRequest + isSet bool +} + +func (v NullableWritableClusterRequest) Get() *WritableClusterRequest { + return v.value +} + +func (v *NullableWritableClusterRequest) Set(val *WritableClusterRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableClusterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableClusterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableClusterRequest(val *WritableClusterRequest) *NullableWritableClusterRequest { + return &NullableWritableClusterRequest{value: val, isSet: true} +} + +func (v NullableWritableClusterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableClusterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_config_context_request.go new file mode 100644 index 00000000..388353f6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_config_context_request.go @@ -0,0 +1,840 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableConfigContextRequest{} + +// WritableConfigContextRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableConfigContextRequest struct { + Name string `json:"name"` + Weight *int32 `json:"weight,omitempty"` + Description *string `json:"description,omitempty"` + IsActive *bool `json:"is_active,omitempty"` + Regions []int32 `json:"regions,omitempty"` + SiteGroups []int32 `json:"site_groups,omitempty"` + Sites []int32 `json:"sites,omitempty"` + Locations []int32 `json:"locations,omitempty"` + DeviceTypes []int32 `json:"device_types,omitempty"` + Roles []int32 `json:"roles,omitempty"` + Platforms []int32 `json:"platforms,omitempty"` + ClusterTypes []int32 `json:"cluster_types,omitempty"` + ClusterGroups []int32 `json:"cluster_groups,omitempty"` + Clusters []int32 `json:"clusters,omitempty"` + TenantGroups []int32 `json:"tenant_groups,omitempty"` + Tenants []int32 `json:"tenants,omitempty"` + Tags []string `json:"tags,omitempty"` + // Remote data source + DataSource NullableInt32 `json:"data_source,omitempty"` + Data interface{} `json:"data"` + AdditionalProperties map[string]interface{} +} + +type _WritableConfigContextRequest WritableConfigContextRequest + +// NewWritableConfigContextRequest instantiates a new WritableConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableConfigContextRequest(name string, data interface{}) *WritableConfigContextRequest { + this := WritableConfigContextRequest{} + this.Name = name + this.Data = data + return &this +} + +// NewWritableConfigContextRequestWithDefaults instantiates a new WritableConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableConfigContextRequestWithDefaults() *WritableConfigContextRequest { + this := WritableConfigContextRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableConfigContextRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableConfigContextRequest) SetName(v string) { + o.Name = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *WritableConfigContextRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *WritableConfigContextRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetRegions() []int32 { + if o == nil || IsNil(o.Regions) { + var ret []int32 + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetRegionsOk() ([]int32, bool) { + if o == nil || IsNil(o.Regions) { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasRegions() bool { + if o != nil && !IsNil(o.Regions) { + return true + } + + return false +} + +// SetRegions gets a reference to the given []int32 and assigns it to the Regions field. +func (o *WritableConfigContextRequest) SetRegions(v []int32) { + o.Regions = v +} + +// GetSiteGroups returns the SiteGroups field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetSiteGroups() []int32 { + if o == nil || IsNil(o.SiteGroups) { + var ret []int32 + return ret + } + return o.SiteGroups +} + +// GetSiteGroupsOk returns a tuple with the SiteGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetSiteGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.SiteGroups) { + return nil, false + } + return o.SiteGroups, true +} + +// HasSiteGroups returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasSiteGroups() bool { + if o != nil && !IsNil(o.SiteGroups) { + return true + } + + return false +} + +// SetSiteGroups gets a reference to the given []int32 and assigns it to the SiteGroups field. +func (o *WritableConfigContextRequest) SetSiteGroups(v []int32) { + o.SiteGroups = v +} + +// GetSites returns the Sites field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetSites() []int32 { + if o == nil || IsNil(o.Sites) { + var ret []int32 + return ret + } + return o.Sites +} + +// GetSitesOk returns a tuple with the Sites field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetSitesOk() ([]int32, bool) { + if o == nil || IsNil(o.Sites) { + return nil, false + } + return o.Sites, true +} + +// HasSites returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasSites() bool { + if o != nil && !IsNil(o.Sites) { + return true + } + + return false +} + +// SetSites gets a reference to the given []int32 and assigns it to the Sites field. +func (o *WritableConfigContextRequest) SetSites(v []int32) { + o.Sites = v +} + +// GetLocations returns the Locations field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetLocations() []int32 { + if o == nil || IsNil(o.Locations) { + var ret []int32 + return ret + } + return o.Locations +} + +// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetLocationsOk() ([]int32, bool) { + if o == nil || IsNil(o.Locations) { + return nil, false + } + return o.Locations, true +} + +// HasLocations returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasLocations() bool { + if o != nil && !IsNil(o.Locations) { + return true + } + + return false +} + +// SetLocations gets a reference to the given []int32 and assigns it to the Locations field. +func (o *WritableConfigContextRequest) SetLocations(v []int32) { + o.Locations = v +} + +// GetDeviceTypes returns the DeviceTypes field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetDeviceTypes() []int32 { + if o == nil || IsNil(o.DeviceTypes) { + var ret []int32 + return ret + } + return o.DeviceTypes +} + +// GetDeviceTypesOk returns a tuple with the DeviceTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetDeviceTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.DeviceTypes) { + return nil, false + } + return o.DeviceTypes, true +} + +// HasDeviceTypes returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasDeviceTypes() bool { + if o != nil && !IsNil(o.DeviceTypes) { + return true + } + + return false +} + +// SetDeviceTypes gets a reference to the given []int32 and assigns it to the DeviceTypes field. +func (o *WritableConfigContextRequest) SetDeviceTypes(v []int32) { + o.DeviceTypes = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetRoles() []int32 { + if o == nil || IsNil(o.Roles) { + var ret []int32 + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetRolesOk() ([]int32, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []int32 and assigns it to the Roles field. +func (o *WritableConfigContextRequest) SetRoles(v []int32) { + o.Roles = v +} + +// GetPlatforms returns the Platforms field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetPlatforms() []int32 { + if o == nil || IsNil(o.Platforms) { + var ret []int32 + return ret + } + return o.Platforms +} + +// GetPlatformsOk returns a tuple with the Platforms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetPlatformsOk() ([]int32, bool) { + if o == nil || IsNil(o.Platforms) { + return nil, false + } + return o.Platforms, true +} + +// HasPlatforms returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasPlatforms() bool { + if o != nil && !IsNil(o.Platforms) { + return true + } + + return false +} + +// SetPlatforms gets a reference to the given []int32 and assigns it to the Platforms field. +func (o *WritableConfigContextRequest) SetPlatforms(v []int32) { + o.Platforms = v +} + +// GetClusterTypes returns the ClusterTypes field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetClusterTypes() []int32 { + if o == nil || IsNil(o.ClusterTypes) { + var ret []int32 + return ret + } + return o.ClusterTypes +} + +// GetClusterTypesOk returns a tuple with the ClusterTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetClusterTypesOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterTypes) { + return nil, false + } + return o.ClusterTypes, true +} + +// HasClusterTypes returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasClusterTypes() bool { + if o != nil && !IsNil(o.ClusterTypes) { + return true + } + + return false +} + +// SetClusterTypes gets a reference to the given []int32 and assigns it to the ClusterTypes field. +func (o *WritableConfigContextRequest) SetClusterTypes(v []int32) { + o.ClusterTypes = v +} + +// GetClusterGroups returns the ClusterGroups field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetClusterGroups() []int32 { + if o == nil || IsNil(o.ClusterGroups) { + var ret []int32 + return ret + } + return o.ClusterGroups +} + +// GetClusterGroupsOk returns a tuple with the ClusterGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetClusterGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.ClusterGroups) { + return nil, false + } + return o.ClusterGroups, true +} + +// HasClusterGroups returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasClusterGroups() bool { + if o != nil && !IsNil(o.ClusterGroups) { + return true + } + + return false +} + +// SetClusterGroups gets a reference to the given []int32 and assigns it to the ClusterGroups field. +func (o *WritableConfigContextRequest) SetClusterGroups(v []int32) { + o.ClusterGroups = v +} + +// GetClusters returns the Clusters field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetClusters() []int32 { + if o == nil || IsNil(o.Clusters) { + var ret []int32 + return ret + } + return o.Clusters +} + +// GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetClustersOk() ([]int32, bool) { + if o == nil || IsNil(o.Clusters) { + return nil, false + } + return o.Clusters, true +} + +// HasClusters returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasClusters() bool { + if o != nil && !IsNil(o.Clusters) { + return true + } + + return false +} + +// SetClusters gets a reference to the given []int32 and assigns it to the Clusters field. +func (o *WritableConfigContextRequest) SetClusters(v []int32) { + o.Clusters = v +} + +// GetTenantGroups returns the TenantGroups field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetTenantGroups() []int32 { + if o == nil || IsNil(o.TenantGroups) { + var ret []int32 + return ret + } + return o.TenantGroups +} + +// GetTenantGroupsOk returns a tuple with the TenantGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetTenantGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.TenantGroups) { + return nil, false + } + return o.TenantGroups, true +} + +// HasTenantGroups returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasTenantGroups() bool { + if o != nil && !IsNil(o.TenantGroups) { + return true + } + + return false +} + +// SetTenantGroups gets a reference to the given []int32 and assigns it to the TenantGroups field. +func (o *WritableConfigContextRequest) SetTenantGroups(v []int32) { + o.TenantGroups = v +} + +// GetTenants returns the Tenants field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetTenants() []int32 { + if o == nil || IsNil(o.Tenants) { + var ret []int32 + return ret + } + return o.Tenants +} + +// GetTenantsOk returns a tuple with the Tenants field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetTenantsOk() ([]int32, bool) { + if o == nil || IsNil(o.Tenants) { + return nil, false + } + return o.Tenants, true +} + +// HasTenants returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasTenants() bool { + if o != nil && !IsNil(o.Tenants) { + return true + } + + return false +} + +// SetTenants gets a reference to the given []int32 and assigns it to the Tenants field. +func (o *WritableConfigContextRequest) SetTenants(v []int32) { + o.Tenants = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableConfigContextRequest) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigContextRequest) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *WritableConfigContextRequest) SetTags(v []string) { + o.Tags = v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConfigContextRequest) GetDataSource() int32 { + if o == nil || IsNil(o.DataSource.Get()) { + var ret int32 + return ret + } + return *o.DataSource.Get() +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConfigContextRequest) GetDataSourceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataSource.Get(), o.DataSource.IsSet() +} + +// HasDataSource returns a boolean if a field has been set. +func (o *WritableConfigContextRequest) HasDataSource() bool { + if o != nil && o.DataSource.IsSet() { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NullableInt32 and assigns it to the DataSource field. +func (o *WritableConfigContextRequest) SetDataSource(v int32) { + o.DataSource.Set(&v) +} + +// SetDataSourceNil sets the value for DataSource to be an explicit nil +func (o *WritableConfigContextRequest) SetDataSourceNil() { + o.DataSource.Set(nil) +} + +// UnsetDataSource ensures that no value is present for DataSource, not even an explicit nil +func (o *WritableConfigContextRequest) UnsetDataSource() { + o.DataSource.Unset() +} + +// GetData returns the Data field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *WritableConfigContextRequest) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConfigContextRequest) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *WritableConfigContextRequest) SetData(v interface{}) { + o.Data = v +} + +func (o WritableConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.Regions) { + toSerialize["regions"] = o.Regions + } + if !IsNil(o.SiteGroups) { + toSerialize["site_groups"] = o.SiteGroups + } + if !IsNil(o.Sites) { + toSerialize["sites"] = o.Sites + } + if !IsNil(o.Locations) { + toSerialize["locations"] = o.Locations + } + if !IsNil(o.DeviceTypes) { + toSerialize["device_types"] = o.DeviceTypes + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Platforms) { + toSerialize["platforms"] = o.Platforms + } + if !IsNil(o.ClusterTypes) { + toSerialize["cluster_types"] = o.ClusterTypes + } + if !IsNil(o.ClusterGroups) { + toSerialize["cluster_groups"] = o.ClusterGroups + } + if !IsNil(o.Clusters) { + toSerialize["clusters"] = o.Clusters + } + if !IsNil(o.TenantGroups) { + toSerialize["tenant_groups"] = o.TenantGroups + } + if !IsNil(o.Tenants) { + toSerialize["tenants"] = o.Tenants + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if o.DataSource.IsSet() { + toSerialize["data_source"] = o.DataSource.Get() + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableConfigContextRequest := _WritableConfigContextRequest{} + + err = json.Unmarshal(data, &varWritableConfigContextRequest) + + if err != nil { + return err + } + + *o = WritableConfigContextRequest(varWritableConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "weight") + delete(additionalProperties, "description") + delete(additionalProperties, "is_active") + delete(additionalProperties, "regions") + delete(additionalProperties, "site_groups") + delete(additionalProperties, "sites") + delete(additionalProperties, "locations") + delete(additionalProperties, "device_types") + delete(additionalProperties, "roles") + delete(additionalProperties, "platforms") + delete(additionalProperties, "cluster_types") + delete(additionalProperties, "cluster_groups") + delete(additionalProperties, "clusters") + delete(additionalProperties, "tenant_groups") + delete(additionalProperties, "tenants") + delete(additionalProperties, "tags") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableConfigContextRequest struct { + value *WritableConfigContextRequest + isSet bool +} + +func (v NullableWritableConfigContextRequest) Get() *WritableConfigContextRequest { + return v.value +} + +func (v *NullableWritableConfigContextRequest) Set(val *WritableConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableConfigContextRequest(val *WritableConfigContextRequest) *NullableWritableConfigContextRequest { + return &NullableWritableConfigContextRequest{value: val, isSet: true} +} + +func (v NullableWritableConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_config_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_config_template_request.go new file mode 100644 index 00000000..24b33db4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_config_template_request.go @@ -0,0 +1,406 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableConfigTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableConfigTemplateRequest{} + +// WritableConfigTemplateRequest Introduces support for Tag assignment. Adds `tags` serialization, and handles tag assignment on create() and update(). +type WritableConfigTemplateRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // Any additional parameters to pass when constructing the Jinja2 environment. + EnvironmentParams interface{} `json:"environment_params,omitempty"` + // Jinja2 template code. + TemplateCode string `json:"template_code"` + // Remote data source + DataSource NullableInt32 `json:"data_source,omitempty"` + DataFile NullableInt32 `json:"data_file,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableConfigTemplateRequest WritableConfigTemplateRequest + +// NewWritableConfigTemplateRequest instantiates a new WritableConfigTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableConfigTemplateRequest(name string, templateCode string) *WritableConfigTemplateRequest { + this := WritableConfigTemplateRequest{} + this.Name = name + this.TemplateCode = templateCode + return &this +} + +// NewWritableConfigTemplateRequestWithDefaults instantiates a new WritableConfigTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableConfigTemplateRequestWithDefaults() *WritableConfigTemplateRequest { + this := WritableConfigTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableConfigTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableConfigTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableConfigTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableConfigTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableConfigTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableConfigTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEnvironmentParams returns the EnvironmentParams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConfigTemplateRequest) GetEnvironmentParams() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.EnvironmentParams +} + +// GetEnvironmentParamsOk returns a tuple with the EnvironmentParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConfigTemplateRequest) GetEnvironmentParamsOk() (*interface{}, bool) { + if o == nil || IsNil(o.EnvironmentParams) { + return nil, false + } + return &o.EnvironmentParams, true +} + +// HasEnvironmentParams returns a boolean if a field has been set. +func (o *WritableConfigTemplateRequest) HasEnvironmentParams() bool { + if o != nil && IsNil(o.EnvironmentParams) { + return true + } + + return false +} + +// SetEnvironmentParams gets a reference to the given interface{} and assigns it to the EnvironmentParams field. +func (o *WritableConfigTemplateRequest) SetEnvironmentParams(v interface{}) { + o.EnvironmentParams = v +} + +// GetTemplateCode returns the TemplateCode field value +func (o *WritableConfigTemplateRequest) GetTemplateCode() string { + if o == nil { + var ret string + return ret + } + + return o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value +// and a boolean to check if the value has been set. +func (o *WritableConfigTemplateRequest) GetTemplateCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TemplateCode, true +} + +// SetTemplateCode sets field value +func (o *WritableConfigTemplateRequest) SetTemplateCode(v string) { + o.TemplateCode = v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConfigTemplateRequest) GetDataSource() int32 { + if o == nil || IsNil(o.DataSource.Get()) { + var ret int32 + return ret + } + return *o.DataSource.Get() +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConfigTemplateRequest) GetDataSourceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataSource.Get(), o.DataSource.IsSet() +} + +// HasDataSource returns a boolean if a field has been set. +func (o *WritableConfigTemplateRequest) HasDataSource() bool { + if o != nil && o.DataSource.IsSet() { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NullableInt32 and assigns it to the DataSource field. +func (o *WritableConfigTemplateRequest) SetDataSource(v int32) { + o.DataSource.Set(&v) +} + +// SetDataSourceNil sets the value for DataSource to be an explicit nil +func (o *WritableConfigTemplateRequest) SetDataSourceNil() { + o.DataSource.Set(nil) +} + +// UnsetDataSource ensures that no value is present for DataSource, not even an explicit nil +func (o *WritableConfigTemplateRequest) UnsetDataSource() { + o.DataSource.Unset() +} + +// GetDataFile returns the DataFile field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConfigTemplateRequest) GetDataFile() int32 { + if o == nil || IsNil(o.DataFile.Get()) { + var ret int32 + return ret + } + return *o.DataFile.Get() +} + +// GetDataFileOk returns a tuple with the DataFile field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConfigTemplateRequest) GetDataFileOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataFile.Get(), o.DataFile.IsSet() +} + +// HasDataFile returns a boolean if a field has been set. +func (o *WritableConfigTemplateRequest) HasDataFile() bool { + if o != nil && o.DataFile.IsSet() { + return true + } + + return false +} + +// SetDataFile gets a reference to the given NullableInt32 and assigns it to the DataFile field. +func (o *WritableConfigTemplateRequest) SetDataFile(v int32) { + o.DataFile.Set(&v) +} + +// SetDataFileNil sets the value for DataFile to be an explicit nil +func (o *WritableConfigTemplateRequest) SetDataFileNil() { + o.DataFile.Set(nil) +} + +// UnsetDataFile ensures that no value is present for DataFile, not even an explicit nil +func (o *WritableConfigTemplateRequest) UnsetDataFile() { + o.DataFile.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableConfigTemplateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConfigTemplateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableConfigTemplateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableConfigTemplateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o WritableConfigTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableConfigTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.EnvironmentParams != nil { + toSerialize["environment_params"] = o.EnvironmentParams + } + toSerialize["template_code"] = o.TemplateCode + if o.DataSource.IsSet() { + toSerialize["data_source"] = o.DataSource.Get() + } + if o.DataFile.IsSet() { + toSerialize["data_file"] = o.DataFile.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableConfigTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "template_code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableConfigTemplateRequest := _WritableConfigTemplateRequest{} + + err = json.Unmarshal(data, &varWritableConfigTemplateRequest) + + if err != nil { + return err + } + + *o = WritableConfigTemplateRequest(varWritableConfigTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "environment_params") + delete(additionalProperties, "template_code") + delete(additionalProperties, "data_source") + delete(additionalProperties, "data_file") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableConfigTemplateRequest struct { + value *WritableConfigTemplateRequest + isSet bool +} + +func (v NullableWritableConfigTemplateRequest) Get() *WritableConfigTemplateRequest { + return v.value +} + +func (v *NullableWritableConfigTemplateRequest) Set(val *WritableConfigTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableConfigTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableConfigTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableConfigTemplateRequest(val *WritableConfigTemplateRequest) *NullableWritableConfigTemplateRequest { + return &NullableWritableConfigTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableConfigTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableConfigTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_port_request.go new file mode 100644 index 00000000..d2c94320 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_port_request.go @@ -0,0 +1,515 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableConsolePortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableConsolePortRequest{} + +// WritableConsolePortRequest Adds support for custom fields and tags. +type WritableConsolePortRequest struct { + Device int32 `json:"device"` + Module NullableInt32 `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritableConsolePortRequestType `json:"type,omitempty"` + Speed NullablePatchedWritableConsolePortRequestSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableConsolePortRequest WritableConsolePortRequest + +// NewWritableConsolePortRequest instantiates a new WritableConsolePortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableConsolePortRequest(device int32, name string) *WritableConsolePortRequest { + this := WritableConsolePortRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewWritableConsolePortRequestWithDefaults instantiates a new WritableConsolePortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableConsolePortRequestWithDefaults() *WritableConsolePortRequest { + this := WritableConsolePortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableConsolePortRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableConsolePortRequest) SetDevice(v int32) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsolePortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsolePortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *WritableConsolePortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *WritableConsolePortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *WritableConsolePortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *WritableConsolePortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableConsolePortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableConsolePortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableConsolePortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritableConsolePortRequest) GetType() PatchedWritableConsolePortRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableConsolePortRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetTypeOk() (*PatchedWritableConsolePortRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableConsolePortRequestType and assigns it to the Type field. +func (o *WritableConsolePortRequest) SetType(v PatchedWritableConsolePortRequestType) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsolePortRequest) GetSpeed() PatchedWritableConsolePortRequestSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret PatchedWritableConsolePortRequestSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsolePortRequest) GetSpeedOk() (*PatchedWritableConsolePortRequestSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullablePatchedWritableConsolePortRequestSpeed and assigns it to the Speed field. +func (o *WritableConsolePortRequest) SetSpeed(v PatchedWritableConsolePortRequestSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *WritableConsolePortRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *WritableConsolePortRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableConsolePortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableConsolePortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritableConsolePortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritableConsolePortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableConsolePortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableConsolePortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableConsolePortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableConsolePortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableConsolePortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableConsolePortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableConsolePortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableConsolePortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableConsolePortRequest := _WritableConsolePortRequest{} + + err = json.Unmarshal(data, &varWritableConsolePortRequest) + + if err != nil { + return err + } + + *o = WritableConsolePortRequest(varWritableConsolePortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableConsolePortRequest struct { + value *WritableConsolePortRequest + isSet bool +} + +func (v NullableWritableConsolePortRequest) Get() *WritableConsolePortRequest { + return v.value +} + +func (v *NullableWritableConsolePortRequest) Set(val *WritableConsolePortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableConsolePortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableConsolePortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableConsolePortRequest(val *WritableConsolePortRequest) *NullableWritableConsolePortRequest { + return &NullableWritableConsolePortRequest{value: val, isSet: true} +} + +func (v NullableWritableConsolePortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableConsolePortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_port_template_request.go new file mode 100644 index 00000000..c1e56dc0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_port_template_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableConsolePortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableConsolePortTemplateRequest{} + +// WritableConsolePortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableConsolePortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableConsolePortTemplateRequest WritableConsolePortTemplateRequest + +// NewWritableConsolePortTemplateRequest instantiates a new WritableConsolePortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableConsolePortTemplateRequest(name string) *WritableConsolePortTemplateRequest { + this := WritableConsolePortTemplateRequest{} + this.Name = name + return &this +} + +// NewWritableConsolePortTemplateRequestWithDefaults instantiates a new WritableConsolePortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableConsolePortTemplateRequestWithDefaults() *WritableConsolePortTemplateRequest { + this := WritableConsolePortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsolePortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsolePortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *WritableConsolePortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *WritableConsolePortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *WritableConsolePortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *WritableConsolePortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsolePortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsolePortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *WritableConsolePortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *WritableConsolePortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *WritableConsolePortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *WritableConsolePortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *WritableConsolePortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableConsolePortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableConsolePortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableConsolePortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableConsolePortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableConsolePortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritableConsolePortTemplateRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortTemplateRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritableConsolePortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *WritableConsolePortTemplateRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableConsolePortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsolePortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableConsolePortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableConsolePortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritableConsolePortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableConsolePortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableConsolePortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableConsolePortTemplateRequest := _WritableConsolePortTemplateRequest{} + + err = json.Unmarshal(data, &varWritableConsolePortTemplateRequest) + + if err != nil { + return err + } + + *o = WritableConsolePortTemplateRequest(varWritableConsolePortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableConsolePortTemplateRequest struct { + value *WritableConsolePortTemplateRequest + isSet bool +} + +func (v NullableWritableConsolePortTemplateRequest) Get() *WritableConsolePortTemplateRequest { + return v.value +} + +func (v *NullableWritableConsolePortTemplateRequest) Set(val *WritableConsolePortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableConsolePortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableConsolePortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableConsolePortTemplateRequest(val *WritableConsolePortTemplateRequest) *NullableWritableConsolePortTemplateRequest { + return &NullableWritableConsolePortTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableConsolePortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableConsolePortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_server_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_server_port_request.go new file mode 100644 index 00000000..b2e73d3a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_server_port_request.go @@ -0,0 +1,515 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableConsoleServerPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableConsoleServerPortRequest{} + +// WritableConsoleServerPortRequest Adds support for custom fields and tags. +type WritableConsoleServerPortRequest struct { + Device int32 `json:"device"` + Module NullableInt32 `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritableConsolePortRequestType `json:"type,omitempty"` + Speed NullablePatchedWritableConsolePortRequestSpeed `json:"speed,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableConsoleServerPortRequest WritableConsoleServerPortRequest + +// NewWritableConsoleServerPortRequest instantiates a new WritableConsoleServerPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableConsoleServerPortRequest(device int32, name string) *WritableConsoleServerPortRequest { + this := WritableConsoleServerPortRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewWritableConsoleServerPortRequestWithDefaults instantiates a new WritableConsoleServerPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableConsoleServerPortRequestWithDefaults() *WritableConsoleServerPortRequest { + this := WritableConsoleServerPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableConsoleServerPortRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableConsoleServerPortRequest) SetDevice(v int32) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsoleServerPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsoleServerPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *WritableConsoleServerPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *WritableConsoleServerPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *WritableConsoleServerPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *WritableConsoleServerPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableConsoleServerPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableConsoleServerPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableConsoleServerPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritableConsoleServerPortRequest) GetType() PatchedWritableConsolePortRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableConsolePortRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetTypeOk() (*PatchedWritableConsolePortRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableConsolePortRequestType and assigns it to the Type field. +func (o *WritableConsoleServerPortRequest) SetType(v PatchedWritableConsolePortRequestType) { + o.Type = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsoleServerPortRequest) GetSpeed() PatchedWritableConsolePortRequestSpeed { + if o == nil || IsNil(o.Speed.Get()) { + var ret PatchedWritableConsolePortRequestSpeed + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsoleServerPortRequest) GetSpeedOk() (*PatchedWritableConsolePortRequestSpeed, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullablePatchedWritableConsolePortRequestSpeed and assigns it to the Speed field. +func (o *WritableConsoleServerPortRequest) SetSpeed(v PatchedWritableConsolePortRequestSpeed) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *WritableConsoleServerPortRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *WritableConsoleServerPortRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableConsoleServerPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableConsoleServerPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritableConsoleServerPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritableConsoleServerPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableConsoleServerPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableConsoleServerPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableConsoleServerPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableConsoleServerPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableConsoleServerPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableConsoleServerPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableConsoleServerPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableConsoleServerPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableConsoleServerPortRequest := _WritableConsoleServerPortRequest{} + + err = json.Unmarshal(data, &varWritableConsoleServerPortRequest) + + if err != nil { + return err + } + + *o = WritableConsoleServerPortRequest(varWritableConsoleServerPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "speed") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableConsoleServerPortRequest struct { + value *WritableConsoleServerPortRequest + isSet bool +} + +func (v NullableWritableConsoleServerPortRequest) Get() *WritableConsoleServerPortRequest { + return v.value +} + +func (v *NullableWritableConsoleServerPortRequest) Set(val *WritableConsoleServerPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableConsoleServerPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableConsoleServerPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableConsoleServerPortRequest(val *WritableConsoleServerPortRequest) *NullableWritableConsoleServerPortRequest { + return &NullableWritableConsoleServerPortRequest{value: val, isSet: true} +} + +func (v NullableWritableConsoleServerPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableConsoleServerPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_server_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_server_port_template_request.go new file mode 100644 index 00000000..226ffb21 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_console_server_port_template_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableConsoleServerPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableConsoleServerPortTemplateRequest{} + +// WritableConsoleServerPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableConsoleServerPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *ConsolePortTypeValue `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableConsoleServerPortTemplateRequest WritableConsoleServerPortTemplateRequest + +// NewWritableConsoleServerPortTemplateRequest instantiates a new WritableConsoleServerPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableConsoleServerPortTemplateRequest(name string) *WritableConsoleServerPortTemplateRequest { + this := WritableConsoleServerPortTemplateRequest{} + this.Name = name + return &this +} + +// NewWritableConsoleServerPortTemplateRequestWithDefaults instantiates a new WritableConsoleServerPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableConsoleServerPortTemplateRequestWithDefaults() *WritableConsoleServerPortTemplateRequest { + this := WritableConsoleServerPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsoleServerPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsoleServerPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *WritableConsoleServerPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *WritableConsoleServerPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *WritableConsoleServerPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *WritableConsoleServerPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableConsoleServerPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableConsoleServerPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *WritableConsoleServerPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *WritableConsoleServerPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *WritableConsoleServerPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *WritableConsoleServerPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *WritableConsoleServerPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableConsoleServerPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableConsoleServerPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableConsoleServerPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableConsoleServerPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritableConsoleServerPortTemplateRequest) GetType() ConsolePortTypeValue { + if o == nil || IsNil(o.Type) { + var ret ConsolePortTypeValue + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortTemplateRequest) GetTypeOk() (*ConsolePortTypeValue, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritableConsoleServerPortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ConsolePortTypeValue and assigns it to the Type field. +func (o *WritableConsoleServerPortTemplateRequest) SetType(v ConsolePortTypeValue) { + o.Type = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableConsoleServerPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableConsoleServerPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableConsoleServerPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableConsoleServerPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritableConsoleServerPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableConsoleServerPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableConsoleServerPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableConsoleServerPortTemplateRequest := _WritableConsoleServerPortTemplateRequest{} + + err = json.Unmarshal(data, &varWritableConsoleServerPortTemplateRequest) + + if err != nil { + return err + } + + *o = WritableConsoleServerPortTemplateRequest(varWritableConsoleServerPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableConsoleServerPortTemplateRequest struct { + value *WritableConsoleServerPortTemplateRequest + isSet bool +} + +func (v NullableWritableConsoleServerPortTemplateRequest) Get() *WritableConsoleServerPortTemplateRequest { + return v.value +} + +func (v *NullableWritableConsoleServerPortTemplateRequest) Set(val *WritableConsoleServerPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableConsoleServerPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableConsoleServerPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableConsoleServerPortTemplateRequest(val *WritableConsoleServerPortTemplateRequest) *NullableWritableConsoleServerPortTemplateRequest { + return &NullableWritableConsoleServerPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableConsoleServerPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableConsoleServerPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_assignment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_assignment_request.go new file mode 100644 index 00000000..859b4bd7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_assignment_request.go @@ -0,0 +1,364 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableContactAssignmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableContactAssignmentRequest{} + +// WritableContactAssignmentRequest Adds support for custom fields and tags. +type WritableContactAssignmentRequest struct { + ContentType string `json:"content_type"` + ObjectId int64 `json:"object_id"` + Contact int32 `json:"contact"` + Role int32 `json:"role"` + Priority *ContactAssignmentPriorityValue `json:"priority,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableContactAssignmentRequest WritableContactAssignmentRequest + +// NewWritableContactAssignmentRequest instantiates a new WritableContactAssignmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableContactAssignmentRequest(contentType string, objectId int64, contact int32, role int32) *WritableContactAssignmentRequest { + this := WritableContactAssignmentRequest{} + this.ContentType = contentType + this.ObjectId = objectId + this.Contact = contact + this.Role = role + return &this +} + +// NewWritableContactAssignmentRequestWithDefaults instantiates a new WritableContactAssignmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableContactAssignmentRequestWithDefaults() *WritableContactAssignmentRequest { + this := WritableContactAssignmentRequest{} + return &this +} + +// GetContentType returns the ContentType field value +func (o *WritableContactAssignmentRequest) GetContentType() string { + if o == nil { + var ret string + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *WritableContactAssignmentRequest) GetContentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *WritableContactAssignmentRequest) SetContentType(v string) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value +func (o *WritableContactAssignmentRequest) GetObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *WritableContactAssignmentRequest) GetObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *WritableContactAssignmentRequest) SetObjectId(v int64) { + o.ObjectId = v +} + +// GetContact returns the Contact field value +func (o *WritableContactAssignmentRequest) GetContact() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Contact +} + +// GetContactOk returns a tuple with the Contact field value +// and a boolean to check if the value has been set. +func (o *WritableContactAssignmentRequest) GetContactOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Contact, true +} + +// SetContact sets field value +func (o *WritableContactAssignmentRequest) SetContact(v int32) { + o.Contact = v +} + +// GetRole returns the Role field value +func (o *WritableContactAssignmentRequest) GetRole() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *WritableContactAssignmentRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *WritableContactAssignmentRequest) SetRole(v int32) { + o.Role = v +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *WritableContactAssignmentRequest) GetPriority() ContactAssignmentPriorityValue { + if o == nil || IsNil(o.Priority) { + var ret ContactAssignmentPriorityValue + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactAssignmentRequest) GetPriorityOk() (*ContactAssignmentPriorityValue, bool) { + if o == nil || IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *WritableContactAssignmentRequest) HasPriority() bool { + if o != nil && !IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given ContactAssignmentPriorityValue and assigns it to the Priority field. +func (o *WritableContactAssignmentRequest) SetPriority(v ContactAssignmentPriorityValue) { + o.Priority = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableContactAssignmentRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactAssignmentRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableContactAssignmentRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableContactAssignmentRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableContactAssignmentRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactAssignmentRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableContactAssignmentRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableContactAssignmentRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableContactAssignmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableContactAssignmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_type"] = o.ContentType + toSerialize["object_id"] = o.ObjectId + toSerialize["contact"] = o.Contact + toSerialize["role"] = o.Role + if !IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableContactAssignmentRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_type", + "object_id", + "contact", + "role", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableContactAssignmentRequest := _WritableContactAssignmentRequest{} + + err = json.Unmarshal(data, &varWritableContactAssignmentRequest) + + if err != nil { + return err + } + + *o = WritableContactAssignmentRequest(varWritableContactAssignmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "contact") + delete(additionalProperties, "role") + delete(additionalProperties, "priority") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableContactAssignmentRequest struct { + value *WritableContactAssignmentRequest + isSet bool +} + +func (v NullableWritableContactAssignmentRequest) Get() *WritableContactAssignmentRequest { + return v.value +} + +func (v *NullableWritableContactAssignmentRequest) Set(val *WritableContactAssignmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableContactAssignmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableContactAssignmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableContactAssignmentRequest(val *WritableContactAssignmentRequest) *NullableWritableContactAssignmentRequest { + return &NullableWritableContactAssignmentRequest{value: val, isSet: true} +} + +func (v NullableWritableContactAssignmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableContactAssignmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_group_request.go new file mode 100644 index 00000000..c29fb705 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableContactGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableContactGroupRequest{} + +// WritableContactGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type WritableContactGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableContactGroupRequest WritableContactGroupRequest + +// NewWritableContactGroupRequest instantiates a new WritableContactGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableContactGroupRequest(name string, slug string) *WritableContactGroupRequest { + this := WritableContactGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableContactGroupRequestWithDefaults instantiates a new WritableContactGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableContactGroupRequestWithDefaults() *WritableContactGroupRequest { + this := WritableContactGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableContactGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableContactGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableContactGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableContactGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableContactGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableContactGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableContactGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableContactGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableContactGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableContactGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableContactGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableContactGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableContactGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableContactGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableContactGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableContactGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableContactGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableContactGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableContactGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableContactGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableContactGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableContactGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableContactGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableContactGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableContactGroupRequest := _WritableContactGroupRequest{} + + err = json.Unmarshal(data, &varWritableContactGroupRequest) + + if err != nil { + return err + } + + *o = WritableContactGroupRequest(varWritableContactGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableContactGroupRequest struct { + value *WritableContactGroupRequest + isSet bool +} + +func (v NullableWritableContactGroupRequest) Get() *WritableContactGroupRequest { + return v.value +} + +func (v *NullableWritableContactGroupRequest) Set(val *WritableContactGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableContactGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableContactGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableContactGroupRequest(val *WritableContactGroupRequest) *NullableWritableContactGroupRequest { + return &NullableWritableContactGroupRequest{value: val, isSet: true} +} + +func (v NullableWritableContactGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableContactGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_request.go new file mode 100644 index 00000000..17f1606e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_contact_request.go @@ -0,0 +1,547 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableContactRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableContactRequest{} + +// WritableContactRequest Adds support for custom fields and tags. +type WritableContactRequest struct { + Group NullableInt32 `json:"group,omitempty"` + Name string `json:"name"` + Title *string `json:"title,omitempty"` + Phone *string `json:"phone,omitempty"` + Email *string `json:"email,omitempty"` + Address *string `json:"address,omitempty"` + Link *string `json:"link,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableContactRequest WritableContactRequest + +// NewWritableContactRequest instantiates a new WritableContactRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableContactRequest(name string) *WritableContactRequest { + this := WritableContactRequest{} + this.Name = name + return &this +} + +// NewWritableContactRequestWithDefaults instantiates a new WritableContactRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableContactRequestWithDefaults() *WritableContactRequest { + this := WritableContactRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableContactRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableContactRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WritableContactRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *WritableContactRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WritableContactRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WritableContactRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetName returns the Name field value +func (o *WritableContactRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableContactRequest) SetName(v string) { + o.Name = v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *WritableContactRequest) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *WritableContactRequest) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *WritableContactRequest) SetTitle(v string) { + o.Title = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *WritableContactRequest) GetPhone() string { + if o == nil || IsNil(o.Phone) { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetPhoneOk() (*string, bool) { + if o == nil || IsNil(o.Phone) { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *WritableContactRequest) HasPhone() bool { + if o != nil && !IsNil(o.Phone) { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *WritableContactRequest) SetPhone(v string) { + o.Phone = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *WritableContactRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *WritableContactRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *WritableContactRequest) SetEmail(v string) { + o.Email = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *WritableContactRequest) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *WritableContactRequest) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *WritableContactRequest) SetAddress(v string) { + o.Address = &v +} + +// GetLink returns the Link field value if set, zero value otherwise. +func (o *WritableContactRequest) GetLink() string { + if o == nil || IsNil(o.Link) { + var ret string + return ret + } + return *o.Link +} + +// GetLinkOk returns a tuple with the Link field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetLinkOk() (*string, bool) { + if o == nil || IsNil(o.Link) { + return nil, false + } + return o.Link, true +} + +// HasLink returns a boolean if a field has been set. +func (o *WritableContactRequest) HasLink() bool { + if o != nil && !IsNil(o.Link) { + return true + } + + return false +} + +// SetLink gets a reference to the given string and assigns it to the Link field. +func (o *WritableContactRequest) SetLink(v string) { + o.Link = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableContactRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableContactRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableContactRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableContactRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableContactRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableContactRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableContactRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableContactRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableContactRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableContactRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableContactRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableContactRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableContactRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableContactRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableContactRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.Phone) { + toSerialize["phone"] = o.Phone + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Link) { + toSerialize["link"] = o.Link + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableContactRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableContactRequest := _WritableContactRequest{} + + err = json.Unmarshal(data, &varWritableContactRequest) + + if err != nil { + return err + } + + *o = WritableContactRequest(varWritableContactRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "name") + delete(additionalProperties, "title") + delete(additionalProperties, "phone") + delete(additionalProperties, "email") + delete(additionalProperties, "address") + delete(additionalProperties, "link") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableContactRequest struct { + value *WritableContactRequest + isSet bool +} + +func (v NullableWritableContactRequest) Get() *WritableContactRequest { + return v.value +} + +func (v *NullableWritableContactRequest) Set(val *WritableContactRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableContactRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableContactRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableContactRequest(val *WritableContactRequest) *NullableWritableContactRequest { + return &NullableWritableContactRequest{value: val, isSet: true} +} + +func (v NullableWritableContactRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableContactRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_custom_field_choice_set_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_custom_field_choice_set_request.go new file mode 100644 index 00000000..5275053c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_custom_field_choice_set_request.go @@ -0,0 +1,316 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableCustomFieldChoiceSetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableCustomFieldChoiceSetRequest{} + +// WritableCustomFieldChoiceSetRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableCustomFieldChoiceSetRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + BaseChoices *PatchedWritableCustomFieldChoiceSetRequestBaseChoices `json:"base_choices,omitempty"` + ExtraChoices [][]string `json:"extra_choices,omitempty"` + // Choices are automatically ordered alphabetically + OrderAlphabetically *bool `json:"order_alphabetically,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableCustomFieldChoiceSetRequest WritableCustomFieldChoiceSetRequest + +// NewWritableCustomFieldChoiceSetRequest instantiates a new WritableCustomFieldChoiceSetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableCustomFieldChoiceSetRequest(name string) *WritableCustomFieldChoiceSetRequest { + this := WritableCustomFieldChoiceSetRequest{} + this.Name = name + return &this +} + +// NewWritableCustomFieldChoiceSetRequestWithDefaults instantiates a new WritableCustomFieldChoiceSetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableCustomFieldChoiceSetRequestWithDefaults() *WritableCustomFieldChoiceSetRequest { + this := WritableCustomFieldChoiceSetRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableCustomFieldChoiceSetRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldChoiceSetRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableCustomFieldChoiceSetRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableCustomFieldChoiceSetRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldChoiceSetRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableCustomFieldChoiceSetRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableCustomFieldChoiceSetRequest) SetDescription(v string) { + o.Description = &v +} + +// GetBaseChoices returns the BaseChoices field value if set, zero value otherwise. +func (o *WritableCustomFieldChoiceSetRequest) GetBaseChoices() PatchedWritableCustomFieldChoiceSetRequestBaseChoices { + if o == nil || IsNil(o.BaseChoices) { + var ret PatchedWritableCustomFieldChoiceSetRequestBaseChoices + return ret + } + return *o.BaseChoices +} + +// GetBaseChoicesOk returns a tuple with the BaseChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldChoiceSetRequest) GetBaseChoicesOk() (*PatchedWritableCustomFieldChoiceSetRequestBaseChoices, bool) { + if o == nil || IsNil(o.BaseChoices) { + return nil, false + } + return o.BaseChoices, true +} + +// HasBaseChoices returns a boolean if a field has been set. +func (o *WritableCustomFieldChoiceSetRequest) HasBaseChoices() bool { + if o != nil && !IsNil(o.BaseChoices) { + return true + } + + return false +} + +// SetBaseChoices gets a reference to the given PatchedWritableCustomFieldChoiceSetRequestBaseChoices and assigns it to the BaseChoices field. +func (o *WritableCustomFieldChoiceSetRequest) SetBaseChoices(v PatchedWritableCustomFieldChoiceSetRequestBaseChoices) { + o.BaseChoices = &v +} + +// GetExtraChoices returns the ExtraChoices field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCustomFieldChoiceSetRequest) GetExtraChoices() [][]string { + if o == nil { + var ret [][]string + return ret + } + return o.ExtraChoices +} + +// GetExtraChoicesOk returns a tuple with the ExtraChoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCustomFieldChoiceSetRequest) GetExtraChoicesOk() ([][]string, bool) { + if o == nil || IsNil(o.ExtraChoices) { + return nil, false + } + return o.ExtraChoices, true +} + +// HasExtraChoices returns a boolean if a field has been set. +func (o *WritableCustomFieldChoiceSetRequest) HasExtraChoices() bool { + if o != nil && IsNil(o.ExtraChoices) { + return true + } + + return false +} + +// SetExtraChoices gets a reference to the given [][]string and assigns it to the ExtraChoices field. +func (o *WritableCustomFieldChoiceSetRequest) SetExtraChoices(v [][]string) { + o.ExtraChoices = v +} + +// GetOrderAlphabetically returns the OrderAlphabetically field value if set, zero value otherwise. +func (o *WritableCustomFieldChoiceSetRequest) GetOrderAlphabetically() bool { + if o == nil || IsNil(o.OrderAlphabetically) { + var ret bool + return ret + } + return *o.OrderAlphabetically +} + +// GetOrderAlphabeticallyOk returns a tuple with the OrderAlphabetically field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldChoiceSetRequest) GetOrderAlphabeticallyOk() (*bool, bool) { + if o == nil || IsNil(o.OrderAlphabetically) { + return nil, false + } + return o.OrderAlphabetically, true +} + +// HasOrderAlphabetically returns a boolean if a field has been set. +func (o *WritableCustomFieldChoiceSetRequest) HasOrderAlphabetically() bool { + if o != nil && !IsNil(o.OrderAlphabetically) { + return true + } + + return false +} + +// SetOrderAlphabetically gets a reference to the given bool and assigns it to the OrderAlphabetically field. +func (o *WritableCustomFieldChoiceSetRequest) SetOrderAlphabetically(v bool) { + o.OrderAlphabetically = &v +} + +func (o WritableCustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableCustomFieldChoiceSetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.BaseChoices) { + toSerialize["base_choices"] = o.BaseChoices + } + if o.ExtraChoices != nil { + toSerialize["extra_choices"] = o.ExtraChoices + } + if !IsNil(o.OrderAlphabetically) { + toSerialize["order_alphabetically"] = o.OrderAlphabetically + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableCustomFieldChoiceSetRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableCustomFieldChoiceSetRequest := _WritableCustomFieldChoiceSetRequest{} + + err = json.Unmarshal(data, &varWritableCustomFieldChoiceSetRequest) + + if err != nil { + return err + } + + *o = WritableCustomFieldChoiceSetRequest(varWritableCustomFieldChoiceSetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "base_choices") + delete(additionalProperties, "extra_choices") + delete(additionalProperties, "order_alphabetically") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableCustomFieldChoiceSetRequest struct { + value *WritableCustomFieldChoiceSetRequest + isSet bool +} + +func (v NullableWritableCustomFieldChoiceSetRequest) Get() *WritableCustomFieldChoiceSetRequest { + return v.value +} + +func (v *NullableWritableCustomFieldChoiceSetRequest) Set(val *WritableCustomFieldChoiceSetRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableCustomFieldChoiceSetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableCustomFieldChoiceSetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableCustomFieldChoiceSetRequest(val *WritableCustomFieldChoiceSetRequest) *NullableWritableCustomFieldChoiceSetRequest { + return &NullableWritableCustomFieldChoiceSetRequest{value: val, isSet: true} +} + +func (v NullableWritableCustomFieldChoiceSetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableCustomFieldChoiceSetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_custom_field_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_custom_field_request.go new file mode 100644 index 00000000..37073800 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_custom_field_request.go @@ -0,0 +1,880 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableCustomFieldRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableCustomFieldRequest{} + +// WritableCustomFieldRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableCustomFieldRequest struct { + ContentTypes []string `json:"content_types"` + Type *PatchedWritableCustomFieldRequestType `json:"type,omitempty"` + ObjectType NullableString `json:"object_type,omitempty"` + // Internal field name + Name string `json:"name"` + // Name of the field as displayed to users (if not provided, 'the field's name will be used) + Label *string `json:"label,omitempty"` + // Custom fields within the same group will be displayed together + GroupName *string `json:"group_name,omitempty"` + Description *string `json:"description,omitempty"` + // If true, this field is required when creating new objects or editing an existing object. + Required *bool `json:"required,omitempty"` + // Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored. + SearchWeight *int32 `json:"search_weight,omitempty"` + FilterLogic *PatchedWritableCustomFieldRequestFilterLogic `json:"filter_logic,omitempty"` + UiVisible *PatchedWritableCustomFieldRequestUiVisible `json:"ui_visible,omitempty"` + UiEditable *PatchedWritableCustomFieldRequestUiEditable `json:"ui_editable,omitempty"` + // Replicate this value when cloning objects + IsCloneable *bool `json:"is_cloneable,omitempty"` + // Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. \"Foo\"). + Default interface{} `json:"default,omitempty"` + // Fields with higher weights appear lower in a form. + Weight *int32 `json:"weight,omitempty"` + // Minimum allowed value (for numeric fields) + ValidationMinimum NullableInt64 `json:"validation_minimum,omitempty"` + // Maximum allowed value (for numeric fields) + ValidationMaximum NullableInt64 `json:"validation_maximum,omitempty"` + // Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, ^[A-Z]{3}$ will limit values to exactly three uppercase letters. + ValidationRegex *string `json:"validation_regex,omitempty"` + ChoiceSet NullableInt32 `json:"choice_set,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableCustomFieldRequest WritableCustomFieldRequest + +// NewWritableCustomFieldRequest instantiates a new WritableCustomFieldRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableCustomFieldRequest(contentTypes []string, name string) *WritableCustomFieldRequest { + this := WritableCustomFieldRequest{} + this.ContentTypes = contentTypes + this.Name = name + return &this +} + +// NewWritableCustomFieldRequestWithDefaults instantiates a new WritableCustomFieldRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableCustomFieldRequestWithDefaults() *WritableCustomFieldRequest { + this := WritableCustomFieldRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *WritableCustomFieldRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *WritableCustomFieldRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetType() PatchedWritableCustomFieldRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableCustomFieldRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetTypeOk() (*PatchedWritableCustomFieldRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableCustomFieldRequestType and assigns it to the Type field. +func (o *WritableCustomFieldRequest) SetType(v PatchedWritableCustomFieldRequestType) { + o.Type = &v +} + +// GetObjectType returns the ObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCustomFieldRequest) GetObjectType() string { + if o == nil || IsNil(o.ObjectType.Get()) { + var ret string + return ret + } + return *o.ObjectType.Get() +} + +// GetObjectTypeOk returns a tuple with the ObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCustomFieldRequest) GetObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectType.Get(), o.ObjectType.IsSet() +} + +// HasObjectType returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasObjectType() bool { + if o != nil && o.ObjectType.IsSet() { + return true + } + + return false +} + +// SetObjectType gets a reference to the given NullableString and assigns it to the ObjectType field. +func (o *WritableCustomFieldRequest) SetObjectType(v string) { + o.ObjectType.Set(&v) +} + +// SetObjectTypeNil sets the value for ObjectType to be an explicit nil +func (o *WritableCustomFieldRequest) SetObjectTypeNil() { + o.ObjectType.Set(nil) +} + +// UnsetObjectType ensures that no value is present for ObjectType, not even an explicit nil +func (o *WritableCustomFieldRequest) UnsetObjectType() { + o.ObjectType.Unset() +} + +// GetName returns the Name field value +func (o *WritableCustomFieldRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableCustomFieldRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableCustomFieldRequest) SetLabel(v string) { + o.Label = &v +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetGroupName() string { + if o == nil || IsNil(o.GroupName) { + var ret string + return ret + } + return *o.GroupName +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetGroupNameOk() (*string, bool) { + if o == nil || IsNil(o.GroupName) { + return nil, false + } + return o.GroupName, true +} + +// HasGroupName returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasGroupName() bool { + if o != nil && !IsNil(o.GroupName) { + return true + } + + return false +} + +// SetGroupName gets a reference to the given string and assigns it to the GroupName field. +func (o *WritableCustomFieldRequest) SetGroupName(v string) { + o.GroupName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableCustomFieldRequest) SetDescription(v string) { + o.Description = &v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *WritableCustomFieldRequest) SetRequired(v bool) { + o.Required = &v +} + +// GetSearchWeight returns the SearchWeight field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetSearchWeight() int32 { + if o == nil || IsNil(o.SearchWeight) { + var ret int32 + return ret + } + return *o.SearchWeight +} + +// GetSearchWeightOk returns a tuple with the SearchWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetSearchWeightOk() (*int32, bool) { + if o == nil || IsNil(o.SearchWeight) { + return nil, false + } + return o.SearchWeight, true +} + +// HasSearchWeight returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasSearchWeight() bool { + if o != nil && !IsNil(o.SearchWeight) { + return true + } + + return false +} + +// SetSearchWeight gets a reference to the given int32 and assigns it to the SearchWeight field. +func (o *WritableCustomFieldRequest) SetSearchWeight(v int32) { + o.SearchWeight = &v +} + +// GetFilterLogic returns the FilterLogic field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetFilterLogic() PatchedWritableCustomFieldRequestFilterLogic { + if o == nil || IsNil(o.FilterLogic) { + var ret PatchedWritableCustomFieldRequestFilterLogic + return ret + } + return *o.FilterLogic +} + +// GetFilterLogicOk returns a tuple with the FilterLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetFilterLogicOk() (*PatchedWritableCustomFieldRequestFilterLogic, bool) { + if o == nil || IsNil(o.FilterLogic) { + return nil, false + } + return o.FilterLogic, true +} + +// HasFilterLogic returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasFilterLogic() bool { + if o != nil && !IsNil(o.FilterLogic) { + return true + } + + return false +} + +// SetFilterLogic gets a reference to the given PatchedWritableCustomFieldRequestFilterLogic and assigns it to the FilterLogic field. +func (o *WritableCustomFieldRequest) SetFilterLogic(v PatchedWritableCustomFieldRequestFilterLogic) { + o.FilterLogic = &v +} + +// GetUiVisible returns the UiVisible field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetUiVisible() PatchedWritableCustomFieldRequestUiVisible { + if o == nil || IsNil(o.UiVisible) { + var ret PatchedWritableCustomFieldRequestUiVisible + return ret + } + return *o.UiVisible +} + +// GetUiVisibleOk returns a tuple with the UiVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetUiVisibleOk() (*PatchedWritableCustomFieldRequestUiVisible, bool) { + if o == nil || IsNil(o.UiVisible) { + return nil, false + } + return o.UiVisible, true +} + +// HasUiVisible returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasUiVisible() bool { + if o != nil && !IsNil(o.UiVisible) { + return true + } + + return false +} + +// SetUiVisible gets a reference to the given PatchedWritableCustomFieldRequestUiVisible and assigns it to the UiVisible field. +func (o *WritableCustomFieldRequest) SetUiVisible(v PatchedWritableCustomFieldRequestUiVisible) { + o.UiVisible = &v +} + +// GetUiEditable returns the UiEditable field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetUiEditable() PatchedWritableCustomFieldRequestUiEditable { + if o == nil || IsNil(o.UiEditable) { + var ret PatchedWritableCustomFieldRequestUiEditable + return ret + } + return *o.UiEditable +} + +// GetUiEditableOk returns a tuple with the UiEditable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetUiEditableOk() (*PatchedWritableCustomFieldRequestUiEditable, bool) { + if o == nil || IsNil(o.UiEditable) { + return nil, false + } + return o.UiEditable, true +} + +// HasUiEditable returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasUiEditable() bool { + if o != nil && !IsNil(o.UiEditable) { + return true + } + + return false +} + +// SetUiEditable gets a reference to the given PatchedWritableCustomFieldRequestUiEditable and assigns it to the UiEditable field. +func (o *WritableCustomFieldRequest) SetUiEditable(v PatchedWritableCustomFieldRequestUiEditable) { + o.UiEditable = &v +} + +// GetIsCloneable returns the IsCloneable field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetIsCloneable() bool { + if o == nil || IsNil(o.IsCloneable) { + var ret bool + return ret + } + return *o.IsCloneable +} + +// GetIsCloneableOk returns a tuple with the IsCloneable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetIsCloneableOk() (*bool, bool) { + if o == nil || IsNil(o.IsCloneable) { + return nil, false + } + return o.IsCloneable, true +} + +// HasIsCloneable returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasIsCloneable() bool { + if o != nil && !IsNil(o.IsCloneable) { + return true + } + + return false +} + +// SetIsCloneable gets a reference to the given bool and assigns it to the IsCloneable field. +func (o *WritableCustomFieldRequest) SetIsCloneable(v bool) { + o.IsCloneable = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCustomFieldRequest) GetDefault() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCustomFieldRequest) GetDefaultOk() (*interface{}, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return &o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasDefault() bool { + if o != nil && IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given interface{} and assigns it to the Default field. +func (o *WritableCustomFieldRequest) SetDefault(v interface{}) { + o.Default = v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetWeight() int32 { + if o == nil || IsNil(o.Weight) { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetWeightOk() (*int32, bool) { + if o == nil || IsNil(o.Weight) { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasWeight() bool { + if o != nil && !IsNil(o.Weight) { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *WritableCustomFieldRequest) SetWeight(v int32) { + o.Weight = &v +} + +// GetValidationMinimum returns the ValidationMinimum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCustomFieldRequest) GetValidationMinimum() int64 { + if o == nil || IsNil(o.ValidationMinimum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMinimum.Get() +} + +// GetValidationMinimumOk returns a tuple with the ValidationMinimum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCustomFieldRequest) GetValidationMinimumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMinimum.Get(), o.ValidationMinimum.IsSet() +} + +// HasValidationMinimum returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasValidationMinimum() bool { + if o != nil && o.ValidationMinimum.IsSet() { + return true + } + + return false +} + +// SetValidationMinimum gets a reference to the given NullableInt64 and assigns it to the ValidationMinimum field. +func (o *WritableCustomFieldRequest) SetValidationMinimum(v int64) { + o.ValidationMinimum.Set(&v) +} + +// SetValidationMinimumNil sets the value for ValidationMinimum to be an explicit nil +func (o *WritableCustomFieldRequest) SetValidationMinimumNil() { + o.ValidationMinimum.Set(nil) +} + +// UnsetValidationMinimum ensures that no value is present for ValidationMinimum, not even an explicit nil +func (o *WritableCustomFieldRequest) UnsetValidationMinimum() { + o.ValidationMinimum.Unset() +} + +// GetValidationMaximum returns the ValidationMaximum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCustomFieldRequest) GetValidationMaximum() int64 { + if o == nil || IsNil(o.ValidationMaximum.Get()) { + var ret int64 + return ret + } + return *o.ValidationMaximum.Get() +} + +// GetValidationMaximumOk returns a tuple with the ValidationMaximum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCustomFieldRequest) GetValidationMaximumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ValidationMaximum.Get(), o.ValidationMaximum.IsSet() +} + +// HasValidationMaximum returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasValidationMaximum() bool { + if o != nil && o.ValidationMaximum.IsSet() { + return true + } + + return false +} + +// SetValidationMaximum gets a reference to the given NullableInt64 and assigns it to the ValidationMaximum field. +func (o *WritableCustomFieldRequest) SetValidationMaximum(v int64) { + o.ValidationMaximum.Set(&v) +} + +// SetValidationMaximumNil sets the value for ValidationMaximum to be an explicit nil +func (o *WritableCustomFieldRequest) SetValidationMaximumNil() { + o.ValidationMaximum.Set(nil) +} + +// UnsetValidationMaximum ensures that no value is present for ValidationMaximum, not even an explicit nil +func (o *WritableCustomFieldRequest) UnsetValidationMaximum() { + o.ValidationMaximum.Unset() +} + +// GetValidationRegex returns the ValidationRegex field value if set, zero value otherwise. +func (o *WritableCustomFieldRequest) GetValidationRegex() string { + if o == nil || IsNil(o.ValidationRegex) { + var ret string + return ret + } + return *o.ValidationRegex +} + +// GetValidationRegexOk returns a tuple with the ValidationRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableCustomFieldRequest) GetValidationRegexOk() (*string, bool) { + if o == nil || IsNil(o.ValidationRegex) { + return nil, false + } + return o.ValidationRegex, true +} + +// HasValidationRegex returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasValidationRegex() bool { + if o != nil && !IsNil(o.ValidationRegex) { + return true + } + + return false +} + +// SetValidationRegex gets a reference to the given string and assigns it to the ValidationRegex field. +func (o *WritableCustomFieldRequest) SetValidationRegex(v string) { + o.ValidationRegex = &v +} + +// GetChoiceSet returns the ChoiceSet field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableCustomFieldRequest) GetChoiceSet() int32 { + if o == nil || IsNil(o.ChoiceSet.Get()) { + var ret int32 + return ret + } + return *o.ChoiceSet.Get() +} + +// GetChoiceSetOk returns a tuple with the ChoiceSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableCustomFieldRequest) GetChoiceSetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ChoiceSet.Get(), o.ChoiceSet.IsSet() +} + +// HasChoiceSet returns a boolean if a field has been set. +func (o *WritableCustomFieldRequest) HasChoiceSet() bool { + if o != nil && o.ChoiceSet.IsSet() { + return true + } + + return false +} + +// SetChoiceSet gets a reference to the given NullableInt32 and assigns it to the ChoiceSet field. +func (o *WritableCustomFieldRequest) SetChoiceSet(v int32) { + o.ChoiceSet.Set(&v) +} + +// SetChoiceSetNil sets the value for ChoiceSet to be an explicit nil +func (o *WritableCustomFieldRequest) SetChoiceSetNil() { + o.ChoiceSet.Set(nil) +} + +// UnsetChoiceSet ensures that no value is present for ChoiceSet, not even an explicit nil +func (o *WritableCustomFieldRequest) UnsetChoiceSet() { + o.ChoiceSet.Unset() +} + +func (o WritableCustomFieldRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableCustomFieldRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.ObjectType.IsSet() { + toSerialize["object_type"] = o.ObjectType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.GroupName) { + toSerialize["group_name"] = o.GroupName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.SearchWeight) { + toSerialize["search_weight"] = o.SearchWeight + } + if !IsNil(o.FilterLogic) { + toSerialize["filter_logic"] = o.FilterLogic + } + if !IsNil(o.UiVisible) { + toSerialize["ui_visible"] = o.UiVisible + } + if !IsNil(o.UiEditable) { + toSerialize["ui_editable"] = o.UiEditable + } + if !IsNil(o.IsCloneable) { + toSerialize["is_cloneable"] = o.IsCloneable + } + if o.Default != nil { + toSerialize["default"] = o.Default + } + if !IsNil(o.Weight) { + toSerialize["weight"] = o.Weight + } + if o.ValidationMinimum.IsSet() { + toSerialize["validation_minimum"] = o.ValidationMinimum.Get() + } + if o.ValidationMaximum.IsSet() { + toSerialize["validation_maximum"] = o.ValidationMaximum.Get() + } + if !IsNil(o.ValidationRegex) { + toSerialize["validation_regex"] = o.ValidationRegex + } + if o.ChoiceSet.IsSet() { + toSerialize["choice_set"] = o.ChoiceSet.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableCustomFieldRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableCustomFieldRequest := _WritableCustomFieldRequest{} + + err = json.Unmarshal(data, &varWritableCustomFieldRequest) + + if err != nil { + return err + } + + *o = WritableCustomFieldRequest(varWritableCustomFieldRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "type") + delete(additionalProperties, "object_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "group_name") + delete(additionalProperties, "description") + delete(additionalProperties, "required") + delete(additionalProperties, "search_weight") + delete(additionalProperties, "filter_logic") + delete(additionalProperties, "ui_visible") + delete(additionalProperties, "ui_editable") + delete(additionalProperties, "is_cloneable") + delete(additionalProperties, "default") + delete(additionalProperties, "weight") + delete(additionalProperties, "validation_minimum") + delete(additionalProperties, "validation_maximum") + delete(additionalProperties, "validation_regex") + delete(additionalProperties, "choice_set") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableCustomFieldRequest struct { + value *WritableCustomFieldRequest + isSet bool +} + +func (v NullableWritableCustomFieldRequest) Get() *WritableCustomFieldRequest { + return v.value +} + +func (v *NullableWritableCustomFieldRequest) Set(val *WritableCustomFieldRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableCustomFieldRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableCustomFieldRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableCustomFieldRequest(val *WritableCustomFieldRequest) *NullableWritableCustomFieldRequest { + return &NullableWritableCustomFieldRequest{value: val, isSet: true} +} + +func (v NullableWritableCustomFieldRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableCustomFieldRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_data_source_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_data_source_request.go new file mode 100644 index 00000000..fdb16216 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_data_source_request.go @@ -0,0 +1,411 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableDataSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableDataSourceRequest{} + +// WritableDataSourceRequest Adds support for custom fields and tags. +type WritableDataSourceRequest struct { + Name string `json:"name"` + Type string `json:"type"` + SourceUrl string `json:"source_url"` + Enabled *bool `json:"enabled,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` + // Patterns (one per line) matching files to ignore when syncing + IgnoreRules *string `json:"ignore_rules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableDataSourceRequest WritableDataSourceRequest + +// NewWritableDataSourceRequest instantiates a new WritableDataSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableDataSourceRequest(name string, type_ string, sourceUrl string) *WritableDataSourceRequest { + this := WritableDataSourceRequest{} + this.Name = name + this.Type = type_ + this.SourceUrl = sourceUrl + return &this +} + +// NewWritableDataSourceRequestWithDefaults instantiates a new WritableDataSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableDataSourceRequestWithDefaults() *WritableDataSourceRequest { + this := WritableDataSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableDataSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableDataSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableDataSourceRequest) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *WritableDataSourceRequest) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableDataSourceRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableDataSourceRequest) SetType(v string) { + o.Type = v +} + +// GetSourceUrl returns the SourceUrl field value +func (o *WritableDataSourceRequest) GetSourceUrl() string { + if o == nil { + var ret string + return ret + } + + return o.SourceUrl +} + +// GetSourceUrlOk returns a tuple with the SourceUrl field value +// and a boolean to check if the value has been set. +func (o *WritableDataSourceRequest) GetSourceUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceUrl, true +} + +// SetSourceUrl sets field value +func (o *WritableDataSourceRequest) SetSourceUrl(v string) { + o.SourceUrl = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *WritableDataSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDataSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *WritableDataSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *WritableDataSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableDataSourceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDataSourceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableDataSourceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableDataSourceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableDataSourceRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDataSourceRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableDataSourceRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableDataSourceRequest) SetComments(v string) { + o.Comments = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDataSourceRequest) GetParameters() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDataSourceRequest) GetParametersOk() (*interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *WritableDataSourceRequest) HasParameters() bool { + if o != nil && IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given interface{} and assigns it to the Parameters field. +func (o *WritableDataSourceRequest) SetParameters(v interface{}) { + o.Parameters = v +} + +// GetIgnoreRules returns the IgnoreRules field value if set, zero value otherwise. +func (o *WritableDataSourceRequest) GetIgnoreRules() string { + if o == nil || IsNil(o.IgnoreRules) { + var ret string + return ret + } + return *o.IgnoreRules +} + +// GetIgnoreRulesOk returns a tuple with the IgnoreRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDataSourceRequest) GetIgnoreRulesOk() (*string, bool) { + if o == nil || IsNil(o.IgnoreRules) { + return nil, false + } + return o.IgnoreRules, true +} + +// HasIgnoreRules returns a boolean if a field has been set. +func (o *WritableDataSourceRequest) HasIgnoreRules() bool { + if o != nil && !IsNil(o.IgnoreRules) { + return true + } + + return false +} + +// SetIgnoreRules gets a reference to the given string and assigns it to the IgnoreRules field. +func (o *WritableDataSourceRequest) SetIgnoreRules(v string) { + o.IgnoreRules = &v +} + +func (o WritableDataSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableDataSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + toSerialize["source_url"] = o.SourceUrl + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.IgnoreRules) { + toSerialize["ignore_rules"] = o.IgnoreRules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableDataSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + "source_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableDataSourceRequest := _WritableDataSourceRequest{} + + err = json.Unmarshal(data, &varWritableDataSourceRequest) + + if err != nil { + return err + } + + *o = WritableDataSourceRequest(varWritableDataSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "source_url") + delete(additionalProperties, "enabled") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "parameters") + delete(additionalProperties, "ignore_rules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableDataSourceRequest struct { + value *WritableDataSourceRequest + isSet bool +} + +func (v NullableWritableDataSourceRequest) Get() *WritableDataSourceRequest { + return v.value +} + +func (v *NullableWritableDataSourceRequest) Set(val *WritableDataSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableDataSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableDataSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableDataSourceRequest(val *WritableDataSourceRequest) *NullableWritableDataSourceRequest { + return &NullableWritableDataSourceRequest{value: val, isSet: true} +} + +func (v NullableWritableDataSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableDataSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_bay_request.go new file mode 100644 index 00000000..12454219 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_bay_request.go @@ -0,0 +1,392 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableDeviceBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableDeviceBayRequest{} + +// WritableDeviceBayRequest Adds support for custom fields and tags. +type WritableDeviceBayRequest struct { + Device int32 `json:"device"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + InstalledDevice NullableInt32 `json:"installed_device,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableDeviceBayRequest WritableDeviceBayRequest + +// NewWritableDeviceBayRequest instantiates a new WritableDeviceBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableDeviceBayRequest(device int32, name string) *WritableDeviceBayRequest { + this := WritableDeviceBayRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewWritableDeviceBayRequestWithDefaults instantiates a new WritableDeviceBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableDeviceBayRequestWithDefaults() *WritableDeviceBayRequest { + this := WritableDeviceBayRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableDeviceBayRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableDeviceBayRequest) SetDevice(v int32) { + o.Device = v +} + +// GetName returns the Name field value +func (o *WritableDeviceBayRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableDeviceBayRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableDeviceBayRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableDeviceBayRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableDeviceBayRequest) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableDeviceBayRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableDeviceBayRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableDeviceBayRequest) SetDescription(v string) { + o.Description = &v +} + +// GetInstalledDevice returns the InstalledDevice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceBayRequest) GetInstalledDevice() int32 { + if o == nil || IsNil(o.InstalledDevice.Get()) { + var ret int32 + return ret + } + return *o.InstalledDevice.Get() +} + +// GetInstalledDeviceOk returns a tuple with the InstalledDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceBayRequest) GetInstalledDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.InstalledDevice.Get(), o.InstalledDevice.IsSet() +} + +// HasInstalledDevice returns a boolean if a field has been set. +func (o *WritableDeviceBayRequest) HasInstalledDevice() bool { + if o != nil && o.InstalledDevice.IsSet() { + return true + } + + return false +} + +// SetInstalledDevice gets a reference to the given NullableInt32 and assigns it to the InstalledDevice field. +func (o *WritableDeviceBayRequest) SetInstalledDevice(v int32) { + o.InstalledDevice.Set(&v) +} + +// SetInstalledDeviceNil sets the value for InstalledDevice to be an explicit nil +func (o *WritableDeviceBayRequest) SetInstalledDeviceNil() { + o.InstalledDevice.Set(nil) +} + +// UnsetInstalledDevice ensures that no value is present for InstalledDevice, not even an explicit nil +func (o *WritableDeviceBayRequest) UnsetInstalledDevice() { + o.InstalledDevice.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableDeviceBayRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableDeviceBayRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableDeviceBayRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableDeviceBayRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableDeviceBayRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableDeviceBayRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableDeviceBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableDeviceBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.InstalledDevice.IsSet() { + toSerialize["installed_device"] = o.InstalledDevice.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableDeviceBayRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableDeviceBayRequest := _WritableDeviceBayRequest{} + + err = json.Unmarshal(data, &varWritableDeviceBayRequest) + + if err != nil { + return err + } + + *o = WritableDeviceBayRequest(varWritableDeviceBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + delete(additionalProperties, "installed_device") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableDeviceBayRequest struct { + value *WritableDeviceBayRequest + isSet bool +} + +func (v NullableWritableDeviceBayRequest) Get() *WritableDeviceBayRequest { + return v.value +} + +func (v *NullableWritableDeviceBayRequest) Set(val *WritableDeviceBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableDeviceBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableDeviceBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableDeviceBayRequest(val *WritableDeviceBayRequest) *NullableWritableDeviceBayRequest { + return &NullableWritableDeviceBayRequest{value: val, isSet: true} +} + +func (v NullableWritableDeviceBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableDeviceBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_bay_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_bay_template_request.go new file mode 100644 index 00000000..74737eac --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_bay_template_request.go @@ -0,0 +1,271 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableDeviceBayTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableDeviceBayTemplateRequest{} + +// WritableDeviceBayTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableDeviceBayTemplateRequest struct { + DeviceType int32 `json:"device_type"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableDeviceBayTemplateRequest WritableDeviceBayTemplateRequest + +// NewWritableDeviceBayTemplateRequest instantiates a new WritableDeviceBayTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableDeviceBayTemplateRequest(deviceType int32, name string) *WritableDeviceBayTemplateRequest { + this := WritableDeviceBayTemplateRequest{} + this.DeviceType = deviceType + this.Name = name + return &this +} + +// NewWritableDeviceBayTemplateRequestWithDefaults instantiates a new WritableDeviceBayTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableDeviceBayTemplateRequestWithDefaults() *WritableDeviceBayTemplateRequest { + this := WritableDeviceBayTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value +func (o *WritableDeviceBayTemplateRequest) GetDeviceType() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *WritableDeviceBayTemplateRequest) SetDeviceType(v int32) { + o.DeviceType = v +} + +// GetName returns the Name field value +func (o *WritableDeviceBayTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableDeviceBayTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableDeviceBayTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableDeviceBayTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableDeviceBayTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableDeviceBayTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceBayTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableDeviceBayTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableDeviceBayTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritableDeviceBayTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableDeviceBayTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_type"] = o.DeviceType + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableDeviceBayTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableDeviceBayTemplateRequest := _WritableDeviceBayTemplateRequest{} + + err = json.Unmarshal(data, &varWritableDeviceBayTemplateRequest) + + if err != nil { + return err + } + + *o = WritableDeviceBayTemplateRequest(varWritableDeviceBayTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableDeviceBayTemplateRequest struct { + value *WritableDeviceBayTemplateRequest + isSet bool +} + +func (v NullableWritableDeviceBayTemplateRequest) Get() *WritableDeviceBayTemplateRequest { + return v.value +} + +func (v *NullableWritableDeviceBayTemplateRequest) Set(val *WritableDeviceBayTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableDeviceBayTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableDeviceBayTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableDeviceBayTemplateRequest(val *WritableDeviceBayTemplateRequest) *NullableWritableDeviceBayTemplateRequest { + return &NullableWritableDeviceBayTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableDeviceBayTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableDeviceBayTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_role_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_role_request.go new file mode 100644 index 00000000..8b9306dc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_role_request.go @@ -0,0 +1,429 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableDeviceRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableDeviceRoleRequest{} + +// WritableDeviceRoleRequest Adds support for custom fields and tags. +type WritableDeviceRoleRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Color *string `json:"color,omitempty"` + // Virtual machines may be assigned to this role + VmRole *bool `json:"vm_role,omitempty"` + ConfigTemplate NullableInt32 `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableDeviceRoleRequest WritableDeviceRoleRequest + +// NewWritableDeviceRoleRequest instantiates a new WritableDeviceRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableDeviceRoleRequest(name string, slug string) *WritableDeviceRoleRequest { + this := WritableDeviceRoleRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableDeviceRoleRequestWithDefaults instantiates a new WritableDeviceRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableDeviceRoleRequestWithDefaults() *WritableDeviceRoleRequest { + this := WritableDeviceRoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableDeviceRoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceRoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableDeviceRoleRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableDeviceRoleRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceRoleRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableDeviceRoleRequest) SetSlug(v string) { + o.Slug = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *WritableDeviceRoleRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceRoleRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *WritableDeviceRoleRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *WritableDeviceRoleRequest) SetColor(v string) { + o.Color = &v +} + +// GetVmRole returns the VmRole field value if set, zero value otherwise. +func (o *WritableDeviceRoleRequest) GetVmRole() bool { + if o == nil || IsNil(o.VmRole) { + var ret bool + return ret + } + return *o.VmRole +} + +// GetVmRoleOk returns a tuple with the VmRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceRoleRequest) GetVmRoleOk() (*bool, bool) { + if o == nil || IsNil(o.VmRole) { + return nil, false + } + return o.VmRole, true +} + +// HasVmRole returns a boolean if a field has been set. +func (o *WritableDeviceRoleRequest) HasVmRole() bool { + if o != nil && !IsNil(o.VmRole) { + return true + } + + return false +} + +// SetVmRole gets a reference to the given bool and assigns it to the VmRole field. +func (o *WritableDeviceRoleRequest) SetVmRole(v bool) { + o.VmRole = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceRoleRequest) GetConfigTemplate() int32 { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret int32 + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceRoleRequest) GetConfigTemplateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *WritableDeviceRoleRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableInt32 and assigns it to the ConfigTemplate field. +func (o *WritableDeviceRoleRequest) SetConfigTemplate(v int32) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *WritableDeviceRoleRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *WritableDeviceRoleRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableDeviceRoleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceRoleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableDeviceRoleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableDeviceRoleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableDeviceRoleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceRoleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableDeviceRoleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableDeviceRoleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableDeviceRoleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceRoleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableDeviceRoleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableDeviceRoleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableDeviceRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableDeviceRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.VmRole) { + toSerialize["vm_role"] = o.VmRole + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableDeviceRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableDeviceRoleRequest := _WritableDeviceRoleRequest{} + + err = json.Unmarshal(data, &varWritableDeviceRoleRequest) + + if err != nil { + return err + } + + *o = WritableDeviceRoleRequest(varWritableDeviceRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "color") + delete(additionalProperties, "vm_role") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableDeviceRoleRequest struct { + value *WritableDeviceRoleRequest + isSet bool +} + +func (v NullableWritableDeviceRoleRequest) Get() *WritableDeviceRoleRequest { + return v.value +} + +func (v *NullableWritableDeviceRoleRequest) Set(val *WritableDeviceRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableDeviceRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableDeviceRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableDeviceRoleRequest(val *WritableDeviceRoleRequest) *NullableWritableDeviceRoleRequest { + return &NullableWritableDeviceRoleRequest{value: val, isSet: true} +} + +func (v NullableWritableDeviceRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableDeviceRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_type_request.go new file mode 100644 index 00000000..49f5a819 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_type_request.go @@ -0,0 +1,809 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "os" +) + +// checks if the WritableDeviceTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableDeviceTypeRequest{} + +// WritableDeviceTypeRequest Adds support for custom fields and tags. +type WritableDeviceTypeRequest struct { + Manufacturer int32 `json:"manufacturer"` + DefaultPlatform NullableInt32 `json:"default_platform,omitempty"` + Model string `json:"model"` + Slug string `json:"slug"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + UHeight *float64 `json:"u_height,omitempty"` + // Devices of this type are excluded when calculating rack utilization. + ExcludeFromUtilization *bool `json:"exclude_from_utilization,omitempty"` + // Device consumes both front and rear rack faces. + IsFullDepth *bool `json:"is_full_depth,omitempty"` + SubdeviceRole *ParentChildStatus `json:"subdevice_role,omitempty"` + Airflow *DeviceAirflowValue `json:"airflow,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit *DeviceTypeWeightUnitValue `json:"weight_unit,omitempty"` + FrontImage **os.File `json:"front_image,omitempty"` + RearImage **os.File `json:"rear_image,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableDeviceTypeRequest WritableDeviceTypeRequest + +// NewWritableDeviceTypeRequest instantiates a new WritableDeviceTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableDeviceTypeRequest(manufacturer int32, model string, slug string) *WritableDeviceTypeRequest { + this := WritableDeviceTypeRequest{} + this.Manufacturer = manufacturer + this.Model = model + this.Slug = slug + var uHeight float64 = 1.0 + this.UHeight = &uHeight + return &this +} + +// NewWritableDeviceTypeRequestWithDefaults instantiates a new WritableDeviceTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableDeviceTypeRequestWithDefaults() *WritableDeviceTypeRequest { + this := WritableDeviceTypeRequest{} + var uHeight float64 = 1.0 + this.UHeight = &uHeight + return &this +} + +// GetManufacturer returns the Manufacturer field value +func (o *WritableDeviceTypeRequest) GetManufacturer() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *WritableDeviceTypeRequest) SetManufacturer(v int32) { + o.Manufacturer = v +} + +// GetDefaultPlatform returns the DefaultPlatform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceTypeRequest) GetDefaultPlatform() int32 { + if o == nil || IsNil(o.DefaultPlatform.Get()) { + var ret int32 + return ret + } + return *o.DefaultPlatform.Get() +} + +// GetDefaultPlatformOk returns a tuple with the DefaultPlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceTypeRequest) GetDefaultPlatformOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DefaultPlatform.Get(), o.DefaultPlatform.IsSet() +} + +// HasDefaultPlatform returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasDefaultPlatform() bool { + if o != nil && o.DefaultPlatform.IsSet() { + return true + } + + return false +} + +// SetDefaultPlatform gets a reference to the given NullableInt32 and assigns it to the DefaultPlatform field. +func (o *WritableDeviceTypeRequest) SetDefaultPlatform(v int32) { + o.DefaultPlatform.Set(&v) +} + +// SetDefaultPlatformNil sets the value for DefaultPlatform to be an explicit nil +func (o *WritableDeviceTypeRequest) SetDefaultPlatformNil() { + o.DefaultPlatform.Set(nil) +} + +// UnsetDefaultPlatform ensures that no value is present for DefaultPlatform, not even an explicit nil +func (o *WritableDeviceTypeRequest) UnsetDefaultPlatform() { + o.DefaultPlatform.Unset() +} + +// GetModel returns the Model field value +func (o *WritableDeviceTypeRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *WritableDeviceTypeRequest) SetModel(v string) { + o.Model = v +} + +// GetSlug returns the Slug field value +func (o *WritableDeviceTypeRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableDeviceTypeRequest) SetSlug(v string) { + o.Slug = v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *WritableDeviceTypeRequest) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetUHeight() float64 { + if o == nil || IsNil(o.UHeight) { + var ret float64 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetUHeightOk() (*float64, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given float64 and assigns it to the UHeight field. +func (o *WritableDeviceTypeRequest) SetUHeight(v float64) { + o.UHeight = &v +} + +// GetExcludeFromUtilization returns the ExcludeFromUtilization field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetExcludeFromUtilization() bool { + if o == nil || IsNil(o.ExcludeFromUtilization) { + var ret bool + return ret + } + return *o.ExcludeFromUtilization +} + +// GetExcludeFromUtilizationOk returns a tuple with the ExcludeFromUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetExcludeFromUtilizationOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeFromUtilization) { + return nil, false + } + return o.ExcludeFromUtilization, true +} + +// HasExcludeFromUtilization returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasExcludeFromUtilization() bool { + if o != nil && !IsNil(o.ExcludeFromUtilization) { + return true + } + + return false +} + +// SetExcludeFromUtilization gets a reference to the given bool and assigns it to the ExcludeFromUtilization field. +func (o *WritableDeviceTypeRequest) SetExcludeFromUtilization(v bool) { + o.ExcludeFromUtilization = &v +} + +// GetIsFullDepth returns the IsFullDepth field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetIsFullDepth() bool { + if o == nil || IsNil(o.IsFullDepth) { + var ret bool + return ret + } + return *o.IsFullDepth +} + +// GetIsFullDepthOk returns a tuple with the IsFullDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetIsFullDepthOk() (*bool, bool) { + if o == nil || IsNil(o.IsFullDepth) { + return nil, false + } + return o.IsFullDepth, true +} + +// HasIsFullDepth returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasIsFullDepth() bool { + if o != nil && !IsNil(o.IsFullDepth) { + return true + } + + return false +} + +// SetIsFullDepth gets a reference to the given bool and assigns it to the IsFullDepth field. +func (o *WritableDeviceTypeRequest) SetIsFullDepth(v bool) { + o.IsFullDepth = &v +} + +// GetSubdeviceRole returns the SubdeviceRole field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetSubdeviceRole() ParentChildStatus { + if o == nil || IsNil(o.SubdeviceRole) { + var ret ParentChildStatus + return ret + } + return *o.SubdeviceRole +} + +// GetSubdeviceRoleOk returns a tuple with the SubdeviceRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetSubdeviceRoleOk() (*ParentChildStatus, bool) { + if o == nil || IsNil(o.SubdeviceRole) { + return nil, false + } + return o.SubdeviceRole, true +} + +// HasSubdeviceRole returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasSubdeviceRole() bool { + if o != nil && !IsNil(o.SubdeviceRole) { + return true + } + + return false +} + +// SetSubdeviceRole gets a reference to the given ParentChildStatus and assigns it to the SubdeviceRole field. +func (o *WritableDeviceTypeRequest) SetSubdeviceRole(v ParentChildStatus) { + o.SubdeviceRole = &v +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetAirflow() DeviceAirflowValue { + if o == nil || IsNil(o.Airflow) { + var ret DeviceAirflowValue + return ret + } + return *o.Airflow +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetAirflowOk() (*DeviceAirflowValue, bool) { + if o == nil || IsNil(o.Airflow) { + return nil, false + } + return o.Airflow, true +} + +// HasAirflow returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasAirflow() bool { + if o != nil && !IsNil(o.Airflow) { + return true + } + + return false +} + +// SetAirflow gets a reference to the given DeviceAirflowValue and assigns it to the Airflow field. +func (o *WritableDeviceTypeRequest) SetAirflow(v DeviceAirflowValue) { + o.Airflow = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceTypeRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceTypeRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *WritableDeviceTypeRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *WritableDeviceTypeRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *WritableDeviceTypeRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetWeightUnit() DeviceTypeWeightUnitValue { + if o == nil || IsNil(o.WeightUnit) { + var ret DeviceTypeWeightUnitValue + return ret + } + return *o.WeightUnit +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetWeightUnitOk() (*DeviceTypeWeightUnitValue, bool) { + if o == nil || IsNil(o.WeightUnit) { + return nil, false + } + return o.WeightUnit, true +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasWeightUnit() bool { + if o != nil && !IsNil(o.WeightUnit) { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given DeviceTypeWeightUnitValue and assigns it to the WeightUnit field. +func (o *WritableDeviceTypeRequest) SetWeightUnit(v DeviceTypeWeightUnitValue) { + o.WeightUnit = &v +} + +// GetFrontImage returns the FrontImage field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetFrontImage() *os.File { + if o == nil || IsNil(o.FrontImage) { + var ret *os.File + return ret + } + return *o.FrontImage +} + +// GetFrontImageOk returns a tuple with the FrontImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetFrontImageOk() (**os.File, bool) { + if o == nil || IsNil(o.FrontImage) { + return nil, false + } + return o.FrontImage, true +} + +// HasFrontImage returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasFrontImage() bool { + if o != nil && !IsNil(o.FrontImage) { + return true + } + + return false +} + +// SetFrontImage gets a reference to the given *os.File and assigns it to the FrontImage field. +func (o *WritableDeviceTypeRequest) SetFrontImage(v *os.File) { + o.FrontImage = &v +} + +// GetRearImage returns the RearImage field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetRearImage() *os.File { + if o == nil || IsNil(o.RearImage) { + var ret *os.File + return ret + } + return *o.RearImage +} + +// GetRearImageOk returns a tuple with the RearImage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetRearImageOk() (**os.File, bool) { + if o == nil || IsNil(o.RearImage) { + return nil, false + } + return o.RearImage, true +} + +// HasRearImage returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasRearImage() bool { + if o != nil && !IsNil(o.RearImage) { + return true + } + + return false +} + +// SetRearImage gets a reference to the given *os.File and assigns it to the RearImage field. +func (o *WritableDeviceTypeRequest) SetRearImage(v *os.File) { + o.RearImage = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableDeviceTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableDeviceTypeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableDeviceTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableDeviceTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableDeviceTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableDeviceTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableDeviceTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableDeviceTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["manufacturer"] = o.Manufacturer + if o.DefaultPlatform.IsSet() { + toSerialize["default_platform"] = o.DefaultPlatform.Get() + } + toSerialize["model"] = o.Model + toSerialize["slug"] = o.Slug + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.ExcludeFromUtilization) { + toSerialize["exclude_from_utilization"] = o.ExcludeFromUtilization + } + if !IsNil(o.IsFullDepth) { + toSerialize["is_full_depth"] = o.IsFullDepth + } + if !IsNil(o.SubdeviceRole) { + toSerialize["subdevice_role"] = o.SubdeviceRole + } + if !IsNil(o.Airflow) { + toSerialize["airflow"] = o.Airflow + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if !IsNil(o.WeightUnit) { + toSerialize["weight_unit"] = o.WeightUnit + } + if !IsNil(o.FrontImage) { + toSerialize["front_image"] = o.FrontImage + } + if !IsNil(o.RearImage) { + toSerialize["rear_image"] = o.RearImage + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableDeviceTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "manufacturer", + "model", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableDeviceTypeRequest := _WritableDeviceTypeRequest{} + + err = json.Unmarshal(data, &varWritableDeviceTypeRequest) + + if err != nil { + return err + } + + *o = WritableDeviceTypeRequest(varWritableDeviceTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "default_platform") + delete(additionalProperties, "model") + delete(additionalProperties, "slug") + delete(additionalProperties, "part_number") + delete(additionalProperties, "u_height") + delete(additionalProperties, "exclude_from_utilization") + delete(additionalProperties, "is_full_depth") + delete(additionalProperties, "subdevice_role") + delete(additionalProperties, "airflow") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "front_image") + delete(additionalProperties, "rear_image") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableDeviceTypeRequest struct { + value *WritableDeviceTypeRequest + isSet bool +} + +func (v NullableWritableDeviceTypeRequest) Get() *WritableDeviceTypeRequest { + return v.value +} + +func (v *NullableWritableDeviceTypeRequest) Set(val *WritableDeviceTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableDeviceTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableDeviceTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableDeviceTypeRequest(val *WritableDeviceTypeRequest) *NullableWritableDeviceTypeRequest { + return &NullableWritableDeviceTypeRequest{value: val, isSet: true} +} + +func (v NullableWritableDeviceTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableDeviceTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_with_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_with_config_context_request.go new file mode 100644 index 00000000..da5f73e3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_device_with_config_context_request.go @@ -0,0 +1,1381 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableDeviceWithConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableDeviceWithConfigContextRequest{} + +// WritableDeviceWithConfigContextRequest Adds support for custom fields and tags. +type WritableDeviceWithConfigContextRequest struct { + Name NullableString `json:"name,omitempty"` + DeviceType int32 `json:"device_type"` + // The function this device serves + Role int32 `json:"role"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Platform NullableInt32 `json:"platform,omitempty"` + // Chassis serial number, assigned by the manufacturer + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Site int32 `json:"site"` + Location NullableInt32 `json:"location,omitempty"` + Rack NullableInt32 `json:"rack,omitempty"` + Position NullableFloat64 `json:"position,omitempty"` + Face *RackFace `json:"face,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + Status *DeviceStatusValue `json:"status,omitempty"` + Airflow *DeviceAirflowValue `json:"airflow,omitempty"` + PrimaryIp4 NullableInt32 `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableInt32 `json:"primary_ip6,omitempty"` + OobIp NullableInt32 `json:"oob_ip,omitempty"` + Cluster NullableInt32 `json:"cluster,omitempty"` + VirtualChassis NullableInt32 `json:"virtual_chassis,omitempty"` + VcPosition NullableInt32 `json:"vc_position,omitempty"` + // Virtual chassis master election priority + VcPriority NullableInt32 `json:"vc_priority,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ConfigTemplate NullableInt32 `json:"config_template,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableDeviceWithConfigContextRequest WritableDeviceWithConfigContextRequest + +// NewWritableDeviceWithConfigContextRequest instantiates a new WritableDeviceWithConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableDeviceWithConfigContextRequest(deviceType int32, role int32, site int32) *WritableDeviceWithConfigContextRequest { + this := WritableDeviceWithConfigContextRequest{} + this.DeviceType = deviceType + this.Role = role + this.Site = site + return &this +} + +// NewWritableDeviceWithConfigContextRequestWithDefaults instantiates a new WritableDeviceWithConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableDeviceWithConfigContextRequestWithDefaults() *WritableDeviceWithConfigContextRequest { + this := WritableDeviceWithConfigContextRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *WritableDeviceWithConfigContextRequest) SetName(v string) { + o.Name.Set(&v) +} + +// SetNameNil sets the value for Name to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetName() { + o.Name.Unset() +} + +// GetDeviceType returns the DeviceType field value +func (o *WritableDeviceWithConfigContextRequest) GetDeviceType() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *WritableDeviceWithConfigContextRequest) SetDeviceType(v int32) { + o.DeviceType = v +} + +// GetRole returns the Role field value +func (o *WritableDeviceWithConfigContextRequest) GetRole() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *WritableDeviceWithConfigContextRequest) SetRole(v int32) { + o.Role = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableDeviceWithConfigContextRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetPlatform() int32 { + if o == nil || IsNil(o.Platform.Get()) { + var ret int32 + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetPlatformOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableInt32 and assigns it to the Platform field. +func (o *WritableDeviceWithConfigContextRequest) SetPlatform(v int32) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetPlatform() { + o.Platform.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *WritableDeviceWithConfigContextRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *WritableDeviceWithConfigContextRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetSite returns the Site field value +func (o *WritableDeviceWithConfigContextRequest) GetSite() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *WritableDeviceWithConfigContextRequest) SetSite(v int32) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetLocation() int32 { + if o == nil || IsNil(o.Location.Get()) { + var ret int32 + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetLocationOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableInt32 and assigns it to the Location field. +func (o *WritableDeviceWithConfigContextRequest) SetLocation(v int32) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetRack() int32 { + if o == nil || IsNil(o.Rack.Get()) { + var ret int32 + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetRackOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableInt32 and assigns it to the Rack field. +func (o *WritableDeviceWithConfigContextRequest) SetRack(v int32) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetRack() { + o.Rack.Unset() +} + +// GetPosition returns the Position field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetPosition() float64 { + if o == nil || IsNil(o.Position.Get()) { + var ret float64 + return ret + } + return *o.Position.Get() +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetPositionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Position.Get(), o.Position.IsSet() +} + +// HasPosition returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasPosition() bool { + if o != nil && o.Position.IsSet() { + return true + } + + return false +} + +// SetPosition gets a reference to the given NullableFloat64 and assigns it to the Position field. +func (o *WritableDeviceWithConfigContextRequest) SetPosition(v float64) { + o.Position.Set(&v) +} + +// SetPositionNil sets the value for Position to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetPositionNil() { + o.Position.Set(nil) +} + +// UnsetPosition ensures that no value is present for Position, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetPosition() { + o.Position.Unset() +} + +// GetFace returns the Face field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetFace() RackFace { + if o == nil || IsNil(o.Face) { + var ret RackFace + return ret + } + return *o.Face +} + +// GetFaceOk returns a tuple with the Face field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetFaceOk() (*RackFace, bool) { + if o == nil || IsNil(o.Face) { + return nil, false + } + return o.Face, true +} + +// HasFace returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasFace() bool { + if o != nil && !IsNil(o.Face) { + return true + } + + return false +} + +// SetFace gets a reference to the given RackFace and assigns it to the Face field. +func (o *WritableDeviceWithConfigContextRequest) SetFace(v RackFace) { + o.Face = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *WritableDeviceWithConfigContextRequest) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *WritableDeviceWithConfigContextRequest) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetStatus() DeviceStatusValue { + if o == nil || IsNil(o.Status) { + var ret DeviceStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetStatusOk() (*DeviceStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given DeviceStatusValue and assigns it to the Status field. +func (o *WritableDeviceWithConfigContextRequest) SetStatus(v DeviceStatusValue) { + o.Status = &v +} + +// GetAirflow returns the Airflow field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetAirflow() DeviceAirflowValue { + if o == nil || IsNil(o.Airflow) { + var ret DeviceAirflowValue + return ret + } + return *o.Airflow +} + +// GetAirflowOk returns a tuple with the Airflow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetAirflowOk() (*DeviceAirflowValue, bool) { + if o == nil || IsNil(o.Airflow) { + return nil, false + } + return o.Airflow, true +} + +// HasAirflow returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasAirflow() bool { + if o != nil && !IsNil(o.Airflow) { + return true + } + + return false +} + +// SetAirflow gets a reference to the given DeviceAirflowValue and assigns it to the Airflow field. +func (o *WritableDeviceWithConfigContextRequest) SetAirflow(v DeviceAirflowValue) { + o.Airflow = &v +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetPrimaryIp4() int32 { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetPrimaryIp4Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp4 field. +func (o *WritableDeviceWithConfigContextRequest) SetPrimaryIp4(v int32) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetPrimaryIp6() int32 { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetPrimaryIp6Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp6 field. +func (o *WritableDeviceWithConfigContextRequest) SetPrimaryIp6(v int32) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetOobIp returns the OobIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetOobIp() int32 { + if o == nil || IsNil(o.OobIp.Get()) { + var ret int32 + return ret + } + return *o.OobIp.Get() +} + +// GetOobIpOk returns a tuple with the OobIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetOobIpOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OobIp.Get(), o.OobIp.IsSet() +} + +// HasOobIp returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasOobIp() bool { + if o != nil && o.OobIp.IsSet() { + return true + } + + return false +} + +// SetOobIp gets a reference to the given NullableInt32 and assigns it to the OobIp field. +func (o *WritableDeviceWithConfigContextRequest) SetOobIp(v int32) { + o.OobIp.Set(&v) +} + +// SetOobIpNil sets the value for OobIp to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetOobIpNil() { + o.OobIp.Set(nil) +} + +// UnsetOobIp ensures that no value is present for OobIp, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetOobIp() { + o.OobIp.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetCluster() int32 { + if o == nil || IsNil(o.Cluster.Get()) { + var ret int32 + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetClusterOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableInt32 and assigns it to the Cluster field. +func (o *WritableDeviceWithConfigContextRequest) SetCluster(v int32) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetCluster() { + o.Cluster.Unset() +} + +// GetVirtualChassis returns the VirtualChassis field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetVirtualChassis() int32 { + if o == nil || IsNil(o.VirtualChassis.Get()) { + var ret int32 + return ret + } + return *o.VirtualChassis.Get() +} + +// GetVirtualChassisOk returns a tuple with the VirtualChassis field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetVirtualChassisOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VirtualChassis.Get(), o.VirtualChassis.IsSet() +} + +// HasVirtualChassis returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasVirtualChassis() bool { + if o != nil && o.VirtualChassis.IsSet() { + return true + } + + return false +} + +// SetVirtualChassis gets a reference to the given NullableInt32 and assigns it to the VirtualChassis field. +func (o *WritableDeviceWithConfigContextRequest) SetVirtualChassis(v int32) { + o.VirtualChassis.Set(&v) +} + +// SetVirtualChassisNil sets the value for VirtualChassis to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetVirtualChassisNil() { + o.VirtualChassis.Set(nil) +} + +// UnsetVirtualChassis ensures that no value is present for VirtualChassis, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetVirtualChassis() { + o.VirtualChassis.Unset() +} + +// GetVcPosition returns the VcPosition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetVcPosition() int32 { + if o == nil || IsNil(o.VcPosition.Get()) { + var ret int32 + return ret + } + return *o.VcPosition.Get() +} + +// GetVcPositionOk returns a tuple with the VcPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetVcPositionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPosition.Get(), o.VcPosition.IsSet() +} + +// HasVcPosition returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasVcPosition() bool { + if o != nil && o.VcPosition.IsSet() { + return true + } + + return false +} + +// SetVcPosition gets a reference to the given NullableInt32 and assigns it to the VcPosition field. +func (o *WritableDeviceWithConfigContextRequest) SetVcPosition(v int32) { + o.VcPosition.Set(&v) +} + +// SetVcPositionNil sets the value for VcPosition to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetVcPositionNil() { + o.VcPosition.Set(nil) +} + +// UnsetVcPosition ensures that no value is present for VcPosition, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetVcPosition() { + o.VcPosition.Unset() +} + +// GetVcPriority returns the VcPriority field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetVcPriority() int32 { + if o == nil || IsNil(o.VcPriority.Get()) { + var ret int32 + return ret + } + return *o.VcPriority.Get() +} + +// GetVcPriorityOk returns a tuple with the VcPriority field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetVcPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VcPriority.Get(), o.VcPriority.IsSet() +} + +// HasVcPriority returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasVcPriority() bool { + if o != nil && o.VcPriority.IsSet() { + return true + } + + return false +} + +// SetVcPriority gets a reference to the given NullableInt32 and assigns it to the VcPriority field. +func (o *WritableDeviceWithConfigContextRequest) SetVcPriority(v int32) { + o.VcPriority.Set(&v) +} + +// SetVcPriorityNil sets the value for VcPriority to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetVcPriorityNil() { + o.VcPriority.Set(nil) +} + +// UnsetVcPriority ensures that no value is present for VcPriority, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetVcPriority() { + o.VcPriority.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableDeviceWithConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableDeviceWithConfigContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetConfigTemplate() int32 { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret int32 + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetConfigTemplateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableInt32 and assigns it to the ConfigTemplate field. +func (o *WritableDeviceWithConfigContextRequest) SetConfigTemplate(v int32) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *WritableDeviceWithConfigContextRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *WritableDeviceWithConfigContextRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableDeviceWithConfigContextRequest) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableDeviceWithConfigContextRequest) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *WritableDeviceWithConfigContextRequest) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableDeviceWithConfigContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableDeviceWithConfigContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableDeviceWithConfigContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableDeviceWithConfigContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableDeviceWithConfigContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableDeviceWithConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableDeviceWithConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["device_type"] = o.DeviceType + toSerialize["role"] = o.Role + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + if o.Position.IsSet() { + toSerialize["position"] = o.Position.Get() + } + if !IsNil(o.Face) { + toSerialize["face"] = o.Face + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Airflow) { + toSerialize["airflow"] = o.Airflow + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.OobIp.IsSet() { + toSerialize["oob_ip"] = o.OobIp.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.VirtualChassis.IsSet() { + toSerialize["virtual_chassis"] = o.VirtualChassis.Get() + } + if o.VcPosition.IsSet() { + toSerialize["vc_position"] = o.VcPosition.Get() + } + if o.VcPriority.IsSet() { + toSerialize["vc_priority"] = o.VcPriority.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableDeviceWithConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "role", + "site", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableDeviceWithConfigContextRequest := _WritableDeviceWithConfigContextRequest{} + + err = json.Unmarshal(data, &varWritableDeviceWithConfigContextRequest) + + if err != nil { + return err + } + + *o = WritableDeviceWithConfigContextRequest(varWritableDeviceWithConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "device_type") + delete(additionalProperties, "role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "rack") + delete(additionalProperties, "position") + delete(additionalProperties, "face") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "status") + delete(additionalProperties, "airflow") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "oob_ip") + delete(additionalProperties, "cluster") + delete(additionalProperties, "virtual_chassis") + delete(additionalProperties, "vc_position") + delete(additionalProperties, "vc_priority") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "config_template") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableDeviceWithConfigContextRequest struct { + value *WritableDeviceWithConfigContextRequest + isSet bool +} + +func (v NullableWritableDeviceWithConfigContextRequest) Get() *WritableDeviceWithConfigContextRequest { + return v.value +} + +func (v *NullableWritableDeviceWithConfigContextRequest) Set(val *WritableDeviceWithConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableDeviceWithConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableDeviceWithConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableDeviceWithConfigContextRequest(val *WritableDeviceWithConfigContextRequest) *NullableWritableDeviceWithConfigContextRequest { + return &NullableWritableDeviceWithConfigContextRequest{value: val, isSet: true} +} + +func (v NullableWritableDeviceWithConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableDeviceWithConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_event_rule_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_event_rule_request.go new file mode 100644 index 00000000..f3b7e6e6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_event_rule_request.go @@ -0,0 +1,686 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableEventRuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableEventRuleRequest{} + +// WritableEventRuleRequest Adds support for custom fields and tags. +type WritableEventRuleRequest struct { + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + // Triggers when a matching object is created. + TypeCreate *bool `json:"type_create,omitempty"` + // Triggers when a matching object is updated. + TypeUpdate *bool `json:"type_update,omitempty"` + // Triggers when a matching object is deleted. + TypeDelete *bool `json:"type_delete,omitempty"` + // Triggers when a job for a matching object is started. + TypeJobStart *bool `json:"type_job_start,omitempty"` + // Triggers when a job for a matching object terminates. + TypeJobEnd *bool `json:"type_job_end,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + // A set of conditions which determine whether the event will be generated. + Conditions interface{} `json:"conditions,omitempty"` + ActionType *EventRuleActionTypeValue `json:"action_type,omitempty"` + ActionObjectType string `json:"action_object_type"` + ActionObjectId NullableInt64 `json:"action_object_id,omitempty"` + Description *string `json:"description,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableEventRuleRequest WritableEventRuleRequest + +// NewWritableEventRuleRequest instantiates a new WritableEventRuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableEventRuleRequest(contentTypes []string, name string, actionObjectType string) *WritableEventRuleRequest { + this := WritableEventRuleRequest{} + this.ContentTypes = contentTypes + this.Name = name + this.ActionObjectType = actionObjectType + return &this +} + +// NewWritableEventRuleRequestWithDefaults instantiates a new WritableEventRuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableEventRuleRequestWithDefaults() *WritableEventRuleRequest { + this := WritableEventRuleRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *WritableEventRuleRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *WritableEventRuleRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *WritableEventRuleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableEventRuleRequest) SetName(v string) { + o.Name = v +} + +// GetTypeCreate returns the TypeCreate field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetTypeCreate() bool { + if o == nil || IsNil(o.TypeCreate) { + var ret bool + return ret + } + return *o.TypeCreate +} + +// GetTypeCreateOk returns a tuple with the TypeCreate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetTypeCreateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeCreate) { + return nil, false + } + return o.TypeCreate, true +} + +// HasTypeCreate returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasTypeCreate() bool { + if o != nil && !IsNil(o.TypeCreate) { + return true + } + + return false +} + +// SetTypeCreate gets a reference to the given bool and assigns it to the TypeCreate field. +func (o *WritableEventRuleRequest) SetTypeCreate(v bool) { + o.TypeCreate = &v +} + +// GetTypeUpdate returns the TypeUpdate field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetTypeUpdate() bool { + if o == nil || IsNil(o.TypeUpdate) { + var ret bool + return ret + } + return *o.TypeUpdate +} + +// GetTypeUpdateOk returns a tuple with the TypeUpdate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetTypeUpdateOk() (*bool, bool) { + if o == nil || IsNil(o.TypeUpdate) { + return nil, false + } + return o.TypeUpdate, true +} + +// HasTypeUpdate returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasTypeUpdate() bool { + if o != nil && !IsNil(o.TypeUpdate) { + return true + } + + return false +} + +// SetTypeUpdate gets a reference to the given bool and assigns it to the TypeUpdate field. +func (o *WritableEventRuleRequest) SetTypeUpdate(v bool) { + o.TypeUpdate = &v +} + +// GetTypeDelete returns the TypeDelete field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetTypeDelete() bool { + if o == nil || IsNil(o.TypeDelete) { + var ret bool + return ret + } + return *o.TypeDelete +} + +// GetTypeDeleteOk returns a tuple with the TypeDelete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetTypeDeleteOk() (*bool, bool) { + if o == nil || IsNil(o.TypeDelete) { + return nil, false + } + return o.TypeDelete, true +} + +// HasTypeDelete returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasTypeDelete() bool { + if o != nil && !IsNil(o.TypeDelete) { + return true + } + + return false +} + +// SetTypeDelete gets a reference to the given bool and assigns it to the TypeDelete field. +func (o *WritableEventRuleRequest) SetTypeDelete(v bool) { + o.TypeDelete = &v +} + +// GetTypeJobStart returns the TypeJobStart field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetTypeJobStart() bool { + if o == nil || IsNil(o.TypeJobStart) { + var ret bool + return ret + } + return *o.TypeJobStart +} + +// GetTypeJobStartOk returns a tuple with the TypeJobStart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetTypeJobStartOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobStart) { + return nil, false + } + return o.TypeJobStart, true +} + +// HasTypeJobStart returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasTypeJobStart() bool { + if o != nil && !IsNil(o.TypeJobStart) { + return true + } + + return false +} + +// SetTypeJobStart gets a reference to the given bool and assigns it to the TypeJobStart field. +func (o *WritableEventRuleRequest) SetTypeJobStart(v bool) { + o.TypeJobStart = &v +} + +// GetTypeJobEnd returns the TypeJobEnd field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetTypeJobEnd() bool { + if o == nil || IsNil(o.TypeJobEnd) { + var ret bool + return ret + } + return *o.TypeJobEnd +} + +// GetTypeJobEndOk returns a tuple with the TypeJobEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetTypeJobEndOk() (*bool, bool) { + if o == nil || IsNil(o.TypeJobEnd) { + return nil, false + } + return o.TypeJobEnd, true +} + +// HasTypeJobEnd returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasTypeJobEnd() bool { + if o != nil && !IsNil(o.TypeJobEnd) { + return true + } + + return false +} + +// SetTypeJobEnd gets a reference to the given bool and assigns it to the TypeJobEnd field. +func (o *WritableEventRuleRequest) SetTypeJobEnd(v bool) { + o.TypeJobEnd = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *WritableEventRuleRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableEventRuleRequest) GetConditions() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableEventRuleRequest) GetConditionsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return &o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasConditions() bool { + if o != nil && IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given interface{} and assigns it to the Conditions field. +func (o *WritableEventRuleRequest) SetConditions(v interface{}) { + o.Conditions = v +} + +// GetActionType returns the ActionType field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetActionType() EventRuleActionTypeValue { + if o == nil || IsNil(o.ActionType) { + var ret EventRuleActionTypeValue + return ret + } + return *o.ActionType +} + +// GetActionTypeOk returns a tuple with the ActionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetActionTypeOk() (*EventRuleActionTypeValue, bool) { + if o == nil || IsNil(o.ActionType) { + return nil, false + } + return o.ActionType, true +} + +// HasActionType returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasActionType() bool { + if o != nil && !IsNil(o.ActionType) { + return true + } + + return false +} + +// SetActionType gets a reference to the given EventRuleActionTypeValue and assigns it to the ActionType field. +func (o *WritableEventRuleRequest) SetActionType(v EventRuleActionTypeValue) { + o.ActionType = &v +} + +// GetActionObjectType returns the ActionObjectType field value +func (o *WritableEventRuleRequest) GetActionObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.ActionObjectType +} + +// GetActionObjectTypeOk returns a tuple with the ActionObjectType field value +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetActionObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActionObjectType, true +} + +// SetActionObjectType sets field value +func (o *WritableEventRuleRequest) SetActionObjectType(v string) { + o.ActionObjectType = v +} + +// GetActionObjectId returns the ActionObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableEventRuleRequest) GetActionObjectId() int64 { + if o == nil || IsNil(o.ActionObjectId.Get()) { + var ret int64 + return ret + } + return *o.ActionObjectId.Get() +} + +// GetActionObjectIdOk returns a tuple with the ActionObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableEventRuleRequest) GetActionObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ActionObjectId.Get(), o.ActionObjectId.IsSet() +} + +// HasActionObjectId returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasActionObjectId() bool { + if o != nil && o.ActionObjectId.IsSet() { + return true + } + + return false +} + +// SetActionObjectId gets a reference to the given NullableInt64 and assigns it to the ActionObjectId field. +func (o *WritableEventRuleRequest) SetActionObjectId(v int64) { + o.ActionObjectId.Set(&v) +} + +// SetActionObjectIdNil sets the value for ActionObjectId to be an explicit nil +func (o *WritableEventRuleRequest) SetActionObjectIdNil() { + o.ActionObjectId.Set(nil) +} + +// UnsetActionObjectId ensures that no value is present for ActionObjectId, not even an explicit nil +func (o *WritableEventRuleRequest) UnsetActionObjectId() { + o.ActionObjectId.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableEventRuleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableEventRuleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableEventRuleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableEventRuleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableEventRuleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableEventRuleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +func (o WritableEventRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableEventRuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.TypeCreate) { + toSerialize["type_create"] = o.TypeCreate + } + if !IsNil(o.TypeUpdate) { + toSerialize["type_update"] = o.TypeUpdate + } + if !IsNil(o.TypeDelete) { + toSerialize["type_delete"] = o.TypeDelete + } + if !IsNil(o.TypeJobStart) { + toSerialize["type_job_start"] = o.TypeJobStart + } + if !IsNil(o.TypeJobEnd) { + toSerialize["type_job_end"] = o.TypeJobEnd + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Conditions != nil { + toSerialize["conditions"] = o.Conditions + } + if !IsNil(o.ActionType) { + toSerialize["action_type"] = o.ActionType + } + toSerialize["action_object_type"] = o.ActionObjectType + if o.ActionObjectId.IsSet() { + toSerialize["action_object_id"] = o.ActionObjectId.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableEventRuleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "name", + "action_object_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableEventRuleRequest := _WritableEventRuleRequest{} + + err = json.Unmarshal(data, &varWritableEventRuleRequest) + + if err != nil { + return err + } + + *o = WritableEventRuleRequest(varWritableEventRuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "type_create") + delete(additionalProperties, "type_update") + delete(additionalProperties, "type_delete") + delete(additionalProperties, "type_job_start") + delete(additionalProperties, "type_job_end") + delete(additionalProperties, "enabled") + delete(additionalProperties, "conditions") + delete(additionalProperties, "action_type") + delete(additionalProperties, "action_object_type") + delete(additionalProperties, "action_object_id") + delete(additionalProperties, "description") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableEventRuleRequest struct { + value *WritableEventRuleRequest + isSet bool +} + +func (v NullableWritableEventRuleRequest) Get() *WritableEventRuleRequest { + return v.value +} + +func (v *NullableWritableEventRuleRequest) Set(val *WritableEventRuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableEventRuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableEventRuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableEventRuleRequest(val *WritableEventRuleRequest) *NullableWritableEventRuleRequest { + return &NullableWritableEventRuleRequest{value: val, isSet: true} +} + +func (v NullableWritableEventRuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableEventRuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_export_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_export_template_request.go new file mode 100644 index 00000000..bf2b40f9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_export_template_request.go @@ -0,0 +1,425 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableExportTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableExportTemplateRequest{} + +// WritableExportTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableExportTemplateRequest struct { + ContentTypes []string `json:"content_types"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + // Jinja2 template code. The list of objects being exported is passed as a context variable named queryset. + TemplateCode string `json:"template_code"` + // Defaults to text/plain; charset=utf-8 + MimeType *string `json:"mime_type,omitempty"` + // Extension to append to the rendered filename + FileExtension *string `json:"file_extension,omitempty"` + // Download file as attachment + AsAttachment *bool `json:"as_attachment,omitempty"` + // Remote data source + DataSource NullableInt32 `json:"data_source,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableExportTemplateRequest WritableExportTemplateRequest + +// NewWritableExportTemplateRequest instantiates a new WritableExportTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableExportTemplateRequest(contentTypes []string, name string, templateCode string) *WritableExportTemplateRequest { + this := WritableExportTemplateRequest{} + this.ContentTypes = contentTypes + this.Name = name + this.TemplateCode = templateCode + return &this +} + +// NewWritableExportTemplateRequestWithDefaults instantiates a new WritableExportTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableExportTemplateRequestWithDefaults() *WritableExportTemplateRequest { + this := WritableExportTemplateRequest{} + return &this +} + +// GetContentTypes returns the ContentTypes field value +func (o *WritableExportTemplateRequest) GetContentTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ContentTypes +} + +// GetContentTypesOk returns a tuple with the ContentTypes field value +// and a boolean to check if the value has been set. +func (o *WritableExportTemplateRequest) GetContentTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ContentTypes, true +} + +// SetContentTypes sets field value +func (o *WritableExportTemplateRequest) SetContentTypes(v []string) { + o.ContentTypes = v +} + +// GetName returns the Name field value +func (o *WritableExportTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableExportTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableExportTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableExportTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableExportTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableExportTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableExportTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTemplateCode returns the TemplateCode field value +func (o *WritableExportTemplateRequest) GetTemplateCode() string { + if o == nil { + var ret string + return ret + } + + return o.TemplateCode +} + +// GetTemplateCodeOk returns a tuple with the TemplateCode field value +// and a boolean to check if the value has been set. +func (o *WritableExportTemplateRequest) GetTemplateCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TemplateCode, true +} + +// SetTemplateCode sets field value +func (o *WritableExportTemplateRequest) SetTemplateCode(v string) { + o.TemplateCode = v +} + +// GetMimeType returns the MimeType field value if set, zero value otherwise. +func (o *WritableExportTemplateRequest) GetMimeType() string { + if o == nil || IsNil(o.MimeType) { + var ret string + return ret + } + return *o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableExportTemplateRequest) GetMimeTypeOk() (*string, bool) { + if o == nil || IsNil(o.MimeType) { + return nil, false + } + return o.MimeType, true +} + +// HasMimeType returns a boolean if a field has been set. +func (o *WritableExportTemplateRequest) HasMimeType() bool { + if o != nil && !IsNil(o.MimeType) { + return true + } + + return false +} + +// SetMimeType gets a reference to the given string and assigns it to the MimeType field. +func (o *WritableExportTemplateRequest) SetMimeType(v string) { + o.MimeType = &v +} + +// GetFileExtension returns the FileExtension field value if set, zero value otherwise. +func (o *WritableExportTemplateRequest) GetFileExtension() string { + if o == nil || IsNil(o.FileExtension) { + var ret string + return ret + } + return *o.FileExtension +} + +// GetFileExtensionOk returns a tuple with the FileExtension field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableExportTemplateRequest) GetFileExtensionOk() (*string, bool) { + if o == nil || IsNil(o.FileExtension) { + return nil, false + } + return o.FileExtension, true +} + +// HasFileExtension returns a boolean if a field has been set. +func (o *WritableExportTemplateRequest) HasFileExtension() bool { + if o != nil && !IsNil(o.FileExtension) { + return true + } + + return false +} + +// SetFileExtension gets a reference to the given string and assigns it to the FileExtension field. +func (o *WritableExportTemplateRequest) SetFileExtension(v string) { + o.FileExtension = &v +} + +// GetAsAttachment returns the AsAttachment field value if set, zero value otherwise. +func (o *WritableExportTemplateRequest) GetAsAttachment() bool { + if o == nil || IsNil(o.AsAttachment) { + var ret bool + return ret + } + return *o.AsAttachment +} + +// GetAsAttachmentOk returns a tuple with the AsAttachment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableExportTemplateRequest) GetAsAttachmentOk() (*bool, bool) { + if o == nil || IsNil(o.AsAttachment) { + return nil, false + } + return o.AsAttachment, true +} + +// HasAsAttachment returns a boolean if a field has been set. +func (o *WritableExportTemplateRequest) HasAsAttachment() bool { + if o != nil && !IsNil(o.AsAttachment) { + return true + } + + return false +} + +// SetAsAttachment gets a reference to the given bool and assigns it to the AsAttachment field. +func (o *WritableExportTemplateRequest) SetAsAttachment(v bool) { + o.AsAttachment = &v +} + +// GetDataSource returns the DataSource field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableExportTemplateRequest) GetDataSource() int32 { + if o == nil || IsNil(o.DataSource.Get()) { + var ret int32 + return ret + } + return *o.DataSource.Get() +} + +// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableExportTemplateRequest) GetDataSourceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataSource.Get(), o.DataSource.IsSet() +} + +// HasDataSource returns a boolean if a field has been set. +func (o *WritableExportTemplateRequest) HasDataSource() bool { + if o != nil && o.DataSource.IsSet() { + return true + } + + return false +} + +// SetDataSource gets a reference to the given NullableInt32 and assigns it to the DataSource field. +func (o *WritableExportTemplateRequest) SetDataSource(v int32) { + o.DataSource.Set(&v) +} + +// SetDataSourceNil sets the value for DataSource to be an explicit nil +func (o *WritableExportTemplateRequest) SetDataSourceNil() { + o.DataSource.Set(nil) +} + +// UnsetDataSource ensures that no value is present for DataSource, not even an explicit nil +func (o *WritableExportTemplateRequest) UnsetDataSource() { + o.DataSource.Unset() +} + +func (o WritableExportTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableExportTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_types"] = o.ContentTypes + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["template_code"] = o.TemplateCode + if !IsNil(o.MimeType) { + toSerialize["mime_type"] = o.MimeType + } + if !IsNil(o.FileExtension) { + toSerialize["file_extension"] = o.FileExtension + } + if !IsNil(o.AsAttachment) { + toSerialize["as_attachment"] = o.AsAttachment + } + if o.DataSource.IsSet() { + toSerialize["data_source"] = o.DataSource.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableExportTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_types", + "name", + "template_code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableExportTemplateRequest := _WritableExportTemplateRequest{} + + err = json.Unmarshal(data, &varWritableExportTemplateRequest) + + if err != nil { + return err + } + + *o = WritableExportTemplateRequest(varWritableExportTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_types") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "template_code") + delete(additionalProperties, "mime_type") + delete(additionalProperties, "file_extension") + delete(additionalProperties, "as_attachment") + delete(additionalProperties, "data_source") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableExportTemplateRequest struct { + value *WritableExportTemplateRequest + isSet bool +} + +func (v NullableWritableExportTemplateRequest) Get() *WritableExportTemplateRequest { + return v.value +} + +func (v *NullableWritableExportTemplateRequest) Set(val *WritableExportTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableExportTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableExportTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableExportTemplateRequest(val *WritableExportTemplateRequest) *NullableWritableExportTemplateRequest { + return &NullableWritableExportTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableExportTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableExportTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_fhrp_group_assignment_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_fhrp_group_assignment_request.go new file mode 100644 index 00000000..6dc1c5ad --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_fhrp_group_assignment_request.go @@ -0,0 +1,253 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableFHRPGroupAssignmentRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableFHRPGroupAssignmentRequest{} + +// WritableFHRPGroupAssignmentRequest Adds support for custom fields and tags. +type WritableFHRPGroupAssignmentRequest struct { + Group int32 `json:"group"` + InterfaceType string `json:"interface_type"` + InterfaceId int64 `json:"interface_id"` + Priority int32 `json:"priority"` + AdditionalProperties map[string]interface{} +} + +type _WritableFHRPGroupAssignmentRequest WritableFHRPGroupAssignmentRequest + +// NewWritableFHRPGroupAssignmentRequest instantiates a new WritableFHRPGroupAssignmentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableFHRPGroupAssignmentRequest(group int32, interfaceType string, interfaceId int64, priority int32) *WritableFHRPGroupAssignmentRequest { + this := WritableFHRPGroupAssignmentRequest{} + this.Group = group + this.InterfaceType = interfaceType + this.InterfaceId = interfaceId + this.Priority = priority + return &this +} + +// NewWritableFHRPGroupAssignmentRequestWithDefaults instantiates a new WritableFHRPGroupAssignmentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableFHRPGroupAssignmentRequestWithDefaults() *WritableFHRPGroupAssignmentRequest { + this := WritableFHRPGroupAssignmentRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *WritableFHRPGroupAssignmentRequest) GetGroup() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *WritableFHRPGroupAssignmentRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *WritableFHRPGroupAssignmentRequest) SetGroup(v int32) { + o.Group = v +} + +// GetInterfaceType returns the InterfaceType field value +func (o *WritableFHRPGroupAssignmentRequest) GetInterfaceType() string { + if o == nil { + var ret string + return ret + } + + return o.InterfaceType +} + +// GetInterfaceTypeOk returns a tuple with the InterfaceType field value +// and a boolean to check if the value has been set. +func (o *WritableFHRPGroupAssignmentRequest) GetInterfaceTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceType, true +} + +// SetInterfaceType sets field value +func (o *WritableFHRPGroupAssignmentRequest) SetInterfaceType(v string) { + o.InterfaceType = v +} + +// GetInterfaceId returns the InterfaceId field value +func (o *WritableFHRPGroupAssignmentRequest) GetInterfaceId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.InterfaceId +} + +// GetInterfaceIdOk returns a tuple with the InterfaceId field value +// and a boolean to check if the value has been set. +func (o *WritableFHRPGroupAssignmentRequest) GetInterfaceIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceId, true +} + +// SetInterfaceId sets field value +func (o *WritableFHRPGroupAssignmentRequest) SetInterfaceId(v int64) { + o.InterfaceId = v +} + +// GetPriority returns the Priority field value +func (o *WritableFHRPGroupAssignmentRequest) GetPriority() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value +// and a boolean to check if the value has been set. +func (o *WritableFHRPGroupAssignmentRequest) GetPriorityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Priority, true +} + +// SetPriority sets field value +func (o *WritableFHRPGroupAssignmentRequest) SetPriority(v int32) { + o.Priority = v +} + +func (o WritableFHRPGroupAssignmentRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableFHRPGroupAssignmentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["interface_type"] = o.InterfaceType + toSerialize["interface_id"] = o.InterfaceId + toSerialize["priority"] = o.Priority + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableFHRPGroupAssignmentRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "interface_type", + "interface_id", + "priority", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableFHRPGroupAssignmentRequest := _WritableFHRPGroupAssignmentRequest{} + + err = json.Unmarshal(data, &varWritableFHRPGroupAssignmentRequest) + + if err != nil { + return err + } + + *o = WritableFHRPGroupAssignmentRequest(varWritableFHRPGroupAssignmentRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "interface_type") + delete(additionalProperties, "interface_id") + delete(additionalProperties, "priority") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableFHRPGroupAssignmentRequest struct { + value *WritableFHRPGroupAssignmentRequest + isSet bool +} + +func (v NullableWritableFHRPGroupAssignmentRequest) Get() *WritableFHRPGroupAssignmentRequest { + return v.value +} + +func (v *NullableWritableFHRPGroupAssignmentRequest) Set(val *WritableFHRPGroupAssignmentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableFHRPGroupAssignmentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableFHRPGroupAssignmentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableFHRPGroupAssignmentRequest(val *WritableFHRPGroupAssignmentRequest) *NullableWritableFHRPGroupAssignmentRequest { + return &NullableWritableFHRPGroupAssignmentRequest{value: val, isSet: true} +} + +func (v NullableWritableFHRPGroupAssignmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableFHRPGroupAssignmentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_front_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_front_port_request.go new file mode 100644 index 00000000..84785f77 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_front_port_request.go @@ -0,0 +1,563 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableFrontPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableFrontPortRequest{} + +// WritableFrontPortRequest Adds support for custom fields and tags. +type WritableFrontPortRequest struct { + Device int32 `json:"device"` + Module NullableInt32 `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + RearPort int32 `json:"rear_port"` + // Mapped position on corresponding rear port + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableFrontPortRequest WritableFrontPortRequest + +// NewWritableFrontPortRequest instantiates a new WritableFrontPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableFrontPortRequest(device int32, name string, type_ FrontPortTypeValue, rearPort int32) *WritableFrontPortRequest { + this := WritableFrontPortRequest{} + this.Device = device + this.Name = name + this.Type = type_ + this.RearPort = rearPort + return &this +} + +// NewWritableFrontPortRequestWithDefaults instantiates a new WritableFrontPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableFrontPortRequestWithDefaults() *WritableFrontPortRequest { + this := WritableFrontPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableFrontPortRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableFrontPortRequest) SetDevice(v int32) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableFrontPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableFrontPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *WritableFrontPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *WritableFrontPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *WritableFrontPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *WritableFrontPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableFrontPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableFrontPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableFrontPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *WritableFrontPortRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableFrontPortRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *WritableFrontPortRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *WritableFrontPortRequest) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value +func (o *WritableFrontPortRequest) GetRearPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetRearPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RearPort, true +} + +// SetRearPort sets field value +func (o *WritableFrontPortRequest) SetRearPort(v int32) { + o.RearPort = v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *WritableFrontPortRequest) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *WritableFrontPortRequest) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableFrontPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableFrontPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritableFrontPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritableFrontPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableFrontPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableFrontPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableFrontPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableFrontPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableFrontPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableFrontPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableFrontPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + toSerialize["rear_port"] = o.RearPort + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableFrontPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + "type", + "rear_port", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableFrontPortRequest := _WritableFrontPortRequest{} + + err = json.Unmarshal(data, &varWritableFrontPortRequest) + + if err != nil { + return err + } + + *o = WritableFrontPortRequest(varWritableFrontPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableFrontPortRequest struct { + value *WritableFrontPortRequest + isSet bool +} + +func (v NullableWritableFrontPortRequest) Get() *WritableFrontPortRequest { + return v.value +} + +func (v *NullableWritableFrontPortRequest) Set(val *WritableFrontPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableFrontPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableFrontPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableFrontPortRequest(val *WritableFrontPortRequest) *NullableWritableFrontPortRequest { + return &NullableWritableFrontPortRequest{value: val, isSet: true} +} + +func (v NullableWritableFrontPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableFrontPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_front_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_front_port_template_request.go new file mode 100644 index 00000000..94424d37 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_front_port_template_request.go @@ -0,0 +1,470 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableFrontPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableFrontPortTemplateRequest{} + +// WritableFrontPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableFrontPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + RearPort int32 `json:"rear_port"` + RearPortPosition *int32 `json:"rear_port_position,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableFrontPortTemplateRequest WritableFrontPortTemplateRequest + +// NewWritableFrontPortTemplateRequest instantiates a new WritableFrontPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableFrontPortTemplateRequest(name string, type_ FrontPortTypeValue, rearPort int32) *WritableFrontPortTemplateRequest { + this := WritableFrontPortTemplateRequest{} + this.Name = name + this.Type = type_ + this.RearPort = rearPort + return &this +} + +// NewWritableFrontPortTemplateRequestWithDefaults instantiates a new WritableFrontPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableFrontPortTemplateRequestWithDefaults() *WritableFrontPortTemplateRequest { + this := WritableFrontPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableFrontPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableFrontPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *WritableFrontPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *WritableFrontPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *WritableFrontPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *WritableFrontPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableFrontPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableFrontPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *WritableFrontPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *WritableFrontPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *WritableFrontPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *WritableFrontPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *WritableFrontPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableFrontPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableFrontPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableFrontPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableFrontPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableFrontPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *WritableFrontPortTemplateRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableFrontPortTemplateRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableFrontPortTemplateRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *WritableFrontPortTemplateRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortTemplateRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *WritableFrontPortTemplateRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *WritableFrontPortTemplateRequest) SetColor(v string) { + o.Color = &v +} + +// GetRearPort returns the RearPort field value +func (o *WritableFrontPortTemplateRequest) GetRearPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RearPort +} + +// GetRearPortOk returns a tuple with the RearPort field value +// and a boolean to check if the value has been set. +func (o *WritableFrontPortTemplateRequest) GetRearPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RearPort, true +} + +// SetRearPort sets field value +func (o *WritableFrontPortTemplateRequest) SetRearPort(v int32) { + o.RearPort = v +} + +// GetRearPortPosition returns the RearPortPosition field value if set, zero value otherwise. +func (o *WritableFrontPortTemplateRequest) GetRearPortPosition() int32 { + if o == nil || IsNil(o.RearPortPosition) { + var ret int32 + return ret + } + return *o.RearPortPosition +} + +// GetRearPortPositionOk returns a tuple with the RearPortPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortTemplateRequest) GetRearPortPositionOk() (*int32, bool) { + if o == nil || IsNil(o.RearPortPosition) { + return nil, false + } + return o.RearPortPosition, true +} + +// HasRearPortPosition returns a boolean if a field has been set. +func (o *WritableFrontPortTemplateRequest) HasRearPortPosition() bool { + if o != nil && !IsNil(o.RearPortPosition) { + return true + } + + return false +} + +// SetRearPortPosition gets a reference to the given int32 and assigns it to the RearPortPosition field. +func (o *WritableFrontPortTemplateRequest) SetRearPortPosition(v int32) { + o.RearPortPosition = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableFrontPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableFrontPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableFrontPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableFrontPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritableFrontPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableFrontPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + toSerialize["rear_port"] = o.RearPort + if !IsNil(o.RearPortPosition) { + toSerialize["rear_port_position"] = o.RearPortPosition + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableFrontPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + "rear_port", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableFrontPortTemplateRequest := _WritableFrontPortTemplateRequest{} + + err = json.Unmarshal(data, &varWritableFrontPortTemplateRequest) + + if err != nil { + return err + } + + *o = WritableFrontPortTemplateRequest(varWritableFrontPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "rear_port") + delete(additionalProperties, "rear_port_position") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableFrontPortTemplateRequest struct { + value *WritableFrontPortTemplateRequest + isSet bool +} + +func (v NullableWritableFrontPortTemplateRequest) Get() *WritableFrontPortTemplateRequest { + return v.value +} + +func (v *NullableWritableFrontPortTemplateRequest) Set(val *WritableFrontPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableFrontPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableFrontPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableFrontPortTemplateRequest(val *WritableFrontPortTemplateRequest) *NullableWritableFrontPortTemplateRequest { + return &NullableWritableFrontPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableFrontPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableFrontPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ike_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ike_policy_request.go new file mode 100644 index 00000000..45ad1bb1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ike_policy_request.go @@ -0,0 +1,446 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableIKEPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableIKEPolicyRequest{} + +// WritableIKEPolicyRequest Adds support for custom fields and tags. +type WritableIKEPolicyRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Version *PatchedWritableIKEPolicyRequestVersion `json:"version,omitempty"` + Mode IKEPolicyModeValue `json:"mode"` + Proposals []int32 `json:"proposals"` + PresharedKey *string `json:"preshared_key,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableIKEPolicyRequest WritableIKEPolicyRequest + +// NewWritableIKEPolicyRequest instantiates a new WritableIKEPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableIKEPolicyRequest(name string, mode IKEPolicyModeValue, proposals []int32) *WritableIKEPolicyRequest { + this := WritableIKEPolicyRequest{} + this.Name = name + this.Mode = mode + this.Proposals = proposals + return &this +} + +// NewWritableIKEPolicyRequestWithDefaults instantiates a new WritableIKEPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableIKEPolicyRequestWithDefaults() *WritableIKEPolicyRequest { + this := WritableIKEPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableIKEPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableIKEPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableIKEPolicyRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableIKEPolicyRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableIKEPolicyRequest) SetDescription(v string) { + o.Description = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *WritableIKEPolicyRequest) GetVersion() PatchedWritableIKEPolicyRequestVersion { + if o == nil || IsNil(o.Version) { + var ret PatchedWritableIKEPolicyRequestVersion + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetVersionOk() (*PatchedWritableIKEPolicyRequestVersion, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *WritableIKEPolicyRequest) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given PatchedWritableIKEPolicyRequestVersion and assigns it to the Version field. +func (o *WritableIKEPolicyRequest) SetVersion(v PatchedWritableIKEPolicyRequestVersion) { + o.Version = &v +} + +// GetMode returns the Mode field value +func (o *WritableIKEPolicyRequest) GetMode() IKEPolicyModeValue { + if o == nil { + var ret IKEPolicyModeValue + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetModeOk() (*IKEPolicyModeValue, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *WritableIKEPolicyRequest) SetMode(v IKEPolicyModeValue) { + o.Mode = v +} + +// GetProposals returns the Proposals field value +func (o *WritableIKEPolicyRequest) GetProposals() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetProposalsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Proposals, true +} + +// SetProposals sets field value +func (o *WritableIKEPolicyRequest) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPresharedKey returns the PresharedKey field value if set, zero value otherwise. +func (o *WritableIKEPolicyRequest) GetPresharedKey() string { + if o == nil || IsNil(o.PresharedKey) { + var ret string + return ret + } + return *o.PresharedKey +} + +// GetPresharedKeyOk returns a tuple with the PresharedKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetPresharedKeyOk() (*string, bool) { + if o == nil || IsNil(o.PresharedKey) { + return nil, false + } + return o.PresharedKey, true +} + +// HasPresharedKey returns a boolean if a field has been set. +func (o *WritableIKEPolicyRequest) HasPresharedKey() bool { + if o != nil && !IsNil(o.PresharedKey) { + return true + } + + return false +} + +// SetPresharedKey gets a reference to the given string and assigns it to the PresharedKey field. +func (o *WritableIKEPolicyRequest) SetPresharedKey(v string) { + o.PresharedKey = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableIKEPolicyRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableIKEPolicyRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableIKEPolicyRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableIKEPolicyRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableIKEPolicyRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableIKEPolicyRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableIKEPolicyRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEPolicyRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableIKEPolicyRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableIKEPolicyRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableIKEPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableIKEPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + toSerialize["mode"] = o.Mode + toSerialize["proposals"] = o.Proposals + if !IsNil(o.PresharedKey) { + toSerialize["preshared_key"] = o.PresharedKey + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableIKEPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mode", + "proposals", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableIKEPolicyRequest := _WritableIKEPolicyRequest{} + + err = json.Unmarshal(data, &varWritableIKEPolicyRequest) + + if err != nil { + return err + } + + *o = WritableIKEPolicyRequest(varWritableIKEPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "version") + delete(additionalProperties, "mode") + delete(additionalProperties, "proposals") + delete(additionalProperties, "preshared_key") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableIKEPolicyRequest struct { + value *WritableIKEPolicyRequest + isSet bool +} + +func (v NullableWritableIKEPolicyRequest) Get() *WritableIKEPolicyRequest { + return v.value +} + +func (v *NullableWritableIKEPolicyRequest) Set(val *WritableIKEPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableIKEPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableIKEPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableIKEPolicyRequest(val *WritableIKEPolicyRequest) *NullableWritableIKEPolicyRequest { + return &NullableWritableIKEPolicyRequest{value: val, isSet: true} +} + +func (v NullableWritableIKEPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableIKEPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ike_proposal_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ike_proposal_request.go new file mode 100644 index 00000000..5534a2df --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ike_proposal_request.go @@ -0,0 +1,487 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableIKEProposalRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableIKEProposalRequest{} + +// WritableIKEProposalRequest Adds support for custom fields and tags. +type WritableIKEProposalRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + AuthenticationMethod IKEProposalAuthenticationMethodValue `json:"authentication_method"` + EncryptionAlgorithm IKEProposalEncryptionAlgorithmValue `json:"encryption_algorithm"` + AuthenticationAlgorithm *PatchedWritableIKEProposalRequestAuthenticationAlgorithm `json:"authentication_algorithm,omitempty"` + Group PatchedWritableIKEProposalRequestGroup `json:"group"` + // Security association lifetime (in seconds) + SaLifetime NullableInt32 `json:"sa_lifetime,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableIKEProposalRequest WritableIKEProposalRequest + +// NewWritableIKEProposalRequest instantiates a new WritableIKEProposalRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableIKEProposalRequest(name string, authenticationMethod IKEProposalAuthenticationMethodValue, encryptionAlgorithm IKEProposalEncryptionAlgorithmValue, group PatchedWritableIKEProposalRequestGroup) *WritableIKEProposalRequest { + this := WritableIKEProposalRequest{} + this.Name = name + this.AuthenticationMethod = authenticationMethod + this.EncryptionAlgorithm = encryptionAlgorithm + this.Group = group + return &this +} + +// NewWritableIKEProposalRequestWithDefaults instantiates a new WritableIKEProposalRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableIKEProposalRequestWithDefaults() *WritableIKEProposalRequest { + this := WritableIKEProposalRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableIKEProposalRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableIKEProposalRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableIKEProposalRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableIKEProposalRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableIKEProposalRequest) SetDescription(v string) { + o.Description = &v +} + +// GetAuthenticationMethod returns the AuthenticationMethod field value +func (o *WritableIKEProposalRequest) GetAuthenticationMethod() IKEProposalAuthenticationMethodValue { + if o == nil { + var ret IKEProposalAuthenticationMethodValue + return ret + } + + return o.AuthenticationMethod +} + +// GetAuthenticationMethodOk returns a tuple with the AuthenticationMethod field value +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetAuthenticationMethodOk() (*IKEProposalAuthenticationMethodValue, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationMethod, true +} + +// SetAuthenticationMethod sets field value +func (o *WritableIKEProposalRequest) SetAuthenticationMethod(v IKEProposalAuthenticationMethodValue) { + o.AuthenticationMethod = v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value +func (o *WritableIKEProposalRequest) GetEncryptionAlgorithm() IKEProposalEncryptionAlgorithmValue { + if o == nil { + var ret IKEProposalEncryptionAlgorithmValue + return ret + } + + return o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetEncryptionAlgorithmOk() (*IKEProposalEncryptionAlgorithmValue, bool) { + if o == nil { + return nil, false + } + return &o.EncryptionAlgorithm, true +} + +// SetEncryptionAlgorithm sets field value +func (o *WritableIKEProposalRequest) SetEncryptionAlgorithm(v IKEProposalEncryptionAlgorithmValue) { + o.EncryptionAlgorithm = v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value if set, zero value otherwise. +func (o *WritableIKEProposalRequest) GetAuthenticationAlgorithm() PatchedWritableIKEProposalRequestAuthenticationAlgorithm { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + var ret PatchedWritableIKEProposalRequestAuthenticationAlgorithm + return ret + } + return *o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetAuthenticationAlgorithmOk() (*PatchedWritableIKEProposalRequestAuthenticationAlgorithm, bool) { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + return nil, false + } + return o.AuthenticationAlgorithm, true +} + +// HasAuthenticationAlgorithm returns a boolean if a field has been set. +func (o *WritableIKEProposalRequest) HasAuthenticationAlgorithm() bool { + if o != nil && !IsNil(o.AuthenticationAlgorithm) { + return true + } + + return false +} + +// SetAuthenticationAlgorithm gets a reference to the given PatchedWritableIKEProposalRequestAuthenticationAlgorithm and assigns it to the AuthenticationAlgorithm field. +func (o *WritableIKEProposalRequest) SetAuthenticationAlgorithm(v PatchedWritableIKEProposalRequestAuthenticationAlgorithm) { + o.AuthenticationAlgorithm = &v +} + +// GetGroup returns the Group field value +func (o *WritableIKEProposalRequest) GetGroup() PatchedWritableIKEProposalRequestGroup { + if o == nil { + var ret PatchedWritableIKEProposalRequestGroup + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetGroupOk() (*PatchedWritableIKEProposalRequestGroup, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *WritableIKEProposalRequest) SetGroup(v PatchedWritableIKEProposalRequestGroup) { + o.Group = v +} + +// GetSaLifetime returns the SaLifetime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIKEProposalRequest) GetSaLifetime() int32 { + if o == nil || IsNil(o.SaLifetime.Get()) { + var ret int32 + return ret + } + return *o.SaLifetime.Get() +} + +// GetSaLifetimeOk returns a tuple with the SaLifetime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIKEProposalRequest) GetSaLifetimeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetime.Get(), o.SaLifetime.IsSet() +} + +// HasSaLifetime returns a boolean if a field has been set. +func (o *WritableIKEProposalRequest) HasSaLifetime() bool { + if o != nil && o.SaLifetime.IsSet() { + return true + } + + return false +} + +// SetSaLifetime gets a reference to the given NullableInt32 and assigns it to the SaLifetime field. +func (o *WritableIKEProposalRequest) SetSaLifetime(v int32) { + o.SaLifetime.Set(&v) +} + +// SetSaLifetimeNil sets the value for SaLifetime to be an explicit nil +func (o *WritableIKEProposalRequest) SetSaLifetimeNil() { + o.SaLifetime.Set(nil) +} + +// UnsetSaLifetime ensures that no value is present for SaLifetime, not even an explicit nil +func (o *WritableIKEProposalRequest) UnsetSaLifetime() { + o.SaLifetime.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableIKEProposalRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableIKEProposalRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableIKEProposalRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableIKEProposalRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableIKEProposalRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableIKEProposalRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableIKEProposalRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIKEProposalRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableIKEProposalRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableIKEProposalRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableIKEProposalRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableIKEProposalRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["authentication_method"] = o.AuthenticationMethod + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + if !IsNil(o.AuthenticationAlgorithm) { + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + } + toSerialize["group"] = o.Group + if o.SaLifetime.IsSet() { + toSerialize["sa_lifetime"] = o.SaLifetime.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableIKEProposalRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authentication_method", + "encryption_algorithm", + "group", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableIKEProposalRequest := _WritableIKEProposalRequest{} + + err = json.Unmarshal(data, &varWritableIKEProposalRequest) + + if err != nil { + return err + } + + *o = WritableIKEProposalRequest(varWritableIKEProposalRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "authentication_method") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "group") + delete(additionalProperties, "sa_lifetime") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableIKEProposalRequest struct { + value *WritableIKEProposalRequest + isSet bool +} + +func (v NullableWritableIKEProposalRequest) Get() *WritableIKEProposalRequest { + return v.value +} + +func (v *NullableWritableIKEProposalRequest) Set(val *WritableIKEProposalRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableIKEProposalRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableIKEProposalRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableIKEProposalRequest(val *WritableIKEProposalRequest) *NullableWritableIKEProposalRequest { + return &NullableWritableIKEProposalRequest{value: val, isSet: true} +} + +func (v NullableWritableIKEProposalRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableIKEProposalRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_interface_request.go new file mode 100644 index 00000000..9ccffc59 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_interface_request.go @@ -0,0 +1,1448 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableInterfaceRequest{} + +// WritableInterfaceRequest Adds support for custom fields and tags. +type WritableInterfaceRequest struct { + Device int32 `json:"device"` + Vdcs []int32 `json:"vdcs"` + Module NullableInt32 `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type InterfaceTypeValue `json:"type"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Bridge NullableInt32 `json:"bridge,omitempty"` + Lag NullableInt32 `json:"lag,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Speed NullableInt32 `json:"speed,omitempty"` + Duplex NullableInterfaceRequestDuplex `json:"duplex,omitempty"` + Wwn NullableString `json:"wwn,omitempty"` + // This interface is used only for out-of-band management + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Mode *PatchedWritableInterfaceRequestMode `json:"mode,omitempty"` + RfRole *WirelessRole `json:"rf_role,omitempty"` + RfChannel *WirelessChannel `json:"rf_channel,omitempty"` + PoeMode *InterfacePoeModeValue `json:"poe_mode,omitempty"` + PoeType *InterfacePoeTypeValue `json:"poe_type,omitempty"` + // Populated by selected channel (if set) + RfChannelFrequency NullableFloat64 `json:"rf_channel_frequency,omitempty"` + // Populated by selected channel (if set) + RfChannelWidth NullableFloat64 `json:"rf_channel_width,omitempty"` + TxPower NullableInt32 `json:"tx_power,omitempty"` + UntaggedVlan NullableInt32 `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + WirelessLans []int32 `json:"wireless_lans,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableInterfaceRequest WritableInterfaceRequest + +// NewWritableInterfaceRequest instantiates a new WritableInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableInterfaceRequest(device int32, vdcs []int32, name string, type_ InterfaceTypeValue) *WritableInterfaceRequest { + this := WritableInterfaceRequest{} + this.Device = device + this.Vdcs = vdcs + this.Name = name + this.Type = type_ + return &this +} + +// NewWritableInterfaceRequestWithDefaults instantiates a new WritableInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableInterfaceRequestWithDefaults() *WritableInterfaceRequest { + this := WritableInterfaceRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableInterfaceRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableInterfaceRequest) SetDevice(v int32) { + o.Device = v +} + +// GetVdcs returns the Vdcs field value +func (o *WritableInterfaceRequest) GetVdcs() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Vdcs +} + +// GetVdcsOk returns a tuple with the Vdcs field value +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetVdcsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Vdcs, true +} + +// SetVdcs sets field value +func (o *WritableInterfaceRequest) SetVdcs(v []int32) { + o.Vdcs = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *WritableInterfaceRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *WritableInterfaceRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *WritableInterfaceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableInterfaceRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableInterfaceRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *WritableInterfaceRequest) GetType() InterfaceTypeValue { + if o == nil { + var ret InterfaceTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetTypeOk() (*InterfaceTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableInterfaceRequest) SetType(v InterfaceTypeValue) { + o.Type = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *WritableInterfaceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableInterfaceRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableInterfaceRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetBridge() int32 { + if o == nil || IsNil(o.Bridge.Get()) { + var ret int32 + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetBridgeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableInt32 and assigns it to the Bridge field. +func (o *WritableInterfaceRequest) SetBridge(v int32) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *WritableInterfaceRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetLag returns the Lag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetLag() int32 { + if o == nil || IsNil(o.Lag.Get()) { + var ret int32 + return ret + } + return *o.Lag.Get() +} + +// GetLagOk returns a tuple with the Lag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetLagOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Lag.Get(), o.Lag.IsSet() +} + +// HasLag returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasLag() bool { + if o != nil && o.Lag.IsSet() { + return true + } + + return false +} + +// SetLag gets a reference to the given NullableInt32 and assigns it to the Lag field. +func (o *WritableInterfaceRequest) SetLag(v int32) { + o.Lag.Set(&v) +} + +// SetLagNil sets the value for Lag to be an explicit nil +func (o *WritableInterfaceRequest) SetLagNil() { + o.Lag.Set(nil) +} + +// UnsetLag ensures that no value is present for Lag, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetLag() { + o.Lag.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *WritableInterfaceRequest) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *WritableInterfaceRequest) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *WritableInterfaceRequest) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *WritableInterfaceRequest) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetSpeed returns the Speed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetSpeed() int32 { + if o == nil || IsNil(o.Speed.Get()) { + var ret int32 + return ret + } + return *o.Speed.Get() +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetSpeedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Speed.Get(), o.Speed.IsSet() +} + +// HasSpeed returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasSpeed() bool { + if o != nil && o.Speed.IsSet() { + return true + } + + return false +} + +// SetSpeed gets a reference to the given NullableInt32 and assigns it to the Speed field. +func (o *WritableInterfaceRequest) SetSpeed(v int32) { + o.Speed.Set(&v) +} + +// SetSpeedNil sets the value for Speed to be an explicit nil +func (o *WritableInterfaceRequest) SetSpeedNil() { + o.Speed.Set(nil) +} + +// UnsetSpeed ensures that no value is present for Speed, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetSpeed() { + o.Speed.Unset() +} + +// GetDuplex returns the Duplex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetDuplex() InterfaceRequestDuplex { + if o == nil || IsNil(o.Duplex.Get()) { + var ret InterfaceRequestDuplex + return ret + } + return *o.Duplex.Get() +} + +// GetDuplexOk returns a tuple with the Duplex field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetDuplexOk() (*InterfaceRequestDuplex, bool) { + if o == nil { + return nil, false + } + return o.Duplex.Get(), o.Duplex.IsSet() +} + +// HasDuplex returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasDuplex() bool { + if o != nil && o.Duplex.IsSet() { + return true + } + + return false +} + +// SetDuplex gets a reference to the given NullableInterfaceRequestDuplex and assigns it to the Duplex field. +func (o *WritableInterfaceRequest) SetDuplex(v InterfaceRequestDuplex) { + o.Duplex.Set(&v) +} + +// SetDuplexNil sets the value for Duplex to be an explicit nil +func (o *WritableInterfaceRequest) SetDuplexNil() { + o.Duplex.Set(nil) +} + +// UnsetDuplex ensures that no value is present for Duplex, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetDuplex() { + o.Duplex.Unset() +} + +// GetWwn returns the Wwn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetWwn() string { + if o == nil || IsNil(o.Wwn.Get()) { + var ret string + return ret + } + return *o.Wwn.Get() +} + +// GetWwnOk returns a tuple with the Wwn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetWwnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Wwn.Get(), o.Wwn.IsSet() +} + +// HasWwn returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasWwn() bool { + if o != nil && o.Wwn.IsSet() { + return true + } + + return false +} + +// SetWwn gets a reference to the given NullableString and assigns it to the Wwn field. +func (o *WritableInterfaceRequest) SetWwn(v string) { + o.Wwn.Set(&v) +} + +// SetWwnNil sets the value for Wwn to be an explicit nil +func (o *WritableInterfaceRequest) SetWwnNil() { + o.Wwn.Set(nil) +} + +// UnsetWwn ensures that no value is present for Wwn, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetWwn() { + o.Wwn.Unset() +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *WritableInterfaceRequest) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableInterfaceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetMode() PatchedWritableInterfaceRequestMode { + if o == nil || IsNil(o.Mode) { + var ret PatchedWritableInterfaceRequestMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetModeOk() (*PatchedWritableInterfaceRequestMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given PatchedWritableInterfaceRequestMode and assigns it to the Mode field. +func (o *WritableInterfaceRequest) SetMode(v PatchedWritableInterfaceRequestMode) { + o.Mode = &v +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetRfRole() WirelessRole { + if o == nil || IsNil(o.RfRole) { + var ret WirelessRole + return ret + } + return *o.RfRole +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetRfRoleOk() (*WirelessRole, bool) { + if o == nil || IsNil(o.RfRole) { + return nil, false + } + return o.RfRole, true +} + +// HasRfRole returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasRfRole() bool { + if o != nil && !IsNil(o.RfRole) { + return true + } + + return false +} + +// SetRfRole gets a reference to the given WirelessRole and assigns it to the RfRole field. +func (o *WritableInterfaceRequest) SetRfRole(v WirelessRole) { + o.RfRole = &v +} + +// GetRfChannel returns the RfChannel field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetRfChannel() WirelessChannel { + if o == nil || IsNil(o.RfChannel) { + var ret WirelessChannel + return ret + } + return *o.RfChannel +} + +// GetRfChannelOk returns a tuple with the RfChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetRfChannelOk() (*WirelessChannel, bool) { + if o == nil || IsNil(o.RfChannel) { + return nil, false + } + return o.RfChannel, true +} + +// HasRfChannel returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasRfChannel() bool { + if o != nil && !IsNil(o.RfChannel) { + return true + } + + return false +} + +// SetRfChannel gets a reference to the given WirelessChannel and assigns it to the RfChannel field. +func (o *WritableInterfaceRequest) SetRfChannel(v WirelessChannel) { + o.RfChannel = &v +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetPoeMode() InterfacePoeModeValue { + if o == nil || IsNil(o.PoeMode) { + var ret InterfacePoeModeValue + return ret + } + return *o.PoeMode +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetPoeModeOk() (*InterfacePoeModeValue, bool) { + if o == nil || IsNil(o.PoeMode) { + return nil, false + } + return o.PoeMode, true +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasPoeMode() bool { + if o != nil && !IsNil(o.PoeMode) { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given InterfacePoeModeValue and assigns it to the PoeMode field. +func (o *WritableInterfaceRequest) SetPoeMode(v InterfacePoeModeValue) { + o.PoeMode = &v +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetPoeType() InterfacePoeTypeValue { + if o == nil || IsNil(o.PoeType) { + var ret InterfacePoeTypeValue + return ret + } + return *o.PoeType +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetPoeTypeOk() (*InterfacePoeTypeValue, bool) { + if o == nil || IsNil(o.PoeType) { + return nil, false + } + return o.PoeType, true +} + +// HasPoeType returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasPoeType() bool { + if o != nil && !IsNil(o.PoeType) { + return true + } + + return false +} + +// SetPoeType gets a reference to the given InterfacePoeTypeValue and assigns it to the PoeType field. +func (o *WritableInterfaceRequest) SetPoeType(v InterfacePoeTypeValue) { + o.PoeType = &v +} + +// GetRfChannelFrequency returns the RfChannelFrequency field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetRfChannelFrequency() float64 { + if o == nil || IsNil(o.RfChannelFrequency.Get()) { + var ret float64 + return ret + } + return *o.RfChannelFrequency.Get() +} + +// GetRfChannelFrequencyOk returns a tuple with the RfChannelFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetRfChannelFrequencyOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelFrequency.Get(), o.RfChannelFrequency.IsSet() +} + +// HasRfChannelFrequency returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasRfChannelFrequency() bool { + if o != nil && o.RfChannelFrequency.IsSet() { + return true + } + + return false +} + +// SetRfChannelFrequency gets a reference to the given NullableFloat64 and assigns it to the RfChannelFrequency field. +func (o *WritableInterfaceRequest) SetRfChannelFrequency(v float64) { + o.RfChannelFrequency.Set(&v) +} + +// SetRfChannelFrequencyNil sets the value for RfChannelFrequency to be an explicit nil +func (o *WritableInterfaceRequest) SetRfChannelFrequencyNil() { + o.RfChannelFrequency.Set(nil) +} + +// UnsetRfChannelFrequency ensures that no value is present for RfChannelFrequency, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetRfChannelFrequency() { + o.RfChannelFrequency.Unset() +} + +// GetRfChannelWidth returns the RfChannelWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetRfChannelWidth() float64 { + if o == nil || IsNil(o.RfChannelWidth.Get()) { + var ret float64 + return ret + } + return *o.RfChannelWidth.Get() +} + +// GetRfChannelWidthOk returns a tuple with the RfChannelWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetRfChannelWidthOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RfChannelWidth.Get(), o.RfChannelWidth.IsSet() +} + +// HasRfChannelWidth returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasRfChannelWidth() bool { + if o != nil && o.RfChannelWidth.IsSet() { + return true + } + + return false +} + +// SetRfChannelWidth gets a reference to the given NullableFloat64 and assigns it to the RfChannelWidth field. +func (o *WritableInterfaceRequest) SetRfChannelWidth(v float64) { + o.RfChannelWidth.Set(&v) +} + +// SetRfChannelWidthNil sets the value for RfChannelWidth to be an explicit nil +func (o *WritableInterfaceRequest) SetRfChannelWidthNil() { + o.RfChannelWidth.Set(nil) +} + +// UnsetRfChannelWidth ensures that no value is present for RfChannelWidth, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetRfChannelWidth() { + o.RfChannelWidth.Unset() +} + +// GetTxPower returns the TxPower field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetTxPower() int32 { + if o == nil || IsNil(o.TxPower.Get()) { + var ret int32 + return ret + } + return *o.TxPower.Get() +} + +// GetTxPowerOk returns a tuple with the TxPower field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetTxPowerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.TxPower.Get(), o.TxPower.IsSet() +} + +// HasTxPower returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasTxPower() bool { + if o != nil && o.TxPower.IsSet() { + return true + } + + return false +} + +// SetTxPower gets a reference to the given NullableInt32 and assigns it to the TxPower field. +func (o *WritableInterfaceRequest) SetTxPower(v int32) { + o.TxPower.Set(&v) +} + +// SetTxPowerNil sets the value for TxPower to be an explicit nil +func (o *WritableInterfaceRequest) SetTxPowerNil() { + o.TxPower.Set(nil) +} + +// UnsetTxPower ensures that no value is present for TxPower, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetTxPower() { + o.TxPower.Unset() +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetUntaggedVlan() int32 { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret int32 + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetUntaggedVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableInt32 and assigns it to the UntaggedVlan field. +func (o *WritableInterfaceRequest) SetUntaggedVlan(v int32) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *WritableInterfaceRequest) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *WritableInterfaceRequest) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritableInterfaceRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetWirelessLans returns the WirelessLans field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetWirelessLans() []int32 { + if o == nil || IsNil(o.WirelessLans) { + var ret []int32 + return ret + } + return o.WirelessLans +} + +// GetWirelessLansOk returns a tuple with the WirelessLans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetWirelessLansOk() ([]int32, bool) { + if o == nil || IsNil(o.WirelessLans) { + return nil, false + } + return o.WirelessLans, true +} + +// HasWirelessLans returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasWirelessLans() bool { + if o != nil && !IsNil(o.WirelessLans) { + return true + } + + return false +} + +// SetWirelessLans gets a reference to the given []int32 and assigns it to the WirelessLans field. +func (o *WritableInterfaceRequest) SetWirelessLans(v []int32) { + o.WirelessLans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *WritableInterfaceRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *WritableInterfaceRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *WritableInterfaceRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableInterfaceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableInterfaceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableInterfaceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableInterfaceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["vdcs"] = o.Vdcs + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Lag.IsSet() { + toSerialize["lag"] = o.Lag.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if o.Speed.IsSet() { + toSerialize["speed"] = o.Speed.Get() + } + if o.Duplex.IsSet() { + toSerialize["duplex"] = o.Duplex.Get() + } + if o.Wwn.IsSet() { + toSerialize["wwn"] = o.Wwn.Get() + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.RfRole) { + toSerialize["rf_role"] = o.RfRole + } + if !IsNil(o.RfChannel) { + toSerialize["rf_channel"] = o.RfChannel + } + if !IsNil(o.PoeMode) { + toSerialize["poe_mode"] = o.PoeMode + } + if !IsNil(o.PoeType) { + toSerialize["poe_type"] = o.PoeType + } + if o.RfChannelFrequency.IsSet() { + toSerialize["rf_channel_frequency"] = o.RfChannelFrequency.Get() + } + if o.RfChannelWidth.IsSet() { + toSerialize["rf_channel_width"] = o.RfChannelWidth.Get() + } + if o.TxPower.IsSet() { + toSerialize["tx_power"] = o.TxPower.Get() + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.WirelessLans) { + toSerialize["wireless_lans"] = o.WirelessLans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "vdcs", + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableInterfaceRequest := _WritableInterfaceRequest{} + + err = json.Unmarshal(data, &varWritableInterfaceRequest) + + if err != nil { + return err + } + + *o = WritableInterfaceRequest(varWritableInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "vdcs") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "lag") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "speed") + delete(additionalProperties, "duplex") + delete(additionalProperties, "wwn") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "rf_role") + delete(additionalProperties, "rf_channel") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_channel_frequency") + delete(additionalProperties, "rf_channel_width") + delete(additionalProperties, "tx_power") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "wireless_lans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableInterfaceRequest struct { + value *WritableInterfaceRequest + isSet bool +} + +func (v NullableWritableInterfaceRequest) Get() *WritableInterfaceRequest { + return v.value +} + +func (v *NullableWritableInterfaceRequest) Set(val *WritableInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableInterfaceRequest(val *WritableInterfaceRequest) *NullableWritableInterfaceRequest { + return &NullableWritableInterfaceRequest{value: val, isSet: true} +} + +func (v NullableWritableInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_interface_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_interface_template_request.go new file mode 100644 index 00000000..8463ed50 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_interface_template_request.go @@ -0,0 +1,600 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableInterfaceTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableInterfaceTemplateRequest{} + +// WritableInterfaceTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableInterfaceTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type InterfaceTypeValue `json:"type"` + Enabled *bool `json:"enabled,omitempty"` + MgmtOnly *bool `json:"mgmt_only,omitempty"` + Description *string `json:"description,omitempty"` + Bridge NullableInt32 `json:"bridge,omitempty"` + PoeMode *InterfacePoeModeValue `json:"poe_mode,omitempty"` + PoeType *InterfacePoeTypeValue `json:"poe_type,omitempty"` + RfRole *WirelessRole `json:"rf_role,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableInterfaceTemplateRequest WritableInterfaceTemplateRequest + +// NewWritableInterfaceTemplateRequest instantiates a new WritableInterfaceTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableInterfaceTemplateRequest(name string, type_ InterfaceTypeValue) *WritableInterfaceTemplateRequest { + this := WritableInterfaceTemplateRequest{} + this.Name = name + this.Type = type_ + return &this +} + +// NewWritableInterfaceTemplateRequestWithDefaults instantiates a new WritableInterfaceTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableInterfaceTemplateRequestWithDefaults() *WritableInterfaceTemplateRequest { + this := WritableInterfaceTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *WritableInterfaceTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *WritableInterfaceTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *WritableInterfaceTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *WritableInterfaceTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *WritableInterfaceTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *WritableInterfaceTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *WritableInterfaceTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableInterfaceTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableInterfaceTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableInterfaceTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *WritableInterfaceTemplateRequest) GetType() InterfaceTypeValue { + if o == nil { + var ret InterfaceTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetTypeOk() (*InterfaceTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableInterfaceTemplateRequest) SetType(v InterfaceTypeValue) { + o.Type = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *WritableInterfaceTemplateRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *WritableInterfaceTemplateRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetMgmtOnly returns the MgmtOnly field value if set, zero value otherwise. +func (o *WritableInterfaceTemplateRequest) GetMgmtOnly() bool { + if o == nil || IsNil(o.MgmtOnly) { + var ret bool + return ret + } + return *o.MgmtOnly +} + +// GetMgmtOnlyOk returns a tuple with the MgmtOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetMgmtOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.MgmtOnly) { + return nil, false + } + return o.MgmtOnly, true +} + +// HasMgmtOnly returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasMgmtOnly() bool { + if o != nil && !IsNil(o.MgmtOnly) { + return true + } + + return false +} + +// SetMgmtOnly gets a reference to the given bool and assigns it to the MgmtOnly field. +func (o *WritableInterfaceTemplateRequest) SetMgmtOnly(v bool) { + o.MgmtOnly = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableInterfaceTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableInterfaceTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInterfaceTemplateRequest) GetBridge() int32 { + if o == nil || IsNil(o.Bridge.Get()) { + var ret int32 + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInterfaceTemplateRequest) GetBridgeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableInt32 and assigns it to the Bridge field. +func (o *WritableInterfaceTemplateRequest) SetBridge(v int32) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *WritableInterfaceTemplateRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *WritableInterfaceTemplateRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetPoeMode returns the PoeMode field value if set, zero value otherwise. +func (o *WritableInterfaceTemplateRequest) GetPoeMode() InterfacePoeModeValue { + if o == nil || IsNil(o.PoeMode) { + var ret InterfacePoeModeValue + return ret + } + return *o.PoeMode +} + +// GetPoeModeOk returns a tuple with the PoeMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetPoeModeOk() (*InterfacePoeModeValue, bool) { + if o == nil || IsNil(o.PoeMode) { + return nil, false + } + return o.PoeMode, true +} + +// HasPoeMode returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasPoeMode() bool { + if o != nil && !IsNil(o.PoeMode) { + return true + } + + return false +} + +// SetPoeMode gets a reference to the given InterfacePoeModeValue and assigns it to the PoeMode field. +func (o *WritableInterfaceTemplateRequest) SetPoeMode(v InterfacePoeModeValue) { + o.PoeMode = &v +} + +// GetPoeType returns the PoeType field value if set, zero value otherwise. +func (o *WritableInterfaceTemplateRequest) GetPoeType() InterfacePoeTypeValue { + if o == nil || IsNil(o.PoeType) { + var ret InterfacePoeTypeValue + return ret + } + return *o.PoeType +} + +// GetPoeTypeOk returns a tuple with the PoeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetPoeTypeOk() (*InterfacePoeTypeValue, bool) { + if o == nil || IsNil(o.PoeType) { + return nil, false + } + return o.PoeType, true +} + +// HasPoeType returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasPoeType() bool { + if o != nil && !IsNil(o.PoeType) { + return true + } + + return false +} + +// SetPoeType gets a reference to the given InterfacePoeTypeValue and assigns it to the PoeType field. +func (o *WritableInterfaceTemplateRequest) SetPoeType(v InterfacePoeTypeValue) { + o.PoeType = &v +} + +// GetRfRole returns the RfRole field value if set, zero value otherwise. +func (o *WritableInterfaceTemplateRequest) GetRfRole() WirelessRole { + if o == nil || IsNil(o.RfRole) { + var ret WirelessRole + return ret + } + return *o.RfRole +} + +// GetRfRoleOk returns a tuple with the RfRole field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInterfaceTemplateRequest) GetRfRoleOk() (*WirelessRole, bool) { + if o == nil || IsNil(o.RfRole) { + return nil, false + } + return o.RfRole, true +} + +// HasRfRole returns a boolean if a field has been set. +func (o *WritableInterfaceTemplateRequest) HasRfRole() bool { + if o != nil && !IsNil(o.RfRole) { + return true + } + + return false +} + +// SetRfRole gets a reference to the given WirelessRole and assigns it to the RfRole field. +func (o *WritableInterfaceTemplateRequest) SetRfRole(v WirelessRole) { + o.RfRole = &v +} + +func (o WritableInterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableInterfaceTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.MgmtOnly) { + toSerialize["mgmt_only"] = o.MgmtOnly + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if !IsNil(o.PoeMode) { + toSerialize["poe_mode"] = o.PoeMode + } + if !IsNil(o.PoeType) { + toSerialize["poe_type"] = o.PoeType + } + if !IsNil(o.RfRole) { + toSerialize["rf_role"] = o.RfRole + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableInterfaceTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableInterfaceTemplateRequest := _WritableInterfaceTemplateRequest{} + + err = json.Unmarshal(data, &varWritableInterfaceTemplateRequest) + + if err != nil { + return err + } + + *o = WritableInterfaceTemplateRequest(varWritableInterfaceTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "enabled") + delete(additionalProperties, "mgmt_only") + delete(additionalProperties, "description") + delete(additionalProperties, "bridge") + delete(additionalProperties, "poe_mode") + delete(additionalProperties, "poe_type") + delete(additionalProperties, "rf_role") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableInterfaceTemplateRequest struct { + value *WritableInterfaceTemplateRequest + isSet bool +} + +func (v NullableWritableInterfaceTemplateRequest) Get() *WritableInterfaceTemplateRequest { + return v.value +} + +func (v *NullableWritableInterfaceTemplateRequest) Set(val *WritableInterfaceTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableInterfaceTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableInterfaceTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableInterfaceTemplateRequest(val *WritableInterfaceTemplateRequest) *NullableWritableInterfaceTemplateRequest { + return &NullableWritableInterfaceTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableInterfaceTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableInterfaceTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_inventory_item_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_inventory_item_request.go new file mode 100644 index 00000000..39e9f9f7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_inventory_item_request.go @@ -0,0 +1,746 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableInventoryItemRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableInventoryItemRequest{} + +// WritableInventoryItemRequest Adds support for custom fields and tags. +type WritableInventoryItemRequest struct { + Device int32 `json:"device"` + Parent NullableInt32 `json:"parent,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableInt32 `json:"role,omitempty"` + Manufacturer NullableInt32 `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this item + AssetTag NullableString `json:"asset_tag,omitempty"` + // This item was automatically discovered + Discovered *bool `json:"discovered,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableInventoryItemRequest WritableInventoryItemRequest + +// NewWritableInventoryItemRequest instantiates a new WritableInventoryItemRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableInventoryItemRequest(device int32, name string) *WritableInventoryItemRequest { + this := WritableInventoryItemRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewWritableInventoryItemRequestWithDefaults instantiates a new WritableInventoryItemRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableInventoryItemRequestWithDefaults() *WritableInventoryItemRequest { + this := WritableInventoryItemRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableInventoryItemRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableInventoryItemRequest) SetDevice(v int32) { + o.Device = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableInventoryItemRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableInventoryItemRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableInventoryItemRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value +func (o *WritableInventoryItemRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableInventoryItemRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableInventoryItemRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableInventoryItemRequest) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *WritableInventoryItemRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *WritableInventoryItemRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *WritableInventoryItemRequest) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret int32 + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableInt32 and assigns it to the Manufacturer field. +func (o *WritableInventoryItemRequest) SetManufacturer(v int32) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *WritableInventoryItemRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *WritableInventoryItemRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *WritableInventoryItemRequest) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *WritableInventoryItemRequest) SetPartId(v string) { + o.PartId = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *WritableInventoryItemRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *WritableInventoryItemRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *WritableInventoryItemRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *WritableInventoryItemRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *WritableInventoryItemRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDiscovered returns the Discovered field value if set, zero value otherwise. +func (o *WritableInventoryItemRequest) GetDiscovered() bool { + if o == nil || IsNil(o.Discovered) { + var ret bool + return ret + } + return *o.Discovered +} + +// GetDiscoveredOk returns a tuple with the Discovered field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetDiscoveredOk() (*bool, bool) { + if o == nil || IsNil(o.Discovered) { + return nil, false + } + return o.Discovered, true +} + +// HasDiscovered returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasDiscovered() bool { + if o != nil && !IsNil(o.Discovered) { + return true + } + + return false +} + +// SetDiscovered gets a reference to the given bool and assigns it to the Discovered field. +func (o *WritableInventoryItemRequest) SetDiscovered(v bool) { + o.Discovered = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableInventoryItemRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableInventoryItemRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemRequest) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemRequest) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *WritableInventoryItemRequest) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *WritableInventoryItemRequest) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *WritableInventoryItemRequest) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemRequest) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemRequest) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *WritableInventoryItemRequest) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *WritableInventoryItemRequest) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *WritableInventoryItemRequest) UnsetComponentId() { + o.ComponentId.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableInventoryItemRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableInventoryItemRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableInventoryItemRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableInventoryItemRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableInventoryItemRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableInventoryItemRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableInventoryItemRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Discovered) { + toSerialize["discovered"] = o.Discovered + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableInventoryItemRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableInventoryItemRequest := _WritableInventoryItemRequest{} + + err = json.Unmarshal(data, &varWritableInventoryItemRequest) + + if err != nil { + return err + } + + *o = WritableInventoryItemRequest(varWritableInventoryItemRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "discovered") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableInventoryItemRequest struct { + value *WritableInventoryItemRequest + isSet bool +} + +func (v NullableWritableInventoryItemRequest) Get() *WritableInventoryItemRequest { + return v.value +} + +func (v *NullableWritableInventoryItemRequest) Set(val *WritableInventoryItemRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableInventoryItemRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableInventoryItemRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableInventoryItemRequest(val *WritableInventoryItemRequest) *NullableWritableInventoryItemRequest { + return &NullableWritableInventoryItemRequest{value: val, isSet: true} +} + +func (v NullableWritableInventoryItemRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableInventoryItemRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_inventory_item_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_inventory_item_template_request.go new file mode 100644 index 00000000..5f45ed73 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_inventory_item_template_request.go @@ -0,0 +1,549 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableInventoryItemTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableInventoryItemTemplateRequest{} + +// WritableInventoryItemTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableInventoryItemTemplateRequest struct { + DeviceType int32 `json:"device_type"` + Parent NullableInt32 `json:"parent,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Role NullableInt32 `json:"role,omitempty"` + Manufacturer NullableInt32 `json:"manufacturer,omitempty"` + // Manufacturer-assigned part identifier + PartId *string `json:"part_id,omitempty"` + Description *string `json:"description,omitempty"` + ComponentType NullableString `json:"component_type,omitempty"` + ComponentId NullableInt64 `json:"component_id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableInventoryItemTemplateRequest WritableInventoryItemTemplateRequest + +// NewWritableInventoryItemTemplateRequest instantiates a new WritableInventoryItemTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableInventoryItemTemplateRequest(deviceType int32, name string) *WritableInventoryItemTemplateRequest { + this := WritableInventoryItemTemplateRequest{} + this.DeviceType = deviceType + this.Name = name + return &this +} + +// NewWritableInventoryItemTemplateRequestWithDefaults instantiates a new WritableInventoryItemTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableInventoryItemTemplateRequestWithDefaults() *WritableInventoryItemTemplateRequest { + this := WritableInventoryItemTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value +func (o *WritableInventoryItemTemplateRequest) GetDeviceType() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *WritableInventoryItemTemplateRequest) SetDeviceType(v int32) { + o.DeviceType = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemTemplateRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemTemplateRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableInventoryItemTemplateRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableInventoryItemTemplateRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableInventoryItemTemplateRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetName returns the Name field value +func (o *WritableInventoryItemTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableInventoryItemTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableInventoryItemTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableInventoryItemTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemTemplateRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemTemplateRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *WritableInventoryItemTemplateRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *WritableInventoryItemTemplateRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *WritableInventoryItemTemplateRequest) UnsetRole() { + o.Role.Unset() +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemTemplateRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret int32 + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemTemplateRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableInt32 and assigns it to the Manufacturer field. +func (o *WritableInventoryItemTemplateRequest) SetManufacturer(v int32) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *WritableInventoryItemTemplateRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *WritableInventoryItemTemplateRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetPartId returns the PartId field value if set, zero value otherwise. +func (o *WritableInventoryItemTemplateRequest) GetPartId() string { + if o == nil || IsNil(o.PartId) { + var ret string + return ret + } + return *o.PartId +} + +// GetPartIdOk returns a tuple with the PartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemTemplateRequest) GetPartIdOk() (*string, bool) { + if o == nil || IsNil(o.PartId) { + return nil, false + } + return o.PartId, true +} + +// HasPartId returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasPartId() bool { + if o != nil && !IsNil(o.PartId) { + return true + } + + return false +} + +// SetPartId gets a reference to the given string and assigns it to the PartId field. +func (o *WritableInventoryItemTemplateRequest) SetPartId(v string) { + o.PartId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableInventoryItemTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableInventoryItemTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableInventoryItemTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComponentType returns the ComponentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemTemplateRequest) GetComponentType() string { + if o == nil || IsNil(o.ComponentType.Get()) { + var ret string + return ret + } + return *o.ComponentType.Get() +} + +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemTemplateRequest) GetComponentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ComponentType.Get(), o.ComponentType.IsSet() +} + +// HasComponentType returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasComponentType() bool { + if o != nil && o.ComponentType.IsSet() { + return true + } + + return false +} + +// SetComponentType gets a reference to the given NullableString and assigns it to the ComponentType field. +func (o *WritableInventoryItemTemplateRequest) SetComponentType(v string) { + o.ComponentType.Set(&v) +} + +// SetComponentTypeNil sets the value for ComponentType to be an explicit nil +func (o *WritableInventoryItemTemplateRequest) SetComponentTypeNil() { + o.ComponentType.Set(nil) +} + +// UnsetComponentType ensures that no value is present for ComponentType, not even an explicit nil +func (o *WritableInventoryItemTemplateRequest) UnsetComponentType() { + o.ComponentType.Unset() +} + +// GetComponentId returns the ComponentId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableInventoryItemTemplateRequest) GetComponentId() int64 { + if o == nil || IsNil(o.ComponentId.Get()) { + var ret int64 + return ret + } + return *o.ComponentId.Get() +} + +// GetComponentIdOk returns a tuple with the ComponentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableInventoryItemTemplateRequest) GetComponentIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.ComponentId.Get(), o.ComponentId.IsSet() +} + +// HasComponentId returns a boolean if a field has been set. +func (o *WritableInventoryItemTemplateRequest) HasComponentId() bool { + if o != nil && o.ComponentId.IsSet() { + return true + } + + return false +} + +// SetComponentId gets a reference to the given NullableInt64 and assigns it to the ComponentId field. +func (o *WritableInventoryItemTemplateRequest) SetComponentId(v int64) { + o.ComponentId.Set(&v) +} + +// SetComponentIdNil sets the value for ComponentId to be an explicit nil +func (o *WritableInventoryItemTemplateRequest) SetComponentIdNil() { + o.ComponentId.Set(nil) +} + +// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil +func (o *WritableInventoryItemTemplateRequest) UnsetComponentId() { + o.ComponentId.Unset() +} + +func (o WritableInventoryItemTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableInventoryItemTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_type"] = o.DeviceType + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if !IsNil(o.PartId) { + toSerialize["part_id"] = o.PartId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.ComponentType.IsSet() { + toSerialize["component_type"] = o.ComponentType.Get() + } + if o.ComponentId.IsSet() { + toSerialize["component_id"] = o.ComponentId.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableInventoryItemTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableInventoryItemTemplateRequest := _WritableInventoryItemTemplateRequest{} + + err = json.Unmarshal(data, &varWritableInventoryItemTemplateRequest) + + if err != nil { + return err + } + + *o = WritableInventoryItemTemplateRequest(varWritableInventoryItemTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "parent") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "part_id") + delete(additionalProperties, "description") + delete(additionalProperties, "component_type") + delete(additionalProperties, "component_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableInventoryItemTemplateRequest struct { + value *WritableInventoryItemTemplateRequest + isSet bool +} + +func (v NullableWritableInventoryItemTemplateRequest) Get() *WritableInventoryItemTemplateRequest { + return v.value +} + +func (v *NullableWritableInventoryItemTemplateRequest) Set(val *WritableInventoryItemTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableInventoryItemTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableInventoryItemTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableInventoryItemTemplateRequest(val *WritableInventoryItemTemplateRequest) *NullableWritableInventoryItemTemplateRequest { + return &NullableWritableInventoryItemTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableInventoryItemTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableInventoryItemTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_address_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_address_request.go new file mode 100644 index 00000000..2858a625 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_address_request.go @@ -0,0 +1,667 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableIPAddressRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableIPAddressRequest{} + +// WritableIPAddressRequest Adds support for custom fields and tags. +type WritableIPAddressRequest struct { + Address string `json:"address"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableIPAddressRequestStatus `json:"status,omitempty"` + Role *PatchedWritableIPAddressRequestRole `json:"role,omitempty"` + AssignedObjectType NullableString `json:"assigned_object_type,omitempty"` + AssignedObjectId NullableInt64 `json:"assigned_object_id,omitempty"` + // The IP for which this address is the \"outside\" IP + NatInside NullableInt32 `json:"nat_inside,omitempty"` + // Hostname or FQDN (not case-sensitive) + DnsName *string `json:"dns_name,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableIPAddressRequest WritableIPAddressRequest + +// NewWritableIPAddressRequest instantiates a new WritableIPAddressRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableIPAddressRequest(address string) *WritableIPAddressRequest { + this := WritableIPAddressRequest{} + this.Address = address + return &this +} + +// NewWritableIPAddressRequestWithDefaults instantiates a new WritableIPAddressRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableIPAddressRequestWithDefaults() *WritableIPAddressRequest { + this := WritableIPAddressRequest{} + return &this +} + +// GetAddress returns the Address field value +func (o *WritableIPAddressRequest) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *WritableIPAddressRequest) SetAddress(v string) { + o.Address = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPAddressRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPAddressRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *WritableIPAddressRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *WritableIPAddressRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *WritableIPAddressRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPAddressRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPAddressRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableIPAddressRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableIPAddressRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableIPAddressRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableIPAddressRequest) GetStatus() PatchedWritableIPAddressRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableIPAddressRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetStatusOk() (*PatchedWritableIPAddressRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableIPAddressRequestStatus and assigns it to the Status field. +func (o *WritableIPAddressRequest) SetStatus(v PatchedWritableIPAddressRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *WritableIPAddressRequest) GetRole() PatchedWritableIPAddressRequestRole { + if o == nil || IsNil(o.Role) { + var ret PatchedWritableIPAddressRequestRole + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetRoleOk() (*PatchedWritableIPAddressRequestRole, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given PatchedWritableIPAddressRequestRole and assigns it to the Role field. +func (o *WritableIPAddressRequest) SetRole(v PatchedWritableIPAddressRequestRole) { + o.Role = &v +} + +// GetAssignedObjectType returns the AssignedObjectType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPAddressRequest) GetAssignedObjectType() string { + if o == nil || IsNil(o.AssignedObjectType.Get()) { + var ret string + return ret + } + return *o.AssignedObjectType.Get() +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPAddressRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectType.Get(), o.AssignedObjectType.IsSet() +} + +// HasAssignedObjectType returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasAssignedObjectType() bool { + if o != nil && o.AssignedObjectType.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectType gets a reference to the given NullableString and assigns it to the AssignedObjectType field. +func (o *WritableIPAddressRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType.Set(&v) +} + +// SetAssignedObjectTypeNil sets the value for AssignedObjectType to be an explicit nil +func (o *WritableIPAddressRequest) SetAssignedObjectTypeNil() { + o.AssignedObjectType.Set(nil) +} + +// UnsetAssignedObjectType ensures that no value is present for AssignedObjectType, not even an explicit nil +func (o *WritableIPAddressRequest) UnsetAssignedObjectType() { + o.AssignedObjectType.Unset() +} + +// GetAssignedObjectId returns the AssignedObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPAddressRequest) GetAssignedObjectId() int64 { + if o == nil || IsNil(o.AssignedObjectId.Get()) { + var ret int64 + return ret + } + return *o.AssignedObjectId.Get() +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPAddressRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.AssignedObjectId.Get(), o.AssignedObjectId.IsSet() +} + +// HasAssignedObjectId returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasAssignedObjectId() bool { + if o != nil && o.AssignedObjectId.IsSet() { + return true + } + + return false +} + +// SetAssignedObjectId gets a reference to the given NullableInt64 and assigns it to the AssignedObjectId field. +func (o *WritableIPAddressRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId.Set(&v) +} + +// SetAssignedObjectIdNil sets the value for AssignedObjectId to be an explicit nil +func (o *WritableIPAddressRequest) SetAssignedObjectIdNil() { + o.AssignedObjectId.Set(nil) +} + +// UnsetAssignedObjectId ensures that no value is present for AssignedObjectId, not even an explicit nil +func (o *WritableIPAddressRequest) UnsetAssignedObjectId() { + o.AssignedObjectId.Unset() +} + +// GetNatInside returns the NatInside field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPAddressRequest) GetNatInside() int32 { + if o == nil || IsNil(o.NatInside.Get()) { + var ret int32 + return ret + } + return *o.NatInside.Get() +} + +// GetNatInsideOk returns a tuple with the NatInside field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPAddressRequest) GetNatInsideOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.NatInside.Get(), o.NatInside.IsSet() +} + +// HasNatInside returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasNatInside() bool { + if o != nil && o.NatInside.IsSet() { + return true + } + + return false +} + +// SetNatInside gets a reference to the given NullableInt32 and assigns it to the NatInside field. +func (o *WritableIPAddressRequest) SetNatInside(v int32) { + o.NatInside.Set(&v) +} + +// SetNatInsideNil sets the value for NatInside to be an explicit nil +func (o *WritableIPAddressRequest) SetNatInsideNil() { + o.NatInside.Set(nil) +} + +// UnsetNatInside ensures that no value is present for NatInside, not even an explicit nil +func (o *WritableIPAddressRequest) UnsetNatInside() { + o.NatInside.Unset() +} + +// GetDnsName returns the DnsName field value if set, zero value otherwise. +func (o *WritableIPAddressRequest) GetDnsName() string { + if o == nil || IsNil(o.DnsName) { + var ret string + return ret + } + return *o.DnsName +} + +// GetDnsNameOk returns a tuple with the DnsName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetDnsNameOk() (*string, bool) { + if o == nil || IsNil(o.DnsName) { + return nil, false + } + return o.DnsName, true +} + +// HasDnsName returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasDnsName() bool { + if o != nil && !IsNil(o.DnsName) { + return true + } + + return false +} + +// SetDnsName gets a reference to the given string and assigns it to the DnsName field. +func (o *WritableIPAddressRequest) SetDnsName(v string) { + o.DnsName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableIPAddressRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableIPAddressRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableIPAddressRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableIPAddressRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableIPAddressRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableIPAddressRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableIPAddressRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPAddressRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableIPAddressRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableIPAddressRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableIPAddressRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableIPAddressRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if o.AssignedObjectType.IsSet() { + toSerialize["assigned_object_type"] = o.AssignedObjectType.Get() + } + if o.AssignedObjectId.IsSet() { + toSerialize["assigned_object_id"] = o.AssignedObjectId.Get() + } + if o.NatInside.IsSet() { + toSerialize["nat_inside"] = o.NatInside.Get() + } + if !IsNil(o.DnsName) { + toSerialize["dns_name"] = o.DnsName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableIPAddressRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableIPAddressRequest := _WritableIPAddressRequest{} + + err = json.Unmarshal(data, &varWritableIPAddressRequest) + + if err != nil { + return err + } + + *o = WritableIPAddressRequest(varWritableIPAddressRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "nat_inside") + delete(additionalProperties, "dns_name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableIPAddressRequest struct { + value *WritableIPAddressRequest + isSet bool +} + +func (v NullableWritableIPAddressRequest) Get() *WritableIPAddressRequest { + return v.value +} + +func (v *NullableWritableIPAddressRequest) Set(val *WritableIPAddressRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableIPAddressRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableIPAddressRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableIPAddressRequest(val *WritableIPAddressRequest) *NullableWritableIPAddressRequest { + return &NullableWritableIPAddressRequest{value: val, isSet: true} +} + +func (v NullableWritableIPAddressRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableIPAddressRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_range_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_range_request.go new file mode 100644 index 00000000..0b24eacb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_range_request.go @@ -0,0 +1,563 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableIPRangeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableIPRangeRequest{} + +// WritableIPRangeRequest Adds support for custom fields and tags. +type WritableIPRangeRequest struct { + StartAddress string `json:"start_address"` + EndAddress string `json:"end_address"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableIPRangeRequestStatus `json:"status,omitempty"` + // The primary function of this range + Role NullableInt32 `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableIPRangeRequest WritableIPRangeRequest + +// NewWritableIPRangeRequest instantiates a new WritableIPRangeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableIPRangeRequest(startAddress string, endAddress string) *WritableIPRangeRequest { + this := WritableIPRangeRequest{} + this.StartAddress = startAddress + this.EndAddress = endAddress + return &this +} + +// NewWritableIPRangeRequestWithDefaults instantiates a new WritableIPRangeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableIPRangeRequestWithDefaults() *WritableIPRangeRequest { + this := WritableIPRangeRequest{} + return &this +} + +// GetStartAddress returns the StartAddress field value +func (o *WritableIPRangeRequest) GetStartAddress() string { + if o == nil { + var ret string + return ret + } + + return o.StartAddress +} + +// GetStartAddressOk returns a tuple with the StartAddress field value +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetStartAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartAddress, true +} + +// SetStartAddress sets field value +func (o *WritableIPRangeRequest) SetStartAddress(v string) { + o.StartAddress = v +} + +// GetEndAddress returns the EndAddress field value +func (o *WritableIPRangeRequest) GetEndAddress() string { + if o == nil { + var ret string + return ret + } + + return o.EndAddress +} + +// GetEndAddressOk returns a tuple with the EndAddress field value +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetEndAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndAddress, true +} + +// SetEndAddress sets field value +func (o *WritableIPRangeRequest) SetEndAddress(v string) { + o.EndAddress = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPRangeRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPRangeRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *WritableIPRangeRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *WritableIPRangeRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *WritableIPRangeRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPRangeRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPRangeRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableIPRangeRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableIPRangeRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableIPRangeRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableIPRangeRequest) GetStatus() PatchedWritableIPRangeRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableIPRangeRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetStatusOk() (*PatchedWritableIPRangeRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableIPRangeRequestStatus and assigns it to the Status field. +func (o *WritableIPRangeRequest) SetStatus(v PatchedWritableIPRangeRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPRangeRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPRangeRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *WritableIPRangeRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *WritableIPRangeRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *WritableIPRangeRequest) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableIPRangeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableIPRangeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableIPRangeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableIPRangeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableIPRangeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableIPRangeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableIPRangeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableIPRangeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *WritableIPRangeRequest) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPRangeRequest) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *WritableIPRangeRequest) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *WritableIPRangeRequest) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +func (o WritableIPRangeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableIPRangeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["start_address"] = o.StartAddress + toSerialize["end_address"] = o.EndAddress + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableIPRangeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "start_address", + "end_address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableIPRangeRequest := _WritableIPRangeRequest{} + + err = json.Unmarshal(data, &varWritableIPRangeRequest) + + if err != nil { + return err + } + + *o = WritableIPRangeRequest(varWritableIPRangeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "start_address") + delete(additionalProperties, "end_address") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + delete(additionalProperties, "mark_utilized") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableIPRangeRequest struct { + value *WritableIPRangeRequest + isSet bool +} + +func (v NullableWritableIPRangeRequest) Get() *WritableIPRangeRequest { + return v.value +} + +func (v *NullableWritableIPRangeRequest) Set(val *WritableIPRangeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableIPRangeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableIPRangeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableIPRangeRequest(val *WritableIPRangeRequest) *NullableWritableIPRangeRequest { + return &NullableWritableIPRangeRequest{value: val, isSet: true} +} + +func (v NullableWritableIPRangeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableIPRangeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_policy_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_policy_request.go new file mode 100644 index 00000000..799e5296 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_policy_request.go @@ -0,0 +1,391 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableIPSecPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableIPSecPolicyRequest{} + +// WritableIPSecPolicyRequest Adds support for custom fields and tags. +type WritableIPSecPolicyRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Proposals []int32 `json:"proposals"` + PfsGroup NullablePatchedWritableIPSecPolicyRequestPfsGroup `json:"pfs_group,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableIPSecPolicyRequest WritableIPSecPolicyRequest + +// NewWritableIPSecPolicyRequest instantiates a new WritableIPSecPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableIPSecPolicyRequest(name string, proposals []int32) *WritableIPSecPolicyRequest { + this := WritableIPSecPolicyRequest{} + this.Name = name + this.Proposals = proposals + return &this +} + +// NewWritableIPSecPolicyRequestWithDefaults instantiates a new WritableIPSecPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableIPSecPolicyRequestWithDefaults() *WritableIPSecPolicyRequest { + this := WritableIPSecPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableIPSecPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableIPSecPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableIPSecPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableIPSecPolicyRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecPolicyRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableIPSecPolicyRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableIPSecPolicyRequest) SetDescription(v string) { + o.Description = &v +} + +// GetProposals returns the Proposals field value +func (o *WritableIPSecPolicyRequest) GetProposals() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Proposals +} + +// GetProposalsOk returns a tuple with the Proposals field value +// and a boolean to check if the value has been set. +func (o *WritableIPSecPolicyRequest) GetProposalsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Proposals, true +} + +// SetProposals sets field value +func (o *WritableIPSecPolicyRequest) SetProposals(v []int32) { + o.Proposals = v +} + +// GetPfsGroup returns the PfsGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPSecPolicyRequest) GetPfsGroup() PatchedWritableIPSecPolicyRequestPfsGroup { + if o == nil || IsNil(o.PfsGroup.Get()) { + var ret PatchedWritableIPSecPolicyRequestPfsGroup + return ret + } + return *o.PfsGroup.Get() +} + +// GetPfsGroupOk returns a tuple with the PfsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPSecPolicyRequest) GetPfsGroupOk() (*PatchedWritableIPSecPolicyRequestPfsGroup, bool) { + if o == nil { + return nil, false + } + return o.PfsGroup.Get(), o.PfsGroup.IsSet() +} + +// HasPfsGroup returns a boolean if a field has been set. +func (o *WritableIPSecPolicyRequest) HasPfsGroup() bool { + if o != nil && o.PfsGroup.IsSet() { + return true + } + + return false +} + +// SetPfsGroup gets a reference to the given NullablePatchedWritableIPSecPolicyRequestPfsGroup and assigns it to the PfsGroup field. +func (o *WritableIPSecPolicyRequest) SetPfsGroup(v PatchedWritableIPSecPolicyRequestPfsGroup) { + o.PfsGroup.Set(&v) +} + +// SetPfsGroupNil sets the value for PfsGroup to be an explicit nil +func (o *WritableIPSecPolicyRequest) SetPfsGroupNil() { + o.PfsGroup.Set(nil) +} + +// UnsetPfsGroup ensures that no value is present for PfsGroup, not even an explicit nil +func (o *WritableIPSecPolicyRequest) UnsetPfsGroup() { + o.PfsGroup.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableIPSecPolicyRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecPolicyRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableIPSecPolicyRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableIPSecPolicyRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableIPSecPolicyRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecPolicyRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableIPSecPolicyRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableIPSecPolicyRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableIPSecPolicyRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecPolicyRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableIPSecPolicyRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableIPSecPolicyRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableIPSecPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableIPSecPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["proposals"] = o.Proposals + if o.PfsGroup.IsSet() { + toSerialize["pfs_group"] = o.PfsGroup.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableIPSecPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "proposals", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableIPSecPolicyRequest := _WritableIPSecPolicyRequest{} + + err = json.Unmarshal(data, &varWritableIPSecPolicyRequest) + + if err != nil { + return err + } + + *o = WritableIPSecPolicyRequest(varWritableIPSecPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "proposals") + delete(additionalProperties, "pfs_group") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableIPSecPolicyRequest struct { + value *WritableIPSecPolicyRequest + isSet bool +} + +func (v NullableWritableIPSecPolicyRequest) Get() *WritableIPSecPolicyRequest { + return v.value +} + +func (v *NullableWritableIPSecPolicyRequest) Set(val *WritableIPSecPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableIPSecPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableIPSecPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableIPSecPolicyRequest(val *WritableIPSecPolicyRequest) *NullableWritableIPSecPolicyRequest { + return &NullableWritableIPSecPolicyRequest{value: val, isSet: true} +} + +func (v NullableWritableIPSecPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableIPSecPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_profile_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_profile_request.go new file mode 100644 index 00000000..e1b69222 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_profile_request.go @@ -0,0 +1,401 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableIPSecProfileRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableIPSecProfileRequest{} + +// WritableIPSecProfileRequest Adds support for custom fields and tags. +type WritableIPSecProfileRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Mode IPSecProfileModeValue `json:"mode"` + IkePolicy int32 `json:"ike_policy"` + IpsecPolicy int32 `json:"ipsec_policy"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableIPSecProfileRequest WritableIPSecProfileRequest + +// NewWritableIPSecProfileRequest instantiates a new WritableIPSecProfileRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableIPSecProfileRequest(name string, mode IPSecProfileModeValue, ikePolicy int32, ipsecPolicy int32) *WritableIPSecProfileRequest { + this := WritableIPSecProfileRequest{} + this.Name = name + this.Mode = mode + this.IkePolicy = ikePolicy + this.IpsecPolicy = ipsecPolicy + return &this +} + +// NewWritableIPSecProfileRequestWithDefaults instantiates a new WritableIPSecProfileRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableIPSecProfileRequestWithDefaults() *WritableIPSecProfileRequest { + this := WritableIPSecProfileRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableIPSecProfileRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableIPSecProfileRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableIPSecProfileRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableIPSecProfileRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableIPSecProfileRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value +func (o *WritableIPSecProfileRequest) GetMode() IPSecProfileModeValue { + if o == nil { + var ret IPSecProfileModeValue + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetModeOk() (*IPSecProfileModeValue, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *WritableIPSecProfileRequest) SetMode(v IPSecProfileModeValue) { + o.Mode = v +} + +// GetIkePolicy returns the IkePolicy field value +func (o *WritableIPSecProfileRequest) GetIkePolicy() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.IkePolicy +} + +// GetIkePolicyOk returns a tuple with the IkePolicy field value +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetIkePolicyOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.IkePolicy, true +} + +// SetIkePolicy sets field value +func (o *WritableIPSecProfileRequest) SetIkePolicy(v int32) { + o.IkePolicy = v +} + +// GetIpsecPolicy returns the IpsecPolicy field value +func (o *WritableIPSecProfileRequest) GetIpsecPolicy() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.IpsecPolicy +} + +// GetIpsecPolicyOk returns a tuple with the IpsecPolicy field value +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetIpsecPolicyOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.IpsecPolicy, true +} + +// SetIpsecPolicy sets field value +func (o *WritableIPSecProfileRequest) SetIpsecPolicy(v int32) { + o.IpsecPolicy = v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableIPSecProfileRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableIPSecProfileRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableIPSecProfileRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableIPSecProfileRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableIPSecProfileRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableIPSecProfileRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableIPSecProfileRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProfileRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableIPSecProfileRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableIPSecProfileRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableIPSecProfileRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableIPSecProfileRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["mode"] = o.Mode + toSerialize["ike_policy"] = o.IkePolicy + toSerialize["ipsec_policy"] = o.IpsecPolicy + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableIPSecProfileRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mode", + "ike_policy", + "ipsec_policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableIPSecProfileRequest := _WritableIPSecProfileRequest{} + + err = json.Unmarshal(data, &varWritableIPSecProfileRequest) + + if err != nil { + return err + } + + *o = WritableIPSecProfileRequest(varWritableIPSecProfileRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "ike_policy") + delete(additionalProperties, "ipsec_policy") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableIPSecProfileRequest struct { + value *WritableIPSecProfileRequest + isSet bool +} + +func (v NullableWritableIPSecProfileRequest) Get() *WritableIPSecProfileRequest { + return v.value +} + +func (v *NullableWritableIPSecProfileRequest) Set(val *WritableIPSecProfileRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableIPSecProfileRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableIPSecProfileRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableIPSecProfileRequest(val *WritableIPSecProfileRequest) *NullableWritableIPSecProfileRequest { + return &NullableWritableIPSecProfileRequest{value: val, isSet: true} +} + +func (v NullableWritableIPSecProfileRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableIPSecProfileRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_proposal_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_proposal_request.go new file mode 100644 index 00000000..113fa5f9 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_ip_sec_proposal_request.go @@ -0,0 +1,486 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableIPSecProposalRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableIPSecProposalRequest{} + +// WritableIPSecProposalRequest Adds support for custom fields and tags. +type WritableIPSecProposalRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + EncryptionAlgorithm *Encryption `json:"encryption_algorithm,omitempty"` + AuthenticationAlgorithm *Authentication `json:"authentication_algorithm,omitempty"` + // Security association lifetime (seconds) + SaLifetimeSeconds NullableInt32 `json:"sa_lifetime_seconds,omitempty"` + // Security association lifetime (in kilobytes) + SaLifetimeData NullableInt32 `json:"sa_lifetime_data,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableIPSecProposalRequest WritableIPSecProposalRequest + +// NewWritableIPSecProposalRequest instantiates a new WritableIPSecProposalRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableIPSecProposalRequest(name string) *WritableIPSecProposalRequest { + this := WritableIPSecProposalRequest{} + this.Name = name + return &this +} + +// NewWritableIPSecProposalRequestWithDefaults instantiates a new WritableIPSecProposalRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableIPSecProposalRequestWithDefaults() *WritableIPSecProposalRequest { + this := WritableIPSecProposalRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableIPSecProposalRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableIPSecProposalRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableIPSecProposalRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableIPSecProposalRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProposalRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableIPSecProposalRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value if set, zero value otherwise. +func (o *WritableIPSecProposalRequest) GetEncryptionAlgorithm() Encryption { + if o == nil || IsNil(o.EncryptionAlgorithm) { + var ret Encryption + return ret + } + return *o.EncryptionAlgorithm +} + +// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProposalRequest) GetEncryptionAlgorithmOk() (*Encryption, bool) { + if o == nil || IsNil(o.EncryptionAlgorithm) { + return nil, false + } + return o.EncryptionAlgorithm, true +} + +// HasEncryptionAlgorithm returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasEncryptionAlgorithm() bool { + if o != nil && !IsNil(o.EncryptionAlgorithm) { + return true + } + + return false +} + +// SetEncryptionAlgorithm gets a reference to the given Encryption and assigns it to the EncryptionAlgorithm field. +func (o *WritableIPSecProposalRequest) SetEncryptionAlgorithm(v Encryption) { + o.EncryptionAlgorithm = &v +} + +// GetAuthenticationAlgorithm returns the AuthenticationAlgorithm field value if set, zero value otherwise. +func (o *WritableIPSecProposalRequest) GetAuthenticationAlgorithm() Authentication { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + var ret Authentication + return ret + } + return *o.AuthenticationAlgorithm +} + +// GetAuthenticationAlgorithmOk returns a tuple with the AuthenticationAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProposalRequest) GetAuthenticationAlgorithmOk() (*Authentication, bool) { + if o == nil || IsNil(o.AuthenticationAlgorithm) { + return nil, false + } + return o.AuthenticationAlgorithm, true +} + +// HasAuthenticationAlgorithm returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasAuthenticationAlgorithm() bool { + if o != nil && !IsNil(o.AuthenticationAlgorithm) { + return true + } + + return false +} + +// SetAuthenticationAlgorithm gets a reference to the given Authentication and assigns it to the AuthenticationAlgorithm field. +func (o *WritableIPSecProposalRequest) SetAuthenticationAlgorithm(v Authentication) { + o.AuthenticationAlgorithm = &v +} + +// GetSaLifetimeSeconds returns the SaLifetimeSeconds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPSecProposalRequest) GetSaLifetimeSeconds() int32 { + if o == nil || IsNil(o.SaLifetimeSeconds.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeSeconds.Get() +} + +// GetSaLifetimeSecondsOk returns a tuple with the SaLifetimeSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPSecProposalRequest) GetSaLifetimeSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeSeconds.Get(), o.SaLifetimeSeconds.IsSet() +} + +// HasSaLifetimeSeconds returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasSaLifetimeSeconds() bool { + if o != nil && o.SaLifetimeSeconds.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeSeconds gets a reference to the given NullableInt32 and assigns it to the SaLifetimeSeconds field. +func (o *WritableIPSecProposalRequest) SetSaLifetimeSeconds(v int32) { + o.SaLifetimeSeconds.Set(&v) +} + +// SetSaLifetimeSecondsNil sets the value for SaLifetimeSeconds to be an explicit nil +func (o *WritableIPSecProposalRequest) SetSaLifetimeSecondsNil() { + o.SaLifetimeSeconds.Set(nil) +} + +// UnsetSaLifetimeSeconds ensures that no value is present for SaLifetimeSeconds, not even an explicit nil +func (o *WritableIPSecProposalRequest) UnsetSaLifetimeSeconds() { + o.SaLifetimeSeconds.Unset() +} + +// GetSaLifetimeData returns the SaLifetimeData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableIPSecProposalRequest) GetSaLifetimeData() int32 { + if o == nil || IsNil(o.SaLifetimeData.Get()) { + var ret int32 + return ret + } + return *o.SaLifetimeData.Get() +} + +// GetSaLifetimeDataOk returns a tuple with the SaLifetimeData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableIPSecProposalRequest) GetSaLifetimeDataOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SaLifetimeData.Get(), o.SaLifetimeData.IsSet() +} + +// HasSaLifetimeData returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasSaLifetimeData() bool { + if o != nil && o.SaLifetimeData.IsSet() { + return true + } + + return false +} + +// SetSaLifetimeData gets a reference to the given NullableInt32 and assigns it to the SaLifetimeData field. +func (o *WritableIPSecProposalRequest) SetSaLifetimeData(v int32) { + o.SaLifetimeData.Set(&v) +} + +// SetSaLifetimeDataNil sets the value for SaLifetimeData to be an explicit nil +func (o *WritableIPSecProposalRequest) SetSaLifetimeDataNil() { + o.SaLifetimeData.Set(nil) +} + +// UnsetSaLifetimeData ensures that no value is present for SaLifetimeData, not even an explicit nil +func (o *WritableIPSecProposalRequest) UnsetSaLifetimeData() { + o.SaLifetimeData.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableIPSecProposalRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProposalRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableIPSecProposalRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableIPSecProposalRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProposalRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableIPSecProposalRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableIPSecProposalRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableIPSecProposalRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableIPSecProposalRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableIPSecProposalRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableIPSecProposalRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableIPSecProposalRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.EncryptionAlgorithm) { + toSerialize["encryption_algorithm"] = o.EncryptionAlgorithm + } + if !IsNil(o.AuthenticationAlgorithm) { + toSerialize["authentication_algorithm"] = o.AuthenticationAlgorithm + } + if o.SaLifetimeSeconds.IsSet() { + toSerialize["sa_lifetime_seconds"] = o.SaLifetimeSeconds.Get() + } + if o.SaLifetimeData.IsSet() { + toSerialize["sa_lifetime_data"] = o.SaLifetimeData.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableIPSecProposalRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableIPSecProposalRequest := _WritableIPSecProposalRequest{} + + err = json.Unmarshal(data, &varWritableIPSecProposalRequest) + + if err != nil { + return err + } + + *o = WritableIPSecProposalRequest(varWritableIPSecProposalRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "encryption_algorithm") + delete(additionalProperties, "authentication_algorithm") + delete(additionalProperties, "sa_lifetime_seconds") + delete(additionalProperties, "sa_lifetime_data") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableIPSecProposalRequest struct { + value *WritableIPSecProposalRequest + isSet bool +} + +func (v NullableWritableIPSecProposalRequest) Get() *WritableIPSecProposalRequest { + return v.value +} + +func (v *NullableWritableIPSecProposalRequest) Set(val *WritableIPSecProposalRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableIPSecProposalRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableIPSecProposalRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableIPSecProposalRequest(val *WritableIPSecProposalRequest) *NullableWritableIPSecProposalRequest { + return &NullableWritableIPSecProposalRequest{value: val, isSet: true} +} + +func (v NullableWritableIPSecProposalRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableIPSecProposalRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_journal_entry_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_journal_entry_request.go new file mode 100644 index 00000000..c64d78b1 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_journal_entry_request.go @@ -0,0 +1,383 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableJournalEntryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableJournalEntryRequest{} + +// WritableJournalEntryRequest Adds support for custom fields and tags. +type WritableJournalEntryRequest struct { + AssignedObjectType string `json:"assigned_object_type"` + AssignedObjectId int64 `json:"assigned_object_id"` + CreatedBy NullableInt32 `json:"created_by,omitempty"` + Kind *JournalEntryKindValue `json:"kind,omitempty"` + Comments string `json:"comments"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableJournalEntryRequest WritableJournalEntryRequest + +// NewWritableJournalEntryRequest instantiates a new WritableJournalEntryRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableJournalEntryRequest(assignedObjectType string, assignedObjectId int64, comments string) *WritableJournalEntryRequest { + this := WritableJournalEntryRequest{} + this.AssignedObjectType = assignedObjectType + this.AssignedObjectId = assignedObjectId + this.Comments = comments + return &this +} + +// NewWritableJournalEntryRequestWithDefaults instantiates a new WritableJournalEntryRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableJournalEntryRequestWithDefaults() *WritableJournalEntryRequest { + this := WritableJournalEntryRequest{} + return &this +} + +// GetAssignedObjectType returns the AssignedObjectType field value +func (o *WritableJournalEntryRequest) GetAssignedObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value +// and a boolean to check if the value has been set. +func (o *WritableJournalEntryRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectType, true +} + +// SetAssignedObjectType sets field value +func (o *WritableJournalEntryRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType = v +} + +// GetAssignedObjectId returns the AssignedObjectId field value +func (o *WritableJournalEntryRequest) GetAssignedObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value +// and a boolean to check if the value has been set. +func (o *WritableJournalEntryRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectId, true +} + +// SetAssignedObjectId sets field value +func (o *WritableJournalEntryRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId = v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableJournalEntryRequest) GetCreatedBy() int32 { + if o == nil || IsNil(o.CreatedBy.Get()) { + var ret int32 + return ret + } + return *o.CreatedBy.Get() +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableJournalEntryRequest) GetCreatedByOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.CreatedBy.Get(), o.CreatedBy.IsSet() +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *WritableJournalEntryRequest) HasCreatedBy() bool { + if o != nil && o.CreatedBy.IsSet() { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given NullableInt32 and assigns it to the CreatedBy field. +func (o *WritableJournalEntryRequest) SetCreatedBy(v int32) { + o.CreatedBy.Set(&v) +} + +// SetCreatedByNil sets the value for CreatedBy to be an explicit nil +func (o *WritableJournalEntryRequest) SetCreatedByNil() { + o.CreatedBy.Set(nil) +} + +// UnsetCreatedBy ensures that no value is present for CreatedBy, not even an explicit nil +func (o *WritableJournalEntryRequest) UnsetCreatedBy() { + o.CreatedBy.Unset() +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *WritableJournalEntryRequest) GetKind() JournalEntryKindValue { + if o == nil || IsNil(o.Kind) { + var ret JournalEntryKindValue + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableJournalEntryRequest) GetKindOk() (*JournalEntryKindValue, bool) { + if o == nil || IsNil(o.Kind) { + return nil, false + } + return o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *WritableJournalEntryRequest) HasKind() bool { + if o != nil && !IsNil(o.Kind) { + return true + } + + return false +} + +// SetKind gets a reference to the given JournalEntryKindValue and assigns it to the Kind field. +func (o *WritableJournalEntryRequest) SetKind(v JournalEntryKindValue) { + o.Kind = &v +} + +// GetComments returns the Comments field value +func (o *WritableJournalEntryRequest) GetComments() string { + if o == nil { + var ret string + return ret + } + + return o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value +// and a boolean to check if the value has been set. +func (o *WritableJournalEntryRequest) GetCommentsOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Comments, true +} + +// SetComments sets field value +func (o *WritableJournalEntryRequest) SetComments(v string) { + o.Comments = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableJournalEntryRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableJournalEntryRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableJournalEntryRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableJournalEntryRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableJournalEntryRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableJournalEntryRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableJournalEntryRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableJournalEntryRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableJournalEntryRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableJournalEntryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assigned_object_type"] = o.AssignedObjectType + toSerialize["assigned_object_id"] = o.AssignedObjectId + if o.CreatedBy.IsSet() { + toSerialize["created_by"] = o.CreatedBy.Get() + } + if !IsNil(o.Kind) { + toSerialize["kind"] = o.Kind + } + toSerialize["comments"] = o.Comments + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableJournalEntryRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "assigned_object_type", + "assigned_object_id", + "comments", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableJournalEntryRequest := _WritableJournalEntryRequest{} + + err = json.Unmarshal(data, &varWritableJournalEntryRequest) + + if err != nil { + return err + } + + *o = WritableJournalEntryRequest(varWritableJournalEntryRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "created_by") + delete(additionalProperties, "kind") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableJournalEntryRequest struct { + value *WritableJournalEntryRequest + isSet bool +} + +func (v NullableWritableJournalEntryRequest) Get() *WritableJournalEntryRequest { + return v.value +} + +func (v *NullableWritableJournalEntryRequest) Set(val *WritableJournalEntryRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableJournalEntryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableJournalEntryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableJournalEntryRequest(val *WritableJournalEntryRequest) *NullableWritableJournalEntryRequest { + return &NullableWritableJournalEntryRequest{value: val, isSet: true} +} + +func (v NullableWritableJournalEntryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableJournalEntryRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_l2_vpn_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_l2_vpn_request.go new file mode 100644 index 00000000..e1291fa0 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_l2_vpn_request.go @@ -0,0 +1,542 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableL2VPNRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableL2VPNRequest{} + +// WritableL2VPNRequest Adds support for custom fields and tags. +type WritableL2VPNRequest struct { + Identifier NullableInt64 `json:"identifier,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Type L2VPNTypeValue `json:"type"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableL2VPNRequest WritableL2VPNRequest + +// NewWritableL2VPNRequest instantiates a new WritableL2VPNRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableL2VPNRequest(name string, slug string, type_ L2VPNTypeValue) *WritableL2VPNRequest { + this := WritableL2VPNRequest{} + this.Name = name + this.Slug = slug + this.Type = type_ + return &this +} + +// NewWritableL2VPNRequestWithDefaults instantiates a new WritableL2VPNRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableL2VPNRequestWithDefaults() *WritableL2VPNRequest { + this := WritableL2VPNRequest{} + return &this +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableL2VPNRequest) GetIdentifier() int64 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int64 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableL2VPNRequest) GetIdentifierOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt64 and assigns it to the Identifier field. +func (o *WritableL2VPNRequest) SetIdentifier(v int64) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *WritableL2VPNRequest) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *WritableL2VPNRequest) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetName returns the Name field value +func (o *WritableL2VPNRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableL2VPNRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableL2VPNRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableL2VPNRequest) SetSlug(v string) { + o.Slug = v +} + +// GetType returns the Type field value +func (o *WritableL2VPNRequest) GetType() L2VPNTypeValue { + if o == nil { + var ret L2VPNTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetTypeOk() (*L2VPNTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableL2VPNRequest) SetType(v L2VPNTypeValue) { + o.Type = v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *WritableL2VPNRequest) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *WritableL2VPNRequest) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *WritableL2VPNRequest) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *WritableL2VPNRequest) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableL2VPNRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableL2VPNRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableL2VPNRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableL2VPNRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableL2VPNRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableL2VPNRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableL2VPNRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableL2VPNRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableL2VPNRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableL2VPNRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableL2VPNRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableL2VPNRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableL2VPNRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableL2VPNRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableL2VPNRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableL2VPNRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["type"] = o.Type + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableL2VPNRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableL2VPNRequest := _WritableL2VPNRequest{} + + err = json.Unmarshal(data, &varWritableL2VPNRequest) + + if err != nil { + return err + } + + *o = WritableL2VPNRequest(varWritableL2VPNRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "identifier") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "type") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableL2VPNRequest struct { + value *WritableL2VPNRequest + isSet bool +} + +func (v NullableWritableL2VPNRequest) Get() *WritableL2VPNRequest { + return v.value +} + +func (v *NullableWritableL2VPNRequest) Set(val *WritableL2VPNRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableL2VPNRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableL2VPNRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableL2VPNRequest(val *WritableL2VPNRequest) *NullableWritableL2VPNRequest { + return &NullableWritableL2VPNRequest{value: val, isSet: true} +} + +func (v NullableWritableL2VPNRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableL2VPNRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_l2_vpn_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_l2_vpn_termination_request.go new file mode 100644 index 00000000..65b4e326 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_l2_vpn_termination_request.go @@ -0,0 +1,298 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableL2VPNTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableL2VPNTerminationRequest{} + +// WritableL2VPNTerminationRequest Adds support for custom fields and tags. +type WritableL2VPNTerminationRequest struct { + L2vpn int32 `json:"l2vpn"` + AssignedObjectType string `json:"assigned_object_type"` + AssignedObjectId int64 `json:"assigned_object_id"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableL2VPNTerminationRequest WritableL2VPNTerminationRequest + +// NewWritableL2VPNTerminationRequest instantiates a new WritableL2VPNTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableL2VPNTerminationRequest(l2vpn int32, assignedObjectType string, assignedObjectId int64) *WritableL2VPNTerminationRequest { + this := WritableL2VPNTerminationRequest{} + this.L2vpn = l2vpn + this.AssignedObjectType = assignedObjectType + this.AssignedObjectId = assignedObjectId + return &this +} + +// NewWritableL2VPNTerminationRequestWithDefaults instantiates a new WritableL2VPNTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableL2VPNTerminationRequestWithDefaults() *WritableL2VPNTerminationRequest { + this := WritableL2VPNTerminationRequest{} + return &this +} + +// GetL2vpn returns the L2vpn field value +func (o *WritableL2VPNTerminationRequest) GetL2vpn() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.L2vpn +} + +// GetL2vpnOk returns a tuple with the L2vpn field value +// and a boolean to check if the value has been set. +func (o *WritableL2VPNTerminationRequest) GetL2vpnOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.L2vpn, true +} + +// SetL2vpn sets field value +func (o *WritableL2VPNTerminationRequest) SetL2vpn(v int32) { + o.L2vpn = v +} + +// GetAssignedObjectType returns the AssignedObjectType field value +func (o *WritableL2VPNTerminationRequest) GetAssignedObjectType() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedObjectType +} + +// GetAssignedObjectTypeOk returns a tuple with the AssignedObjectType field value +// and a boolean to check if the value has been set. +func (o *WritableL2VPNTerminationRequest) GetAssignedObjectTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectType, true +} + +// SetAssignedObjectType sets field value +func (o *WritableL2VPNTerminationRequest) SetAssignedObjectType(v string) { + o.AssignedObjectType = v +} + +// GetAssignedObjectId returns the AssignedObjectId field value +func (o *WritableL2VPNTerminationRequest) GetAssignedObjectId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.AssignedObjectId +} + +// GetAssignedObjectIdOk returns a tuple with the AssignedObjectId field value +// and a boolean to check if the value has been set. +func (o *WritableL2VPNTerminationRequest) GetAssignedObjectIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.AssignedObjectId, true +} + +// SetAssignedObjectId sets field value +func (o *WritableL2VPNTerminationRequest) SetAssignedObjectId(v int64) { + o.AssignedObjectId = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableL2VPNTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableL2VPNTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableL2VPNTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableL2VPNTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableL2VPNTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableL2VPNTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableL2VPNTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableL2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableL2VPNTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["l2vpn"] = o.L2vpn + toSerialize["assigned_object_type"] = o.AssignedObjectType + toSerialize["assigned_object_id"] = o.AssignedObjectId + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableL2VPNTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "l2vpn", + "assigned_object_type", + "assigned_object_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableL2VPNTerminationRequest := _WritableL2VPNTerminationRequest{} + + err = json.Unmarshal(data, &varWritableL2VPNTerminationRequest) + + if err != nil { + return err + } + + *o = WritableL2VPNTerminationRequest(varWritableL2VPNTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "l2vpn") + delete(additionalProperties, "assigned_object_type") + delete(additionalProperties, "assigned_object_id") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableL2VPNTerminationRequest struct { + value *WritableL2VPNTerminationRequest + isSet bool +} + +func (v NullableWritableL2VPNTerminationRequest) Get() *WritableL2VPNTerminationRequest { + return v.value +} + +func (v *NullableWritableL2VPNTerminationRequest) Set(val *WritableL2VPNTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableL2VPNTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableL2VPNTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableL2VPNTerminationRequest(val *WritableL2VPNTerminationRequest) *NullableWritableL2VPNTerminationRequest { + return &NullableWritableL2VPNTerminationRequest{value: val, isSet: true} +} + +func (v NullableWritableL2VPNTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableL2VPNTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_location_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_location_request.go new file mode 100644 index 00000000..5eaa6f8c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_location_request.go @@ -0,0 +1,468 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableLocationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableLocationRequest{} + +// WritableLocationRequest Extends PrimaryModelSerializer to include MPTT support. +type WritableLocationRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Site int32 `json:"site"` + Parent NullableInt32 `json:"parent,omitempty"` + Status *LocationStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableLocationRequest WritableLocationRequest + +// NewWritableLocationRequest instantiates a new WritableLocationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableLocationRequest(name string, slug string, site int32) *WritableLocationRequest { + this := WritableLocationRequest{} + this.Name = name + this.Slug = slug + this.Site = site + return &this +} + +// NewWritableLocationRequestWithDefaults instantiates a new WritableLocationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableLocationRequestWithDefaults() *WritableLocationRequest { + this := WritableLocationRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableLocationRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableLocationRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableLocationRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableLocationRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableLocationRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableLocationRequest) SetSlug(v string) { + o.Slug = v +} + +// GetSite returns the Site field value +func (o *WritableLocationRequest) GetSite() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *WritableLocationRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *WritableLocationRequest) SetSite(v int32) { + o.Site = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableLocationRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableLocationRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableLocationRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableLocationRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableLocationRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableLocationRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableLocationRequest) GetStatus() LocationStatusValue { + if o == nil || IsNil(o.Status) { + var ret LocationStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableLocationRequest) GetStatusOk() (*LocationStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableLocationRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatusValue and assigns it to the Status field. +func (o *WritableLocationRequest) SetStatus(v LocationStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableLocationRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableLocationRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableLocationRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableLocationRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableLocationRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableLocationRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableLocationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableLocationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableLocationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableLocationRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableLocationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableLocationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableLocationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableLocationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableLocationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableLocationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableLocationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableLocationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableLocationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableLocationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["site"] = o.Site + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableLocationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "site", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableLocationRequest := _WritableLocationRequest{} + + err = json.Unmarshal(data, &varWritableLocationRequest) + + if err != nil { + return err + } + + *o = WritableLocationRequest(varWritableLocationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "site") + delete(additionalProperties, "parent") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableLocationRequest struct { + value *WritableLocationRequest + isSet bool +} + +func (v NullableWritableLocationRequest) Get() *WritableLocationRequest { + return v.value +} + +func (v *NullableWritableLocationRequest) Set(val *WritableLocationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableLocationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableLocationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableLocationRequest(val *WritableLocationRequest) *NullableWritableLocationRequest { + return &NullableWritableLocationRequest{value: val, isSet: true} +} + +func (v NullableWritableLocationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableLocationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_bay_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_bay_request.go new file mode 100644 index 00000000..fc4170a4 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_bay_request.go @@ -0,0 +1,411 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableModuleBayRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableModuleBayRequest{} + +// WritableModuleBayRequest Adds support for custom fields and tags. +type WritableModuleBayRequest struct { + Device int32 `json:"device"` + Name string `json:"name"` + InstalledModule int32 `json:"installed_module"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableModuleBayRequest WritableModuleBayRequest + +// NewWritableModuleBayRequest instantiates a new WritableModuleBayRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableModuleBayRequest(device int32, name string, installedModule int32) *WritableModuleBayRequest { + this := WritableModuleBayRequest{} + this.Device = device + this.Name = name + this.InstalledModule = installedModule + return &this +} + +// NewWritableModuleBayRequestWithDefaults instantiates a new WritableModuleBayRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableModuleBayRequestWithDefaults() *WritableModuleBayRequest { + this := WritableModuleBayRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableModuleBayRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableModuleBayRequest) SetDevice(v int32) { + o.Device = v +} + +// GetName returns the Name field value +func (o *WritableModuleBayRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableModuleBayRequest) SetName(v string) { + o.Name = v +} + +// GetInstalledModule returns the InstalledModule field value +func (o *WritableModuleBayRequest) GetInstalledModule() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InstalledModule +} + +// GetInstalledModuleOk returns a tuple with the InstalledModule field value +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetInstalledModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InstalledModule, true +} + +// SetInstalledModule sets field value +func (o *WritableModuleBayRequest) SetInstalledModule(v int32) { + o.InstalledModule = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableModuleBayRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableModuleBayRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableModuleBayRequest) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *WritableModuleBayRequest) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *WritableModuleBayRequest) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *WritableModuleBayRequest) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableModuleBayRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableModuleBayRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableModuleBayRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableModuleBayRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableModuleBayRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableModuleBayRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableModuleBayRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableModuleBayRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableModuleBayRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableModuleBayRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableModuleBayRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["name"] = o.Name + toSerialize["installed_module"] = o.InstalledModule + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableModuleBayRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + "installed_module", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableModuleBayRequest := _WritableModuleBayRequest{} + + err = json.Unmarshal(data, &varWritableModuleBayRequest) + + if err != nil { + return err + } + + *o = WritableModuleBayRequest(varWritableModuleBayRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "name") + delete(additionalProperties, "installed_module") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableModuleBayRequest struct { + value *WritableModuleBayRequest + isSet bool +} + +func (v NullableWritableModuleBayRequest) Get() *WritableModuleBayRequest { + return v.value +} + +func (v *NullableWritableModuleBayRequest) Set(val *WritableModuleBayRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableModuleBayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableModuleBayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableModuleBayRequest(val *WritableModuleBayRequest) *NullableWritableModuleBayRequest { + return &NullableWritableModuleBayRequest{value: val, isSet: true} +} + +func (v NullableWritableModuleBayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableModuleBayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_bay_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_bay_template_request.go new file mode 100644 index 00000000..d26918a7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_bay_template_request.go @@ -0,0 +1,309 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableModuleBayTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableModuleBayTemplateRequest{} + +// WritableModuleBayTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableModuleBayTemplateRequest struct { + DeviceType int32 `json:"device_type"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + // Identifier to reference when renaming installed components + Position *string `json:"position,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableModuleBayTemplateRequest WritableModuleBayTemplateRequest + +// NewWritableModuleBayTemplateRequest instantiates a new WritableModuleBayTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableModuleBayTemplateRequest(deviceType int32, name string) *WritableModuleBayTemplateRequest { + this := WritableModuleBayTemplateRequest{} + this.DeviceType = deviceType + this.Name = name + return &this +} + +// NewWritableModuleBayTemplateRequestWithDefaults instantiates a new WritableModuleBayTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableModuleBayTemplateRequestWithDefaults() *WritableModuleBayTemplateRequest { + this := WritableModuleBayTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value +func (o *WritableModuleBayTemplateRequest) GetDeviceType() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeviceType +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +func (o *WritableModuleBayTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeviceType, true +} + +// SetDeviceType sets field value +func (o *WritableModuleBayTemplateRequest) SetDeviceType(v int32) { + o.DeviceType = v +} + +// GetName returns the Name field value +func (o *WritableModuleBayTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableModuleBayTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableModuleBayTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableModuleBayTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableModuleBayTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableModuleBayTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetPosition returns the Position field value if set, zero value otherwise. +func (o *WritableModuleBayTemplateRequest) GetPosition() string { + if o == nil || IsNil(o.Position) { + var ret string + return ret + } + return *o.Position +} + +// GetPositionOk returns a tuple with the Position field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayTemplateRequest) GetPositionOk() (*string, bool) { + if o == nil || IsNil(o.Position) { + return nil, false + } + return o.Position, true +} + +// HasPosition returns a boolean if a field has been set. +func (o *WritableModuleBayTemplateRequest) HasPosition() bool { + if o != nil && !IsNil(o.Position) { + return true + } + + return false +} + +// SetPosition gets a reference to the given string and assigns it to the Position field. +func (o *WritableModuleBayTemplateRequest) SetPosition(v string) { + o.Position = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableModuleBayTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleBayTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableModuleBayTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableModuleBayTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritableModuleBayTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableModuleBayTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_type"] = o.DeviceType + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Position) { + toSerialize["position"] = o.Position + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableModuleBayTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_type", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableModuleBayTemplateRequest := _WritableModuleBayTemplateRequest{} + + err = json.Unmarshal(data, &varWritableModuleBayTemplateRequest) + + if err != nil { + return err + } + + *o = WritableModuleBayTemplateRequest(varWritableModuleBayTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "position") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableModuleBayTemplateRequest struct { + value *WritableModuleBayTemplateRequest + isSet bool +} + +func (v NullableWritableModuleBayTemplateRequest) Get() *WritableModuleBayTemplateRequest { + return v.value +} + +func (v *NullableWritableModuleBayTemplateRequest) Set(val *WritableModuleBayTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableModuleBayTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableModuleBayTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableModuleBayTemplateRequest(val *WritableModuleBayTemplateRequest) *NullableWritableModuleBayTemplateRequest { + return &NullableWritableModuleBayTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableModuleBayTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableModuleBayTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_request.go new file mode 100644 index 00000000..c9db9a3e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_request.go @@ -0,0 +1,495 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableModuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableModuleRequest{} + +// WritableModuleRequest Adds support for custom fields and tags. +type WritableModuleRequest struct { + Device int32 `json:"device"` + ModuleBay int32 `json:"module_bay"` + ModuleType int32 `json:"module_type"` + Status *ModuleStatusValue `json:"status,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this device + AssetTag NullableString `json:"asset_tag,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableModuleRequest WritableModuleRequest + +// NewWritableModuleRequest instantiates a new WritableModuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableModuleRequest(device int32, moduleBay int32, moduleType int32) *WritableModuleRequest { + this := WritableModuleRequest{} + this.Device = device + this.ModuleBay = moduleBay + this.ModuleType = moduleType + return &this +} + +// NewWritableModuleRequestWithDefaults instantiates a new WritableModuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableModuleRequestWithDefaults() *WritableModuleRequest { + this := WritableModuleRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableModuleRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableModuleRequest) SetDevice(v int32) { + o.Device = v +} + +// GetModuleBay returns the ModuleBay field value +func (o *WritableModuleRequest) GetModuleBay() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ModuleBay +} + +// GetModuleBayOk returns a tuple with the ModuleBay field value +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetModuleBayOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ModuleBay, true +} + +// SetModuleBay sets field value +func (o *WritableModuleRequest) SetModuleBay(v int32) { + o.ModuleBay = v +} + +// GetModuleType returns the ModuleType field value +func (o *WritableModuleRequest) GetModuleType() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ModuleType +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ModuleType, true +} + +// SetModuleType sets field value +func (o *WritableModuleRequest) SetModuleType(v int32) { + o.ModuleType = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableModuleRequest) GetStatus() ModuleStatusValue { + if o == nil || IsNil(o.Status) { + var ret ModuleStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetStatusOk() (*ModuleStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableModuleRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatusValue and assigns it to the Status field. +func (o *WritableModuleRequest) SetStatus(v ModuleStatusValue) { + o.Status = &v +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *WritableModuleRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *WritableModuleRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *WritableModuleRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableModuleRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableModuleRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *WritableModuleRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *WritableModuleRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *WritableModuleRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *WritableModuleRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableModuleRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableModuleRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableModuleRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableModuleRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableModuleRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableModuleRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableModuleRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableModuleRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableModuleRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableModuleRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableModuleRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableModuleRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableModuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableModuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["module_bay"] = o.ModuleBay + toSerialize["module_type"] = o.ModuleType + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableModuleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "module_bay", + "module_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableModuleRequest := _WritableModuleRequest{} + + err = json.Unmarshal(data, &varWritableModuleRequest) + + if err != nil { + return err + } + + *o = WritableModuleRequest(varWritableModuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module_bay") + delete(additionalProperties, "module_type") + delete(additionalProperties, "status") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableModuleRequest struct { + value *WritableModuleRequest + isSet bool +} + +func (v NullableWritableModuleRequest) Get() *WritableModuleRequest { + return v.value +} + +func (v *NullableWritableModuleRequest) Set(val *WritableModuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableModuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableModuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableModuleRequest(val *WritableModuleRequest) *NullableWritableModuleRequest { + return &NullableWritableModuleRequest{value: val, isSet: true} +} + +func (v NullableWritableModuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableModuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_type_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_type_request.go new file mode 100644 index 00000000..590b6c16 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_module_type_request.go @@ -0,0 +1,466 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableModuleTypeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableModuleTypeRequest{} + +// WritableModuleTypeRequest Adds support for custom fields and tags. +type WritableModuleTypeRequest struct { + Manufacturer int32 `json:"manufacturer"` + Model string `json:"model"` + // Discrete part number (optional) + PartNumber *string `json:"part_number,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + WeightUnit *DeviceTypeWeightUnitValue `json:"weight_unit,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableModuleTypeRequest WritableModuleTypeRequest + +// NewWritableModuleTypeRequest instantiates a new WritableModuleTypeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableModuleTypeRequest(manufacturer int32, model string) *WritableModuleTypeRequest { + this := WritableModuleTypeRequest{} + this.Manufacturer = manufacturer + this.Model = model + return &this +} + +// NewWritableModuleTypeRequestWithDefaults instantiates a new WritableModuleTypeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableModuleTypeRequestWithDefaults() *WritableModuleTypeRequest { + this := WritableModuleTypeRequest{} + return &this +} + +// GetManufacturer returns the Manufacturer field value +func (o *WritableModuleTypeRequest) GetManufacturer() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Manufacturer, true +} + +// SetManufacturer sets field value +func (o *WritableModuleTypeRequest) SetManufacturer(v int32) { + o.Manufacturer = v +} + +// GetModel returns the Model field value +func (o *WritableModuleTypeRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *WritableModuleTypeRequest) SetModel(v string) { + o.Model = v +} + +// GetPartNumber returns the PartNumber field value if set, zero value otherwise. +func (o *WritableModuleTypeRequest) GetPartNumber() string { + if o == nil || IsNil(o.PartNumber) { + var ret string + return ret + } + return *o.PartNumber +} + +// GetPartNumberOk returns a tuple with the PartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetPartNumberOk() (*string, bool) { + if o == nil || IsNil(o.PartNumber) { + return nil, false + } + return o.PartNumber, true +} + +// HasPartNumber returns a boolean if a field has been set. +func (o *WritableModuleTypeRequest) HasPartNumber() bool { + if o != nil && !IsNil(o.PartNumber) { + return true + } + + return false +} + +// SetPartNumber gets a reference to the given string and assigns it to the PartNumber field. +func (o *WritableModuleTypeRequest) SetPartNumber(v string) { + o.PartNumber = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableModuleTypeRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableModuleTypeRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *WritableModuleTypeRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *WritableModuleTypeRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *WritableModuleTypeRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *WritableModuleTypeRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise. +func (o *WritableModuleTypeRequest) GetWeightUnit() DeviceTypeWeightUnitValue { + if o == nil || IsNil(o.WeightUnit) { + var ret DeviceTypeWeightUnitValue + return ret + } + return *o.WeightUnit +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetWeightUnitOk() (*DeviceTypeWeightUnitValue, bool) { + if o == nil || IsNil(o.WeightUnit) { + return nil, false + } + return o.WeightUnit, true +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *WritableModuleTypeRequest) HasWeightUnit() bool { + if o != nil && !IsNil(o.WeightUnit) { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given DeviceTypeWeightUnitValue and assigns it to the WeightUnit field. +func (o *WritableModuleTypeRequest) SetWeightUnit(v DeviceTypeWeightUnitValue) { + o.WeightUnit = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableModuleTypeRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableModuleTypeRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableModuleTypeRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableModuleTypeRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableModuleTypeRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableModuleTypeRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableModuleTypeRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableModuleTypeRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableModuleTypeRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableModuleTypeRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableModuleTypeRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableModuleTypeRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableModuleTypeRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableModuleTypeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableModuleTypeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["manufacturer"] = o.Manufacturer + toSerialize["model"] = o.Model + if !IsNil(o.PartNumber) { + toSerialize["part_number"] = o.PartNumber + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if !IsNil(o.WeightUnit) { + toSerialize["weight_unit"] = o.WeightUnit + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableModuleTypeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "manufacturer", + "model", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableModuleTypeRequest := _WritableModuleTypeRequest{} + + err = json.Unmarshal(data, &varWritableModuleTypeRequest) + + if err != nil { + return err + } + + *o = WritableModuleTypeRequest(varWritableModuleTypeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "model") + delete(additionalProperties, "part_number") + delete(additionalProperties, "weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableModuleTypeRequest struct { + value *WritableModuleTypeRequest + isSet bool +} + +func (v NullableWritableModuleTypeRequest) Get() *WritableModuleTypeRequest { + return v.value +} + +func (v *NullableWritableModuleTypeRequest) Set(val *WritableModuleTypeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableModuleTypeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableModuleTypeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableModuleTypeRequest(val *WritableModuleTypeRequest) *NullableWritableModuleTypeRequest { + return &NullableWritableModuleTypeRequest{value: val, isSet: true} +} + +func (v NullableWritableModuleTypeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableModuleTypeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_object_permission_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_object_permission_request.go new file mode 100644 index 00000000..56afbe31 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_object_permission_request.go @@ -0,0 +1,412 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableObjectPermissionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableObjectPermissionRequest{} + +// WritableObjectPermissionRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableObjectPermissionRequest struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ObjectTypes []string `json:"object_types"` + Groups []int32 `json:"groups,omitempty"` + Users []int32 `json:"users,omitempty"` + // The list of actions granted by this permission + Actions []string `json:"actions"` + // Queryset filter matching the applicable objects of the selected type(s) + Constraints interface{} `json:"constraints,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableObjectPermissionRequest WritableObjectPermissionRequest + +// NewWritableObjectPermissionRequest instantiates a new WritableObjectPermissionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableObjectPermissionRequest(name string, objectTypes []string, actions []string) *WritableObjectPermissionRequest { + this := WritableObjectPermissionRequest{} + this.Name = name + this.ObjectTypes = objectTypes + this.Actions = actions + return &this +} + +// NewWritableObjectPermissionRequestWithDefaults instantiates a new WritableObjectPermissionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableObjectPermissionRequestWithDefaults() *WritableObjectPermissionRequest { + this := WritableObjectPermissionRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableObjectPermissionRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableObjectPermissionRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableObjectPermissionRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableObjectPermissionRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableObjectPermissionRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableObjectPermissionRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableObjectPermissionRequest) SetDescription(v string) { + o.Description = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *WritableObjectPermissionRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableObjectPermissionRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *WritableObjectPermissionRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *WritableObjectPermissionRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetObjectTypes returns the ObjectTypes field value +func (o *WritableObjectPermissionRequest) GetObjectTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ObjectTypes +} + +// GetObjectTypesOk returns a tuple with the ObjectTypes field value +// and a boolean to check if the value has been set. +func (o *WritableObjectPermissionRequest) GetObjectTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ObjectTypes, true +} + +// SetObjectTypes sets field value +func (o *WritableObjectPermissionRequest) SetObjectTypes(v []string) { + o.ObjectTypes = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *WritableObjectPermissionRequest) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableObjectPermissionRequest) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *WritableObjectPermissionRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *WritableObjectPermissionRequest) SetGroups(v []int32) { + o.Groups = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *WritableObjectPermissionRequest) GetUsers() []int32 { + if o == nil || IsNil(o.Users) { + var ret []int32 + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableObjectPermissionRequest) GetUsersOk() ([]int32, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *WritableObjectPermissionRequest) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []int32 and assigns it to the Users field. +func (o *WritableObjectPermissionRequest) SetUsers(v []int32) { + o.Users = v +} + +// GetActions returns the Actions field value +func (o *WritableObjectPermissionRequest) GetActions() []string { + if o == nil { + var ret []string + return ret + } + + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value +// and a boolean to check if the value has been set. +func (o *WritableObjectPermissionRequest) GetActionsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Actions, true +} + +// SetActions sets field value +func (o *WritableObjectPermissionRequest) SetActions(v []string) { + o.Actions = v +} + +// GetConstraints returns the Constraints field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableObjectPermissionRequest) GetConstraints() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Constraints +} + +// GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableObjectPermissionRequest) GetConstraintsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Constraints) { + return nil, false + } + return &o.Constraints, true +} + +// HasConstraints returns a boolean if a field has been set. +func (o *WritableObjectPermissionRequest) HasConstraints() bool { + if o != nil && IsNil(o.Constraints) { + return true + } + + return false +} + +// SetConstraints gets a reference to the given interface{} and assigns it to the Constraints field. +func (o *WritableObjectPermissionRequest) SetConstraints(v interface{}) { + o.Constraints = v +} + +func (o WritableObjectPermissionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableObjectPermissionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["object_types"] = o.ObjectTypes + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + toSerialize["actions"] = o.Actions + if o.Constraints != nil { + toSerialize["constraints"] = o.Constraints + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableObjectPermissionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "object_types", + "actions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableObjectPermissionRequest := _WritableObjectPermissionRequest{} + + err = json.Unmarshal(data, &varWritableObjectPermissionRequest) + + if err != nil { + return err + } + + *o = WritableObjectPermissionRequest(varWritableObjectPermissionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "enabled") + delete(additionalProperties, "object_types") + delete(additionalProperties, "groups") + delete(additionalProperties, "users") + delete(additionalProperties, "actions") + delete(additionalProperties, "constraints") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableObjectPermissionRequest struct { + value *WritableObjectPermissionRequest + isSet bool +} + +func (v NullableWritableObjectPermissionRequest) Get() *WritableObjectPermissionRequest { + return v.value +} + +func (v *NullableWritableObjectPermissionRequest) Set(val *WritableObjectPermissionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableObjectPermissionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableObjectPermissionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableObjectPermissionRequest(val *WritableObjectPermissionRequest) *NullableWritableObjectPermissionRequest { + return &NullableWritableObjectPermissionRequest{value: val, isSet: true} +} + +func (v NullableWritableObjectPermissionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableObjectPermissionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_platform_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_platform_request.go new file mode 100644 index 00000000..af95328e --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_platform_request.go @@ -0,0 +1,403 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePlatformRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePlatformRequest{} + +// WritablePlatformRequest Adds support for custom fields and tags. +type WritablePlatformRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + // Optionally limit this platform to devices of a certain manufacturer + Manufacturer NullableInt32 `json:"manufacturer,omitempty"` + ConfigTemplate NullableInt32 `json:"config_template,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePlatformRequest WritablePlatformRequest + +// NewWritablePlatformRequest instantiates a new WritablePlatformRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePlatformRequest(name string, slug string) *WritablePlatformRequest { + this := WritablePlatformRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritablePlatformRequestWithDefaults instantiates a new WritablePlatformRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePlatformRequestWithDefaults() *WritablePlatformRequest { + this := WritablePlatformRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritablePlatformRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritablePlatformRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritablePlatformRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritablePlatformRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritablePlatformRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritablePlatformRequest) SetSlug(v string) { + o.Slug = v +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePlatformRequest) GetManufacturer() int32 { + if o == nil || IsNil(o.Manufacturer.Get()) { + var ret int32 + return ret + } + return *o.Manufacturer.Get() +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePlatformRequest) GetManufacturerOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Manufacturer.Get(), o.Manufacturer.IsSet() +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *WritablePlatformRequest) HasManufacturer() bool { + if o != nil && o.Manufacturer.IsSet() { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given NullableInt32 and assigns it to the Manufacturer field. +func (o *WritablePlatformRequest) SetManufacturer(v int32) { + o.Manufacturer.Set(&v) +} + +// SetManufacturerNil sets the value for Manufacturer to be an explicit nil +func (o *WritablePlatformRequest) SetManufacturerNil() { + o.Manufacturer.Set(nil) +} + +// UnsetManufacturer ensures that no value is present for Manufacturer, not even an explicit nil +func (o *WritablePlatformRequest) UnsetManufacturer() { + o.Manufacturer.Unset() +} + +// GetConfigTemplate returns the ConfigTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePlatformRequest) GetConfigTemplate() int32 { + if o == nil || IsNil(o.ConfigTemplate.Get()) { + var ret int32 + return ret + } + return *o.ConfigTemplate.Get() +} + +// GetConfigTemplateOk returns a tuple with the ConfigTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePlatformRequest) GetConfigTemplateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ConfigTemplate.Get(), o.ConfigTemplate.IsSet() +} + +// HasConfigTemplate returns a boolean if a field has been set. +func (o *WritablePlatformRequest) HasConfigTemplate() bool { + if o != nil && o.ConfigTemplate.IsSet() { + return true + } + + return false +} + +// SetConfigTemplate gets a reference to the given NullableInt32 and assigns it to the ConfigTemplate field. +func (o *WritablePlatformRequest) SetConfigTemplate(v int32) { + o.ConfigTemplate.Set(&v) +} + +// SetConfigTemplateNil sets the value for ConfigTemplate to be an explicit nil +func (o *WritablePlatformRequest) SetConfigTemplateNil() { + o.ConfigTemplate.Set(nil) +} + +// UnsetConfigTemplate ensures that no value is present for ConfigTemplate, not even an explicit nil +func (o *WritablePlatformRequest) UnsetConfigTemplate() { + o.ConfigTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePlatformRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePlatformRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePlatformRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePlatformRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritablePlatformRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePlatformRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritablePlatformRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritablePlatformRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritablePlatformRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePlatformRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritablePlatformRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritablePlatformRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritablePlatformRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePlatformRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Manufacturer.IsSet() { + toSerialize["manufacturer"] = o.Manufacturer.Get() + } + if o.ConfigTemplate.IsSet() { + toSerialize["config_template"] = o.ConfigTemplate.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePlatformRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePlatformRequest := _WritablePlatformRequest{} + + err = json.Unmarshal(data, &varWritablePlatformRequest) + + if err != nil { + return err + } + + *o = WritablePlatformRequest(varWritablePlatformRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "config_template") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePlatformRequest struct { + value *WritablePlatformRequest + isSet bool +} + +func (v NullableWritablePlatformRequest) Get() *WritablePlatformRequest { + return v.value +} + +func (v *NullableWritablePlatformRequest) Set(val *WritablePlatformRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePlatformRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePlatformRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePlatformRequest(val *WritablePlatformRequest) *NullableWritablePlatformRequest { + return &NullableWritablePlatformRequest{value: val, isSet: true} +} + +func (v NullableWritablePlatformRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePlatformRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_feed_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_feed_request.go new file mode 100644 index 00000000..9243917d --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_feed_request.go @@ -0,0 +1,737 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePowerFeedRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePowerFeedRequest{} + +// WritablePowerFeedRequest Adds support for custom fields and tags. +type WritablePowerFeedRequest struct { + PowerPanel int32 `json:"power_panel"` + Rack NullableInt32 `json:"rack,omitempty"` + Name string `json:"name"` + Status *PatchedWritablePowerFeedRequestStatus `json:"status,omitempty"` + Type *PatchedWritablePowerFeedRequestType `json:"type,omitempty"` + Supply *PatchedWritablePowerFeedRequestSupply `json:"supply,omitempty"` + Phase *PatchedWritablePowerFeedRequestPhase `json:"phase,omitempty"` + Voltage *int32 `json:"voltage,omitempty"` + Amperage *int32 `json:"amperage,omitempty"` + // Maximum permissible draw (percentage) + MaxUtilization *int32 `json:"max_utilization,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Description *string `json:"description,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePowerFeedRequest WritablePowerFeedRequest + +// NewWritablePowerFeedRequest instantiates a new WritablePowerFeedRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePowerFeedRequest(powerPanel int32, name string) *WritablePowerFeedRequest { + this := WritablePowerFeedRequest{} + this.PowerPanel = powerPanel + this.Name = name + return &this +} + +// NewWritablePowerFeedRequestWithDefaults instantiates a new WritablePowerFeedRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePowerFeedRequestWithDefaults() *WritablePowerFeedRequest { + this := WritablePowerFeedRequest{} + return &this +} + +// GetPowerPanel returns the PowerPanel field value +func (o *WritablePowerFeedRequest) GetPowerPanel() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PowerPanel +} + +// GetPowerPanelOk returns a tuple with the PowerPanel field value +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetPowerPanelOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PowerPanel, true +} + +// SetPowerPanel sets field value +func (o *WritablePowerFeedRequest) SetPowerPanel(v int32) { + o.PowerPanel = v +} + +// GetRack returns the Rack field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerFeedRequest) GetRack() int32 { + if o == nil || IsNil(o.Rack.Get()) { + var ret int32 + return ret + } + return *o.Rack.Get() +} + +// GetRackOk returns a tuple with the Rack field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerFeedRequest) GetRackOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Rack.Get(), o.Rack.IsSet() +} + +// HasRack returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasRack() bool { + if o != nil && o.Rack.IsSet() { + return true + } + + return false +} + +// SetRack gets a reference to the given NullableInt32 and assigns it to the Rack field. +func (o *WritablePowerFeedRequest) SetRack(v int32) { + o.Rack.Set(&v) +} + +// SetRackNil sets the value for Rack to be an explicit nil +func (o *WritablePowerFeedRequest) SetRackNil() { + o.Rack.Set(nil) +} + +// UnsetRack ensures that no value is present for Rack, not even an explicit nil +func (o *WritablePowerFeedRequest) UnsetRack() { + o.Rack.Unset() +} + +// GetName returns the Name field value +func (o *WritablePowerFeedRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritablePowerFeedRequest) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetStatus() PatchedWritablePowerFeedRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritablePowerFeedRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetStatusOk() (*PatchedWritablePowerFeedRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritablePowerFeedRequestStatus and assigns it to the Status field. +func (o *WritablePowerFeedRequest) SetStatus(v PatchedWritablePowerFeedRequestStatus) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetType() PatchedWritablePowerFeedRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerFeedRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetTypeOk() (*PatchedWritablePowerFeedRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerFeedRequestType and assigns it to the Type field. +func (o *WritablePowerFeedRequest) SetType(v PatchedWritablePowerFeedRequestType) { + o.Type = &v +} + +// GetSupply returns the Supply field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetSupply() PatchedWritablePowerFeedRequestSupply { + if o == nil || IsNil(o.Supply) { + var ret PatchedWritablePowerFeedRequestSupply + return ret + } + return *o.Supply +} + +// GetSupplyOk returns a tuple with the Supply field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetSupplyOk() (*PatchedWritablePowerFeedRequestSupply, bool) { + if o == nil || IsNil(o.Supply) { + return nil, false + } + return o.Supply, true +} + +// HasSupply returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasSupply() bool { + if o != nil && !IsNil(o.Supply) { + return true + } + + return false +} + +// SetSupply gets a reference to the given PatchedWritablePowerFeedRequestSupply and assigns it to the Supply field. +func (o *WritablePowerFeedRequest) SetSupply(v PatchedWritablePowerFeedRequestSupply) { + o.Supply = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetPhase() PatchedWritablePowerFeedRequestPhase { + if o == nil || IsNil(o.Phase) { + var ret PatchedWritablePowerFeedRequestPhase + return ret + } + return *o.Phase +} + +// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetPhaseOk() (*PatchedWritablePowerFeedRequestPhase, bool) { + if o == nil || IsNil(o.Phase) { + return nil, false + } + return o.Phase, true +} + +// HasPhase returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasPhase() bool { + if o != nil && !IsNil(o.Phase) { + return true + } + + return false +} + +// SetPhase gets a reference to the given PatchedWritablePowerFeedRequestPhase and assigns it to the Phase field. +func (o *WritablePowerFeedRequest) SetPhase(v PatchedWritablePowerFeedRequestPhase) { + o.Phase = &v +} + +// GetVoltage returns the Voltage field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetVoltage() int32 { + if o == nil || IsNil(o.Voltage) { + var ret int32 + return ret + } + return *o.Voltage +} + +// GetVoltageOk returns a tuple with the Voltage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetVoltageOk() (*int32, bool) { + if o == nil || IsNil(o.Voltage) { + return nil, false + } + return o.Voltage, true +} + +// HasVoltage returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasVoltage() bool { + if o != nil && !IsNil(o.Voltage) { + return true + } + + return false +} + +// SetVoltage gets a reference to the given int32 and assigns it to the Voltage field. +func (o *WritablePowerFeedRequest) SetVoltage(v int32) { + o.Voltage = &v +} + +// GetAmperage returns the Amperage field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetAmperage() int32 { + if o == nil || IsNil(o.Amperage) { + var ret int32 + return ret + } + return *o.Amperage +} + +// GetAmperageOk returns a tuple with the Amperage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetAmperageOk() (*int32, bool) { + if o == nil || IsNil(o.Amperage) { + return nil, false + } + return o.Amperage, true +} + +// HasAmperage returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasAmperage() bool { + if o != nil && !IsNil(o.Amperage) { + return true + } + + return false +} + +// SetAmperage gets a reference to the given int32 and assigns it to the Amperage field. +func (o *WritablePowerFeedRequest) SetAmperage(v int32) { + o.Amperage = &v +} + +// GetMaxUtilization returns the MaxUtilization field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetMaxUtilization() int32 { + if o == nil || IsNil(o.MaxUtilization) { + var ret int32 + return ret + } + return *o.MaxUtilization +} + +// GetMaxUtilizationOk returns a tuple with the MaxUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetMaxUtilizationOk() (*int32, bool) { + if o == nil || IsNil(o.MaxUtilization) { + return nil, false + } + return o.MaxUtilization, true +} + +// HasMaxUtilization returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasMaxUtilization() bool { + if o != nil && !IsNil(o.MaxUtilization) { + return true + } + + return false +} + +// SetMaxUtilization gets a reference to the given int32 and assigns it to the MaxUtilization field. +func (o *WritablePowerFeedRequest) SetMaxUtilization(v int32) { + o.MaxUtilization = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritablePowerFeedRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePowerFeedRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerFeedRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerFeedRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritablePowerFeedRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritablePowerFeedRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritablePowerFeedRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritablePowerFeedRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritablePowerFeedRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritablePowerFeedRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerFeedRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritablePowerFeedRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritablePowerFeedRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritablePowerFeedRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePowerFeedRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["power_panel"] = o.PowerPanel + if o.Rack.IsSet() { + toSerialize["rack"] = o.Rack.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Supply) { + toSerialize["supply"] = o.Supply + } + if !IsNil(o.Phase) { + toSerialize["phase"] = o.Phase + } + if !IsNil(o.Voltage) { + toSerialize["voltage"] = o.Voltage + } + if !IsNil(o.Amperage) { + toSerialize["amperage"] = o.Amperage + } + if !IsNil(o.MaxUtilization) { + toSerialize["max_utilization"] = o.MaxUtilization + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePowerFeedRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "power_panel", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePowerFeedRequest := _WritablePowerFeedRequest{} + + err = json.Unmarshal(data, &varWritablePowerFeedRequest) + + if err != nil { + return err + } + + *o = WritablePowerFeedRequest(varWritablePowerFeedRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "power_panel") + delete(additionalProperties, "rack") + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "type") + delete(additionalProperties, "supply") + delete(additionalProperties, "phase") + delete(additionalProperties, "voltage") + delete(additionalProperties, "amperage") + delete(additionalProperties, "max_utilization") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "description") + delete(additionalProperties, "tenant") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePowerFeedRequest struct { + value *WritablePowerFeedRequest + isSet bool +} + +func (v NullableWritablePowerFeedRequest) Get() *WritablePowerFeedRequest { + return v.value +} + +func (v *NullableWritablePowerFeedRequest) Set(val *WritablePowerFeedRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePowerFeedRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePowerFeedRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePowerFeedRequest(val *WritablePowerFeedRequest) *NullableWritablePowerFeedRequest { + return &NullableWritablePowerFeedRequest{value: val, isSet: true} +} + +func (v NullableWritablePowerFeedRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePowerFeedRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_outlet_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_outlet_request.go new file mode 100644 index 00000000..e79754a2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_outlet_request.go @@ -0,0 +1,552 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePowerOutletRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePowerOutletRequest{} + +// WritablePowerOutletRequest Adds support for custom fields and tags. +type WritablePowerOutletRequest struct { + Device int32 `json:"device"` + Module NullableInt32 `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerOutletRequestType `json:"type,omitempty"` + PowerPort NullableInt32 `json:"power_port,omitempty"` + FeedLeg *PatchedWritablePowerOutletRequestFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePowerOutletRequest WritablePowerOutletRequest + +// NewWritablePowerOutletRequest instantiates a new WritablePowerOutletRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePowerOutletRequest(device int32, name string) *WritablePowerOutletRequest { + this := WritablePowerOutletRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewWritablePowerOutletRequestWithDefaults instantiates a new WritablePowerOutletRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePowerOutletRequestWithDefaults() *WritablePowerOutletRequest { + this := WritablePowerOutletRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritablePowerOutletRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritablePowerOutletRequest) SetDevice(v int32) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerOutletRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerOutletRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *WritablePowerOutletRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *WritablePowerOutletRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *WritablePowerOutletRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *WritablePowerOutletRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritablePowerOutletRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritablePowerOutletRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritablePowerOutletRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritablePowerOutletRequest) GetType() PatchedWritablePowerOutletRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerOutletRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetTypeOk() (*PatchedWritablePowerOutletRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerOutletRequestType and assigns it to the Type field. +func (o *WritablePowerOutletRequest) SetType(v PatchedWritablePowerOutletRequestType) { + o.Type = &v +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerOutletRequest) GetPowerPort() int32 { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret int32 + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerOutletRequest) GetPowerPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableInt32 and assigns it to the PowerPort field. +func (o *WritablePowerOutletRequest) SetPowerPort(v int32) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *WritablePowerOutletRequest) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *WritablePowerOutletRequest) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise. +func (o *WritablePowerOutletRequest) GetFeedLeg() PatchedWritablePowerOutletRequestFeedLeg { + if o == nil || IsNil(o.FeedLeg) { + var ret PatchedWritablePowerOutletRequestFeedLeg + return ret + } + return *o.FeedLeg +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetFeedLegOk() (*PatchedWritablePowerOutletRequestFeedLeg, bool) { + if o == nil || IsNil(o.FeedLeg) { + return nil, false + } + return o.FeedLeg, true +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasFeedLeg() bool { + if o != nil && !IsNil(o.FeedLeg) { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given PatchedWritablePowerOutletRequestFeedLeg and assigns it to the FeedLeg field. +func (o *WritablePowerOutletRequest) SetFeedLeg(v PatchedWritablePowerOutletRequestFeedLeg) { + o.FeedLeg = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePowerOutletRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePowerOutletRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritablePowerOutletRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritablePowerOutletRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritablePowerOutletRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritablePowerOutletRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritablePowerOutletRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritablePowerOutletRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritablePowerOutletRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritablePowerOutletRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePowerOutletRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if !IsNil(o.FeedLeg) { + toSerialize["feed_leg"] = o.FeedLeg + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePowerOutletRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePowerOutletRequest := _WritablePowerOutletRequest{} + + err = json.Unmarshal(data, &varWritablePowerOutletRequest) + + if err != nil { + return err + } + + *o = WritablePowerOutletRequest(varWritablePowerOutletRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePowerOutletRequest struct { + value *WritablePowerOutletRequest + isSet bool +} + +func (v NullableWritablePowerOutletRequest) Get() *WritablePowerOutletRequest { + return v.value +} + +func (v *NullableWritablePowerOutletRequest) Set(val *WritablePowerOutletRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePowerOutletRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePowerOutletRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePowerOutletRequest(val *WritablePowerOutletRequest) *NullableWritablePowerOutletRequest { + return &NullableWritablePowerOutletRequest{value: val, isSet: true} +} + +func (v NullableWritablePowerOutletRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePowerOutletRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_outlet_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_outlet_template_request.go new file mode 100644 index 00000000..aea3fb9c --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_outlet_template_request.go @@ -0,0 +1,460 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePowerOutletTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePowerOutletTemplateRequest{} + +// WritablePowerOutletTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritablePowerOutletTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerOutletTemplateRequestType `json:"type,omitempty"` + PowerPort NullableInt32 `json:"power_port,omitempty"` + FeedLeg *PatchedWritablePowerOutletRequestFeedLeg `json:"feed_leg,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePowerOutletTemplateRequest WritablePowerOutletTemplateRequest + +// NewWritablePowerOutletTemplateRequest instantiates a new WritablePowerOutletTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePowerOutletTemplateRequest(name string) *WritablePowerOutletTemplateRequest { + this := WritablePowerOutletTemplateRequest{} + this.Name = name + return &this +} + +// NewWritablePowerOutletTemplateRequestWithDefaults instantiates a new WritablePowerOutletTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePowerOutletTemplateRequestWithDefaults() *WritablePowerOutletTemplateRequest { + this := WritablePowerOutletTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerOutletTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerOutletTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *WritablePowerOutletTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *WritablePowerOutletTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *WritablePowerOutletTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *WritablePowerOutletTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerOutletTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerOutletTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *WritablePowerOutletTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *WritablePowerOutletTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *WritablePowerOutletTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *WritablePowerOutletTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *WritablePowerOutletTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritablePowerOutletTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritablePowerOutletTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritablePowerOutletTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritablePowerOutletTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritablePowerOutletTemplateRequest) GetType() PatchedWritablePowerOutletTemplateRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerOutletTemplateRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletTemplateRequest) GetTypeOk() (*PatchedWritablePowerOutletTemplateRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritablePowerOutletTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerOutletTemplateRequestType and assigns it to the Type field. +func (o *WritablePowerOutletTemplateRequest) SetType(v PatchedWritablePowerOutletTemplateRequestType) { + o.Type = &v +} + +// GetPowerPort returns the PowerPort field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerOutletTemplateRequest) GetPowerPort() int32 { + if o == nil || IsNil(o.PowerPort.Get()) { + var ret int32 + return ret + } + return *o.PowerPort.Get() +} + +// GetPowerPortOk returns a tuple with the PowerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerOutletTemplateRequest) GetPowerPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PowerPort.Get(), o.PowerPort.IsSet() +} + +// HasPowerPort returns a boolean if a field has been set. +func (o *WritablePowerOutletTemplateRequest) HasPowerPort() bool { + if o != nil && o.PowerPort.IsSet() { + return true + } + + return false +} + +// SetPowerPort gets a reference to the given NullableInt32 and assigns it to the PowerPort field. +func (o *WritablePowerOutletTemplateRequest) SetPowerPort(v int32) { + o.PowerPort.Set(&v) +} + +// SetPowerPortNil sets the value for PowerPort to be an explicit nil +func (o *WritablePowerOutletTemplateRequest) SetPowerPortNil() { + o.PowerPort.Set(nil) +} + +// UnsetPowerPort ensures that no value is present for PowerPort, not even an explicit nil +func (o *WritablePowerOutletTemplateRequest) UnsetPowerPort() { + o.PowerPort.Unset() +} + +// GetFeedLeg returns the FeedLeg field value if set, zero value otherwise. +func (o *WritablePowerOutletTemplateRequest) GetFeedLeg() PatchedWritablePowerOutletRequestFeedLeg { + if o == nil || IsNil(o.FeedLeg) { + var ret PatchedWritablePowerOutletRequestFeedLeg + return ret + } + return *o.FeedLeg +} + +// GetFeedLegOk returns a tuple with the FeedLeg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletTemplateRequest) GetFeedLegOk() (*PatchedWritablePowerOutletRequestFeedLeg, bool) { + if o == nil || IsNil(o.FeedLeg) { + return nil, false + } + return o.FeedLeg, true +} + +// HasFeedLeg returns a boolean if a field has been set. +func (o *WritablePowerOutletTemplateRequest) HasFeedLeg() bool { + if o != nil && !IsNil(o.FeedLeg) { + return true + } + + return false +} + +// SetFeedLeg gets a reference to the given PatchedWritablePowerOutletRequestFeedLeg and assigns it to the FeedLeg field. +func (o *WritablePowerOutletTemplateRequest) SetFeedLeg(v PatchedWritablePowerOutletRequestFeedLeg) { + o.FeedLeg = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePowerOutletTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerOutletTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePowerOutletTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePowerOutletTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritablePowerOutletTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePowerOutletTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.PowerPort.IsSet() { + toSerialize["power_port"] = o.PowerPort.Get() + } + if !IsNil(o.FeedLeg) { + toSerialize["feed_leg"] = o.FeedLeg + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePowerOutletTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePowerOutletTemplateRequest := _WritablePowerOutletTemplateRequest{} + + err = json.Unmarshal(data, &varWritablePowerOutletTemplateRequest) + + if err != nil { + return err + } + + *o = WritablePowerOutletTemplateRequest(varWritablePowerOutletTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "power_port") + delete(additionalProperties, "feed_leg") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePowerOutletTemplateRequest struct { + value *WritablePowerOutletTemplateRequest + isSet bool +} + +func (v NullableWritablePowerOutletTemplateRequest) Get() *WritablePowerOutletTemplateRequest { + return v.value +} + +func (v *NullableWritablePowerOutletTemplateRequest) Set(val *WritablePowerOutletTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePowerOutletTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePowerOutletTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePowerOutletTemplateRequest(val *WritablePowerOutletTemplateRequest) *NullableWritablePowerOutletTemplateRequest { + return &NullableWritablePowerOutletTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritablePowerOutletTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePowerOutletTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_panel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_panel_request.go new file mode 100644 index 00000000..09b12628 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_panel_request.go @@ -0,0 +1,391 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePowerPanelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePowerPanelRequest{} + +// WritablePowerPanelRequest Adds support for custom fields and tags. +type WritablePowerPanelRequest struct { + Site int32 `json:"site"` + Location NullableInt32 `json:"location,omitempty"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePowerPanelRequest WritablePowerPanelRequest + +// NewWritablePowerPanelRequest instantiates a new WritablePowerPanelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePowerPanelRequest(site int32, name string) *WritablePowerPanelRequest { + this := WritablePowerPanelRequest{} + this.Site = site + this.Name = name + return &this +} + +// NewWritablePowerPanelRequestWithDefaults instantiates a new WritablePowerPanelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePowerPanelRequestWithDefaults() *WritablePowerPanelRequest { + this := WritablePowerPanelRequest{} + return &this +} + +// GetSite returns the Site field value +func (o *WritablePowerPanelRequest) GetSite() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *WritablePowerPanelRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *WritablePowerPanelRequest) SetSite(v int32) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPanelRequest) GetLocation() int32 { + if o == nil || IsNil(o.Location.Get()) { + var ret int32 + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPanelRequest) GetLocationOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *WritablePowerPanelRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableInt32 and assigns it to the Location field. +func (o *WritablePowerPanelRequest) SetLocation(v int32) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *WritablePowerPanelRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *WritablePowerPanelRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetName returns the Name field value +func (o *WritablePowerPanelRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritablePowerPanelRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritablePowerPanelRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePowerPanelRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPanelRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePowerPanelRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePowerPanelRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritablePowerPanelRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPanelRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritablePowerPanelRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritablePowerPanelRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritablePowerPanelRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPanelRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritablePowerPanelRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritablePowerPanelRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritablePowerPanelRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPanelRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritablePowerPanelRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritablePowerPanelRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritablePowerPanelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePowerPanelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePowerPanelRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "site", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePowerPanelRequest := _WritablePowerPanelRequest{} + + err = json.Unmarshal(data, &varWritablePowerPanelRequest) + + if err != nil { + return err + } + + *o = WritablePowerPanelRequest(varWritablePowerPanelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePowerPanelRequest struct { + value *WritablePowerPanelRequest + isSet bool +} + +func (v NullableWritablePowerPanelRequest) Get() *WritablePowerPanelRequest { + return v.value +} + +func (v *NullableWritablePowerPanelRequest) Set(val *WritablePowerPanelRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePowerPanelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePowerPanelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePowerPanelRequest(val *WritablePowerPanelRequest) *NullableWritablePowerPanelRequest { + return &NullableWritablePowerPanelRequest{value: val, isSet: true} +} + +func (v NullableWritablePowerPanelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePowerPanelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_port_request.go new file mode 100644 index 00000000..37cd841a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_port_request.go @@ -0,0 +1,565 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePowerPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePowerPortRequest{} + +// WritablePowerPortRequest Adds support for custom fields and tags. +type WritablePowerPortRequest struct { + Device int32 `json:"device"` + Module NullableInt32 `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerPortRequestType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePowerPortRequest WritablePowerPortRequest + +// NewWritablePowerPortRequest instantiates a new WritablePowerPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePowerPortRequest(device int32, name string) *WritablePowerPortRequest { + this := WritablePowerPortRequest{} + this.Device = device + this.Name = name + return &this +} + +// NewWritablePowerPortRequestWithDefaults instantiates a new WritablePowerPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePowerPortRequestWithDefaults() *WritablePowerPortRequest { + this := WritablePowerPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritablePowerPortRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritablePowerPortRequest) SetDevice(v int32) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *WritablePowerPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *WritablePowerPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *WritablePowerPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *WritablePowerPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritablePowerPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritablePowerPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritablePowerPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritablePowerPortRequest) GetType() PatchedWritablePowerPortRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerPortRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetTypeOk() (*PatchedWritablePowerPortRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerPortRequestType and assigns it to the Type field. +func (o *WritablePowerPortRequest) SetType(v PatchedWritablePowerPortRequestType) { + o.Type = &v +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPortRequest) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPortRequest) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *WritablePowerPortRequest) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *WritablePowerPortRequest) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *WritablePowerPortRequest) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPortRequest) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPortRequest) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *WritablePowerPortRequest) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *WritablePowerPortRequest) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *WritablePowerPortRequest) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePowerPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePowerPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritablePowerPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritablePowerPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritablePowerPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritablePowerPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritablePowerPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritablePowerPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritablePowerPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritablePowerPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePowerPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePowerPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePowerPortRequest := _WritablePowerPortRequest{} + + err = json.Unmarshal(data, &varWritablePowerPortRequest) + + if err != nil { + return err + } + + *o = WritablePowerPortRequest(varWritablePowerPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePowerPortRequest struct { + value *WritablePowerPortRequest + isSet bool +} + +func (v NullableWritablePowerPortRequest) Get() *WritablePowerPortRequest { + return v.value +} + +func (v *NullableWritablePowerPortRequest) Set(val *WritablePowerPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePowerPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePowerPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePowerPortRequest(val *WritablePowerPortRequest) *NullableWritablePowerPortRequest { + return &NullableWritablePowerPortRequest{value: val, isSet: true} +} + +func (v NullableWritablePowerPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePowerPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_port_template_request.go new file mode 100644 index 00000000..205f9ee7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_power_port_template_request.go @@ -0,0 +1,473 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePowerPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePowerPortTemplateRequest{} + +// WritablePowerPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritablePowerPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type *PatchedWritablePowerPortTemplateRequestType `json:"type,omitempty"` + // Maximum power draw (watts) + MaximumDraw NullableInt32 `json:"maximum_draw,omitempty"` + // Allocated power draw (watts) + AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePowerPortTemplateRequest WritablePowerPortTemplateRequest + +// NewWritablePowerPortTemplateRequest instantiates a new WritablePowerPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePowerPortTemplateRequest(name string) *WritablePowerPortTemplateRequest { + this := WritablePowerPortTemplateRequest{} + this.Name = name + return &this +} + +// NewWritablePowerPortTemplateRequestWithDefaults instantiates a new WritablePowerPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePowerPortTemplateRequestWithDefaults() *WritablePowerPortTemplateRequest { + this := WritablePowerPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *WritablePowerPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *WritablePowerPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *WritablePowerPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *WritablePowerPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *WritablePowerPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *WritablePowerPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *WritablePowerPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *WritablePowerPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *WritablePowerPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritablePowerPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritablePowerPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritablePowerPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritablePowerPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritablePowerPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritablePowerPortTemplateRequest) GetType() PatchedWritablePowerPortTemplateRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritablePowerPortTemplateRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortTemplateRequest) GetTypeOk() (*PatchedWritablePowerPortTemplateRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritablePowerPortTemplateRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritablePowerPortTemplateRequestType and assigns it to the Type field. +func (o *WritablePowerPortTemplateRequest) SetType(v PatchedWritablePowerPortTemplateRequestType) { + o.Type = &v +} + +// GetMaximumDraw returns the MaximumDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPortTemplateRequest) GetMaximumDraw() int32 { + if o == nil || IsNil(o.MaximumDraw.Get()) { + var ret int32 + return ret + } + return *o.MaximumDraw.Get() +} + +// GetMaximumDrawOk returns a tuple with the MaximumDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPortTemplateRequest) GetMaximumDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaximumDraw.Get(), o.MaximumDraw.IsSet() +} + +// HasMaximumDraw returns a boolean if a field has been set. +func (o *WritablePowerPortTemplateRequest) HasMaximumDraw() bool { + if o != nil && o.MaximumDraw.IsSet() { + return true + } + + return false +} + +// SetMaximumDraw gets a reference to the given NullableInt32 and assigns it to the MaximumDraw field. +func (o *WritablePowerPortTemplateRequest) SetMaximumDraw(v int32) { + o.MaximumDraw.Set(&v) +} + +// SetMaximumDrawNil sets the value for MaximumDraw to be an explicit nil +func (o *WritablePowerPortTemplateRequest) SetMaximumDrawNil() { + o.MaximumDraw.Set(nil) +} + +// UnsetMaximumDraw ensures that no value is present for MaximumDraw, not even an explicit nil +func (o *WritablePowerPortTemplateRequest) UnsetMaximumDraw() { + o.MaximumDraw.Unset() +} + +// GetAllocatedDraw returns the AllocatedDraw field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePowerPortTemplateRequest) GetAllocatedDraw() int32 { + if o == nil || IsNil(o.AllocatedDraw.Get()) { + var ret int32 + return ret + } + return *o.AllocatedDraw.Get() +} + +// GetAllocatedDrawOk returns a tuple with the AllocatedDraw field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePowerPortTemplateRequest) GetAllocatedDrawOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.AllocatedDraw.Get(), o.AllocatedDraw.IsSet() +} + +// HasAllocatedDraw returns a boolean if a field has been set. +func (o *WritablePowerPortTemplateRequest) HasAllocatedDraw() bool { + if o != nil && o.AllocatedDraw.IsSet() { + return true + } + + return false +} + +// SetAllocatedDraw gets a reference to the given NullableInt32 and assigns it to the AllocatedDraw field. +func (o *WritablePowerPortTemplateRequest) SetAllocatedDraw(v int32) { + o.AllocatedDraw.Set(&v) +} + +// SetAllocatedDrawNil sets the value for AllocatedDraw to be an explicit nil +func (o *WritablePowerPortTemplateRequest) SetAllocatedDrawNil() { + o.AllocatedDraw.Set(nil) +} + +// UnsetAllocatedDraw ensures that no value is present for AllocatedDraw, not even an explicit nil +func (o *WritablePowerPortTemplateRequest) UnsetAllocatedDraw() { + o.AllocatedDraw.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePowerPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePowerPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePowerPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePowerPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritablePowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePowerPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.MaximumDraw.IsSet() { + toSerialize["maximum_draw"] = o.MaximumDraw.Get() + } + if o.AllocatedDraw.IsSet() { + toSerialize["allocated_draw"] = o.AllocatedDraw.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePowerPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePowerPortTemplateRequest := _WritablePowerPortTemplateRequest{} + + err = json.Unmarshal(data, &varWritablePowerPortTemplateRequest) + + if err != nil { + return err + } + + *o = WritablePowerPortTemplateRequest(varWritablePowerPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "maximum_draw") + delete(additionalProperties, "allocated_draw") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePowerPortTemplateRequest struct { + value *WritablePowerPortTemplateRequest + isSet bool +} + +func (v NullableWritablePowerPortTemplateRequest) Get() *WritablePowerPortTemplateRequest { + return v.value +} + +func (v *NullableWritablePowerPortTemplateRequest) Set(val *WritablePowerPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePowerPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePowerPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePowerPortTemplateRequest(val *WritablePowerPortTemplateRequest) *NullableWritablePowerPortTemplateRequest { + return &NullableWritablePowerPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritablePowerPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePowerPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_prefix_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_prefix_request.go new file mode 100644 index 00000000..12e0d5a7 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_prefix_request.go @@ -0,0 +1,668 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritablePrefixRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritablePrefixRequest{} + +// WritablePrefixRequest Adds support for custom fields and tags. +type WritablePrefixRequest struct { + Prefix string `json:"prefix"` + Site NullableInt32 `json:"site,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Vlan NullableInt32 `json:"vlan,omitempty"` + Status *PatchedWritablePrefixRequestStatus `json:"status,omitempty"` + // The primary function of this prefix + Role NullableInt32 `json:"role,omitempty"` + // All IP addresses within this prefix are considered usable + IsPool *bool `json:"is_pool,omitempty"` + // Treat as 100% utilized + MarkUtilized *bool `json:"mark_utilized,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritablePrefixRequest WritablePrefixRequest + +// NewWritablePrefixRequest instantiates a new WritablePrefixRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritablePrefixRequest(prefix string) *WritablePrefixRequest { + this := WritablePrefixRequest{} + this.Prefix = prefix + return &this +} + +// NewWritablePrefixRequestWithDefaults instantiates a new WritablePrefixRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritablePrefixRequestWithDefaults() *WritablePrefixRequest { + this := WritablePrefixRequest{} + return &this +} + +// GetPrefix returns the Prefix field value +func (o *WritablePrefixRequest) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *WritablePrefixRequest) SetPrefix(v string) { + o.Prefix = v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePrefixRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePrefixRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *WritablePrefixRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *WritablePrefixRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *WritablePrefixRequest) UnsetSite() { + o.Site.Unset() +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePrefixRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePrefixRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *WritablePrefixRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *WritablePrefixRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *WritablePrefixRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePrefixRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePrefixRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritablePrefixRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritablePrefixRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritablePrefixRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePrefixRequest) GetVlan() int32 { + if o == nil || IsNil(o.Vlan.Get()) { + var ret int32 + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePrefixRequest) GetVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableInt32 and assigns it to the Vlan field. +func (o *WritablePrefixRequest) SetVlan(v int32) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *WritablePrefixRequest) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *WritablePrefixRequest) UnsetVlan() { + o.Vlan.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritablePrefixRequest) GetStatus() PatchedWritablePrefixRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritablePrefixRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetStatusOk() (*PatchedWritablePrefixRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritablePrefixRequestStatus and assigns it to the Status field. +func (o *WritablePrefixRequest) SetStatus(v PatchedWritablePrefixRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritablePrefixRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritablePrefixRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *WritablePrefixRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *WritablePrefixRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *WritablePrefixRequest) UnsetRole() { + o.Role.Unset() +} + +// GetIsPool returns the IsPool field value if set, zero value otherwise. +func (o *WritablePrefixRequest) GetIsPool() bool { + if o == nil || IsNil(o.IsPool) { + var ret bool + return ret + } + return *o.IsPool +} + +// GetIsPoolOk returns a tuple with the IsPool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetIsPoolOk() (*bool, bool) { + if o == nil || IsNil(o.IsPool) { + return nil, false + } + return o.IsPool, true +} + +// HasIsPool returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasIsPool() bool { + if o != nil && !IsNil(o.IsPool) { + return true + } + + return false +} + +// SetIsPool gets a reference to the given bool and assigns it to the IsPool field. +func (o *WritablePrefixRequest) SetIsPool(v bool) { + o.IsPool = &v +} + +// GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. +func (o *WritablePrefixRequest) GetMarkUtilized() bool { + if o == nil || IsNil(o.MarkUtilized) { + var ret bool + return ret + } + return *o.MarkUtilized +} + +// GetMarkUtilizedOk returns a tuple with the MarkUtilized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetMarkUtilizedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkUtilized) { + return nil, false + } + return o.MarkUtilized, true +} + +// HasMarkUtilized returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasMarkUtilized() bool { + if o != nil && !IsNil(o.MarkUtilized) { + return true + } + + return false +} + +// SetMarkUtilized gets a reference to the given bool and assigns it to the MarkUtilized field. +func (o *WritablePrefixRequest) SetMarkUtilized(v bool) { + o.MarkUtilized = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritablePrefixRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritablePrefixRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritablePrefixRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritablePrefixRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritablePrefixRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritablePrefixRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritablePrefixRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritablePrefixRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritablePrefixRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritablePrefixRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritablePrefixRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritablePrefixRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prefix"] = o.Prefix + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.IsPool) { + toSerialize["is_pool"] = o.IsPool + } + if !IsNil(o.MarkUtilized) { + toSerialize["mark_utilized"] = o.MarkUtilized + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritablePrefixRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritablePrefixRequest := _WritablePrefixRequest{} + + err = json.Unmarshal(data, &varWritablePrefixRequest) + + if err != nil { + return err + } + + *o = WritablePrefixRequest(varWritablePrefixRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "site") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tenant") + delete(additionalProperties, "vlan") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "is_pool") + delete(additionalProperties, "mark_utilized") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritablePrefixRequest struct { + value *WritablePrefixRequest + isSet bool +} + +func (v NullableWritablePrefixRequest) Get() *WritablePrefixRequest { + return v.value +} + +func (v *NullableWritablePrefixRequest) Set(val *WritablePrefixRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritablePrefixRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritablePrefixRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritablePrefixRequest(val *WritablePrefixRequest) *NullableWritablePrefixRequest { + return &NullableWritablePrefixRequest{value: val, isSet: true} +} + +func (v NullableWritablePrefixRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritablePrefixRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_account_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_account_request.go new file mode 100644 index 00000000..ae737831 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_account_request.go @@ -0,0 +1,380 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableProviderAccountRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableProviderAccountRequest{} + +// WritableProviderAccountRequest Adds support for custom fields and tags. +type WritableProviderAccountRequest struct { + Provider int32 `json:"provider"` + Name *string `json:"name,omitempty"` + Account string `json:"account"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableProviderAccountRequest WritableProviderAccountRequest + +// NewWritableProviderAccountRequest instantiates a new WritableProviderAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableProviderAccountRequest(provider int32, account string) *WritableProviderAccountRequest { + this := WritableProviderAccountRequest{} + this.Provider = provider + this.Account = account + return &this +} + +// NewWritableProviderAccountRequestWithDefaults instantiates a new WritableProviderAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableProviderAccountRequestWithDefaults() *WritableProviderAccountRequest { + this := WritableProviderAccountRequest{} + return &this +} + +// GetProvider returns the Provider field value +func (o *WritableProviderAccountRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *WritableProviderAccountRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *WritableProviderAccountRequest) SetProvider(v int32) { + o.Provider = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *WritableProviderAccountRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderAccountRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *WritableProviderAccountRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *WritableProviderAccountRequest) SetName(v string) { + o.Name = &v +} + +// GetAccount returns the Account field value +func (o *WritableProviderAccountRequest) GetAccount() string { + if o == nil { + var ret string + return ret + } + + return o.Account +} + +// GetAccountOk returns a tuple with the Account field value +// and a boolean to check if the value has been set. +func (o *WritableProviderAccountRequest) GetAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Account, true +} + +// SetAccount sets field value +func (o *WritableProviderAccountRequest) SetAccount(v string) { + o.Account = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableProviderAccountRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderAccountRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableProviderAccountRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableProviderAccountRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableProviderAccountRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderAccountRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableProviderAccountRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableProviderAccountRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableProviderAccountRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderAccountRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableProviderAccountRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableProviderAccountRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableProviderAccountRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderAccountRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableProviderAccountRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableProviderAccountRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableProviderAccountRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableProviderAccountRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["provider"] = o.Provider + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["account"] = o.Account + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableProviderAccountRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "provider", + "account", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableProviderAccountRequest := _WritableProviderAccountRequest{} + + err = json.Unmarshal(data, &varWritableProviderAccountRequest) + + if err != nil { + return err + } + + *o = WritableProviderAccountRequest(varWritableProviderAccountRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "account") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableProviderAccountRequest struct { + value *WritableProviderAccountRequest + isSet bool +} + +func (v NullableWritableProviderAccountRequest) Get() *WritableProviderAccountRequest { + return v.value +} + +func (v *NullableWritableProviderAccountRequest) Set(val *WritableProviderAccountRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableProviderAccountRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableProviderAccountRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableProviderAccountRequest(val *WritableProviderAccountRequest) *NullableWritableProviderAccountRequest { + return &NullableWritableProviderAccountRequest{value: val, isSet: true} +} + +func (v NullableWritableProviderAccountRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableProviderAccountRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_network_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_network_request.go new file mode 100644 index 00000000..3581f930 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_network_request.go @@ -0,0 +1,380 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableProviderNetworkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableProviderNetworkRequest{} + +// WritableProviderNetworkRequest Adds support for custom fields and tags. +type WritableProviderNetworkRequest struct { + Provider int32 `json:"provider"` + Name string `json:"name"` + ServiceId *string `json:"service_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableProviderNetworkRequest WritableProviderNetworkRequest + +// NewWritableProviderNetworkRequest instantiates a new WritableProviderNetworkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableProviderNetworkRequest(provider int32, name string) *WritableProviderNetworkRequest { + this := WritableProviderNetworkRequest{} + this.Provider = provider + this.Name = name + return &this +} + +// NewWritableProviderNetworkRequestWithDefaults instantiates a new WritableProviderNetworkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableProviderNetworkRequestWithDefaults() *WritableProviderNetworkRequest { + this := WritableProviderNetworkRequest{} + return &this +} + +// GetProvider returns the Provider field value +func (o *WritableProviderNetworkRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *WritableProviderNetworkRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *WritableProviderNetworkRequest) SetProvider(v int32) { + o.Provider = v +} + +// GetName returns the Name field value +func (o *WritableProviderNetworkRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableProviderNetworkRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableProviderNetworkRequest) SetName(v string) { + o.Name = v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *WritableProviderNetworkRequest) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderNetworkRequest) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *WritableProviderNetworkRequest) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *WritableProviderNetworkRequest) SetServiceId(v string) { + o.ServiceId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableProviderNetworkRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderNetworkRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableProviderNetworkRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableProviderNetworkRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableProviderNetworkRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderNetworkRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableProviderNetworkRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableProviderNetworkRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableProviderNetworkRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderNetworkRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableProviderNetworkRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableProviderNetworkRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableProviderNetworkRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderNetworkRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableProviderNetworkRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableProviderNetworkRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableProviderNetworkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableProviderNetworkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["provider"] = o.Provider + toSerialize["name"] = o.Name + if !IsNil(o.ServiceId) { + toSerialize["service_id"] = o.ServiceId + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableProviderNetworkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "provider", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableProviderNetworkRequest := _WritableProviderNetworkRequest{} + + err = json.Unmarshal(data, &varWritableProviderNetworkRequest) + + if err != nil { + return err + } + + *o = WritableProviderNetworkRequest(varWritableProviderNetworkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "provider") + delete(additionalProperties, "name") + delete(additionalProperties, "service_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableProviderNetworkRequest struct { + value *WritableProviderNetworkRequest + isSet bool +} + +func (v NullableWritableProviderNetworkRequest) Get() *WritableProviderNetworkRequest { + return v.value +} + +func (v *NullableWritableProviderNetworkRequest) Set(val *WritableProviderNetworkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableProviderNetworkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableProviderNetworkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableProviderNetworkRequest(val *WritableProviderNetworkRequest) *NullableWritableProviderNetworkRequest { + return &NullableWritableProviderNetworkRequest{value: val, isSet: true} +} + +func (v NullableWritableProviderNetworkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableProviderNetworkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_request.go new file mode 100644 index 00000000..52b1a7fb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_provider_request.go @@ -0,0 +1,410 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableProviderRequest{} + +// WritableProviderRequest Adds support for custom fields and tags. +type WritableProviderRequest struct { + // Full name of the provider + Name string `json:"name"` + Slug string `json:"slug"` + Accounts []int32 `json:"accounts"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableProviderRequest WritableProviderRequest + +// NewWritableProviderRequest instantiates a new WritableProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableProviderRequest(name string, slug string, accounts []int32) *WritableProviderRequest { + this := WritableProviderRequest{} + this.Name = name + this.Slug = slug + this.Accounts = accounts + return &this +} + +// NewWritableProviderRequestWithDefaults instantiates a new WritableProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableProviderRequestWithDefaults() *WritableProviderRequest { + this := WritableProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableProviderRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableProviderRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableProviderRequest) SetSlug(v string) { + o.Slug = v +} + +// GetAccounts returns the Accounts field value +func (o *WritableProviderRequest) GetAccounts() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Accounts +} + +// GetAccountsOk returns a tuple with the Accounts field value +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetAccountsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Accounts, true +} + +// SetAccounts sets field value +func (o *WritableProviderRequest) SetAccounts(v []int32) { + o.Accounts = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableProviderRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableProviderRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableProviderRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableProviderRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableProviderRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableProviderRequest) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *WritableProviderRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *WritableProviderRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *WritableProviderRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableProviderRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableProviderRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableProviderRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableProviderRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableProviderRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableProviderRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableProviderRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["accounts"] = o.Accounts + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "accounts", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableProviderRequest := _WritableProviderRequest{} + + err = json.Unmarshal(data, &varWritableProviderRequest) + + if err != nil { + return err + } + + *o = WritableProviderRequest(varWritableProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "accounts") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableProviderRequest struct { + value *WritableProviderRequest + isSet bool +} + +func (v NullableWritableProviderRequest) Get() *WritableProviderRequest { + return v.value +} + +func (v *NullableWritableProviderRequest) Set(val *WritableProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableProviderRequest(val *WritableProviderRequest) *NullableWritableProviderRequest { + return &NullableWritableProviderRequest{value: val, isSet: true} +} + +func (v NullableWritableProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rack_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rack_request.go new file mode 100644 index 00000000..95d288a2 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rack_request.go @@ -0,0 +1,1165 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableRackRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableRackRequest{} + +// WritableRackRequest Adds support for custom fields and tags. +type WritableRackRequest struct { + Name string `json:"name"` + FacilityId NullableString `json:"facility_id,omitempty"` + Site int32 `json:"site"` + Location NullableInt32 `json:"location,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableRackRequestStatus `json:"status,omitempty"` + // Functional role + Role NullableInt32 `json:"role,omitempty"` + Serial *string `json:"serial,omitempty"` + // A unique tag used to identify this rack + AssetTag NullableString `json:"asset_tag,omitempty"` + Type *PatchedWritableRackRequestType `json:"type,omitempty"` + Width *PatchedWritableRackRequestWidth `json:"width,omitempty"` + // Height in rack units + UHeight *int32 `json:"u_height,omitempty"` + // Starting unit for rack + StartingUnit *int32 `json:"starting_unit,omitempty"` + Weight NullableFloat64 `json:"weight,omitempty"` + // Maximum load capacity for the rack + MaxWeight NullableInt32 `json:"max_weight,omitempty"` + WeightUnit *DeviceTypeWeightUnitValue `json:"weight_unit,omitempty"` + // Units are numbered top-to-bottom + DescUnits *bool `json:"desc_units,omitempty"` + // Outer dimension of rack (width) + OuterWidth NullableInt32 `json:"outer_width,omitempty"` + // Outer dimension of rack (depth) + OuterDepth NullableInt32 `json:"outer_depth,omitempty"` + OuterUnit *PatchedWritableRackRequestOuterUnit `json:"outer_unit,omitempty"` + // Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails. + MountingDepth NullableInt32 `json:"mounting_depth,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableRackRequest WritableRackRequest + +// NewWritableRackRequest instantiates a new WritableRackRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableRackRequest(name string, site int32) *WritableRackRequest { + this := WritableRackRequest{} + this.Name = name + this.Site = site + return &this +} + +// NewWritableRackRequestWithDefaults instantiates a new WritableRackRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableRackRequestWithDefaults() *WritableRackRequest { + this := WritableRackRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableRackRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableRackRequest) SetName(v string) { + o.Name = v +} + +// GetFacilityId returns the FacilityId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetFacilityId() string { + if o == nil || IsNil(o.FacilityId.Get()) { + var ret string + return ret + } + return *o.FacilityId.Get() +} + +// GetFacilityIdOk returns a tuple with the FacilityId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetFacilityIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FacilityId.Get(), o.FacilityId.IsSet() +} + +// HasFacilityId returns a boolean if a field has been set. +func (o *WritableRackRequest) HasFacilityId() bool { + if o != nil && o.FacilityId.IsSet() { + return true + } + + return false +} + +// SetFacilityId gets a reference to the given NullableString and assigns it to the FacilityId field. +func (o *WritableRackRequest) SetFacilityId(v string) { + o.FacilityId.Set(&v) +} + +// SetFacilityIdNil sets the value for FacilityId to be an explicit nil +func (o *WritableRackRequest) SetFacilityIdNil() { + o.FacilityId.Set(nil) +} + +// UnsetFacilityId ensures that no value is present for FacilityId, not even an explicit nil +func (o *WritableRackRequest) UnsetFacilityId() { + o.FacilityId.Unset() +} + +// GetSite returns the Site field value +func (o *WritableRackRequest) GetSite() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Site +} + +// GetSiteOk returns a tuple with the Site field value +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Site, true +} + +// SetSite sets field value +func (o *WritableRackRequest) SetSite(v int32) { + o.Site = v +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetLocation() int32 { + if o == nil || IsNil(o.Location.Get()) { + var ret int32 + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetLocationOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *WritableRackRequest) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableInt32 and assigns it to the Location field. +func (o *WritableRackRequest) SetLocation(v int32) { + o.Location.Set(&v) +} + +// SetLocationNil sets the value for Location to be an explicit nil +func (o *WritableRackRequest) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *WritableRackRequest) UnsetLocation() { + o.Location.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableRackRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableRackRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableRackRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableRackRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableRackRequest) GetStatus() PatchedWritableRackRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableRackRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetStatusOk() (*PatchedWritableRackRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableRackRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableRackRequestStatus and assigns it to the Status field. +func (o *WritableRackRequest) SetStatus(v PatchedWritableRackRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableRackRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *WritableRackRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *WritableRackRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *WritableRackRequest) UnsetRole() { + o.Role.Unset() +} + +// GetSerial returns the Serial field value if set, zero value otherwise. +func (o *WritableRackRequest) GetSerial() string { + if o == nil || IsNil(o.Serial) { + var ret string + return ret + } + return *o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetSerialOk() (*string, bool) { + if o == nil || IsNil(o.Serial) { + return nil, false + } + return o.Serial, true +} + +// HasSerial returns a boolean if a field has been set. +func (o *WritableRackRequest) HasSerial() bool { + if o != nil && !IsNil(o.Serial) { + return true + } + + return false +} + +// SetSerial gets a reference to the given string and assigns it to the Serial field. +func (o *WritableRackRequest) SetSerial(v string) { + o.Serial = &v +} + +// GetAssetTag returns the AssetTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetAssetTag() string { + if o == nil || IsNil(o.AssetTag.Get()) { + var ret string + return ret + } + return *o.AssetTag.Get() +} + +// GetAssetTagOk returns a tuple with the AssetTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetAssetTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssetTag.Get(), o.AssetTag.IsSet() +} + +// HasAssetTag returns a boolean if a field has been set. +func (o *WritableRackRequest) HasAssetTag() bool { + if o != nil && o.AssetTag.IsSet() { + return true + } + + return false +} + +// SetAssetTag gets a reference to the given NullableString and assigns it to the AssetTag field. +func (o *WritableRackRequest) SetAssetTag(v string) { + o.AssetTag.Set(&v) +} + +// SetAssetTagNil sets the value for AssetTag to be an explicit nil +func (o *WritableRackRequest) SetAssetTagNil() { + o.AssetTag.Set(nil) +} + +// UnsetAssetTag ensures that no value is present for AssetTag, not even an explicit nil +func (o *WritableRackRequest) UnsetAssetTag() { + o.AssetTag.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WritableRackRequest) GetType() PatchedWritableRackRequestType { + if o == nil || IsNil(o.Type) { + var ret PatchedWritableRackRequestType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetTypeOk() (*PatchedWritableRackRequestType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WritableRackRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PatchedWritableRackRequestType and assigns it to the Type field. +func (o *WritableRackRequest) SetType(v PatchedWritableRackRequestType) { + o.Type = &v +} + +// GetWidth returns the Width field value if set, zero value otherwise. +func (o *WritableRackRequest) GetWidth() PatchedWritableRackRequestWidth { + if o == nil || IsNil(o.Width) { + var ret PatchedWritableRackRequestWidth + return ret + } + return *o.Width +} + +// GetWidthOk returns a tuple with the Width field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetWidthOk() (*PatchedWritableRackRequestWidth, bool) { + if o == nil || IsNil(o.Width) { + return nil, false + } + return o.Width, true +} + +// HasWidth returns a boolean if a field has been set. +func (o *WritableRackRequest) HasWidth() bool { + if o != nil && !IsNil(o.Width) { + return true + } + + return false +} + +// SetWidth gets a reference to the given PatchedWritableRackRequestWidth and assigns it to the Width field. +func (o *WritableRackRequest) SetWidth(v PatchedWritableRackRequestWidth) { + o.Width = &v +} + +// GetUHeight returns the UHeight field value if set, zero value otherwise. +func (o *WritableRackRequest) GetUHeight() int32 { + if o == nil || IsNil(o.UHeight) { + var ret int32 + return ret + } + return *o.UHeight +} + +// GetUHeightOk returns a tuple with the UHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetUHeightOk() (*int32, bool) { + if o == nil || IsNil(o.UHeight) { + return nil, false + } + return o.UHeight, true +} + +// HasUHeight returns a boolean if a field has been set. +func (o *WritableRackRequest) HasUHeight() bool { + if o != nil && !IsNil(o.UHeight) { + return true + } + + return false +} + +// SetUHeight gets a reference to the given int32 and assigns it to the UHeight field. +func (o *WritableRackRequest) SetUHeight(v int32) { + o.UHeight = &v +} + +// GetStartingUnit returns the StartingUnit field value if set, zero value otherwise. +func (o *WritableRackRequest) GetStartingUnit() int32 { + if o == nil || IsNil(o.StartingUnit) { + var ret int32 + return ret + } + return *o.StartingUnit +} + +// GetStartingUnitOk returns a tuple with the StartingUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetStartingUnitOk() (*int32, bool) { + if o == nil || IsNil(o.StartingUnit) { + return nil, false + } + return o.StartingUnit, true +} + +// HasStartingUnit returns a boolean if a field has been set. +func (o *WritableRackRequest) HasStartingUnit() bool { + if o != nil && !IsNil(o.StartingUnit) { + return true + } + + return false +} + +// SetStartingUnit gets a reference to the given int32 and assigns it to the StartingUnit field. +func (o *WritableRackRequest) SetStartingUnit(v int32) { + o.StartingUnit = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetWeight() float64 { + if o == nil || IsNil(o.Weight.Get()) { + var ret float64 + return ret + } + return *o.Weight.Get() +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetWeightOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Weight.Get(), o.Weight.IsSet() +} + +// HasWeight returns a boolean if a field has been set. +func (o *WritableRackRequest) HasWeight() bool { + if o != nil && o.Weight.IsSet() { + return true + } + + return false +} + +// SetWeight gets a reference to the given NullableFloat64 and assigns it to the Weight field. +func (o *WritableRackRequest) SetWeight(v float64) { + o.Weight.Set(&v) +} + +// SetWeightNil sets the value for Weight to be an explicit nil +func (o *WritableRackRequest) SetWeightNil() { + o.Weight.Set(nil) +} + +// UnsetWeight ensures that no value is present for Weight, not even an explicit nil +func (o *WritableRackRequest) UnsetWeight() { + o.Weight.Unset() +} + +// GetMaxWeight returns the MaxWeight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetMaxWeight() int32 { + if o == nil || IsNil(o.MaxWeight.Get()) { + var ret int32 + return ret + } + return *o.MaxWeight.Get() +} + +// GetMaxWeightOk returns a tuple with the MaxWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetMaxWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxWeight.Get(), o.MaxWeight.IsSet() +} + +// HasMaxWeight returns a boolean if a field has been set. +func (o *WritableRackRequest) HasMaxWeight() bool { + if o != nil && o.MaxWeight.IsSet() { + return true + } + + return false +} + +// SetMaxWeight gets a reference to the given NullableInt32 and assigns it to the MaxWeight field. +func (o *WritableRackRequest) SetMaxWeight(v int32) { + o.MaxWeight.Set(&v) +} + +// SetMaxWeightNil sets the value for MaxWeight to be an explicit nil +func (o *WritableRackRequest) SetMaxWeightNil() { + o.MaxWeight.Set(nil) +} + +// UnsetMaxWeight ensures that no value is present for MaxWeight, not even an explicit nil +func (o *WritableRackRequest) UnsetMaxWeight() { + o.MaxWeight.Unset() +} + +// GetWeightUnit returns the WeightUnit field value if set, zero value otherwise. +func (o *WritableRackRequest) GetWeightUnit() DeviceTypeWeightUnitValue { + if o == nil || IsNil(o.WeightUnit) { + var ret DeviceTypeWeightUnitValue + return ret + } + return *o.WeightUnit +} + +// GetWeightUnitOk returns a tuple with the WeightUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetWeightUnitOk() (*DeviceTypeWeightUnitValue, bool) { + if o == nil || IsNil(o.WeightUnit) { + return nil, false + } + return o.WeightUnit, true +} + +// HasWeightUnit returns a boolean if a field has been set. +func (o *WritableRackRequest) HasWeightUnit() bool { + if o != nil && !IsNil(o.WeightUnit) { + return true + } + + return false +} + +// SetWeightUnit gets a reference to the given DeviceTypeWeightUnitValue and assigns it to the WeightUnit field. +func (o *WritableRackRequest) SetWeightUnit(v DeviceTypeWeightUnitValue) { + o.WeightUnit = &v +} + +// GetDescUnits returns the DescUnits field value if set, zero value otherwise. +func (o *WritableRackRequest) GetDescUnits() bool { + if o == nil || IsNil(o.DescUnits) { + var ret bool + return ret + } + return *o.DescUnits +} + +// GetDescUnitsOk returns a tuple with the DescUnits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetDescUnitsOk() (*bool, bool) { + if o == nil || IsNil(o.DescUnits) { + return nil, false + } + return o.DescUnits, true +} + +// HasDescUnits returns a boolean if a field has been set. +func (o *WritableRackRequest) HasDescUnits() bool { + if o != nil && !IsNil(o.DescUnits) { + return true + } + + return false +} + +// SetDescUnits gets a reference to the given bool and assigns it to the DescUnits field. +func (o *WritableRackRequest) SetDescUnits(v bool) { + o.DescUnits = &v +} + +// GetOuterWidth returns the OuterWidth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetOuterWidth() int32 { + if o == nil || IsNil(o.OuterWidth.Get()) { + var ret int32 + return ret + } + return *o.OuterWidth.Get() +} + +// GetOuterWidthOk returns a tuple with the OuterWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetOuterWidthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterWidth.Get(), o.OuterWidth.IsSet() +} + +// HasOuterWidth returns a boolean if a field has been set. +func (o *WritableRackRequest) HasOuterWidth() bool { + if o != nil && o.OuterWidth.IsSet() { + return true + } + + return false +} + +// SetOuterWidth gets a reference to the given NullableInt32 and assigns it to the OuterWidth field. +func (o *WritableRackRequest) SetOuterWidth(v int32) { + o.OuterWidth.Set(&v) +} + +// SetOuterWidthNil sets the value for OuterWidth to be an explicit nil +func (o *WritableRackRequest) SetOuterWidthNil() { + o.OuterWidth.Set(nil) +} + +// UnsetOuterWidth ensures that no value is present for OuterWidth, not even an explicit nil +func (o *WritableRackRequest) UnsetOuterWidth() { + o.OuterWidth.Unset() +} + +// GetOuterDepth returns the OuterDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetOuterDepth() int32 { + if o == nil || IsNil(o.OuterDepth.Get()) { + var ret int32 + return ret + } + return *o.OuterDepth.Get() +} + +// GetOuterDepthOk returns a tuple with the OuterDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetOuterDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OuterDepth.Get(), o.OuterDepth.IsSet() +} + +// HasOuterDepth returns a boolean if a field has been set. +func (o *WritableRackRequest) HasOuterDepth() bool { + if o != nil && o.OuterDepth.IsSet() { + return true + } + + return false +} + +// SetOuterDepth gets a reference to the given NullableInt32 and assigns it to the OuterDepth field. +func (o *WritableRackRequest) SetOuterDepth(v int32) { + o.OuterDepth.Set(&v) +} + +// SetOuterDepthNil sets the value for OuterDepth to be an explicit nil +func (o *WritableRackRequest) SetOuterDepthNil() { + o.OuterDepth.Set(nil) +} + +// UnsetOuterDepth ensures that no value is present for OuterDepth, not even an explicit nil +func (o *WritableRackRequest) UnsetOuterDepth() { + o.OuterDepth.Unset() +} + +// GetOuterUnit returns the OuterUnit field value if set, zero value otherwise. +func (o *WritableRackRequest) GetOuterUnit() PatchedWritableRackRequestOuterUnit { + if o == nil || IsNil(o.OuterUnit) { + var ret PatchedWritableRackRequestOuterUnit + return ret + } + return *o.OuterUnit +} + +// GetOuterUnitOk returns a tuple with the OuterUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetOuterUnitOk() (*PatchedWritableRackRequestOuterUnit, bool) { + if o == nil || IsNil(o.OuterUnit) { + return nil, false + } + return o.OuterUnit, true +} + +// HasOuterUnit returns a boolean if a field has been set. +func (o *WritableRackRequest) HasOuterUnit() bool { + if o != nil && !IsNil(o.OuterUnit) { + return true + } + + return false +} + +// SetOuterUnit gets a reference to the given PatchedWritableRackRequestOuterUnit and assigns it to the OuterUnit field. +func (o *WritableRackRequest) SetOuterUnit(v PatchedWritableRackRequestOuterUnit) { + o.OuterUnit = &v +} + +// GetMountingDepth returns the MountingDepth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackRequest) GetMountingDepth() int32 { + if o == nil || IsNil(o.MountingDepth.Get()) { + var ret int32 + return ret + } + return *o.MountingDepth.Get() +} + +// GetMountingDepthOk returns a tuple with the MountingDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackRequest) GetMountingDepthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MountingDepth.Get(), o.MountingDepth.IsSet() +} + +// HasMountingDepth returns a boolean if a field has been set. +func (o *WritableRackRequest) HasMountingDepth() bool { + if o != nil && o.MountingDepth.IsSet() { + return true + } + + return false +} + +// SetMountingDepth gets a reference to the given NullableInt32 and assigns it to the MountingDepth field. +func (o *WritableRackRequest) SetMountingDepth(v int32) { + o.MountingDepth.Set(&v) +} + +// SetMountingDepthNil sets the value for MountingDepth to be an explicit nil +func (o *WritableRackRequest) SetMountingDepthNil() { + o.MountingDepth.Set(nil) +} + +// UnsetMountingDepth ensures that no value is present for MountingDepth, not even an explicit nil +func (o *WritableRackRequest) UnsetMountingDepth() { + o.MountingDepth.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableRackRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableRackRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableRackRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableRackRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableRackRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableRackRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableRackRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableRackRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableRackRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableRackRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableRackRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableRackRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableRackRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableRackRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.FacilityId.IsSet() { + toSerialize["facility_id"] = o.FacilityId.Get() + } + toSerialize["site"] = o.Site + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Serial) { + toSerialize["serial"] = o.Serial + } + if o.AssetTag.IsSet() { + toSerialize["asset_tag"] = o.AssetTag.Get() + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Width) { + toSerialize["width"] = o.Width + } + if !IsNil(o.UHeight) { + toSerialize["u_height"] = o.UHeight + } + if !IsNil(o.StartingUnit) { + toSerialize["starting_unit"] = o.StartingUnit + } + if o.Weight.IsSet() { + toSerialize["weight"] = o.Weight.Get() + } + if o.MaxWeight.IsSet() { + toSerialize["max_weight"] = o.MaxWeight.Get() + } + if !IsNil(o.WeightUnit) { + toSerialize["weight_unit"] = o.WeightUnit + } + if !IsNil(o.DescUnits) { + toSerialize["desc_units"] = o.DescUnits + } + if o.OuterWidth.IsSet() { + toSerialize["outer_width"] = o.OuterWidth.Get() + } + if o.OuterDepth.IsSet() { + toSerialize["outer_depth"] = o.OuterDepth.Get() + } + if !IsNil(o.OuterUnit) { + toSerialize["outer_unit"] = o.OuterUnit + } + if o.MountingDepth.IsSet() { + toSerialize["mounting_depth"] = o.MountingDepth.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableRackRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "site", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableRackRequest := _WritableRackRequest{} + + err = json.Unmarshal(data, &varWritableRackRequest) + + if err != nil { + return err + } + + *o = WritableRackRequest(varWritableRackRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "facility_id") + delete(additionalProperties, "site") + delete(additionalProperties, "location") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "serial") + delete(additionalProperties, "asset_tag") + delete(additionalProperties, "type") + delete(additionalProperties, "width") + delete(additionalProperties, "u_height") + delete(additionalProperties, "starting_unit") + delete(additionalProperties, "weight") + delete(additionalProperties, "max_weight") + delete(additionalProperties, "weight_unit") + delete(additionalProperties, "desc_units") + delete(additionalProperties, "outer_width") + delete(additionalProperties, "outer_depth") + delete(additionalProperties, "outer_unit") + delete(additionalProperties, "mounting_depth") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableRackRequest struct { + value *WritableRackRequest + isSet bool +} + +func (v NullableWritableRackRequest) Get() *WritableRackRequest { + return v.value +} + +func (v *NullableWritableRackRequest) Set(val *WritableRackRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableRackRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableRackRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableRackRequest(val *WritableRackRequest) *NullableWritableRackRequest { + return &NullableWritableRackRequest{value: val, isSet: true} +} + +func (v NullableWritableRackRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableRackRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rack_reservation_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rack_reservation_request.go new file mode 100644 index 00000000..981f945f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rack_reservation_request.go @@ -0,0 +1,412 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableRackReservationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableRackReservationRequest{} + +// WritableRackReservationRequest Adds support for custom fields and tags. +type WritableRackReservationRequest struct { + Rack int32 `json:"rack"` + Units []int32 `json:"units"` + User int32 `json:"user"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description string `json:"description"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableRackReservationRequest WritableRackReservationRequest + +// NewWritableRackReservationRequest instantiates a new WritableRackReservationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableRackReservationRequest(rack int32, units []int32, user int32, description string) *WritableRackReservationRequest { + this := WritableRackReservationRequest{} + this.Rack = rack + this.Units = units + this.User = user + this.Description = description + return &this +} + +// NewWritableRackReservationRequestWithDefaults instantiates a new WritableRackReservationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableRackReservationRequestWithDefaults() *WritableRackReservationRequest { + this := WritableRackReservationRequest{} + return &this +} + +// GetRack returns the Rack field value +func (o *WritableRackReservationRequest) GetRack() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Rack +} + +// GetRackOk returns a tuple with the Rack field value +// and a boolean to check if the value has been set. +func (o *WritableRackReservationRequest) GetRackOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Rack, true +} + +// SetRack sets field value +func (o *WritableRackReservationRequest) SetRack(v int32) { + o.Rack = v +} + +// GetUnits returns the Units field value +func (o *WritableRackReservationRequest) GetUnits() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Units +} + +// GetUnitsOk returns a tuple with the Units field value +// and a boolean to check if the value has been set. +func (o *WritableRackReservationRequest) GetUnitsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Units, true +} + +// SetUnits sets field value +func (o *WritableRackReservationRequest) SetUnits(v []int32) { + o.Units = v +} + +// GetUser returns the User field value +func (o *WritableRackReservationRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *WritableRackReservationRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *WritableRackReservationRequest) SetUser(v int32) { + o.User = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRackReservationRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRackReservationRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableRackReservationRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableRackReservationRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableRackReservationRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableRackReservationRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value +func (o *WritableRackReservationRequest) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *WritableRackReservationRequest) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WritableRackReservationRequest) SetDescription(v string) { + o.Description = v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableRackReservationRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackReservationRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableRackReservationRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableRackReservationRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableRackReservationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackReservationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableRackReservationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableRackReservationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableRackReservationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRackReservationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableRackReservationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableRackReservationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableRackReservationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableRackReservationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["rack"] = o.Rack + toSerialize["units"] = o.Units + toSerialize["user"] = o.User + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + toSerialize["description"] = o.Description + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableRackReservationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "rack", + "units", + "user", + "description", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableRackReservationRequest := _WritableRackReservationRequest{} + + err = json.Unmarshal(data, &varWritableRackReservationRequest) + + if err != nil { + return err + } + + *o = WritableRackReservationRequest(varWritableRackReservationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "rack") + delete(additionalProperties, "units") + delete(additionalProperties, "user") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableRackReservationRequest struct { + value *WritableRackReservationRequest + isSet bool +} + +func (v NullableWritableRackReservationRequest) Get() *WritableRackReservationRequest { + return v.value +} + +func (v *NullableWritableRackReservationRequest) Set(val *WritableRackReservationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableRackReservationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableRackReservationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableRackReservationRequest(val *WritableRackReservationRequest) *NullableWritableRackReservationRequest { + return &NullableWritableRackReservationRequest{value: val, isSet: true} +} + +func (v NullableWritableRackReservationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableRackReservationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rear_port_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rear_port_request.go new file mode 100644 index 00000000..d20023ba --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rear_port_request.go @@ -0,0 +1,534 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableRearPortRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableRearPortRequest{} + +// WritableRearPortRequest Adds support for custom fields and tags. +type WritableRearPortRequest struct { + Device int32 `json:"device"` + Module NullableInt32 `json:"module,omitempty"` + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + // Number of front ports which may be mapped + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + // Treat as if a cable is connected + MarkConnected *bool `json:"mark_connected,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableRearPortRequest WritableRearPortRequest + +// NewWritableRearPortRequest instantiates a new WritableRearPortRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableRearPortRequest(device int32, name string, type_ FrontPortTypeValue) *WritableRearPortRequest { + this := WritableRearPortRequest{} + this.Device = device + this.Name = name + this.Type = type_ + return &this +} + +// NewWritableRearPortRequestWithDefaults instantiates a new WritableRearPortRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableRearPortRequestWithDefaults() *WritableRearPortRequest { + this := WritableRearPortRequest{} + return &this +} + +// GetDevice returns the Device field value +func (o *WritableRearPortRequest) GetDevice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *WritableRearPortRequest) SetDevice(v int32) { + o.Device = v +} + +// GetModule returns the Module field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRearPortRequest) GetModule() int32 { + if o == nil || IsNil(o.Module.Get()) { + var ret int32 + return ret + } + return *o.Module.Get() +} + +// GetModuleOk returns a tuple with the Module field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRearPortRequest) GetModuleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Module.Get(), o.Module.IsSet() +} + +// HasModule returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasModule() bool { + if o != nil && o.Module.IsSet() { + return true + } + + return false +} + +// SetModule gets a reference to the given NullableInt32 and assigns it to the Module field. +func (o *WritableRearPortRequest) SetModule(v int32) { + o.Module.Set(&v) +} + +// SetModuleNil sets the value for Module to be an explicit nil +func (o *WritableRearPortRequest) SetModuleNil() { + o.Module.Set(nil) +} + +// UnsetModule ensures that no value is present for Module, not even an explicit nil +func (o *WritableRearPortRequest) UnsetModule() { + o.Module.Unset() +} + +// GetName returns the Name field value +func (o *WritableRearPortRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableRearPortRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableRearPortRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableRearPortRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *WritableRearPortRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableRearPortRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *WritableRearPortRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *WritableRearPortRequest) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *WritableRearPortRequest) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *WritableRearPortRequest) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableRearPortRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableRearPortRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMarkConnected returns the MarkConnected field value if set, zero value otherwise. +func (o *WritableRearPortRequest) GetMarkConnected() bool { + if o == nil || IsNil(o.MarkConnected) { + var ret bool + return ret + } + return *o.MarkConnected +} + +// GetMarkConnectedOk returns a tuple with the MarkConnected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetMarkConnectedOk() (*bool, bool) { + if o == nil || IsNil(o.MarkConnected) { + return nil, false + } + return o.MarkConnected, true +} + +// HasMarkConnected returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasMarkConnected() bool { + if o != nil && !IsNil(o.MarkConnected) { + return true + } + + return false +} + +// SetMarkConnected gets a reference to the given bool and assigns it to the MarkConnected field. +func (o *WritableRearPortRequest) SetMarkConnected(v bool) { + o.MarkConnected = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableRearPortRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableRearPortRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableRearPortRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableRearPortRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableRearPortRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableRearPortRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableRearPortRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + if o.Module.IsSet() { + toSerialize["module"] = o.Module.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.MarkConnected) { + toSerialize["mark_connected"] = o.MarkConnected + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableRearPortRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableRearPortRequest := _WritableRearPortRequest{} + + err = json.Unmarshal(data, &varWritableRearPortRequest) + + if err != nil { + return err + } + + *o = WritableRearPortRequest(varWritableRearPortRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "module") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + delete(additionalProperties, "mark_connected") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableRearPortRequest struct { + value *WritableRearPortRequest + isSet bool +} + +func (v NullableWritableRearPortRequest) Get() *WritableRearPortRequest { + return v.value +} + +func (v *NullableWritableRearPortRequest) Set(val *WritableRearPortRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableRearPortRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableRearPortRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableRearPortRequest(val *WritableRearPortRequest) *NullableWritableRearPortRequest { + return &NullableWritableRearPortRequest{value: val, isSet: true} +} + +func (v NullableWritableRearPortRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableRearPortRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rear_port_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rear_port_template_request.go new file mode 100644 index 00000000..c2ae33f3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_rear_port_template_request.go @@ -0,0 +1,441 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableRearPortTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableRearPortTemplateRequest{} + +// WritableRearPortTemplateRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableRearPortTemplateRequest struct { + DeviceType NullableInt32 `json:"device_type,omitempty"` + ModuleType NullableInt32 `json:"module_type,omitempty"` + // {module} is accepted as a substitution for the module bay position when attached to a module type. + Name string `json:"name"` + // Physical label + Label *string `json:"label,omitempty"` + Type FrontPortTypeValue `json:"type"` + Color *string `json:"color,omitempty"` + Positions *int32 `json:"positions,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableRearPortTemplateRequest WritableRearPortTemplateRequest + +// NewWritableRearPortTemplateRequest instantiates a new WritableRearPortTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableRearPortTemplateRequest(name string, type_ FrontPortTypeValue) *WritableRearPortTemplateRequest { + this := WritableRearPortTemplateRequest{} + this.Name = name + this.Type = type_ + return &this +} + +// NewWritableRearPortTemplateRequestWithDefaults instantiates a new WritableRearPortTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableRearPortTemplateRequestWithDefaults() *WritableRearPortTemplateRequest { + this := WritableRearPortTemplateRequest{} + return &this +} + +// GetDeviceType returns the DeviceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRearPortTemplateRequest) GetDeviceType() int32 { + if o == nil || IsNil(o.DeviceType.Get()) { + var ret int32 + return ret + } + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRearPortTemplateRequest) GetDeviceTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// HasDeviceType returns a boolean if a field has been set. +func (o *WritableRearPortTemplateRequest) HasDeviceType() bool { + if o != nil && o.DeviceType.IsSet() { + return true + } + + return false +} + +// SetDeviceType gets a reference to the given NullableInt32 and assigns it to the DeviceType field. +func (o *WritableRearPortTemplateRequest) SetDeviceType(v int32) { + o.DeviceType.Set(&v) +} + +// SetDeviceTypeNil sets the value for DeviceType to be an explicit nil +func (o *WritableRearPortTemplateRequest) SetDeviceTypeNil() { + o.DeviceType.Set(nil) +} + +// UnsetDeviceType ensures that no value is present for DeviceType, not even an explicit nil +func (o *WritableRearPortTemplateRequest) UnsetDeviceType() { + o.DeviceType.Unset() +} + +// GetModuleType returns the ModuleType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRearPortTemplateRequest) GetModuleType() int32 { + if o == nil || IsNil(o.ModuleType.Get()) { + var ret int32 + return ret + } + return *o.ModuleType.Get() +} + +// GetModuleTypeOk returns a tuple with the ModuleType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRearPortTemplateRequest) GetModuleTypeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ModuleType.Get(), o.ModuleType.IsSet() +} + +// HasModuleType returns a boolean if a field has been set. +func (o *WritableRearPortTemplateRequest) HasModuleType() bool { + if o != nil && o.ModuleType.IsSet() { + return true + } + + return false +} + +// SetModuleType gets a reference to the given NullableInt32 and assigns it to the ModuleType field. +func (o *WritableRearPortTemplateRequest) SetModuleType(v int32) { + o.ModuleType.Set(&v) +} + +// SetModuleTypeNil sets the value for ModuleType to be an explicit nil +func (o *WritableRearPortTemplateRequest) SetModuleTypeNil() { + o.ModuleType.Set(nil) +} + +// UnsetModuleType ensures that no value is present for ModuleType, not even an explicit nil +func (o *WritableRearPortTemplateRequest) UnsetModuleType() { + o.ModuleType.Unset() +} + +// GetName returns the Name field value +func (o *WritableRearPortTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableRearPortTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableRearPortTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *WritableRearPortTemplateRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortTemplateRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *WritableRearPortTemplateRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *WritableRearPortTemplateRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value +func (o *WritableRearPortTemplateRequest) GetType() FrontPortTypeValue { + if o == nil { + var ret FrontPortTypeValue + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WritableRearPortTemplateRequest) GetTypeOk() (*FrontPortTypeValue, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WritableRearPortTemplateRequest) SetType(v FrontPortTypeValue) { + o.Type = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *WritableRearPortTemplateRequest) GetColor() string { + if o == nil || IsNil(o.Color) { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortTemplateRequest) GetColorOk() (*string, bool) { + if o == nil || IsNil(o.Color) { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *WritableRearPortTemplateRequest) HasColor() bool { + if o != nil && !IsNil(o.Color) { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *WritableRearPortTemplateRequest) SetColor(v string) { + o.Color = &v +} + +// GetPositions returns the Positions field value if set, zero value otherwise. +func (o *WritableRearPortTemplateRequest) GetPositions() int32 { + if o == nil || IsNil(o.Positions) { + var ret int32 + return ret + } + return *o.Positions +} + +// GetPositionsOk returns a tuple with the Positions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortTemplateRequest) GetPositionsOk() (*int32, bool) { + if o == nil || IsNil(o.Positions) { + return nil, false + } + return o.Positions, true +} + +// HasPositions returns a boolean if a field has been set. +func (o *WritableRearPortTemplateRequest) HasPositions() bool { + if o != nil && !IsNil(o.Positions) { + return true + } + + return false +} + +// SetPositions gets a reference to the given int32 and assigns it to the Positions field. +func (o *WritableRearPortTemplateRequest) SetPositions(v int32) { + o.Positions = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableRearPortTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRearPortTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableRearPortTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableRearPortTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritableRearPortTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableRearPortTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceType.IsSet() { + toSerialize["device_type"] = o.DeviceType.Get() + } + if o.ModuleType.IsSet() { + toSerialize["module_type"] = o.ModuleType.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + toSerialize["type"] = o.Type + if !IsNil(o.Color) { + toSerialize["color"] = o.Color + } + if !IsNil(o.Positions) { + toSerialize["positions"] = o.Positions + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableRearPortTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableRearPortTemplateRequest := _WritableRearPortTemplateRequest{} + + err = json.Unmarshal(data, &varWritableRearPortTemplateRequest) + + if err != nil { + return err + } + + *o = WritableRearPortTemplateRequest(varWritableRearPortTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_type") + delete(additionalProperties, "module_type") + delete(additionalProperties, "name") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "color") + delete(additionalProperties, "positions") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableRearPortTemplateRequest struct { + value *WritableRearPortTemplateRequest + isSet bool +} + +func (v NullableWritableRearPortTemplateRequest) Get() *WritableRearPortTemplateRequest { + return v.value +} + +func (v *NullableWritableRearPortTemplateRequest) Set(val *WritableRearPortTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableRearPortTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableRearPortTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableRearPortTemplateRequest(val *WritableRearPortTemplateRequest) *NullableWritableRearPortTemplateRequest { + return &NullableWritableRearPortTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableRearPortTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableRearPortTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_region_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_region_request.go new file mode 100644 index 00000000..dd4d1a1b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_region_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableRegionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableRegionRequest{} + +// WritableRegionRequest Extends PrimaryModelSerializer to include MPTT support. +type WritableRegionRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableRegionRequest WritableRegionRequest + +// NewWritableRegionRequest instantiates a new WritableRegionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableRegionRequest(name string, slug string) *WritableRegionRequest { + this := WritableRegionRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableRegionRequestWithDefaults instantiates a new WritableRegionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableRegionRequestWithDefaults() *WritableRegionRequest { + this := WritableRegionRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableRegionRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableRegionRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableRegionRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableRegionRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableRegionRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableRegionRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRegionRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRegionRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableRegionRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableRegionRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableRegionRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableRegionRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableRegionRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRegionRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableRegionRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableRegionRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableRegionRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRegionRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableRegionRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableRegionRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableRegionRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRegionRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableRegionRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableRegionRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableRegionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableRegionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableRegionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableRegionRequest := _WritableRegionRequest{} + + err = json.Unmarshal(data, &varWritableRegionRequest) + + if err != nil { + return err + } + + *o = WritableRegionRequest(varWritableRegionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableRegionRequest struct { + value *WritableRegionRequest + isSet bool +} + +func (v NullableWritableRegionRequest) Get() *WritableRegionRequest { + return v.value +} + +func (v *NullableWritableRegionRequest) Set(val *WritableRegionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableRegionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableRegionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableRegionRequest(val *WritableRegionRequest) *NullableWritableRegionRequest { + return &NullableWritableRegionRequest{value: val, isSet: true} +} + +func (v NullableWritableRegionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableRegionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_route_target_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_route_target_request.go new file mode 100644 index 00000000..07d61be3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_route_target_request.go @@ -0,0 +1,363 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableRouteTargetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableRouteTargetRequest{} + +// WritableRouteTargetRequest Adds support for custom fields and tags. +type WritableRouteTargetRequest struct { + // Route target value (formatted in accordance with RFC 4360) + Name string `json:"name"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableRouteTargetRequest WritableRouteTargetRequest + +// NewWritableRouteTargetRequest instantiates a new WritableRouteTargetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableRouteTargetRequest(name string) *WritableRouteTargetRequest { + this := WritableRouteTargetRequest{} + this.Name = name + return &this +} + +// NewWritableRouteTargetRequestWithDefaults instantiates a new WritableRouteTargetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableRouteTargetRequestWithDefaults() *WritableRouteTargetRequest { + this := WritableRouteTargetRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableRouteTargetRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableRouteTargetRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableRouteTargetRequest) SetName(v string) { + o.Name = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableRouteTargetRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableRouteTargetRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableRouteTargetRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableRouteTargetRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableRouteTargetRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableRouteTargetRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableRouteTargetRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRouteTargetRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableRouteTargetRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableRouteTargetRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableRouteTargetRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRouteTargetRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableRouteTargetRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableRouteTargetRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableRouteTargetRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRouteTargetRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableRouteTargetRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableRouteTargetRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableRouteTargetRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableRouteTargetRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableRouteTargetRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableRouteTargetRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableRouteTargetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableRouteTargetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableRouteTargetRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableRouteTargetRequest := _WritableRouteTargetRequest{} + + err = json.Unmarshal(data, &varWritableRouteTargetRequest) + + if err != nil { + return err + } + + *o = WritableRouteTargetRequest(varWritableRouteTargetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableRouteTargetRequest struct { + value *WritableRouteTargetRequest + isSet bool +} + +func (v NullableWritableRouteTargetRequest) Get() *WritableRouteTargetRequest { + return v.value +} + +func (v *NullableWritableRouteTargetRequest) Set(val *WritableRouteTargetRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableRouteTargetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableRouteTargetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableRouteTargetRequest(val *WritableRouteTargetRequest) *NullableWritableRouteTargetRequest { + return &NullableWritableRouteTargetRequest{value: val, isSet: true} +} + +func (v NullableWritableRouteTargetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableRouteTargetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_service_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_service_request.go new file mode 100644 index 00000000..f1dc6ec6 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_service_request.go @@ -0,0 +1,506 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableServiceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableServiceRequest{} + +// WritableServiceRequest Adds support for custom fields and tags. +type WritableServiceRequest struct { + Device NullableInt32 `json:"device,omitempty"` + VirtualMachine NullableInt32 `json:"virtual_machine,omitempty"` + Name string `json:"name"` + Ports []int32 `json:"ports"` + Protocol PatchedWritableServiceRequestProtocol `json:"protocol"` + // The specific IP addresses (if any) to which this service is bound + Ipaddresses []int32 `json:"ipaddresses,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableServiceRequest WritableServiceRequest + +// NewWritableServiceRequest instantiates a new WritableServiceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableServiceRequest(name string, ports []int32, protocol PatchedWritableServiceRequestProtocol) *WritableServiceRequest { + this := WritableServiceRequest{} + this.Name = name + this.Ports = ports + this.Protocol = protocol + return &this +} + +// NewWritableServiceRequestWithDefaults instantiates a new WritableServiceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableServiceRequestWithDefaults() *WritableServiceRequest { + this := WritableServiceRequest{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableServiceRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device.Get()) { + var ret int32 + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableServiceRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *WritableServiceRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableInt32 and assigns it to the Device field. +func (o *WritableServiceRequest) SetDevice(v int32) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *WritableServiceRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *WritableServiceRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetVirtualMachine returns the VirtualMachine field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableServiceRequest) GetVirtualMachine() int32 { + if o == nil || IsNil(o.VirtualMachine.Get()) { + var ret int32 + return ret + } + return *o.VirtualMachine.Get() +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableServiceRequest) GetVirtualMachineOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.VirtualMachine.Get(), o.VirtualMachine.IsSet() +} + +// HasVirtualMachine returns a boolean if a field has been set. +func (o *WritableServiceRequest) HasVirtualMachine() bool { + if o != nil && o.VirtualMachine.IsSet() { + return true + } + + return false +} + +// SetVirtualMachine gets a reference to the given NullableInt32 and assigns it to the VirtualMachine field. +func (o *WritableServiceRequest) SetVirtualMachine(v int32) { + o.VirtualMachine.Set(&v) +} + +// SetVirtualMachineNil sets the value for VirtualMachine to be an explicit nil +func (o *WritableServiceRequest) SetVirtualMachineNil() { + o.VirtualMachine.Set(nil) +} + +// UnsetVirtualMachine ensures that no value is present for VirtualMachine, not even an explicit nil +func (o *WritableServiceRequest) UnsetVirtualMachine() { + o.VirtualMachine.Unset() +} + +// GetName returns the Name field value +func (o *WritableServiceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableServiceRequest) SetName(v string) { + o.Name = v +} + +// GetPorts returns the Ports field value +func (o *WritableServiceRequest) GetPorts() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetPortsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Ports, true +} + +// SetPorts sets field value +func (o *WritableServiceRequest) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value +func (o *WritableServiceRequest) GetProtocol() PatchedWritableServiceRequestProtocol { + if o == nil { + var ret PatchedWritableServiceRequestProtocol + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetProtocolOk() (*PatchedWritableServiceRequestProtocol, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *WritableServiceRequest) SetProtocol(v PatchedWritableServiceRequestProtocol) { + o.Protocol = v +} + +// GetIpaddresses returns the Ipaddresses field value if set, zero value otherwise. +func (o *WritableServiceRequest) GetIpaddresses() []int32 { + if o == nil || IsNil(o.Ipaddresses) { + var ret []int32 + return ret + } + return o.Ipaddresses +} + +// GetIpaddressesOk returns a tuple with the Ipaddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetIpaddressesOk() ([]int32, bool) { + if o == nil || IsNil(o.Ipaddresses) { + return nil, false + } + return o.Ipaddresses, true +} + +// HasIpaddresses returns a boolean if a field has been set. +func (o *WritableServiceRequest) HasIpaddresses() bool { + if o != nil && !IsNil(o.Ipaddresses) { + return true + } + + return false +} + +// SetIpaddresses gets a reference to the given []int32 and assigns it to the Ipaddresses field. +func (o *WritableServiceRequest) SetIpaddresses(v []int32) { + o.Ipaddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableServiceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableServiceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableServiceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableServiceRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableServiceRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableServiceRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableServiceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableServiceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableServiceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableServiceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableServiceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableServiceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableServiceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableServiceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.VirtualMachine.IsSet() { + toSerialize["virtual_machine"] = o.VirtualMachine.Get() + } + toSerialize["name"] = o.Name + toSerialize["ports"] = o.Ports + toSerialize["protocol"] = o.Protocol + if !IsNil(o.Ipaddresses) { + toSerialize["ipaddresses"] = o.Ipaddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableServiceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "ports", + "protocol", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableServiceRequest := _WritableServiceRequest{} + + err = json.Unmarshal(data, &varWritableServiceRequest) + + if err != nil { + return err + } + + *o = WritableServiceRequest(varWritableServiceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "ipaddresses") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableServiceRequest struct { + value *WritableServiceRequest + isSet bool +} + +func (v NullableWritableServiceRequest) Get() *WritableServiceRequest { + return v.value +} + +func (v *NullableWritableServiceRequest) Set(val *WritableServiceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableServiceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableServiceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableServiceRequest(val *WritableServiceRequest) *NullableWritableServiceRequest { + return &NullableWritableServiceRequest{value: val, isSet: true} +} + +func (v NullableWritableServiceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableServiceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_service_template_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_service_template_request.go new file mode 100644 index 00000000..e330e091 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_service_template_request.go @@ -0,0 +1,372 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableServiceTemplateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableServiceTemplateRequest{} + +// WritableServiceTemplateRequest Adds support for custom fields and tags. +type WritableServiceTemplateRequest struct { + Name string `json:"name"` + Ports []int32 `json:"ports"` + Protocol PatchedWritableServiceRequestProtocol `json:"protocol"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableServiceTemplateRequest WritableServiceTemplateRequest + +// NewWritableServiceTemplateRequest instantiates a new WritableServiceTemplateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableServiceTemplateRequest(name string, ports []int32, protocol PatchedWritableServiceRequestProtocol) *WritableServiceTemplateRequest { + this := WritableServiceTemplateRequest{} + this.Name = name + this.Ports = ports + this.Protocol = protocol + return &this +} + +// NewWritableServiceTemplateRequestWithDefaults instantiates a new WritableServiceTemplateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableServiceTemplateRequestWithDefaults() *WritableServiceTemplateRequest { + this := WritableServiceTemplateRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableServiceTemplateRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableServiceTemplateRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableServiceTemplateRequest) SetName(v string) { + o.Name = v +} + +// GetPorts returns the Ports field value +func (o *WritableServiceTemplateRequest) GetPorts() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value +// and a boolean to check if the value has been set. +func (o *WritableServiceTemplateRequest) GetPortsOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Ports, true +} + +// SetPorts sets field value +func (o *WritableServiceTemplateRequest) SetPorts(v []int32) { + o.Ports = v +} + +// GetProtocol returns the Protocol field value +func (o *WritableServiceTemplateRequest) GetProtocol() PatchedWritableServiceRequestProtocol { + if o == nil { + var ret PatchedWritableServiceRequestProtocol + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *WritableServiceTemplateRequest) GetProtocolOk() (*PatchedWritableServiceRequestProtocol, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *WritableServiceTemplateRequest) SetProtocol(v PatchedWritableServiceRequestProtocol) { + o.Protocol = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableServiceTemplateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceTemplateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableServiceTemplateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableServiceTemplateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableServiceTemplateRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceTemplateRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableServiceTemplateRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableServiceTemplateRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableServiceTemplateRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceTemplateRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableServiceTemplateRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableServiceTemplateRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableServiceTemplateRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableServiceTemplateRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableServiceTemplateRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableServiceTemplateRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableServiceTemplateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableServiceTemplateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["ports"] = o.Ports + toSerialize["protocol"] = o.Protocol + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableServiceTemplateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "ports", + "protocol", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableServiceTemplateRequest := _WritableServiceTemplateRequest{} + + err = json.Unmarshal(data, &varWritableServiceTemplateRequest) + + if err != nil { + return err + } + + *o = WritableServiceTemplateRequest(varWritableServiceTemplateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "ports") + delete(additionalProperties, "protocol") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableServiceTemplateRequest struct { + value *WritableServiceTemplateRequest + isSet bool +} + +func (v NullableWritableServiceTemplateRequest) Get() *WritableServiceTemplateRequest { + return v.value +} + +func (v *NullableWritableServiceTemplateRequest) Set(val *WritableServiceTemplateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableServiceTemplateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableServiceTemplateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableServiceTemplateRequest(val *WritableServiceTemplateRequest) *NullableWritableServiceTemplateRequest { + return &NullableWritableServiceTemplateRequest{value: val, isSet: true} +} + +func (v NullableWritableServiceTemplateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableServiceTemplateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_site_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_site_group_request.go new file mode 100644 index 00000000..519a4b20 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_site_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableSiteGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableSiteGroupRequest{} + +// WritableSiteGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type WritableSiteGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableSiteGroupRequest WritableSiteGroupRequest + +// NewWritableSiteGroupRequest instantiates a new WritableSiteGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableSiteGroupRequest(name string, slug string) *WritableSiteGroupRequest { + this := WritableSiteGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableSiteGroupRequestWithDefaults instantiates a new WritableSiteGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableSiteGroupRequestWithDefaults() *WritableSiteGroupRequest { + this := WritableSiteGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableSiteGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableSiteGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableSiteGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableSiteGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableSiteGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableSiteGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableSiteGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableSiteGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableSiteGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableSiteGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableSiteGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableSiteGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableSiteGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableSiteGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableSiteGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableSiteGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableSiteGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableSiteGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableSiteGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableSiteGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableSiteGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableSiteGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableSiteGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableSiteGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableSiteGroupRequest := _WritableSiteGroupRequest{} + + err = json.Unmarshal(data, &varWritableSiteGroupRequest) + + if err != nil { + return err + } + + *o = WritableSiteGroupRequest(varWritableSiteGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableSiteGroupRequest struct { + value *WritableSiteGroupRequest + isSet bool +} + +func (v NullableWritableSiteGroupRequest) Get() *WritableSiteGroupRequest { + return v.value +} + +func (v *NullableWritableSiteGroupRequest) Set(val *WritableSiteGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableSiteGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableSiteGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableSiteGroupRequest(val *WritableSiteGroupRequest) *NullableWritableSiteGroupRequest { + return &NullableWritableSiteGroupRequest{value: val, isSet: true} +} + +func (v NullableWritableSiteGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableSiteGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_site_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_site_request.go new file mode 100644 index 00000000..1bcf339a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_site_request.go @@ -0,0 +1,822 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableSiteRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableSiteRequest{} + +// WritableSiteRequest Adds support for custom fields and tags. +type WritableSiteRequest struct { + // Full name of the site + Name string `json:"name"` + Slug string `json:"slug"` + Status *LocationStatusValue `json:"status,omitempty"` + Region NullableInt32 `json:"region,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + // Local facility ID or description + Facility *string `json:"facility,omitempty"` + TimeZone NullableString `json:"time_zone,omitempty"` + Description *string `json:"description,omitempty"` + // Physical location of the building + PhysicalAddress *string `json:"physical_address,omitempty"` + // If different from the physical address + ShippingAddress *string `json:"shipping_address,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Latitude NullableFloat64 `json:"latitude,omitempty"` + // GPS coordinate in decimal format (xx.yyyyyy) + Longitude NullableFloat64 `json:"longitude,omitempty"` + Comments *string `json:"comments,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableSiteRequest WritableSiteRequest + +// NewWritableSiteRequest instantiates a new WritableSiteRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableSiteRequest(name string, slug string) *WritableSiteRequest { + this := WritableSiteRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableSiteRequestWithDefaults instantiates a new WritableSiteRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableSiteRequestWithDefaults() *WritableSiteRequest { + this := WritableSiteRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableSiteRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableSiteRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableSiteRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableSiteRequest) SetSlug(v string) { + o.Slug = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetStatus() LocationStatusValue { + if o == nil || IsNil(o.Status) { + var ret LocationStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetStatusOk() (*LocationStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given LocationStatusValue and assigns it to the Status field. +func (o *WritableSiteRequest) SetStatus(v LocationStatusValue) { + o.Status = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableSiteRequest) GetRegion() int32 { + if o == nil || IsNil(o.Region.Get()) { + var ret int32 + return ret + } + return *o.Region.Get() +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableSiteRequest) GetRegionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Region.Get(), o.Region.IsSet() +} + +// HasRegion returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasRegion() bool { + if o != nil && o.Region.IsSet() { + return true + } + + return false +} + +// SetRegion gets a reference to the given NullableInt32 and assigns it to the Region field. +func (o *WritableSiteRequest) SetRegion(v int32) { + o.Region.Set(&v) +} + +// SetRegionNil sets the value for Region to be an explicit nil +func (o *WritableSiteRequest) SetRegionNil() { + o.Region.Set(nil) +} + +// UnsetRegion ensures that no value is present for Region, not even an explicit nil +func (o *WritableSiteRequest) UnsetRegion() { + o.Region.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableSiteRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableSiteRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *WritableSiteRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WritableSiteRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WritableSiteRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableSiteRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableSiteRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableSiteRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableSiteRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableSiteRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *WritableSiteRequest) SetFacility(v string) { + o.Facility = &v +} + +// GetTimeZone returns the TimeZone field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableSiteRequest) GetTimeZone() string { + if o == nil || IsNil(o.TimeZone.Get()) { + var ret string + return ret + } + return *o.TimeZone.Get() +} + +// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableSiteRequest) GetTimeZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TimeZone.Get(), o.TimeZone.IsSet() +} + +// HasTimeZone returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasTimeZone() bool { + if o != nil && o.TimeZone.IsSet() { + return true + } + + return false +} + +// SetTimeZone gets a reference to the given NullableString and assigns it to the TimeZone field. +func (o *WritableSiteRequest) SetTimeZone(v string) { + o.TimeZone.Set(&v) +} + +// SetTimeZoneNil sets the value for TimeZone to be an explicit nil +func (o *WritableSiteRequest) SetTimeZoneNil() { + o.TimeZone.Set(nil) +} + +// UnsetTimeZone ensures that no value is present for TimeZone, not even an explicit nil +func (o *WritableSiteRequest) UnsetTimeZone() { + o.TimeZone.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableSiteRequest) SetDescription(v string) { + o.Description = &v +} + +// GetPhysicalAddress returns the PhysicalAddress field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetPhysicalAddress() string { + if o == nil || IsNil(o.PhysicalAddress) { + var ret string + return ret + } + return *o.PhysicalAddress +} + +// GetPhysicalAddressOk returns a tuple with the PhysicalAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetPhysicalAddressOk() (*string, bool) { + if o == nil || IsNil(o.PhysicalAddress) { + return nil, false + } + return o.PhysicalAddress, true +} + +// HasPhysicalAddress returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasPhysicalAddress() bool { + if o != nil && !IsNil(o.PhysicalAddress) { + return true + } + + return false +} + +// SetPhysicalAddress gets a reference to the given string and assigns it to the PhysicalAddress field. +func (o *WritableSiteRequest) SetPhysicalAddress(v string) { + o.PhysicalAddress = &v +} + +// GetShippingAddress returns the ShippingAddress field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetShippingAddress() string { + if o == nil || IsNil(o.ShippingAddress) { + var ret string + return ret + } + return *o.ShippingAddress +} + +// GetShippingAddressOk returns a tuple with the ShippingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetShippingAddressOk() (*string, bool) { + if o == nil || IsNil(o.ShippingAddress) { + return nil, false + } + return o.ShippingAddress, true +} + +// HasShippingAddress returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasShippingAddress() bool { + if o != nil && !IsNil(o.ShippingAddress) { + return true + } + + return false +} + +// SetShippingAddress gets a reference to the given string and assigns it to the ShippingAddress field. +func (o *WritableSiteRequest) SetShippingAddress(v string) { + o.ShippingAddress = &v +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableSiteRequest) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude.Get()) { + var ret float64 + return ret + } + return *o.Latitude.Get() +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableSiteRequest) GetLatitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Latitude.Get(), o.Latitude.IsSet() +} + +// HasLatitude returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasLatitude() bool { + if o != nil && o.Latitude.IsSet() { + return true + } + + return false +} + +// SetLatitude gets a reference to the given NullableFloat64 and assigns it to the Latitude field. +func (o *WritableSiteRequest) SetLatitude(v float64) { + o.Latitude.Set(&v) +} + +// SetLatitudeNil sets the value for Latitude to be an explicit nil +func (o *WritableSiteRequest) SetLatitudeNil() { + o.Latitude.Set(nil) +} + +// UnsetLatitude ensures that no value is present for Latitude, not even an explicit nil +func (o *WritableSiteRequest) UnsetLatitude() { + o.Latitude.Unset() +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableSiteRequest) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude.Get()) { + var ret float64 + return ret + } + return *o.Longitude.Get() +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableSiteRequest) GetLongitudeOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Longitude.Get(), o.Longitude.IsSet() +} + +// HasLongitude returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasLongitude() bool { + if o != nil && o.Longitude.IsSet() { + return true + } + + return false +} + +// SetLongitude gets a reference to the given NullableFloat64 and assigns it to the Longitude field. +func (o *WritableSiteRequest) SetLongitude(v float64) { + o.Longitude.Set(&v) +} + +// SetLongitudeNil sets the value for Longitude to be an explicit nil +func (o *WritableSiteRequest) SetLongitudeNil() { + o.Longitude.Set(nil) +} + +// UnsetLongitude ensures that no value is present for Longitude, not even an explicit nil +func (o *WritableSiteRequest) UnsetLongitude() { + o.Longitude.Unset() +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableSiteRequest) SetComments(v string) { + o.Comments = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *WritableSiteRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableSiteRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableSiteRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableSiteRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableSiteRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableSiteRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableSiteRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableSiteRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Region.IsSet() { + toSerialize["region"] = o.Region.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if o.TimeZone.IsSet() { + toSerialize["time_zone"] = o.TimeZone.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.PhysicalAddress) { + toSerialize["physical_address"] = o.PhysicalAddress + } + if !IsNil(o.ShippingAddress) { + toSerialize["shipping_address"] = o.ShippingAddress + } + if o.Latitude.IsSet() { + toSerialize["latitude"] = o.Latitude.Get() + } + if o.Longitude.IsSet() { + toSerialize["longitude"] = o.Longitude.Get() + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableSiteRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableSiteRequest := _WritableSiteRequest{} + + err = json.Unmarshal(data, &varWritableSiteRequest) + + if err != nil { + return err + } + + *o = WritableSiteRequest(varWritableSiteRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "status") + delete(additionalProperties, "region") + delete(additionalProperties, "group") + delete(additionalProperties, "tenant") + delete(additionalProperties, "facility") + delete(additionalProperties, "time_zone") + delete(additionalProperties, "description") + delete(additionalProperties, "physical_address") + delete(additionalProperties, "shipping_address") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "comments") + delete(additionalProperties, "asns") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableSiteRequest struct { + value *WritableSiteRequest + isSet bool +} + +func (v NullableWritableSiteRequest) Get() *WritableSiteRequest { + return v.value +} + +func (v *NullableWritableSiteRequest) Set(val *WritableSiteRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableSiteRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableSiteRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableSiteRequest(val *WritableSiteRequest) *NullableWritableSiteRequest { + return &NullableWritableSiteRequest{value: val, isSet: true} +} + +func (v NullableWritableSiteRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableSiteRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tenant_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tenant_group_request.go new file mode 100644 index 00000000..f27ad9df --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tenant_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableTenantGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableTenantGroupRequest{} + +// WritableTenantGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type WritableTenantGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableTenantGroupRequest WritableTenantGroupRequest + +// NewWritableTenantGroupRequest instantiates a new WritableTenantGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableTenantGroupRequest(name string, slug string) *WritableTenantGroupRequest { + this := WritableTenantGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableTenantGroupRequestWithDefaults instantiates a new WritableTenantGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableTenantGroupRequestWithDefaults() *WritableTenantGroupRequest { + this := WritableTenantGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableTenantGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableTenantGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableTenantGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableTenantGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableTenantGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableTenantGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTenantGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTenantGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableTenantGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableTenantGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableTenantGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableTenantGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableTenantGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTenantGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableTenantGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableTenantGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableTenantGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTenantGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableTenantGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableTenantGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableTenantGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTenantGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableTenantGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableTenantGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableTenantGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableTenantGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableTenantGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableTenantGroupRequest := _WritableTenantGroupRequest{} + + err = json.Unmarshal(data, &varWritableTenantGroupRequest) + + if err != nil { + return err + } + + *o = WritableTenantGroupRequest(varWritableTenantGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableTenantGroupRequest struct { + value *WritableTenantGroupRequest + isSet bool +} + +func (v NullableWritableTenantGroupRequest) Get() *WritableTenantGroupRequest { + return v.value +} + +func (v *NullableWritableTenantGroupRequest) Set(val *WritableTenantGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableTenantGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableTenantGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableTenantGroupRequest(val *WritableTenantGroupRequest) *NullableWritableTenantGroupRequest { + return &NullableWritableTenantGroupRequest{value: val, isSet: true} +} + +func (v NullableWritableTenantGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableTenantGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tenant_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tenant_request.go new file mode 100644 index 00000000..ebd31213 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tenant_request.go @@ -0,0 +1,391 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableTenantRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableTenantRequest{} + +// WritableTenantRequest Adds support for custom fields and tags. +type WritableTenantRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Group NullableInt32 `json:"group,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableTenantRequest WritableTenantRequest + +// NewWritableTenantRequest instantiates a new WritableTenantRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableTenantRequest(name string, slug string) *WritableTenantRequest { + this := WritableTenantRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableTenantRequestWithDefaults instantiates a new WritableTenantRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableTenantRequestWithDefaults() *WritableTenantRequest { + this := WritableTenantRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableTenantRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableTenantRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableTenantRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableTenantRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableTenantRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableTenantRequest) SetSlug(v string) { + o.Slug = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTenantRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTenantRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WritableTenantRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *WritableTenantRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WritableTenantRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WritableTenantRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableTenantRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTenantRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableTenantRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableTenantRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableTenantRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTenantRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableTenantRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableTenantRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableTenantRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTenantRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableTenantRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableTenantRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableTenantRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTenantRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableTenantRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableTenantRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableTenantRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableTenantRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableTenantRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableTenantRequest := _WritableTenantRequest{} + + err = json.Unmarshal(data, &varWritableTenantRequest) + + if err != nil { + return err + } + + *o = WritableTenantRequest(varWritableTenantRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "group") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableTenantRequest struct { + value *WritableTenantRequest + isSet bool +} + +func (v NullableWritableTenantRequest) Get() *WritableTenantRequest { + return v.value +} + +func (v *NullableWritableTenantRequest) Set(val *WritableTenantRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableTenantRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableTenantRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableTenantRequest(val *WritableTenantRequest) *NullableWritableTenantRequest { + return &NullableWritableTenantRequest{value: val, isSet: true} +} + +func (v NullableWritableTenantRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableTenantRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_token_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_token_request.go new file mode 100644 index 00000000..3609630f --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_token_request.go @@ -0,0 +1,375 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the WritableTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableTokenRequest{} + +// WritableTokenRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableTokenRequest struct { + User int32 `json:"user"` + Expires NullableTime `json:"expires,omitempty"` + LastUsed NullableTime `json:"last_used,omitempty"` + Key *string `json:"key,omitempty"` + // Permit create/update/delete operations using this key + WriteEnabled *bool `json:"write_enabled,omitempty"` + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableTokenRequest WritableTokenRequest + +// NewWritableTokenRequest instantiates a new WritableTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableTokenRequest(user int32) *WritableTokenRequest { + this := WritableTokenRequest{} + this.User = user + return &this +} + +// NewWritableTokenRequestWithDefaults instantiates a new WritableTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableTokenRequestWithDefaults() *WritableTokenRequest { + this := WritableTokenRequest{} + return &this +} + +// GetUser returns the User field value +func (o *WritableTokenRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *WritableTokenRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *WritableTokenRequest) SetUser(v int32) { + o.User = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTokenRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *WritableTokenRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *WritableTokenRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *WritableTokenRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *WritableTokenRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetLastUsed returns the LastUsed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTokenRequest) GetLastUsed() time.Time { + if o == nil || IsNil(o.LastUsed.Get()) { + var ret time.Time + return ret + } + return *o.LastUsed.Get() +} + +// GetLastUsedOk returns a tuple with the LastUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTokenRequest) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUsed.Get(), o.LastUsed.IsSet() +} + +// HasLastUsed returns a boolean if a field has been set. +func (o *WritableTokenRequest) HasLastUsed() bool { + if o != nil && o.LastUsed.IsSet() { + return true + } + + return false +} + +// SetLastUsed gets a reference to the given NullableTime and assigns it to the LastUsed field. +func (o *WritableTokenRequest) SetLastUsed(v time.Time) { + o.LastUsed.Set(&v) +} + +// SetLastUsedNil sets the value for LastUsed to be an explicit nil +func (o *WritableTokenRequest) SetLastUsedNil() { + o.LastUsed.Set(nil) +} + +// UnsetLastUsed ensures that no value is present for LastUsed, not even an explicit nil +func (o *WritableTokenRequest) UnsetLastUsed() { + o.LastUsed.Unset() +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *WritableTokenRequest) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTokenRequest) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *WritableTokenRequest) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *WritableTokenRequest) SetKey(v string) { + o.Key = &v +} + +// GetWriteEnabled returns the WriteEnabled field value if set, zero value otherwise. +func (o *WritableTokenRequest) GetWriteEnabled() bool { + if o == nil || IsNil(o.WriteEnabled) { + var ret bool + return ret + } + return *o.WriteEnabled +} + +// GetWriteEnabledOk returns a tuple with the WriteEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTokenRequest) GetWriteEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.WriteEnabled) { + return nil, false + } + return o.WriteEnabled, true +} + +// HasWriteEnabled returns a boolean if a field has been set. +func (o *WritableTokenRequest) HasWriteEnabled() bool { + if o != nil && !IsNil(o.WriteEnabled) { + return true + } + + return false +} + +// SetWriteEnabled gets a reference to the given bool and assigns it to the WriteEnabled field. +func (o *WritableTokenRequest) SetWriteEnabled(v bool) { + o.WriteEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableTokenRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTokenRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableTokenRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableTokenRequest) SetDescription(v string) { + o.Description = &v +} + +func (o WritableTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if o.LastUsed.IsSet() { + toSerialize["last_used"] = o.LastUsed.Get() + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.WriteEnabled) { + toSerialize["write_enabled"] = o.WriteEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableTokenRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableTokenRequest := _WritableTokenRequest{} + + err = json.Unmarshal(data, &varWritableTokenRequest) + + if err != nil { + return err + } + + *o = WritableTokenRequest(varWritableTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "expires") + delete(additionalProperties, "last_used") + delete(additionalProperties, "key") + delete(additionalProperties, "write_enabled") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableTokenRequest struct { + value *WritableTokenRequest + isSet bool +} + +func (v NullableWritableTokenRequest) Get() *WritableTokenRequest { + return v.value +} + +func (v *NullableWritableTokenRequest) Set(val *WritableTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableTokenRequest(val *WritableTokenRequest) *NullableWritableTokenRequest { + return &NullableWritableTokenRequest{value: val, isSet: true} +} + +func (v NullableWritableTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tunnel_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tunnel_request.go new file mode 100644 index 00000000..844dba96 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tunnel_request.go @@ -0,0 +1,572 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableTunnelRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableTunnelRequest{} + +// WritableTunnelRequest Adds support for custom fields and tags. +type WritableTunnelRequest struct { + Name string `json:"name"` + Status *PatchedWritableTunnelRequestStatus `json:"status,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Encapsulation PatchedWritableTunnelRequestEncapsulation `json:"encapsulation"` + IpsecProfile NullableInt32 `json:"ipsec_profile,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + TunnelId NullableInt64 `json:"tunnel_id,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableTunnelRequest WritableTunnelRequest + +// NewWritableTunnelRequest instantiates a new WritableTunnelRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableTunnelRequest(name string, encapsulation PatchedWritableTunnelRequestEncapsulation) *WritableTunnelRequest { + this := WritableTunnelRequest{} + this.Name = name + this.Encapsulation = encapsulation + return &this +} + +// NewWritableTunnelRequestWithDefaults instantiates a new WritableTunnelRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableTunnelRequestWithDefaults() *WritableTunnelRequest { + this := WritableTunnelRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableTunnelRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableTunnelRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableTunnelRequest) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableTunnelRequest) GetStatus() PatchedWritableTunnelRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableTunnelRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelRequest) GetStatusOk() (*PatchedWritableTunnelRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableTunnelRequestStatus and assigns it to the Status field. +func (o *WritableTunnelRequest) SetStatus(v PatchedWritableTunnelRequestStatus) { + o.Status = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTunnelRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTunnelRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *WritableTunnelRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WritableTunnelRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WritableTunnelRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetEncapsulation returns the Encapsulation field value +func (o *WritableTunnelRequest) GetEncapsulation() PatchedWritableTunnelRequestEncapsulation { + if o == nil { + var ret PatchedWritableTunnelRequestEncapsulation + return ret + } + + return o.Encapsulation +} + +// GetEncapsulationOk returns a tuple with the Encapsulation field value +// and a boolean to check if the value has been set. +func (o *WritableTunnelRequest) GetEncapsulationOk() (*PatchedWritableTunnelRequestEncapsulation, bool) { + if o == nil { + return nil, false + } + return &o.Encapsulation, true +} + +// SetEncapsulation sets field value +func (o *WritableTunnelRequest) SetEncapsulation(v PatchedWritableTunnelRequestEncapsulation) { + o.Encapsulation = v +} + +// GetIpsecProfile returns the IpsecProfile field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTunnelRequest) GetIpsecProfile() int32 { + if o == nil || IsNil(o.IpsecProfile.Get()) { + var ret int32 + return ret + } + return *o.IpsecProfile.Get() +} + +// GetIpsecProfileOk returns a tuple with the IpsecProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTunnelRequest) GetIpsecProfileOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.IpsecProfile.Get(), o.IpsecProfile.IsSet() +} + +// HasIpsecProfile returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasIpsecProfile() bool { + if o != nil && o.IpsecProfile.IsSet() { + return true + } + + return false +} + +// SetIpsecProfile gets a reference to the given NullableInt32 and assigns it to the IpsecProfile field. +func (o *WritableTunnelRequest) SetIpsecProfile(v int32) { + o.IpsecProfile.Set(&v) +} + +// SetIpsecProfileNil sets the value for IpsecProfile to be an explicit nil +func (o *WritableTunnelRequest) SetIpsecProfileNil() { + o.IpsecProfile.Set(nil) +} + +// UnsetIpsecProfile ensures that no value is present for IpsecProfile, not even an explicit nil +func (o *WritableTunnelRequest) UnsetIpsecProfile() { + o.IpsecProfile.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTunnelRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTunnelRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableTunnelRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableTunnelRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableTunnelRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetTunnelId returns the TunnelId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTunnelRequest) GetTunnelId() int64 { + if o == nil || IsNil(o.TunnelId.Get()) { + var ret int64 + return ret + } + return *o.TunnelId.Get() +} + +// GetTunnelIdOk returns a tuple with the TunnelId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTunnelRequest) GetTunnelIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TunnelId.Get(), o.TunnelId.IsSet() +} + +// HasTunnelId returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasTunnelId() bool { + if o != nil && o.TunnelId.IsSet() { + return true + } + + return false +} + +// SetTunnelId gets a reference to the given NullableInt64 and assigns it to the TunnelId field. +func (o *WritableTunnelRequest) SetTunnelId(v int64) { + o.TunnelId.Set(&v) +} + +// SetTunnelIdNil sets the value for TunnelId to be an explicit nil +func (o *WritableTunnelRequest) SetTunnelIdNil() { + o.TunnelId.Set(nil) +} + +// UnsetTunnelId ensures that no value is present for TunnelId, not even an explicit nil +func (o *WritableTunnelRequest) UnsetTunnelId() { + o.TunnelId.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableTunnelRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableTunnelRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableTunnelRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableTunnelRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableTunnelRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableTunnelRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableTunnelRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableTunnelRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableTunnelRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableTunnelRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableTunnelRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + toSerialize["encapsulation"] = o.Encapsulation + if o.IpsecProfile.IsSet() { + toSerialize["ipsec_profile"] = o.IpsecProfile.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.TunnelId.IsSet() { + toSerialize["tunnel_id"] = o.TunnelId.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableTunnelRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "encapsulation", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableTunnelRequest := _WritableTunnelRequest{} + + err = json.Unmarshal(data, &varWritableTunnelRequest) + + if err != nil { + return err + } + + *o = WritableTunnelRequest(varWritableTunnelRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "group") + delete(additionalProperties, "encapsulation") + delete(additionalProperties, "ipsec_profile") + delete(additionalProperties, "tenant") + delete(additionalProperties, "tunnel_id") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableTunnelRequest struct { + value *WritableTunnelRequest + isSet bool +} + +func (v NullableWritableTunnelRequest) Get() *WritableTunnelRequest { + return v.value +} + +func (v *NullableWritableTunnelRequest) Set(val *WritableTunnelRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableTunnelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableTunnelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableTunnelRequest(val *WritableTunnelRequest) *NullableWritableTunnelRequest { + return &NullableWritableTunnelRequest{value: val, isSet: true} +} + +func (v NullableWritableTunnelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableTunnelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tunnel_termination_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tunnel_termination_request.go new file mode 100644 index 00000000..1594fbfc --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_tunnel_termination_request.go @@ -0,0 +1,402 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableTunnelTerminationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableTunnelTerminationRequest{} + +// WritableTunnelTerminationRequest Adds support for custom fields and tags. +type WritableTunnelTerminationRequest struct { + Tunnel int32 `json:"tunnel"` + Role *PatchedWritableTunnelTerminationRequestRole `json:"role,omitempty"` + TerminationType string `json:"termination_type"` + TerminationId NullableInt64 `json:"termination_id,omitempty"` + OutsideIp NullableInt32 `json:"outside_ip,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableTunnelTerminationRequest WritableTunnelTerminationRequest + +// NewWritableTunnelTerminationRequest instantiates a new WritableTunnelTerminationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableTunnelTerminationRequest(tunnel int32, terminationType string) *WritableTunnelTerminationRequest { + this := WritableTunnelTerminationRequest{} + this.Tunnel = tunnel + this.TerminationType = terminationType + return &this +} + +// NewWritableTunnelTerminationRequestWithDefaults instantiates a new WritableTunnelTerminationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableTunnelTerminationRequestWithDefaults() *WritableTunnelTerminationRequest { + this := WritableTunnelTerminationRequest{} + return &this +} + +// GetTunnel returns the Tunnel field value +func (o *WritableTunnelTerminationRequest) GetTunnel() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Tunnel +} + +// GetTunnelOk returns a tuple with the Tunnel field value +// and a boolean to check if the value has been set. +func (o *WritableTunnelTerminationRequest) GetTunnelOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Tunnel, true +} + +// SetTunnel sets field value +func (o *WritableTunnelTerminationRequest) SetTunnel(v int32) { + o.Tunnel = v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *WritableTunnelTerminationRequest) GetRole() PatchedWritableTunnelTerminationRequestRole { + if o == nil || IsNil(o.Role) { + var ret PatchedWritableTunnelTerminationRequestRole + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelTerminationRequest) GetRoleOk() (*PatchedWritableTunnelTerminationRequestRole, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableTunnelTerminationRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given PatchedWritableTunnelTerminationRequestRole and assigns it to the Role field. +func (o *WritableTunnelTerminationRequest) SetRole(v PatchedWritableTunnelTerminationRequestRole) { + o.Role = &v +} + +// GetTerminationType returns the TerminationType field value +func (o *WritableTunnelTerminationRequest) GetTerminationType() string { + if o == nil { + var ret string + return ret + } + + return o.TerminationType +} + +// GetTerminationTypeOk returns a tuple with the TerminationType field value +// and a boolean to check if the value has been set. +func (o *WritableTunnelTerminationRequest) GetTerminationTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TerminationType, true +} + +// SetTerminationType sets field value +func (o *WritableTunnelTerminationRequest) SetTerminationType(v string) { + o.TerminationType = v +} + +// GetTerminationId returns the TerminationId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTunnelTerminationRequest) GetTerminationId() int64 { + if o == nil || IsNil(o.TerminationId.Get()) { + var ret int64 + return ret + } + return *o.TerminationId.Get() +} + +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTunnelTerminationRequest) GetTerminationIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.TerminationId.Get(), o.TerminationId.IsSet() +} + +// HasTerminationId returns a boolean if a field has been set. +func (o *WritableTunnelTerminationRequest) HasTerminationId() bool { + if o != nil && o.TerminationId.IsSet() { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given NullableInt64 and assigns it to the TerminationId field. +func (o *WritableTunnelTerminationRequest) SetTerminationId(v int64) { + o.TerminationId.Set(&v) +} + +// SetTerminationIdNil sets the value for TerminationId to be an explicit nil +func (o *WritableTunnelTerminationRequest) SetTerminationIdNil() { + o.TerminationId.Set(nil) +} + +// UnsetTerminationId ensures that no value is present for TerminationId, not even an explicit nil +func (o *WritableTunnelTerminationRequest) UnsetTerminationId() { + o.TerminationId.Unset() +} + +// GetOutsideIp returns the OutsideIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableTunnelTerminationRequest) GetOutsideIp() int32 { + if o == nil || IsNil(o.OutsideIp.Get()) { + var ret int32 + return ret + } + return *o.OutsideIp.Get() +} + +// GetOutsideIpOk returns a tuple with the OutsideIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableTunnelTerminationRequest) GetOutsideIpOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.OutsideIp.Get(), o.OutsideIp.IsSet() +} + +// HasOutsideIp returns a boolean if a field has been set. +func (o *WritableTunnelTerminationRequest) HasOutsideIp() bool { + if o != nil && o.OutsideIp.IsSet() { + return true + } + + return false +} + +// SetOutsideIp gets a reference to the given NullableInt32 and assigns it to the OutsideIp field. +func (o *WritableTunnelTerminationRequest) SetOutsideIp(v int32) { + o.OutsideIp.Set(&v) +} + +// SetOutsideIpNil sets the value for OutsideIp to be an explicit nil +func (o *WritableTunnelTerminationRequest) SetOutsideIpNil() { + o.OutsideIp.Set(nil) +} + +// UnsetOutsideIp ensures that no value is present for OutsideIp, not even an explicit nil +func (o *WritableTunnelTerminationRequest) UnsetOutsideIp() { + o.OutsideIp.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableTunnelTerminationRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelTerminationRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableTunnelTerminationRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableTunnelTerminationRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableTunnelTerminationRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableTunnelTerminationRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableTunnelTerminationRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableTunnelTerminationRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableTunnelTerminationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableTunnelTerminationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["tunnel"] = o.Tunnel + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + toSerialize["termination_type"] = o.TerminationType + if o.TerminationId.IsSet() { + toSerialize["termination_id"] = o.TerminationId.Get() + } + if o.OutsideIp.IsSet() { + toSerialize["outside_ip"] = o.OutsideIp.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableTunnelTerminationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "tunnel", + "termination_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableTunnelTerminationRequest := _WritableTunnelTerminationRequest{} + + err = json.Unmarshal(data, &varWritableTunnelTerminationRequest) + + if err != nil { + return err + } + + *o = WritableTunnelTerminationRequest(varWritableTunnelTerminationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tunnel") + delete(additionalProperties, "role") + delete(additionalProperties, "termination_type") + delete(additionalProperties, "termination_id") + delete(additionalProperties, "outside_ip") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableTunnelTerminationRequest struct { + value *WritableTunnelTerminationRequest + isSet bool +} + +func (v NullableWritableTunnelTerminationRequest) Get() *WritableTunnelTerminationRequest { + return v.value +} + +func (v *NullableWritableTunnelTerminationRequest) Set(val *WritableTunnelTerminationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableTunnelTerminationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableTunnelTerminationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableTunnelTerminationRequest(val *WritableTunnelTerminationRequest) *NullableWritableTunnelTerminationRequest { + return &NullableWritableTunnelTerminationRequest{value: val, isSet: true} +} + +func (v NullableWritableTunnelTerminationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableTunnelTerminationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_user_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_user_request.go new file mode 100644 index 00000000..d4caa7bd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_user_request.go @@ -0,0 +1,459 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the WritableUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableUserRequest{} + +// WritableUserRequest Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144) +type WritableUserRequest struct { + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username"` + Password string `json:"password"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + // Designates whether the user can log into this admin site. + IsStaff *bool `json:"is_staff,omitempty"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + DateJoined *time.Time `json:"date_joined,omitempty"` + // The groups this user belongs to. A user will get all permissions granted to each of their groups. + Groups []int32 `json:"groups,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableUserRequest WritableUserRequest + +// NewWritableUserRequest instantiates a new WritableUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableUserRequest(username string, password string) *WritableUserRequest { + this := WritableUserRequest{} + this.Username = username + this.Password = password + return &this +} + +// NewWritableUserRequestWithDefaults instantiates a new WritableUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableUserRequestWithDefaults() *WritableUserRequest { + this := WritableUserRequest{} + return &this +} + +// GetUsername returns the Username field value +func (o *WritableUserRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *WritableUserRequest) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *WritableUserRequest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *WritableUserRequest) SetPassword(v string) { + o.Password = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *WritableUserRequest) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *WritableUserRequest) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *WritableUserRequest) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *WritableUserRequest) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *WritableUserRequest) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *WritableUserRequest) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *WritableUserRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *WritableUserRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *WritableUserRequest) SetEmail(v string) { + o.Email = &v +} + +// GetIsStaff returns the IsStaff field value if set, zero value otherwise. +func (o *WritableUserRequest) GetIsStaff() bool { + if o == nil || IsNil(o.IsStaff) { + var ret bool + return ret + } + return *o.IsStaff +} + +// GetIsStaffOk returns a tuple with the IsStaff field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetIsStaffOk() (*bool, bool) { + if o == nil || IsNil(o.IsStaff) { + return nil, false + } + return o.IsStaff, true +} + +// HasIsStaff returns a boolean if a field has been set. +func (o *WritableUserRequest) HasIsStaff() bool { + if o != nil && !IsNil(o.IsStaff) { + return true + } + + return false +} + +// SetIsStaff gets a reference to the given bool and assigns it to the IsStaff field. +func (o *WritableUserRequest) SetIsStaff(v bool) { + o.IsStaff = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *WritableUserRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *WritableUserRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *WritableUserRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetDateJoined returns the DateJoined field value if set, zero value otherwise. +func (o *WritableUserRequest) GetDateJoined() time.Time { + if o == nil || IsNil(o.DateJoined) { + var ret time.Time + return ret + } + return *o.DateJoined +} + +// GetDateJoinedOk returns a tuple with the DateJoined field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetDateJoinedOk() (*time.Time, bool) { + if o == nil || IsNil(o.DateJoined) { + return nil, false + } + return o.DateJoined, true +} + +// HasDateJoined returns a boolean if a field has been set. +func (o *WritableUserRequest) HasDateJoined() bool { + if o != nil && !IsNil(o.DateJoined) { + return true + } + + return false +} + +// SetDateJoined gets a reference to the given time.Time and assigns it to the DateJoined field. +func (o *WritableUserRequest) SetDateJoined(v time.Time) { + o.DateJoined = &v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *WritableUserRequest) GetGroups() []int32 { + if o == nil || IsNil(o.Groups) { + var ret []int32 + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableUserRequest) GetGroupsOk() ([]int32, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *WritableUserRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []int32 and assigns it to the Groups field. +func (o *WritableUserRequest) SetGroups(v []int32) { + o.Groups = v +} + +func (o WritableUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.IsStaff) { + toSerialize["is_staff"] = o.IsStaff + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if !IsNil(o.DateJoined) { + toSerialize["date_joined"] = o.DateJoined + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableUserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "username", + "password", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableUserRequest := _WritableUserRequest{} + + err = json.Unmarshal(data, &varWritableUserRequest) + + if err != nil { + return err + } + + *o = WritableUserRequest(varWritableUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "email") + delete(additionalProperties, "is_staff") + delete(additionalProperties, "is_active") + delete(additionalProperties, "date_joined") + delete(additionalProperties, "groups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableUserRequest struct { + value *WritableUserRequest + isSet bool +} + +func (v NullableWritableUserRequest) Get() *WritableUserRequest { + return v.value +} + +func (v *NullableWritableUserRequest) Set(val *WritableUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableUserRequest(val *WritableUserRequest) *NullableWritableUserRequest { + return &NullableWritableUserRequest{value: val, isSet: true} +} + +func (v NullableWritableUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_chassis_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_chassis_request.go new file mode 100644 index 00000000..56955c6a --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_chassis_request.go @@ -0,0 +1,399 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableVirtualChassisRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableVirtualChassisRequest{} + +// WritableVirtualChassisRequest Adds support for custom fields and tags. +type WritableVirtualChassisRequest struct { + Name string `json:"name"` + Domain *string `json:"domain,omitempty"` + Master NullableInt32 `json:"master,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableVirtualChassisRequest WritableVirtualChassisRequest + +// NewWritableVirtualChassisRequest instantiates a new WritableVirtualChassisRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableVirtualChassisRequest(name string) *WritableVirtualChassisRequest { + this := WritableVirtualChassisRequest{} + this.Name = name + return &this +} + +// NewWritableVirtualChassisRequestWithDefaults instantiates a new WritableVirtualChassisRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableVirtualChassisRequestWithDefaults() *WritableVirtualChassisRequest { + this := WritableVirtualChassisRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableVirtualChassisRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableVirtualChassisRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableVirtualChassisRequest) SetName(v string) { + o.Name = v +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *WritableVirtualChassisRequest) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualChassisRequest) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *WritableVirtualChassisRequest) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *WritableVirtualChassisRequest) SetDomain(v string) { + o.Domain = &v +} + +// GetMaster returns the Master field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualChassisRequest) GetMaster() int32 { + if o == nil || IsNil(o.Master.Get()) { + var ret int32 + return ret + } + return *o.Master.Get() +} + +// GetMasterOk returns a tuple with the Master field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualChassisRequest) GetMasterOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Master.Get(), o.Master.IsSet() +} + +// HasMaster returns a boolean if a field has been set. +func (o *WritableVirtualChassisRequest) HasMaster() bool { + if o != nil && o.Master.IsSet() { + return true + } + + return false +} + +// SetMaster gets a reference to the given NullableInt32 and assigns it to the Master field. +func (o *WritableVirtualChassisRequest) SetMaster(v int32) { + o.Master.Set(&v) +} + +// SetMasterNil sets the value for Master to be an explicit nil +func (o *WritableVirtualChassisRequest) SetMasterNil() { + o.Master.Set(nil) +} + +// UnsetMaster ensures that no value is present for Master, not even an explicit nil +func (o *WritableVirtualChassisRequest) UnsetMaster() { + o.Master.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableVirtualChassisRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualChassisRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableVirtualChassisRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableVirtualChassisRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableVirtualChassisRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualChassisRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableVirtualChassisRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableVirtualChassisRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableVirtualChassisRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualChassisRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableVirtualChassisRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableVirtualChassisRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableVirtualChassisRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualChassisRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableVirtualChassisRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableVirtualChassisRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableVirtualChassisRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableVirtualChassisRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if o.Master.IsSet() { + toSerialize["master"] = o.Master.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableVirtualChassisRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableVirtualChassisRequest := _WritableVirtualChassisRequest{} + + err = json.Unmarshal(data, &varWritableVirtualChassisRequest) + + if err != nil { + return err + } + + *o = WritableVirtualChassisRequest(varWritableVirtualChassisRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "domain") + delete(additionalProperties, "master") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableVirtualChassisRequest struct { + value *WritableVirtualChassisRequest + isSet bool +} + +func (v NullableWritableVirtualChassisRequest) Get() *WritableVirtualChassisRequest { + return v.value +} + +func (v *NullableWritableVirtualChassisRequest) Set(val *WritableVirtualChassisRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableVirtualChassisRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableVirtualChassisRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableVirtualChassisRequest(val *WritableVirtualChassisRequest) *NullableWritableVirtualChassisRequest { + return &NullableWritableVirtualChassisRequest{value: val, isSet: true} +} + +func (v NullableWritableVirtualChassisRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableVirtualChassisRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_device_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_device_context_request.go new file mode 100644 index 00000000..f40c43dd --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_device_context_request.go @@ -0,0 +1,584 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableVirtualDeviceContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableVirtualDeviceContextRequest{} + +// WritableVirtualDeviceContextRequest Adds support for custom fields and tags. +type WritableVirtualDeviceContextRequest struct { + Name string `json:"name"` + Device NullableInt32 `json:"device,omitempty"` + // Numeric identifier unique to the parent device + Identifier NullableInt32 `json:"identifier,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + PrimaryIp4 NullableInt32 `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableInt32 `json:"primary_ip6,omitempty"` + Status PatchedWritableVirtualDeviceContextRequestStatus `json:"status"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableVirtualDeviceContextRequest WritableVirtualDeviceContextRequest + +// NewWritableVirtualDeviceContextRequest instantiates a new WritableVirtualDeviceContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableVirtualDeviceContextRequest(name string, status PatchedWritableVirtualDeviceContextRequestStatus) *WritableVirtualDeviceContextRequest { + this := WritableVirtualDeviceContextRequest{} + this.Name = name + this.Status = status + return &this +} + +// NewWritableVirtualDeviceContextRequestWithDefaults instantiates a new WritableVirtualDeviceContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableVirtualDeviceContextRequestWithDefaults() *WritableVirtualDeviceContextRequest { + this := WritableVirtualDeviceContextRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableVirtualDeviceContextRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableVirtualDeviceContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableVirtualDeviceContextRequest) SetName(v string) { + o.Name = v +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualDeviceContextRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device.Get()) { + var ret int32 + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualDeviceContextRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableInt32 and assigns it to the Device field. +func (o *WritableVirtualDeviceContextRequest) SetDevice(v int32) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *WritableVirtualDeviceContextRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *WritableVirtualDeviceContextRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualDeviceContextRequest) GetIdentifier() int32 { + if o == nil || IsNil(o.Identifier.Get()) { + var ret int32 + return ret + } + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualDeviceContextRequest) GetIdentifierOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasIdentifier() bool { + if o != nil && o.Identifier.IsSet() { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given NullableInt32 and assigns it to the Identifier field. +func (o *WritableVirtualDeviceContextRequest) SetIdentifier(v int32) { + o.Identifier.Set(&v) +} + +// SetIdentifierNil sets the value for Identifier to be an explicit nil +func (o *WritableVirtualDeviceContextRequest) SetIdentifierNil() { + o.Identifier.Set(nil) +} + +// UnsetIdentifier ensures that no value is present for Identifier, not even an explicit nil +func (o *WritableVirtualDeviceContextRequest) UnsetIdentifier() { + o.Identifier.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualDeviceContextRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualDeviceContextRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableVirtualDeviceContextRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableVirtualDeviceContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableVirtualDeviceContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualDeviceContextRequest) GetPrimaryIp4() int32 { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualDeviceContextRequest) GetPrimaryIp4Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp4 field. +func (o *WritableVirtualDeviceContextRequest) SetPrimaryIp4(v int32) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *WritableVirtualDeviceContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *WritableVirtualDeviceContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualDeviceContextRequest) GetPrimaryIp6() int32 { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualDeviceContextRequest) GetPrimaryIp6Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp6 field. +func (o *WritableVirtualDeviceContextRequest) SetPrimaryIp6(v int32) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *WritableVirtualDeviceContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *WritableVirtualDeviceContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetStatus returns the Status field value +func (o *WritableVirtualDeviceContextRequest) GetStatus() PatchedWritableVirtualDeviceContextRequestStatus { + if o == nil { + var ret PatchedWritableVirtualDeviceContextRequestStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *WritableVirtualDeviceContextRequest) GetStatusOk() (*PatchedWritableVirtualDeviceContextRequestStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *WritableVirtualDeviceContextRequest) SetStatus(v PatchedWritableVirtualDeviceContextRequestStatus) { + o.Status = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableVirtualDeviceContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualDeviceContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableVirtualDeviceContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableVirtualDeviceContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualDeviceContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableVirtualDeviceContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableVirtualDeviceContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualDeviceContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableVirtualDeviceContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableVirtualDeviceContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualDeviceContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableVirtualDeviceContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableVirtualDeviceContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableVirtualDeviceContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableVirtualDeviceContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.Identifier.IsSet() { + toSerialize["identifier"] = o.Identifier.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + toSerialize["status"] = o.Status + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableVirtualDeviceContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableVirtualDeviceContextRequest := _WritableVirtualDeviceContextRequest{} + + err = json.Unmarshal(data, &varWritableVirtualDeviceContextRequest) + + if err != nil { + return err + } + + *o = WritableVirtualDeviceContextRequest(varWritableVirtualDeviceContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "device") + delete(additionalProperties, "identifier") + delete(additionalProperties, "tenant") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "status") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableVirtualDeviceContextRequest struct { + value *WritableVirtualDeviceContextRequest + isSet bool +} + +func (v NullableWritableVirtualDeviceContextRequest) Get() *WritableVirtualDeviceContextRequest { + return v.value +} + +func (v *NullableWritableVirtualDeviceContextRequest) Set(val *WritableVirtualDeviceContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableVirtualDeviceContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableVirtualDeviceContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableVirtualDeviceContextRequest(val *WritableVirtualDeviceContextRequest) *NullableWritableVirtualDeviceContextRequest { + return &NullableWritableVirtualDeviceContextRequest{value: val, isSet: true} +} + +func (v NullableWritableVirtualDeviceContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableVirtualDeviceContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_disk_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_disk_request.go new file mode 100644 index 00000000..b66cdf17 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_disk_request.go @@ -0,0 +1,335 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableVirtualDiskRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableVirtualDiskRequest{} + +// WritableVirtualDiskRequest Adds support for custom fields and tags. +type WritableVirtualDiskRequest struct { + VirtualMachine int32 `json:"virtual_machine"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Size int32 `json:"size"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableVirtualDiskRequest WritableVirtualDiskRequest + +// NewWritableVirtualDiskRequest instantiates a new WritableVirtualDiskRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableVirtualDiskRequest(virtualMachine int32, name string, size int32) *WritableVirtualDiskRequest { + this := WritableVirtualDiskRequest{} + this.VirtualMachine = virtualMachine + this.Name = name + this.Size = size + return &this +} + +// NewWritableVirtualDiskRequestWithDefaults instantiates a new WritableVirtualDiskRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableVirtualDiskRequestWithDefaults() *WritableVirtualDiskRequest { + this := WritableVirtualDiskRequest{} + return &this +} + +// GetVirtualMachine returns the VirtualMachine field value +func (o *WritableVirtualDiskRequest) GetVirtualMachine() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value +// and a boolean to check if the value has been set. +func (o *WritableVirtualDiskRequest) GetVirtualMachineOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualMachine, true +} + +// SetVirtualMachine sets field value +func (o *WritableVirtualDiskRequest) SetVirtualMachine(v int32) { + o.VirtualMachine = v +} + +// GetName returns the Name field value +func (o *WritableVirtualDiskRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableVirtualDiskRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableVirtualDiskRequest) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableVirtualDiskRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualDiskRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableVirtualDiskRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableVirtualDiskRequest) SetDescription(v string) { + o.Description = &v +} + +// GetSize returns the Size field value +func (o *WritableVirtualDiskRequest) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *WritableVirtualDiskRequest) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *WritableVirtualDiskRequest) SetSize(v int32) { + o.Size = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableVirtualDiskRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualDiskRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableVirtualDiskRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableVirtualDiskRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableVirtualDiskRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualDiskRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableVirtualDiskRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableVirtualDiskRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableVirtualDiskRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableVirtualDiskRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["virtual_machine"] = o.VirtualMachine + toSerialize["name"] = o.Name + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["size"] = o.Size + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableVirtualDiskRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "virtual_machine", + "name", + "size", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableVirtualDiskRequest := _WritableVirtualDiskRequest{} + + err = json.Unmarshal(data, &varWritableVirtualDiskRequest) + + if err != nil { + return err + } + + *o = WritableVirtualDiskRequest(varWritableVirtualDiskRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "size") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableVirtualDiskRequest struct { + value *WritableVirtualDiskRequest + isSet bool +} + +func (v NullableWritableVirtualDiskRequest) Get() *WritableVirtualDiskRequest { + return v.value +} + +func (v *NullableWritableVirtualDiskRequest) Set(val *WritableVirtualDiskRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableVirtualDiskRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableVirtualDiskRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableVirtualDiskRequest(val *WritableVirtualDiskRequest) *NullableWritableVirtualDiskRequest { + return &NullableWritableVirtualDiskRequest{value: val, isSet: true} +} + +func (v NullableWritableVirtualDiskRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableVirtualDiskRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_machine_with_config_context_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_machine_with_config_context_request.go new file mode 100644 index 00000000..c3478928 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_virtual_machine_with_config_context_request.go @@ -0,0 +1,918 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableVirtualMachineWithConfigContextRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableVirtualMachineWithConfigContextRequest{} + +// WritableVirtualMachineWithConfigContextRequest Adds support for custom fields and tags. +type WritableVirtualMachineWithConfigContextRequest struct { + Name string `json:"name"` + Status *ModuleStatusValue `json:"status,omitempty"` + Site NullableInt32 `json:"site,omitempty"` + Cluster NullableInt32 `json:"cluster,omitempty"` + Device NullableInt32 `json:"device,omitempty"` + Role NullableInt32 `json:"role,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Platform NullableInt32 `json:"platform,omitempty"` + PrimaryIp4 NullableInt32 `json:"primary_ip4,omitempty"` + PrimaryIp6 NullableInt32 `json:"primary_ip6,omitempty"` + Vcpus NullableFloat64 `json:"vcpus,omitempty"` + Memory NullableInt32 `json:"memory,omitempty"` + Disk NullableInt32 `json:"disk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + // Local config context data takes precedence over source contexts in the final rendered config context + LocalContextData interface{} `json:"local_context_data,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableVirtualMachineWithConfigContextRequest WritableVirtualMachineWithConfigContextRequest + +// NewWritableVirtualMachineWithConfigContextRequest instantiates a new WritableVirtualMachineWithConfigContextRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableVirtualMachineWithConfigContextRequest(name string) *WritableVirtualMachineWithConfigContextRequest { + this := WritableVirtualMachineWithConfigContextRequest{} + this.Name = name + return &this +} + +// NewWritableVirtualMachineWithConfigContextRequestWithDefaults instantiates a new WritableVirtualMachineWithConfigContextRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableVirtualMachineWithConfigContextRequestWithDefaults() *WritableVirtualMachineWithConfigContextRequest { + this := WritableVirtualMachineWithConfigContextRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableVirtualMachineWithConfigContextRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableVirtualMachineWithConfigContextRequest) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableVirtualMachineWithConfigContextRequest) GetStatus() ModuleStatusValue { + if o == nil || IsNil(o.Status) { + var ret ModuleStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) GetStatusOk() (*ModuleStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ModuleStatusValue and assigns it to the Status field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetStatus(v ModuleStatusValue) { + o.Status = &v +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetSite() { + o.Site.Unset() +} + +// GetCluster returns the Cluster field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetCluster() int32 { + if o == nil || IsNil(o.Cluster.Get()) { + var ret int32 + return ret + } + return *o.Cluster.Get() +} + +// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetClusterOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Cluster.Get(), o.Cluster.IsSet() +} + +// HasCluster returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasCluster() bool { + if o != nil && o.Cluster.IsSet() { + return true + } + + return false +} + +// SetCluster gets a reference to the given NullableInt32 and assigns it to the Cluster field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetCluster(v int32) { + o.Cluster.Set(&v) +} + +// SetClusterNil sets the value for Cluster to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetClusterNil() { + o.Cluster.Set(nil) +} + +// UnsetCluster ensures that no value is present for Cluster, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetCluster() { + o.Cluster.Unset() +} + +// GetDevice returns the Device field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetDevice() int32 { + if o == nil || IsNil(o.Device.Get()) { + var ret int32 + return ret + } + return *o.Device.Get() +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetDeviceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Device.Get(), o.Device.IsSet() +} + +// HasDevice returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasDevice() bool { + if o != nil && o.Device.IsSet() { + return true + } + + return false +} + +// SetDevice gets a reference to the given NullableInt32 and assigns it to the Device field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetDevice(v int32) { + o.Device.Set(&v) +} + +// SetDeviceNil sets the value for Device to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetDeviceNil() { + o.Device.Set(nil) +} + +// UnsetDevice ensures that no value is present for Device, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetDevice() { + o.Device.Unset() +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetRole() { + o.Role.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetPlatform returns the Platform field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetPlatform() int32 { + if o == nil || IsNil(o.Platform.Get()) { + var ret int32 + return ret + } + return *o.Platform.Get() +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetPlatformOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Platform.Get(), o.Platform.IsSet() +} + +// HasPlatform returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasPlatform() bool { + if o != nil && o.Platform.IsSet() { + return true + } + + return false +} + +// SetPlatform gets a reference to the given NullableInt32 and assigns it to the Platform field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetPlatform(v int32) { + o.Platform.Set(&v) +} + +// SetPlatformNil sets the value for Platform to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetPlatformNil() { + o.Platform.Set(nil) +} + +// UnsetPlatform ensures that no value is present for Platform, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetPlatform() { + o.Platform.Unset() +} + +// GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetPrimaryIp4() int32 { + if o == nil || IsNil(o.PrimaryIp4.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp4.Get() +} + +// GetPrimaryIp4Ok returns a tuple with the PrimaryIp4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetPrimaryIp4Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp4.Get(), o.PrimaryIp4.IsSet() +} + +// HasPrimaryIp4 returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasPrimaryIp4() bool { + if o != nil && o.PrimaryIp4.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp4 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp4 field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetPrimaryIp4(v int32) { + o.PrimaryIp4.Set(&v) +} + +// SetPrimaryIp4Nil sets the value for PrimaryIp4 to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetPrimaryIp4Nil() { + o.PrimaryIp4.Set(nil) +} + +// UnsetPrimaryIp4 ensures that no value is present for PrimaryIp4, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetPrimaryIp4() { + o.PrimaryIp4.Unset() +} + +// GetPrimaryIp6 returns the PrimaryIp6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetPrimaryIp6() int32 { + if o == nil || IsNil(o.PrimaryIp6.Get()) { + var ret int32 + return ret + } + return *o.PrimaryIp6.Get() +} + +// GetPrimaryIp6Ok returns a tuple with the PrimaryIp6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetPrimaryIp6Ok() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PrimaryIp6.Get(), o.PrimaryIp6.IsSet() +} + +// HasPrimaryIp6 returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasPrimaryIp6() bool { + if o != nil && o.PrimaryIp6.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp6 gets a reference to the given NullableInt32 and assigns it to the PrimaryIp6 field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetPrimaryIp6(v int32) { + o.PrimaryIp6.Set(&v) +} + +// SetPrimaryIp6Nil sets the value for PrimaryIp6 to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetPrimaryIp6Nil() { + o.PrimaryIp6.Set(nil) +} + +// UnsetPrimaryIp6 ensures that no value is present for PrimaryIp6, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetPrimaryIp6() { + o.PrimaryIp6.Unset() +} + +// GetVcpus returns the Vcpus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetVcpus() float64 { + if o == nil || IsNil(o.Vcpus.Get()) { + var ret float64 + return ret + } + return *o.Vcpus.Get() +} + +// GetVcpusOk returns a tuple with the Vcpus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetVcpusOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Vcpus.Get(), o.Vcpus.IsSet() +} + +// HasVcpus returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasVcpus() bool { + if o != nil && o.Vcpus.IsSet() { + return true + } + + return false +} + +// SetVcpus gets a reference to the given NullableFloat64 and assigns it to the Vcpus field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetVcpus(v float64) { + o.Vcpus.Set(&v) +} + +// SetVcpusNil sets the value for Vcpus to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetVcpusNil() { + o.Vcpus.Set(nil) +} + +// UnsetVcpus ensures that no value is present for Vcpus, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetVcpus() { + o.Vcpus.Unset() +} + +// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetMemory() int32 { + if o == nil || IsNil(o.Memory.Get()) { + var ret int32 + return ret + } + return *o.Memory.Get() +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetMemoryOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Memory.Get(), o.Memory.IsSet() +} + +// HasMemory returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasMemory() bool { + if o != nil && o.Memory.IsSet() { + return true + } + + return false +} + +// SetMemory gets a reference to the given NullableInt32 and assigns it to the Memory field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetMemory(v int32) { + o.Memory.Set(&v) +} + +// SetMemoryNil sets the value for Memory to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetMemoryNil() { + o.Memory.Set(nil) +} + +// UnsetMemory ensures that no value is present for Memory, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetMemory() { + o.Memory.Unset() +} + +// GetDisk returns the Disk field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetDisk() int32 { + if o == nil || IsNil(o.Disk.Get()) { + var ret int32 + return ret + } + return *o.Disk.Get() +} + +// GetDiskOk returns a tuple with the Disk field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetDiskOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Disk.Get(), o.Disk.IsSet() +} + +// HasDisk returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasDisk() bool { + if o != nil && o.Disk.IsSet() { + return true + } + + return false +} + +// SetDisk gets a reference to the given NullableInt32 and assigns it to the Disk field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetDisk(v int32) { + o.Disk.Set(&v) +} + +// SetDiskNil sets the value for Disk to be an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) SetDiskNil() { + o.Disk.Set(nil) +} + +// UnsetDisk ensures that no value is present for Disk, not even an explicit nil +func (o *WritableVirtualMachineWithConfigContextRequest) UnsetDisk() { + o.Disk.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableVirtualMachineWithConfigContextRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableVirtualMachineWithConfigContextRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetComments(v string) { + o.Comments = &v +} + +// GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVirtualMachineWithConfigContextRequest) GetLocalContextData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.LocalContextData +} + +// GetLocalContextDataOk returns a tuple with the LocalContextData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVirtualMachineWithConfigContextRequest) GetLocalContextDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.LocalContextData) { + return nil, false + } + return &o.LocalContextData, true +} + +// HasLocalContextData returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasLocalContextData() bool { + if o != nil && IsNil(o.LocalContextData) { + return true + } + + return false +} + +// SetLocalContextData gets a reference to the given interface{} and assigns it to the LocalContextData field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetLocalContextData(v interface{}) { + o.LocalContextData = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableVirtualMachineWithConfigContextRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableVirtualMachineWithConfigContextRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableVirtualMachineWithConfigContextRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableVirtualMachineWithConfigContextRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableVirtualMachineWithConfigContextRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableVirtualMachineWithConfigContextRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Cluster.IsSet() { + toSerialize["cluster"] = o.Cluster.Get() + } + if o.Device.IsSet() { + toSerialize["device"] = o.Device.Get() + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if o.Platform.IsSet() { + toSerialize["platform"] = o.Platform.Get() + } + if o.PrimaryIp4.IsSet() { + toSerialize["primary_ip4"] = o.PrimaryIp4.Get() + } + if o.PrimaryIp6.IsSet() { + toSerialize["primary_ip6"] = o.PrimaryIp6.Get() + } + if o.Vcpus.IsSet() { + toSerialize["vcpus"] = o.Vcpus.Get() + } + if o.Memory.IsSet() { + toSerialize["memory"] = o.Memory.Get() + } + if o.Disk.IsSet() { + toSerialize["disk"] = o.Disk.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if o.LocalContextData != nil { + toSerialize["local_context_data"] = o.LocalContextData + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableVirtualMachineWithConfigContextRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableVirtualMachineWithConfigContextRequest := _WritableVirtualMachineWithConfigContextRequest{} + + err = json.Unmarshal(data, &varWritableVirtualMachineWithConfigContextRequest) + + if err != nil { + return err + } + + *o = WritableVirtualMachineWithConfigContextRequest(varWritableVirtualMachineWithConfigContextRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + delete(additionalProperties, "site") + delete(additionalProperties, "cluster") + delete(additionalProperties, "device") + delete(additionalProperties, "role") + delete(additionalProperties, "tenant") + delete(additionalProperties, "platform") + delete(additionalProperties, "primary_ip4") + delete(additionalProperties, "primary_ip6") + delete(additionalProperties, "vcpus") + delete(additionalProperties, "memory") + delete(additionalProperties, "disk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "local_context_data") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableVirtualMachineWithConfigContextRequest struct { + value *WritableVirtualMachineWithConfigContextRequest + isSet bool +} + +func (v NullableWritableVirtualMachineWithConfigContextRequest) Get() *WritableVirtualMachineWithConfigContextRequest { + return v.value +} + +func (v *NullableWritableVirtualMachineWithConfigContextRequest) Set(val *WritableVirtualMachineWithConfigContextRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableVirtualMachineWithConfigContextRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableVirtualMachineWithConfigContextRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableVirtualMachineWithConfigContextRequest(val *WritableVirtualMachineWithConfigContextRequest) *NullableWritableVirtualMachineWithConfigContextRequest { + return &NullableWritableVirtualMachineWithConfigContextRequest{value: val, isSet: true} +} + +func (v NullableWritableVirtualMachineWithConfigContextRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableVirtualMachineWithConfigContextRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vlan_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vlan_request.go new file mode 100644 index 00000000..6b20b5e8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vlan_request.go @@ -0,0 +1,576 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableVLANRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableVLANRequest{} + +// WritableVLANRequest Adds support for custom fields and tags. +type WritableVLANRequest struct { + // The specific site to which this VLAN is assigned (if any) + Site NullableInt32 `json:"site,omitempty"` + // VLAN group (optional) + Group NullableInt32 `json:"group,omitempty"` + // Numeric VLAN ID (1-4094) + Vid int32 `json:"vid"` + Name string `json:"name"` + Tenant NullableInt32 `json:"tenant,omitempty"` + Status *PatchedWritableVLANRequestStatus `json:"status,omitempty"` + // The primary function of this VLAN + Role NullableInt32 `json:"role,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableVLANRequest WritableVLANRequest + +// NewWritableVLANRequest instantiates a new WritableVLANRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableVLANRequest(vid int32, name string) *WritableVLANRequest { + this := WritableVLANRequest{} + this.Vid = vid + this.Name = name + return &this +} + +// NewWritableVLANRequestWithDefaults instantiates a new WritableVLANRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableVLANRequestWithDefaults() *WritableVLANRequest { + this := WritableVLANRequest{} + return &this +} + +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVLANRequest) GetSite() int32 { + if o == nil || IsNil(o.Site.Get()) { + var ret int32 + return ret + } + return *o.Site.Get() +} + +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVLANRequest) GetSiteOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Site.Get(), o.Site.IsSet() +} + +// HasSite returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableInt32 and assigns it to the Site field. +func (o *WritableVLANRequest) SetSite(v int32) { + o.Site.Set(&v) +} + +// SetSiteNil sets the value for Site to be an explicit nil +func (o *WritableVLANRequest) SetSiteNil() { + o.Site.Set(nil) +} + +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *WritableVLANRequest) UnsetSite() { + o.Site.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVLANRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVLANRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *WritableVLANRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WritableVLANRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WritableVLANRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetVid returns the Vid field value +func (o *WritableVLANRequest) GetVid() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Vid +} + +// GetVidOk returns a tuple with the Vid field value +// and a boolean to check if the value has been set. +func (o *WritableVLANRequest) GetVidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Vid, true +} + +// SetVid sets field value +func (o *WritableVLANRequest) SetVid(v int32) { + o.Vid = v +} + +// GetName returns the Name field value +func (o *WritableVLANRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableVLANRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableVLANRequest) SetName(v string) { + o.Name = v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVLANRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVLANRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableVLANRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableVLANRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableVLANRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableVLANRequest) GetStatus() PatchedWritableVLANRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableVLANRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVLANRequest) GetStatusOk() (*PatchedWritableVLANRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableVLANRequestStatus and assigns it to the Status field. +func (o *WritableVLANRequest) SetStatus(v PatchedWritableVLANRequestStatus) { + o.Status = &v +} + +// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVLANRequest) GetRole() int32 { + if o == nil || IsNil(o.Role.Get()) { + var ret int32 + return ret + } + return *o.Role.Get() +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVLANRequest) GetRoleOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Role.Get(), o.Role.IsSet() +} + +// HasRole returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasRole() bool { + if o != nil && o.Role.IsSet() { + return true + } + + return false +} + +// SetRole gets a reference to the given NullableInt32 and assigns it to the Role field. +func (o *WritableVLANRequest) SetRole(v int32) { + o.Role.Set(&v) +} + +// SetRoleNil sets the value for Role to be an explicit nil +func (o *WritableVLANRequest) SetRoleNil() { + o.Role.Set(nil) +} + +// UnsetRole ensures that no value is present for Role, not even an explicit nil +func (o *WritableVLANRequest) UnsetRole() { + o.Role.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableVLANRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVLANRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableVLANRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableVLANRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVLANRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableVLANRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableVLANRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVLANRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableVLANRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableVLANRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVLANRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableVLANRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableVLANRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableVLANRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableVLANRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + toSerialize["vid"] = o.Vid + toSerialize["name"] = o.Name + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Role.IsSet() { + toSerialize["role"] = o.Role.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableVLANRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "vid", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableVLANRequest := _WritableVLANRequest{} + + err = json.Unmarshal(data, &varWritableVLANRequest) + + if err != nil { + return err + } + + *o = WritableVLANRequest(varWritableVLANRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "site") + delete(additionalProperties, "group") + delete(additionalProperties, "vid") + delete(additionalProperties, "name") + delete(additionalProperties, "tenant") + delete(additionalProperties, "status") + delete(additionalProperties, "role") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableVLANRequest struct { + value *WritableVLANRequest + isSet bool +} + +func (v NullableWritableVLANRequest) Get() *WritableVLANRequest { + return v.value +} + +func (v *NullableWritableVLANRequest) Set(val *WritableVLANRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableVLANRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableVLANRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableVLANRequest(val *WritableVLANRequest) *NullableWritableVLANRequest { + return &NullableWritableVLANRequest{value: val, isSet: true} +} + +func (v NullableWritableVLANRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableVLANRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vm_interface_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vm_interface_request.go new file mode 100644 index 00000000..db618607 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vm_interface_request.go @@ -0,0 +1,705 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableVMInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableVMInterfaceRequest{} + +// WritableVMInterfaceRequest Adds support for custom fields and tags. +type WritableVMInterfaceRequest struct { + VirtualMachine int32 `json:"virtual_machine"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + Parent NullableInt32 `json:"parent,omitempty"` + Bridge NullableInt32 `json:"bridge,omitempty"` + Mtu NullableInt32 `json:"mtu,omitempty"` + MacAddress NullableString `json:"mac_address,omitempty"` + Description *string `json:"description,omitempty"` + Mode *PatchedWritableInterfaceRequestMode `json:"mode,omitempty"` + UntaggedVlan NullableInt32 `json:"untagged_vlan,omitempty"` + TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + Vrf NullableInt32 `json:"vrf,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableVMInterfaceRequest WritableVMInterfaceRequest + +// NewWritableVMInterfaceRequest instantiates a new WritableVMInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableVMInterfaceRequest(virtualMachine int32, name string) *WritableVMInterfaceRequest { + this := WritableVMInterfaceRequest{} + this.VirtualMachine = virtualMachine + this.Name = name + return &this +} + +// NewWritableVMInterfaceRequestWithDefaults instantiates a new WritableVMInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableVMInterfaceRequestWithDefaults() *WritableVMInterfaceRequest { + this := WritableVMInterfaceRequest{} + return &this +} + +// GetVirtualMachine returns the VirtualMachine field value +func (o *WritableVMInterfaceRequest) GetVirtualMachine() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.VirtualMachine +} + +// GetVirtualMachineOk returns a tuple with the VirtualMachine field value +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetVirtualMachineOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.VirtualMachine, true +} + +// SetVirtualMachine sets field value +func (o *WritableVMInterfaceRequest) SetVirtualMachine(v int32) { + o.VirtualMachine = v +} + +// GetName returns the Name field value +func (o *WritableVMInterfaceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableVMInterfaceRequest) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *WritableVMInterfaceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *WritableVMInterfaceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVMInterfaceRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVMInterfaceRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableVMInterfaceRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableVMInterfaceRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableVMInterfaceRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetBridge returns the Bridge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVMInterfaceRequest) GetBridge() int32 { + if o == nil || IsNil(o.Bridge.Get()) { + var ret int32 + return ret + } + return *o.Bridge.Get() +} + +// GetBridgeOk returns a tuple with the Bridge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVMInterfaceRequest) GetBridgeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Bridge.Get(), o.Bridge.IsSet() +} + +// HasBridge returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasBridge() bool { + if o != nil && o.Bridge.IsSet() { + return true + } + + return false +} + +// SetBridge gets a reference to the given NullableInt32 and assigns it to the Bridge field. +func (o *WritableVMInterfaceRequest) SetBridge(v int32) { + o.Bridge.Set(&v) +} + +// SetBridgeNil sets the value for Bridge to be an explicit nil +func (o *WritableVMInterfaceRequest) SetBridgeNil() { + o.Bridge.Set(nil) +} + +// UnsetBridge ensures that no value is present for Bridge, not even an explicit nil +func (o *WritableVMInterfaceRequest) UnsetBridge() { + o.Bridge.Unset() +} + +// GetMtu returns the Mtu field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVMInterfaceRequest) GetMtu() int32 { + if o == nil || IsNil(o.Mtu.Get()) { + var ret int32 + return ret + } + return *o.Mtu.Get() +} + +// GetMtuOk returns a tuple with the Mtu field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVMInterfaceRequest) GetMtuOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Mtu.Get(), o.Mtu.IsSet() +} + +// HasMtu returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasMtu() bool { + if o != nil && o.Mtu.IsSet() { + return true + } + + return false +} + +// SetMtu gets a reference to the given NullableInt32 and assigns it to the Mtu field. +func (o *WritableVMInterfaceRequest) SetMtu(v int32) { + o.Mtu.Set(&v) +} + +// SetMtuNil sets the value for Mtu to be an explicit nil +func (o *WritableVMInterfaceRequest) SetMtuNil() { + o.Mtu.Set(nil) +} + +// UnsetMtu ensures that no value is present for Mtu, not even an explicit nil +func (o *WritableVMInterfaceRequest) UnsetMtu() { + o.Mtu.Unset() +} + +// GetMacAddress returns the MacAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVMInterfaceRequest) GetMacAddress() string { + if o == nil || IsNil(o.MacAddress.Get()) { + var ret string + return ret + } + return *o.MacAddress.Get() +} + +// GetMacAddressOk returns a tuple with the MacAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVMInterfaceRequest) GetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MacAddress.Get(), o.MacAddress.IsSet() +} + +// HasMacAddress returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasMacAddress() bool { + if o != nil && o.MacAddress.IsSet() { + return true + } + + return false +} + +// SetMacAddress gets a reference to the given NullableString and assigns it to the MacAddress field. +func (o *WritableVMInterfaceRequest) SetMacAddress(v string) { + o.MacAddress.Set(&v) +} + +// SetMacAddressNil sets the value for MacAddress to be an explicit nil +func (o *WritableVMInterfaceRequest) SetMacAddressNil() { + o.MacAddress.Set(nil) +} + +// UnsetMacAddress ensures that no value is present for MacAddress, not even an explicit nil +func (o *WritableVMInterfaceRequest) UnsetMacAddress() { + o.MacAddress.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableVMInterfaceRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableVMInterfaceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *WritableVMInterfaceRequest) GetMode() PatchedWritableInterfaceRequestMode { + if o == nil || IsNil(o.Mode) { + var ret PatchedWritableInterfaceRequestMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetModeOk() (*PatchedWritableInterfaceRequestMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given PatchedWritableInterfaceRequestMode and assigns it to the Mode field. +func (o *WritableVMInterfaceRequest) SetMode(v PatchedWritableInterfaceRequestMode) { + o.Mode = &v +} + +// GetUntaggedVlan returns the UntaggedVlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVMInterfaceRequest) GetUntaggedVlan() int32 { + if o == nil || IsNil(o.UntaggedVlan.Get()) { + var ret int32 + return ret + } + return *o.UntaggedVlan.Get() +} + +// GetUntaggedVlanOk returns a tuple with the UntaggedVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVMInterfaceRequest) GetUntaggedVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.UntaggedVlan.Get(), o.UntaggedVlan.IsSet() +} + +// HasUntaggedVlan returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasUntaggedVlan() bool { + if o != nil && o.UntaggedVlan.IsSet() { + return true + } + + return false +} + +// SetUntaggedVlan gets a reference to the given NullableInt32 and assigns it to the UntaggedVlan field. +func (o *WritableVMInterfaceRequest) SetUntaggedVlan(v int32) { + o.UntaggedVlan.Set(&v) +} + +// SetUntaggedVlanNil sets the value for UntaggedVlan to be an explicit nil +func (o *WritableVMInterfaceRequest) SetUntaggedVlanNil() { + o.UntaggedVlan.Set(nil) +} + +// UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil +func (o *WritableVMInterfaceRequest) UnsetUntaggedVlan() { + o.UntaggedVlan.Unset() +} + +// GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. +func (o *WritableVMInterfaceRequest) GetTaggedVlans() []int32 { + if o == nil || IsNil(o.TaggedVlans) { + var ret []int32 + return ret + } + return o.TaggedVlans +} + +// GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetTaggedVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.TaggedVlans) { + return nil, false + } + return o.TaggedVlans, true +} + +// HasTaggedVlans returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasTaggedVlans() bool { + if o != nil && !IsNil(o.TaggedVlans) { + return true + } + + return false +} + +// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +func (o *WritableVMInterfaceRequest) SetTaggedVlans(v []int32) { + o.TaggedVlans = v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVMInterfaceRequest) GetVrf() int32 { + if o == nil || IsNil(o.Vrf.Get()) { + var ret int32 + return ret + } + return *o.Vrf.Get() +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVMInterfaceRequest) GetVrfOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vrf.Get(), o.Vrf.IsSet() +} + +// HasVrf returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableInt32 and assigns it to the Vrf field. +func (o *WritableVMInterfaceRequest) SetVrf(v int32) { + o.Vrf.Set(&v) +} + +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *WritableVMInterfaceRequest) SetVrfNil() { + o.Vrf.Set(nil) +} + +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *WritableVMInterfaceRequest) UnsetVrf() { + o.Vrf.Unset() +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableVMInterfaceRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableVMInterfaceRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableVMInterfaceRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVMInterfaceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableVMInterfaceRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableVMInterfaceRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableVMInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableVMInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["virtual_machine"] = o.VirtualMachine + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if o.Bridge.IsSet() { + toSerialize["bridge"] = o.Bridge.Get() + } + if o.Mtu.IsSet() { + toSerialize["mtu"] = o.Mtu.Get() + } + if o.MacAddress.IsSet() { + toSerialize["mac_address"] = o.MacAddress.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if o.UntaggedVlan.IsSet() { + toSerialize["untagged_vlan"] = o.UntaggedVlan.Get() + } + if !IsNil(o.TaggedVlans) { + toSerialize["tagged_vlans"] = o.TaggedVlans + } + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableVMInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "virtual_machine", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableVMInterfaceRequest := _WritableVMInterfaceRequest{} + + err = json.Unmarshal(data, &varWritableVMInterfaceRequest) + + if err != nil { + return err + } + + *o = WritableVMInterfaceRequest(varWritableVMInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_machine") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "parent") + delete(additionalProperties, "bridge") + delete(additionalProperties, "mtu") + delete(additionalProperties, "mac_address") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "untagged_vlan") + delete(additionalProperties, "tagged_vlans") + delete(additionalProperties, "vrf") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableVMInterfaceRequest struct { + value *WritableVMInterfaceRequest + isSet bool +} + +func (v NullableWritableVMInterfaceRequest) Get() *WritableVMInterfaceRequest { + return v.value +} + +func (v *NullableWritableVMInterfaceRequest) Set(val *WritableVMInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableVMInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableVMInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableVMInterfaceRequest(val *WritableVMInterfaceRequest) *NullableWritableVMInterfaceRequest { + return &NullableWritableVMInterfaceRequest{value: val, isSet: true} +} + +func (v NullableWritableVMInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableVMInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vrf_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vrf_request.go new file mode 100644 index 00000000..32117ca8 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_vrf_request.go @@ -0,0 +1,523 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableVRFRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableVRFRequest{} + +// WritableVRFRequest Adds support for custom fields and tags. +type WritableVRFRequest struct { + Name string `json:"name"` + // Unique route distinguisher (as defined in RFC 4364) + Rd NullableString `json:"rd,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique *bool `json:"enforce_unique,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + ImportTargets []int32 `json:"import_targets,omitempty"` + ExportTargets []int32 `json:"export_targets,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableVRFRequest WritableVRFRequest + +// NewWritableVRFRequest instantiates a new WritableVRFRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableVRFRequest(name string) *WritableVRFRequest { + this := WritableVRFRequest{} + this.Name = name + return &this +} + +// NewWritableVRFRequestWithDefaults instantiates a new WritableVRFRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableVRFRequestWithDefaults() *WritableVRFRequest { + this := WritableVRFRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableVRFRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableVRFRequest) SetName(v string) { + o.Name = v +} + +// GetRd returns the Rd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVRFRequest) GetRd() string { + if o == nil || IsNil(o.Rd.Get()) { + var ret string + return ret + } + return *o.Rd.Get() +} + +// GetRdOk returns a tuple with the Rd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVRFRequest) GetRdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rd.Get(), o.Rd.IsSet() +} + +// HasRd returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasRd() bool { + if o != nil && o.Rd.IsSet() { + return true + } + + return false +} + +// SetRd gets a reference to the given NullableString and assigns it to the Rd field. +func (o *WritableVRFRequest) SetRd(v string) { + o.Rd.Set(&v) +} + +// SetRdNil sets the value for Rd to be an explicit nil +func (o *WritableVRFRequest) SetRdNil() { + o.Rd.Set(nil) +} + +// UnsetRd ensures that no value is present for Rd, not even an explicit nil +func (o *WritableVRFRequest) UnsetRd() { + o.Rd.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableVRFRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableVRFRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableVRFRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableVRFRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableVRFRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetEnforceUnique returns the EnforceUnique field value if set, zero value otherwise. +func (o *WritableVRFRequest) GetEnforceUnique() bool { + if o == nil || IsNil(o.EnforceUnique) { + var ret bool + return ret + } + return *o.EnforceUnique +} + +// GetEnforceUniqueOk returns a tuple with the EnforceUnique field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetEnforceUniqueOk() (*bool, bool) { + if o == nil || IsNil(o.EnforceUnique) { + return nil, false + } + return o.EnforceUnique, true +} + +// HasEnforceUnique returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasEnforceUnique() bool { + if o != nil && !IsNil(o.EnforceUnique) { + return true + } + + return false +} + +// SetEnforceUnique gets a reference to the given bool and assigns it to the EnforceUnique field. +func (o *WritableVRFRequest) SetEnforceUnique(v bool) { + o.EnforceUnique = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableVRFRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableVRFRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableVRFRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableVRFRequest) SetComments(v string) { + o.Comments = &v +} + +// GetImportTargets returns the ImportTargets field value if set, zero value otherwise. +func (o *WritableVRFRequest) GetImportTargets() []int32 { + if o == nil || IsNil(o.ImportTargets) { + var ret []int32 + return ret + } + return o.ImportTargets +} + +// GetImportTargetsOk returns a tuple with the ImportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetImportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ImportTargets) { + return nil, false + } + return o.ImportTargets, true +} + +// HasImportTargets returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasImportTargets() bool { + if o != nil && !IsNil(o.ImportTargets) { + return true + } + + return false +} + +// SetImportTargets gets a reference to the given []int32 and assigns it to the ImportTargets field. +func (o *WritableVRFRequest) SetImportTargets(v []int32) { + o.ImportTargets = v +} + +// GetExportTargets returns the ExportTargets field value if set, zero value otherwise. +func (o *WritableVRFRequest) GetExportTargets() []int32 { + if o == nil || IsNil(o.ExportTargets) { + var ret []int32 + return ret + } + return o.ExportTargets +} + +// GetExportTargetsOk returns a tuple with the ExportTargets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetExportTargetsOk() ([]int32, bool) { + if o == nil || IsNil(o.ExportTargets) { + return nil, false + } + return o.ExportTargets, true +} + +// HasExportTargets returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasExportTargets() bool { + if o != nil && !IsNil(o.ExportTargets) { + return true + } + + return false +} + +// SetExportTargets gets a reference to the given []int32 and assigns it to the ExportTargets field. +func (o *WritableVRFRequest) SetExportTargets(v []int32) { + o.ExportTargets = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableVRFRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableVRFRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableVRFRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableVRFRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableVRFRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableVRFRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableVRFRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableVRFRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Rd.IsSet() { + toSerialize["rd"] = o.Rd.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.EnforceUnique) { + toSerialize["enforce_unique"] = o.EnforceUnique + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.ImportTargets) { + toSerialize["import_targets"] = o.ImportTargets + } + if !IsNil(o.ExportTargets) { + toSerialize["export_targets"] = o.ExportTargets + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableVRFRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableVRFRequest := _WritableVRFRequest{} + + err = json.Unmarshal(data, &varWritableVRFRequest) + + if err != nil { + return err + } + + *o = WritableVRFRequest(varWritableVRFRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "rd") + delete(additionalProperties, "tenant") + delete(additionalProperties, "enforce_unique") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "import_targets") + delete(additionalProperties, "export_targets") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableVRFRequest struct { + value *WritableVRFRequest + isSet bool +} + +func (v NullableWritableVRFRequest) Get() *WritableVRFRequest { + return v.value +} + +func (v *NullableWritableVRFRequest) Set(val *WritableVRFRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableVRFRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableVRFRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableVRFRequest(val *WritableVRFRequest) *NullableWritableVRFRequest { + return &NullableWritableVRFRequest{value: val, isSet: true} +} + +func (v NullableWritableVRFRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableVRFRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_lan_group_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_lan_group_request.go new file mode 100644 index 00000000..af7524a3 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_lan_group_request.go @@ -0,0 +1,354 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableWirelessLANGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableWirelessLANGroupRequest{} + +// WritableWirelessLANGroupRequest Extends PrimaryModelSerializer to include MPTT support. +type WritableWirelessLANGroupRequest struct { + Name string `json:"name"` + Slug string `json:"slug"` + Parent NullableInt32 `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableWirelessLANGroupRequest WritableWirelessLANGroupRequest + +// NewWritableWirelessLANGroupRequest instantiates a new WritableWirelessLANGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableWirelessLANGroupRequest(name string, slug string) *WritableWirelessLANGroupRequest { + this := WritableWirelessLANGroupRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewWritableWirelessLANGroupRequestWithDefaults instantiates a new WritableWirelessLANGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableWirelessLANGroupRequestWithDefaults() *WritableWirelessLANGroupRequest { + this := WritableWirelessLANGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WritableWirelessLANGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WritableWirelessLANGroupRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *WritableWirelessLANGroupRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANGroupRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *WritableWirelessLANGroupRequest) SetSlug(v string) { + o.Slug = v +} + +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableWirelessLANGroupRequest) GetParent() int32 { + if o == nil || IsNil(o.Parent.Get()) { + var ret int32 + return ret + } + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableWirelessLANGroupRequest) GetParentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// HasParent returns a boolean if a field has been set. +func (o *WritableWirelessLANGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. +func (o *WritableWirelessLANGroupRequest) SetParent(v int32) { + o.Parent.Set(&v) +} + +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableWirelessLANGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} + +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableWirelessLANGroupRequest) UnsetParent() { + o.Parent.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableWirelessLANGroupRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANGroupRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableWirelessLANGroupRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableWirelessLANGroupRequest) SetDescription(v string) { + o.Description = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableWirelessLANGroupRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANGroupRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableWirelessLANGroupRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableWirelessLANGroupRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableWirelessLANGroupRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANGroupRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableWirelessLANGroupRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableWirelessLANGroupRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableWirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableWirelessLANGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableWirelessLANGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableWirelessLANGroupRequest := _WritableWirelessLANGroupRequest{} + + err = json.Unmarshal(data, &varWritableWirelessLANGroupRequest) + + if err != nil { + return err + } + + *o = WritableWirelessLANGroupRequest(varWritableWirelessLANGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "parent") + delete(additionalProperties, "description") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableWirelessLANGroupRequest struct { + value *WritableWirelessLANGroupRequest + isSet bool +} + +func (v NullableWritableWirelessLANGroupRequest) Get() *WritableWirelessLANGroupRequest { + return v.value +} + +func (v *NullableWritableWirelessLANGroupRequest) Set(val *WritableWirelessLANGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableWirelessLANGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableWirelessLANGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableWirelessLANGroupRequest(val *WritableWirelessLANGroupRequest) *NullableWritableWirelessLANGroupRequest { + return &NullableWritableWirelessLANGroupRequest{value: val, isSet: true} +} + +func (v NullableWritableWirelessLANGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableWirelessLANGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_lan_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_lan_request.go new file mode 100644 index 00000000..649de483 --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_lan_request.go @@ -0,0 +1,606 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableWirelessLANRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableWirelessLANRequest{} + +// WritableWirelessLANRequest Adds support for custom fields and tags. +type WritableWirelessLANRequest struct { + Ssid string `json:"ssid"` + Description *string `json:"description,omitempty"` + Group NullableInt32 `json:"group,omitempty"` + Status *PatchedWritableWirelessLANRequestStatus `json:"status,omitempty"` + Vlan NullableInt32 `json:"vlan,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + AuthType *AuthenticationType1 `json:"auth_type,omitempty"` + AuthCipher *AuthenticationCipher `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableWirelessLANRequest WritableWirelessLANRequest + +// NewWritableWirelessLANRequest instantiates a new WritableWirelessLANRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableWirelessLANRequest(ssid string) *WritableWirelessLANRequest { + this := WritableWirelessLANRequest{} + this.Ssid = ssid + return &this +} + +// NewWritableWirelessLANRequestWithDefaults instantiates a new WritableWirelessLANRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableWirelessLANRequestWithDefaults() *WritableWirelessLANRequest { + this := WritableWirelessLANRequest{} + return &this +} + +// GetSsid returns the Ssid field value +func (o *WritableWirelessLANRequest) GetSsid() string { + if o == nil { + var ret string + return ret + } + + return o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetSsidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Ssid, true +} + +// SetSsid sets field value +func (o *WritableWirelessLANRequest) SetSsid(v string) { + o.Ssid = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableWirelessLANRequest) SetDescription(v string) { + o.Description = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableWirelessLANRequest) GetGroup() int32 { + if o == nil || IsNil(o.Group.Get()) { + var ret int32 + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableWirelessLANRequest) GetGroupOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableInt32 and assigns it to the Group field. +func (o *WritableWirelessLANRequest) SetGroup(v int32) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *WritableWirelessLANRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *WritableWirelessLANRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetStatus() PatchedWritableWirelessLANRequestStatus { + if o == nil || IsNil(o.Status) { + var ret PatchedWritableWirelessLANRequestStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetStatusOk() (*PatchedWritableWirelessLANRequestStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PatchedWritableWirelessLANRequestStatus and assigns it to the Status field. +func (o *WritableWirelessLANRequest) SetStatus(v PatchedWritableWirelessLANRequestStatus) { + o.Status = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableWirelessLANRequest) GetVlan() int32 { + if o == nil || IsNil(o.Vlan.Get()) { + var ret int32 + return ret + } + return *o.Vlan.Get() +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableWirelessLANRequest) GetVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Vlan.Get(), o.Vlan.IsSet() +} + +// HasVlan returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasVlan() bool { + if o != nil && o.Vlan.IsSet() { + return true + } + + return false +} + +// SetVlan gets a reference to the given NullableInt32 and assigns it to the Vlan field. +func (o *WritableWirelessLANRequest) SetVlan(v int32) { + o.Vlan.Set(&v) +} + +// SetVlanNil sets the value for Vlan to be an explicit nil +func (o *WritableWirelessLANRequest) SetVlanNil() { + o.Vlan.Set(nil) +} + +// UnsetVlan ensures that no value is present for Vlan, not even an explicit nil +func (o *WritableWirelessLANRequest) UnsetVlan() { + o.Vlan.Unset() +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableWirelessLANRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableWirelessLANRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableWirelessLANRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableWirelessLANRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableWirelessLANRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetAuthType() AuthenticationType1 { + if o == nil || IsNil(o.AuthType) { + var ret AuthenticationType1 + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetAuthTypeOk() (*AuthenticationType1, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthenticationType1 and assigns it to the AuthType field. +func (o *WritableWirelessLANRequest) SetAuthType(v AuthenticationType1) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetAuthCipher() AuthenticationCipher { + if o == nil || IsNil(o.AuthCipher) { + var ret AuthenticationCipher + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetAuthCipherOk() (*AuthenticationCipher, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given AuthenticationCipher and assigns it to the AuthCipher field. +func (o *WritableWirelessLANRequest) SetAuthCipher(v AuthenticationCipher) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *WritableWirelessLANRequest) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableWirelessLANRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableWirelessLANRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableWirelessLANRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLANRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableWirelessLANRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableWirelessLANRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableWirelessLANRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableWirelessLANRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ssid"] = o.Ssid + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Vlan.IsSet() { + toSerialize["vlan"] = o.Vlan.Get() + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableWirelessLANRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "ssid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableWirelessLANRequest := _WritableWirelessLANRequest{} + + err = json.Unmarshal(data, &varWritableWirelessLANRequest) + + if err != nil { + return err + } + + *o = WritableWirelessLANRequest(varWritableWirelessLANRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "ssid") + delete(additionalProperties, "description") + delete(additionalProperties, "group") + delete(additionalProperties, "status") + delete(additionalProperties, "vlan") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableWirelessLANRequest struct { + value *WritableWirelessLANRequest + isSet bool +} + +func (v NullableWritableWirelessLANRequest) Get() *WritableWirelessLANRequest { + return v.value +} + +func (v *NullableWritableWirelessLANRequest) Set(val *WritableWirelessLANRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableWirelessLANRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableWirelessLANRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableWirelessLANRequest(val *WritableWirelessLANRequest) *NullableWritableWirelessLANRequest { + return &NullableWritableWirelessLANRequest{value: val, isSet: true} +} + +func (v NullableWritableWirelessLANRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableWirelessLANRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_link_request.go b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_link_request.go new file mode 100644 index 00000000..3aa8dedb --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/model_writable_wireless_link_request.go @@ -0,0 +1,576 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the WritableWirelessLinkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WritableWirelessLinkRequest{} + +// WritableWirelessLinkRequest Adds support for custom fields and tags. +type WritableWirelessLinkRequest struct { + InterfaceA int32 `json:"interface_a"` + InterfaceB int32 `json:"interface_b"` + Ssid *string `json:"ssid,omitempty"` + Status *CableStatusValue `json:"status,omitempty"` + Tenant NullableInt32 `json:"tenant,omitempty"` + AuthType *AuthenticationType1 `json:"auth_type,omitempty"` + AuthCipher *AuthenticationCipher `json:"auth_cipher,omitempty"` + AuthPsk *string `json:"auth_psk,omitempty"` + Description *string `json:"description,omitempty"` + Comments *string `json:"comments,omitempty"` + Tags []NestedTagRequest `json:"tags,omitempty"` + CustomFields map[string]interface{} `json:"custom_fields,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WritableWirelessLinkRequest WritableWirelessLinkRequest + +// NewWritableWirelessLinkRequest instantiates a new WritableWirelessLinkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWritableWirelessLinkRequest(interfaceA int32, interfaceB int32) *WritableWirelessLinkRequest { + this := WritableWirelessLinkRequest{} + this.InterfaceA = interfaceA + this.InterfaceB = interfaceB + return &this +} + +// NewWritableWirelessLinkRequestWithDefaults instantiates a new WritableWirelessLinkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWritableWirelessLinkRequestWithDefaults() *WritableWirelessLinkRequest { + this := WritableWirelessLinkRequest{} + return &this +} + +// GetInterfaceA returns the InterfaceA field value +func (o *WritableWirelessLinkRequest) GetInterfaceA() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InterfaceA +} + +// GetInterfaceAOk returns a tuple with the InterfaceA field value +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetInterfaceAOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceA, true +} + +// SetInterfaceA sets field value +func (o *WritableWirelessLinkRequest) SetInterfaceA(v int32) { + o.InterfaceA = v +} + +// GetInterfaceB returns the InterfaceB field value +func (o *WritableWirelessLinkRequest) GetInterfaceB() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InterfaceB +} + +// GetInterfaceBOk returns a tuple with the InterfaceB field value +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetInterfaceBOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InterfaceB, true +} + +// SetInterfaceB sets field value +func (o *WritableWirelessLinkRequest) SetInterfaceB(v int32) { + o.InterfaceB = v +} + +// GetSsid returns the Ssid field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetSsid() string { + if o == nil || IsNil(o.Ssid) { + var ret string + return ret + } + return *o.Ssid +} + +// GetSsidOk returns a tuple with the Ssid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetSsidOk() (*string, bool) { + if o == nil || IsNil(o.Ssid) { + return nil, false + } + return o.Ssid, true +} + +// HasSsid returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasSsid() bool { + if o != nil && !IsNil(o.Ssid) { + return true + } + + return false +} + +// SetSsid gets a reference to the given string and assigns it to the Ssid field. +func (o *WritableWirelessLinkRequest) SetSsid(v string) { + o.Ssid = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetStatus() CableStatusValue { + if o == nil || IsNil(o.Status) { + var ret CableStatusValue + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetStatusOk() (*CableStatusValue, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given CableStatusValue and assigns it to the Status field. +func (o *WritableWirelessLinkRequest) SetStatus(v CableStatusValue) { + o.Status = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WritableWirelessLinkRequest) GetTenant() int32 { + if o == nil || IsNil(o.Tenant.Get()) { + var ret int32 + return ret + } + return *o.Tenant.Get() +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WritableWirelessLinkRequest) GetTenantOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Tenant.Get(), o.Tenant.IsSet() +} + +// HasTenant returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasTenant() bool { + if o != nil && o.Tenant.IsSet() { + return true + } + + return false +} + +// SetTenant gets a reference to the given NullableInt32 and assigns it to the Tenant field. +func (o *WritableWirelessLinkRequest) SetTenant(v int32) { + o.Tenant.Set(&v) +} + +// SetTenantNil sets the value for Tenant to be an explicit nil +func (o *WritableWirelessLinkRequest) SetTenantNil() { + o.Tenant.Set(nil) +} + +// UnsetTenant ensures that no value is present for Tenant, not even an explicit nil +func (o *WritableWirelessLinkRequest) UnsetTenant() { + o.Tenant.Unset() +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetAuthType() AuthenticationType1 { + if o == nil || IsNil(o.AuthType) { + var ret AuthenticationType1 + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetAuthTypeOk() (*AuthenticationType1, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthenticationType1 and assigns it to the AuthType field. +func (o *WritableWirelessLinkRequest) SetAuthType(v AuthenticationType1) { + o.AuthType = &v +} + +// GetAuthCipher returns the AuthCipher field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetAuthCipher() AuthenticationCipher { + if o == nil || IsNil(o.AuthCipher) { + var ret AuthenticationCipher + return ret + } + return *o.AuthCipher +} + +// GetAuthCipherOk returns a tuple with the AuthCipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetAuthCipherOk() (*AuthenticationCipher, bool) { + if o == nil || IsNil(o.AuthCipher) { + return nil, false + } + return o.AuthCipher, true +} + +// HasAuthCipher returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasAuthCipher() bool { + if o != nil && !IsNil(o.AuthCipher) { + return true + } + + return false +} + +// SetAuthCipher gets a reference to the given AuthenticationCipher and assigns it to the AuthCipher field. +func (o *WritableWirelessLinkRequest) SetAuthCipher(v AuthenticationCipher) { + o.AuthCipher = &v +} + +// GetAuthPsk returns the AuthPsk field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetAuthPsk() string { + if o == nil || IsNil(o.AuthPsk) { + var ret string + return ret + } + return *o.AuthPsk +} + +// GetAuthPskOk returns a tuple with the AuthPsk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetAuthPskOk() (*string, bool) { + if o == nil || IsNil(o.AuthPsk) { + return nil, false + } + return o.AuthPsk, true +} + +// HasAuthPsk returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasAuthPsk() bool { + if o != nil && !IsNil(o.AuthPsk) { + return true + } + + return false +} + +// SetAuthPsk gets a reference to the given string and assigns it to the AuthPsk field. +func (o *WritableWirelessLinkRequest) SetAuthPsk(v string) { + o.AuthPsk = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *WritableWirelessLinkRequest) SetDescription(v string) { + o.Description = &v +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *WritableWirelessLinkRequest) SetComments(v string) { + o.Comments = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetTags() []NestedTagRequest { + if o == nil || IsNil(o.Tags) { + var ret []NestedTagRequest + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetTagsOk() ([]NestedTagRequest, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []NestedTagRequest and assigns it to the Tags field. +func (o *WritableWirelessLinkRequest) SetTags(v []NestedTagRequest) { + o.Tags = v +} + +// GetCustomFields returns the CustomFields field value if set, zero value otherwise. +func (o *WritableWirelessLinkRequest) GetCustomFields() map[string]interface{} { + if o == nil || IsNil(o.CustomFields) { + var ret map[string]interface{} + return ret + } + return o.CustomFields +} + +// GetCustomFieldsOk returns a tuple with the CustomFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WritableWirelessLinkRequest) GetCustomFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CustomFields) { + return map[string]interface{}{}, false + } + return o.CustomFields, true +} + +// HasCustomFields returns a boolean if a field has been set. +func (o *WritableWirelessLinkRequest) HasCustomFields() bool { + if o != nil && !IsNil(o.CustomFields) { + return true + } + + return false +} + +// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field. +func (o *WritableWirelessLinkRequest) SetCustomFields(v map[string]interface{}) { + o.CustomFields = v +} + +func (o WritableWirelessLinkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WritableWirelessLinkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["interface_a"] = o.InterfaceA + toSerialize["interface_b"] = o.InterfaceB + if !IsNil(o.Ssid) { + toSerialize["ssid"] = o.Ssid + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Tenant.IsSet() { + toSerialize["tenant"] = o.Tenant.Get() + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.AuthCipher) { + toSerialize["auth_cipher"] = o.AuthCipher + } + if !IsNil(o.AuthPsk) { + toSerialize["auth_psk"] = o.AuthPsk + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.CustomFields) { + toSerialize["custom_fields"] = o.CustomFields + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WritableWirelessLinkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "interface_a", + "interface_b", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWritableWirelessLinkRequest := _WritableWirelessLinkRequest{} + + err = json.Unmarshal(data, &varWritableWirelessLinkRequest) + + if err != nil { + return err + } + + *o = WritableWirelessLinkRequest(varWritableWirelessLinkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "interface_a") + delete(additionalProperties, "interface_b") + delete(additionalProperties, "ssid") + delete(additionalProperties, "status") + delete(additionalProperties, "tenant") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "auth_cipher") + delete(additionalProperties, "auth_psk") + delete(additionalProperties, "description") + delete(additionalProperties, "comments") + delete(additionalProperties, "tags") + delete(additionalProperties, "custom_fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWritableWirelessLinkRequest struct { + value *WritableWirelessLinkRequest + isSet bool +} + +func (v NullableWritableWirelessLinkRequest) Get() *WritableWirelessLinkRequest { + return v.value +} + +func (v *NullableWritableWirelessLinkRequest) Set(val *WritableWirelessLinkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWritableWirelessLinkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWritableWirelessLinkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWritableWirelessLinkRequest(val *WritableWirelessLinkRequest) *NullableWritableWirelessLinkRequest { + return &NullableWritableWirelessLinkRequest{value: val, isSet: true} +} + +func (v NullableWritableWirelessLinkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWritableWirelessLinkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/readme.md b/vendor/github.com/netbox-community/go-netbox/v3/readme.md new file mode 100644 index 00000000..632a1a2b --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/readme.md @@ -0,0 +1,134 @@ +# go-netbox + +[![GoDoc](https://pkg.go.dev/badge/github.com/netbox-community/go-netbox/v3)](https://pkg.go.dev/github.com/netbox-community/go-netbox/v3) [![Build Status](https://github.com/netbox-community/go-netbox/workflows/main/badge.svg?branch=master)](https://github.com/netbox-community/go-netbox/actions) [![Report Card](https://goreportcard.com/badge/github.com/netbox-community/go-netbox)](https://goreportcard.com/report/github.com/netbox-community/go-netbox) + +_go-netbox_ is —to nobody's surprise— the official [Go](https://go.dev) API client for the [Netbox](https://github.com/netbox-community/netbox) IPAM and DCIM service. + +This project follows [Semantic Versioning](https://semver.org). The version of the library built for a Netbox version has the same tag, followed by a hyphen and the build number (an incremental integer), as several versions of the library may exist for the same version of Netbox. + +## Installation + +Use `go get` to add the library as a dependency to your project. Do not forget to run `go mod init` first if necessary. + +```shell +go get github.com/netbox-community/go-netbox/v3 + +# Or install a specific version +go get github.com/netbox-community/go-netbox/v3@v3.7.1-0 +``` + +**Note:** dependencies should be managed with [Go modules](https://go.dev/doc/modules/managing-dependencies). + +## Usage + +### Instantiate the client + +The package has a constructor for creating a client by providing a URL and an authentication token. + +```golang +package main + +import ( + "context" + "log" + + "github.com/netbox-community/go-netbox/v3" +) + +func main() { + ctx := context.Background() + + c := netbox.NewAPIClientFor("https://demo.netbox.dev", "v3ry$3cr3t") + + log.Printf("%+v", c) +} + +``` + +### Use the client + +With the client already instantiated, it is possible to consume any API feature. + +For example, to list the first 10 active virtual machines: + +```golang +package main + +import ( + "context" + "log" + + "github.com/netbox-community/go-netbox/v3" +) + +func main() { + ctx := context.Background() + + c := netbox.NewAPIClientFor("https://demo.netbox.dev", "v3ry$3cr3t") + + res, _, err := c.VirtualizationAPI. + VirtualizationVirtualMachinesList(ctx). + Status([]string{"active"}). + Limit(10). + Execute() + + if err != nil { + log.Fatal(err) + } + + log.Printf("%v", res.Results) +} +``` + +See [docs](docs) or [reference](https://pkg.go.dev/github.com/netbox-community/go-netbox) for more information on all possible usages. + +## Development + +The project comes with a containerized development environment that may be used on any platform. It is only required to have [Git](https://git-scm.com) and [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or, separately, [Docker](https://docs.docker.com/engine/install) and [Docker Compose](https://docs.docker.com/compose/install/)) installed on the machine. + +To start the development environment, run the following command. + +```bash +make +``` + +Then, to attach a shell in the container, run the command below. + +```bash +make shell +``` + +Finally, to stop the development environment, run the following command. + +```bash +make down +``` + +### Considerations + +The library is entirely generated from the Netbox [OpenAPI](https://www.openapis.org/) specification using _[openapi-generator](https://github.com/OpenAPITools/openapi-generator)_. Therefore, files listed [here](.openapi-generator/files) should not be directly modified, as they will be overwritten in the next regeneration (see next section). + +In order to fix a bug in the generated code, the corresponding error in the OpenAPI spec must be fixed. To do so, the following steps may be followed: + +1. Optional. Patch the OpenAPI spec in this repo by editing [this script](scripts/fix-spec.py), so that a corrected version can be published as soon as possible. +2. Fix the OpenAPI spec in the [Netbox repository](https://github.com/netbox-community/netbox), either by reporting an issue or by creating a pull request. + +### Regenerate the library + +To update the OpenAPI specification to the latest Netbox version and regenerate the library, run the following command. + +```bash +make build +``` + +If regeneration of the library is needed for a specific Netbox version other than the latest one, pass the corresponding argument. + +```bash +make build NETBOX_VERSION=3.0.0 +``` + +In order to obtain the OpenAPI specification, the version of _[netbox-docker](https://github.com/netbox-community/netbox-docker)_ corresponding to the given Netbox version is used. However, it is also possible to provide a specific version of _netbox-docker_. + +```bash +make build NETBOX_VERSION=3.0.0 NETBOX_DOCKER_VERSION=1.3.1 +``` diff --git a/vendor/github.com/netbox-community/go-netbox/v3/response.go b/vendor/github.com/netbox-community/go-netbox/v3/response.go new file mode 100644 index 00000000..0fd6adff --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/response.go @@ -0,0 +1,47 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/vendor/github.com/netbox-community/go-netbox/v3/utils.go b/vendor/github.com/netbox-community/go-netbox/v3/utils.go new file mode 100644 index 00000000..1b1080bf --- /dev/null +++ b/vendor/github.com/netbox-community/go-netbox/v3/utils.go @@ -0,0 +1,347 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 2235268a..e80ed0e9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -23,6 +23,9 @@ github.com/fatih/color # github.com/fatih/structs v1.1.0 ## explicit github.com/fatih/structs +# github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a +## explicit; go 1.13 +github.com/gocarina/gocsv # github.com/golang/protobuf v1.5.3 ## explicit; go 1.9 github.com/golang/protobuf/proto